Data processing method, electronic device, and storage medium

By creating a data transmission protocol and using a sliding window to process data frames at the receiving end, the shortcomings of the PRP protocol in complex network situations are resolved, and the flexibility and efficiency of multi-link data processing are improved.

CN116647516BActive Publication Date: 2026-04-24安徽蔚来智驾科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
安徽蔚来智驾科技有限公司
Filing Date
2023-05-31
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

The existing PRP protocol lacks effective means to handle complex network conditions such as network storms and network latency, and cannot meet the redundant communication requirements of multiple network links.

Method used

At the receiving end, a data transmission protocol is created, data frames are received, and a sliding window is created in the buffer. Data frames are selectively discarded or sent to the application layer based on the frame sequence number and the sliding window. Multi-link data is processed through dynamic adjustment of the frame sequence number and the sliding window.

Benefits of technology

Without requiring modifications to the network receiving hardware, it improves the flexibility and efficiency of multi-link data processing, ensures the validity of data frames, and enables redundant data processing across multiple network links.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116647516B_ABST
    Figure CN116647516B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communication, and specifically provides a data processing method, an electronic device and a storage medium, aiming at solving the problem that the existing method cannot realize the processing of multi-link redundant messages. To this end, the data processing method of the present application comprises: creating a data transmission protocol; receiving a data frame; creating a sliding window in a cache area; selectively discarding the data frame or sending the data frame to an application layer based on the frame sequence number of the data frame and the sliding window. In this way, the flexibility of multi-link data processing is increased, the effectiveness of the data frame is ensured, the redundant data processing function of multi-network link is realized, and the data processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, specifically providing a data processing method, an electronic device, and a storage medium. Background Technology

[0002] With the expansion and widespread application of network protocols, industrial sectors, including the automotive industry, typically design multi-network and complex topologies, even configuring multiple network interface cards (NICs) and switches to achieve redundant communication and ensure information security and reliability. The Parallel Redundancy Protocol (PRP), proposed by the IEC (International Electrotechnical Commission), can guarantee the correctness and security of field communication data during transmission. However, the PRP protocol only addresses dual-network links and lacks handling for complex network conditions in practical applications, such as network storms and network latency.

[0003] Accordingly, a new solution is needed in this field to address the aforementioned problems. Summary of the Invention

[0004] To overcome the aforementioned deficiencies, this invention is proposed to provide solutions or at least partial solutions to the aforementioned technical problems. This invention provides a data processing method, an electronic device, and a storage medium.

[0005] In a first aspect, the present invention provides a data processing method applied to a receiving end, characterized in that the method includes: creating a data transmission protocol; receiving a data frame; creating a sliding window in a buffer; selectively discarding the data frame or sending the data frame to the application layer based on the frame sequence number of the data frame and the sliding window.

[0006] In one implementation, selectively discarding or sending the data frame to the application layer based on the frame sequence number of the data frame and the sliding window includes: determining the positional relationship between the frame sequence number of the data frame and the sliding window; discarding the data frame if the frame sequence number of the data frame is less than the lower limit of the sliding window; selectively discarding or sending the data frame to the application layer based on the frame sequence number of the data frame and the sliding window if the frame sequence number of the data frame is within the sliding window; and updating the sliding window based on the frame sequence number of the data frame if the frame sequence number of the data frame is greater than the upper limit of the sliding window, and selectively discarding or sending the data frame to the application layer based on the frame sequence number of the data frame and the sliding window.

[0007] In one implementation, updating the sliding window based on the frame sequence number of the data frame includes: updating the upper limit of the sliding window based on the frame sequence number of the data frame to obtain the updated sliding window.

[0008] In one implementation, selectively discarding the data frame or sending the data frame to the application layer based on the frame sequence number of the data frame and the sliding window includes: querying the buffer to see if the frame sequence number of the data frame exists; if yes, discarding the data frame; if no, storing the data frame in the buffer, sending consecutive data frames within the sliding window of the buffer to the application layer, and temporarily storing non-consecutive data frames in the buffer.

[0009] In one embodiment, the method further includes: after the data frame is stored in the buffer, setting the flag bit at the corresponding position in the buffer to 1, and / or after the consecutive data frames are sent to the application layer, setting the flag bit at the corresponding position in the buffer to 0.

