A Dynamic Encapsulation Algorithm for Wireless Data Transmission

The dynamic packaging algorithm splits user data into small packet data sequences, making full use of the residual packet space, solving the problems of wasted channel resources and reduced transmission rate in wireless transmission of data links, and achieving efficient channel utilization and data transmission rate improvement.

CN114258082BActive Publication Date: 2025-06-20THE 20TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111513898.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-11-18
Filing Date
2021-12-13
Publication Date
2025-06-20
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

When the data link conducts wireless transmission and communication of big data, the length of the tail packet after the user data is unpacked and packaged cannot perfectly fill the wireless transmission data packet, resulting in wasted channel resources and a reduced data transmission rate.

Method used

The dynamic packaging algorithm is used to split the user data into several small packet data sequences, and determine whether to store small packet data based on the length of the remaining packets, making full use of the remaining packet space generated during each data encapsulation of the sending end to improve channel utilization.

Benefits of technology

Through dynamic packaging algorithms, channel capacity can be effectively utilized, data transmission rate can be improved, channel resource waste can be reduced, and channel resource waste is suitable for wireless transmission needs of large amounts of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114258082B_ABST
    Figure CN114258082B_ABST
Patent Text Reader

Abstract

The present invention provides a dynamic encapsulation algorithm for wireless data transmission. The entire packet of data received by the user from the serial port or network port, that is, the user data packet, is defined as a number of small packet data sequences. According to the remaining packet length obtained from the previous unpacking, it is judged whether the remaining packet can store a small packet of data. If it can store, this small packet of data is used as the first packet; otherwise, the next wireless data packet is used as the first packet. Data encapsulation processing is performed on the current user data packet, including first packet processing, middle packet processing, and last packet processing in sequence until all user data packets are processed. The present invention uses a dynamic encapsulation algorithm, which can make the best use of each storage space of the channel to the greatest extent under the condition of unchanged channel capacity, while improving the data transmission rate and having high code portability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data link communication transmission, and involves various technologies such as channel utilization, wireless network, information transmission, and data processing. Background Art

[0002] With the continuous in-depth promotion of data link in communication applications, the importance of data link as a necessary means for major platforms to communicate has gradually emerged. When the data link performs big data wireless transmission communication, the size of the data transmitted by users through the serial port or network port often does not match the size of the wireless transmission data packet designed by the actual channel waveform. Therefore, on the premise of ensuring the accuracy of the communication process and not changing the channel waveform, it is necessary to perform unpacking and encapsulation processing on the user data received at the sending end in units of the length of the wireless transmission data packet. However, the length of the tail packet after unpacking and encapsulating the user data is often uneven and cannot perfectly fill a wireless transmission data packet, resulting in multiple empty bytes in the wireless transmission data packet. The current encapsulation method for wireless transmission of data in the data link directly vacates the remaining packets generated by these tail packets that cannot fully occupy the wireless transmission data packet, and fills the first packet of each packet of user data directly from the starting byte of the wireless transmission data packet. This will result in wasting some channel resources for each transmission of a packet of user data. Although the advantage is that the implementation of data encapsulation at the sending end is simpler and easier to implement, when transmitting a large amount of data, the wasted channel resources will increase accordingly, and at the same time, it also increases the time for wireless data transmission and reduces the data transmission rate. Summary of the Invention

[0003] In order to overcome the deficiencies of the prior art, the present invention provides a dynamic encapsulation algorithm for wireless transmission of data, which can meet the needs of the data link system for wireless transmission of data when the length of user data is variable but the FPGA waveform does not need to be changed, and improves the channel utilization rate and data transmission rate during the data transmission process, and has the characteristics of strong portability, high practicability, and simple implementation.

[0004] The technical solutions adopted by the present invention to solve its technical problems include the following steps:

[0005] Step 1, define the whole packet of data received by the user from the serial port or network port, that is, the user data packet, into several small packet data sequences. Each small packet data includes a packet header, valid data, and a packet tail; the packet header at least includes a first packet serial number, a small packet serial number, a head and tail packet identifier, and the length of the valid data in the small packet; the packet tail is verification data; the first packet is the first packet in the small packet data sequence, and the tail packet is the last packet in the small packet data sequence;

