Data acquisition integrity detection and packet loss positioning method and system based on m sequence

By deploying M-sequence generators at both the sending and receiving ends, and utilizing the deterministic principle of M-sequences, accurate detection of data packet integrity and fault location are achieved, solving the problems of packet loss, duplication, and out-of-order transmission during data transmission. This method is suitable for IoT devices with limited computing power.

CN121125571BActive Publication Date: 2026-02-13CHENGDU MAISHUO ELECTRIC CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511657218.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-02-13
Estimated Expiration
2045-11-13

AI Technical Summary

Technical Problem

In existing data acquisition systems, data packets are easily lost during transmission, and existing detection methods cannot accurately locate the packet loss point, detect duplicate and out-of-order data packets, and are prone to loss of synchronization.

Method used

Deploy M-sequence generators at the sending and receiving ends, and use the deterministic principle of M-sequences to achieve self-synchronization. By comparing the difference between the sequence number of the data packet and the expected sequence number, accurately locate packet loss, duplication, and out-of-order problems, and perform fault location and recovery.

Benefits of technology

It achieves accurate detection of data packet integrity and precise location of faults, has strong anti-interference capabilities, is suitable for IoT devices with limited computing power, and has powerful self-synchronization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125571B_ABST
    Figure CN121125571B_ABST
Patent Text Reader

Abstract

The application discloses a data collection integrity detection and packet loss positioning method and system based on M sequence, relates to the technical field of data collection and processing, and is characterized in that M sequence generators with the same initial state and polynomial are arranged at the sending end and the receiving end, the receiving end compares a data packet sequence number extracted from a data packet with an expected data packet sequence number, judges whether the two sequence numbers match, if the two sequence numbers match, the state of the M sequence generator at the receiving end is advanced by one step, and the expected data packet sequence number is stored in a received sequence number database, and if the two sequence numbers do not match, a sequence number difference is calculated according to the extracted data packet sequence number and the expected data packet sequence number, data packet integrity transmission detection is performed according to the sequence number difference, and according to a detection result and log information of the sending end, a fault cause is positioned and a recovery strategy is performed. The application realizes self-synchronization based on the determinacy principle of M sequence, thereby realizing multiple error detection at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data acquisition processing, in particular to a data acquisition integrity detection and packet loss positioning method and system based on M sequence. BACKGROUND

[0002] In a high-speed and high-reliability data acquisition system, data integrity and continuity are crucial. During the transmission of data packets from the acquisition source (such as sensors, acquisition cards) to the final receiving end (such as data processing servers), packets may be lost due to the following reasons:

[0003] 1. Internal packet loss at the acquisition end: CPU overload unable to respond to hardware interrupts, driver layer buffer overflow, data processing thread blocking, etc.

[0004] 2. Transmission link packet loss: network congestion, physical link errors, switch packet loss, etc.

[0005] 3. Packet loss at the receiving end: slow processing of the receiving application program leading to socket buffer overflow.

[0006] The current common method for detecting the integrity of data packet transmission is to use a simple incremental counter (such as trigger count, send count, callback count) and compare the difference to determine packet loss. This method has obvious drawbacks:

[0007] 1. Fuzzy positioning: only the approximate number of lost packets can be inferred, not the exact packet that was lost, making it difficult to diagnose intermittent and small-scale packet loss problems.

[0008] 2. Single function: unable to effectively detect data packet duplication and out-of-order problems.

[0009] 3. Step loss: the counter is prone to step loss after system restart or serious errors, requiring a complex synchronization recovery mechanism.

[0010] Therefore, there is an urgent need for a new method that can accurately and reliably monitor data integrity and locate fault links. SUMMARY

[0011] The purpose of the present application is to provide a data acquisition integrity detection and packet loss positioning method and system based on M sequence, which deploys M sequence generators at the receiving end and the sending end, realizes self-synchronization based on the deterministic principle of M sequence, and simultaneously realizes multiple error detection at low cost.

[0012] To achieve the above purpose, the following scheme is adopted:

[0013] In one aspect, the application provides a method for data collection integrity detection and packet loss positioning based on M-sequence, wherein M-sequence generators with the same initial state and polynomial are deployed at the sending end and the receiving end, the M-sequence generator determines a unique M-sequence according to the polynomial, and the specific process for detection and packet loss positioning at the receiving end is as follows:

[0014] S1, receiving the data packet sent by the sending end and the log information of the sending end, wherein the data packet header carries the M-sequence code value generated by the M-sequence generator of the sending end after successfully assembling the data packet, and the M-sequence code value is used as the data packet sequence number;

[0015] S2, extracting the data packet sequence number from the data packet and comparing it with the expected data packet sequence number generated by the M-sequence generator of the receiving end according to the current state to determine whether they match, if they match, the state of the M-sequence generator of the receiving end is further advanced and the expected data packet sequence number is stored in the received sequence number database;

[0016] S3, if they do not match, calculating the sequence number difference according to the extracted data packet sequence number and the expected data packet sequence number, and performing data packet integrity transmission detection according to the sequence number difference;

[0017] S4, positioning the fault cause and performing the recovery strategy according to the detection result and the log information of the sending end.

[0018] In some specific embodiments, the specific process for data packet integrity transmission detection in step S3 is as follows:

[0019] S31, when the data packet sequence number does not match the expected data packet sequence number, searching the received sequence number database to determine whether there is received sequence number data matching the data packet sequence number, if there is, the detection result is packet repetition, and if there is not, step S32 is performed;

[0020] S32, calculating the sequence number difference according to the extracted data packet sequence number and the expected data packet sequence number;

[0021] S33, when the sequence number difference is positive, i.e., the data packet sequence number is greater than the expected data packet sequence number, the detection result is packet loss;

[0022] S34, when the sequence number difference is negative, i.e., the data packet sequence number is less than the expected data packet sequence number, the detection result is packet sequence error.

[0023] In some specific embodiments, when the detection result is packet loss, the specific process for positioning the packet loss cause is as follows:

[0024] S331, when the detection result is packet loss, querying log information of the sending end, the log information including data packets successfully sent by the sending end and corresponding data packet sequence numbers thereof;

[0025] S332, matching the expected data packet sequence number with the data packet sequence numbers in the log information, if the matching is successful, judging that the transmission link has packet loss;

[0026] If the matching in the log information is failed, judging that the sending end has internal packet loss.

[0027] In some specific embodiments, when the detection result is packet loss, the recovery strategy is:

[0028] According to the sequence number difference and the M sequence continuity, calculating the missing data packet sequence number range, generating a packet loss alarm event, and generating all missing data packet sequence numbers according to the data packet sequence number range;

[0029] According to the current transmission link type, judging whether to wait for retransmission or ignore.

[0030] In some specific embodiments, if the current transmission link type is real-time streaming, the state of the M sequence generator of the receiving end is forcibly updated to the data packet sequence number corresponding to the currently received data packet, so as to obtain the expected data packet sequence number matched with the currently received data packet;

[0031] Then, the state of the M sequence generator of the receiving end is further updated, and the forcibly updated expected data packet sequence number is stored in the received sequence number database.

[0032] In some specific embodiments, if the current transmission link type is reliable transmission, the state of the M sequence generator of the receiving end is kept unchanged, the currently received data packet is stored in the cache queue, and the data packet sequence number that needs to start retransmission is encapsulated into a retransmission request to send the retransmission request to the sending end;

[0033] The receiving end waits to receive the retransmitted data packet, stores the received retransmitted data packet in the cache queue, reads the data packets from the cache queue in sequence according to the data packet sequence numbers of the data packets, and updates the state of the M sequence generator of the receiving end and the received sequence number database correspondingly when reading the data packets;

[0034] When reading the data packets in the cache queue is completed, the state of the M sequence generator of the receiving end is further updated, and the receiving end waits to receive the next data packet sent by the sending end.

[0035] In some specific embodiments, when the detection result is a packet repetition, a packet repetition alarm event is generated, the data packet serial number is recorded as a repetition, the current received data packet is discarded, the state of the M sequence generator at the receiving end is kept unchanged, and the next data packet sent by the sending end is waited for.

[0036] In some specific embodiments, when the detection result is a packet out-of-order, the specific process of the recovery strategy is as follows:

[0037] When the detection result is a packet out-of-order, a packet out-of-order alarm event is generated, the current received data packet is recorded as a delayed packet, the data packet serial number corresponding to the delayed packet is stored in the received serial number database according to the continuity of the M sequence, the state of the M sequence generator at the receiving end is kept unchanged, and the next data packet sent by the sending end is waited for.