[0010] In one embodiment, the method further includes: determining whether a data frame stored in the cache has timed out; if so, pushing the data frame to the application layer.

[0011] In one embodiment, determining whether a data frame stored in the buffer has timed out includes: obtaining the transmission time and time threshold of the data frame; determining the time difference based on the transmission time and the lower limit of the sliding window; and determining that the data frame stored in the buffer has timed out if the time difference is greater than the time threshold.

[0012] In one implementation, the sliding window is a dynamic window; creating the sliding window includes: determining the upper and lower limits of the sliding window based on the frame number of the data frame; or determining the lower limit of the sliding window based on the frame number of the data frame and determining the upper limit of the sliding window based on the frame number of the expected next data frame.

[0013] In a second aspect, an electronic device is provided, comprising at least one processor and at least one storage device adapted to store a plurality of program codes adapted to be loaded and executed by the processor to perform the data processing method described in any of the preceding claims.

[0014] In a third aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, the program codes being adapted to be loaded and executed by a processor to perform the data processing method described in any of the preceding claims.

[0015] The above-described technical solutions of the present invention have at least one or more of the following beneficial effects:

[0016] The data processing method of this invention, applied at the receiving end, includes creating a data transmission protocol; receiving data frames; creating a sliding window in a buffer; and selectively discarding or sending the data frames to the application layer based on the frame sequence number and the sliding window. Thus, no adaptation or modification to the network receiving hardware is required, there is no priority difference between links, and for messages with the same sequence number, the first received data frame is processed first, while redundant frames received later are discarded. This increases the flexibility of multi-link data processing, ensures the validity of data frames, realizes redundant data processing functionality across multiple network links, and improves data processing efficiency. Attached Figure Description

[0017] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Furthermore, similar numbers in the drawings are used to denote similar components, wherein:

[0018] Figure 1 This is a schematic flowchart of the main steps of a data processing method according to an embodiment of the present invention;

[0019] Figure 2 This is a schematic diagram of the data transmission protocol in one embodiment;

[0020] Figure 3 This is a schematic diagram of a sliding window for a data frame in one embodiment;

[0021] Figure 4 This is a schematic diagram of a sliding window for a data frame in another embodiment;

[0022] Figure 5 This is a schematic diagram of a process in one embodiment where data frames are selectively discarded or sent based on frame sequence number and sliding window;

[0023] Figure 6 This is a schematic diagram of the complete flow of a data processing method in one embodiment;

[0024] Figure 7 This is a schematic diagram of the structure of an electronic device in one embodiment. Detailed Implementation

[0025] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0026] In the description of this invention, "module" and "processor" can include hardware, software, or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, memory, and may also include software components, such as program code, or a combination of software and hardware. A processor can be a central processing unit, microprocessor, image processor, digital signal processor, or any other suitable processor. The processor has data and / or signal processing capabilities. The processor can be implemented in software, in hardware, or a combination of both. Non-transitory computer-readable storage media includes any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The terms "at least one A or B" or "at least one of A and B" have a similar meaning to "A and / or B" and can include only A, only B, or A and B. The singular terms "a" or "this" can also include plural forms.

[0027] The traditional PRP (Parallel Redundancy Protocol) can guarantee the correctness and security of field communication data during transmission. However, the PRP protocol only applies to two-network links and lacks handling for complex networks or multi-link scenarios in practical use, such as network storms and network latency.

[0028] To address this, this application proposes a data processing method, electronic device, and storage medium applied at a receiving end. The method includes creating a data transmission protocol; receiving data frames; creating a sliding window in a buffer; and selectively discarding or sending the data frames to the application layer based on the frame sequence number and the sliding window. This eliminates the need for adaptation and modification to the network receiving hardware, eliminates priority differences between links, and for messages with the same sequence number, the first received data frame is processed first, while later received redundant frames are discarded. This increases the flexibility of multi-link data processing, ensures the validity of data frames, realizes redundant data processing functionality across multiple network links, and improves data processing efficiency.

[0029] See appendix Figure 1 , Figure 1 This is a schematic flowchart of the main steps of a data processing method according to an embodiment of the present invention.