[0006] Step 2: According to the remaining packet length obtained from the previous unpacking, determine whether the remaining packet can store a small packet of data. If it can store, use this small packet of data as the first packet; otherwise, leave the remaining packet empty and use the next wireless data packet as the first packet.

[0007] Based on the data length of the current user data packet and the wireless data packet length, calculate the number of unpacked packets of the current user data packet, the length of the first packet, the number of middle packets, the length of the last packet, and the remaining packet length.

[0008] Step 3: Perform data encapsulation processing on the current user data packet, including first packet processing, middle packet processing, and last packet processing in sequence.

[0009] For the above-mentioned first packet processing, according to the first packet length calculated in Step 2, intercept the corresponding length of data from the start of the current user data packet as the first packet valid data; after determining the values of the first packet sequence number, small packet sequence number, first / last packet flag, and small packet valid data length of the first packet data, generate a packet header; generate a CRC check value based on the first packet valid data as the packet tail; store the packet header, valid data, and packet tail together into the current wireless data packet.

[0010] For the above-mentioned middle packet processing, use the length of the wireless data packet excluding the fixed packet header and packet tail as the middle packet data length, and intercept the corresponding length of user data from the remaining data of the current user data packet one by one according to the number of middle packets calculated in Step 2 as the middle packet valid data; after determining the values of the first packet sequence number, small packet sequence number, first / last packet flag, and small packet valid data length of each middle packet one by one, generate a packet header; generate a CRC check value based on each middle packet valid data as the packet tail; store the packet header, valid data, and packet tail together into the current wireless data packet.

[0011] For the above-mentioned last packet processing, according to the last packet length calculated in Step 2, use the remaining data of the current user data packet as the last packet valid data; after determining the values of the first packet sequence number, small packet sequence number, first / last packet flag, and small packet valid data length, generate a packet header; generate a CRC check value based on the last packet valid data as the packet tail; store the packet header, valid data, and packet tail together into the current wireless data packet.

[0012] Step 4: If all user data packets have been processed, perform subsequent channel transmission tasks; otherwise, repeat Steps 2 and 3 until all are processed.

[0013] In the above-mentioned Step 2, when processing the first user data packet, the first packet starts to be stored from the start of the first wireless data packet.

[0014] The basis for the above-mentioned Step 2 to judge whether the remaining packet can store a small packet of data is that if the remaining packet length is greater than the sum of the header and tail lengths of a small packet, it can store a small packet of data.

[0015] The first packet sequence number is determined according to the sequence number of the user data packet where the small packet is located in the entire user data.

[0016] The small packet sequence number is determined according to the position of the small packet in the user data packet when unpacking.

[0017] The first / last packet flag is determined according to whether the small packet is the first packet and whether it is the last packet.

[0018] The CRC check value is a two-byte data obtained by calculating the CRC check value for the valid data content of the small packet.

[0019] The beneficial effect of the present invention is that when the user data packet cannot be perfectly filled into the wireless data packet (that is, it cannot be guaranteed that there is no remaining packet space after filling or the remaining packet space can hold a small packet of data), the remaining packet space generated during each data encapsulation at the sending end is fully utilized, and the channel capacity can be utilized to the greatest extent. Therefore, when a large amount of data is wirelessly transmitted in the data link system, compared with the traditional method of leaving the remaining packets empty in the sending end encapsulation algorithm, after using the dynamic encapsulation algorithm of the present invention, without changing the channel capacity, each storage space of the channel can be utilized to the greatest extent, and at the same time, the data transmission rate is improved.

[0020] The present invention realizes a dynamic encapsulation algorithm for wirelessly transmitting data. This method is particularly suitable for the wireless transmission requirements of a large amount of data. At the same time, it is not limited by the change of the channel capacity and the limitation of the user data length. It can flexibly meet the wireless data transmission requirements of different channel capacities and different user data formats, and has high code portability and strong applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flowchart of the method of the present invention;

[0022] Figure 2 is a schematic diagram of the frame structure format of the small packet data in the present invention;