[0038] In a second aspect, the application provides a data acquisition integrity detection and packet loss positioning system based on an M sequence, which includes a sending end and a receiving end, and M sequence generators with the same initial state and polynomial are arranged at the sending end and the receiving end, and the M sequence generator determines a unique M sequence according to the polynomial, wherein the sending end includes:

[0039] A data packet assembling unit is configured to assemble raw data collected from hardware into a data packet to be sent.

[0040] An M sequence generating unit is configured to further advance the state of the M sequence generator and generate a corresponding M sequence code value after the data packet assembling unit successfully assembles the data packet to be sent.

[0041] The data packet assembling unit is further configured to embed the M sequence code value generated by the M sequence generator as a data packet serial number in the packet header of the data packet to be sent, and record the data packet to be sent and the data packet serial number at this time in log information.

[0042] A sending unit is configured to send the data packet to be sent and the log information to the receiving end.

[0043] The receiving end includes:

[0044] An analyzing unit is configured to receive the data packet and the log information sent by the sending end, and extract the data packet serial number from the data packet.

[0045] An M sequence synchronizing unit is configured to generate an expected data packet serial number synchronized with the sending end according to the current state of the M sequence generator after receiving the data packet.

[0046] A comparison and verification unit is configured to compare whether the data packet sequence number matches the expected data packet sequence number, if yes, the state of the M sequence generator of the receiving end is further advanced, and the expected data packet sequence number is stored in the received sequence number database, if no, a diagnostic analysis unit is called for analysis;

[0047] The diagnostic analysis unit is configured to calculate a sequence number difference value according to the extracted data packet sequence number and the expected data packet sequence number, perform data packet integrity transmission detection according to the sequence number difference value, and locate the fault cause and perform a recovery strategy according to the detection result and the log information of the sending end.

[0048] The present application has the beneficial effects of:

[0049] The present application has the beneficial effects of:

[0050] The present application not only can detect the number of lost packets, but also can accurately locate the specific lost data packets, and can detect data packet repetition and out-of-order problems at the same time, and has strong self-synchronization capability, to solve the problem of accurate diagnosis of data stream integrity in a data acquisition system. BRIEF DESCRIPTION OF DRAWINGS

[0051] Figure 1 A flow chart of a data acquisition integrity detection and packet positioning method based on an M sequence is provided for the embodiments of the present application.

[0052] Figure 2 A block diagram of a data acquisition integrity detection and packet positioning system based on an M sequence is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. The description of the at least one exemplary embodiment is actually only illustrative, but not as any limitation on the present application and its application or use. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0054] The relative arrangement of parts and steps, numerical expressions, and values set forth in these embodiments are not intended to limit the scope of the present disclosure unless otherwise specifically stated.

[0055] In addition, descriptions of well-known functions and methods can be omitted so as to describe the present disclosure more clearly and concisely.

[0056] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail herein, but should be considered part of the description of the application.

[0057] In all of the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Thus, other examples of the example embodiments can have different values.

[0058] Embodiment 1

[0059] The present embodiment provides a data collection integrity detection and packet loss positioning method based on M sequence, and M sequence generators with the same initial state and polynomial are deployed at the sending end and the receiving end. The M sequence generator determines a unique M sequence according to the polynomial.

[0060] It can be understood that the M sequence generator (LFSR) adopted in the present embodiment is a linear feedback shift register, which controls a synchronous clock to drive all registers to shift, and generates one bit per clock cycle through a preset polynomial and initial value. Since the M sequence state is completely irrelevant to the application data, only LFSR shifting and comparison are involved in numbering the data packets, therefore, one M sequence generator can be deployed at the sending end and the receiving end respectively, and the initial state and polynomial of the M sequence generator are initialized after deployment, and the M sequence generators at the sending end and the receiving end are synchronized, and the initial state and polynomial of the M sequence generators at the sending end and the receiving end are completely the same. In this way, the sequence number of each data packet can be unique and strongly related to the state of the M sequence generator, and the receiving end can tolerate a certain degree of out-of-order. It can confirm whether a certain packet is a packet from another position that arrives in advance by checking the sequence number, instead of misjudging it as a lost packet, and has strong anti-out-of-order capability. Only when the packet is truly lost, the continuity of the label will be essentially broken.