[0030] like Figure 1 As shown, the data processing method in this embodiment of the invention mainly includes the following steps S101-S104, which are applied to the receiving end.

[0031] Step S101: Create a data transmission protocol.

[0032] Step S102: Receive data frames.

[0033] Step S103: Create a sliding window in the buffer area.

[0034] Step S104: Based on the frame sequence number of the data frame and the sliding window, selectively discard the data frame or send the data frame to the application layer.

[0035] Based on steps S101-S104 above, the process includes: creating a data transmission protocol; receiving data frames; creating a sliding window in the buffer; and selectively discarding or sending the data frames to the application layer based on the frame sequence number and the sliding window. In this way, no adaptation or modification to the network receiving hardware is required, there is no priority difference between links, and for messages with the same sequence number, the first received data frame is processed first, while redundant frames received later are discarded. This increases the flexibility of multi-link data processing, ensures the validity of data frames, realizes redundant data processing functions for multiple network links, and improves data processing efficiency.

[0036] The following provides further explanation of steps S101 to S104.

[0037] Regarding step S101 above, as follows: Figure 2 As shown, creating a data transmission protocol can specifically involve adding a data header to the existing data transmission protocol. The data header is used to identify redundant protocols, transmission channels, and frame sequence numbers (seq_id), etc.

[0038] In addition, the data transmission protocol includes a frame sequence number (seq_id), a timestamp, a version number, and identification data. The frame sequence number (seq_id) ranges from 0 to 65535. For received network transmission messages, channel priority is not distinguished; the frame sequence number (seq_id) is the unique source of identification. The timestamp indicates the transmission time of the data frame, the version number indicates the version number of the data transmission protocol, and the corresponding parsing method is selected based on the version number to parse the data frame. The identification data describes the data content of the data frame.

[0039] The above is a further explanation of step S101. Steps S102 and S103 will be further explained below.

[0040] For step S102, the received data frame can be a continuous frame, or it can be a skipped frame, an out-of-order frame, or a dropped frame, etc. There is no specific limitation on the type of data frame here.

[0041] Regarding step S103, in one specific embodiment, the sliding window is a dynamic window; the creation of the sliding window includes: determining the upper and lower limits of the sliding window based on the frame number of the data frame; or determining the lower limit of the sliding window based on the frame number of the data frame, and determining the upper limit of the sliding window based on the frame number of the expected next data frame.

[0042] Specifically, a dynamic window is formed in the buffer, and the frame sequence number seq_id corresponds to a unique buffer location. A circular buffer can be used as an example of such a buffer, but it is not limited to it.

[0043] A circular buffer, also known as a circular queue, cyclic buffer, or circular buffer, is a data structure used to represent a fixed-size, contiguous buffer, suitable for buffering data streams. In communication programs, circular buffers are frequently used as a data structure to store data sent and received during communication. A circular buffer is a first-in, first-out (FIFO) circular buffer, providing mutual exclusion access to the buffer for the communication program.

[0044] In one embodiment, the upper and lower limits of the sliding window can be determined based on the frame sequence number of the data frame. For example... Figure 3 As shown, if the currently received data frames are consecutive frames, the frame sequence number seq_id of the last received data frame is the lower limit of the window win_min, and the frame sequence number seq_id of the last received data frame is the upper limit of the window win_max. win_min and win_max form a dynamic window. As the frame sequence number seq_id of the received data frames continuously increases, win_min and win_max move simultaneously, and the window size remains 0.

[0045] like Figure 4 As shown, in one embodiment, when a frame skip or out-of-order frame occurs, the lower limit of the sliding window, win_min, remains unchanged, while the upper limit, win_max, is increased, which will cause the window to expand. In this case, the frame sequence number seq_id of the latest received skipped data frame is used as the maximum value of the sliding window.

[0046] In another embodiment, the frame sequence number of the last received consecutive data frames can be set as the lower window limit (win_min), and the frame sequence number (seq_id) of the expected received data frames can be set as the upper window limit (win_max). Furthermore, data frames received less than the lower window limit (win_min) are discarded directly, while data frames greater than the upper window limit (win_max) are buffered until consecutive data frames are available or a timeout occurs, at which point they are pushed to the application layer.

