Parallel redundancy Ethernet receiving and processing method based on annular sliding window algorithm and related equipment
By adjusting the pointer position and status flags using a circular sliding window algorithm, the packet loss problem in out-of-order message processing of the PRP protocol is solved, improving software performance and transmission stability, and making it suitable for multipath transmission environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-03-10
AI Technical Summary
Existing parallel redundancy protocols (PRPs) have shortcomings in dynamic network adaptability, synchronization accuracy, hardware implementation, and protocol compatibility, which makes it easy to lose packets when processing out-of-order messages and makes it difficult to meet the microsecond-level latency and high reliability requirements of industrial scenarios.
The circular sliding window algorithm is adopted. By initializing the buffer marker array and adjusting the positions of the first and last pointers, the sequence number shifting operation is eliminated. The two state marking methods are combined to handle out-of-order messages, simplifying the memory allocation process and improving the software performance.
It effectively solves the packet loss problem caused by out-of-order messages, improves software performance, adapts to multipath transmission environments, and enhances transmission stability and throughput efficiency.
Smart Images

Figure CN121644016A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of network bus communication, in particular to a parallel redundant Ethernet receiving processing method based on a ring sliding window algorithm and related equipment. BACKGROUND
[0002] Parallel redundancy protocol (PRP) is a key technology for realizing high-reliability data transmission. Its core is to complete data link layer redundancy processing through a dual-network redundancy architecture: the sending end duplicates and distributes a single frame message to dual networks, and the receiving end determines the data redundancy by means of a sliding window and discards duplicate frames and only sends the first frame. For example, the related patent of Shanghai Huanchuang Communication adopts a dynamic discarding strategy to configure parameters, which effectively avoids business failures caused by message sequence logic in standard PRP.
[0003] The ring sliding window is the core packet loss processing mechanism of PRP, with the upper limit of the window set as the expected next frame sequence number and the lower limit as the starting frame sequence number, so as to realize out-of-order reorganization through sequence number comparison; the receiving end extracts the first valid frame from the window after obtaining data from dual networks and discards duplicate frames, thereby guaranteeing data uniqueness; some PRP modules implemented by physical layer (such as dual-redundancy gigabit Ethernet PHY) can realize seamless switching and zero recovery time through hardware acceleration. In order to further optimize performance, existing technologies introduce various optimization methods: dynamic flow control sets MTU threshold and flag bit to inform the upper layer to adjust the sending rate, thereby relieving queue overflow and packet loss; interleaving coding performs redundancy calculation and interleaving processing on packets in the coding stage, thereby improving anti-packet loss capability; clock synchronization compares the clock difference of dual network ports to ensure timing consistency through a latching mechanism. At present, this technology has been widely applied in the fields of power protection devices, vehicle-mounted TSN networks, industrial Ethernet, etc., and can realize microsecond-level delay and 99.999% transmission reliability.
[0004] However, the existing PRP receiving filtering scheme still has many technical defects, mainly concentrated in dynamic adaptability, synchronization accuracy and hardware implementation limitations: first, the dynamic window adjustment has defects, the window capacity depends on the RTT dynamic adjustment, but when the network bursts congestion or path changes, the RTT estimation is easy to lag or deviate, leading to window too large to aggravate congestion, too small to reduce the throughput efficiency (the actual efficiency may be reduced from more than 85% of the theoretical value to less than 70%), and the ring buffer is fixed at 256 frames (single frame 1536 bytes), when the burst traffic exceeds the capacity, even if the dynamic flow control is enabled, it may still cause packet loss due to notification delay; second, the parallel redundant synchronization has problems, relying on IEEE 1588 time synchronization but the difference of hardware clock source will cause microsecond level drift, when the clock difference of double network card exceeds the locking threshold, the data comparison is invalid, and the receiving end only discards strictly repeated frames, which cannot handle the sequence number offset problem caused by double channel out-of-order, which is easy to cause repeated submission or misdeletion of valid frames; third, there are bottlenecks in hardware resources and real-time performance, the frame CRC check, sequence number sorting and other operations of the data selection module implemented by FPGA may introduce more than 10us delay under extreme load such as 1Gbps full bandwidth, which breaks the microsecond level recovery requirement of industrial scene, and high frequency data packet transmission is easy to cause interrupt storm, leading to sharp increase of CPU load; fourth, the protocol compatibility has defects, the protocol stack reconstruction when dynamically switching PRP / HSR mode will cause 5-10ms data interruption, and the retransmission request (SACK) of sliding window may be misjudged as congestion signal by the intermediate device in the network, triggering unnecessary rate limiting. These defects are easy to be triggered in wireless roaming network, video stream burst transmission, cross-device long-distance transmission, industrial control real-time bus and other scenes, affecting the transmission stability.
[0005] The sliding window filtering scheme of PRP protocol can simplify the sequence number filtering process, omit the mechanism of judging the arrival of the same sequence number in time sequence through time stamp, improve the software algorithm performance and reduce the design complexity, but in multipath transmission environment, the message order is easy to become chaotic, at this time, simply using sliding window algorithm will cause message loss. In summary, the existing scheme has significant limitations in dynamic network adaptability and hardware real-time performance, and further optimization is needed to improve the technical robustness. SUMMARY
[0006] In order to overcome the defects of the prior art, the purpose of the present application is to provide a parallel redundant Ethernet receiving processing method based on ring sliding window algorithm and related equipment, to solve the technical problem of how to realize the reception of out-of-order messages while avoiding packet loss caused by out-of-order.
[0007] The present application is realized by the following technical scheme: In a first aspect, the present application provides a parallel redundant Ethernet receiving processing method based on ring sliding window algorithm, comprising: Initialize and configure the buffer tag array and the start and end pointers of the circular sliding window to establish the basis for recording the message arrival status; Based on the records, when a new message is received, the positions of the first and last pointers of the circular sliding window are adjusted according to the offset to be adjusted, in order to replace the array shifting operation; Based on the adjusted pointer position, the corresponding area within the annular sliding window is marked with a status, and the parallel redundant Ethernet receiving and processing is completed according to the status marking.
[0008] Preferably, the initialization configuration includes setting all elements of the buffer tag array to zero, the length of the buffer tag array being a configurable value with a default length of 256; initializing the first pointer L of the circular sliding window to 0 and the tail pointer R to the length of the buffer tag array - 1.
[0009] Furthermore, adjusting the positions of the first and last pointers of the circular sliding window specifically includes adjusting the first pointer L and the last pointer R, where the formula for adjusting the first pointer L is as follows: L = (L - delta)% length; The formula for adjusting the tail pointer R is as follows: R = (R - delta) % length; Where delta is the offset to be adjusted; length is the length of the buffer marker array.
[0010] Furthermore, the corresponding area within the annular sliding window is marked with a status, including marking the delta bit starting from the left boundary of the annular sliding window as a non-received state, with the mark value of the non-received state being 0; the marking is implemented using a memory segment setting interface, when R+delta ≤ length-1, directly marking arr [R+1, (R+delta)% length] as 0; when R+delta>length-1, first marking arr [R+1, length-1] as 0, and then marking arr [0, R+delta-length] as 0.
[0011] Furthermore, the corresponding area within the annular sliding window is marked with a status, including marking the delta bit starting from the left boundary of the annular sliding window as a non-received state, with the mark value of the non-received state being 0; the marking is implemented one by one using a loop operation, and when delta=1, the loop operation is omitted, the first pointer L and the tail pointer R are shifted left by 1 bit, the received mark operation at the left boundary of the annular sliding window is directly executed and the adjustment process is exited.
[0012] Furthermore, during the process of cyclically marking each packet, the number of lost packets is counted simultaneously.
[0013] Preferably, marking the corresponding area within the annular sliding window further includes marking the array position corresponding to the left boundary of the annular sliding window, i.e., the first pointer L, as a received state, wherein the mark value of the received state is 1.
[0014] Secondly, the present invention also provides a parallel redundant Ethernet receiving and processing system based on a ring sliding window algorithm, used to implement the above-described parallel redundant Ethernet receiving and processing method based on a ring sliding window algorithm, comprising: The array pointer initialization module is used to initialize and configure the buffer marker array and the first and last pointers of the circular sliding window, establishing the basis for recording the message arrival status; The pointer shift adjustment module is used to adjust the positions of the first and last pointers of the circular sliding window based on the offset to be adjusted when a new message is received, based on the recorded data, in order to replace the array shift operation; The status marking processing module is used to mark the status of the corresponding area within the annular sliding window based on the adjusted pointer position, and to complete the parallel redundant Ethernet reception processing based on the status marking.
[0015] Thirdly, the present invention also provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the parallel redundant Ethernet high-performance receiving processing method described above.
[0016] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the parallel redundant Ethernet high-performance receiving processing method described above.
[0017] Compared with the prior art, the present invention has the following beneficial technical effects: This invention provides a parallel redundant Ethernet receiving and processing method based on a circular sliding window algorithm. The circular sliding window algorithm eliminates the array copying operation caused by sequence number shifting, simplifies the memory allocation process, and improves software performance. This invention also provides two methods for marking non-received states. The first method is highly efficient in configuration and suitable for scenarios with a large number of out-of-order packets to improve software performance. The second method can statistically analyze packet loss data, taking into account the software's statistical functions, and does not affect algorithm performance when there are few out-of-order packets. This effectively solves the packet loss problem caused by out-of-order packets in multipath transmission environments and addresses the performance bottlenecks of traditional algorithms. Attached Figure Description
[0018] Figure 1 This is a flowchart of the parallel redundant Ethernet receiving and processing method based on the ring sliding window algorithm in an embodiment of the present invention; Figure 2This is a schematic diagram of a parallel redundant Ethernet receiving and processing system based on a circular sliding window algorithm in an embodiment of the present invention. In the diagram: 1. Array pointer initialization module; 2. Pointer shifting and adjustment module; 3. Status flag processing module. Detailed Implementation
[0019] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0021] The purpose of this invention is to provide a parallel redundant Ethernet receiving and processing method and related equipment based on the ring sliding window algorithm, so as to solve the technical problem of how to receive out-of-order packets while avoiding packet loss caused by out-of-order packets.
[0022] The present invention will now be described in further detail with reference to the accompanying drawings: See Figure 1 This invention provides a parallel redundant Ethernet receiving processing method based on a circular sliding window algorithm, comprising: Step 1: Initialize and configure the buffer tag array and the start and end pointers of the circular sliding window to establish the basis for recording the message arrival status; Specifically, the initialization configuration includes setting all elements of the buffer tag array to zero. The length of the buffer tag array is a configurable value, with a default length of 256. The first pointer L of the circular sliding window is initialized to 0, and the tail pointer R is initialized to the length of the buffer tag array - 1.
[0023] Array right shift by delta bits includes: (1) Array right shift delta: arr_t[]<- arr[]; arr[delta,length-1]<- arr_t[0,length-1-delta]; (2) The newly added delta vacant positions are marked as not received: arr[0,delta-1]<- non_received(0); (3) The array 0 subscript position marker has been received: arr[0] = received(1).
[0024] Step 2: Based on the records, when a new message is received, adjust the positions of the first and last pointers of the circular sliding window according to the offset to be adjusted, in order to replace the array shifting operation; Specifically, adjusting the positions of the first and last pointers in the circular sliding window includes adjusting the first pointer L and the last pointer R. The formula for adjusting the first pointer L is as follows: L = (L - delta)% length; The formula for adjusting the tail pointer R is as follows: R=(R-delta)% length=(L-1-delta)%length; Where delta is the offset to be adjusted; length is the length of the buffer marker array.
[0025] In this embodiment, the array is initialized as follows: Array is set to zero: L = 0, R = length - 1 Shifting a circular array right by delta bits: R = (L-1)%length (1) Shift the first and last pointers (indices) of the circular array left by delta positions: L = (L - delta) % length, R = (R - delta) % length = (L - 1 - delta) % length (2) The delta bits starting at the left boundary (L index / R+1 index) of the circular array are marked as not received: arr[L,(L+delta-1)%length]<- non_received(0) (3) The left boundary (L index) of the circular array is marked as received: arr[L]=received(1) (4) The delta bit starting at the left boundary (L index / R+1 index) of the circular array is marked as not received.
[0026] Step 3: Based on the adjusted pointer position, mark the status of the corresponding area within the annular sliding window, and complete the parallel redundant Ethernet receiving and processing work according to the status marks.
[0027] The method for marking the corresponding area within the annular sliding window includes marking the delta bit starting from the left boundary of the annular sliding window as a non-received state, with the mark value of the non-received state being 0. The marking is implemented using a memory segment setting interface. When R+delta ≤ length-1, arr [R+1, (R+delta)% length] is directly marked as 0. When R+delta > length-1, arr [R+1, length-1] is first marked as 0, and then arr [0, R+delta-length] is marked as 0.
[0028] The method involves marking the corresponding area within the annular sliding window with a status. The second method includes marking the delta bit starting from the left boundary of the annular sliding window as a non-received state, with the value of the non-received state being 0. The marking is implemented one by one using a loop operation. When delta=1, the loop operation is omitted, and after the first pointer L and the tail pointer R are shifted left by 1 bit, the received marking operation at the left boundary of the annular sliding window is directly executed and the adjustment process is exited.
[0029] In this invention, during the process of cyclically calculating and marking each packet, the number of lost packets is counted simultaneously.
[0030] In this invention, the corresponding area within the annular sliding window is marked with a status, and the array position corresponding to the left boundary of the annular sliding window, i.e., the first pointer L, is marked as a received state, and the marked value of the received state is 1.
[0031] Example 1 This embodiment provides a parallel redundant Ethernet receiving processing method based on the ring sliding window algorithm for receiving out-of-order packets caused by multipath propagation. The specific process is as follows: Initialize the buffer marker array [0, 255], with the first pointer L = 0 and the tail pointer R = 255; Receive message 1_a: Update the window to [1,x,x…,x], mark sequence number 1 as received, and upload the message; Receive message 1_b: Window state is [1,x,x…,x], this sequence number has been marked, discard the message; Receive message 2_a: offset delta=1, after adjusting the pointer, the array is shifted 1 bit to the right, the window is updated to [2,1,x…,x], sequence number 2 is marked as received, and the message is uploaded; Receive message 2_b: Window state is [2,1,x…,x], this sequence number has been marked, discard the message; Receive message 3_a: offset delta=1, after adjusting the pointer, the array is shifted 1 bit to the right, the window is updated to [3,2,1,x…,x], sequence number 3 is marked as received, and the message is uploaded; Receive message 5_a: offset delta=2, after adjusting the pointer, the array is shifted 2 positions to the right, the window is updated to [5,x,3,2,1,x…,x], sequence number 5 is marked as received, and the message is uploaded; Receive message 4_a: Update the window to [5,4,3,2,1,x…,x], mark sequence number 4 as received, and upload the message; Receive message 8_a: offset delta=3, after adjusting the pointer, the array is shifted 3 bits to the right, the window is updated to [8,x,x,5,4,3,2,1,x…,x], sequence number 8 is marked as received, and the message is uploaded; Receive message 6_a: Update the window to [8,x,6,5,4,3,2,1,x…,x], mark sequence number 6 as received, and upload the message; Received message 4_b: Window state is [8,263], this sequence number has been marked, discard the message.
[0032] Example 2 This embodiment provides a parallel redundant Ethernet receiving processing method based on the ring sliding window algorithm for receiving out-of-order packets caused by packet loss. The specific process is as follows: Initialize the buffer marker array [0, 255], with the first pointer L = 0 and the tail pointer R = 255; Receive message 1_b: Update the window to [1,x,x…,x], mark sequence number 1 as received, and upload the message; Received message 1_a: Window state is [2,1,x…,x], this sequence number has been marked, discard the message; Receive message 2_b: Update the window to [2,1,x…,x], mark sequence number 2 as received, and upload the message; Receive message 3_b: Update the window to [3,2,1,x…,x], mark sequence number 3 as received, and upload the message; Receive message 2_a: Window state is [3,2,1,x…,x], this sequence number has been marked, discard the message; Received message 3_a: Window state is [3,2,1,x…,x], this sequence number has been marked, discard the message; Message 4_a was lost and no corresponding action was taken. Receive message 5_a: offset delta=2, after adjusting the pointer, the window is updated to [5,x,3,2,1,x…,x], sequence number 5 is marked as received, and the message is uploaded; Receive message 4_b: Update the window to [5,4,3,2,1,x…,x], mark sequence number 4 as received, and upload the message; Receive message 6_a: Update the window to [6,5,4,3,2,1,x…,x], mark sequence number 6 as received, and upload the message.
[0033] The length of the buffer tag array of the present invention can be flexibly configured according to the actual application scenario, and is not limited to the default 256; the two methods for not receiving status tags can be dynamically selected according to the number of out-of-order packets. When there are many out-of-order packets, the first method is selected to improve performance, and when it is necessary to count the number of lost packets or when there are few out-of-order packets, the second method is selected to balance functionality and efficiency.
[0034] In summary, this invention provides a parallel redundant Ethernet receiving processing method based on the circular sliding window algorithm. The circular sliding window algorithm eliminates the array copying operation caused by sequence number shifting, simplifies the memory allocation process, and improves software performance. This invention also provides two methods for marking non-received states. The first method is highly efficient in configuration and suitable for scenarios with a large number of out-of-order packets to improve software performance. The second method can statistically analyze packet loss data, taking into account the software's statistical functions, and does not affect algorithm performance when there are few out-of-order packets. This effectively solves the packet loss problem caused by out-of-order packets in multipath transmission environments and addresses the performance bottlenecks of traditional algorithms.
[0035] Example 3 according to Figure 2 As shown, this embodiment provides a parallel redundant Ethernet receiving and processing system based on a circular sliding window algorithm, used to implement the above-described parallel redundant Ethernet receiving and processing method based on a circular sliding window algorithm, including: Array pointer initialization module 1 is used to initialize and configure the buffer mark array and the first and last pointers of the circular sliding window, and establish the basis for recording the message arrival status; The pointer shift adjustment module 2 is used to adjust the positions of the first and last pointers of the circular sliding window based on the offset to be adjusted when a new message is received, based on the recorded data, in order to replace the array shift operation. The status marking processing module 3 is used to mark the status of the corresponding area within the annular sliding window based on the adjusted pointer position, and to complete the parallel redundant Ethernet reception processing based on the status marking.
[0036] Example 4 The present invention also provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, such as a parallel redundant Ethernet receiving processing program based on a circular sliding window algorithm.
[0037] When the processor executes the computer program, it implements the steps of the above-described parallel redundant Ethernet receiving processing method based on the ring sliding window algorithm, for example: Initialize and configure the buffer tag array and the start and end pointers of the circular sliding window to establish the basis for recording the message arrival status; Based on the records, when a new message is received, the positions of the first and last pointers of the circular sliding window are adjusted according to the offset to be adjusted, in order to replace the array shifting operation; Based on the adjusted pointer position, the corresponding area within the annular sliding window is marked with a status, and the parallel redundant Ethernet receiving and processing is completed according to the status marking.
[0038] Alternatively, when the processor executes the computer program, it implements the functions of each module in the above system, for example: Array pointer initialization module 1 is used to initialize and configure the buffer mark array and the first and last pointers of the circular sliding window, and establish the basis for recording the message arrival status; The pointer shift adjustment module 2 is used to adjust the positions of the first and last pointers of the circular sliding window based on the offset to be adjusted when a new message is received, based on the recorded data, in order to replace the array shift operation. The status marking processing module 3 is used to mark the status of the corresponding area within the annular sliding window based on the adjusted pointer position, and to complete the parallel redundant Ethernet reception processing based on the status marking.
[0039] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the mobile terminal.
[0040] For example, the computer program can be divided into an array pointer initialization module 1, a pointer shifting and adjustment module 2, and a status flag processing module 3; The specific functions of each module are as follows: Array pointer initialization module 1 is used to initialize and configure the buffer mark array and the first and last pointers of the circular sliding window, and establish the basis for recording the message arrival status; The pointer shift adjustment module 2 is used to adjust the positions of the first and last pointers of the circular sliding window based on the offset to be adjusted when a new message is received, based on the recorded data, in order to replace the array shift operation. The status marking processing module 3 is used to mark the status of the corresponding area within the annular sliding window based on the adjusted pointer position, and to complete the parallel redundant Ethernet reception processing based on the status marking.
[0041] The mobile terminal can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The mobile terminal may include, but is not limited to, a processor and memory.
[0042] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the mobile terminal, connecting various parts of the mobile terminal via various interfaces and lines.
[0043] The memory can be used to store the computer program and / or module. The processor implements various functions of the mobile terminal by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory.
[0044] The memory may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function (such as sound playback, image playback, etc.); the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disks, RAM, plug-in hard disks, SmartMediaCards (SMC), Secure Digital (SD) cards, FlashCards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0045] Example 5 The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the parallel redundant Ethernet receiving and processing method based on a ring sliding window algorithm.
[0046] If the modules / units integrated in the mobile terminal are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0047] Based on this understanding, all or part of the processes in the above-described method can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of the above-described aggregated reinforcement learning resource scheduling method. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate form.
[0048] The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0049] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A parallel redundant Ethernet receiving processing method based on a ring sliding window algorithm, characterized in that, Comprise: The initialization configuration includes setting all elements of the buffer mark array to zero, and the length of the buffer mark array is a configurable value, and the default length is 256; the head pointer L of the ring sliding window is initialized to 0, and the tail pointer R is initialized to the length of the buffer mark array minus 1. The adjustment of the head pointer L and the tail pointer R of the ring sliding window includes the adjustment of the head pointer L and the tail pointer R, wherein the adjustment formula of the head pointer L is as follows: L=(L-delta)% length; 2. The parallel redundant Ethernet receiving processing method based on the ring sliding window algorithm according to claim 1, characterized in that, The adjustment formula of the tail pointer R is as follows:
3. The parallel redundant Ethernet receiving processing method based on ring sliding window algorithm according to claim 2, characterized in that, R=(R-delta)% length; Wherein, delta is the offset to be adjusted; length is the length of the buffer mark array. The state marking of the corresponding region in the ring sliding window includes marking the delta bits starting from the left boundary of the ring sliding window as an unreceived state, and the marking value of the unreceived state is 0; the marking is realized by using a memory segment setting interface, when R+delta≤length-1, arr[R+1, (R+delta)%length] is directly marked as 0; when R+delta>length-1, arr[R+1, length-1] is marked as 0 first, and then arr[0, R+delta-length] is marked as 0. The state marking of the corresponding region in the ring sliding window includes marking the delta bits starting from the left boundary of the ring sliding window as an unreceived state, and the marking value of the unreceived state is 0; the marking is realized by using a memory segment setting interface, when R+delta≤length-1, arr[R+1, (R+delta)%length] is directly marked as 0; when R+delta>length-1, arr[R+1, length-1] is marked as 0 first, and then arr[0, R+delta-length] is marked as 0. The process of marking one by one in the loop operation is to synchronize the packet loss number.
4. The parallel redundant Ethernet receiving processing method based on ring sliding window algorithm according to claim 3, characterized in that, 7. The parallel redundant Ethernet receiving processing method based on the ring sliding window algorithm of claim 1, wherein the state marking of the corresponding region in the ring sliding window further comprises marking the array position corresponding to the left boundary of the ring sliding window, i.e. the head pointer L, as a received state, and the marking value of the received state is 1.
5. The parallel redundant Ethernet receiving processing method based on ring sliding window algorithm according to claim 3, characterized in that, A parallel redundant Ethernet receiving processing method based on a ring sliding window algorithm is implemented, comprising:
6. The parallel redundant Ethernet receiving processing method based on ring sliding window algorithm according to claim 5, characterized in that, An array pointer initialization module is configured to initialize the head and tail pointers of the buffer mark array and the ring sliding window, and to establish a record basis for the state of the arriving packet; A pointer shift adjustment module is configured to adjust the head and tail pointers of the ring sliding window based on the offset to be adjusted when receiving a new packet on the record basis, instead of array shift operation; 8. A parallel redundant Ethernet receiving processing system based on a ring sliding window algorithm, characterized in that, An array pointer initialization module is configured to initialize the head and tail pointers of the buffer mark array and the ring sliding window, and to establish a record basis for the state of the arriving packet; A state marking processing module is configured to mark a corresponding region in the ring-shaped sliding window based on the adjusted pointer position, and complete parallel redundant Ethernet receiving processing work according to the state marking.
9. A mobile terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the parallel redundant Ethernet high-performance receiving processing method according to any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the steps of the parallel redundant Ethernet high-performance receiving processing method according to any one of claims 1-7.
Citation Information
Patent Citations
Data processing method and storage system
CN114780458A
Data processing method, electronic equipment and storage medium
CN116647516A
Method and system for reducing data transmission packet loss rate of USB (Universal Serial Bus) virtual serial port and related equipment
CN119961200A
Power line carrier communication protocol data link layer simulation method
CN120729361A
Use of a circular buffer to assure in-order delivery of packets
US20030026277A1