[0061] Specifically, the following processes are performed in the sending end:

[0062] 1. Initialize M-sequence generator: at the data sending end, initialize a linear feedback shift register (LFSR) whose generating polynomial determines a specific M-sequence. The initial state and polynomial of the M-sequence generator at the sending end and the receiving end are completely identical.

[0063] 2. Generate parallel sequence number: every time a data packet is successfully assembled or ready to be sent, the M-sequence generator advances one step to generate a new M-sequence code value. The code value is embedded into the packet header of the data packet as the packet sequence number (PSN_N).

[0064] 3. Record and send: record the current PSN_N and the data packet sending timestamp in the local log, and then send the data packet.

[0065] As shown in Figure 1 , initialize an M-sequence generator at the receiving end that is completely identical to the one at the sending end. The specific process of detecting and locating packet loss is as follows:

[0066] S1. Receive the data packet sent by the sending end and the log information of the sending end. The data packet header carries the M-sequence code value generated by the M-sequence generator of the sending end after the sending end successfully assembled the data packet. The M-sequence code value is taken as the packet sequence number.

[0067] S2. Extract the packet sequence number from the data packet and compare it with the expected packet sequence number generated by the M-sequence generator at the receiving end based on the current state. If they match, the state of the M-sequence generator at the receiving end advances one step and the expected packet sequence number is stored in the received sequence number database.

[0068] S3. If they do not match, calculate the sequence number difference based on the extracted packet sequence number and the expected packet sequence number, and perform data packet integrity transmission detection based on the sequence number difference.

[0069] If the packet sequence number matches the expected packet sequence number, it means that the data packet arrives correctly in sequence. The M-sequence generator at the receiving end advances one step to prepare for the verification of the next packet. The data packet is sent to the application layer for processing. If they do not match, the receiving end calculates the missing or redundant sequence numbers based on the current expected packet sequence number and the received packet sequence number, based on the deterministic principle of the M-sequence, to accurately determine. Specifically, the specific process of data packet integrity transmission detection in step S3 is as follows:

[0070] S31. When the packet sequence number does not match the expected packet sequence number, check whether there is a received sequence number data that matches the packet sequence number in the received sequence number database. If there is, the detection result is packet duplication. If there is not, perform step S32.

[0071] S32, calculate the sequence number difference value according to the extracted data packet sequence number and the expected data packet sequence number;

[0072] S33, when the sequence number difference value is positive, i.e. the data packet sequence number is greater than the expected data packet sequence number, and there is a certain sequence number in between, the detection result is packet loss;

[0073] S34, when the sequence number difference value is negative, i.e. the data packet sequence number is less than the expected data packet sequence number, it means that it may be a delayed old packet, and the detection result is packet sequence error.

[0074] S4, according to the detection result and the log information of the sending end, the fault cause is located and the recovery strategy is executed.

[0075] Combined with the log of the sending end, the fault link can be further located. If the log shows that a certain data packet sequence number has been sent but not received by the receiving end, the transmission link packet is lost. If the M sequence of the sending end advances, but the data packet corresponding to the PSN cannot be assembled or sent at all, the internal packet of the collection end is lost. The receiving end can continuously count the occurrence rate of various error events and generate an alarm, and the specific analysis process is as follows:

[0076] A, when the detection result is packet loss, the specific process of locating the packet loss reason is as follows:

[0077] S331, when the detection result is packet loss, the log information of the sending end is queried, which includes the data packet sequence number and the corresponding data packet sequence number of the data packet sent successfully by the sending end;

[0078] S332, match the expected data packet sequence number with the data packet sequence number in the log information. If it can be matched successfully, it is judged that the transmission link packet is lost;

[0079] If it cannot be matched in the log information, it is judged that the sending end internal packet is lost.

[0080] A1, when the detection result is packet loss, the recovery strategy is as follows:

[0081] According to the sequence number difference value and the continuity of the M sequence, the missing data packet sequence number range is calculated, the packet loss alarm event is generated, and all the missing data packet sequence numbers are generated according to the data packet sequence number range;

[0082] According to the current transmission link type, it is judged whether to wait for retransmission or ignore.