[0023] Figure 3 is a schematic diagram of the encapsulation structure format of a complete user data packet in the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0024] The present invention will be further described below in conjunction with the drawings and embodiments. The present invention includes but is not limited to the following embodiments.

[0025] The present invention adapts to the wireless transmission requirements of a fixed channel transmission volume by dynamically changing the encapsulation format of the user big data. Without changing the physical layer waveform, the utilization rate of the channel and the data transmission rate are improved at the software level.

[0026] Before describing the operation steps of the present invention, some concept terms involved in the present invention are introduced as shown in Table 1.

[0027] Table 1 Concepts of the dynamic encapsulation method

[0028]

[0029]

[0030] The present invention includes dynamic encapsulation of sender data, which mainly includes the following steps:

[0031] Step 1, calculate the number of unpacked current user data packets

[0032] First, according to the remaining packet length obtained from the previous unpacking, determine whether a small packet of data can be stored. The judgment basis is: if the remaining packet length is greater than the sum of the header and tail lengths of a small packet, a small packet of data can be stored, and this small packet is used as the first packet; otherwise, if a small packet of data cannot be stored, the remaining packet is left empty, and the small packet of data of the next user data packet is stored starting from the beginning of the next wireless data packet and used as the first packet.

[0033] Then, according to the data length of the current user data packet and the length of the wireless data packet, calculate the number of unpacked current user data packets, the length of the first packet, the number of middle packets, the length of the last packet, and the remaining packet length.

[0034] Step 2, data encapsulation processing

[0035] 1. First packet processing

[0036] First, according to the length of the first packet calculated in Step 1, intercept the corresponding length of data from the start of the current user data packet as the valid data of the first packet; then, according to the principle of determining the header message elements in Table 1, determine the values of the first packet sequence number, small packet sequence number, first and last packet identifier, and the length of the valid data of the small packet in the first packet data, and generate the header data of the first packet; then, generate the CRC check value of the packet tail only for the valid data of the first packet according to the principle of determining the packet tail check value in Table 1; finally, store the header data of the first packet, the valid data of the first packet, and the packet tail check value data of the first packet into the current wireless data packet together, waiting for subsequent processing.

[0037] 2. Middle packet processing

[0038] First, according to the number of tundishes and the tundish data length calculated in Step 1 (i.e., the length of the wireless data packet excluding the fixed packet header and packet tail), user data of the corresponding length is intercepted one by one from the currently remaining user data packets as the valid data of the tundish. Then, according to the principle for determining the packet header message elements in Table 1, after determining the values of the first packet sequence number, small packet sequence number, head / tail packet identifier, and small packet valid data length for each tundish one by one, the tundish packet header data corresponding to each tundish is generated. Next, according to the principle for determining the packet tail check value in Table 1, the packet tail CRC check value only for the valid data of the tundish is generated for each tundish. Finally, the packet header data, valid data, and packet tail check value data of each tundish are stored into the wireless data packet one by one, waiting for subsequent processing.

[0039] 3. Tail Packet Processing

[0040] According to the tail packet length calculated in Step 1, all the currently remaining data packets of the user are used as the valid data of the tail packet. Then, according to the principle for determining the packet header message elements in Table 1, after determining the values of the first packet sequence number, small packet sequence number, head / tail packet identifier, and small packet valid data length, the tail packet header data is generated. Next, according to the principle for determining the packet tail check value in Table 1, the packet tail CRC check value only for the valid data of the tail packet is generated. Finally, the tail packet header data, the valid data of the tail packet, and the tail packet check value data are stored into the wireless data packet together, waiting for subsequent processing.

[0041] In Step 3, if all the user data packets have been processed, then perform the subsequent channel transmission task; otherwise, repeat Steps 1 and 2 until all are processed.

[0042] Suppose there is currently 30 MBytes of large data to be wirelessly transmitted, the size of the user data packet is 1500 Bytes, the size of the wireless transmission packet is 256 Bytes, and the transmission rate is 256 B / ms.

[0043] Table 2 Key Message Element Formats for the Dynamic Encapsulation Packet Header and Packet Tail

[0044]

[0045] Among them, the formats of the key message elements of the small packet header and packet tail are as shown in Table 2. The packet header length is 8 Bytes (including other message elements), and the packet tail length is 2 Bytes. Then, each wireless transmission packet can transmit at most 246 Bytes of valid data.

