Inertial navigation communication data processing method and device, electronic equipment and computer readable storage medium
By filtering and compensating for incoherent packet serial numbers in the inertial navigation system, dynamic compensation for packet loss and data reorganization are realized, data integrity and real-time problems in packet loss scenarios are solved, and system performance and reliability are improved.
Patent Information
- Application Number
- CN202510845682.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-24
AI Technical Summary
In the inertial navigation system, data integrity is missing in packet loss scenarios, difficulty in identifying and data alignment of dynamic starting point, and insufficient parsing efficiency and fault tolerance in high dynamic environments, resulting in insufficient performance and reliability of the system in a high dynamic environment.
By receiving multi-packet data, it forms a packet sequence number and a status byte array, filters out inconsistent packet sequence numbers, deletes and compensates for lost data, real-time analysis by packet and dynamic reorganization of data blocks.
It improves the data processing performance and reliability of the system in complex communication scenarios, realizes dynamic compensation for packet loss and data reorganization, and ensures the integrity and real-time nature of data analysis.
Smart Images

Figure CN120378058A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of inertial technology, and particularly to an inertial navigation communication data processing method, device, electronic device, and computer-readable storage medium. Background Art
[0002] In an inertial navigation and motion parameter measurement system, the efficient parsing and synchronous display of multi-source sensor data are key technologies for improving the real-time performance and accuracy of the system. In the prior art, the communication protocol usually directly includes the pulse data of gyroscopes (gyros) and accelerometers (accelerometers), as well as information such as gyro differential frequency, sum frequency, light intensity voltage, and frequency stabilization voltage. Generally, if the check bit is correct, the data can be directly parsed according to the protocol. Even if the check is incorrect and data is lost, directly discarding the packet of data will not have any impact on the actual display. However, in some special cases where high-speed data needs to be transmitted, due to hardware limitations, to achieve the target rate, the byte length of each packet of data cannot be too long. Therefore, some data will be split into multiple packets by bytes for parsing. Correspondingly, when parsing the data, it should also be determined whether all bytes of the data are complete. For example, double-type data needs to be parsed into double-type data through 8 consecutive packets of data (such as sequence numbers 0-7 corresponding to differential frequency X, sequence numbers 8-15 corresponding to differential frequency Y, etc.) to achieve dynamic analysis. However, such systems face the following technical problems in practical applications: 1) Lack of data integrity in the case of packet loss: Traditional parsing methods rely on the strict continuity of data packets. When packet loss occurs due to an unstable communication link, the system usually adopts a simple discard strategy or waits for retransmission. However, this method is not applicable to cases where multi-packet data combination parsing is required. Directly discarding will cause incorrect parsing of key data. For example, if the data packets with sequence numbers 3-5 are lost, the data corresponding to sequence numbers 0-7 will be parsed incorrectly and cannot be recovered through dynamic compensation, seriously affecting the real-time performance and calculation accuracy.
[0003] 2) Difficulty in dynamic starting point identification and data alignment: The system needs to display the gyro and accelerometer pulse data and the multi-packet combination parsing data on the same screen, requiring the data to be aligned based on a fixed sequence number segment (such as 0-999). However, in actual communication, the data may start being transmitted from any sequence number (such as the starting sequence number being 500). Traditional methods need to rely on a global cache and traverse all the data to locate the starting point, resulting in processing delays and being unable to adapt to high-real-time scenarios (such as a 1ms sampling period). In addition, if the starting sequence number (such as 0) or the ending sequence number (999) is lost, the prior art lacks an effective boundary compensation mechanism, resulting in data splicing failure or display misalignment.
[0004] 3) Insufficient parsing efficiency and fault tolerance: The parsing parameters for multi-pack combination need to be parsed through the status bytes of 8 consecutive packets. However, existing methods mostly adopt a batch processing mode and cannot achieve real-time per-pack parsing. Meanwhile, in the case of packet loss or out-of-order scenarios, traditional technologies are difficult to dynamically reconstruct valid data segments (for example, when sequence number 4 is lost among sequence numbers 0 - 7, it is impossible to interpolate or predict using adjacent sequence numbers), resulting in lag or distortion of data calculation results.
[0005] In view of the above problems, existing technologies have significant deficiencies in real-time parsing, dynamic splicing, and fault tolerance mechanisms of multi-source data, and it is difficult to meet the stringent requirements for data integrity, real-time performance, and robustness in high-dynamic environments. Therefore, there is an urgent need for an innovative method that can achieve rapid positioning of dynamic starting points, packet loss compensation and data reconstruction, and real-time per-pack data parsing, so as to improve the system performance and reliability in complex communication scenarios. Summary of the Invention
[0006] In view of the problems in the background technology, the present invention proposes an inertial navigation communication data processing method to achieve dynamic packet loss compensation and data reconstruction, enabling the host computer to parse data in real time and truly per-pack, thereby improving the system performance and reliability in complex communication scenarios.
[0007] The present invention adopts the following technical solutions: An inertial navigation communication data processing method, comprising the following steps: 1) Receive multi-pack data transmitted by the slave computer, and obtain the packet sequence number and its corresponding status byte of each packet in the multi-pack data in the receiving order, forming a first packet sequence number array and its corresponding first status byte array; 2) Find the smallest packet sequence number and the largest packet sequence number of valid data in the first packet sequence number array, intercept the two and all the packet sequence numbers between them to form a second packet sequence number array, and intercept the status bytes corresponding to the sequence numbers in the second packet sequence number array in the first status byte array to form a second status byte array corresponding to the second packet sequence number array; 3) Screen out the discontinuous packet sequence numbers in the second packet sequence number array to form a discontinuous array; 4) Arrange the numbers 0 - N in order, with every L numbers as a data block, where N is the number of valid bytes of the packet sequence number and L is the length of the complete parsing byte; for each data in the discontinuous array, determine which data block the data is located in, determine and delete the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array, and determine and delete the sub-array of status bytes corresponding to the sub-array of packet sequence numbers in the second status byte array, and fill in the data block at the position of the deleted sub-array of packet sequence numbers in the second packet sequence number array, and fill in L zeros at the position of the deleted sub-array of status bytes in the second status byte array.
[0008] Optionally, in step 4), the process of determining the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array is as follows: Based on the first data of the data block, search for the data in the second packet sequence number array that is equal to the first data, or greater than the first data and closest in value to the first data, and determine it as the first data of the sub-array of packet sequence numbers corresponding to the data block. Based on the last data of the data block, search for the data in the second packet sequence number array that is equal to the last data, or less than the last data and closest in value to the last data, and determine it as the last data of the sub-array of packet sequence numbers corresponding to the data block. Determine the array composed of the first data, the last data, and the data between them in the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array as the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array.
[0009] Optionally, in step 4), the process of determining the sub-array of status bytes corresponding to the sub-array of packet sequence numbers in the second status byte array is as follows: Based on the index of the first data of the sub-array of packet sequence numbers in the second packet sequence number array, search for the data corresponding to the index in the second status byte array, and determine it as the first data of the sub-array of status bytes. Based on the index of the last data of the sub-array of packet sequence numbers in the second packet sequence number array, search for the data corresponding to the index in the second status byte array, and determine it as the last data of the sub-array of status bytes. Determine the array composed of the first data, the last data, and the data between them in the sub-array of status bytes in the second status byte array as the sub-array of status bytes corresponding to the sub-array of packet sequence numbers in the second status byte array.
[0010] Optionally, step 4) further includes: Assign a false variable to each data block. After step 4) is executed for a certain data in the discontinuous array, set the false variable of the data block corresponding to the data to true. When it is judged which data block the next data in the discontinuous array is located in, judge whether the false variable of the data block where the next data is located is true. If so, jump to the next data in the discontinuous array.
[0011] Optionally, step 3) specifically includes: For each packet sequence number in the second packet sequence number array, subtract the packet sequence number that is sorted before it from the said packet sequence number, and determine whether the obtained value is equal to 1. If so, skip to the next packet sequence number. If not, subtract the packet sequence number that is sorted before it from the said packet sequence number, and subtract 1 from the obtained value to get the number of packet sequence numbers M between the said packet sequence number and the packet sequence number before it. Add 1 to the said packet sequence number M times in a loop, and the value obtained by adding 1 each time in the loop is the packet sequence number between the said packet sequence number and the packet sequence number before it. Determine the packet sequence numbers between the said packet sequence number and the packet sequence number before it as the discontinuous packet sequence numbers in the second packet sequence number array.
[0012] Optionally, step 2) specifically includes: If the packet sequence number rollback count is greater than or equal to the sampling frequency, then: For the packet sequence numbers in the first packet sequence number array in index order, determine whether its value is equal to 0 or less than the value of the previous packet sequence number. If so, jump to step 2.1). If not, jump to step 2.2). Step 2.1): Determine the said packet sequence number as the smallest packet sequence number of the valid data in the first packet sequence number array, intercept all the data after the smallest packet sequence number of the valid data in the first packet sequence number array to form an intermediate packet sequence number array, and intercept the data corresponding to the smallest packet sequence number of the valid data in the first packet sequence number array and all the data after it in the first initial state byte array according to the index to form an intermediate state byte array; Judge the packet sequence numbers in the intermediate packet sequence number array in index order, and determine whether its value is greater than or equal to the number of valid bytes of the packet sequence number. If so and equal to the number of valid bytes of the packet sequence number, determine the said packet sequence number as the largest packet sequence number of the valid data in the first packet sequence number array. If so and greater than the number of valid bytes of the packet sequence number, determine the previous packet sequence number of it as the largest packet sequence number of the valid data in the first packet sequence number array, intercept all the data before the largest packet sequence number of the valid data in the intermediate packet sequence number to get the second packet sequence number array, and intercept the status bytes corresponding to each sequence number in the second packet sequence number array in the intermediate state byte array to form a second state byte array corresponding to the second packet sequence number array; If not, use the intermediate packet sequence number array and the intermediate state byte array for splicing with the multi-packet data at the next moment; Step 2.2): Determine whether the first packet sequence number in the first packet sequence number array is the smallest value in the first packet sequence number array. If so, determine the packet sequence numbers in the first packet sequence number array in index order, and determine whether their values are greater than or equal to the number of valid bytes of the packet sequence number. If so and equal to the number of valid bytes of the packet sequence number, determine that the packet sequence number is the largest packet sequence number of the valid data in the first packet sequence number array. If so and greater than the number of valid bytes of the packet sequence number, determine that the previous packet sequence number is the largest packet sequence number of the valid data in the first packet sequence number array. Intercept all the data before and including the largest packet sequence number of the valid data in the first packet sequence number array to obtain the second packet sequence number array, and intercept the status bytes corresponding to each sequence number in the second packet sequence number array in the first status byte array to form the second status byte array corresponding to the second packet sequence number array. If not, use the first packet sequence number array and the first status byte array for splicing with the multi-packet data at the next moment. If the packet sequence number rollback count is less than the sampling frequency, then: Reverse the first packet sequence number array and the first status byte array to obtain the initial reversed packet sequence number array and the initial reversed status byte array. Determine the packet sequence numbers in the initial reversed packet sequence number array in index order. If its value is equal to the number of valid bytes of the packet sequence number or greater than the value of the previous packet sequence number, determine that it is the largest packet sequence number in the first packet sequence number array. Intercept all the data after and including the largest packet sequence number in the initial reversed packet sequence number array to form the intermediate reversed packet sequence number array, and intercept all the data after and corresponding to the largest packet sequence number in the initial reversed packet sequence number array in the initial reversed status byte array according to the index to form the intermediate reversed status byte array. Determine the packet sequence numbers in the intermediate reversed packet sequence number array in index order. If its value is greater than the value of the previous packet sequence number, determine that the previous packet sequence number is the smallest packet sequence number in the first packet sequence number array. Intercept all the data before and including the smallest packet sequence number in the intermediate reversed packet sequence number array to form the final reversed packet sequence number array, and intercept all the data before and corresponding to the smallest packet sequence number in the intermediate reversed packet sequence number array in the intermediate reversed status byte array according to the index to form the final reversed status byte array. Reverse the final reversed packet sequence number array and the final reversed status byte array respectively to obtain the second packet sequence number array and its corresponding second status byte array.
[0013] Optionally, in the said step 1), the receiving the multi-packet data transmitted by the lower computer specifically includes: Receive the multi-packet data transmitted by the lower computer at the current moment and splice it with the remaining multi-packet data received and processed at the previous moment.
[0014] As a general inventive concept, the present invention also provides a device for implementing the above inertial navigation communication data processing method, including: A receiving module, configured to receive multi-packet data transmitted by a lower computer, obtain the packet sequence number of each packet of data and its corresponding status byte in the multi-packet data in the receiving order, and form a first packet sequence number array and its corresponding first status byte array; An intercepting module, configured to find the smallest packet sequence number of valid data and the largest packet sequence number of valid data in the first packet sequence number array, intercept the two and all packet sequence numbers therebetween, form a second packet sequence number array, and intercept the status bytes corresponding to the sequence numbers in the second packet sequence number array in the first status byte array to form a second status byte array corresponding to the second packet sequence number array; A screening module, configured to screen out the discontinuous packet sequence numbers in the second packet sequence number array to form a discontinuous array; A recombination module arranges the numbers 0-N in order, with every L numbers as a data block, where N is the number of valid bytes of the packet sequence number and L is the length of the complete parsing byte; for each data in the discontinuous array, determine which data block the data is located in, determine and delete the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array, and determine and delete the sub-array of status bytes corresponding to the sub-array of packet sequence numbers in the second status byte array, and fill in the data block at the position of the sub-array of packet sequence numbers deleted in the second packet sequence number array, and fill in L zeros at the position of the sub-array of status bytes deleted in the second status byte array.
[0015] As a general inventive concept, the present invention further provides an electronic device, where the electronic device includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the above-mentioned inertial navigation communication data processing method when executing the computer program.
[0016] As a general inventive concept, the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program implements the steps of the above-mentioned inertial navigation communication data processing method when executed by a processor.
[0017] Compared with the prior art, the advantages of the present invention are as follows: In the inertial navigation communication data processing method of the present invention, the valid packet sequence number range is divided into data blocks according to the length of the complete parsing byte. By screening out the discontinuous packet sequence numbers in the multi-packet data transmitted by the lower computer, all packet sequence numbers and status bytes included in the data block where the discontinuous packet sequence numbers are located in the transmitted data are deleted, and the corresponding complete data block is filled in at the position of the deleted packet sequence number, and multiple zeros equal to the length of the complete parsing byte are filled in at the position of the deleted status byte, so as to realize packet loss dynamic compensation and data recombination, enabling the upper computer to parse the data packet by packet in real time and truly, thereby improving the system performance and reliability in complex communication scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To facilitate a better understanding of the present invention, the present invention will be described in more detail by referring to the specific embodiments shown in the accompanying drawings. These drawings only depict typical embodiments of the present invention and should not be considered as limiting the scope of protection of the present invention.
[0019] Figure 1 It is a flowchart of the inertial navigation communication data processing method of the present invention.
[0020] Figure 2 It is a schematic diagram for finding the head serial number in Embodiment 1 of the present invention.
[0021] Figure 3 It is a schematic diagram for finding the tail serial number in Embodiment 1 of the present invention.
[0022] Figure 4 It is a schematic diagram for finding the discontinuous serial numbers in Embodiment 1 of the present invention.
[0023] Figure 5 It is a schematic diagram for replacing all the status byte of the data block where the discontinuous serial numbers are located with 0 in Embodiment 1 of the present invention.
[0024] Figure 6 It is a schematic diagram for obtaining the complete processed status byte data in Embodiment 1 of the present invention. Specific Embodiments
[0025] The following describes the embodiments of the present invention with reference to the accompanying drawings, so that those skilled in the art can better understand the present invention and be able to implement it. However, the listed embodiments are not intended to limit the present invention. Without conflict, the following embodiments and the technical features in the embodiments can be combined with each other, and the same components are represented by the same reference numerals.
[0026] Embodiment 1: An inertial navigation communication data processing method includes the following steps: 1) Receive multiple packets of data transmitted by the lower computer at the current moment, splice them with the remaining multiple packets of data received and processed at the previous moment, and obtain the packet serial number of each packet of data and its corresponding status byte in the multiple packets of data in the order of reception, so as to form a first packet serial number array and its corresponding first status byte array.
[0027] 2) Find the minimum packet serial number of the valid data and the maximum packet serial number of the valid data in the first packet serial number array, intercept both of them and all the packet serial numbers between them to form a second packet serial number array, and intercept the status bytes corresponding to the serial numbers in the second packet serial number array in the first status byte array to form a second status byte array corresponding to the second packet serial number array; the specific process is as follows: If the packet serial number rollback number is greater than or equal to the sampling frequency, then: For the packet sequence numbers in the first packet sequence number array in index order, determine whether their values are equal to 0 or less than the value of the previous packet sequence number. If so, jump to step 2.1); if not, jump to step 2.2). Step 2.1): Determine that the packet sequence number is the smallest packet sequence number of the valid data in the first packet sequence number array. Intercept all the data after the smallest packet sequence number of the valid data in the first packet sequence number array to form an intermediate packet sequence number array, and intercept all the data after the data corresponding to the smallest packet sequence number of the valid data in the first packet sequence number array in the first initial state byte array according to the index to form an intermediate state byte array; Judge the packet sequence numbers in the intermediate packet sequence number array in index order, and judge whether their values are greater than or equal to the valid byte number of the packet sequence number. If so and equal to the valid byte number of the packet sequence number, determine that the packet sequence number is the largest packet sequence number of the valid data in the first packet sequence number array. If so and greater than the valid byte number of the packet sequence number, determine that its previous packet sequence number is the largest packet sequence number of the valid data in the first packet sequence number array. Intercept all the data before and including the largest packet sequence number of the valid data in the intermediate packet sequence number to obtain a second packet sequence number array, and intercept the status bytes corresponding to each sequence number in the second packet sequence number array in the intermediate state byte array to form a second state byte array corresponding to the second packet sequence number array; if not, use the intermediate packet sequence number array and the intermediate state byte array for splicing with the multi-packet data at the next moment; Step 2.2): Judge whether the first packet sequence number in the first packet sequence number array is the smallest value in the first packet sequence number array. If so, judge the packet sequence numbers in the first packet sequence number array in index order, and judge whether their values are greater than or equal to the valid byte number of the packet sequence number. If so and equal to the valid byte number of the packet sequence number, determine that the packet sequence number is the largest packet sequence number of the valid data in the first packet sequence number array. If so and greater than the valid byte number of the packet sequence number, determine that its previous packet sequence number is the largest packet sequence number of the valid data in the first packet sequence number array. Intercept all the data before and including the largest packet sequence number of the valid data in the first packet sequence number array to obtain a second packet sequence number array, and intercept the status bytes corresponding to each sequence number in the second packet sequence number array in the first state byte array to form a second state byte array corresponding to the second packet sequence number array; if not, use the first packet sequence number array and the first state byte array for splicing with the multi-packet data at the next moment.
[0028] If the packet sequence number rollback count is less than the sampling frequency, then: The first packet sequence number array and the first state byte array are reversed to obtain an initial packet sequence number inverse array and an initial state byte inverse array, and the packet sequence number in the initial packet sequence number inverse array is determined in index order. If its value is equal to the number of valid bytes of the packet sequence number or is greater than the value of the previous packet sequence number, it is determined to be the maximum packet sequence number in the first packet sequence number array, and the maximum packet sequence number in the initial packet sequence number inverse array and all subsequent data are intercepted to form an intermediate packet sequence number inverse array, and the data corresponding to the maximum packet sequence number in the initial packet sequence number inverse array and all subsequent data are intercepted in the initial state byte inverse array according to the index to form an intermediate state byte inverse array; Determine the packet number in the intermediate packet number inverse array according to the index order. If its value is greater than the value of the previous packet number, determine that the previous packet number is the minimum packet number in the first packet number array, intercept the minimum packet number in the intermediate packet number inverse array and all data before it to form a final packet number inverse array, and intercept the data corresponding to the minimum packet number in the intermediate packet number inverse array and all data before it in the intermediate status byte inverse array according to the index to form a final status byte inverse array; The final packet sequence number inverse array and the final status byte inverse array are inverted respectively to obtain a second packet sequence number array and its corresponding second status byte array.
[0029] 3) Filter out the incoherent packet numbers in the second packet number array to form an incoherent array; the specific process is as follows: For each packet sequence number in the second packet sequence number array, subtract the packet sequence number sorted before it from the packet sequence number, and determine whether the obtained value is equal to 1. If so, jump to the next packet sequence number. If not, subtract the packet sequence number sorted before it from the packet sequence number, and subtract 1 from the obtained value to obtain the number M of packet sequence numbers between the packet sequence number and the previous packet sequence number. The packet sequence number is incremented by 1 in a cycle M times, and the value obtained by incrementing by 1 in each cycle is the packet sequence number between the packet sequence number and the previous packet sequence number. The packet sequence numbers between the packet sequence number and the previous packet sequence number are determined as incoherent packet sequence numbers in the second packet sequence number array.
[0030] 4) Arrange the numbers 0 - N in order, with every L numbers as a data block, where N is the number of valid bytes of the packet sequence number, and L is the length of the complete parsing byte; for each data in the discontinuous array, determine which data block the data is located in, determine and delete the packet sequence number sub - array corresponding to the data block in the second packet sequence number array, and determine and delete the status byte sub - array corresponding to the packet sequence number sub - array in the second status byte array. Complement the data block at the position of the deleted packet sequence number sub - array in the second packet sequence number array, and complement L zeros at the position of the deleted status byte sub - array in the second status byte array. In addition, assign a false variable to each data block. After step 4) is executed for a certain data in the discontinuous array, set the false variable of the data block corresponding to the data to true. When determining which data block the next data in the discontinuous array is located in, determine whether the false variable of the data block where the next data is located is true. If so, skip to the next data in the discontinuous array.
[0031] Among them, the process of determining the packet sequence number sub - array corresponding to the data block in the second packet sequence number array is as follows: According to the first data of the data block, search for the data in the second packet sequence number array that is equal to the first data, or greater than the first data and closest to the first data in value, and determine it as the first data of the packet sequence number sub - array corresponding to the data block. According to the last data of the data block, search for the data in the second packet sequence number array that is equal to the last data, or less than the last data and closest to the last data in value, and determine it as the last data of the packet sequence number sub - array corresponding to the data block. Determine the array composed of the first data, the last data, and the data between them of the packet sequence number sub - array corresponding to the data block in the second packet sequence number array as the packet sequence number sub - array corresponding to the data block in the second packet sequence number array.
[0032] The process of determining the status byte sub - array corresponding to the packet sequence number sub - array in the second status byte array is as follows: According to the index of the first data of the packet sequence number sub - array in the second packet sequence number array, search for the data corresponding to the index in the second status byte array, and determine it as the first data of the status byte sub - array. According to the index of the last data of the packet sequence number sub - array in the second packet sequence number array, search for the data corresponding to the index in the second status byte array, and determine it as the last data of the status byte sub - array. Determine the array composed of the first data, the last data, and the data between them of the status byte sub - array in the second status byte array as the status byte sub - array corresponding to the packet sequence number sub - array in the second status byte array.
[0033] The following is the process of processing the inertial navigation communication data of a certain company using the present invention: The communication protocol of the lower computer of the inertial navigation of a certain company is shown in Tables 1 and 2: Table 1 Gyroscope plus table 1KHz sampling data frame
[0034] Table 2 Definition of time scale remainder and status data
[0035] It is necessary to parse the data shown in Table 1. The data represented by bytes 3 - 20 can be parsed packet by packet when reading a packet of data. 1000 packets of data can be parsed in 1 second. The processing of status byte 21 in Table 1 is shown in Table 2. The status byte has only one byte, and the data listed in Table 2 are all of double type. Therefore, 8 bytes (i.e., 8 packets of data) are required to parse out one data. Since the sampling time is 1ms, it can be directly determined that when the packet numbers are 0 - 7, the status bytes of these 8 packets of data can parse out the differential frequency X data, and when the serial numbers are 8 - 15, these 8 packets of data can parse out the differential frequency Y data, and so on.
[0036] However, three problems need to be considered while parsing the data: Problem 1: If packet loss occurs during data transmission, how should the data be processed; Problem 2: The pulse data of the gyroscope and accelerometer in Table 1 and the differential frequency and other data in Table 2 need to be displayed on the same screen, which means that parsing must start from serial number 0. However, during the communication process, the data may not necessarily be transmitted starting from 0. Therefore, data splicing is required and then the processing of serial numbers 0 - the valid byte number of the packet number is carried out.
[0037] Problem 3: In the case of Problem 2, when considering the process of finding the valid byte number of 0 - the packet number, if packet loss occurs, or 0 or the valid byte number of the packet number is lost, how should the data be processed.
[0038] As Figure 1 shown, the process of processing the inertial navigation communication data in this embodiment is as follows (as shown in Table 2, the valid byte number of the packet number in this embodiment is 269): 1. It is known that the data serial numbers range from 0 - 9999, and if it exceeds 9999, it will wrap around to 0; 2. Obtain 1000 (sampling frequency) packets of data per second; 3. Obtain the serial number and the corresponding status byte in each packet of data; 4. Splice with the remaining data of the previous group of 1000 packets of data; 5. Poll the serial numbers after splicing. Determine the serial numbers where the serial number is equal to 0 or satisfies the condition that the current value is less than the previous value, and take its index 1 (this step is to find the head of the serial numbers from 0 to 269 and exclude the case of the serial number 0 lost in data transmission). For example, Figure 2 as shown, record whether any of the above conditions is satisfied, denoted as satisfied 1; 6. If "satisfied 1" = True, then intercept the data from this index and after according to index 1, and then poll the data after index 1. When the situation where the serial number is greater than 269 appears, the polling stops, and the index 2 at the stop is obtained. For example, Figure 3 as shown, intercept the data before index 2, and the status byte data group corresponding to the serial number is also intercepted according to the positions of index 1 and index 2 for subsequent operations; 7. As described in step 6, if "satisfied 1" = True, but the situation where the serial number is greater than 269 does not appear, then no subsequent calculations are performed, and all the data after index 1 is used for splicing calculations with the next packet of data; 8. If "satisfied 1" = False, determine whether the minimum value in the spliced serial numbers is the first element. If so, then "satisfied 2" = True. Since 1000 packets of data are processed each time, if the first element is greater than 0, then the situation where the serial number is greater than 269 will definitely appear in these 1000 packets of data, and then the index 2 can be obtained. Then, intercept from the first element of the spliced serial number data to the position of index 2 for subsequent operations; 9. If "satisfied 1" = False and "satisfied 2" = False, then directly transfer all the spliced serial number arrays to splice with the next group of 1000 packets of data until the situation in step 7 appears. When step 7 is executed and then spliced with the next group of 1000 packets of data, the situation in step 6 will appear; 10. So far, the data segment from 0 to 999 of the serial number has been intercepted, a total of 1000 packets of data. If packet loss occurs, then there are less than 1000 packets of data. At the same time, intercept the corresponding status byte data according to the above index, and the serial number corresponds to the status byte one by one; 11. According to the intercepted data segment from 0 to 999, by judging that if the difference between the current value and the previous value is not 1, it means that the data is not continuous and packet loss has occurred, and all the discontinuous data serial numbers are obtained. For example, Figure 4 as shown; 12. Take every 8 numbers of the serial number as a data block, and detect which data blocks the discontinuous data serial numbers are in. If the discontinuous data serial numbers appear in a certain data block, then replace all the status byte data corresponding to that serial number data block with 0. Taking the lost serial numbers 52 and 53 in Figure 4 as an example, both of them are in the data block from 48 to 55, Figure 5Schematic diagram showing that after this step is executed, the data block from 48 to 55 is filled, and the status byte corresponding to this data block is replaced with 0; 13. Since a total of 36 data need to be parsed (the complete parsed byte length of the first 33 data is 8, and the complete parsed byte length of the last 3 data is 2), an array is initialized. The array contains 36 dummy variables. Taking the data block with serial numbers 0 - 7 as an example, if the serial numbers are 1, 2, 3, 5, 7 and 0, 4, 6 are missing, then the head and tail of this segment need to be found, which are 1 and 7 (first search in decreasing order starting from 7, the index corresponding to 7 is found to be 4, then search in increasing order starting from 0. Since 0 does not exist, search for 1, and the index corresponding to 1 is 0. Using 4 - 0 + 1 = 5, it is obtained that there are 5 existing data in this data block, the head is 1, and the tail is 5). Then, through the array deletion function, delete 5 data starting from serial number 1 in the array, and initialize 8 zeros to fill in this position, and the serial numbers are filled to 0 - 7. Since 0 - 7 is the 0th data block, after processing once in this data block, set the 0th dummy variable to true. If the next discontinuous data is still in this data block, since this variable is true, the above operations are not executed; 14. Finally, a total of 270 serial numbers from 0 to 269 and their corresponding status bytes can be obtained, and the status bytes of the data blocks with missing data are all set to 0. As Figure 6 shown, it can be seen that the serial number corresponding to the serial number index 260 after processing is also 260; 15. Then, according to Table 2, intercept the first 264 bytes, convert every 8 bytes into double - type data for parsing and display, so that 33 double - type data can be obtained; 16. Since the serial numbers are from 0 to 10000, the data in Table 2 is refreshed every 10 seconds.
[0039] Embodiment 2:
[0040] This embodiment provides a device for implementing the inertial navigation communication data processing method of Embodiment 1, including: A receiving module, configured to receive multiple packets of data transmitted by the lower computer, obtain the packet serial number of each packet of data and its corresponding status byte in the multiple packets of data in the receiving order, and form a first packet serial number array and its corresponding first status byte array; An intercepting module, configured to find the minimum packet serial number of valid data and the maximum packet serial number of valid data in the first packet serial number array, intercept both and all the packet serial numbers therebetween to form a second packet serial number array, and intercept the status bytes corresponding to each serial number in the second packet serial number array in the first status byte array to form a second status byte array corresponding to the second packet serial number array; A screening module, configured to screen out the discontinuous packet serial numbers in the second packet serial number array to form a discontinuous array; Recombination module, which arranges the numbers 0 - N in order, with every L numbers as a data block, where N is the number of valid bytes of the packet sequence number and L is the length of the complete parsing bytes; for each data in the discontinuous array, determine which data block the data is located in, determine and delete the packet sequence number sub - array corresponding to the data block in the second packet sequence number array, and determine and delete the status byte sub - array corresponding to the packet sequence number sub - array in the second status byte array, supplement the data block at the position of the deleted packet sequence number sub - array in the second packet sequence number array, and supplement L zeros at the position of the deleted status byte sub - array in the second status byte array.
[0041] Embodiment 3:
[0042] This embodiment provides an electronic device, including: A memory for storing computer programs; A processor for implementing the steps of the inertial navigation communication data processing method in Embodiment 1 when executing the computer program.
[0043] Embodiment 4:
[0044] This embodiment provides a computer - readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the inertial navigation communication data processing method in Embodiment 1 are implemented.
Claims
1. An inertial navigation communication data processing method, characterized in that It includes the following steps: 1) Receive multi-packet data transmitted by the slave computer, and obtain the packet sequence number of each packet of data and its corresponding status byte in the multi-packet data in the receiving order, so as to form a first packet sequence number array and its corresponding first status byte array; 2) Search for the smallest packet sequence number of valid data and the largest packet sequence number of valid data in the first packet sequence number array, intercept the two and all the packet sequence numbers between them to form a second packet sequence number array, and intercept the status bytes corresponding to each sequence number in the second packet sequence number array in the first status byte array to form a second status byte array corresponding to the second packet sequence number array; 3) Screen out the discontinuous packet sequence numbers in the second packet sequence number array to form a discontinuous array; 4) Arrange the numbers 0 - N in order, with every L numbers as a data block, where N is the number of valid bytes of the packet sequence number and L is the length of the complete parsing byte; for each data in the discontinuous array, determine which data block the data is located in, determine and delete the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array, and determine and delete the sub-array of status bytes corresponding to the sub-array of packet sequence numbers in the second status byte array, fill in the data block at the position of the deleted sub-array of packet sequence numbers in the second packet sequence number array, and fill in L zeros at the position of the deleted sub-array of status bytes in the second status byte array.
2. The inertial navigation communication data processing method according to claim 1, wherein In step 4), the process of determining the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array is as follows: According to the first data of the data block, search for the data in the second packet sequence number array that is equal to the first data, or greater than the first data and closest to the first data in value, and determine it as the first data of the sub-array of packet sequence numbers corresponding to the data block; According to the last data of the data block, search for the data in the second packet sequence number array that is equal to the last data, or less than the last data and closest to the last data in value, and determine it as the last data of the sub-array of packet sequence numbers corresponding to the data block; Determine the array composed of the first data, the last data, and the data between them of the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array as the sub-array of packet sequence numbers corresponding to the data block in the second packet sequence number array.
3. The inertial navigation communication data processing method according to claim 2, wherein In step 4), the process of determining the sub-array of status bytes corresponding to the sub-array of packet sequence numbers in the second status byte array is as follows: According to the index of the first data of the sub-array of packet sequence numbers in the second packet sequence number array, search for the data corresponding to the index in the second status byte array, and determine it as the first data of the sub-array of status bytes; According to the index of the last data of the sub-array of packet sequence numbers in the second packet sequence number array, search for the data corresponding to the index in the second status byte array, and determine it as the last data of the sub-array of status bytes; Determine the array composed of the first data, the last data, and the data between them of the sub-array of status bytes in the second status byte array as the sub-array of status bytes corresponding to the sub-array of packet sequence numbers in the second status byte array.
4. The inertial navigation communication data processing method according to any one of claims 1-3, characterized in that, Step 4) also includes: Assign a false variable to each data block. After step 4) is executed for a certain piece of data in the discontinuous array, set the false variable of the data block corresponding to the said data to true. When it is judged which data block the next piece of data in the discontinuous array is located in, judge whether the false variable of the data block where the next piece of data is located is true. If so, jump to the next piece of data in the discontinuous array.
5. The inertial navigation communication data processing method according to any one of claims 1-3, characterized in that The specific content of step 3) includes: For each packet sequence number in the second packet sequence number array, subtract the packet sequence number sorted before it from the said packet sequence number, and judge whether the obtained value is equal to 1. If so, jump to the next packet sequence number. If not, subtract the packet sequence number sorted before it from the said packet sequence number, subtract 1 from the obtained value to get the number M of packet sequence numbers between the said packet sequence number and its previous packet sequence number, loop the said packet sequence number M times and add 1 each time. The value obtained by adding 1 each time is the packet sequence number between the said packet sequence number and its previous packet sequence number, and determine the packet sequence numbers between the said packet sequence number and its previous packet sequence number as the discontinuous packet sequence numbers in the second packet sequence number array.
6. The inertial navigation communication data processing method according to any one of claims 1-3, characterized in that The specific content of step 2) includes: If the packet sequence number rollback number is greater than or equal to the sampling frequency, then: According to the index order, for the packet sequence numbers in the first packet sequence number array, judge whether its value is equal to 0 or less than the value of the previous packet sequence number. If so, jump to step 2.1). If not, jump to step 2.2). Step 2.1): Determine the said packet sequence number as the smallest packet sequence number of the valid data in the first packet sequence number array, intercept all the data after the smallest packet sequence number of the valid data in the first packet sequence number array to form an intermediate packet sequence number array, and intercept the data corresponding to the smallest packet sequence number of the valid data in the first packet sequence number array and all the data after it in the first initial state byte array according to the index to form an intermediate state byte array; According to the index order, judge the packet sequence numbers in the intermediate packet sequence number array, and judge whether its value is greater than or equal to the valid byte number of the packet sequence number. If so and equal to the valid byte number of the packet sequence number, determine the said packet sequence number as the largest packet sequence number of the valid data in the first packet sequence number array. If so and greater than the valid byte number of the packet sequence number, determine its previous packet sequence number as the largest packet sequence number of the valid data in the first packet sequence number array, intercept all the data before the largest packet sequence number of the valid data in the intermediate packet sequence number to get a second packet sequence number array, and intercept the state bytes corresponding to each sequence number in the second packet sequence number array in the intermediate state byte array to form a second state byte array corresponding to the second packet sequence number array; If not, use the intermediate packet sequence number array and the intermediate state byte array to splice with the multi-packet data at the next moment. Step 2.2): Determine whether the first packet sequence number in the first packet sequence number array is the smallest value in the first packet sequence number array. If so, judge the packet sequence numbers in the first packet sequence number array in index order, and determine whether their values are greater than or equal to the number of valid bytes of the packet sequence number. If so and equal to the number of valid bytes of the packet sequence number, determine that the packet sequence number is the largest packet sequence number of valid data in the first packet sequence number array. If so and greater than the number of valid bytes of the packet sequence number, determine that the previous packet sequence number is the largest packet sequence number of valid data in the first packet sequence number array. Intercept all the data before and including the largest packet sequence number of valid data in the first packet sequence number array to obtain a second packet sequence number array, and intercept the status bytes corresponding to each sequence number in the second packet sequence number array in the first status byte array to form a second status byte array corresponding to the second packet sequence number array; If not, use the first packet sequence number array and the first status byte array for splicing with the multi-packet data at the next moment. If the packet sequence number rollback count is less than the sampling frequency, then: Reverse the first packet sequence number array and the first status byte array to obtain an initial packet sequence number reverse array and an initial status byte reverse array. Judge the packet sequence numbers in the initial packet sequence number reverse array in index order. If its value is equal to the number of valid bytes of the packet sequence number or greater than the value of the previous packet sequence number, determine that it is the largest packet sequence number in the first packet sequence number array. Intercept all the data after and including the largest packet sequence number in the initial packet sequence number reverse array to form an intermediate packet sequence number reverse array, and intercept all the data after and corresponding to the largest packet sequence number in the initial packet sequence number reverse array in the initial status byte reverse array according to the index to form an intermediate status byte reverse array; Judge the packet sequence numbers in the intermediate packet sequence number reverse array in index order. If its value is greater than the value of the previous packet sequence number, determine that the previous packet sequence number is the smallest packet sequence number in the first packet sequence number array. Intercept all the data before and including the smallest packet sequence number in the intermediate packet sequence number reverse array to form a final packet sequence number reverse array, and intercept all the data before and corresponding to the smallest packet sequence number in the intermediate packet sequence number reverse array in the intermediate status byte reverse array according to the index to form a final status byte reverse array; Reverse the final packet sequence number reverse array and the final status byte reverse array respectively to obtain a second packet sequence number array and its corresponding second status byte array.
7. The inertial navigation communication data processing method according to any one of claims 1-3, characterized in that, In the said step 1), the receiving of the multi-packet data transmitted by the lower computer specifically includes: Receiving the multi-packet data transmitted by the lower computer at the current moment and splicing it with the remaining multi-packet data received and processed at the previous moment.
8. An apparatus for implementing the inertial navigation communication data processing method according to any one of claims 1-7, characterized in that, It includes: A receiving module, configured to receive the multi-packet data transmitted by the lower computer, obtain the packet sequence number of each packet of data and its corresponding status byte in the multi-packet data in the receiving order, and form a first packet sequence number array and its corresponding first status byte array; An intercepting module, configured to find the smallest packet sequence number of valid data and the largest packet sequence number of valid data in the first packet sequence number array, intercept both and all the packet sequence numbers therebetween to form a second packet sequence number array, and intercept the status bytes corresponding to each sequence number in the second packet sequence number array in the first status byte array to form a second status byte array corresponding to the second packet sequence number array; A screening module, configured to screen out the discontinuous packet sequence numbers in the second packet sequence number array to form a discontinuous array; A recombination module arranges the numbers 0-N in order, with every L numbers as a data block, where N is the number of valid bytes of the packet sequence number and L is the length of the complete parsing byte; for each data in the discontinuous array, determine which data block the data is located in, determine and delete the packet sequence number sub-array corresponding to the data block in the second packet sequence number array, and determine and delete the status byte sub-array corresponding to the packet sequence number sub-array in the second status byte array, fill in the data block at the position of the deleted packet sequence number sub-array in the second packet sequence number array, and fill in L zeros at the position of the deleted status byte sub-array in the second status byte array.
9. An electronic device, characterized in that, The electronic device includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the inertial navigation communication data processing method according to any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program, when executed by the processor, implements the steps of the inertial navigation communication data processing method according to any one of claims 1-7.
Citation Information
Patent Citations
Device and method for sending a sequence of data packets and decoder and device for decoding a sequence of data packets
CN101689961A
Data recovery method and data recovery device
CN104778097A
Transmission method, playing method and device of video code streams as well as conference equipment
CN108632565A
Fragmented frame recombination method and device
CN114584560A
Shallow compressed video error concealment method and system based on wavelet transform
CN118524223A