[0083] A2, if the current transmission link type is real-time flow, the state of the M sequence generator of the receiving end is forced to update to the data packet sequence number corresponding to the currently received data packet, so as to obtain the expected data packet sequence number matched with the data packet sequence number corresponding to the currently received data packet;

[0084] Then the state of the M-sequence generator of the receiving end is further advanced, and the expected data packet sequence number after forced update is stored in the received sequence number database.

[0085] A3. If the current transmission link type is reliable transmission, the state of the M-sequence generator of the receiving end is kept unchanged, the currently received data packet is stored in the cache queue, and the data packet sequence number that needs to start retransmission is encapsulated into a retransmission request to send the retransmission request to the sending end;

[0086] The receiving end waits to receive the retransmitted data packet, stores the received retransmitted data packet in the cache queue, reads the data packets from the cache queue in sequence according to the data packet sequence number of the data packets, and updates the state of the M-sequence generator of the receiving end and the received sequence number database correspondingly when reading the data packets.

[0087] When the data packets in the cache queue are read, the state of the M-sequence generator of the receiving end is further advanced, and the receiving end waits to receive the next data packet sent by the sending end.

[0088] B. When the detection result is packet repetition, a packet repetition alarm event is generated, the data packet sequence number is recorded as repetition, the currently received data packet is discarded, the state of the M-sequence generator of the receiving end is kept unchanged, and the receiving end waits to receive the next data packet sent by the sending end.

[0089] C. When the detection result is packet out-of-sequence, the specific process of the recovery strategy is as follows:

[0090] When the detection result is packet out-of-sequence, a packet out-of-sequence alarm event is generated, the currently received data packet is recorded as a delayed packet, the data packet sequence number corresponding to the delayed packet is stored in the received sequence number database according to the continuity of the M-sequence, the state of the M-sequence generator of the receiving end is kept unchanged, and the receiving end waits to receive the next data packet sent by the sending end.

[0091] In order to better understand the implementation process of the embodiment, the following takes a data acquisition system based on FPGA and gigabit Ethernet as an example, takes FPGA as the sending end, and takes the PC software side as the receiving end, and the specific process is as follows:

[0092] The sending end (FPGA side) implementation:

[0093] ①In the FPGA logic, a 10-stage LFSR (such as a polynomial of x^10+x^3+1) is used as an M-sequence generator, and the initial state is all 1.

[0094] ②Whenever the ADC sampling buffer is full of one frame of data (such as 1024 points), the LFSR advances one bit to generate a new 10-bit PSN.

[0095] ③The PSN, timestamp, and ADC data are packaged into an Ethernet UDP frame together.

[0096] ④ Send the UDP frame through the MAC layer.

[0097] Implementation on the receiving end (PC software side):

[0098] ① The receiving program initializes a 10-level LFSR with the same configuration, and the initial state is also all 1s.

[0099] ② Read UDP packets from the network card and parse out the PSN.

[0100] ③ Compare the parsed PSN with the current status value of the local LFSR (i.e., the expected PSN).

[0101] ④ Case A: Match, data packet is correct, LFSR advances one step, data is sent to processing queue.

[0102] ⑤ Scenario B: Mismatch, assuming the expected PSN is 500, but the received PSN is 503;

[0103] The diagnostic logic immediately calculates the missing PSNs 501 and 502;

[0104] Checking the sender's logs revealed that PSN501 and 502 had been recorded as "sent".

[0105] Conclusion: PSN501 and 502 were lost during network transmission, triggering a "Transmission Link Packet Loss" alarm. If the current transmission link is reliable, the sending end is requested to retransmit the data packets corresponding to PSN501 and 502. After receiving the retransmitted data packets corresponding to PSN501 and 502, the M-sequence generator is controlled to generate the corresponding expected data packet sequence number and store it in the received sequence number database. Furthermore, after receiving the retransmitted data packets, the previously received data packet corresponding to PSN 503 needs to be sent to the application layer for processing before the local LFSR current status value is advanced, preparing for the next generation of expected PSNs.

[0106] ⑥ Case C: Mismatch, received a PSN that has already been received (e.g., 490).

[0107] Conclusion: Duplicate packets exist in the network. A "duplicate packet" alarm is triggered.

[0108] ⑦ The software interface can display information such as the current PSN, expected PSN, packet loss list, and error statistics charts in real time.