[0047] By creating a sliding window in the buffer, a basic support is provided for the redundancy judgment of data frames, which helps to improve the processing efficiency of data frames.

[0048] The above is a further explanation of step S103. The following is a further explanation of step S104.

[0049] Specifically, such as Figure 5 As shown, the above step S104 can be implemented by the following steps S1041 to S1044.

[0050] Step S1041: Determine the relationship between the frame number of the data frame and the position of the sliding window.

[0051] Positional relationship refers to the relationship between the frame number and the upper or lower limit of the sliding window.

[0052] Step S1042: If the frame number of the data frame is less than the lower limit of the sliding window, discard the data frame.

[0053] If the frame sequence number of a data frame is less than the lower limit of the sliding window (win_min), it is assumed that the data frame has already been received or that the data frame has timed out, and it is discarded directly.

[0054] Step S1043: If the frame sequence number of the data frame is within the sliding window, selectively discard the data frame or send the data frame to the application layer based on the frame sequence number of the data frame and the sliding window.

[0055] Step S1044: If the frame sequence number of the data frame is greater than the upper limit of the sliding window, update the sliding window based on the frame sequence number of the data frame, and selectively discard the data frame or send the data frame to the application layer based on the frame sequence number of the data frame and the sliding window (updated sliding window).

[0056] In one specific implementation, updating the sliding window based on the frame sequence number of the data frame includes: updating the upper limit of the sliding window based on the frame sequence number of the data frame to obtain the updated sliding window.

[0057] Specifically, when the frame sequence number of a data frame is greater than the upper limit of the sliding window, the frame sequence number of the data frame is used as the upper limit of the sliding window, while the lower limit of the sliding window remains unchanged, resulting in an updated sliding window. This facilitates subsequent redundant processing of skipped frames, out-of-order frames, or dropped frames, thereby improving the processing efficiency of data frames.

[0058] In one specific implementation, the step of selectively discarding the data frame or sending the data frame to the application layer based on the frame sequence number of the data frame and the sliding window includes: querying the buffer to see if the frame sequence number of the data frame exists; if yes, discarding the data frame; if no, storing the data frame in the buffer, sending consecutive data frames within the sliding window of the buffer to the application layer, and temporarily storing non-consecutive data frames in the buffer.

[0059] Specifically, the system can check in the buffer whether the frame number of the data frame already exists. If it does, the data frame is discarded. Otherwise, the data frame is stored in the buffer, and consecutive data frames within the sliding window of the buffer are sent to the application layer, while non-consecutive data frames are temporarily stored in the buffer.

[0060] In one specific embodiment, the method further includes: after the data frame is stored in the buffer, setting the flag bit at the corresponding position in the buffer to 1, and / or after the consecutive data frames are sent to the application layer, setting the flag bit at the corresponding position in the buffer to 0.

[0061] Specifically, after a received data frame is temporarily stored in the buffer, the corresponding position in the buffer is marked as 1, and the message content carried by the data frame, such as the transmission channel and timestamp, is recorded. The buffer size is limited; when the buffer size is exceeded, the recorded data is forcibly pushed to the application layer. For data frames that have already been pushed to the application layer, the flag bit at the corresponding position in the buffer is reset to 0, and the corresponding data content in the buffer is also cleared.

[0062] In one specific embodiment, the method further includes: determining whether a data frame stored in the cache has timed out; if so, pushing the data frame to the application layer.

[0063] Specifically, for consecutive frames, skipped frames, out-of-order frames, and dropped frames, the frame sequence and specific data content are stored in the buffer. If a consecutive frame or other type of data frame is about to time out in the buffer, the data frame is pushed to the application layer in order.

[0064] In one specific implementation, determining whether a data frame stored in the buffer has timed out includes: obtaining the transmission time and time threshold of the data frame; determining the time difference based on the transmission time and the lower limit of the sliding window; and determining that the data frame stored in the buffer has timed out if the time difference is greater than the time threshold.

[0065] Because the data transmission protocol includes a field for the sending time of the data frame and is configured with a timeout period (time threshold), the sending time carried by the newly received data frame is compared with the sending time of the data frame corresponding to the lower limit of the dynamic window, win_min. If the time difference is greater than the timeout period, it is considered that the data frame between the lower limit of the window, win_min and the newly received data frame is about to time out, and the data frame needs to be pushed to the application layer to prevent the data from becoming meaningless due to timeout.