[0046] For 30 MB of data, with each packet being 1500 B, there are 20972 packets (actually 20971.52 packets, and packets less than one are counted as one) of user data.

[0047] [Step 1]

[0048] Since this is the first user data packet, the remaining packet length of the previous packet is 0. Therefore, the first packet will be stored starting from the beginning of the first wireless packet.

[0049] Unpacking calculation for the first user data packet: The number of unpacked packets is 7 (1500 = 246 * 6 + 220: 1 first packet, 5 middle packets, 1 last packet). Among them, the length of the first packet is 256B (256 = 246 + 10, 10B is the length of the packet header and trailer), the number of middle packets is 5, and the length of the last packet is 230B (230 = 220 + 10, 10B is the length of the packet header and trailer), and the remaining packet length is 26B (26 = 256 - 230).

[0050] [Step 2]

[0051] 1. First packet processing

[0052] According to the definition of the packet header message elements of the first packet of the first user data packet, determine that the first packet sequence number nFirSeq = 0, the small packet sequence number nSeq = 0, the first packet identifier nSOM = 1, the last packet identifier nEOM = 0, and the effective data length of the small packet nLen = 246, and generate the corresponding packet header data; then generate the packet trailer CRC check value according to the content of the first packet's effective data; finally, store the first packet's header, effective data, and packet trailer CRC check data into the first wireless packet.

[0053] 2. Middle packet processing

[0054] According to the definition of the packet header message elements of the 1st to 5th middle packets of the first user data packet, determine that the first packet sequence number FirSeq = 0, the small packet sequence number nSeq = 1 - 5 (sorted in the order of interception), the first packet identifier nSOM = 0, the last packet identifier nEOM = 0, and the effective data length of the small packet nLen = 246, and generate the corresponding packet header data; then generate the corresponding packet trailer CRC check value according to the middle packet's effective data; finally, store the first packet data, effective data, and packet trailer CRC check data of the 1st to 5th middle packets of the first user data packet into the 2nd to 6th wireless packets one by one.

[0055] 3. Last packet processing

[0056] According to the definition of the packet header message elements of the last packet of the first user data packet, determine that the first packet sequence number nFirSeq = 0, the small packet sequence number nSeq = 6, the first packet identifier nSOM = 0, the last packet identifier nEOM = 1, and the effective data length of the small packet nLen = 220, and generate the corresponding packet header data; then generate the packet trailer CRC check value according to the content of the last packet's effective data; finally, store the last packet's header, effective data, and packet trailer CRC check data into the 7th wireless packet.

[0057] [Step 3]

[0058] After processing the first packet, the middle packets, and the last packet respectively, finally, 6 filled wireless data packets (the 1st to the 6th) and 1 wireless data packet with a remaining packet length of 26B (the 7th) can be obtained. Among them, the 26B remaining packet can hold at most 16B of user data (10B must be used for the packet header and packet tail). Since not all user data has been processed yet, return to step 1 to continue processing the 2nd user data packet.

[0059] [Step 1]

[0060] After the processing of the 1st user data packet, a remaining packet with a length of 26B is generated in the 7th wireless data packet, and the length of the packet header and packet tail data is greater than 10B. Therefore, the first packet of the 2nd user data packet will be stored in the remaining packet space of the 7th wireless data packet.

[0061] Unpacking calculation for the 2nd user data packet: The number of unpacked packets is 7 (1500 = 16 + 256 * 5 + 204: 1 first packet, 5 middle packets, 1 last packet). Among them, the length of the first packet is 26B (26 = 16 + 10, 10B is the length of the packet header and packet tail), the number of middle packets is 5, and the length of the last packet is 214B (214 = 204 + 10, 10B is the length of the packet header and packet tail), and the remaining packet length is 42B (58 = 256 - 214).

[0062] [Step 2]

[0063] 1. First packet processing