[0109] It can be understood that in the embodiment, the M-sequence generator is used to generate a unique data packet sequence number, and the state of the M-sequence generator is used as a tag with a multiple function, which is equivalent to introducing a simple state tag, and can realize the following functions at the same time: packet loss detection and counting (through the state difference), repeated packet and replay attack identification (state value expiration), data injection attack identification (illegal state value), and lightweight synchronization (as a basis for retransmission request).

[0110] Compared with the traditional scheme, which needs a sequence number, a timestamp, a MAC digest and a plurality of fields to realize similar functions, the M-sequence tag is very small. Usually, only a few bits (such as 8 bits or 16 bits) of the tag field need to be added in the data packet header. Compared with adding a large hash value (more than 32 bytes) or complex redundancy check information for each packet, the bandwidth overhead is extremely small.

[0111] In addition, since the M-sequence state is completely irrelevant to the application data, the calculation overhead of generation and verification is extremely low (only involves LFSR shift and comparison). The self-synchronization characteristics of the M-sequence make the system quickly re-synchronize as soon as a legal packet is received after a short out-of-step, which makes it particularly suitable for security reinforcement of Internet of Things devices with limited computing power, while traditional encryption and authentication algorithms are difficult to deploy on these devices. Since each data packet has a unique "fingerprint" based on the M-sequence state, consecutive packet loss will leave a unique "gap" in the tag sequence. By analyzing the difference between the received tag sequence and the local expected sequence, the number and specific position of the lost packets can be calculated like solving an equation, even if multiple packets are lost in succession.

[0112] Compared with the traditional sequence number-based identification method, the prior art provides discrete, single-packet-based verification, which lacks a continuous, data-independent, and whole-communication-session state channel to monitor the overall integrity of the transmission path. It can only tell the system that the data packet is "incomplete" (the sequence number is interrupted), but it cannot directly know how many packets are lost, especially when multiple packets are lost in succession. For example, if the sequence numbers 1, 2, and 5 are received, it is known that packets are lost between 2 and 5, but it cannot be determined whether two packets [3, 4] are lost or only one packet [4] is lost (packet 3 may be delayed). This method is very difficult to handle packet reordering. Reordering may be misjudged as packet loss, and the anti-reordering capability is weak.

[0113] The M-sequence method proposed in the embodiment can tolerate a certain degree of reordering because the tag of each data packet is unique and strongly related to the sequence number. It can confirm through the tag verification that a certain packet is indeed a packet from another position that arrives ahead of time, rather than being misjudged as a lost packet, and has strong anti-reordering capability. Only when a packet is truly lost, the continuity of the tag will be essentially broken.

[0114] In addition, the conventional method often uses block check (such as hash), in order to verify the integrity of a data block (such as 1G file), it is usually necessary to calculate the hash value (such as SHA-256) of the whole block. This is a large amount of calculation, and it is impossible to judge the integrity in real time during the data stream transmission. The M sequence method has extremely low calculation overhead, and the generation and verification of M sequence label mainly includes shift and XOR, and the hardware implementation only needs a few gate circuits, and the software implementation is also extremely efficient, and the calculation burden can be ignored. The real-time performance is strong, and the integrity verification of each packet is completed immediately, without waiting for the whole data block transmission to end. Real-time alarm and positioning can be realized.

[0115] The method proposed in the embodiment has great advantages in scenarios that require high-speed, real-time and accurate diagnosis of network problems, such as: high-performance computing (HPC) cluster: checking the transmission integrity of a large amount of data between nodes in parallel computing. Financial transaction system: ensure that each transaction data is not lost, and quickly locate the fault point. Video live streaming and streaming media: diagnose which frame or data packet is lost to cause lag or screen tearing. Industrial Internet of Things (IIoT): monitor the collection link of a large amount of sensor data, and locate the transmission bottleneck; storage system: verify the integrity of data when writing from memory to hard disk or migrating between different storage nodes.

[0116] Embodiment 2

[0117] As shown in Figure 2 The embodiment proposes a data acquisition integrity detection and packet loss positioning system based on M sequence, which includes a sending end and a receiving end. The sending end is a data acquisition system, and the receiving end is a data processing end. M sequence generators with the same initial state and polynomial are deployed in the sending end and the receiving end. The M sequence generator determines a unique M sequence according to the polynomial, wherein the sending end comprises:

[0118] A data packet assembly unit is configured to assemble raw data collected from hardware into a data packet to be sent.

[0119] An M sequence generation unit is configured to further advance the state of the M sequence generator and generate a corresponding M sequence code value after the data packet assembly unit successfully assembles the data packet to be sent.

[0120] The data packet assembly unit is further configured to embed the M sequence code value generated by the M sequence generator as a data packet sequence number in the packet header of the data packet to be sent, and record the data packet to be sent and the data packet sequence number in the log information at this time.

[0121] A sending unit is configured to send the data packet to be sent and the log information to the receiving end through the network. Packet loss, delay or out-of-order problems may occur during network transmission.

[0122] The receiving end comprises:

[0123] a parsing unit, configured to receive a data packet and log information of the sending end sent by the sending end, and parse the data packet to extract a data packet sequence number from the data packet;

[0124] an M sequence synchronization unit, configured to generate an expected data packet sequence number synchronized with the sending end according to a current state of the M sequence generator after receiving the data packet;

[0125] a comparison and verification unit, configured to compare whether the data packet sequence number matches the expected data packet sequence number, if yes, the state of the M sequence generator of the receiving end is further advanced, and the expected data packet sequence number is stored in a received sequence number database, and if no, a diagnostic analysis unit is called for analysis;

[0126] the diagnostic analysis unit, configured to calculate a sequence number difference value according to the extracted data packet sequence number and the expected data packet sequence number, perform data packet integrity transmission detection according to the sequence number difference value, and locate a fault cause and execute a recovery strategy according to a detection result and the log information of the sending end.

[0127] The above is only a preferred embodiment of the present application, and does not limit the present application in any form. According to the technical essence of the present application, any simple modification, equivalent replacement and improvement of the above embodiment within the spirit and principle of the present application are still within the protection scope of the present application.

Claims

1. A method for data acquisition integrity detection and packet loss location based on M-sequences, characterized in that, Both the sending and receiving ends are equipped with M-sequence generators with the same initial state and polynomial. The M-sequence generator determines a unique M-sequence based on the polynomial. The specific process of detection and packet loss localization at the receiving end is as follows: S1. Receive the data packet sent by the sending end and the log information of the sending end. The header of the data packet carries the M sequence code value generated by the M sequence generator of the sending end after the sending end successfully assembles the data packet. Use the M sequence code value as the data packet sequence number. S2. Extract the data packet sequence number from the data packet and compare it with the expected data packet sequence number generated by the M sequence generator at the receiving end based on the current state to determine whether they match. If they match, the state of the M sequence generator at the receiving end advances one step and the expected data packet sequence number is stored in the received sequence number database. S3. If there is no match, calculate the sequence number difference based on the extracted data packet sequence number and the expected data packet sequence number, and perform data packet integrity transmission detection based on the sequence number difference. The specific process of data packet integrity transmission detection in step S3 is as follows: S31. When the data packet sequence number does not match the expected data packet sequence number, check in the received sequence number database whether there is a received sequence number that matches the data packet sequence number. If it exists, the detection result is packet duplication. If it does not exist, proceed to step S32. S32. Calculate the sequence number difference based on the extracted data packet sequence number and the expected data packet sequence number; S33. When the sequence number difference is positive, that is, when the data packet sequence number is greater than the expected data packet sequence number, the detection result is packet loss; S34. When the sequence number difference is negative, that is, when the data packet sequence number is less than the expected data packet sequence number, the detection result is packet out of order. S4. Based on the detection results and the log information from the sending end, locate the cause of the fault and execute the recovery strategy; When the detection result is packet loss, the specific process for locating the cause of packet loss is as follows: S331. When the detection result is packet loss, query the log information of the sending end. The log information includes the data packets that the sending end has successfully sent and their corresponding data packet sequence numbers. S332. Match the expected data packet sequence number with the data packet sequence number in the log information. If a match is found, it is determined that the transmission link has lost packets. If no match is found in the log information, it is determined that there was packet loss on the sending end.

2. The data acquisition integrity detection and packet loss location method based on M-sequence according to claim 1, characterized in that, When the detection result indicates packet loss, the recovery strategy is as follows: The range of missing data packet sequence numbers is calculated based on the sequence number difference and the continuity of the M sequence, a packet loss alarm event is generated, and all missing data packet sequence numbers are generated based on the data packet sequence number range. Determine whether to wait for retransmission or ignore it based on the current transmission link type.

