Multi-channel data selection method with time sequence control
By adopting a multi-channel data selection method with timing control in real-time data processing of aircraft, and using a ring queue and a two-way linked list structure, the problems of homologous data selection sent by multiple devices and different delayed data processing sent by different devices are solved. Achieve higher data utilization and reliability.
Patent Information
- Application Number
- CN202411432436.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In real-time data processing of aircraft, there are difficulties in selecting homologous data sent by multiple devices and processing of data sent by different devices with different delays.
The multi-channel data selection method with timing control is adopted, and the data structure of a ring queue and a normal bidirectional linked list, as well as queue read pointers and read sequence variables are used to ensure that the data is processed in the order of reception and reduce the impact of network delay.
Improve data utilization and reliability, simplify the development difficulty of real-time data processing, and improve operational efficiency.
Smart Images

Figure CN119402437A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of real-time data processing of aircraft, and in particular relates to a multi-channel data selection method with timing control. Background Art
[0002] During the flight of the aircraft, the internal working status is transmitted to the ground in real time. There are multiple devices on the ground that receive the radio signals sent by the aircraft in real time, convert them into data that can be processed by computers, and send them to the data center via Ethernet. The data packets sent down by the same aircraft and received by different devices are homologous data, and the sequence numbers of the data packets are consistent. Each packet of data sent to the center is a fixed-length data packet, which contains the data sequence number and the number of the sending device. The sending order is consistent with the order of the receiving aircraft data. After the data center receives the data, it needs to process and solve the data to a certain extent, and finally decode it into data on the internal working status of the aircraft.
[0003] Considering that the data source received by the ground equipment is the aircraft in flight, the data received by the ground equipment at the same time should be the same in theory, but in fact, the radio signal is easily interfered with and the data has certain errors. Considering that the ground receiving equipment is generally separated by a certain distance and has a wide geographical layout in order to have a longer data reception time, these data are sent to the center through the network. Depending on the number of network nodes, there will be a certain network delay. When processing these data, the center must consider the impact of delay on data processing.
[0004] Therefore, the data that the data center needs to process is homologous data with time sequence and different delays. The present invention designs a data structure and a corresponding access control method of a multi-way data selector based on timing control to simplify the development difficulty of real-time data processing. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] The technical problem to be solved by the present invention is how to provide a multi-channel data selection method with timing control to solve the problem of selecting homologous data sent by multiple devices and the problem of processing data with different delays sent by different devices.
[0007] (II) Technical solution
[0008] In order to solve the above technical problems, the present invention proposes a multi-channel data selection method with timing control, which uses two linked list structures and two variables, wherein the two linked list structures include: a circular queue and an ordinary bidirectional linked list; the two variables include: a queue read pointer and a read sequence number variable;
[0009] The circular queue is connected end to end, and each data bit in the circular queue is used to store the first address of a linked list;
[0010] Multiple linked lists, used to store received homologous data, each linked list stores data corresponding to a data packet;
[0011] Queue read pointer, pointing to the currently read ring queue data bit;
[0012] A read sequence number variable is used to store the packet sequence number of the data packet stored in the linked list corresponding to the currently read ring queue data bit;
[0013] When writing data, the data bit of the ring queue that the data to be written should be written into is calculated according to the packet sequence number of the data to be written, the current queue read pointer of the ring queue and the data packet sequence number in the current read sequence number variable, and the data to be written is written into the linked list corresponding to the data bit; each data packet of the same source is stored in the same linked list, and the data stored in the linked list has no priority;
[0014] When reading and processing data, the data center processes it in the order in which the data is received; when operating on a circular queue, it starts from the current queue read pointer position and reads in sequence; after reading data once, the queue read pointer points to the next data bit in the queue, and the packet number in the read sequence variable is increased by 1; when there is data in the linked list corresponding to the data bit in the circular queue, no matter how much data there is, only one data is returned to the user.
[0015] (III) Beneficial effects
[0016] The present invention proposes a multi-channel data selection method with timing control. Compared with strategic selection methods such as switching data sources by time and selecting data sources by data arrival time, the present invention involves all data received by all centers in the data selection process, which improves data utilization and reliability. The present invention only uses queue read pointers and read sequence number variables to determine the location where data is written, which not only reduces the circular queue write pointer and write sequence number variables, but also makes the operation simpler and more efficient.
[0017] The present invention is simple to implement and can effectively select data of multi-channel data collection and transmission from the same source, thereby greatly simplifying the difficulty of real-time data processing of aircraft. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of a circular queue;
[0019] Figure 2 It is a schematic diagram of the data bit structure of the present invention;
[0020] Figure 3It is a partial expanded schematic diagram of the data bit structure of the present invention;
[0021] Figure 4 It is a schematic diagram of data bit calculation of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0023] The design principle of the present invention is to enable the processing system to make the best use of the data sent by all ground devices and to eliminate the influence of the delay of data sent by different devices as much as possible.
[0024] To solve the above problems, the present invention proposes a multi-way data selection method with timing control, which uses two linked list structures and two variables. The two linked list structures include: a circular queue and an ordinary bidirectional linked list; the two variables include: a queue read pointer and a read sequence number variable.
[0025] The circular queue is connected end to end, and each data bit in the circular queue is used to store the first address of a linked list;
[0026] Multiple linked lists, used to store received homologous data, each linked list stores data corresponding to a data packet;
[0027] Queue read pointer, pointing to the currently read ring queue data bit;
[0028] The read sequence number variable is used to store the packet sequence number of the data packet stored in the linked list corresponding to the currently read ring queue data bit.
[0029] When writing data, the data bit that the data to be written should be written into the circular queue is calculated according to the packet sequence number of the data to be written, the current queue read pointer of the circular queue, and the data packet sequence number in the current read sequence number variable, and the data to be written is written into the linked list corresponding to the data bit. Each data packet of the same source is stored in the same linked list, and the data stored in the linked list has no priority.
[0030] When reading and processing data, the data center needs to process it in the order in which the data is received. When operating on a circular queue, it starts from the current queue read pointer position and reads in sequence. After reading the data once, the queue read pointer points to the next data bit in the queue, and the packet number in the read sequence variable is increased by 1.
[0031] When there is data in the linked list corresponding to the data position in the ring queue, no matter how much data there is, only one data is returned to the user. The processing of the linked list data in the data position is as follows:
[0032] If the linked list of the current data position has only one data, the queue returns this data to the user.
[0033] If the linked list of the current data position has two data, regardless of whether the data contents are consistent, a random data is returned to the user.
[0034] If the linked list of the current data position has 3 or more data, the consistency of the data content will be determined mutually. If 2 or more data are found to be consistent, there is no need to determine all the data in the linked list, and the consistent data will be returned to the user. If all the data are different, a random data will be returned to the user.
[0035] If the linked list of the current data position is empty and does not contain any data, it is considered that the data center has failed to receive the data at this position for some reason and is processed according to the non-continuous data processing method.
[0036] Embodiment 1:
[0037] The present invention designs a multi-channel data selection method with timing control to meet the use requirements of homologous multi-channel data with timing control.
[0038] (I) Detailed description of data structure
[0039] The invention relates to a multi-channel data selection method with timing control, which uses two linked list structures and two variables, wherein the two linked list structures include: a circular queue and a common bidirectional linked list; the two variables include: a queue read pointer and a read sequence number variable;
[0040] The circular queue is connected end to end, and each data bit in the circular queue is used to store the first address of a linked list;
[0041] Multiple linked lists, used to store received homologous data, each linked list stores data corresponding to a data packet;
[0042] Queue read pointer, pointing to the currently read ring queue data bit;
[0043] The read sequence number variable is used to store the packet sequence number of the data packet stored in the linked list corresponding to the currently read ring queue data bit.
[0044] The read and write control of the data bits is determined by the queue read pointer and read sequence number variables.
[0045] Figure 1 It is a schematic diagram of the circular queue of the present invention. During the process of receiving, writing and using data, the circular queue is always operated, and the old data bits are continuously overwritten with the new data bits.
[0046] Figure 2 , Figure 3The data bit structure diagram of the present invention. The same color indicates the same data bit. When writing data to the same data bit, it is stored in the linked list of the same data bit and does not overwrite the same bit data. The read and write direction represents the operation direction of the data structure controlled by the cursor pointer.
[0047] (II) Methods of data structure initialization
[0048] The data structure and related variables involved in the multi-channel data selection method with timing control of the present invention are initialized to perform the following operations:
[0049] S11. Set the ring queue to a fixed size based on usage scenarios, data frequency, and other factors;
[0050] S12, initializing and clearing the circular queue: pointing each data bit in the circular queue to the first address of a linked list, and the data in the bidirectional linked list is empty;
[0051] S13, the queue read pointer and read sequence number variables are set to 0;
[0052] (III) Data writing method
[0053] Before data is written, it is assumed that certain validity checks have been performed according to the rules.
[0054] S21, first packet data write
[0055] When the first packet of data is written, the data is written into the linked list corresponding to the 0 data bit, the queue read pointer is not updated and remains 0, and the sequence number of the data packet stored in the read sequence number variable is updated to the data packet sequence number of the first packet.
[0056] S22, normal data writing
[0057] When the second packet of data is written, the data is written into the linked list corresponding to the 1 data bit, the queue read pointer is updated to 1, and the sequence number of the data packet stored in the read sequence number variable is updated to the sequence number of the second packet; and so on.
[0058] S23, writing of advance data
[0059] The advanced data refers to the received data packet whose sequence number is greater than the packet sequence number in the read sequence number variable corresponding to the current queue read pointer. It belongs to the data to be processed and should be stored.
[0060] The data bits are calculated according to the following data bit calculation method, and the data is written into the linked list of the corresponding data bits. The queue read pointer is not updated, and the read sequence number variable is not updated.
[0061] S24, writing of delayed data
[0062] Lagging data refers to the sequence number of the received data packet. Due to the large network delay, it is smaller than the packet sequence number in the read sequence number variable corresponding to the current queue read pointer. It is data that does not need to be processed and is not stored.
[0063] The present invention only uses the queue read pointer and the read sequence number variable to determine the position where data is written, which not only reduces the circular queue write pointer and the write sequence number variable, but also makes the operation simpler and more efficient.
[0064] The calculation method of data bits is:
[0065] like Figure 4 As shown, when writing data, it is necessary to calculate the data bit address where the received data should be stored based on the current queue read pointer and the packet sequence number in the read sequence number variable.
[0066] First calculate the sequence number difference P c , that is, the difference between the sequence number of the currently received data packet and the sequence number in the read sequence number variable corresponding to the current queue read pointer. The formula is as follows:
[0067] P c =P d -P z
[0068] Where P c is the sequence number difference, P d is the sequence number of the currently received data packet, P z The packet sequence number in the read sequence number variable corresponding to the current queue read pointer.
[0069] Then calculate the write data bit, that is, the position where the currently received data is written, the formula is as follows:
[0070] P R =P Y +P C
[0071] Among them, P R is the data bit that the currently received data should be written to. Each data bit corresponds to a linked list. Y is the data position corresponding to the current queue read pointer, P C is the sequence number difference. Under normal circumstances, the linked list of the position to be written should be empty. If the linked list of the writing position has data, it means that the length of the ring queue is too small, and the number of queues in the ring queue should be increased.
[0072] (IV) Data reading method
[0073] S31. Method for reading continuous data
[0074] After taking out the linked list data corresponding to the current queue read pointer, the other data in the linked list is no longer used, and the linked list is cleared to write other new data. At the same time, the queue read pointer is increased by 1, and the read sequence number variable is increased by 1.
[0075] S32. Method for reading non-continuous data
[0076] Non-continuous data refers to the processing method when the next data bit is found to be empty during data reading, and is processed according to the following process.
[0077] First determine whether the data is interrupted:
[0078] Based on the packet number recorded by the current read sequence number variable, determine whether the packet numbers recorded at the queue read pointer + 1 are continuous. If they are continuous, read them according to the continuous data reading method.
[0079] If the data at cursor position + 1 is empty, then continue to determine whether the data bit at cursor position + 2 is empty.
[0080] If there is data in the 1 / 2 ring queue, and the difference between the data bit with data and the current queue read pointer is exactly equal to the packet sequence number, it means that the received data is missing. When reading data, the information in the linked list corresponding to the data bit with data is directly returned. Then the queue read pointer points to the data bit with data, and the packet sequence number of the read sequence number variable is modified at the same time.
[0081] If there is no valid data in the 1 / 2 ring queue, it means that the data has been interrupted and the subsequent data cannot be read. At this time, the ring queue is reinitialized.
[0082] S33, Reading strategy for multiple data packets with the same data bit
[0083] When reading data at a certain position in the circular queue, if the doubly linked list it points to contains one or more data, a valid data packet should be returned according to different situations.
[0084] Case 1: There is only one data packet, and the data is returned;
[0085] Case 2: There are 2 data packets, and one data packet is returned randomly;
[0086] Case 3: When there are more than 3 packets, the consistency of the contents is judged and the data packet with the most consistency is returned; if the consistency is different, a random data packet is returned.
[0087] Embodiment 2:
[0088] A multi-channel data selection method with timing control uses a data structure combining a ring queue and a bidirectional linked list to store data of the same source but with different delay time characteristics.
[0089] In the selector, the circular queue is used to store the data bits pointing to the bidirectional linked list, as well as the cursor pointer and the packet sequence number of the aircraft downlink data. The bidirectional linked list is used to store the aircraft downlink data with the same packet sequence number sent from different devices. For example, 2 in the circular queue means storing the data packet sequence number of the aircraft downlink with the packet sequence number 2 and the corresponding linked list pointer; at the same time, ①, ②③, etc. in the bidirectional linked list pointed to by the circular queue position 2 identify the data value of the aircraft downlink packet sequence number 2 from device ①.
[0090] Furthermore, the method of writing data to the selector is as follows:
[0091] Before data is written, it is assumed that certain validity checks have been performed according to the rules.
[0092] 1) First packet data is written
[0093] When the first packet of data is written, the data is written into the linked list of the 0 data bit, and the data cursor is not updated and remains 0. The sequence number of the data packet is updated to the sequence number of the first packet.
[0094] 2) Writing of advanced data
[0095] The advanced data refers to the received data packet whose sequence number is greater than the packet sequence number of the current cursor position. It is data to be processed and should be stored.
[0096] The data bits are calculated according to the fourth rule and written into the data linked list of the corresponding data bits. The data cursor is not updated and the data packet sequence number is not updated.
[0097] 3) Writing of delayed data
[0098] Lagging data refers to the sequence number of the received data packet. Due to the large network delay, it is smaller than the packet sequence number of the current cursor position. It is data that is no longer used and is directly discarded.
[0099] 4) Calculation method of data bits
[0100] like Figure 4 As shown, when writing data, it is necessary to calculate the data bit address where the received data should be stored based on the current cursor position and the packet sequence number.
[0101] First calculate the sequence number difference P c , that is, the sequence number of the currently received data packet and the sequence number of the packet recorded at the current cursor position. The formula is as follows:
[0102] P c =P d -P z
[0103] Where P c is the sequence number difference, Pd is the sequence number of the currently received data packet, P z The packet number recorded at the current cursor position.
[0104] Then calculate the write data position, that is, the position where the currently received data is written, the formula is as follows:
[0105] P R =P Y +P C
[0106] Among them, P R is the location where the currently received data should be written, P Y is the current cursor position, P C The serial number difference.
[0107] Furthermore, the data reading method
[0108] 1) Method for reading continuous data
[0109] Take out the linked list data pointed to by the current cursor position, then clear the linked list, and at the same time increase the cursor position by 1 and the data packet number by 1.
[0110] 2) How to read non-continuous data
[0111] Non-continuous data refers to the processing method when the next data bit is found to be empty during data reading, and is processed according to the following process.
[0112] First determine whether the data is interrupted:
[0113] Based on the packet number recorded at the current cursor position, determine whether the packet numbers recorded at the cursor position + 1 are continuous. If they are continuous, read them according to the continuous data reading method.
[0114] If the data at cursor position + 1 is empty, then continue to determine whether the data bit at cursor position + 2 is empty.
[0115] If there is data in the 1 / 2 ring queue, and the data bit with data minus the current cursor position is exactly equal to the difference in the packet sequence number, it means that the received data is missing. When reading data, the data bit information with data is directly returned. Then the cursor points to the data bit with data.
[0116] If there is no valid data in the 1 / 2 ring queue, it means that the data has been interrupted and the subsequent data cannot be read. At this time, the ring queue is reinitialized.
[0117] 3) Reading strategy for multiple data packets with the same data bit
[0118] When reading data at a certain position in the circular queue, if there are multiple data packets in the doubly linked list it points to, valid data packets should be returned according to different situations.
[0119] Case 1: There is only one data packet, and the data is returned;
[0120] Case 2: There are 2 data packets, and one data packet is returned randomly;
[0121] Case 3: When there are more than 3 packets, the consistency of the contents is judged and the data packet with the most consistency is returned; if the consistency is different, a random data packet is returned.
[0122] The present invention proposes a multi-channel data selection method with timing control. Compared with strategic selection methods such as switching data sources by time and selecting data sources by data arrival time, the present invention involves all data received by all centers in the data selection process, thereby improving data utilization and reliability.
[0123] The present invention only uses the queue read pointer and the read sequence number variable to determine the position where data is written, which not only reduces the circular queue write pointer and the write sequence number variable, but also makes the operation simpler and more efficient.
[0124] The present invention is simple to implement and can effectively select data of multi-channel data collection and transmission from the same source, thereby greatly simplifying the difficulty of real-time data processing of aircraft.
[0125] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A multi-channel data selection method with timing control, characterized in that: The method uses two linked list structures and two variables, wherein the two linked list structures include: a circular queue and a common bidirectional linked list; the two variables include: a queue read pointer and a read sequence number variable; The circular queue is connected end to end, and each data bit in the circular queue is used to store the first address of a linked list; Multiple linked lists, used to store received homologous data, each linked list stores data corresponding to a data packet; Queue read pointer, pointing to the currently read ring queue data bit; A read sequence number variable is used to store the packet sequence number of the data packet stored in the linked list corresponding to the currently read ring queue data bit; When writing data, the data bit of the ring queue that the data to be written should be written into is calculated according to the packet sequence number of the data to be written, the current queue read pointer of the ring queue and the data packet sequence number in the current read sequence number variable, and the data to be written is written into the linked list corresponding to the data bit; each data packet of the same source is stored in the same linked list, and the data stored in the linked list has no priority; When reading and processing data, the data center processes it in the order in which the data is received; when operating on a circular queue, it starts from the current queue read pointer position and reads in sequence; after reading data once, the queue read pointer points to the next data bit in the queue, and the packet number in the read sequence variable is increased by 1; when there is data in the linked list corresponding to the data bit in the circular queue, no matter how much data there is, only one data is returned to the user.
2. The multi-channel data selection method with timing control as claimed in claim 1, characterized in that: The method also includes, during initialization, performing the following operations: S11. Set the ring queue to a fixed size according to the usage scenario and data frequency; S12, initializing and clearing the circular queue: pointing each data bit in the circular queue to the first address of a linked list, and the data in the bidirectional linked list is empty; S13. Set the queue read pointer and read sequence number variables to 0.
3. The multi-channel data selection method with timing control as claimed in claim 2, characterized in that: When writing data, the method specifically includes: S21, first packet data write When the first packet of data is written, the data is written into the linked list corresponding to the 0 data bit, the queue read pointer is not updated and remains 0, and the sequence number of the data packet stored in the read sequence number variable is updated to the sequence number of the first packet; S22, normal data writing When the second packet of data is written, the data is written into the linked list corresponding to the 1 data bit, the queue read pointer is updated to 1, and the sequence number of the data packet stored in the read sequence number variable is updated to the sequence number of the second packet; and so on; S23, writing of advance data The advanced data refers to the received data packet whose sequence number is greater than the packet sequence number in the read sequence number variable corresponding to the current queue read pointer, which belongs to the data to be processed and should be stored; the data bit is calculated according to the data bit calculation method, and the data is written into the linked list of the corresponding data bit. The queue read pointer is not updated, and the read sequence number variable is not updated; S24, writing of delayed data Lagging data refers to the received data packet whose sequence number is smaller than the packet sequence number in the read sequence number variable corresponding to the current queue read pointer. It is data that does not need to be processed and is not stored.
4. The multi-channel data selection method with timing control as claimed in claim 3, characterized in that: The data bit calculation method comprises: When writing data, the data bit address where the received data should be stored is calculated based on the current queue read pointer and the packet sequence number in the read sequence number variable; First, calculate the sequence number difference P c , that is, the difference between the sequence number of the currently received data packet and the sequence number in the read sequence number variable corresponding to the current queue read pointer. The formula is as follows: P c =P d -P z Where P c is the sequence number difference, P d is the sequence number of the currently received data packet, P z The packet sequence number in the read sequence number variable corresponding to the current queue read pointer; Then, calculate the write data bit, that is, the position where the currently received data is written, the formula is as follows: P R =P Y +P C Among them, P R is the data bit that the currently received data should be written to. Each data bit corresponds to a linked list. Y is the data position corresponding to the current queue read pointer, P C The serial number difference.
5. The multi-channel data selection method with timing control as claimed in claim 4, characterized in that: When advance data is written, under normal circumstances, the linked list of the position to be written should be empty. If there is data in the linked list of the writing position, it means that the length of the circular queue is too small, and the number of queues in the circular queue should be increased.
6. The multi-channel data selection method with timing control according to any one of claims 1 to 5, characterized in that: When reading and processing data, this method specifically includes: S31. Method for reading continuous data After taking out the linked list data corresponding to the current queue read pointer, the other data in the linked list is no longer used, and the linked list is cleared to write other new data. At the same time, the queue read pointer is increased by 1, and the read sequence number variable is increased by 1; S32. Method for reading non-continuous data Non-continuous data refers to the processing method when the next data bit is found to be empty during data reading. The processing is carried out according to the following process: First determine whether the data is interrupted: Based on the packet number recorded by the current read sequence number variable, determine whether the packet numbers recorded at the queue read pointer + 1 are continuous. If they are continuous, read them according to the continuous data reading method. If the data at cursor position +1 is empty, then continue to determine whether the data bit at cursor position +2 is empty; if there is data in the 1 / 2 ring queue, and the data bit with data minus the current queue read pointer is exactly equal to the difference in the packet sequence number, it means that the received data is missing; when reading data, directly return the information in the linked list corresponding to the data bit with data; then the queue read pointer points to the data bit with data, and at the same time modify the packet sequence number of the read sequence number variable; If there is no valid data in the 1 / 2 ring queue, it means that the data has been interrupted and subsequent data cannot be read; at this time, the ring queue is reinitialized.
7. The multi-channel data selection method with timing control as claimed in claim 6, characterized in that: When reading data at a certain position in the circular queue, if the doubly linked list it points to contains one or more data, a valid data packet should be returned according to different situations; if the linked list at the current data position is empty and does not contain any data, it is considered that the data center has failed to receive the data at this position for some reason and the data is processed according to the non-continuous data processing method.
8. The multi-channel data selection method with timing control as claimed in claim 7, characterized in that: If the linked list of the current data position has only one data, the queue returns this data to the user.
9. The multi-channel data selection method with timing control as claimed in claim 7, characterized in that: If the linked list of the current data position has two data, regardless of whether the data contents are consistent, a random data is returned to the user.
10. The multi-channel data selection method with timing control as claimed in claim 7, characterized in that: If the linked list of the current data position has 3 or more data, the consistency of the data content will be determined mutually. If 2 or more data are found to be consistent, there is no need to determine all the data in the linked list, and the consistent data will be returned to the user. If all the data are different, a random data will be returned to the user.
Citation Information
Patent Citations
Data queue de-queuing control method and device
CN103914341A
Panic buying request processing method and device under high concurrent traffic, equipment, and medium
CN113783917A
Data reordering method, system and equipment based on RTP (Real-time Transport Protocol) and medium
CN114189487A
Ethod
KR1020000034007A