[0064] According to the definition of the packet header message elements of the first packet of the 2nd user data packet, determine that the first packet sequence number nFirSeq = 1, the small packet sequence number nSeq = 0, the first packet identifier nSOM = 1, the last packet identifier nEOM = 0, and the small packet valid data length nLen = 16, and generate the corresponding packet header data; then generate the packet tail CRC check value according to the content of the first packet valid data; finally, store the first packet header, valid data, and packet tail CRC check data into the remaining packet space of the 7th wireless data packet.

[0065] 2. Middle packet processing

[0066] According to the definition of the packet header message elements of the 1st to 5th middle packets of the 2nd user data packet, determine that the first packet sequence number FirSeq = 1, the small packet sequence number nSeq = 1 to 5 (sorted in the order of interception), the first packet identifier nSOM = 0, the last packet identifier nEOM = 0, and the small packet valid data length nLen = 246, and generate the corresponding packet header data; then generate the corresponding packet tail CRC check value according to the middle packet valid data; finally, store the first packet data, valid data, and packet tail CRC check data of the 1st to 5th middle packets of the 2nd user data packet into the 8th to 12th wireless data packets one by one.

[0067] 3. Last packet processing

[0068] According to the definition of the header message element of the last packet of the second user data packet, determine that the first packet sequence number nFirSeq = 1, the small packet sequence number nSeq = 6, the first packet identifier nSOM = 0, the last packet identifier nEOM = 1, and the effective data length of the small packet nLen = 204, and generate the corresponding header data; then generate the CRC check value at the end of the packet according to the content of the effective data at the end of the packet; finally, store the header of the last packet, the effective data, and the CRC check data at the end of the packet into the 13th wireless data packet.

[0069] [Step 3]

[0070] After processing the first packet, the middle packets, and the last packet respectively, finally, 6 filled wireless data packets (the 7th to 12th) and 1 wireless data packet with a remaining packet length of 42B (the 13th) can be obtained. Among them, the 42B remaining packet can hold at most 32B of user data (10B must be used for the header and the end of the packet). Since the user data has not been fully processed, return to Step 1 to continue processing the second user data packet.

[0071] There are 20,972 user data packets for 30MB of user data. Therefore, after looping 20,972 times through the operation steps of dynamic encapsulation at the sending end, finally, 30MB (31,457,280 Bytes) of user data is calculated, and a total of 125,832 wireless transmission packets are sent, that is, 32,212,992 Bytes (equal to 125,832 * 256) of data.

[0072] If the traditional encapsulation algorithm is used, 7 wireless transmission packets (1500 / 246, rounded up) need to be sent for each user data packet. Then, to send 30MB (31,457,280 Bytes) of user data, 146,804 wireless transmission packets need to be sent, that is, 37,581,824 Bytes (equal to 146,804 * 256) of data.

[0073] Based on the above data, calculate the channel utilization rate and data transmission rate of the dynamic encapsulation algorithm and the traditional encapsulation algorithm of the present invention as shown in Table 3 below. Among them, the calculation formulas for the channel utilization rate and the data transmission rate are as follows:

[0074] Channel utilization rate = actual user data volume / wireless transmission data volume / 100 (unit: %)

[0075] Data transmission rate = actual user data volume / wireless transmission time (unit: Byte / ms)

[0076] Algorithm Channel utilization rate (%) Data transmission rate (Byte / ms) Dynamic encapsulation algorithm 97.654% 249.994B / ms Traditional encapsulation algorithm 83.703% 214.281B / ms

[0077] As can be seen from the table, when the total data volume is 30MB, the user data packet is 1500B, the wireless transmission packet is 256B, and the channel transmission rate is 256B / ms, the channel utilization rate of the dynamic encapsulation algorithm of the present invention can reach 97.654%, which is 14% higher than that of the traditional algorithm; the data sending rate can reach about 249.994B / ms, which is 35.713B / ms higher than that of the traditional algorithm, and the effect is remarkable.

[0078] Since a large number of redundant packets are generated but not used when the traditional algorithm is used to send the tail packet data by the user, the larger the redundant packet data generated when each packet of user data is sent, the lower the channel utilization rate and the slower the data sending rate. Therefore, when the wireless transmission packet of the channel is larger and the user data packet is smaller, the generated redundant packet data will be larger, resulting in a lower channel utilization rate and data sending rate. This is the drawback of the traditional encapsulation algorithm. However, the dynamic encapsulation algorithm of the present invention makes full use of the redundant packet space of the wireless transmission packet, so the channel utilization rate and data sending rate will be significantly improved.