3. The data acquisition integrity detection and packet loss location method based on M-sequence according to claim 2, characterized in that, If the current transmission link type is real-time stream, the state of the M sequence generator at the receiving end is forcibly updated to correspond to the data packet sequence number corresponding to the currently received data packet, so as to obtain the expected data packet sequence number that matches the data packet sequence number corresponding to the currently received data packet. Then, the state of the M-sequence generator at the receiving end is advanced one step, and the expected data packet sequence number after forced update is saved to the received sequence number database.

4. The data acquisition integrity detection and packet loss location method based on M-sequence according to claim 2, characterized in that, If the current transmission link type is reliable transmission, keep the state of the M sequence generator at the receiving end unchanged, store the currently received data packet in the buffer queue, encapsulate the sequence number of the data packet that needs to be retransmitted into the retransmission request, and send the retransmission request to the sending end. The receiving end waits to receive retransmitted data packets, stores the received retransmitted data packets in the buffer queue, reads data packets from the buffer queue in sequence according to the data packet sequence number, and updates the state of the receiving end's M sequence generator and the received sequence number database accordingly when reading data packets. After reading all the data packets in the buffer queue, the state of the receiver's M-sequence generator advances one step, waiting to receive the next data packet sent by the sender.

5. The data acquisition integrity detection and packet loss location method based on M-sequence according to claim 1, characterized in that, When the detection result is a packet duplicate, a packet duplicate alarm event is generated, the packet sequence number is recorded as duplicated, the currently received packet is discarded, the state of the M sequence generator at the receiving end remains unchanged, and it waits to receive the next packet sent by the sending end.

6. The data acquisition integrity detection and packet loss location method based on M-sequence according to claim 1, characterized in that, When the detection result indicates that the packet is out of order, the specific process of the recovery strategy is as follows: When the detection result is packet out of order, a packet out of order alarm event is generated, and the currently received data packet is recorded as a delayed packet. The sequence number of the data packet corresponding to the delayed packet is stored in the received sequence number database according to the M sequence continuity. The state of the M sequence generator at the receiving end remains unchanged, waiting for the next data packet sent by the receiving end.

7. A data acquisition integrity detection and packet loss location system based on M-sequences, employing the data acquisition integrity detection and packet loss location method based on M-sequences as described in claim 1, characterized in that, The system includes a transmitter and a receiver, both of which are equipped with an M-sequence generator having the same initial state and polynomial. The M-sequence generator determines a unique M-sequence based on the polynomial. The transmitter includes: The data packet assembly unit is used to assemble the raw data collected from the hardware into a data packet to be sent. The M-sequence generation unit is used to advance the state of the M-sequence generator and generate the corresponding M-sequence code value after the data packet assembly unit successfully assembles the data packet to be sent. The data packet assembly unit is also used to embed the M sequence code value generated by the M sequence as the data packet sequence number into the header of the data packet to be sent, and to record the data packet to be sent and the data packet sequence number in the log information at this time; The sending unit is used to send the data packets to be sent and log information to the receiving end; The receiving end includes: The parsing unit is used to receive data packets sent by the sending end and log information from the sending end, and to parse the data packets to extract the data packet sequence number. The M-sequence synchronization unit is used to generate the expected data packet sequence number synchronized with the sending end based on the current state of the M-sequence generator after receiving the data packet. The comparison and verification unit is used to compare whether the data packet sequence number matches the expected data packet sequence number. If they match, the state of the M sequence generator at the receiving end advances and the expected data packet sequence number is saved to the received sequence number database. If they do not match, the diagnostic analysis unit is called to perform analysis. The diagnostic analysis unit is used to calculate the sequence number difference based on the extracted data packet sequence number and the expected data packet sequence number, perform data packet integrity transmission detection based on the sequence number difference, and locate the cause of the fault and execute the recovery strategy based on the detection results and the log information of the sending end.

Citation Information

Patent Citations

  • Gold sequence parameter estimation method based on search matching algorithm of generator polynomial library

    CN107342837A

  • A packet loss automatic detection system and a method

    CN109005081A

  • RDMA long-distance communication retransmission method and system

    CN117879768A