WO2016119624A1 - Data transmission method and apparatus thereof - Google Patents
Data transmission method and apparatus thereof Download PDFInfo
- Publication number
- WO2016119624A1 WO2016119624A1 PCT/CN2016/071550 CN2016071550W WO2016119624A1 WO 2016119624 A1 WO2016119624 A1 WO 2016119624A1 CN 2016071550 W CN2016071550 W CN 2016071550W WO 2016119624 A1 WO2016119624 A1 WO 2016119624A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- radio frame
- packet length
- data
- bit
- sequence corresponding
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
Definitions
- the present application relates to the field, and in particular, to a data transmission method and apparatus thereof.
- the terminal device can access the Internet through the access device, thereby implementing remote control or management of the terminal device.
- Different terminal devices can also be connected to the access device to access the wireless network, such as accessing the wireless local area network.
- the terminal device may be a mobile phone, or a smart home device, or an embedded device.
- the access device may be a wireless router or a home gateway or a mobile terminal.
- the terminal device can be connected to the access device by using a wireless access method. For example, a Wi-Fi module can be set on the terminal device, and the access device is connected through the Wi-Fi mode.
- the terminal device needs to obtain the account information of the wireless local area network, and use the account information to establish a connection with the access device.
- the account information of the wireless local area network may include an SSID (Service Set Identifier) and an access password of the wireless local area network.
- SSID Service Set Identifier
- the terminal device such as most smart home devices or embedded devices, does not have input devices such as a keyboard and a screen, it cannot input the account information of the wireless local area network by manual input, and can only obtain wireless by interacting with other devices.
- LAN account information is carried in the frame body (also called the payload) portion of the radio frame, and the data carried by the payload portion of the radio frame is encrypted.
- the data carried by the payload portion of the wireless frame cannot be decrypted, so the account information of the wireless local area network cannot be obtained, and thus the access device cannot be connected, and the wireless local area network cannot be accessed.
- An embodiment of the present application provides a data transmission method and an apparatus thereof for implementing transmission of data by a bit sequence corresponding to a packet length of a radio frame, so that a receiver can acquire a required bit sequence according to a packet length of a radio frame. data.
- a bit sequence corresponding to a packet length of the radio frame includes a sequence number field and a data field, where the number of bits in the sequence number field is at least greater than 3;
- the data carried by the bit sequence corresponding to the packet length of the radio frame is determined according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame.
- the sequence includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
- a receiving module configured to receive a wireless frame
- a first determining module configured to determine a packet length of the radio frame, where a bit sequence corresponding to a packet length of the radio frame includes a sequence number field and a data field, where the number of bits in the sequence number field is at least greater than 3;
- a second determining module configured to determine, according to a value of a sequence number field and/or a bit field of a data field in a bit sequence corresponding to a packet length of the radio frame, whether a bit sequence corresponding to a packet length of the radio frame is used Carrying data;
- a third determining module configured to determine, according to a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame, in a case that the second determining module determines to be YES The data carried by the bit sequence corresponding to the packet length.
- An acquiring module configured to acquire data that needs to be carried by a bit sequence corresponding to a packet length of a radio frame
- a determining module configured to determine, according to the acquired data, a bit sequence corresponding to a packet length of the radio frame, so that the data field in the bit sequence corresponding to the packet length of the radio frame carries the data, where the radio frame
- the bit sequence corresponding to the packet length includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
- a generating module configured to generate the radio frame according to a packet length of the radio frame
- a sending module configured to send the wireless frame.
- the receiver can acquire the required data according to the bit sequence corresponding to the packet length of the radio frame. .
- the sender can send the account information of the wireless local area network to the receiver according to the bit sequence corresponding to the packet length of the wireless frame, so that the receiver obtains the account information of the wireless local area network, thereby enabling wireless access. local area network.
- the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is greater than 3 since the sequence number field in the bit sequence corresponding to the packet length can be used to identify the sequence number of the radio frame in the group, the length is passed.
- the sequence number field is such that each packet contains a larger number of radio frames, that is, a radio frame as a packet interval can be transmitted every time a larger number of radio frames are separated, and the number of radio frames as a packet interval is smaller. The more it is possible to reduce the reception efficiency of the receiver due to the loss of the radio frame as the packet interval.
- FIG. 1 is a schematic structural diagram of a radio frame in the prior art
- FIG. 2 is a schematic diagram of distribution of data frames and packet frames in an embodiment of the present application
- FIG. 3 is a schematic diagram of a format of a bit sequence corresponding to a packet length of a radio frame according to an embodiment of the present disclosure
- FIG. 4 is a schematic flowchart of a data transmission method of a receiver according to an embodiment of the present disclosure
- FIG. 5 is a schematic diagram of carrying a plurality of byte data by using a bit sequence corresponding to a packet length of a plurality of data frames according to an embodiment of the present disclosure
- FIG. 6 is a schematic flowchart of a data transmission method of a sender according to an embodiment of the present disclosure
- FIG. 7 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present disclosure.
- FIG. 8 is a second schematic structural diagram of a data sending apparatus according to an embodiment of the present disclosure.
- the terminal device cannot establish communication directly with other devices in the wireless network, such as mobile phones, before accessing the wireless network, nor can it access the Internet through the access device.
- the Wi-Fi module of the terminal device can enter the listening mode, and in the listening mode, the wireless frame sent by the peripheral device can be monitored.
- the payload part of the radio frame is encrypted. If the terminal device cannot decrypt the payload part, the data carried by the payload part cannot be obtained, but the packet length of the entire radio frame can be calculated, and the packet of the radio frame can be calculated.
- the length is the total length of the radio frame. According to this feature, the implementation of the present application provides a data transmission scheme.
- the sender transmits the data to be transmitted in a bit sequence corresponding to the packet length of the radio frame, and after receiving the radio frame, the receiver calculates the packet length of the radio frame, according to the packet.
- the long corresponding bit sequence can acquire the required data.
- a mobile terminal such as a mobile phone
- a sender data transmission device such as a mobile phone
- a smart home device or an embedded device that does not have an input device such as a keyboard and a screen is used as a receiver.
- a data transmission device wherein the sender data transmission device carries an access password of the wireless local area network through a bit sequence corresponding to a packet length of the radio frame, and the receiver data transmission device calculates a packet length of the radio frame according to the received radio frame, according to the packet length
- the corresponding bit sequence acquires a wireless local area network access password, thereby accessing the wireless local area network according to the access password, thereby solving the problem that the smart home device or the embedded device accesses the wireless local area network.
- the radio frame described in the embodiment of the present application follows a wireless communication protocol.
- This document describes an example in which a radio frame follows the 802.11 series protocol.
- the radio frame described below is a radio frame that complies with the 802.11 series protocol, unless otherwise stated.
- FIG. 1 exemplarily shows the structure of a radio frame defined by the 802.11 protocol.
- the frame header part carries control information, protocol information, and address information
- the frame entity part is a payload part of the radio frame, and is used to carry data content.
- the FCS (Frame Check Sequence) field is used to carry the frame check. Information to ensure the integrity of the wireless frame.
- the total length occupied by the frame header portion, the frame entity portion, and the FCS portion is called the packet length of the radio frame.
- the packet length of the radio frame can be calculated by the application layer of the receiver data transmission device.
- radio frame described in the embodiment of the present application is not limited to the structure shown in FIG. 1.
- Radio frames can be transmitted in packets, and multiple radio frames can be included in one packet.
- a radio frame in one packet is referred to as a data frame.
- a radio frame needs to be sent between two packets for interval.
- a radio frame inserted between two packets is referred to as a packet frame.
- the packet frame is used to control the starting position of the next packet, that is, the data frame for synchronizing the next packet. The location to prevent the receiver from being out of order.
- the bit sequence corresponding to the packet length is used to carry data, such as an account for accessing the wireless network; and the bit sequence corresponding to the packet length of the packet frame is used to carry the packet number. .
- radio frame classification defined by the 802.11 protocol or other communication protocols.
- FIG. 2 exemplarily shows the distribution of data frames and packet frames.
- a radio frame that needs to carry data by using a bit sequence corresponding to a packet length for example, a radio frame that needs to use a bit sequence corresponding to a packet length to carry an access password of a wireless local area network, and a packet of the radio frame.
- the format of the long corresponding bit sequence is defined.
- the bit sequence corresponding to the packet length may include a sequence number field and a data field.
- the radio frame is a data frame
- the value of the bit field in the bit sequence corresponding to the packet length is used to indicate the sequence number of the data frame in the packet to which it belongs, and the value of the bit in the data field is used to indicate that The data carried by the bit sequence corresponding to the packet length;
- the radio frame is a packet frame
- the value of the bit field in the bit sequence corresponding to the packet length may be used as the identifier of the packet frame, and the value of the bit in the data field Used to indicate the group number.
- the sequence number field in the bit sequence corresponding to the packet length of the radio frame in the embodiment of the present application may be located in the high bit position portion of the bit sequence corresponding to the packet length, and the data field in the bit sequence corresponding to the packet length may be located.
- the low bit portion of the bit sequence corresponding to the packet length may be located.
- the packet length of a radio frame is usually less than 1500 bytes due to the limitation of the length of the MTU (the maximum transmission unit of the data packet agreed upon by the communication protocol), and the hexadecimal representation of the decimal 1500 is 0x5DC, and the 11-bit width is used. It can be used to indicate the packet length, that is, the bit sequence corresponding to the packet length of the radio frame has a length of at least 11 bits.
- the bit sequence length corresponding to the packet length of the radio frame is 11 bits.
- the bit sequence corresponding to the packet length is used for the radio frame that needs to carry the data with the bit sequence corresponding to the packet length.
- the upper 4 bits are used as the sequence number field, and the lower 7 bits of the bit sequence corresponding to the packet length are used as the data field.
- the value of 4 bits is ⁇ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 ⁇ , expressed as [0,15].
- the range of values is represented by [a1, a2], the lower limit of the range is a1, the upper limit is a2, and a1 and a2 are included, that is, an integer ranging from a1 to a2.
- the value of the upper 4 bits is [0, 11].
- the radio frame may generate interference with other radio frames, which is disadvantageous for the data reception of the receiver. Therefore, in the embodiment of the present application, the value of the sequence number field is used. 0 can be excluded from the range.
- a sequence number field corresponding to a packet length has a value range of [1, 10]; for a packet frame, a packet length corresponds to a bit sequence.
- the range of the sequence number field is [11].
- the value range of the 7-bit data field is [0, 127].
- the value range of the sequence number field in the bit sequence corresponding to the packet length of the data frame does not overlap with the value range of the sequence number field in the bit sequence corresponding to the packet length of the packet frame, and therefore may correspond to the packet length.
- the value of the bit field of the sequence number field in the bit sequence distinguishes between the data frame and the packet frame.
- data that needs to be carried by using a bit sequence corresponding to a packet length may be an ASCII character, such as account information of a wireless local area network. Since the valid ASCII characters of the data are only a subset of the ASCII character set, the ASCII characters in the subset have a value range of [32, 126].
- the sequence number field in the bit sequence corresponding to the packet length of the data frame and the packet frame may be adopted by the following solutions.
- the value range of the data field is defined.
- the data frame is represented by Fram_data
- the packet frame is represented by Fram_group
- the sequence number field in the bit sequence corresponding to the packet length is represented by field_index
- the bit corresponding to the packet length is represented by field_data.
- the data field in the sequence is represented by Fram_data
- Fram_data field_index has a value range of [1, 10], and field_data has a value range of [32, 126].
- Fram_group takes any integer in the range [11, 15], preferably takes a value of 11, and field_data takes the value range [0, 31].
- the sender data transmission device can directly determine the binary value of the ASCII character.
- the value of the bit of the data field in the bit sequence corresponding to the packet length is received, and the data transmission means of the receiver can directly obtain the corresponding ASCII character according to the value of the bit of the data field in the bit sequence corresponding to the packet length.
- Fram_data field_index has a value range of [1, 11], a preferred range is [1, 10], and field_data has a value range of [0, 94].
- Fram_group takes any integer within the range [1, 11], preferably takes a value of 11, and field_data takes the range [95,126]
- the sender data transmission device may subtract the value corresponding to the ASCII character by 32, and take the value corresponding to the subtracted value as the bit of the data field in the bit sequence corresponding to the packet length.
- the value of the data transmission device of the receiver can add 32 bits of the data field in the bit sequence corresponding to the packet length, and obtain the corresponding ASCII character according to the value obtained after the addition.
- the definition scheme of the value range of the above sequence number field and the data field is only an example, and the embodiment of the present application is not limited to the above solution.
- the value range of the sequence number field in the bit sequence corresponding to the packet length of the data frame and the packet frame is allowed to overlap, but the value range of the data field cannot overlap, so that the data can be distinguished according to the value range of the data field.
- Frame and packet frame; or, the range of values of the data fields in the bit sequence corresponding to the packet length of the data frame and the packet frame are allowed to overlap, but the value range of the sequence number field cannot overlap, and thus, according to the sequence number field
- the range of values is used to distinguish between data frames and packet frames.
- FIG. 3a and FIG. 3b exemplarily show that the length of the bit sequence corresponding to the packet length is 11 bits, and the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- the packet length of the radio frame corresponds to the format of the bit sequence.
- FIG. 3a exemplarily shows the format of a bit sequence corresponding to the packet length of the data frame, and the data field in the bit sequence corresponding to the packet length of one data frame can be used to carry an ASCII character.
- Fig. 3b exemplarily shows the format of a bit sequence corresponding to the packet length of a packet frame.
- the sequence number field of the bit sequence corresponding to the packet length of the data frame occupies 4 bits of the high bit portion of the bit sequence, and the value range is defined as [1, 10], and the data field occupies the bit sequence.
- the 7 bits of the low bit portion are in the range [32, 126].
- the format definition of the bit sequence corresponding to the packet length of the data frame can be expressed as:
- the data field in the bit sequence corresponding to the packet length of a data frame can carry one byte of data, such as an ASCII character.
- the sequence number field in the bit sequence corresponding to the packet length of the packet frame occupies 4 bits of the high bit portion of the bit sequence, and the defined value is fixed to 11, and the data field occupies the low bit portion of the bit sequence. 7 bits, the value range is [0, 31].
- the format definition of the bit sequence corresponding to the packet length of the packet frame can be expressed as:
- len represents the packet length of the packet frame
- fixed_index represents the fixed sequence number used by the packet frame, and the value is 11
- base_index represents the packet number, and the value range is [0, 31].
- the packet according to the radio frame can be The value of the bit of the data field in the long corresponding bit sequence distinguishes between the data frame and the packet frame.
- the data frame and the packet frame may be distinguished according to the value of the bit field of the sequence number field.
- the above description is only taking the length of the bit sequence corresponding to the packet length of the radio frame as 11 bits.
- the length of the bit sequence corresponding to the packet length of the radio frame may also be greater than 11 bits.
- the bit sequence corresponding to the packet length The high N bit in the middle can be used as the sequence number field, and N is an integer greater than 4 in the bit sequence.
- the lower M bits can be used as the data field, and M is an integer greater than or equal to 7.
- FIG. 4 is a schematic diagram of a flow of a data transmission method according to an embodiment of the present application. This flow describes the processing of the data receiver, which can be performed by the data transmission device as the data receiver.
- the data transmission device is provided with a wireless module, such as a Wi-Fi module, capable of receiving and processing radio frames.
- the data transmission device may be a smart home device or an embedded device.
- the process can include the following steps:
- Step 401 Receive a radio frame.
- Step 402 Determine a packet length of the radio frame; a bit sequence corresponding to a packet length of the radio frame includes a sequence number field and a data field, and the bit number of the sequence number field is at least greater than 3;
- Step 403 Determine, according to the value of the sequence number field and/or the bit field of the data field in the bit sequence corresponding to the packet length of the radio frame, whether the bit sequence corresponding to the packet length of the radio frame is used to carry data.
- Step 404 If the determination is yes, determining the data carried by the bit sequence corresponding to the packet length of the radio frame according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame.
- step 403 if it is determined in step 403 that the bit sequence corresponding to the packet length of the radio frame is used to carry the packet number, data reception and ordering may be performed according to the radio frame.
- the structure of the bit sequence corresponding to the packet length can be as described above.
- the sequence number field in the bit sequence corresponding to the packet length is located in the high bit portion of the bit sequence
- the data field in the bit sequence corresponding to the packet length is located in the low bit portion of the bit sequence.
- the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- step 401 since the wireless module is disposed in the data transmission device, the wireless frame transmitted by the peripheral device can be monitored.
- the data transmission apparatus as the receiver can calculate the packet length of the radio frame at the application layer, thereby obtaining a bit sequence corresponding to the packet length.
- the data frame and the packet frame may be distinguished according to the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length, or may be determined according to the value of the bit field of the data field in the bit sequence corresponding to the packet length.
- the data transmission device may determine whether the radio frame is a data frame in one of the following manners:
- Mode 1 If the value of the bit field in the bit sequence corresponding to the packet length of the radio frame is within the first value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry data, The value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is used to identify the sequence number of the radio frame in the group to which the radio frame belongs.
- the bit corresponding to the packet length of the radio frame is within the second value range or is the first value, determining the bit corresponding to the packet length of the radio frame
- the sequence is used to carry a packet number, where the second value range does not overlap with the first value range, and the first value is not in the first value range.
- the format of the bit sequence corresponding to the packet length of the radio frame shown in FIG. 3a and FIG. 3b is taken as an example, if the bit length of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is [1] In the range of 10, the radio frame is determined to be a data frame. If the bit length of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is 11, the radio frame is determined to be a packet frame.
- Mode 2 If the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the third value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry data,
- the third value range is a value range corresponding to data that needs to be carried by a bit sequence corresponding to a packet length of the radio frame.
- a fixed value is selected as the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the packet frame.
- the fourth value range is a value range of the packet sequence number, and the third value range does not overlap with the fourth value range.
- the format of the bit sequence corresponding to the packet length of the radio frame shown in FIG. 3a and FIG. 3b is For example, if the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the range of [32, 126], it is determined that the radio frame is a data frame, if the packet length of the radio frame is in the bit sequence corresponding to If the value of the bit of the data field is in the range [0, 31], it is determined that the radio frame is a packet frame.
- the data transmission apparatus as the receiver may determine data carried by the bit sequence corresponding to the packet length of the data frame by using a data field in a bit sequence corresponding to the packet length of the data frame. The value of the bit is determined, and the corresponding ASCII character is determined, and the determined ASCII character is determined as data carried by the bit sequence corresponding to the packet length of the data frame.
- the data field in the bit sequence corresponding to the packet length of a data frame can usually carry one byte, such as an ASCII character. If the data carried by the bit sequence corresponding to the packet length needs to contain multiple bytes, such as multiple ASCII characters, Then, the bit sequence corresponding to the packet length of the corresponding number of data frames can be used to carry the data of the multiple bytes.
- FIG. 5 exemplarily shows a schematic diagram of carrying a plurality of byte data by a bit sequence corresponding to a packet length of a plurality of data frames, where byte 1 to byte n represent data to be transmitted through a packet length of the radio frame, For example, a byte can represent an ASCII character.
- the value of the bit of the sequence number field in the bit sequence corresponding to the packet length of the data frame may be determined by using the value of the bit field in the bit sequence corresponding to the packet length of the data frame.
- the order of the data frames splicing the data carried by the bit sequences corresponding to the packet lengths of the data frames in this order, thereby solving the problem of inaccurate data caused by the disorder of receiving the wireless frames.
- the data transmission apparatus as the receiver may determine the sequence number of the data frame in the belonging packet according to the value of the bit position of the sequence number field in the bit sequence corresponding to the packet length of the data frame, according to the data frame in the group to which the data frame belongs.
- the sequence number determines the position of the data carried by the data field in the bit sequence corresponding to the packet length of the data frame in the entire data sequence.
- the data transmission apparatus as the receiver may determine the packet number according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the packet frame, and determine the absolute value of the data in the entire data sequence according to the packet number. Position, or determine the starting offset of the next packet data.
- the data transmission device as the receiver analyzes the data, one can be determined according to the following formula.
- the final location of the data is the following formula.
- pos represents the final location of the packet and group_nums represents the number of data frames within a packet.
- the receiver determines the final location of the data based on base_index and index.
- the foregoing embodiment may be applied to a scenario of wireless network access, in which the data that needs to be carried by the bit sequence corresponding to the packet length of the radio frame may include: an account for performing wireless network access.
- Information, or access password of the wireless network such as an access password of a wireless local area network.
- the receiver can acquire the required data according to the bit sequence corresponding to the packet length of the radio frame. .
- the sender can send the account information of the wireless local area network to the receiver according to the bit sequence corresponding to the packet length of the wireless frame, so that the receiver obtains the account information of the wireless local area network, thereby enabling wireless access. local area network.
- the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is greater than 3 since the sequence number field in the bit sequence corresponding to the packet length can be used to identify the sequence number of the radio frame in the group, the length is passed.
- the sequence number field is such that each packet contains a larger number of radio frames, that is, a radio frame as a packet interval can be transmitted every time a larger number of radio frames are separated, and the number of radio frames as a packet interval is smaller. The more it is possible to reduce the reception efficiency of the receiver due to the loss of the radio frame as the packet interval.
- each time 10 data frames are transmitted one packet frame needs to be transmitted, and a total of 10 packet frames are required.
- the number of bits of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is less than or equal to 3, for example equal to 3, 25 packet frames are required.
- the determination of the location of the data frame is crucial to the receiver, because the wireless frame transmission process is easy to lose, and it is difficult for the receiver to collect the information at a time. In the cyclic receiving process, each time a data is received, the location of the data needs to be determined.
- the embodiment of the present application reduces the number of packet frames, and thus can be guaranteed to a certain extent. Receiver's reception reliability.
- FIG. 6 is a schematic diagram of a flow of a data transmission method according to an embodiment of the present application. This flow describes the processing of the data sender, which can be performed by the data transmission device as the data sender.
- the data transmission device is provided with a wireless module, such as a Wi-Fi module, capable of transmitting and processing radio frames.
- the data transmission device may be a mobile terminal or may be a wireless router or a home gateway or the like.
- the process may include the following steps:
- Step 601 Acquire data that needs to be carried by a bit sequence corresponding to a packet length of the radio frame.
- Step 602 Determine, according to the acquired data, a bit sequence corresponding to a packet length of the radio frame, so that a data field in a bit sequence corresponding to a packet length of the radio frame carries the data, where a packet length of the radio frame
- the corresponding bit sequence includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
- Step 603 Generate the radio frame according to a packet length of the radio frame.
- Step 604 Send the radio frame.
- the structure of the bit sequence corresponding to the packet length can be as described above.
- the sequence number field is located in the high bit portion of the bit sequence corresponding to the packet length
- the data field is located in the low bit portion of the bit sequence corresponding to the packet length.
- the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- the data transmission device as the sender can acquire data that needs to be carried by the bit sequence corresponding to the packet length of the radio frame, and the data can be one byte in a byte sequence, such as in an ASCII string.
- An ASCII character An ASCII character.
- the data transmission apparatus as the sender may convert the data carried by the bit sequence corresponding to the packet length of the radio frame into a value corresponding to the ASCII character, according to the value corresponding to the converted ASCII character. Determining a value of a data field in a bit sequence corresponding to a packet length of the radio frame, so that a data field in a bit sequence corresponding to a packet length of the radio frame carries the data.
- the data transmission apparatus as the sender can generate a radio frame of a corresponding length according to the bit sequence corresponding to the packet length determined in step 602.
- the header portion of a wireless frame The length of the frame check portion is fixed, so that the length of the generated frame portion can be made equal to the length represented by the bit sequence corresponding to the packet length determined in step 602 by adjusting the length of the frame entity portion.
- the data transmission apparatus as the sender may further determine the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame according to the sequence number of the radio frame in the belonging packet.
- the value of the bit in the sequence number field is in the first value range, the first value range does not overlap with the second value range, or the first value range does not include the first value a value, wherein, if the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the second value range or is the first value, the packet length of the radio frame corresponds to
- the bits of the data field in the bit sequence are used to carry the packet number.
- the data transmission apparatus as the sender can set the packet length according to the sequence number of the current data frame in the belonging packet.
- the value of the bit of the sequence number field in the bit sequence is combined with the value of the bit of the data field in the bit sequence to obtain the value of the bit sequence, that is, the packet length of the current data frame.
- the data transmission apparatus as the sender may further transmit the following radio frame before or after transmitting the radio frame: the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is taken in the fourth Within the value range, the fourth value range is a value range of the packet sequence number, the fourth value range does not overlap with the third value range, and the third value range is a packet that needs to use a radio frame. The range of values corresponding to the data carried by the corresponding bit sequence.
- the packet number of the packet frame the packet number is determined.
- the value ranges from [0, 31], and the value of the bit of the data field in the bit sequence corresponding to the packet length of the packet frame is set according to the packet number.
- the value of the bit field of the sequence number in the bit sequence corresponding to the packet length of the packet frame is set to 11 or set to any integer within the range of [11, 16], so as to identify the radio frame as a packet frame.
- the bit range of the data field in the bit sequence corresponding to the packet length of the data frame is [32, 126], and the ratio of the data field in the bit sequence corresponding to the packet length of the packet frame.
- the range of values of the special bits does not overlap.
- the data field in the bit sequence corresponding to the packet length of a data frame can usually carry one byte, such as an ASCII character. If the data carried by the bit sequence corresponding to the packet length needs to contain multiple bytes, such as multiple ASCII characters, Then, the bit sequence corresponding to the packet length of the corresponding number of data frames can be used to carry the data of the multiple bytes.
- FIG. 5 exemplarily shows a schematic diagram of carrying a plurality of byte data by a bit sequence corresponding to a packet length of a plurality of data frames, where byte 1 to byte n represent data to be transmitted through a packet length of the radio frame, For example, a byte can represent an ASCII character.
- the foregoing embodiment may be applied to a scenario of wireless network access, in which the data that needs to be carried by the bit sequence corresponding to the packet length of the radio frame may include: an account for performing wireless network access.
- Information, or access password of the wireless network such as an access password of a wireless local area network.
- the receiver can acquire the required data according to the bit sequence corresponding to the packet length of the radio frame. .
- the sender can send the account information of the wireless local area network to the receiver according to the bit sequence corresponding to the packet length of the wireless frame, so that the receiver obtains the account information of the wireless local area network, thereby enabling wireless access. local area network.
- the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is greater than 3 since the sequence number field in the bit sequence corresponding to the packet length can be used to identify the sequence number of the radio frame in the group, the length is passed.
- the sequence number field is such that each packet contains a larger number of radio frames, that is, a radio frame as a packet interval can be transmitted every time a larger number of radio frames are separated, and the number of radio frames as a packet interval is smaller. The more it is possible to reduce the reception efficiency of the receiver due to the loss of the radio frame as the packet interval.
- the data includes, but is not limited to, the number of data bytes (ie, the total length), the flag (flag), the length of the SSID, the SSID, the length of the access password, the access password, the frame check sequence, and the like.
- the number of data bytes (total length), the flag (flag), the length of the SSID, and the length of the access password can occupy 1 byte respectively, and the frame check sequence can occupy 2 bytes, SSID and access.
- the password can occupy multiple bytes each.
- sequence of flag bits of the radio frame can be defined as follows:
- Bit6 to bit5 reserved field
- Bit4 to bit3 protocol version, current version 00;
- Bit2 to bit1 payload information encryption mode, 00 means no encryption, 01 means stream cipher;
- Bit0 Whether to include the SSID.
- bit sequence format corresponding to the packet length of the radio frame shown in FIG. 3a and FIG. 3b is taken as an example to describe the packet length of the radio frame in the scenario of wireless network access.
- the corresponding bit sequence carries the process of accessing account information for the wireless local area network.
- the scenario is: the smart home device obtains the account information of the wireless local area network through the mobile terminal to access the wireless local area network.
- an application is installed on the mobile terminal, and the function of the application is that the account information of the wireless local area network can be sent through the bit sequence corresponding to the packet length of the wireless frame in the manner of the foregoing embodiment of the present application.
- a corresponding application is installed on the smart home device, and the function of the application is that the wireless frame can be received in the manner of the foregoing embodiment of the present application, and the account information of the wireless local area network carried by the bit sequence corresponding to the packet length of the wireless frame is obtained.
- the mobile terminal After the application installed on the mobile terminal and the smart home device is turned on, the mobile terminal acquires account information of the wireless local area network, where the account information includes: the SSID is 1234, and the access password is abcd.
- the account information can be obtained by the mobile terminal in various ways, for example, the account information is cached on the mobile terminal or the account information is manually input.
- the mobile terminal sequentially transmits 18 radio frames, wherein each 10 radio frames transmits a radio frame for spacing packets.
- the sender and the receiver may agree that the bit sequences corresponding to the packet lengths of the second to fifth radio frames are respectively used to carry the total length information, the length of the flag, the SSID, the length information of the access password, and the subsequent wireless.
- the bit sequence corresponding to the packet length of the frame is used to transmit the ASCII character of the SSID and the access code in turn, and the bit sequence corresponding to the packet length of the last two radio frames is used to carry the frame check sequence.
- the radio frames sent by the sender include:
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 1 is 1011, and the value of the bit in the data field is 0000000, and the value indicates the packet number of the first packet;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 2 is 0001, and the value of the bit in the data field is 0001110.
- the value represents the total length information, and the decimal value is 14 because of the total length.
- Information, flag, SSID length information, access password length information, frame check sequence, SSID of 4 ASCII characters, and access codes of 4 ASCII characters occupy a total of 14 bytes;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 3 is 0010, and the value of the bit in the data field is 0000000, which represents the value of the flag flag bit;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 4 is 0011, and the value of the bit in the data field is 0000100, which indicates that the SSID is composed of 4 ASCII characters;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 5 is 0100, and the value of the bit in the data field is 0000100, which indicates that the access password is composed of 4 ASCII characters;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 6 is 0101, and the value of the bit in the data field is 0110001, which indicates that the first ASCII character of the SSID is 1;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 7 is 0110, and the value of the bit in the data field is 0110010, which indicates that the second ASCII character of the SSID is 2;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 8 is 0111, and the value of the bit in the data field is 0110011, which indicates that the third ASCII character of the SSID is 3;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 9 is 1000, and the value of the bit in the data field is 0110100, which indicates that the fourth ASCII character of the SSID is 4;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 10 is 1001, and the value of the bit in the data field is 1100001, which indicates that the first ASCII character of the access password is a;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 11 is 1010, and the value of the bit in the data field is 1100010, which indicates that the second ASCII character of the access password is b;
- the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame 12 is 1011, and the number is The value of the bit of the field is 0000010, and the value represents the packet number of the second packet;
- the bit length of the sequence number corresponding to the packet length of the radio frame 13 is 0001, and the value of the bit of the data field is 1100011, which indicates that the third ASCII character of the access password is c;
- the value of the bit field in the bit sequence corresponding to the packet length of the radio frame 14 is 0010, and the value of the bit in the data field is 1100100, which indicates that the fourth ASCII character of the access password is d;
- bit length of the sequence number field in the bit sequence corresponding to the packet length of the radio frame 15 is 0011, and the bit value of the data field is a check value of 7 bits;
- the bit length of the sequence number field in the bit sequence corresponding to the packet length of the radio frame 16 is 0100, and the bit value of the data field is a check value of 7 bits.
- the smart home device After receiving the wireless frame, the smart home device separately calculates the packet length of each radio frame, converts the value of the packet length into a binary sequence, and according to the bit length of the data field in the binary sequence corresponding to the packet length of each data frame.
- the value of the corresponding length information, flag, frame check sequence, and ASCII characters of the SSID and the access code are obtained, and the value of the bit field in the binary sequence corresponding to the packet length of the data frame and the packet frame are The value of the bit of the data field in the binary sequence corresponding to the packet length determines the assembly order of the ASCII characters of the SSID and the access password, thereby obtaining the complete SSID and the access password, and thus the account information can be used to access the wireless local area network. .
- the embodiment of the present application further provides a data transmission device as a data receiver, and a data transmission device as a data sender.
- FIG. 7 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application.
- the data transmission device can act as a data receiver to perform the aforementioned data transmission process.
- the data transmission device is provided with a wireless module, such as a Wi-Fi module, capable of receiving and processing radio frames.
- the data transmission device may be a smart home device or an embedded device.
- the data transmission device may include: a receiving module 701, a first determining module 702, a second determining module 703, and a third determining module 704, where:
- the receiving module 701 is configured to receive a radio frame.
- the first determining module 702 is configured to determine a packet length of the radio frame, where a packet length of the radio frame corresponds to The bit sequence includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
- the second determining module 703 is configured to determine, according to the value of the sequence number field and/or the bit field of the data field in the bit sequence corresponding to the packet length of the radio frame, whether the bit sequence corresponding to the packet length of the radio frame is used.
- the third determining module 704 is configured to determine, according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame, in the case that the second determining module 703 determines that the value is YES.
- the sequence number field is located in a high-bit portion of a bit sequence corresponding to a packet length, and the data field is located in a low-bit portion of a bit sequence corresponding to a packet length.
- the radio frame is a radio frame defined by the 802.11 protocol, where the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- the data carried by the bit sequence corresponding to the packet length of the radio frame includes: account information used for performing wireless network access, or an access password of the wireless network.
- the third determining module 704 is specifically configured to: determine an ASCII character according to a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame, and determine the determined ASCII character as the wireless The data carried by the bit sequence corresponding to the packet length of the frame.
- the second determining module 703 is specifically configured to: if the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the first value range, determine the packet of the radio frame The bit sequence corresponding to the long bit is used to carry data, wherein the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is used to identify the sequence number of the radio frame in the belonging packet.
- the second determining module 703 is further configured to: if the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the second value range or is the first value, determine The bit sequence corresponding to the packet length of the radio frame is used to carry the packet number, where the second value range does not overlap with the first value range, and the first value is not in the first value.
- the second determining module 703 is specifically configured to: if the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is within a third value range, determine the packet of the radio frame Long pair
- the bit sequence is used to carry data
- the third value range is a value range corresponding to data to be carried by the bit sequence corresponding to the packet length of the radio frame.
- the second determining module 703 is further configured to determine, if the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is within a fourth value range, determine a packet length of the radio frame.
- the corresponding bit sequence is used to carry the packet number
- the fourth value range is the value range of the packet sequence number
- the third value range does not overlap with the fourth value range.
- FIG. 8 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application.
- the data transmission device can act as a data sender to perform the aforementioned data transmission process.
- the data transmission device is provided with a wireless module, such as a Wi-Fi module, capable of transmitting and processing radio frames.
- the data transmission device may be a mobile terminal or may be a wireless router or a home gateway or the like.
- the apparatus may include: an obtaining module 801, a determining module 802, a generating module 803, and a sending module 804, where:
- the obtaining module 801 is configured to acquire data that needs to be carried by a bit sequence corresponding to a packet length of the radio frame;
- a determining module 802 configured to determine, according to the acquired data, a bit sequence corresponding to a packet length of the radio frame, so that the data field in the bit sequence corresponding to the packet length of the radio frame carries the data, where the radio frame
- the bit sequence corresponding to the packet length includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
- the generating module 803 is configured to generate the radio frame according to a packet length of the radio frame
- the sending module 804 is configured to send the radio frame.
- the sequence number field is located in a high-bit portion of a bit sequence corresponding to a packet length, and the data field is located in a low-bit portion of a bit sequence corresponding to a packet length.
- the radio frame is a radio frame defined by the 802.11 protocol, where the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- the data that needs to be carried by the bit sequence corresponding to the packet length of the radio frame includes: account information for performing wireless network access, or an access password of the wireless network.
- the determining module 802 is specifically configured to: convert the acquired data into an ASCII character pair.
- the value of the data field in the bit sequence corresponding to the packet length of the radio frame is determined according to the value corresponding to the converted ASCII character, so that the data in the bit sequence corresponding to the packet length of the radio frame is determined.
- the domain carries the data.
- the determining module 802 is further configured to: determine, according to the sequence number of the radio frame in the belonging packet, a value of a bit field in a bit sequence corresponding to a packet length of the radio frame, where the bit number in the sequence number field The value of the bit is in the first value range, the first value range does not overlap with the second value range, or the first value range does not include the first value, where the radio frame If the value of the bit of the sequence number field in the bit sequence corresponding to the packet length is within the second value range or is the first value, the data field in the bit sequence corresponding to the packet length of the radio frame The bits are used to carry the packet number.
- the sending module 804 may be further configured to: send a radio frame before or after transmitting the radio frame: a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame is at a fourth value
- the fourth value range is a value range of the packet sequence number
- the fourth value range does not overlap with the third value range
- the third value range is a packet length of the radio frame to be used. The range of values corresponding to the data carried by the corresponding bit sequence.
- the receiver can acquire the required data according to the bit sequence corresponding to the packet length of the radio frame.
- the sender can send the account information of the wireless local area network to the receiver according to the bit sequence corresponding to the packet length of the wireless frame, so that the receiver obtains the account information of the wireless local area network, thereby enabling wireless access. local area network.
- the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is greater than 3 since the sequence number field in the bit sequence corresponding to the packet length can be used to identify the sequence number of the radio frame in the group, the length is passed.
- the sequence number field is such that each packet contains a larger number of radio frames, that is, a radio frame as a packet interval can be transmitted every time a larger number of radio frames are separated, and the number of radio frames as a packet interval is smaller. The more it is possible to reduce the reception efficiency of the receiver due to the loss of the radio frame as the packet interval.
- the present application is made with reference to a method, a device (system), and a computer program according to an embodiment of the present application.
- the flow chart and/or block diagram of the product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
- These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Disclosed in the present application are a data transmission method and an apparatus thereof, and the method comprises: receiving a wireless frame; determining the packet length of the wireless frame, and the bit sequence corresponding to the packet length of the wireless frame includes a serial number domain and a data domain, and the bit number of the serial number domain is at least greater than 3; determining whether the bit sequence corresponding to the packet length of the wireless frame is used to carry data according to the bit value of the serial number domain and/or the data domain in the bit sequence corresponding to the packet length of the wireless frame; if it is, determining the data carried by the bit sequence corresponding to the packet length of the wireless frame according to the bit value of the data domain in the bit sequence corresponding to the packet length of the wireless frame. The application could realize data transmission through the bit sequence corresponding to the packet length of the wireless frame, such that the receiving side could obtain the required data by parsing according to the packet length information of the wireless frame.
Description
本申请涉及领域,尤其涉及一种数据传输方法及其装置。The present application relates to the field, and in particular, to a data transmission method and apparatus thereof.
终端设备可以通过接入设备接入互联网,从而实现终端设备的远程控制或管理。不同的终端设备也可以与接入设备连接,以接入无线网络,比如接入无线局域网。所述终端设备可以是手机,或者是智能家居设备,或者是嵌入式设备等;所述接入设备可以是无线路由器或者是家庭网关或者是移动终端等。所述终端设备可以采用无线接入方式与所述接入设备连接,比如,终端设备上可设置Wi-Fi模块,通过Wi-Fi方式与接入设备连接。The terminal device can access the Internet through the access device, thereby implementing remote control or management of the terminal device. Different terminal devices can also be connected to the access device to access the wireless network, such as accessing the wireless local area network. The terminal device may be a mobile phone, or a smart home device, or an embedded device. The access device may be a wireless router or a home gateway or a mobile terminal. The terminal device can be connected to the access device by using a wireless access method. For example, a Wi-Fi module can be set on the terminal device, and the access device is connected through the Wi-Fi mode.
终端设备需要获得无线局域网的账户信息,使用该账户信息才能与接入设备建立连接。无线局域网的账户信息可包括无线局域网的SSID(Service Set Identifier,服务集标识)和接入密码。The terminal device needs to obtain the account information of the wireless local area network, and use the account information to establish a connection with the access device. The account information of the wireless local area network may include an SSID (Service Set Identifier) and an access password of the wireless local area network.
如果终端设备,比如大部分智能家居设备或者是嵌入式设备,由于没有键盘和屏幕等输入装置,因此无法通过人工输入方式输入无线局域网的账户信息,只能借助于与其它设备进行交互来获取无线局域网的账户信息。但是,根据802.11协议,无线局域网的账户信息,尤其是接入密码,是承载在无线帧的帧体(也称为载荷)部分的,而无线帧的载荷部分所承载的数据是经过加密的,对于没有键盘和屏幕的终端设备来说,则无法解密得到无线帧的载荷部分所承载的数据,因此无法获得无线局域网的账户信息,进而无法与接入设备连接,无法接入无线局域网。If the terminal device, such as most smart home devices or embedded devices, does not have input devices such as a keyboard and a screen, it cannot input the account information of the wireless local area network by manual input, and can only obtain wireless by interacting with other devices. LAN account information. However, according to the 802.11 protocol, the account information of the WLAN, especially the access password, is carried in the frame body (also called the payload) portion of the radio frame, and the data carried by the payload portion of the radio frame is encrypted. For a terminal device without a keyboard and a screen, the data carried by the payload portion of the wireless frame cannot be decrypted, so the account information of the wireless local area network cannot be obtained, and thus the access device cannot be connected, and the wireless local area network cannot be accessed.
由此可见,目前亟需一种能够在不用解析无线帧的载荷部分也能获得需要的数据的解决方案。
It can be seen that there is a need for a solution that can obtain the required data without having to parse the payload portion of the radio frame.
申请内容Application content
本申请的实施例提供了一种数据传输方法及其装置,用于实现通过无线帧的包长对应的比特序列传输数据,以使接收方能够根据无线帧的包长对应的比特序列获取需要的数据。An embodiment of the present application provides a data transmission method and an apparatus thereof for implementing transmission of data by a bit sequence corresponding to a packet length of a radio frame, so that a receiver can acquire a required bit sequence according to a packet length of a radio frame. data.
本申请实施例提供的一种数据传输方法,包括:A data transmission method provided by an embodiment of the present application includes:
接收无线帧;Receiving a radio frame;
确定所述无线帧的包长,所述无线帧的包长对应的比特序列包括序号域和数据域,所述序号域的比特位数至少大于3;Determining a packet length of the radio frame, where a bit sequence corresponding to a packet length of the radio frame includes a sequence number field and a data field, where the number of bits in the sequence number field is at least greater than 3;
根据所述无线帧的包长对应的比特序列中的序号域和/或数据域的比特位的取值,确定所述无线帧的包长对应的比特序列是否用来承载数据;Determining, according to the value of the sequence number field and/or the bit field of the data field in the bit sequence corresponding to the packet length of the radio frame, whether the bit sequence corresponding to the packet length of the radio frame is used to carry data;
若确定为是,则根据所述无线帧的包长对应的比特序列中的数据域的比特位的取值,确定所述无线帧的包长对应的比特序列所承载的数据。If the determination is yes, the data carried by the bit sequence corresponding to the packet length of the radio frame is determined according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame.
本申请另一实施例提供的一种数据传输方法,包括:A data transmission method provided by another embodiment of the present application includes:
获取需要由无线帧的包长对应的比特序列承载的数据;Obtaining data that needs to be carried by a bit sequence corresponding to a packet length of the radio frame;
根据获取到的数据,确定无线帧的包长对应的比特序列,使所述无线帧的包长对应的比特序列中的数据域承载所述数据,其中,所述无线帧的包长对应的比特序列中包含序号域和数据域,所述序号域的比特位数至少大于3;Determining, according to the obtained data, a bit sequence corresponding to a packet length of the radio frame, and causing the data field in the bit sequence corresponding to the packet length of the radio frame to carry the data, where a bit corresponding to a packet length of the radio frame The sequence includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
根据所述无线帧的包长生成所述无线帧;Generating the radio frame according to a packet length of the radio frame;
发送所述无线帧。Sending the radio frame.
本申请实施例提供的数据传输装置,包括:The data transmission device provided by the embodiment of the present application includes:
接收模块,用于接收无线帧;a receiving module, configured to receive a wireless frame;
第一确定模块,用于确定所述无线帧的包长,所述无线帧的包长对应的比特序列包括序号域和数据域,所述序号域的比特位数至少大于3;a first determining module, configured to determine a packet length of the radio frame, where a bit sequence corresponding to a packet length of the radio frame includes a sequence number field and a data field, where the number of bits in the sequence number field is at least greater than 3;
第二确定模块,用于根据所述无线帧的包长对应的比特序列中的序号域和/或数据域的比特位的取值,确定所述无线帧的包长对应的比特序列是否用来承载数据;
a second determining module, configured to determine, according to a value of a sequence number field and/or a bit field of a data field in a bit sequence corresponding to a packet length of the radio frame, whether a bit sequence corresponding to a packet length of the radio frame is used Carrying data;
第三确定模块,用于在所述第二确定模块确定为是的情况下,根据所述无线帧的包长对应的比特序列中的数据域的比特位的取值,确定所述无线帧的包长对应的比特序列所承载的数据。a third determining module, configured to determine, according to a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame, in a case that the second determining module determines to be YES The data carried by the bit sequence corresponding to the packet length.
本申请另一实施例提供的一种数据传输装置,包括:A data transmission apparatus provided by another embodiment of the present application includes:
获取模块,用于获取需要由无线帧的包长对应的比特序列承载的数据;An acquiring module, configured to acquire data that needs to be carried by a bit sequence corresponding to a packet length of a radio frame;
确定模块,用于根据获取到的数据,确定无线帧的包长对应的比特序列,使所述无线帧的包长对应的比特序列中的数据域承载所述数据,其中,所述无线帧的包长对应的比特序列中包含序号域和数据域,所述序号域的比特位数至少大于3;a determining module, configured to determine, according to the acquired data, a bit sequence corresponding to a packet length of the radio frame, so that the data field in the bit sequence corresponding to the packet length of the radio frame carries the data, where the radio frame The bit sequence corresponding to the packet length includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
生成模块,用于根据所述无线帧的包长生成所述无线帧;;a generating module, configured to generate the radio frame according to a packet length of the radio frame;
发送模块,用于发送所述无线帧。And a sending module, configured to send the wireless frame.
本申请的上述实施例中,由于通过无线帧的包长对应的比特序列的数据域承载需要发送给接入方的数据,使得接收方能够根据无线帧的包长对应的比特序列获取需要的数据。尤其在接入无线局域网的场景下,发送方可将无线局域网的账户信息承载在无线帧的包长对应的比特序列发送给接收方,使得接收方获得无线局域网的账户信息,从而可接入无线局域网。另外,由于无线帧的包长对应的比特序列中的序号域的比特位数大于3,由于包长对应的比特序列中的序号域可用来标识无线帧在所在分组内的序号,因此通过该长度的序号域,使得每个分组内包含较多数量的无线帧,也就是说,可以每间隔较多数量的无线帧发送一个作为分组间隔的无线帧,而作为分组间隔的无线帧的数量越少,越能降低因作为分组间隔的无线帧丢失而导致的对接收方接收效率的影响。In the foregoing embodiment of the present application, since the data domain of the bit sequence corresponding to the packet length of the radio frame carries data that needs to be sent to the access side, the receiver can acquire the required data according to the bit sequence corresponding to the packet length of the radio frame. . Especially in the scenario of accessing the wireless local area network, the sender can send the account information of the wireless local area network to the receiver according to the bit sequence corresponding to the packet length of the wireless frame, so that the receiver obtains the account information of the wireless local area network, thereby enabling wireless access. local area network. In addition, since the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is greater than 3, since the sequence number field in the bit sequence corresponding to the packet length can be used to identify the sequence number of the radio frame in the group, the length is passed. The sequence number field is such that each packet contains a larger number of radio frames, that is, a radio frame as a packet interval can be transmitted every time a larger number of radio frames are separated, and the number of radio frames as a packet interval is smaller. The more it is possible to reduce the reception efficiency of the receiver due to the loss of the radio frame as the packet interval.
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提
下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following drawings will be briefly described in the description of the embodiments. It is obvious that the drawings in the following description are only some embodiments of the present application, A person of ordinary skill in the art, without premise of creative labor
Further drawings can also be obtained from these figures.
图1为本现有技术中无线帧的结构示意图;1 is a schematic structural diagram of a radio frame in the prior art;
图2为本申请实施例中数据帧和分组帧的分布示意图;2 is a schematic diagram of distribution of data frames and packet frames in an embodiment of the present application;
图3a和图3b分别为本申请实施例提供的无线帧的包长对应的比特序列的格式示意图;FIG. 3 is a schematic diagram of a format of a bit sequence corresponding to a packet length of a radio frame according to an embodiment of the present disclosure;
图4为本申请实施例提供的接收方的数据传输方法流程示意图;4 is a schematic flowchart of a data transmission method of a receiver according to an embodiment of the present disclosure;
图5为本申请实施例提供的用多个数据帧的包长对应的比特序列承载多个字节数据的示意图;FIG. 5 is a schematic diagram of carrying a plurality of byte data by using a bit sequence corresponding to a packet length of a plurality of data frames according to an embodiment of the present disclosure;
图6为本申请实施例提供的发送方的数据传输方法流程示意图;FIG. 6 is a schematic flowchart of a data transmission method of a sender according to an embodiment of the present disclosure;
图7为本申请实施例提供的数据传输装置的结构示意图之一;FIG. 7 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present disclosure;
图8为本申请实施例提供的数据发送装置的结构示意图之二。FIG. 8 is a second schematic structural diagram of a data sending apparatus according to an embodiment of the present disclosure.
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,显然,所描述的实施例仅仅是本申请一部份实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。The present application will be further described in detail below with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, but not all embodiments. . All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
下面介绍的是本申请的多个实施例中的一部份,旨在提供对本申请的基本了解,并不旨在确认本申请的关键或决定性要素或限定所要保护的范围。根据本申请的技术方案,在不变更本申请的实质精神下,可以相互替换而得到其它的实现方式。The following is a description of some of the various embodiments of the present application, which are intended to provide a basic understanding of the application, and are not intended to identify key or critical elements of the application or the scope of the invention. According to the technical solution of the present application, other implementations can be obtained by replacing each other without changing the spirit of the present application.
如前所述,终端设备在未接入无线网络之前,无法与无线网络中的其它设备如手机,直接建立通信,也无法通过接入设备接入互联网。但是,终端设备的Wi-Fi模块可以进入监听模式,在监听模式下可以监听周边设备发送的无线帧。无线帧的载荷部分是加密的,如果终端设备无法解密载荷部分也就无法获得载荷部分承载的数据,但整个无线帧的包长是可以计算得到的,无线帧的包
长即为该无线帧的总长度。依据这个特点,本申请实施提供了一种数据传输方案。As mentioned above, the terminal device cannot establish communication directly with other devices in the wireless network, such as mobile phones, before accessing the wireless network, nor can it access the Internet through the access device. However, the Wi-Fi module of the terminal device can enter the listening mode, and in the listening mode, the wireless frame sent by the peripheral device can be monitored. The payload part of the radio frame is encrypted. If the terminal device cannot decrypt the payload part, the data carried by the payload part cannot be obtained, but the packet length of the entire radio frame can be calculated, and the packet of the radio frame can be calculated.
The length is the total length of the radio frame. According to this feature, the implementation of the present application provides a data transmission scheme.
在本申请实施例提供的数据传输方案中,发送方将发送的数据承载在无线帧的包长对应的比特序列发送,接收方捕获到无线帧后,计算出无线帧的包长,根据该包长对应的比特序列可获取需要的数据。In the data transmission scheme provided by the embodiment of the present application, the sender transmits the data to be transmitted in a bit sequence corresponding to the packet length of the radio frame, and after receiving the radio frame, the receiver calculates the packet length of the radio frame, according to the packet. The long corresponding bit sequence can acquire the required data.
以将本申请实施例应用在智能家居场景下为例,可将移动终端,如手机,作为发送方数据传输装置,将不具备键盘和屏幕等输入装置的智能家居设备或嵌入式设备作为接收方数据传输装置,由发送方数据传输装置通过无线帧的包长对应的比特序列承载无线局域网的接入密码,接收方数据传输装置根据接收到的无线帧计算该无线帧的包长,根据包长对应的比特序列获取无线局域网接入密码,从而根据该接入密码接入无线局域网,进而解决了智能家居设备或嵌入式设备接入无线局域网的问题。Taking the embodiment of the present application as an example in a smart home scenario, a mobile terminal, such as a mobile phone, can be used as a sender data transmission device, and a smart home device or an embedded device that does not have an input device such as a keyboard and a screen is used as a receiver. a data transmission device, wherein the sender data transmission device carries an access password of the wireless local area network through a bit sequence corresponding to a packet length of the radio frame, and the receiver data transmission device calculates a packet length of the radio frame according to the received radio frame, according to the packet length The corresponding bit sequence acquires a wireless local area network access password, thereby accessing the wireless local area network according to the access password, thereby solving the problem that the smart home device or the embedded device accesses the wireless local area network.
本申请实施例中所述的无线帧遵循无线通信协议。本文以无线帧遵循802.11系列协议为例进行描述,在不特别声明的情况下,下面描述的无线帧为遵循802.11系列协议的无线帧。The radio frame described in the embodiment of the present application follows a wireless communication protocol. This document describes an example in which a radio frame follows the 802.11 series protocol. The radio frame described below is a radio frame that complies with the 802.11 series protocol, unless otherwise stated.
图1示例性地示出了802.11协议定义的一种无线帧的结构。其中,帧头部分承载控制信息、协议信息和地址信息等,帧实体部分为无线帧的载荷部分,用来承载数据内容,FCS(Frame Check Sequence,帧校验序列)字段用来承载帧校验信息,以保证无线帧的完整性。帧头部分、帧实体部分以及FCS部分所占用的总长度,称为无线帧的包长。无线帧的包长可由接收方数据传输装置的应用层计算得到。FIG. 1 exemplarily shows the structure of a radio frame defined by the 802.11 protocol. The frame header part carries control information, protocol information, and address information, and the frame entity part is a payload part of the radio frame, and is used to carry data content. The FCS (Frame Check Sequence) field is used to carry the frame check. Information to ensure the integrity of the wireless frame. The total length occupied by the frame header portion, the frame entity portion, and the FCS portion is called the packet length of the radio frame. The packet length of the radio frame can be calculated by the application layer of the receiver data transmission device.
需要说明的是,本申请实施例中所述的无线帧不限于图1所示的结构。It should be noted that the radio frame described in the embodiment of the present application is not limited to the structure shown in FIG. 1.
无线帧可分组进行发送,一个分组内可包括多个无线帧。为描述方便,本申请实施例中,将一个分组内的无线帧称为数据帧。两个分组之间需要发送一个无线帧进行间隔,本申请实施例中将两个分组之间插入的无线帧称为分组帧。分组帧用于控制下一个分组的起始位置,即,用于同步下一分组的数据帧
的位置,以防止接收方乱序。Radio frames can be transmitted in packets, and multiple radio frames can be included in one packet. For convenience of description, in the embodiment of the present application, a radio frame in one packet is referred to as a data frame. A radio frame needs to be sent between two packets for interval. In this embodiment of the present application, a radio frame inserted between two packets is referred to as a packet frame. The packet frame is used to control the starting position of the next packet, that is, the data frame for synchronizing the next packet.
The location to prevent the receiver from being out of order.
本申请实施例中所述的数据帧,其包长对应的比特序列用来承载数据,比如用于接入无线网络的账户;所述的分组帧的包长对应的比特序列用来承载分组号。In the data frame described in the embodiment of the present application, the bit sequence corresponding to the packet length is used to carry data, such as an account for accessing the wireless network; and the bit sequence corresponding to the packet length of the packet frame is used to carry the packet number. .
需要说明的是,这种对无线帧的区分方式仅用于本申请实施例,目的是便于描述,并不意味着对802.11协议或其它通信协议定义的无线帧分类进行修改。It should be noted that the manner of distinguishing the radio frames is only used in the embodiments of the present application, and the purpose is to facilitate the description, and does not mean to modify the radio frame classification defined by the 802.11 protocol or other communication protocols.
图2示例性地示出了数据帧与分组帧的分布。FIG. 2 exemplarily shows the distribution of data frames and packet frames.
本申请实施例中,针对需要用包长对应的比特序列来承载数据的无线帧,比如,需要用包长对应的比特序列来承载无线局域网的接入密码的无线帧,对该无线帧的包长对应的比特序列的格式进行了定义。具体来说,包长对应的比特序列中可包含序号域和数据域。如果无线帧是数据帧,则包长对应的比特序列中的序号域的比特位的取值用来表示数据帧在其所属分组内的序号,数据域的比特位的取值用来表示需要由包长对应的比特序列所承载的数据;如果无线帧是分组帧,则包长对应的比特序列中的序号域的比特位的取值可作为分组帧的标识,数据域的比特位的取值用来表示分组号。In the embodiment of the present application, a radio frame that needs to carry data by using a bit sequence corresponding to a packet length, for example, a radio frame that needs to use a bit sequence corresponding to a packet length to carry an access password of a wireless local area network, and a packet of the radio frame. The format of the long corresponding bit sequence is defined. Specifically, the bit sequence corresponding to the packet length may include a sequence number field and a data field. If the radio frame is a data frame, the value of the bit field in the bit sequence corresponding to the packet length is used to indicate the sequence number of the data frame in the packet to which it belongs, and the value of the bit in the data field is used to indicate that The data carried by the bit sequence corresponding to the packet length; if the radio frame is a packet frame, the value of the bit field in the bit sequence corresponding to the packet length may be used as the identifier of the packet frame, and the value of the bit in the data field Used to indicate the group number.
优选地,本申请实施例中所述的无线帧的包长对应的比特序列中的序号域可位于包长对应的比特序列的高比特位部分,包长对应的比特序列中的数据域可位于包长对应的比特序列的低比特位部分。上述序号域和数据域的定义仅为一种示例,本申请实施例对此不作限制。Preferably, the sequence number field in the bit sequence corresponding to the packet length of the radio frame in the embodiment of the present application may be located in the high bit position portion of the bit sequence corresponding to the packet length, and the data field in the bit sequence corresponding to the packet length may be located. The low bit portion of the bit sequence corresponding to the packet length. The definition of the sequence number field and the data field is only an example, and the embodiment of the present application does not limit this.
根据802.11协议,无线帧的包长由于MTU(通信协议约定的数据包最大传输单元)长度的限制原因,通常小于1500字节,十进制1500的十六进制表示为0x5DC,使用11比特位宽即可用来表示包长,即,无线帧的包长对应的比特序列的长度至少为11比特。According to the 802.11 protocol, the packet length of a radio frame is usually less than 1500 bytes due to the limitation of the length of the MTU (the maximum transmission unit of the data packet agreed upon by the communication protocol), and the hexadecimal representation of the decimal 1500 is 0x5DC, and the 11-bit width is used. It can be used to indicate the packet length, that is, the bit sequence corresponding to the packet length of the radio frame has a length of at least 11 bits.
以无线帧的包长对应的比特序列长度为11比特为例,本申请实施例中,针对需要用包长对应的比特序列来承载数据的无线帧,将包长对应的比特序列
的高4比特作为序号域,将包长对应的比特序列的低7比特作为数据域。For example, the bit sequence length corresponding to the packet length of the radio frame is 11 bits. In the embodiment of the present application, the bit sequence corresponding to the packet length is used for the radio frame that needs to carry the data with the bit sequence corresponding to the packet length.
The upper 4 bits are used as the sequence number field, and the lower 7 bits of the bit sequence corresponding to the packet length are used as the data field.
4个比特的取值范围为{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},表示为[0,15]。本文以下用[a1,a2]表示取值范围,该范围的下限是a1,上限是a2,且包含a1和a2,即取值范围是a1到a2之间的整数。考虑到无线帧的包长通常限制在1500=0x5DC以下,因此高4比特的取值范围为[0,11]。The value of 4 bits is {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}, expressed as [0,15]. Herein, the range of values is represented by [a1, a2], the lower limit of the range is a1, the upper limit is a2, and a1 and a2 are included, that is, an integer ranging from a1 to a2. Considering that the packet length of a radio frame is usually limited to 1500=0x5DC or less, the value of the upper 4 bits is [0, 11].
考虑到序号域中的比特位如果取全零的数值,则该无线帧可能与其它无线帧之间产生干扰,不利于接收方的数据接收,因此在本申请实施例中,序号域的取值范围中可排除0。比如,在一种优选的方案中,对于数据帧来说,包长对应的比特序列中的序号域的取值范围为[1,10];对于分组帧来说,包长对应的比特序列中的序号域的取值范围是[11]。7比特长度的数据域的取值范围是[0,127]。由于数据帧的包长对应的比特序列中的序号域的取值范围与分组帧的包长对应的比特序列中的序号域的取值或取值范围没有交叠,因此可通过包长对应的比特序列中的序号域的比特位的取值来区分数据帧和分组帧。Considering that the bit in the sequence number field takes the value of all zeros, the radio frame may generate interference with other radio frames, which is disadvantageous for the data reception of the receiver. Therefore, in the embodiment of the present application, the value of the sequence number field is used. 0 can be excluded from the range. For example, in a preferred solution, for a data frame, a sequence number field corresponding to a packet length has a value range of [1, 10]; for a packet frame, a packet length corresponds to a bit sequence. The range of the sequence number field is [11]. The value range of the 7-bit data field is [0, 127]. The value range of the sequence number field in the bit sequence corresponding to the packet length of the data frame does not overlap with the value range of the sequence number field in the bit sequence corresponding to the packet length of the packet frame, and therefore may correspond to the packet length. The value of the bit field of the sequence number field in the bit sequence distinguishes between the data frame and the packet frame.
通常,需要使用包长对应的比特序列来承载的数据可以是ASCII字符,比如无线局域网的账户信息。由于该数据的有效ASCII字符仅为ASCII字符集的一个子集,该子集内的ASCII字符的取值范围为[32,126]。Generally, data that needs to be carried by using a bit sequence corresponding to a packet length may be an ASCII character, such as account information of a wireless local area network. Since the valid ASCII characters of the data are only a subset of the ASCII character set, the ASCII characters in the subset have a value range of [32, 126].
根据数据帧的包长对应的比特序列中的数据域的取值的上述特点,本申请实施例中,可采用以下几种方案对数据帧和分组帧的包长对应的比特序列中的序号域以及数据域的取值范围进行定义,其中,为描述方便,用Fram_data表示数据帧,用Fram_group表示分组帧,用field_index表示包长对应的比特序列中的序号域,用field_data表示包长对应的比特序列中的数据域。According to the foregoing feature of the value of the data field in the bit sequence corresponding to the packet length of the data frame, in the embodiment of the present application, the sequence number field in the bit sequence corresponding to the packet length of the data frame and the packet frame may be adopted by the following solutions. And the value range of the data field is defined. For the convenience of description, the data frame is represented by Fram_data, the packet frame is represented by Fram_group, the sequence number field in the bit sequence corresponding to the packet length is represented by field_index, and the bit corresponding to the packet length is represented by field_data. The data field in the sequence.
方案1 plan 1
Fram_data:field_index取值范围为[1,10],field_data取值范围为[32,126]Fram_data: field_index has a value range of [1, 10], and field_data has a value range of [32, 126].
Fram_group:field_index取值为[11,15]范围内的任意一个整数,优选取值为11,field_data取值范围为[0,31]Fram_group: field_index takes any integer in the range [11, 15], preferably takes a value of 11, and field_data takes the value range [0, 31].
如果采用方案1,则发送方数据传输装置可将ASCII字符的二进制取值直
接作为包长对应的比特序列中的数据域的比特位的取值,接收方数据传输装置可根据包长对应的比特序列中的数据域的比特位的取值直接得到对应的ASCII字符。If scheme 1 is adopted, the sender data transmission device can directly determine the binary value of the ASCII character.
The value of the bit of the data field in the bit sequence corresponding to the packet length is received, and the data transmission means of the receiver can directly obtain the corresponding ASCII character according to the value of the bit of the data field in the bit sequence corresponding to the packet length.
方案2 Scenario 2
Fram_data:field_index取值范围为[1,11],优选范围为[1,10],field_data取值范围为[0,94]Fram_data: field_index has a value range of [1, 11], a preferred range is [1, 10], and field_data has a value range of [0, 94].
Fram_group:field_index取值为[1,11]范围内的任意一个整数,优选取值为11,field_data取值范围为[95,126]Fram_group: field_index takes any integer within the range [1, 11], preferably takes a value of 11, and field_data takes the range [95,126]
如果采用方案2,则发送方数据传输装置可将ASCII字符对应的取值减去32后,将减法运算后的取值所对应的取值作为包长对应的比特序列中的数据域的比特位的取值,接收方数据传输装置可将包长对应的比特序列中的数据域的比特位的取值加上32后,根据加法运算后的取值得到对应的ASCII字符。If the scheme 2 is adopted, the sender data transmission device may subtract the value corresponding to the ASCII character by 32, and take the value corresponding to the subtracted value as the bit of the data field in the bit sequence corresponding to the packet length. The value of the data transmission device of the receiver can add 32 bits of the data field in the bit sequence corresponding to the packet length, and obtain the corresponding ASCII character according to the value obtained after the addition.
以上序号域和数据域的取值范围的定义方案仅为一种示例,本申请实施例并不仅限于上述方案。比如,允许数据帧和分组帧的包长对应的比特序列中的序号域的取值范围交叠,但数据域的取值范围不能存在交叠,这样可根据数据域的取值范围来区分数据帧和分组帧;或者,允许数据帧和分组帧的包长对应的比特序列中的数据域的取值范围交叠,但序号域的取值范围不能存在交叠,这样,可以根据序号域的取值范围来区分数据帧和分组帧。The definition scheme of the value range of the above sequence number field and the data field is only an example, and the embodiment of the present application is not limited to the above solution. For example, the value range of the sequence number field in the bit sequence corresponding to the packet length of the data frame and the packet frame is allowed to overlap, but the value range of the data field cannot overlap, so that the data can be distinguished according to the value range of the data field. Frame and packet frame; or, the range of values of the data fields in the bit sequence corresponding to the packet length of the data frame and the packet frame are allowed to overlap, but the value range of the sequence number field cannot overlap, and thus, according to the sequence number field The range of values is used to distinguish between data frames and packet frames.
图3a和图3b以包长对应的比特序列的长度为11比特,且序号域的比特位数为4、数据域的比特位数为7为例,示例性地示出了本申请实施例提供的无线帧的包长对应的比特序列的格式。其中,图3a示例性地示出了数据帧的包长对应的比特序列的格式,一个数据帧的包长对应的比特序列中的数据域可以用来承载一个ASCII字符。图3b示例性地示出了分组帧的包长对应的比特序列的格式。3a and FIG. 3b exemplarily show that the length of the bit sequence corresponding to the packet length is 11 bits, and the number of bits in the sequence number field is 4, and the number of bits in the data field is 7. The packet length of the radio frame corresponds to the format of the bit sequence. FIG. 3a exemplarily shows the format of a bit sequence corresponding to the packet length of the data frame, and the data field in the bit sequence corresponding to the packet length of one data frame can be used to carry an ASCII character. Fig. 3b exemplarily shows the format of a bit sequence corresponding to the packet length of a packet frame.
图3a中,数据帧的包长对应的比特序列的序号域占用该比特序列中的高比特位部分的4个比特,取值范围定义为[1,10],数据域占用该比特序列中的
低比特位部分的7个比特,取值范围为[32,126]。In FIG. 3a, the sequence number field of the bit sequence corresponding to the packet length of the data frame occupies 4 bits of the high bit portion of the bit sequence, and the value range is defined as [1, 10], and the data field occupies the bit sequence.
The 7 bits of the low bit portion are in the range [32, 126].
数据帧的包长对应的比特序列的格式定义可表示为:The format definition of the bit sequence corresponding to the packet length of the data frame can be expressed as:
len=(index<<7)+data,index=[1,2,3,4,5,6,7,8,9,10]Len=(index<<7)+data,index=[1,2,3,4,5,6,7,8,9,10]
126>=data>=32126>=data>=32
其中,len代表数据帧的包长;index代表数据帧相对序号,即数据帧在所属分组内的序号或位置;data代表数据域中的数据,即需要由包长对应的比特序列承载的数据,一个数据帧的包长对应的比特序列中的数据域可承载一个字节的数据,比如一个ASCII字符。在使用包长对应的比特序列承载用于接入无线网络的账号信息的情况下,可定义126>=data>=32,因为该范围所对应的ASCII字符为账号信息所使用的ASCII字符。Where len represents the packet length of the data frame; index represents the relative sequence number of the data frame, that is, the sequence number or position of the data frame within the belonging packet; and data represents the data in the data domain, that is, data carried by the bit sequence corresponding to the packet length, The data field in the bit sequence corresponding to the packet length of a data frame can carry one byte of data, such as an ASCII character. In the case of using the bit sequence corresponding to the packet length to carry the account information for accessing the wireless network, 126>=data>=32 may be defined because the ASCII character corresponding to the range is the ASCII character used for the account information.
图3b中,分组帧的包长对应的比特序列中的序号域占用该比特序列的高比特位部分的4个比特,定义的取值固定为11,数据域占用该比特序列的低比特位部分的7个比特,取值范围为[0,31]。In FIG. 3b, the sequence number field in the bit sequence corresponding to the packet length of the packet frame occupies 4 bits of the high bit portion of the bit sequence, and the defined value is fixed to 11, and the data field occupies the low bit portion of the bit sequence. 7 bits, the value range is [0, 31].
分组帧的包长对应的比特序列的格式定义可表示为:The format definition of the bit sequence corresponding to the packet length of the packet frame can be expressed as:
len=(fixed_index<<7)+base_indexLen=(fixed_index<<7)+base_index
其中,len代表分组帧的包长,fixed_index代表分组帧使用的固定序号,取值为11;base_index代表分组号,取值范围为[0,31]。Where len represents the packet length of the packet frame, fixed_index represents the fixed sequence number used by the packet frame, and the value is 11; base_index represents the packet number, and the value range is [0, 31].
根据图3a和图3b,在定义126>=data>=32的情况下,由于base_index的取值范围是[0,31],与data的取值范围没有交叠,因此可根据无线帧的包长对应的比特序列中的数据域的比特位的取值区分数据帧和分组帧。当然,在数据帧和分组帧的包长对应的比特序列中的序号域的比特位的取值没有交叠的情况下,也可根据序号域的比特位的取值区分数据帧和分组帧。According to FIG. 3a and FIG. 3b, in the case where the definition 126>=data>=32, since the value range of the base_index is [0, 31], there is no overlap with the value range of the data, so the packet according to the radio frame can be The value of the bit of the data field in the long corresponding bit sequence distinguishes between the data frame and the packet frame. Certainly, in the case that the values of the bits of the sequence number field in the bit sequence corresponding to the packet length of the data frame and the packet frame do not overlap, the data frame and the packet frame may be distinguished according to the value of the bit field of the sequence number field.
可以看出,使用以上编码格式即可达到将数据和序号隐藏编码到无线帧的包长对应的比特序列的目的。It can be seen that the purpose of hiding the data and the sequence number into the bit sequence corresponding to the packet length of the radio frame can be achieved by using the above coding format.
以上仅以无线帧的包长对应的比特序列的长度为11比特为例描述,无线帧的包长对应的比特序列的长度也可以大于11比特,在这种情况下,包长对应的比特序列中的高N比特可作为序号域,N是大于4的整数,该比特序列中
的低M比特可作为数据域,M是大于或等于7的整数。The above description is only taking the length of the bit sequence corresponding to the packet length of the radio frame as 11 bits. The length of the bit sequence corresponding to the packet length of the radio frame may also be greater than 11 bits. In this case, the bit sequence corresponding to the packet length. The high N bit in the middle can be used as the sequence number field, and N is an integer greater than 4 in the bit sequence.
The lower M bits can be used as the data field, and M is an integer greater than or equal to 7.
根据以上对无线帧的包长对应的比特序列的格式定义,下面分别结合图3和图4,对本申请实施例提供的数据传输方法流程进行详细描述。According to the format definition of the bit sequence corresponding to the packet length of the radio frame, the flow of the data transmission method provided by the embodiment of the present application is described in detail below with reference to FIG. 3 and FIG. 4 respectively.
参见图4,为本申请实施例提供的数据传输方法流程的示意图。该流程描述了数据接收方的处理过程,该流程可由作为数据接收方的数据传输装置执行。所述数据传输装置设置有无线模块,比如Wi-Fi模块,能够接收和处理无线帧。比如,该数据传输装置可以是智能家居设备或嵌入式设备等。FIG. 4 is a schematic diagram of a flow of a data transmission method according to an embodiment of the present application. This flow describes the processing of the data receiver, which can be performed by the data transmission device as the data receiver. The data transmission device is provided with a wireless module, such as a Wi-Fi module, capable of receiving and processing radio frames. For example, the data transmission device may be a smart home device or an embedded device.
如图所示,该流程可包括如下步骤:As shown, the process can include the following steps:
步骤401:接收无线帧;Step 401: Receive a radio frame.
步骤402:确定所述无线帧的包长;所述无线帧的包长对应的比特序列包括序号域和数据域,所述序号域的比特位数至少大于3;Step 402: Determine a packet length of the radio frame; a bit sequence corresponding to a packet length of the radio frame includes a sequence number field and a data field, and the bit number of the sequence number field is at least greater than 3;
步骤403:根据所述无线帧的包长对应的比特序列中的序号域和/或数据域的比特位的取值,确定所述无线帧的包长对应的比特序列是否用来承载数据;Step 403: Determine, according to the value of the sequence number field and/or the bit field of the data field in the bit sequence corresponding to the packet length of the radio frame, whether the bit sequence corresponding to the packet length of the radio frame is used to carry data.
步骤404:如果确定为是,则根据所述无线帧的包长对应的比特序列中的数据域的比特位的取值,确定所述无线帧的包长对应的比特序列所承载的数据。Step 404: If the determination is yes, determining the data carried by the bit sequence corresponding to the packet length of the radio frame according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame.
进一步地,若在步骤403中确定所述无线帧的包长对应的比特序列用来承载分组号,则可根据该无线帧进行数据接收和排序。Further, if it is determined in step 403 that the bit sequence corresponding to the packet length of the radio frame is used to carry the packet number, data reception and ordering may be performed according to the radio frame.
上述流程中所述的无线帧,其包长对应的比特序列的结构可如前所述。比如,包长对应的比特序列中的序号域位于该比特序列中的高比特位部分,包长对应的比特序列中的数据域位于该比特序列中的低比特位部分。优选地,所述序号域的比特位数为4,所述数据域的比特位数为7。In the radio frame described in the above process, the structure of the bit sequence corresponding to the packet length can be as described above. For example, the sequence number field in the bit sequence corresponding to the packet length is located in the high bit portion of the bit sequence, and the data field in the bit sequence corresponding to the packet length is located in the low bit portion of the bit sequence. Preferably, the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
在步骤401中,由于数据传输装置中设置有无线模块,因此可以监听周边设备发送的无线帧。In step 401, since the wireless module is disposed in the data transmission device, the wireless frame transmitted by the peripheral device can be monitored.
在步骤402中,作为接收方的数据传输装置可在应用层计算得到该无线帧的包长,进而得到该包长对应的比特序列。
In step 402, the data transmission apparatus as the receiver can calculate the packet length of the radio frame at the application layer, thereby obtaining a bit sequence corresponding to the packet length.
如前所述,可根据包长对应的比特序列中的序号域的比特位的取值来区分数据帧和分组帧,也可以根据包长对应的比特序列中的数据域的比特位的取值来区分数据帧和分组帧,相应地,在步骤403中,数据传输装置可采用以下方式中的一种来确定所述无线帧是否是数据帧:As described above, the data frame and the packet frame may be distinguished according to the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length, or may be determined according to the value of the bit field of the data field in the bit sequence corresponding to the packet length. To distinguish between the data frame and the packet frame, correspondingly, in step 403, the data transmission device may determine whether the radio frame is a data frame in one of the following manners:
方式1:若所述无线帧的包长对应的比特序列中序号域的比特位的取值在第一取值范围内,则确定所述无线帧的包长对应的比特序列用来承载数据,其中,所述无线帧的包长对应的比特序列中序号域的比特位的取值用于标识所述无线帧在所属分组内的序号。Mode 1: If the value of the bit field in the bit sequence corresponding to the packet length of the radio frame is within the first value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry data, The value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is used to identify the sequence number of the radio frame in the group to which the radio frame belongs.
进一步地,若所述无线帧的包长对应的比特序列中序号域的比特位的取值在第二取值范围内或为第一取值,则确定所述无线帧的包长对应的比特序列用来承载分组号,其中,所述第二取值范围与所述第一取值范围没有交叠,所述第一取值不在所述第一取值范围内。Further, if the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the second value range or is the first value, determining the bit corresponding to the packet length of the radio frame The sequence is used to carry a packet number, where the second value range does not overlap with the first value range, and the first value is not in the first value range.
举例来说,以图3a和图3b所示的无线帧的包长对应的比特序列的格式为例,如果无线帧的包长对应的比特序列中的序号域的比特位的取值在[1,10]范围内,则确定该无线帧为数据帧,如果无线帧的包长对应的比特序列中的序号域的比特位的取值为11,则确定该无线帧为分组帧。For example, the format of the bit sequence corresponding to the packet length of the radio frame shown in FIG. 3a and FIG. 3b is taken as an example, if the bit length of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is [1] In the range of 10, the radio frame is determined to be a data frame. If the bit length of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is 11, the radio frame is determined to be a packet frame.
方式2:若所述无线帧的包长对应的比特序列中数据域的比特位的取值在第三取值范围内,则确定所述无线帧的包长对应的比特序列用来承载数据,所述第三取值范围为需要由无线帧的包长对应的比特序列承载的数据所对应的取值范围。优选地,在这种情况下,会选定一个固定值作为分组帧的包长对应的比特序列中的序号域的比特位的取值。Mode 2: If the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the third value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry data, The third value range is a value range corresponding to data that needs to be carried by a bit sequence corresponding to a packet length of the radio frame. Preferably, in this case, a fixed value is selected as the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the packet frame.
进一步地,若所述无线帧的包长对应的比特序列中数据域的比特位的取值在第四取值范围内,则确定所述无线帧的包长对应的比特序列用来承载分组号,所述第四取值范围为分组序号的取值范围,所述第三取值范围与所述第四取值范围没有交叠。Further, if the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the fourth value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry the packet number The fourth value range is a value range of the packet sequence number, and the third value range does not overlap with the fourth value range.
举例来说,以图3a和图3b所示的无线帧的包长对应的比特序列的格式为
例,如果无线帧的包长对应的比特序列中的数据域的比特位的取值在[32,126]范围内,则确定该无线帧为数据帧,如果无线帧的包长对应的比特序列中的数据域的比特位的取值在[0,31]范围内,则确定该无线帧为分组帧。For example, the format of the bit sequence corresponding to the packet length of the radio frame shown in FIG. 3a and FIG. 3b is
For example, if the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the range of [32, 126], it is determined that the radio frame is a data frame, if the packet length of the radio frame is in the bit sequence corresponding to If the value of the bit of the data field is in the range [0, 31], it is determined that the radio frame is a packet frame.
在步骤404中,作为接收方的数据传输装置可通过以下过程确定所述数据帧的包长对应的比特序列所承载的数据:根据所述数据帧的包长对应的比特序列中的数据域的比特位的取值,确定对应的ASCII字符,将确定出的ASCII字符确定为所述数据帧的包长对应的比特序列所承载的数据。In step 404, the data transmission apparatus as the receiver may determine data carried by the bit sequence corresponding to the packet length of the data frame by using a data field in a bit sequence corresponding to the packet length of the data frame. The value of the bit is determined, and the corresponding ASCII character is determined, and the determined ASCII character is determined as data carried by the bit sequence corresponding to the packet length of the data frame.
一个数据帧的包长对应的比特序列中的数据域通常可承载一个字节,比如一个ASCII字符,如果需要由包长对应的比特序列承载的数据包含多个字节,比如多个ASCII字符,则可以使用相应数量的数据帧的包长对应的比特序列来承载该多个字节的数据。图5示例性地示出了用多个数据帧的包长对应的比特序列承载多个字节数据的示意图,图中字节1至字节n表示需要通过无线帧的包长传输的数据,比如,一个字节可代表一个ASCII字符。The data field in the bit sequence corresponding to the packet length of a data frame can usually carry one byte, such as an ASCII character. If the data carried by the bit sequence corresponding to the packet length needs to contain multiple bytes, such as multiple ASCII characters, Then, the bit sequence corresponding to the packet length of the corresponding number of data frames can be used to carry the data of the multiple bytes. FIG. 5 exemplarily shows a schematic diagram of carrying a plurality of byte data by a bit sequence corresponding to a packet length of a plurality of data frames, where byte 1 to byte n represent data to be transmitted through a packet length of the radio frame, For example, a byte can represent an ASCII character.
考虑到数据传输装置接收无线帧的顺序可能与发送顺序不一致,因此本申请实施例中,可通过数据帧的包长对应的比特序列中的序号域的比特位的取值,来确定一个分组内的数据帧的顺序,按照该顺序将这些数据帧的包长对应的比特序列所承载的数据进行拼接,从而可以解决接收无线帧乱序所导致的数据不准确的问题。In the embodiment of the present application, the value of the bit of the sequence number field in the bit sequence corresponding to the packet length of the data frame may be determined by using the value of the bit field in the bit sequence corresponding to the packet length of the data frame. The order of the data frames splicing the data carried by the bit sequences corresponding to the packet lengths of the data frames in this order, thereby solving the problem of inaccurate data caused by the disorder of receiving the wireless frames.
具体来说,作为接收方的数据传输装置可以根据数据帧的包长对应的比特序列中序号域的比特位的取值确定该数据帧在所属分组内的序号,根据该数据帧在所属分组内的序号,确定该数据帧的包长对应的比特序列中的数据域所承载的数据在整个数据序列中的位置。Specifically, the data transmission apparatus as the receiver may determine the sequence number of the data frame in the belonging packet according to the value of the bit position of the sequence number field in the bit sequence corresponding to the packet length of the data frame, according to the data frame in the group to which the data frame belongs. The sequence number determines the position of the data carried by the data field in the bit sequence corresponding to the packet length of the data frame in the entire data sequence.
进一步地,作为接收方的数据传输装置可根据分组帧的包长对应的比特序列中的数据域的比特位的取值确定分组号,根据该分组号,确定数据的在整个数据序列里的绝对位置,或者说确定下一分组数据的起始偏移。Further, the data transmission apparatus as the receiver may determine the packet number according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the packet frame, and determine the absolute value of the data in the entire data sequence according to the packet number. Position, or determine the starting offset of the next packet data.
比如,作为接收方的数据传输装置解析数据时,可根据以下公式确定一个
数据的最终位置:For example, when the data transmission device as the receiver analyzes the data, one can be determined according to the following formula.
The final location of the data:
pos=(base_index*group_nums)+indexPos=(base_index*group_nums)+index
其中,pos代表数据包的最终位置,group_nums代表一个分组内的数据帧的数量。接收方根据base_index和index来确定数据的最终位置。Where pos represents the final location of the packet and group_nums represents the number of data frames within a packet. The receiver determines the final location of the data based on base_index and index.
优选地,可将上述实施例应用于无线网络接入的场景,在该场景下,所述需要由无线帧的包长对应的比特序列承载的数据可包括:用于进行无线网络接入的账户信息,或者无线网络的接入密码,比如可以是无线局域网的接入密码。Preferably, the foregoing embodiment may be applied to a scenario of wireless network access, in which the data that needs to be carried by the bit sequence corresponding to the packet length of the radio frame may include: an account for performing wireless network access. Information, or access password of the wireless network, such as an access password of a wireless local area network.
本申请的上述实施例中,由于通过无线帧的包长对应的比特序列的数据域承载需要发送给接入方的数据,使得接收方能够根据无线帧的包长对应的比特序列获取需要的数据。尤其在接入无线局域网的场景下,发送方可将无线局域网的账户信息承载在无线帧的包长对应的比特序列发送给接收方,使得接收方获得无线局域网的账户信息,从而可接入无线局域网。另外,由于无线帧的包长对应的比特序列中的序号域的比特位数大于3,由于包长对应的比特序列中的序号域可用来标识无线帧在所在分组内的序号,因此通过该长度的序号域,使得每个分组内包含较多数量的无线帧,也就是说,可以每间隔较多数量的无线帧发送一个作为分组间隔的无线帧,而作为分组间隔的无线帧的数量越少,越能降低因作为分组间隔的无线帧丢失而导致的对接收方接收效率的影响。In the foregoing embodiment of the present application, since the data domain of the bit sequence corresponding to the packet length of the radio frame carries data that needs to be sent to the access side, the receiver can acquire the required data according to the bit sequence corresponding to the packet length of the radio frame. . Especially in the scenario of accessing the wireless local area network, the sender can send the account information of the wireless local area network to the receiver according to the bit sequence corresponding to the packet length of the wireless frame, so that the receiver obtains the account information of the wireless local area network, thereby enabling wireless access. local area network. In addition, since the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is greater than 3, since the sequence number field in the bit sequence corresponding to the packet length can be used to identify the sequence number of the radio frame in the group, the length is passed. The sequence number field is such that each packet contains a larger number of radio frames, that is, a radio frame as a packet interval can be transmitted every time a larger number of radio frames are separated, and the number of radio frames as a packet interval is smaller. The more it is possible to reduce the reception efficiency of the receiver due to the loss of the radio frame as the packet interval.
以需要通过无线帧的包长对应的比特序列传输100字节的数据为例,根据本申请的上述实施例,每发送10个数据帧,需要发送一个分组帧,一共需要10个分组帧。但是,如果无线帧的包长对应的比特序列中的序号域的比特位数小于或等于3,比如等于3,则需要25个分组帧。数据帧位置的确定对接收方至关重要,因为无线帧传输过程容易丢失,接收方一次很难将信息搜集完整,在循环接收过程中,每收到一个数据,需要确定该数据的位置。由于无线传输的可靠性不高,分组帧的丢失,易引起前一个分组的数据解析出现混乱,影响接收方的效率,因此采用本申请实施例降低了分组帧的数量,进而可一定程度上保证接收方的接收可靠性。
For example, in the case of transmitting 100 bytes of data through a bit sequence corresponding to the packet length of the radio frame, according to the above embodiment of the present application, each time 10 data frames are transmitted, one packet frame needs to be transmitted, and a total of 10 packet frames are required. However, if the number of bits of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is less than or equal to 3, for example equal to 3, 25 packet frames are required. The determination of the location of the data frame is crucial to the receiver, because the wireless frame transmission process is easy to lose, and it is difficult for the receiver to collect the information at a time. In the cyclic receiving process, each time a data is received, the location of the data needs to be determined. Because the reliability of the wireless transmission is not high, the loss of the packet frame may cause confusion in the data analysis of the previous packet, which affects the efficiency of the receiver. Therefore, the embodiment of the present application reduces the number of packet frames, and thus can be guaranteed to a certain extent. Receiver's reception reliability.
参见图6,为本申请实施例提供的数据传输方法流程的示意图。该流程描述了数据发送方的处理过程,该流程可由作为数据发送方的数据传输装置执行。所述数据传输装置设置有无线模块,比如Wi-Fi模块,能够发送和处理无线帧。比如,该数据传输装置可以是移动终端或者可以是无线路由器或家庭网关等。FIG. 6 is a schematic diagram of a flow of a data transmission method according to an embodiment of the present application. This flow describes the processing of the data sender, which can be performed by the data transmission device as the data sender. The data transmission device is provided with a wireless module, such as a Wi-Fi module, capable of transmitting and processing radio frames. For example, the data transmission device may be a mobile terminal or may be a wireless router or a home gateway or the like.
如图6所示,该流程可包括如下步骤:As shown in FIG. 6, the process may include the following steps:
步骤601:获取需要由无线帧的包长对应的比特序列承载的数据;Step 601: Acquire data that needs to be carried by a bit sequence corresponding to a packet length of the radio frame.
步骤602:根据获取到的数据,确定无线帧的包长对应的比特序列,使所述无线帧的包长对应的比特序列中的数据域承载所述数据,其中,所述无线帧的包长对应的比特序列中包含序号域和数据域,所述序号域的比特位数至少大于3;Step 602: Determine, according to the acquired data, a bit sequence corresponding to a packet length of the radio frame, so that a data field in a bit sequence corresponding to a packet length of the radio frame carries the data, where a packet length of the radio frame The corresponding bit sequence includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
步骤603:根据所述无线帧的包长生成所述无线帧;Step 603: Generate the radio frame according to a packet length of the radio frame.
步骤604:发送所述无线帧。Step 604: Send the radio frame.
上述流程中所述的无线帧,其包长对应的比特序列的结构可如前所述。比如,序号域位于包长对应的比特序列中的高比特位部分,所述数据域位于包长对应的比特序列中的低比特位部分。优选地,所述序号域的比特位数为4,所述数据域的比特位数为7。In the radio frame described in the above process, the structure of the bit sequence corresponding to the packet length can be as described above. For example, the sequence number field is located in the high bit portion of the bit sequence corresponding to the packet length, and the data field is located in the low bit portion of the bit sequence corresponding to the packet length. Preferably, the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
在步骤601中,作为发送方的数据传输装置可获取需要由无线帧的包长对应的比特序列承载的数据,该数据可以是一个字节序列中的一个字节,比如一个ASCII字符串中的一个ASCII字符。In step 601, the data transmission device as the sender can acquire data that needs to be carried by the bit sequence corresponding to the packet length of the radio frame, and the data can be one byte in a byte sequence, such as in an ASCII string. An ASCII character.
在步骤602中,作为发送方的数据传输装置可将所述需要由无线帧的包长对应的比特序列承载的数据转换为ASCII字符对应的取值,根据转换后的ASCII字符对应的取值,确定所述无线帧的包长对应的比特序列中数据域的取值,使所述无线帧的包长对应的比特序列中的数据域承载所述数据。In step 602, the data transmission apparatus as the sender may convert the data carried by the bit sequence corresponding to the packet length of the radio frame into a value corresponding to the ASCII character, according to the value corresponding to the converted ASCII character. Determining a value of a data field in a bit sequence corresponding to a packet length of the radio frame, so that a data field in a bit sequence corresponding to a packet length of the radio frame carries the data.
步骤603中,作为发送方的数据传输装置可根据步骤602中所确定出的包长对应的比特序列,生成相应长度的无线帧。通常情况下,无线帧的帧头部分
和帧校验部分的长度是固定不变的,因此可通过调整帧实体部分的长度,使得生成的无线帧的长度与步骤602所确定出的包长对应的比特序列所表示的长度相等。In step 603, the data transmission apparatus as the sender can generate a radio frame of a corresponding length according to the bit sequence corresponding to the packet length determined in step 602. Usually, the header portion of a wireless frame
The length of the frame check portion is fixed, so that the length of the generated frame portion can be made equal to the length represented by the bit sequence corresponding to the packet length determined in step 602 by adjusting the length of the frame entity portion.
进一步地,在步骤602中,作为发送方的数据传输装置还可根据所述无线帧在所属分组内的序号,确定所述无线帧的包长对应的比特序列中序号域的比特位的取值,所述序号域中比特位的取值在第一取值范围内,所述第一取值范围与第二取值范围没有交叠,或者所述第一取值范围内不包含第一取值,其中,若无线帧的包长对应的比特序列中的序号域的比特位的取值在所述第二取值范围内或者为所述第一取值,则该无线帧的包长对应的比特序列中的数据域的比特位用来承载分组号。Further, in step 602, the data transmission apparatus as the sender may further determine the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame according to the sequence number of the radio frame in the belonging packet. The value of the bit in the sequence number field is in the first value range, the first value range does not overlap with the second value range, or the first value range does not include the first value a value, wherein, if the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the second value range or is the first value, the packet length of the radio frame corresponds to The bits of the data field in the bit sequence are used to carry the packet number.
举例来说,以图3a和图3b所示的无线帧的包长对应的比特序列的格式为例,作为发送方的数据传输装置可根据当前数据帧在所属分组内的序号设置包长对应的比特序列中的序号域的比特位的取值,结合该比特位序列中的数据域的比特位的取值,得到该比特序列的取值,即,当前数据帧的包长。For example, taking the format of the bit sequence corresponding to the packet length of the radio frame shown in FIG. 3a and FIG. 3b as an example, the data transmission apparatus as the sender can set the packet length according to the sequence number of the current data frame in the belonging packet. The value of the bit of the sequence number field in the bit sequence is combined with the value of the bit of the data field in the bit sequence to obtain the value of the bit sequence, that is, the packet length of the current data frame.
进一步地,作为发送方的数据传输装置还可在发送所述无线帧之前或之后发送以下无线帧:该无线帧的包长对应的比特序列中的数据域的比特位的取值在第四取值范围内,所述第四取值范围为分组序号的取值范围,所述第四取值范围与第三取值范围没有交叠,所述第三取值范围为需要使用无线帧的包长对应的比特序列承载的数据所对应的取值范围。Further, the data transmission apparatus as the sender may further transmit the following radio frame before or after transmitting the radio frame: the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is taken in the fourth Within the value range, the fourth value range is a value range of the packet sequence number, the fourth value range does not overlap with the third value range, and the third value range is a packet that needs to use a radio frame. The range of values corresponding to the data carried by the corresponding bit sequence.
举例来说,以图3a和图3b所示的无线帧的包长对应的比特序列的格式为例,作为发送方的数据传输装置决定发送分组帧时,确定该分组帧的分组号,分组号的取值范围为[0,31],根据该分组号设置该分组帧的包长对应的比特序列中的数据域的比特位的取值。将该分组帧的包长对应的比特序列中的序号域的比特位的取值设置为11或者设置为[11,16]范围内的任意一个整数,以便用来标识该无线帧为分组帧。其中,数据帧的包长对应的比特序列中的数据域的比特位取值范围是[32,126],与分组帧的包长对应的比特序列中的数据域的比
特位的取值范围没有交叠。For example, taking the format of the bit sequence corresponding to the packet length of the radio frame shown in FIG. 3a and FIG. 3b as an example, when the data transmission apparatus as the sender determines to transmit the packet frame, the packet number of the packet frame, the packet number is determined. The value ranges from [0, 31], and the value of the bit of the data field in the bit sequence corresponding to the packet length of the packet frame is set according to the packet number. The value of the bit field of the sequence number in the bit sequence corresponding to the packet length of the packet frame is set to 11 or set to any integer within the range of [11, 16], so as to identify the radio frame as a packet frame. The bit range of the data field in the bit sequence corresponding to the packet length of the data frame is [32, 126], and the ratio of the data field in the bit sequence corresponding to the packet length of the packet frame.
The range of values of the special bits does not overlap.
一个数据帧的包长对应的比特序列中的数据域通常可承载一个字节,比如一个ASCII字符,如果需要由包长对应的比特序列承载的数据包含多个字节,比如多个ASCII字符,则可以使用相应数量的数据帧的包长对应的比特序列来承载该多个字节的数据。图5示例性地示出了用多个数据帧的包长对应的比特序列承载多个字节数据的示意图,图中字节1至字节n表示需要通过无线帧的包长传输的数据,比如,一个字节可代表一个ASCII字符。The data field in the bit sequence corresponding to the packet length of a data frame can usually carry one byte, such as an ASCII character. If the data carried by the bit sequence corresponding to the packet length needs to contain multiple bytes, such as multiple ASCII characters, Then, the bit sequence corresponding to the packet length of the corresponding number of data frames can be used to carry the data of the multiple bytes. FIG. 5 exemplarily shows a schematic diagram of carrying a plurality of byte data by a bit sequence corresponding to a packet length of a plurality of data frames, where byte 1 to byte n represent data to be transmitted through a packet length of the radio frame, For example, a byte can represent an ASCII character.
优选地,可将上述实施例应用于无线网络接入的场景,在该场景下,所述需要由无线帧的包长对应的比特序列承载的数据可包括:用于进行无线网络接入的账户信息,或者无线网络的接入密码,比如可以是无线局域网的接入密码。Preferably, the foregoing embodiment may be applied to a scenario of wireless network access, in which the data that needs to be carried by the bit sequence corresponding to the packet length of the radio frame may include: an account for performing wireless network access. Information, or access password of the wireless network, such as an access password of a wireless local area network.
本申请的上述实施例中,由于通过无线帧的包长对应的比特序列的数据域承载需要发送给接入方的数据,使得接收方能够根据无线帧的包长对应的比特序列获取需要的数据。尤其在接入无线局域网的场景下,发送方可将无线局域网的账户信息承载在无线帧的包长对应的比特序列发送给接收方,使得接收方获得无线局域网的账户信息,从而可接入无线局域网。另外,由于无线帧的包长对应的比特序列中的序号域的比特位数大于3,由于包长对应的比特序列中的序号域可用来标识无线帧在所在分组内的序号,因此通过该长度的序号域,使得每个分组内包含较多数量的无线帧,也就是说,可以每间隔较多数量的无线帧发送一个作为分组间隔的无线帧,而作为分组间隔的无线帧的数量越少,越能降低因作为分组间隔的无线帧丢失而导致的对接收方接收效率的影响。In the foregoing embodiment of the present application, since the data domain of the bit sequence corresponding to the packet length of the radio frame carries data that needs to be sent to the access side, the receiver can acquire the required data according to the bit sequence corresponding to the packet length of the radio frame. . Especially in the scenario of accessing the wireless local area network, the sender can send the account information of the wireless local area network to the receiver according to the bit sequence corresponding to the packet length of the wireless frame, so that the receiver obtains the account information of the wireless local area network, thereby enabling wireless access. local area network. In addition, since the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is greater than 3, since the sequence number field in the bit sequence corresponding to the packet length can be used to identify the sequence number of the radio frame in the group, the length is passed. The sequence number field is such that each packet contains a larger number of radio frames, that is, a radio frame as a packet interval can be transmitted every time a larger number of radio frames are separated, and the number of radio frames as a packet interval is smaller. The more it is possible to reduce the reception efficiency of the receiver due to the loss of the radio frame as the packet interval.
需要说明的是,采用本申请实施例可通过包长对应的比特序列承载各种需要的数据发送给接收方。比如,这些数据包括但不限于:数据字节数(即总长)、标志位(flag)、SSID的长度、SSID、接入密码的长度、接入密码、帧校验序列等。其中,数据字节数(总长)、标志位(flag)、SSID的长度以及接入密码的长度,可分别占用1个字节,帧校验序列的可占用2个字节,SSID以及接入密码可分别占用多个字节。
It should be noted that, in the embodiment of the present application, various required data may be carried by the bit sequence corresponding to the packet length and sent to the receiver. For example, the data includes, but is not limited to, the number of data bytes (ie, the total length), the flag (flag), the length of the SSID, the SSID, the length of the access password, the access password, the frame check sequence, and the like. The number of data bytes (total length), the flag (flag), the length of the SSID, and the length of the access password can occupy 1 byte respectively, and the frame check sequence can occupy 2 bytes, SSID and access. The password can occupy multiple bytes each.
其中,无线帧的标志位序列可定义如下:Wherein, the sequence of flag bits of the radio frame can be defined as follows:
bit7:固定为0;Bit7: fixed to 0;
bit6至bit5:保留字段;Bit6 to bit5: reserved field;
bit4至bit3:协议版本,当前版本00;Bit4 to bit3: protocol version, current version 00;
bit2至bit1:载荷(payload)信息加密方式,00表示无加密,01表示流密码(stream cipher);Bit2 to bit1: payload information encryption mode, 00 means no encryption, 01 means stream cipher;
bit0:是否包含SSID。Bit0: Whether to include the SSID.
为了更清楚地理解本申请的上述实施例,下面以图3a和图3b所示的无线帧的包长对应的比特序列格式为例,描述无线网络接入的场景下,通过无线帧的包长对应的比特序列承载用于接入无线局域网的账户信息的过程。For a more clear understanding of the foregoing embodiment of the present application, the bit sequence format corresponding to the packet length of the radio frame shown in FIG. 3a and FIG. 3b is taken as an example to describe the packet length of the radio frame in the scenario of wireless network access. The corresponding bit sequence carries the process of accessing account information for the wireless local area network.
该场景为:智能家居设备通过移动终端获取无线局域网的账户信息以接入无线局域网。The scenario is: the smart home device obtains the account information of the wireless local area network through the mobile terminal to access the wireless local area network.
该过程可描述为:移动终端上安装有应用程序,该应用程序的功能是可以采用本申请上述实施例的方式将无线局域网的账户信息通过无线帧的包长对应的比特序列发送。智能家居设备上安装有相应的应用程序,该应用程序的功能是可以采用本申请上述实施例的方式接收无线帧,并获得无线帧的包长对应的比特序列所承载的无线局域网的账户信息。The process can be described as follows: an application is installed on the mobile terminal, and the function of the application is that the account information of the wireless local area network can be sent through the bit sequence corresponding to the packet length of the wireless frame in the manner of the foregoing embodiment of the present application. A corresponding application is installed on the smart home device, and the function of the application is that the wireless frame can be received in the manner of the foregoing embodiment of the present application, and the account information of the wireless local area network carried by the bit sequence corresponding to the packet length of the wireless frame is obtained.
当移动终端和智能家居设备上安装的上述应用程序开启后,移动终端获取无线局域网的账户信息,该账户信息包括:SSID为1234,接入密码为abcd。该账户信息可通过多种方式被移动终端获得,比如,移动终端上缓存有该账户信息或者通过人工方式输入该账户信息。After the application installed on the mobile terminal and the smart home device is turned on, the mobile terminal acquires account information of the wireless local area network, where the account information includes: the SSID is 1234, and the access password is abcd. The account information can be obtained by the mobile terminal in various ways, for example, the account information is cached on the mobile terminal or the account information is manually input.
移动终端顺序发送18个无线帧,其中,每10个无线帧发送一个用来间隔分组的无线帧。其中,发送方和接收方可约定第2至第5个无线帧的包长对应的比特序列分别用来承载总长度信息、flag、SSID的长度信息、接入密码的长度信息,其后的无线帧的包长对应的比特序列依次用来传输SSID和接入密码的ASCII字符,最后2个无线帧的包长对应的比特序列用来承载帧检验序列。
发送方发送的无线帧包括:The mobile terminal sequentially transmits 18 radio frames, wherein each 10 radio frames transmits a radio frame for spacing packets. The sender and the receiver may agree that the bit sequences corresponding to the packet lengths of the second to fifth radio frames are respectively used to carry the total length information, the length of the flag, the SSID, the length information of the access password, and the subsequent wireless. The bit sequence corresponding to the packet length of the frame is used to transmit the ASCII character of the SSID and the access code in turn, and the bit sequence corresponding to the packet length of the last two radio frames is used to carry the frame check sequence.
The radio frames sent by the sender include:
无线帧1的包长对应的比特序列中的序号域的比特位的取值为1011,数据域的比特位的取值为0000000,该值表示第一个分组的分组号;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 1 is 1011, and the value of the bit in the data field is 0000000, and the value indicates the packet number of the first packet;
无线帧2的包长对应的比特序列中的序号域的比特位的取值为0001,数据域的比特位的取值为0001110,该值表示总长度信息,十进制取值为14,因为总长度信息、flag、SSID长度信息、接入密码长度信息、帧校验序列、4个ASCII字符的SSID以及4个ASCII字符的接入密码共计占用14个字节;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 2 is 0001, and the value of the bit in the data field is 0001110. The value represents the total length information, and the decimal value is 14 because of the total length. Information, flag, SSID length information, access password length information, frame check sequence, SSID of 4 ASCII characters, and access codes of 4 ASCII characters occupy a total of 14 bytes;
无线帧3的包长对应的比特序列中的序号域的比特位的取值为0010,数据域的比特位的取值为0000000,该值表示flag标志位的取值;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 3 is 0010, and the value of the bit in the data field is 0000000, which represents the value of the flag flag bit;
无线帧4的包长对应的比特序列中的序号域的比特位的取值为0011,数据域的比特位的取值为0000100,该值表示SSID由4个ASCII字符组成;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 4 is 0011, and the value of the bit in the data field is 0000100, which indicates that the SSID is composed of 4 ASCII characters;
无线帧5的包长对应的比特序列中的序号域的比特位的取值为0100,数据域的比特位的取值为0000100,该值表示接入密码由4个ASCII字符组成;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 5 is 0100, and the value of the bit in the data field is 0000100, which indicates that the access password is composed of 4 ASCII characters;
无线帧6的包长对应的比特序列中的序号域的比特位的取值为0101,数据域的比特位的取值为0110001,该值表示SSID的第一个ASCII字符为1;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 6 is 0101, and the value of the bit in the data field is 0110001, which indicates that the first ASCII character of the SSID is 1;
无线帧7的包长对应的比特序列中的序号域的比特位的取值为0110,数据域的比特位的取值为0110010,该值表示SSID的第二个ASCII字符为2;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 7 is 0110, and the value of the bit in the data field is 0110010, which indicates that the second ASCII character of the SSID is 2;
无线帧8的包长对应的比特序列中的序号域的比特位的取值为0111,数据域的比特位的取值为0110011,该值表示SSID的第三个ASCII字符为3;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 8 is 0111, and the value of the bit in the data field is 0110011, which indicates that the third ASCII character of the SSID is 3;
无线帧9的包长对应的比特序列中的序号域的比特位的取值为1000,数据域的比特位的取值为0110100,该值表示SSID的第四个ASCII字符为4;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 9 is 1000, and the value of the bit in the data field is 0110100, which indicates that the fourth ASCII character of the SSID is 4;
无线帧10的包长对应的比特序列中的序号域的比特位的取值为1001,数据域的比特位的取值为1100001,该值表示接入密码的第一个ASCII字符为a;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 10 is 1001, and the value of the bit in the data field is 1100001, which indicates that the first ASCII character of the access password is a;
无线帧11的包长对应的比特序列中的序号域的比特位的取值为1010,数据域的比特位的取值为1100010,该值表示接入密码的第二个ASCII字符为b;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 11 is 1010, and the value of the bit in the data field is 1100010, which indicates that the second ASCII character of the access password is b;
无线帧12的包长对应的比特序列中的序号域的比特位的取值为1011,数
据域的比特位的取值为0000010,该值表示第二个分组的分组号;The bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame 12 is 1011, and the number is
The value of the bit of the field is 0000010, and the value represents the packet number of the second packet;
无线帧13的包长对应的比特序列中的序号域的比特位的取值为0001,数据域的比特位的取值为1100011,该值表示接入密码的第三个ASCII字符为c;The bit length of the sequence number corresponding to the packet length of the radio frame 13 is 0001, and the value of the bit of the data field is 1100011, which indicates that the third ASCII character of the access password is c;
无线帧14的包长对应的比特序列中的序号域的比特位的取值为0010,数据域的比特位的取值为1100100,该值表示接入密码的第四个ASCII字符为d;The value of the bit field in the bit sequence corresponding to the packet length of the radio frame 14 is 0010, and the value of the bit in the data field is 1100100, which indicates that the fourth ASCII character of the access password is d;
无线帧15的包长对应的比特序列中的序号域的比特位的取值为0011,数据域的比特位的取值为7比特的校验值;The bit length of the sequence number field in the bit sequence corresponding to the packet length of the radio frame 15 is 0011, and the bit value of the data field is a check value of 7 bits;
无线帧16的包长对应的比特序列中的序号域的比特位的取值为0100,数据域的比特位的取值为7比特的校验值。The bit length of the sequence number field in the bit sequence corresponding to the packet length of the radio frame 16 is 0100, and the bit value of the data field is a check value of 7 bits.
智能家居设备接收上述无线帧后,分别计算出每个无线帧的包长,将包长的取值转换为二进制序列,根据每个数据帧的包长对应的二进制序列中的数据域的比特位的取值得到相应的长度信息、flag、帧校验序列以及SSID和接入密码的ASCII字符,并根据数据帧的包长对应的二进制序列中的序号域的比特位的取值以及分组帧的包长对应的二进制序列中的数据域的比特位的取值,确定SSID和接入密码的ASCII字符的拼装顺序,从而得到完整的SSID和接入密码,进而可使用该账户信息接入无线局域网。After receiving the wireless frame, the smart home device separately calculates the packet length of each radio frame, converts the value of the packet length into a binary sequence, and according to the bit length of the data field in the binary sequence corresponding to the packet length of each data frame. The value of the corresponding length information, flag, frame check sequence, and ASCII characters of the SSID and the access code are obtained, and the value of the bit field in the binary sequence corresponding to the packet length of the data frame and the packet frame are The value of the bit of the data field in the binary sequence corresponding to the packet length determines the assembly order of the ASCII characters of the SSID and the access password, thereby obtaining the complete SSID and the access password, and thus the account information can be used to access the wireless local area network. .
基于相同的技术构思,本申请实施例还提供了一种作为数据接收方的数据传输装置,以及一种作为数据发送方的数据传输装置。Based on the same technical concept, the embodiment of the present application further provides a data transmission device as a data receiver, and a data transmission device as a data sender.
参见图7,为本申请实施例提供的数据传输装置的结构示意图。该数据传输装置可作为数据接收方,执行前述的数据传输流程。所述数据传输装置设置有无线模块,比如Wi-Fi模块,能够接收和处理无线帧。比如,该数据传输装置可以是智能家居设备或嵌入式设备等。FIG. 7 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application. The data transmission device can act as a data receiver to perform the aforementioned data transmission process. The data transmission device is provided with a wireless module, such as a Wi-Fi module, capable of receiving and processing radio frames. For example, the data transmission device may be a smart home device or an embedded device.
如图所示,该数据传输装置可包括:接收模块701、第一确定模块702、第二确定模块703、第三确定模块704,其中:As shown in the figure, the data transmission device may include: a receiving module 701, a first determining module 702, a second determining module 703, and a third determining module 704, where:
接收模块701,用于接收无线帧;The receiving module 701 is configured to receive a radio frame.
第一确定模块702,用于确定所述无线帧的包长,所述无线帧的包长对应
的比特序列包括序号域和数据域,所述序号域的比特位数至少大于3;The first determining module 702 is configured to determine a packet length of the radio frame, where a packet length of the radio frame corresponds to
The bit sequence includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
第二确定模块703,用于根据所述无线帧的包长对应的比特序列中的序号域和/或数据域的比特位的取值,确定所述无线帧的包长对应的比特序列是否用来承载数据;The second determining module 703 is configured to determine, according to the value of the sequence number field and/or the bit field of the data field in the bit sequence corresponding to the packet length of the radio frame, whether the bit sequence corresponding to the packet length of the radio frame is used. To carry data;
第三确定模块704,用于在第二确定模块703确定为是的情况下,根据所述无线帧的包长对应的比特序列中的数据域的比特位的取值,确定所述无线帧的包长对应的比特序列所承载的数据。The third determining module 704 is configured to determine, according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame, in the case that the second determining module 703 determines that the value is YES. The data carried by the bit sequence corresponding to the packet length.
其中,所述序号域位于包长对应的比特序列中的高比特位部分,所述数据域位于包长对应的比特序列中的低比特位部分。The sequence number field is located in a high-bit portion of a bit sequence corresponding to a packet length, and the data field is located in a low-bit portion of a bit sequence corresponding to a packet length.
其中,所述无线帧为802.11协议定义的无线帧,所述序号域的比特位数为4,所述数据域的比特位数为7。The radio frame is a radio frame defined by the 802.11 protocol, where the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
其中,所述无线帧的包长对应的比特序列所承载的数据包括:用于进行无线网络接入的账户信息,或者无线网络的接入密码。The data carried by the bit sequence corresponding to the packet length of the radio frame includes: account information used for performing wireless network access, or an access password of the wireless network.
优选地,第三确定模块704可具体用于:根据所述无线帧的包长对应的比特序列中数据域的比特位的取值确定ASCII字符,并将确定出的ASCII字符确定为所述无线帧的包长对应的比特序列所承载的数据。Preferably, the third determining module 704 is specifically configured to: determine an ASCII character according to a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame, and determine the determined ASCII character as the wireless The data carried by the bit sequence corresponding to the packet length of the frame.
优选地,第二确定模块703可具体用于:若所述无线帧的包长对应的比特序列中序号域的比特位的取值在第一取值范围内,则确定所述无线帧的包长对应的比特序列用来承载数据,其中,所述无线帧的包长对应的比特序列中序号域的比特位的取值用于标识所述无线帧在所属分组内的序号。Preferably, the second determining module 703 is specifically configured to: if the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the first value range, determine the packet of the radio frame The bit sequence corresponding to the long bit is used to carry data, wherein the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is used to identify the sequence number of the radio frame in the belonging packet.
进一步地,第二确定模块703还可用于:若所述无线帧的包长对应的比特序列中序号域的比特位的取值在第二取值范围内或为第一取值,则确定所述无线帧的包长对应的比特序列用来承载分组号,其中,所述第二取值范围与所述第一取值范围没有交叠,所述第一取值不在所述第一取值范围内。Further, the second determining module 703 is further configured to: if the value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the second value range or is the first value, determine The bit sequence corresponding to the packet length of the radio frame is used to carry the packet number, where the second value range does not overlap with the first value range, and the first value is not in the first value. Within the scope.
优选地,第二确定模块703可具体用于:若所述无线帧的包长对应的比特序列中数据域的比特位的取值在第三取值范围内,则确定所述无线帧的包长对
应的比特序列用来承载数据,所述第三取值范围为需要由无线帧的包长对应的比特序列承载的数据所对应的取值范围。Preferably, the second determining module 703 is specifically configured to: if the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is within a third value range, determine the packet of the radio frame Long pair
The bit sequence is used to carry data, and the third value range is a value range corresponding to data to be carried by the bit sequence corresponding to the packet length of the radio frame.
进一步地,第二确定模块703还可用于:若所述无线帧的包长对应的比特序列中数据域的比特位的取值在第四取值范围内,则确定所述无线帧的包长对应的比特序列用来承载分组号,所述第四取值范围为分组序号的取值范围,所述第三取值范围与所述第四取值范围没有交叠。Further, the second determining module 703 is further configured to determine, if the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is within a fourth value range, determine a packet length of the radio frame. The corresponding bit sequence is used to carry the packet number, and the fourth value range is the value range of the packet sequence number, and the third value range does not overlap with the fourth value range.
参见图8,为本申请实施例提供的数据传输装置的结构示意图。该数据传输装置可作为数据发送方,执行前述的数据传输流程。所述数据传输装置设置有无线模块,比如Wi-Fi模块,能够发送和处理无线帧。比如,该数据传输装置可以是移动终端或者可以是无线路由器或家庭网关等。FIG. 8 is a schematic structural diagram of a data transmission apparatus according to an embodiment of the present application. The data transmission device can act as a data sender to perform the aforementioned data transmission process. The data transmission device is provided with a wireless module, such as a Wi-Fi module, capable of transmitting and processing radio frames. For example, the data transmission device may be a mobile terminal or may be a wireless router or a home gateway or the like.
如图8所示,该装置可包括:获取模块801、确定模块802、生成模块803以及发送模块804,其中:As shown in FIG. 8, the apparatus may include: an obtaining module 801, a determining module 802, a generating module 803, and a sending module 804, where:
获取模块801,用于获取需要由无线帧的包长对应的比特序列承载的数据;The obtaining module 801 is configured to acquire data that needs to be carried by a bit sequence corresponding to a packet length of the radio frame;
确定模块802,用于根据获取到的数据,确定无线帧的包长对应的比特序列,使所述无线帧的包长对应的比特序列中的数据域承载所述数据,其中,所述无线帧的包长对应的比特序列中包含序号域和数据域,所述序号域的比特位数至少大于3;a determining module 802, configured to determine, according to the acquired data, a bit sequence corresponding to a packet length of the radio frame, so that the data field in the bit sequence corresponding to the packet length of the radio frame carries the data, where the radio frame The bit sequence corresponding to the packet length includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;
生成模块803,用于根据所述无线帧的包长生成所述无线帧;;The generating module 803 is configured to generate the radio frame according to a packet length of the radio frame;
发送模块804,用于发送所述无线帧。The sending module 804 is configured to send the radio frame.
其中,所述序号域位于包长对应的比特序列中的高比特位部分,所述数据域位于包长对应的比特序列中的低比特位部分。The sequence number field is located in a high-bit portion of a bit sequence corresponding to a packet length, and the data field is located in a low-bit portion of a bit sequence corresponding to a packet length.
其中,所述无线帧为802.11协议定义的无线帧,所述序号域的比特位数为4,所述数据域的比特位数为7。The radio frame is a radio frame defined by the 802.11 protocol, where the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
其中,所述需要由无线帧的包长对应的比特序列承载的数据包括:用于进行无线网络接入的账户信息,或者无线网络的接入密码。The data that needs to be carried by the bit sequence corresponding to the packet length of the radio frame includes: account information for performing wireless network access, or an access password of the wireless network.
优选地,确定模块802可具体用于:将获取到的数据转换为ASCII字符对
应的取值,根据转换后的ASCII字符对应的取值,确定所述无线帧的包长对应的比特序列中数据域的取值,使所述无线帧的包长对应的比特序列中的数据域承载所述数据。Preferably, the determining module 802 is specifically configured to: convert the acquired data into an ASCII character pair.
The value of the data field in the bit sequence corresponding to the packet length of the radio frame is determined according to the value corresponding to the converted ASCII character, so that the data in the bit sequence corresponding to the packet length of the radio frame is determined. The domain carries the data.
进一步地,确定模块802还可用于:根据所述无线帧在所属分组内的序号,确定所述无线帧的包长对应的比特序列中序号域的比特位的取值,所述序号域中比特位的取值在第一取值范围内,所述第一取值范围与第二取值范围没有交叠,或者所述第一取值范围内不包含第一取值,其中,若无线帧的包长对应的比特序列中的序号域的比特位的取值在所述第二取值范围内或者为所述第一取值,则该无线帧的包长对应的比特序列中的数据域的比特位用来承载分组号。Further, the determining module 802 is further configured to: determine, according to the sequence number of the radio frame in the belonging packet, a value of a bit field in a bit sequence corresponding to a packet length of the radio frame, where the bit number in the sequence number field The value of the bit is in the first value range, the first value range does not overlap with the second value range, or the first value range does not include the first value, where the radio frame If the value of the bit of the sequence number field in the bit sequence corresponding to the packet length is within the second value range or is the first value, the data field in the bit sequence corresponding to the packet length of the radio frame The bits are used to carry the packet number.
进一步地,发送模块804可还用于:在发送所述无线帧之前或之后发送一下无线帧:该无线帧的包长对应的比特序列中的数据域的比特位的取值在第四取值范围内,所述第四取值范围为分组序号的取值范围,所述第四取值范围与第三取值范围没有交叠,所述第三取值范围为需要使用无线帧的包长对应的比特序列承载的数据所对应的取值范围。Further, the sending module 804 may be further configured to: send a radio frame before or after transmitting the radio frame: a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame is at a fourth value In the range, the fourth value range is a value range of the packet sequence number, the fourth value range does not overlap with the third value range, and the third value range is a packet length of the radio frame to be used. The range of values corresponding to the data carried by the corresponding bit sequence.
综上所述,由于通过无线帧的包长对应的比特序列的数据域承载需要发送给接入方的数据,使得接收方能够根据无线帧的包长对应的比特序列获取需要的数据。尤其在接入无线局域网的场景下,发送方可将无线局域网的账户信息承载在无线帧的包长对应的比特序列发送给接收方,使得接收方获得无线局域网的账户信息,从而可接入无线局域网。另外,由于无线帧的包长对应的比特序列中的序号域的比特位数大于3,由于包长对应的比特序列中的序号域可用来标识无线帧在所在分组内的序号,因此通过该长度的序号域,使得每个分组内包含较多数量的无线帧,也就是说,可以每间隔较多数量的无线帧发送一个作为分组间隔的无线帧,而作为分组间隔的无线帧的数量越少,越能降低因作为分组间隔的无线帧丢失而导致的对接收方接收效率的影响。In summary, since the data domain of the bit sequence corresponding to the packet length of the radio frame carries data to be transmitted to the access side, the receiver can acquire the required data according to the bit sequence corresponding to the packet length of the radio frame. Especially in the scenario of accessing the wireless local area network, the sender can send the account information of the wireless local area network to the receiver according to the bit sequence corresponding to the packet length of the wireless frame, so that the receiver obtains the account information of the wireless local area network, thereby enabling wireless access. local area network. In addition, since the bit number of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is greater than 3, since the sequence number field in the bit sequence corresponding to the packet length can be used to identify the sequence number of the radio frame in the group, the length is passed. The sequence number field is such that each packet contains a larger number of radio frames, that is, a radio frame as a packet interval can be transmitted every time a larger number of radio frames are separated, and the number of radio frames as a packet interval is smaller. The more it is possible to reduce the reception efficiency of the receiver due to the loss of the radio frame as the packet interval.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产
品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其它可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其它可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is made with reference to a method, a device (system), and a computer program according to an embodiment of the present application.
The flow chart and/or block diagram of the product is described. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其它可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其它可编程数据处理设备上,使得在计算机或其它可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其它可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiment of the present application has been described, it will be apparent that those skilled in the art can make further changes and modifications to the embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and the modifications and
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。
It will be apparent to those skilled in the art that various modifications and changes can be made in the present application without departing from the spirit and scope of the application. Thus, it is intended that the present invention cover the modifications and variations of the present invention.
Claims (32)
- 一种数据传输方法,其特征在于,包括:A data transmission method, comprising:接收无线帧;Receiving a radio frame;确定所述无线帧的包长,所述无线帧的包长对应的比特序列包括序号域和数据域,所述序号域的比特位数至少大于3;Determining a packet length of the radio frame, where a bit sequence corresponding to a packet length of the radio frame includes a sequence number field and a data field, where the number of bits in the sequence number field is at least greater than 3;根据所述无线帧的包长对应的比特序列中的序号域和/或数据域的比特位的取值,确定所述无线帧的包长对应的比特序列是否用来承载数据;Determining, according to the value of the sequence number field and/or the bit field of the data field in the bit sequence corresponding to the packet length of the radio frame, whether the bit sequence corresponding to the packet length of the radio frame is used to carry data;若确定为是,则根据所述无线帧的包长对应的比特序列中的数据域的比特位的取值,确定所述无线帧的包长对应的比特序列所承载的数据。If the determination is yes, the data carried by the bit sequence corresponding to the packet length of the radio frame is determined according to the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame.
- 如权利要求1所述的方法,其特征在于,所述序号域位于包长对应的比特序列中的高比特位部分,所述数据域位于包长对应的比特序列中的低比特位部分。The method according to claim 1, wherein said sequence number field is located in a high bit portion of a bit sequence corresponding to a packet length, and said data field is located in a low bit portion of a bit sequence corresponding to a packet length.
- 如权利要求1或2所述的方法,其特征在于,所述无线帧为802.11协议定义的无线帧,所述序号域的比特位数为4,所述数据域的比特位数为7。The method according to claim 1 or 2, wherein the radio frame is a radio frame defined by the 802.11 protocol, the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- 如权利要求1至3中任一项所述的方法,其特征在于,所述根据所述无线帧的包长对应的比特序列中的数据域的比特位的取值,确定所述无线帧的包长对应的比特序列所承载的数据,包括:The method according to any one of claims 1 to 3, wherein the determining the radio frame according to the value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame The data carried by the bit sequence corresponding to the packet length includes:根据所述无线帧的包长对应的比特序列中数据域的比特位的取值确定ASCII字符;Determining an ASCII character according to a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame;将确定出的ASCII字符确定为所述无线帧的包长对应的比特序列所承载的数据。The determined ASCII character is determined as data carried by the bit sequence corresponding to the packet length of the radio frame.
- 如权利要求1所述的方法,其特征在于,所述根据所述无线帧的包长对应的比特序列中序号域的比特位的取值,确定所述无线帧的包长对应的比特序列是否用来承载数据,包括:The method according to claim 1, wherein the determining whether the bit sequence corresponding to the packet length of the radio frame is based on a value of a bit of a sequence number field in a bit sequence corresponding to a packet length of the radio frame Used to carry data, including:若所述无线帧的包长对应的比特序列中序号域的比特位的取值在第一取值范围内,则确定所述无线帧的包长对应的比特序列用来承载数据,其中,所 述无线帧的包长对应的比特序列中序号域的比特位的取值用于标识所述无线帧在所属分组内的序号。If the value of the bit field of the bit sequence corresponding to the packet length of the radio frame is within the first value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry data, where The value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is used to identify the sequence number of the radio frame within the belonging packet.
- 如权利要求5所述的方法,其特征在于,还包括:The method of claim 5, further comprising:若所述无线帧的包长对应的比特序列中序号域的比特位的取值在第二取值范围内或为第一取值,则确定所述无线帧的包长对应的比特序列用来承载分组号,其中,所述第二取值范围与所述第一取值范围没有交叠,所述第一取值不在所述第一取值范围内。Determining, if the value of the bit of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the second value range or the first value, determining a bit sequence corresponding to the packet length of the radio frame is used. And carrying the packet number, where the second value range does not overlap with the first value range, and the first value is not in the first value range.
- 如权利要求1所述的方法,其特征在于,所述根据所述无线帧的包长对应的比特序列中数据域的比特位的取值,确定所述无线帧的包长对应的比特序列是否用来承载业务数据,包括:The method according to claim 1, wherein the determining whether the bit sequence corresponding to the packet length of the radio frame is based on a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame Used to carry business data, including:若所述无线帧的包长对应的比特序列中数据域的比特位的取值在第三取值范围内,则确定所述无线帧的包长对应的比特序列用来承载数据,所述第三取值范围为需要由无线帧的包长对应的比特序列承载的数据所对应的取值范围。If the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the third value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry data, where The value range of the three values is a range of values corresponding to the data carried by the bit sequence corresponding to the packet length of the radio frame.
- 如权利要求7所述的方法,其特征在于,还包括:The method of claim 7 further comprising:若所述无线帧的包长对应的比特序列中数据域的比特位的取值在第四取值范围内,则确定所述无线帧的包长对应的比特序列用来承载分组号,所述第四取值范围为分组序号的取值范围,所述第三取值范围与所述第四取值范围没有交叠。If the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the fourth value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry the packet number, The fourth value range is a value range of the packet sequence number, and the third value range does not overlap with the fourth value range.
- 如权利要求1至8中任一项所述的方法,其特征在于,所述无线帧的包长对应的比特序列所承载的数据包括:用于进行无线网络接入的账户信息,或者无线网络的接入密码。The method according to any one of claims 1 to 8, wherein the data carried by the bit sequence corresponding to the packet length of the radio frame comprises: account information for performing wireless network access, or a wireless network Access password.
- 一种数据传输方法,其特征在于,包括:A data transmission method, comprising:获取需要由无线帧的包长对应的比特序列承载的数据;Obtaining data that needs to be carried by a bit sequence corresponding to a packet length of the radio frame;根据获取到的数据,确定无线帧的包长对应的比特序列,使所述无线帧的包长对应的比特序列中的数据域承载所述数据,其中,所述无线帧的包长对应 的比特序列中包含序号域和数据域,所述序号域的比特位数至少大于3;Determining, according to the acquired data, a bit sequence corresponding to a packet length of the radio frame, and causing the data field in the bit sequence corresponding to the packet length of the radio frame to carry the data, where the packet length of the radio frame corresponds to The bit sequence includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;根据所述无线帧的包长生成所述无线帧;Generating the radio frame according to a packet length of the radio frame;发送所述无线帧。Sending the radio frame.
- 如权利要求10所述的方法,其特征在于,所述序号域位于包长对应的比特序列中的高比特位部分,所述数据域位于包长对应的比特序列中的低比特位部分。The method according to claim 10, wherein said sequence number field is located in a high bit portion of a bit sequence corresponding to a packet length, and said data field is located in a low bit portion of a bit sequence corresponding to a packet length.
- 如权利要求10或11所述的方法,其特征在于,所述无线帧为802.11协议定义的无线帧,所述序号域的比特位数为4,所述数据域的比特位数为7。The method according to claim 10 or 11, wherein the radio frame is a radio frame defined by the 802.11 protocol, the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- 如权利要求10至12中任一项所述的方法,其特征在于,所述根据获取到的数据,确定无线帧的包长对应的比特序列,使所述无线帧的包长对应的比特序列中的数据域承载所述数据,包括:The method according to any one of claims 10 to 12, wherein the determining, according to the acquired data, a bit sequence corresponding to a packet length of a radio frame, and a bit sequence corresponding to a packet length of the radio frame The data domain in the middle carries the data, including:将获取到的数据转换为ASCII字符对应的取值;Convert the obtained data into the value corresponding to the ASCII character;根据转换后的ASCII字符对应的取值,确定所述无线帧的包长对应的比特序列中数据域的取值,使所述无线帧的包长对应的比特序列中的数据域承载所述数据。And determining, according to the value corresponding to the converted ASCII character, the value of the data field in the bit sequence corresponding to the packet length of the radio frame, so that the data field in the bit sequence corresponding to the packet length of the radio frame carries the data .
- 如权利要求10所述的方法,其特征在于,所述根据获取到的数据,确定无线帧的包长对应的比特序列的过程中,还包括:The method according to claim 10, wherein the determining the bit sequence corresponding to the packet length of the radio frame according to the acquired data further includes:根据所述无线帧在所属分组内的序号,确定所述无线帧的包长对应的比特序列中序号域的比特位的取值,所述序号域中比特位的取值在第一取值范围内,所述第一取值范围与第二取值范围没有交叠,或者所述第一取值范围内不包含第一取值,其中,若无线帧的包长对应的比特序列中的序号域的比特位的取值在所述第二取值范围内或者为所述第一取值,则该无线帧的包长对应的比特序列中的数据域的比特位用来承载分组号。Determining, according to the sequence number of the radio frame in the group, the value of the bit field in the bit sequence corresponding to the packet length of the radio frame, where the value of the bit field in the sequence number field is in the first value range The first value range does not overlap with the second value range, or the first value range does not include the first value, where the sequence number in the bit sequence corresponding to the packet length of the radio frame If the value of the bit of the field is within the second value range or is the first value, the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is used to carry the packet number.
- 如权利要求10所述的方法,其特征在于,在发送所述无线帧之前或之后还包括发送以下无线帧:The method of claim 10, further comprising transmitting the following radio frame before or after transmitting the radio frame:该无线帧的包长对应的比特序列中的数据域的比特位的取值在第四取值 范围内,所述第四取值范围为分组序号的取值范围,所述第四取值范围与第三取值范围没有交叠,所述第三取值范围为需要使用无线帧的包长对应的比特序列承载的数据所对应的取值范围。The value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the fourth value. In the range, the fourth value range is a value range of the packet sequence number, the fourth value range does not overlap with the third value range, and the third value range is a packet length of the radio frame to be used. The range of values corresponding to the data carried by the corresponding bit sequence.
- 如权利要求10至15中任一项所述的方法,其特征在于,所述需要由无线帧的包长对应的比特序列承载的数据包括:用于进行无线网络接入的账户信息,或者无线网络的接入密码。The method according to any one of claims 10 to 15, wherein the data to be carried by the bit sequence corresponding to the packet length of the radio frame comprises: account information for performing wireless network access, or wireless Network access password.
- 一种数据传输装置,其特征在于,包括:A data transmission device, comprising:接收模块,用于接收无线帧;a receiving module, configured to receive a wireless frame;第一确定模块,用于确定所述无线帧的包长,所述无线帧的包长对应的比特序列包括序号域和数据域,所述序号域的比特位数至少大于3;a first determining module, configured to determine a packet length of the radio frame, where a bit sequence corresponding to a packet length of the radio frame includes a sequence number field and a data field, where the number of bits in the sequence number field is at least greater than 3;第二确定模块,用于根据所述无线帧的包长对应的比特序列中的序号域和/或数据域的比特位的取值,确定所述无线帧的包长对应的比特序列是否用来承载数据;a second determining module, configured to determine, according to a value of a sequence number field and/or a bit field of a data field in a bit sequence corresponding to a packet length of the radio frame, whether a bit sequence corresponding to a packet length of the radio frame is used Carrying data;第三确定模块,用于在所述第二确定模块确定为是的情况下,根据所述无线帧的包长对应的比特序列中的数据域的比特位的取值,确定所述无线帧的包长对应的比特序列所承载的数据。a third determining module, configured to determine, according to a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame, in a case that the second determining module determines to be YES The data carried by the bit sequence corresponding to the packet length.
- 如权利要求17所述的装置,其特征在于,所述序号域位于包长对应的比特序列中的高比特位部分,所述数据域位于包长对应的比特序列中的低比特位部分。The apparatus according to claim 17, wherein said sequence number field is located in a high bit portion of a bit sequence corresponding to a packet length, and said data field is located in a low bit portion of a bit sequence corresponding to a packet length.
- 如权利要求17或18所述的装置,其特征在于,所述无线帧为802.11协议定义的无线帧,所述序号域的比特位数为4,所述数据域的比特位数为7。The device according to claim 17 or 18, wherein the radio frame is a radio frame defined by the 802.11 protocol, the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- 如权利要求17至19中任一项所述的装置,其特征在于,所述第三确定模块具体用于:The apparatus according to any one of claims 17 to 19, wherein the third determining module is specifically configured to:根据所述无线帧的包长对应的比特序列中数据域的比特位的取值确定ASCII字符;Determining an ASCII character according to a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame;将确定出的ASCII字符确定为所述无线帧的包长对应的比特序列所承载 的数据。Determining the determined ASCII character as being carried by the bit sequence corresponding to the packet length of the radio frame The data.
- 如权利要求17所述的装置,其特征在于,所述第二确定模块具体用于:The device according to claim 17, wherein the second determining module is specifically configured to:若所述无线帧的包长对应的比特序列中序号域的比特位的取值在第一取值范围内,则确定所述无线帧的包长对应的比特序列用来承载数据,其中,所述无线帧的包长对应的比特序列中序号域的比特位的取值用于标识所述无线帧在所属分组内的序号。If the value of the bit field of the bit sequence corresponding to the packet length of the radio frame is within the first value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry data, where The value of the bit field of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is used to identify the sequence number of the radio frame within the belonging packet.
- 如权利要求21所述的装置,其特征在于,所述第二确定模块还用于:The device of claim 21, wherein the second determining module is further configured to:若所述无线帧的包长对应的比特序列中序号域的比特位的取值在第二取值范围内或为第一取值,则确定所述无线帧的包长对应的比特序列用来承载分组号,其中,所述第二取值范围与所述第一取值范围没有交叠,所述第一取值不在所述第一取值范围内。Determining, if the value of the bit of the sequence number field in the bit sequence corresponding to the packet length of the radio frame is within the second value range or the first value, determining a bit sequence corresponding to the packet length of the radio frame is used. And carrying the packet number, where the second value range does not overlap with the first value range, and the first value is not in the first value range.
- 如权利要求17所述的装置,其特征在于,所述第二确定模块具体用于:The device according to claim 17, wherein the second determining module is specifically configured to:若所述无线帧的包长对应的比特序列中数据域的比特位的取值在第三取值范围内,则确定所述无线帧的包长对应的比特序列用来承载数据,所述第三取值范围为需要由无线帧的包长对应的比特序列承载的数据所对应的取值范围。If the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the third value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry data, where The value range of the three values is a range of values corresponding to the data carried by the bit sequence corresponding to the packet length of the radio frame.
- 如权利要求23所述的装置,其特征在于,所述第二确定模块还用于:The device of claim 23, wherein the second determining module is further configured to:若所述无线帧的包长对应的比特序列中数据域的比特位的取值在第四取值范围内,则确定所述无线帧的包长对应的比特序列用来承载分组号,所述第四取值范围为分组序号的取值范围,所述第三取值范围与所述第四取值范围没有交叠。If the value of the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is in the fourth value range, determining that the bit sequence corresponding to the packet length of the radio frame is used to carry the packet number, The fourth value range is a value range of the packet sequence number, and the third value range does not overlap with the fourth value range.
- 如权利要求17至24中任一项所述的装置,其特征在于,所述无线帧的包长对应的比特序列所承载的数据包括:用于进行无线网络接入的账户信息,或者无线网络的接入密码。 The device according to any one of claims 17 to 24, wherein the data carried by the bit sequence corresponding to the packet length of the radio frame comprises: account information for performing wireless network access, or a wireless network Access password.
- 一种数据传输装置,其特征在于,包括:A data transmission device, comprising:获取模块,用于获取需要由无线帧的包长对应的比特序列承载的数据;An acquiring module, configured to acquire data that needs to be carried by a bit sequence corresponding to a packet length of a radio frame;确定模块,用于根据获取到的数据,确定无线帧的包长对应的比特序列,使所述无线帧的包长对应的比特序列中的数据域承载所述数据,其中,所述无线帧的包长对应的比特序列中包含序号域和数据域,所述序号域的比特位数至少大于3;a determining module, configured to determine, according to the acquired data, a bit sequence corresponding to a packet length of the radio frame, so that the data field in the bit sequence corresponding to the packet length of the radio frame carries the data, where the radio frame The bit sequence corresponding to the packet length includes a sequence number field and a data field, and the number of bits in the sequence number field is at least greater than 3;生成模块,用于根据所述无线帧的包长生成所述无线帧;a generating module, configured to generate the radio frame according to a packet length of the radio frame;发送模块,用于发送所述无线帧。And a sending module, configured to send the wireless frame.
- 如权利要求26所述的装置,其特征在于,所述序号域位于包长对应的比特序列中的高比特位部分,所述数据域位于包长对应的比特序列中的低比特位部分。The apparatus according to claim 26, wherein said sequence number field is located in a high bit portion of a bit sequence corresponding to a packet length, and said data field is located in a low bit portion of a bit sequence corresponding to a packet length.
- 如权利要求26或27所述的装置,其特征在于,所述无线帧为802.11协议定义的无线帧,所述序号域的比特位数为4,所述数据域的比特位数为7。The apparatus according to claim 26 or 27, wherein the radio frame is a radio frame defined by the 802.11 protocol, the number of bits in the sequence number field is 4, and the number of bits in the data field is 7.
- 如权利要求26至28中任一项所述的装置,其特征在于,所述确定模块具体用于:The apparatus according to any one of claims 26 to 28, wherein the determining module is specifically configured to:将获取到的数据转换为ASCII字符对应的取值;Convert the obtained data into the value corresponding to the ASCII character;根据转换后的ASCII字符对应的取值,确定所述无线帧的包长对应的比特序列中数据域的取值,使所述无线帧的包长对应的比特序列中的数据域承载所述数据。And determining, according to the value corresponding to the converted ASCII character, the value of the data field in the bit sequence corresponding to the packet length of the radio frame, so that the data field in the bit sequence corresponding to the packet length of the radio frame carries the data .
- 如权利要求26所述的装置,其特征在于,所述确定模块还用于:The device of claim 26, wherein the determining module is further configured to:根据所述无线帧在所属分组内的序号,确定所述无线帧的包长对应的比特序列中序号域的比特位的取值,所述序号域中比特位的取值在第一取值范围内,所述第一取值范围与第二取值范围没有交叠,或者所述第一取值范围内不包含第一取值,其中,若无线帧的包长对应的比特序列中的序号域的比特位的取值在所述第二取值范围内或者为所述第一取值,则该无线帧的包长对应的比特序列中的数据域的比特位用来承载分组号。 Determining, according to the sequence number of the radio frame in the group, the value of the bit field in the bit sequence corresponding to the packet length of the radio frame, where the value of the bit field in the sequence number field is in the first value range The first value range does not overlap with the second value range, or the first value range does not include the first value, where the sequence number in the bit sequence corresponding to the packet length of the radio frame If the value of the bit of the field is within the second value range or is the first value, the bit of the data field in the bit sequence corresponding to the packet length of the radio frame is used to carry the packet number.
- 如权利要求26所述的装置,其特征在于,所述发送模块还用于:The device of claim 26, wherein the sending module is further configured to:在发送所述无线帧之前或之后发送一下无线帧:该无线帧的包长对应的比特序列中的数据域的比特位的取值在第四取值范围内,所述第四取值范围为分组序号的取值范围,所述第四取值范围与第三取值范围没有交叠,所述第三取值范围为需要使用无线帧的包长对应的比特序列承载的数据所对应的取值范围。Transmitting a radio frame before or after transmitting the radio frame: a value of a bit of a data field in a bit sequence corresponding to a packet length of the radio frame is in a fourth value range, and the fourth value range is The value range of the packet sequence number, the fourth value range does not overlap with the third value range, and the third value range is the data corresponding to the data sequence carried by the bit sequence corresponding to the packet length of the radio frame. Range of values.
- 如权利要求26至31中任一项所述的装置,其特征在于,所述需要由无线帧的包长对应的比特序列承载的数据包括:用于进行无线网络接入的账户信息,或者无线网络的接入密码。 The apparatus according to any one of claims 26 to 31, wherein the data to be carried by the bit sequence corresponding to the packet length of the radio frame comprises: account information for performing wireless network access, or wireless Network access password.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510051618.5A CN105991214B (en) | 2015-01-30 | 2015-01-30 | A kind of data transmission method and its device |
CN201510051618.5 | 2015-01-30 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016119624A1 true WO2016119624A1 (en) | 2016-08-04 |
Family
ID=56542400
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/071550 WO2016119624A1 (en) | 2015-01-30 | 2016-01-21 | Data transmission method and apparatus thereof |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105991214B (en) |
WO (1) | WO2016119624A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111541521A (en) * | 2020-05-07 | 2020-08-14 | 上海道生物联技术有限公司 | Data packet length identification method and system |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107548163B (en) * | 2017-08-07 | 2020-12-11 | 重庆邮电大学 | Reliable terahertz wireless personal area network access method with high time slot utilization rate |
CN111555855B (en) * | 2020-05-22 | 2022-11-11 | 乐鑫信息科技(上海)股份有限公司 | Wireless transmission method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1816979A (en) * | 2003-07-01 | 2006-08-09 | 摩托罗拉公司(在特拉华州注册的公司) | Method, apparatus and system for use in controlling transmission power during wireless communication |
CN101964675A (en) * | 2009-07-22 | 2011-02-02 | 华为技术有限公司 | Method for transmitting precoding control instruction (PCI) information and user equipment (UE) |
CN102790659A (en) * | 2012-07-18 | 2012-11-21 | 福建先创通信有限公司 | Method for transmitting data packet in mobile communication system |
US20130136157A1 (en) * | 2011-11-29 | 2013-05-30 | Electronics And Telecommunications Research Institute | Method for transmitting and receiving wireless signal in wireless communication system and apparatus for the same |
CN103973397A (en) * | 2013-01-29 | 2014-08-06 | 中兴通讯股份有限公司 | Method for sending and receiving ACK/NACK information, base station and terminals |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103763757A (en) * | 2014-01-23 | 2014-04-30 | 上海汉枫电子科技有限公司 | Method for rapid networking based on internet-of-thing embedded type Wi-Fi module |
CN104270744B (en) * | 2014-09-28 | 2019-03-15 | 杭州雄迈信息技术有限公司 | The rapid configuration system and method for wireless network |
-
2015
- 2015-01-30 CN CN201510051618.5A patent/CN105991214B/en active Active
-
2016
- 2016-01-21 WO PCT/CN2016/071550 patent/WO2016119624A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1816979A (en) * | 2003-07-01 | 2006-08-09 | 摩托罗拉公司(在特拉华州注册的公司) | Method, apparatus and system for use in controlling transmission power during wireless communication |
CN101964675A (en) * | 2009-07-22 | 2011-02-02 | 华为技术有限公司 | Method for transmitting precoding control instruction (PCI) information and user equipment (UE) |
US20130136157A1 (en) * | 2011-11-29 | 2013-05-30 | Electronics And Telecommunications Research Institute | Method for transmitting and receiving wireless signal in wireless communication system and apparatus for the same |
CN102790659A (en) * | 2012-07-18 | 2012-11-21 | 福建先创通信有限公司 | Method for transmitting data packet in mobile communication system |
CN103973397A (en) * | 2013-01-29 | 2014-08-06 | 中兴通讯股份有限公司 | Method for sending and receiving ACK/NACK information, base station and terminals |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111541521A (en) * | 2020-05-07 | 2020-08-14 | 上海道生物联技术有限公司 | Data packet length identification method and system |
Also Published As
Publication number | Publication date |
---|---|
CN105991214A (en) | 2016-10-05 |
CN105991214B (en) | 2019-08-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10165446B2 (en) | Methods and systems for enabling communication with a receiver device in a network | |
CN103945369B (en) | A kind of length by checking WIFI packets realizes the Internet-surfing configuration method of WIFI equipment | |
KR101859923B1 (en) | Data communication via data packet headers | |
US8165080B2 (en) | Addressing schemes for wireless communication | |
CN104703176B (en) | Configuration method of wireless network, intelligent terminal and wireless network equipment | |
EP3445094A1 (en) | Wifi configuration method, wifi mobile terminal, and wifi device | |
EP3066813B1 (en) | Apparatus and methods for mac header compression | |
US10701524B2 (en) | Multicast transmission method, information extraction method and corresponding terminal and device | |
CN102291398B (en) | Data compression and decompression method, apparatus and system in wireless telecommunication system | |
CN105119900B (en) | Information secure transmission method, networking cut-in method and corresponding terminal | |
CN106412886A (en) | Method, device and system for secure access of intelligent device to wireless network | |
CN103327030A (en) | Method for information transmission by utilizing Wi-Fi (Wireless-Fidelity) message length | |
CN103841523A (en) | Information transmission method for conducting Wi-Fi message length based on multicast physical address | |
WO2016119624A1 (en) | Data transmission method and apparatus thereof | |
CN105120454B (en) | Information transferring method, networking cut-in method and corresponding terminal | |
CA2924394C (en) | Apparatus and methods for separated security implementations in wireless communications | |
CN102348203B (en) | Method for realizing encryption synchronization | |
CN106060801B (en) | Data communication method, device and system based on Wi-Fi device | |
CN105763516B (en) | The method and apparatus that terminal sends data to net external equipment out of WLAN | |
CN114500167B (en) | Information processing method and device, electronic equipment and storage medium | |
CN104753690B (en) | A kind of information processing method and electronic equipment | |
WO2024092838A1 (en) | Data transmission method and apparatus | |
CN117202313A (en) | Automatic network distribution method and related device for intelligent equipment | |
CN115038066A (en) | Data transmission method, data transmission device, related equipment and storage medium | |
Adi | A Review of LoRaWAN Performance Server Advanced Security |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16742686 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16742686 Country of ref document: EP Kind code of ref document: A1 |