Claims

1. A dynamic encapsulation method for wireless data transmission, characterized in that, It includes the following steps: Step 1: Define the entire packet of data received by the user from the serial port or network port, i.e., the user data packet, into several small packet data sequences. Each small packet data includes a packet header, valid data, and a packet tail. The packet header at least includes a first packet sequence number, a small packet sequence number, a head and tail packet identifier, and the length of the valid data in the small packet. The packet tail is the check data. The first packet is the first packet in the small packet data sequence, and the last packet is the last packet in the small packet data sequence. Step 2: According to the length of the remaining packet obtained from the previous unpacking, determine whether the remaining packet can store a small packet of data. If it can store, use this small packet of data as the first packet; otherwise, leave the remaining packet empty and use the next wireless data packet as the first packet. Calculate the number of unpacked packets, the length of the first packet, the number of middle packets, the length of the last packet, and the length of the remaining packet for the current user data packet based on the length of the current user data packet and the length of the wireless data packet. Step 3: Perform data encapsulation processing on the current user data packet, including first packet processing, middle packet processing, and last packet processing in sequence. For the first packet processing, according to the length of the first packet calculated in Step 2, intercept the corresponding length of data from the start of the current user data packet as the valid data of the first packet. After determining the values of the first packet sequence number, small packet sequence number, head and tail packet identifier, and the length of the valid data in the small packet for the first packet data, generate the packet header. Generate the CRC check value as the packet tail based on the valid data of the first packet. Store the packet header, valid data, and packet tail together into the current wireless data packet. For the middle packet processing, use the length of the wireless data packet excluding the fixed packet header and packet tail as the length of the middle packet data. According to the number of middle packets calculated in Step 2, sequentially intercept the corresponding length of user data from the remaining data of the current user data packet as the valid data of the middle packet. After determining the values of the first packet sequence number, small packet sequence number, head and tail packet identifier, and the length of the valid data in the small packet for each middle packet one by one, generate the packet header. Generate the CRC check value as the packet tail based on the valid data of each middle packet. Store the packet header, valid data, and packet tail together into the current wireless data packet. For the last packet processing, according to the length of the last packet calculated in Step 2, use the remaining data of the current user data packet as the valid data of the last packet. After determining the values of the first packet sequence number, small packet sequence number, head and tail packet identifier, and the length of the valid data in the small packet, generate the packet header. Generate the CRC check value as the packet tail based on the valid data of the last packet. Store the packet header, valid data, and packet tail together into the current wireless data packet. Step 4: If all user data packets are processed, perform subsequent channel transmission tasks; otherwise, repeat Steps 2 and 3 until all are processed.

2. The dynamic encapsulation method for wireless data transmission according to claim 1, characterized in that, When processing the first user data packet in Step 2, the first packet starts to be stored from the start of the first wireless data packet.

3. The dynamic encapsulation method for wireless data transmission according to claim 1, characterized in that, The basis for Step 2 to determine whether the remaining packet can store a small packet of data is that if the length of the remaining packet is greater than the sum of the lengths of the header and tail of a small packet, it can store a small packet of data.

4. The dynamic encapsulation method for wireless data transmission according to claim 1, characterized in that, The first packet sequence number is determined according to the sequence number of the user data packet where the small packet is located in the entire user data.

5. The dynamic encapsulation method for wireless data transmission according to claim 1, characterized in that, The small packet sequence number is determined according to the number of the small packet sequence number of the small packet in the user data packet during unpacking.

6. The dynamic encapsulation method for wireless data transmission according to claim 1, characterized in that, The head and tail packet identifier is determined based on whether the small packet belongs to the first packet and whether it belongs to the last packet.

7. The dynamic encapsulation method for wireless data transmission according to claim 1, characterized in that, The CRC check value is two-byte data obtained by calculating the CRC check value for the valid data content of the small packet.

Citation Information

Patent Citations

  • Data sending method and device, data receiving method and device and electronic equipment

    CN109756491A

  • Data transmission method and device

    CN111726777A