[0066] To prevent the dynamic window from expanding indefinitely due to frame drops or network disconnections, when the timestamp of a received data frame exceeds a certain time threshold, data frames within the dynamic window are pushed to the application layer in ascending order of frame sequence number (seq_id), and the window slides to the latest seq_id position. Push rules can be added and changed according to business needs; all cached data within the window can be pushed, or only continuous data within the window can be pushed, while non-continuous data is discarded.

[0067] Additionally, counters can be added to statistically analyze data frame reception during the runtime cycle, such as the number of messages received on each link and the number of redundant frames. This allows for better monitoring of the communication quality and load of a particular link, facilitating better adjustment and optimization of multi-link networks. The data generated during the runtime cycle forms a link health index; the more data pushed to the application layer through a particular channel, the higher the transmission speed and efficiency. This method can provide reference data for network analysis.

[0068] This application's data processing method is applied to scenarios involving multi-link redundant data transmission. It filters redundant messages in real time, handles anomalies, and moves the processing to the receiving end before pushing the processed data up to the application layer to ensure data correctness and reliability. This saves application layer computing resources and improves data processing efficiency. Simultaneously, it decouples from network protocols, making it flexibly applicable to different network scenarios. It also supports data monitoring for each link, providing data such as frame loss rate and transmission efficiency.

[0069] like Figure 6 In one specific embodiment shown, the data processing method of this application can be implemented through the following steps S201 to S211.

[0070] Step S201: Parse the received data frame to obtain the frame sequence number seq_id.

[0071] Step S202: Determine whether the frame number is within the sliding window [win_min, win_max]. If the frame number is less than the lower limit of the window, proceed to step S203; if the frame number is within the sliding window, proceed to step S204; if the frame number is greater than the upper limit of the window, proceed to steps S205 and S204 in sequence.

[0072] Step S203: Discard the data frame.

[0073] Step S204: Receive data frames.

[0074] Step S205: Update the upper limit of the sliding window, win_max, to the frame number.

[0075] Step S206: Check if the frame sequence number in the buffer is redundant. If yes, proceed to step S203; otherwise, proceed to step S207.

[0076] Step S207: Set the flag bit at the corresponding position in the buffer to 1.

[0077] Step S208: Determine if the cached data has timed out. If yes, proceed to step S209; otherwise, proceed to step S210.

[0078] Step S209: Push all data in the sliding window to the application layer and reset the window.

[0079] Step S210: Determine if there are consecutive frames in the sliding window of the buffer. If yes, proceed to step S211; otherwise, end.

[0080] Step S211: Push consecutive data frames to the application layer and reset the corresponding position in the current buffer to 0.

[0081] By identifying redundant data transmitted across multiple links, after receiving the first data frame on any link, subsequent data frames with the same sequence number received on other links are discarded. This achieves the effect of optimal selection; when the network is unstable, messages from the fastest-transmitting link are accepted, while data from other links is discarded. The data received by the application layer is correctly ordered and timely, improving data processing efficiency and the accuracy of processing results. Even when network storms or link failures occur across multiple links, resulting in significant jumps in frame sequence numbers, data can still be pushed to the application layer normally.

[0082] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are all within the scope of protection of the present invention.

[0083] Those skilled in the art will understand that all or part of the processes in the method of the above embodiment of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable storage medium can include any entity or device capable of carrying the computer program code, a medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.

[0084] Furthermore, the present invention also provides an electronic device. In one embodiment of the electronic device according to the present invention, such as Figure 7 As shown, the electronic device includes at least one processor 71 and at least one storage device 72. The storage device 72 can be configured to store a program for executing the data processing method of the above-described method embodiments. The processor 71 can be configured to execute the program in the storage device 72, which includes, but is not limited to, a program for executing the data processing method of the above-described method embodiments. For ease of explanation, only the parts related to the embodiments of the present invention are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of the present invention.

[0085] In embodiments of the present invention, the electronic device may be a control device comprising various devices. In some possible implementations, the electronic device may include multiple storage devices and multiple processors. The program executing the data processing method of the above method embodiments may be divided into multiple subroutines, each subroutine may be loaded and run by a processor to execute different steps of the data processing method of the above method embodiments. Specifically, each subroutine may be stored in different storage devices, and each processor may be configured to execute programs in one or more storage devices to jointly implement the data processing method of the above method embodiments, that is, each processor executes different steps of the data processing method of the above method embodiments to jointly implement the data processing method of the above method embodiments.

[0086] The aforementioned multiple processors can be processors deployed on the same device. For example, the aforementioned electronic device can be a high-performance device composed of multiple processors, and the aforementioned multiple processors can be processors configured on that high-performance device. Alternatively, the aforementioned multiple processors can also be processors deployed on different devices. For example, the aforementioned electronic device can be a server cluster, and the aforementioned multiple processors can be processors on different servers within the server cluster.

[0087] Furthermore, the present invention also provides a computer-readable storage medium. In one embodiment of the computer-readable storage medium according to the present invention, the computer-readable storage medium can be configured to store a program for performing the data processing method of the above-described method embodiments, the program being loaded and run by a processor to implement the above-described data processing method. For ease of explanation, only the parts related to the embodiments of the present invention are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. The computer-readable storage medium can be a storage device comprising various electronic devices; optionally, in the embodiments of the present invention, the computer-readable storage medium is a non-transitory computer-readable storage medium.

[0088] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A data processing method, applied at a receiving end, characterized in that, The method includes: Create a data transmission protocol; Receive data frames; A sliding window is created in the buffer, wherein the upper and lower limits of the sliding window are determined based on the frame sequence number of the data frame; Determine the relationship between the frame number of the data frame and the position of the sliding window; When the frame number of the data frame is greater than the upper limit of the sliding window, The upper limit of the sliding window is updated based on the frame sequence number of the data frame to obtain the updated sliding window. Based on the frame sequence number of the data frame and the sliding window, the data frame may be selectively discarded or sent to the application layer.

2. The data processing method according to claim 1, characterized in that, The method further includes: If the frame number of the data frame is less than the lower limit of the sliding window, the data frame is discarded. If the frame sequence number of the data frame is within the sliding window, the data frame may be selectively discarded or sent to the application layer based on the frame sequence number of the data frame and the sliding window.

3. The data processing method according to claim 1 or 2, characterized in that, The selective discarding or sending of the data frame to the application layer based on the frame sequence number and the sliding window includes: Check the buffer to see if the frame number of the data frame exists; If so, then discard the data frame; If not, the data frame is stored in the buffer, consecutive data frames within the sliding window of the buffer are sent to the application layer, and discontinuous data frames are temporarily stored in the buffer.

4. The data processing method according to claim 3, characterized in that, The method further includes: after the data frame is stored in the buffer, setting the flag bit at the corresponding position in the buffer to 1, and / or After the consecutive data frames are sent to the application layer, the flag bit at the corresponding position in the buffer is set to 0.

5. The data processing method according to claim 3, characterized in that, The method further includes: Determine whether the data frame stored in the buffer has timed out; If so, the data frame is pushed to the application layer.

6. The data processing method according to claim 5, characterized in that, The step of determining whether a data frame stored in the buffer has timed out includes: Obtain the transmission time and time threshold of the data frame; The time difference is determined based on the sending time and the lower limit of the sliding window; If the time difference is greater than the time threshold, then the data frame stored in the buffer is determined to have timed out.

7. The data processing method according to claim 1, characterized in that, The sliding window is a dynamic window; The creation of the sliding window includes: determining the upper and lower limits of the sliding window based on the frame sequence number of the data frame; or The lower limit of the sliding window is determined based on the frame number of the data frame, and the upper limit of the sliding window is determined based on the frame number of the expected next data frame.

8. An electronic device comprising at least one processor and at least one storage device, said storage device being adapted to store a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by the processor to perform the data processing method according to any one of claims 1 to 7.

9. A computer-readable storage medium storing a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by a processor to perform the data processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Implementation method for parallel dual-network redundancy

    CN106911436A

  • IPsec anti-replay method and system based on dynamic sliding window

    CN116155477A