Packet loss error correction method and system based on sliding window
By dynamically adjusting the size of the sliding window and using forward error correction code, the shortcomings of packet loss error correction methods in the existing technology in complex network environments are solved, and efficient and reliable data transmission and resource consumption are achieved.
Patent Information
- Application Number
- CN202510243614.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-13
AI Technical Summary
The existing packet loss error correction method based on sliding windows has problems such as wasting bandwidth, insufficient error correction capabilities, difficulty in optimizing timeout retransmission mechanisms, large consumption of storage and computing resources, and lack of intelligent tuning mechanisms in complex and dynamically changing network environments.
By setting the original number of packets N and redundant number of packets M, the window size is dynamically adjusted according to the FEC encoding and decoding time, packet loss rate, code rate and jitter rate information, the forward error correction code is used to redundantly encode the data packets, and the redundant packets are used to correct errors at the receiving end. Decoding and recovery are performed when the number of lost packets does not exceed the number of redundant packets; otherwise, the retransmission request phase will be entered. At the same time, a confirmation mechanism is used to detect lost packets, and the window size is dynamically adjusted according to the packet loss rate to improve throughput and error correction capabilities.
Adaptive adjustment in different network environments is realized, bandwidth waste is reduced, error correction ability is improved, data transmission reliability and efficiency is ensured, and computing resources and storage consumption is reduced.
Smart Images

Figure CN120150897A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of packet loss error correction, and more specifically, particularly relates to a packet loss error correction method and system based on a sliding window. Background Art
[0002] Currently, real-time media stream transmission has been widely applied in various fields such as video systems, monitoring systems, IPTV, etc., and real-time media stream transmission all uses the Real-time Transport Protocol (RTP). RTP is a protocol that does not support any form of reliability guarantee and does not support any defined congestion control. Therefore, for the RTP protocol itself during real-time media stream transmission, it cannot recover packet loss, and for this reason, packet loss error correction is the key technical focus of all relevant manufacturers.
[0003] Currently, the packet loss error correction technology during real-time media stream transmission generally sets up an out-of-order buffer and a packet loss buffer at the receiving end. Among them, the out-of-order buffer is a buffer set at the receiving end for out-of-order rearrangement, and packet loss is not judged in this buffer; the packet loss buffer is a buffer set at the receiving end after the out-of-order buffer to judge packet loss and wait for the retransmission packet to be received. In the packet loss buffer, it is judged whether the sequence numbers of the received packets are continuous according to the detection points or monitoring points set by the user. If they are not continuous, it indicates that there is packet loss, and a packet loss retransmission request is sent to the sending end. After receiving the packet loss retransmission request, the sending end searches for the required packet in the retransmission buffer and then retransmits it. Here, the retransmission buffer is a buffer that backs up the already sent data packets after the sending end sends the data packets, and can retransmit them when the receiving end requests retransmission. After receiving the retransmission buffer, the receiving end fills it into the corresponding positions of the receiving buffer (including the out-of-order buffer and the packet loss buffer), and then sends it to the decoder for decoding.
[0004] Although the packet loss error correction method based on a sliding window has been widely applied in many network protocols, there are still some challenges in complex and dynamically changing network environments. First, due to the fluctuation of the packet loss rate, a fixed Forward Error Correction (FEC) redundancy ratio may lead to unnecessary bandwidth waste or insufficient error correction ability. Second, the timeout parameter in the timeout retransmission mechanism is difficult to optimize. Too short a timeout may lead to misjudgment and unnecessary retransmissions, while too long a timeout will introduce high latency. In addition, the storage requirements and computational overhead of the sliding window also pose challenges to low-resource devices, especially in the case of high packet loss or large-scale transmission. More importantly, the existing methods lack a sufficient intelligent tuning mechanism and cannot timely predict and adapt to changes in the packet loss pattern, thus affecting the reliability and efficiency of data transmission. Therefore, it is necessary to introduce more intelligent adjustment strategies and optimization algorithms to solve these problems and improve the adaptability and transmission efficiency of network protocols. Summary of the Invention
[0005] The purpose of this section is to outline some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of the present application, to avoid obscuring the purpose of this section, the abstract, and the title. However, such simplifications or omissions shall not be used to limit the scope of the present invention.
[0006] In view of the problems of the above-mentioned or existing packet loss correction methods and systems based on sliding windows, the present invention is proposed.
[0007] To solve the above technical problems, the present invention provides the following technical solutions:
[0008] An embodiment of the present invention provides a packet loss correction method based on a sliding window, including: setting the number of original data packets N, the number of redundant data packets M, the FEC encoding time, and the FEC decoding time, and determining a preliminary window size according to the FEC encoding and decoding time, packet loss rate, code rate, and jitter rate information;
[0009] Performing redundant encoding on the data packets using a forward error correction code, generating M redundant data packets for every N original data packets, and the sender sequentially sending N + M data packets based on the sliding window;
[0010] The receiver maintains a receiving window, stores the received data packets, and uses the redundant packets for error correction. If the number of lost packets does not exceed the number of redundant packets M, the data is decoded and restored; if the number of lost packets exceeds M, it enters the retransmission request stage;
[0011] Using an acknowledgement mechanism to detect lost data packets. If an ACK is not received or an NACK is received within T timeout , the sender retransmits the missing data packets;
[0012] Dynamically adjusting the window size according to the packet loss rate. When the packet loss rate is low, reduce the window size, with the window size not less than 10 data packets, to improve throughput and increase the balanced coding delay to balance the growth rate; when the packet loss rate is high, increase the window size to increase the packet loss correction recovery rate, with the window size not higher than 50 data packets to ensure that the FEC encoding can effectively recover the lost data packets; applying the TCP sliding window to the FEC encoding; when the receiving window time becomes longer, moderately reduce the window size.
[0013] As a preferred solution of the packet loss correction method based on a sliding window according to the present invention, wherein: the performing redundant encoding on the data packets using a forward error correction code, generating M redundant data packets for every N original data packets, and the sender sequentially sending N + M data packets based on the sliding window includes:
[0014] Assume that each window at the sender contains N original data packets and M redundant data packets, that is, N + M data packets are transmitted each time. At initialization, the size of the sliding window is N + M, and N data packets and M redundant data packets are sent in sequence for each window;
[0015] Each time, the sender performs FEC encoding on N original data packets and M redundant data packets. The encoded data packets are divided into original data packets and redundant packets. The redundant packets are generated through SD-RS FEC encoding and decoding, so as to ensure that even if some data packets are lost, the receiver can still recover the complete data;
[0016] Based on the received data packets and FEC header information, the receiver performs decoding processing. If the received data packets are insufficient and the number of lost data packets is less than or equal to the number of redundant packets M, the receiver uses FEC decoding to recover the lost data packets; if the number of lost data packets K > M, the receiver cannot recover and needs to request a retransmission.
[0017] As a preferred solution of the packet loss correction method based on a sliding window according to the present invention, wherein: the receiver maintains a receiving window, stores the received data packets, and performs error correction using redundant packets, including:
[0018] Set the window size W r = N + M. The receiver creates a buffer queue to store the received data packets, waits for the data packets to arrive, and records the data packet index and receiving status at the same time; when the data packet arrives, it is judged whether the data packet number belongs to the current window range; if the data packet belongs to the current window range, it is stored in the receiving window and the bitmap is updated, marked as received; if the data packet exceeds the current window range, it is temporarily stored and waits for the window range to slide until it enters the valid window before being processed; maintain a bitmap to mark the received data packets and the lost data packets;
[0019] If all N + M data packets are received, there is no need for error correction and the window slides; if the loss quantity K ≤ M, FEC is used for recovery; if K > M, the sender is requested to retransmit the lost data packets.
[0020] As a preferred solution of the packet loss correction method based on a sliding window according to the present invention, wherein: the receiver maintains a receiving window, stores the received data packets, and performs error correction using redundant packets, further including:
[0021] When K ≤ M, extract the received data packets D 1 , D 2 ,..., D N-K and M redundant packets P 1 , P 2 ,..., P M, After the RS code reconstructs the lost data packets through finite field operations and restores the complete data, it delivers the data to the upper-layer protocol, slides the window, and prepares to receive new data packets;
[0022] When K > M, send a NACK to request the sender to retransmit the lost data packets, wait for the retransmitted data, store it in the window after receiving, and try to decode it again.
[0023] As a preferred solution of the packet loss correction method based on a sliding window according to the present invention, wherein: the lost data packets are detected by using an acknowledgment mechanism. If no ACK is received or a NACK is received within T timeout , the sender retransmits the missing data packets, including:
[0024] If no ACK is received or a NACK is received within T timeout , retransmit the lost data packets. If the same data packet times out continuously, increase the timeout time, record the packet loss rate P loss , adaptively adjust M. When all the data packets in the window are received with ACKs, move the window forward by N data packets and continue to send a new batch of data packets;
[0025] Maintain a receiving window W r , store the received data packets, use a bitmap to mark the received and lost data packets, set the ACK timeout Tack timeout . If the complete data is not received after the timeout, actively request a retransmission. When the data packet is completely received, slide the window forward.
[0026] As a preferred solution of the packet loss correction method based on a sliding window according to the present invention, wherein: the window size is dynamically adjusted according to the packet loss rate. When the packet loss rate is low, reduce the window size, and the window size is not less than 10 data packets to improve the throughput and increase the balanced coding delay to balance the growth rate; when the packet loss rate is high, increase the window size to increase the packet loss correction recovery rate, and the window size is not higher than 50 data packets to ensure that the FEC coding can effectively recover the lost data packets; apply the TCP sliding window to the FEC coding; when the receiving window time becomes longer, moderately reduce the window size, including:
[0027] When P loss < P th , increase the window size W to improve the throughput, with exponential growth:
[0028] W = W + α
[0029] Set the window growth factor α and stop growing when reaching W max ;
[0030] When P loss > P th , reduce the window size, with multiplicative reduction:
[0031] W = β × W
[0032] Set β to ensure that the window does not drop suddenly and is not lower than W min ;
[0033] When P loss < P th , the sender increases the window size:
[0034] W = W + α
[0035] Upper bound constraint, if W > W max , then W = W max ;
[0036] When P loss > P th , the sender decreases the window size:
[0037] W = β × W
[0038] Lower bound constraint, if W < W min , then W = W min .
[0039] As a preferred solution of the packet loss error correction method based on a sliding window according to the present invention, wherein: said dynamically adjusting the window size according to the packet loss rate, when the packet loss rate is low, reducing the window size, and the window size is not lower than 10 data packets to improve the throughput and increase the balanced coding delay to balance the growth rate; when the packet loss rate is high, increasing the window size to increase the packet loss error correction recovery rate, and the window size is not higher than 50 data packets to ensure that the FEC coding effectively recovers the lost data packets; applying the TCP sliding window to the FEC coding; making the receiving window time longer and moderately reducing the window size, further including:
[0040] When the FEC coding time or decoding time is long, the window is moderately reduced, and the window size is adjusted in an exponential or linear reduction manner to reduce the additional delay caused by the encoding and decoding consumption; when the encoding or decoding process becomes faster, the window size is moderately increased, and the redundant packets of the FEC coding recover more lost data packets, thereby improving the data recovery ability; when increasing the window, the increased encoding consumption time is controlled within an acceptable range;
[0041] When the jitter rate is high, the arrival time of the data packets fluctuates greatly, and the window should be moderately reduced to reduce the time consumption of encoding and decoding and at the same time reduce the network delay; when the network transmission is stable and the jitter rate is low, increase the window size to ensure that more original data packets participate in the encoding;
[0042] Parallelize the FEC encoding operations of multiple data packets. Each core is responsible for encoding a part of the data packets. During encoding, divide N original data packets and M redundant packets into multiple blocks, and each block is processed independently. By independently encoding and decoding each block, it can be executed in parallel on multiple cores. By optimizing the memory access pattern and data locality, during the parallel computing process, the data can be kept in the cache of the same processing core as much as possible, reducing the latency of memory access; utilize FPGA, ASIC, and GPU to execute the FEC encoding and decoding tasks, improving the computing speed and reducing the energy consumption.
[0043] A packet loss correction system based on a sliding window, comprising: setting the number of original data packets N, the number of redundant data packets M, the FEC encoding time, and the FEC decoding time, and determining the initial window size according to the FEC encoding and decoding time, packet loss rate, code rate, and jitter rate information;
[0044] An encapsulation encoding module, which is used to perform redundant encoding on data packets using a forward error correction code. Generate M redundant data packets for every N original data packets, and the sender sequentially sends N + M data packets based on the sliding window;
[0045] A data verification module, which is used for the receiver to maintain a receiving window, store the received data packets, and use the redundant packets for error correction. If the number of lost packets does not exceed the number of redundant packets M, decode and recover the data, and move the sliding window forward; if the number of lost packets exceeds M, enter the retransmission request stage;
[0046] A data packet detection module, which is used to detect lost data packets using an acknowledgment mechanism. If an ACK is not received or a NACK is received within T timeout , the sender retransmits the missing data packets;
[0047] A dynamic adjustment module, which is used to dynamically adjust the window size according to the packet loss rate. When the packet loss rate is low, reduce the window size, and the window size is not less than 10 data packets to improve the throughput and increase the balanced encoding delay to balance the growth rate; when the packet loss rate is high, increase the window size to increase the packet loss correction recovery rate, and the window size is not more than 50 data packets to ensure that the FEC encoding can effectively recover the lost data packets; apply the TCP sliding window to the FEC encoding; when the receiving window time becomes longer, appropriately reduce the window size.
[0048] A computing device, the computing device includes:
[0049] At least one processor, a memory, and an input / output unit;
[0050] Wherein, the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the steps of the packet loss correction method based on the sliding window.
[0051] A computer-readable storage medium includes instructions that, when run on a computer, cause the computer to perform the steps of a packet loss error correction method based on a sliding window.
[0052] The beneficial effects of the present invention are as follows: By dynamically adjusting the window size and the FEC redundancy ratio according to the network packet loss rate, the present invention can achieve adaptive adjustment in different network environments, reduce bandwidth waste, and provide stronger error correction capabilities in high packet loss environments. Combined with the timeout retransmission mechanism, it ensures the timely retransmission of missing data packets in case of packet loss, avoids unnecessary retransmissions, and improves the data transmission efficiency. By adopting a low-complexity forward error correction algorithm, it reduces the consumption of computing resources and storage, is particularly suitable for low-power devices and embedded systems, and improves the overall performance of the system. Description of the Drawings
[0053] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0054] Figure 1 It is a flowchart of a packet loss error correction method based on a sliding window provided by an embodiment of the present invention.
[0055] Figure 2 It is a schematic structural diagram of a packet loss error correction system based on a sliding window provided by an embodiment of the present invention.
[0056] Figure 3 Schematically shows a structural diagram of a medium according to an embodiment of the present invention.
[0057] Figure 4 Schematically shows a structural diagram of a computing device according to an embodiment of the present invention.
[0058] Figure 5 It is an FEC encoding schematic diagram of a packet loss error correction system based on a sliding window provided by an embodiment of the present invention.
[0059] Figure 6 It is an Fec algorithm schematic diagram of a packet loss error correction system based on a sliding window provided by an embodiment of the present invention.
[0060] Figure 7 It is a comparison diagram of the coding efficiency of the SD-RS algorithm of a packet loss error correction system based on a sliding window provided by an embodiment of the present invention.
[0061] In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Embodiments
[0062] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following provides a detailed description of the specific implementation manners of the present invention in conjunction with the accompanying drawings of the specification.
[0063] In the following description, many specific details are set forth to facilitate a thorough understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art can make similar generalizations without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0064] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation manner of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it an individual or alternative embodiment that is mutually exclusive with other embodiments.
[0065] Embodiment
[0066] The following refers to Figure 1 , Figure 1 which is a flowchart of a packet loss correction method based on a sliding window provided for an embodiment of the present invention. It should be noted that the implementation manner of the present invention can be applied to any applicable scenario.
[0067] Figure 1 The process of the packet loss correction method based on a sliding window provided for an embodiment of the present invention shown in
[0068] S1: Set the number of original data packets N, the number of redundant data packets M, the FEC encoding time, and the FEC decoding time. Determine the preliminary window size according to the FEC encoding and decoding times, packet loss rate, code rate, and jitter rate information.
[0069] Preferably, the FEC encoding time has a quadratic relationship with the window size. Assume that the encoding time is a constant ratio, that is, Tencode = kencode × (N + M) 2 , where kencode is a constant related to the complexity of the encoding algorithm.
[0070] The FEC decoding time also has a quadratic relationship with the window size. The formula for the decoding time is: Tdecode = kdecode × (N + M) 2 , where kdecode is a constant related to the decoding process.
[0071] Therefore, the window size W = N + M will have a significant impact on the FEC encoding and decoding times. When the FEC encoding and decoding times are longer, the window size needs to be smaller to maintain the real-time performance of the system.
[0072] S2: Redundantly encode the data packets using forward error correction codes. For every N original data packets, M redundant data packets are generated, and the sender sequentially sends N + M data packets based on a sliding window.
[0073] Preferably, assume that each window of the sender contains N original data packets and M redundant data packets, that is, N + M data packets are transmitted each time. During initialization, the size of the sliding window is N + M, and each window sequentially sends N data packets and M redundant data packets;
[0074] The sender performs FEC encoding on N original data packets and M redundant data packets each time. The encoded data packets are divided into original data packets and redundant packets. The redundant packets are generated through SD-RS FEC encoding and decoding, so as to ensure that even if some data packets are lost, the receiver can still recover the complete data;
[0075] The receiver performs decoding processing based on the received data packets and FEC header information. If the received data packets are insufficient and the number of lost data packets is less than or equal to the number of redundant packets M, the receiver uses FEC decoding to recover the lost data packets; if the number of lost data packets K > M, the receiver cannot recover and needs to request a retransmission.
[0076] Further, N = 5, M = 3. The receiver receives 5 original data packets and 2 redundant data packets, and 1 original data packet and 1 redundant data packet are lost.
[0077] Steps: The sender generates redundant packets through SD-RS FEC encoding and decoding for 5 original data packets and 3 redundant data packets. The sender sends these data packets to the receiver. After receiving the data packets, the receiver finds that 1 original data packet is lost, but 2 redundant data packets still exist.
[0078] The receiver uses the lost 1 redundant data packet to recover the lost original data packet through SD-RS FEC encoding and decoding. If the number of lost data packets exceeds the number of redundant data packets (that is, the number of lost packets is greater than M), the receiver sends a NACK to request retransmission of the lost data packets.
[0079] S3: The receiver maintains a receiving window, stores the received data packets, and uses redundant packets for error correction. If the number of lost packets does not exceed the number of redundant packets M, the data is decoded and recovered; if the number of lost packets exceeds M, it enters the retransmission request phase.
[0080] Preferably, set the window size W r= N + M. The receiving end creates a buffer queue to store the received data packets, waits for the data packets to arrive, and records the data packet index and receiving status at the same time. When a data packet arrives, it is judged whether the data packet number belongs to the current window range. If the data packet belongs to the current window range, it is stored in the receiving window and the bitmap is updated to mark it as received. If the data packet exceeds the current window range, it is temporarily stored and waits for the window range to slide until it enters the valid window before being processed. A bitmap is maintained to mark the received data packets and the lost data packets. If all N + M data packets are received, there is no need for error correction and the window slides. If the number of lost packets K ≤ M, FEC is used for recovery. If K > M, the sending end is requested to retransmit the lost data packets.
[0081] Preferably, when K ≤ M, the received data packets D 1 , D 2 ,..., D N-K and M redundant packets P 1 , P 2 ,..., P M are extracted. The RS code reconstructs the lost data packets through finite field operations. After the complete data is recovered, it is delivered to the upper layer protocol, the window slides, and it is ready to receive new data packets.
[0082] When K > M, a NACK is sent to request the sending end to retransmit the lost data packets, waits for the retransmitted data, stores it in the window after receiving it, and attempts to decode it again.
[0083] Furthermore, assume that the data stream of the sending end is divided into multiple windows, and each window contains N = 3 original data packets and M = 2 redundant data packets. The window size is W r = N + M = 5.
[0084] The receiving end state is initialized, and the window size Wr = 5. A buffer queue is created and the bitmap is initialized. The initial state of the bitmap is [0, 0, 0, 0, 0] (indicating that no data packets have been received). Assume that the sending end sends data packets P1, P2, P3, R1, R2 (where R1, R2 are redundant packets). The receiving end receives the data packets in sequence and stores them in the buffer queue. After receiving P1, the bitmap is updated to [1, 0, 0, 0, 0]. After receiving P3, the bitmap is updated to [1, 0, 1, 0, 0]. After receiving a data packet, the receiving end checks the data packets in the buffer queue. Assume that the receiving end still lacks P2 and R1. The number of lost data packets K = 2. Since the number of lost data packets K = 2 exceeds the number of redundant packets M = 2, the receiving end cannot recover the data packets through the redundant packets. The receiving end will send a NACK request to the sending end to request the retransmission of the lost P2 and R1.
[0085] After the sender receives the NACK request, it retransmits the lost data packet. After the receiver receives the retransmitted data packet, it updates the cache queue and slides the window.
[0086] S4: Use an acknowledgment mechanism to detect lost data packets. If no ACK is received or NACK is received within T timeout , the sender retransmits the missing data packet.
[0087] Preferably, if no ACK is received or NACK is received within T timeout , retransmit the lost data packet. If the same data packet times out continuously, increase the timeout time, record the loss rate P loss , adaptively adjust M. When all data packets in the window are received with ACK, the window moves forward by N data packets and continues to send a new batch of data packets;
[0088] Maintain a receiving window W r , store the received data packets, use a bitmap to mark the received and lost data packets, set the ACK timeout Tack timeout , if the complete data is not received after the timeout, actively request retransmission. When the data packet is completely received, the sliding window moves forward.
[0089] Furthermore, assume that the following parameters are set for the sender and the receiver: N = 5, the number of redundant packets M = 2, the window size W r = N + M = 7, T timeout = 500ms, Tack timeout = 300ms. The state of the receiver when receiving data packets is as follows:
[0090] Received D1, D2, P1, P2, lost data packet D3, the number of lost packets K = 1. Therefore, K ≤ M, and the receiver uses the redundant packet to recover the lost D3;
[0091] Step 1: Initialize the receiving window
[0092] The receiver creates a cache queue and marks the received data packets:
[0093] Data packets D1, D2, P1, P2 have been received, bitmap [1, 1, 0, 1, 1, 1, 1];
[0094] Step 2: Recover the data packet
[0095] Use the redundant packets P1, P2 and the received D1, D2 to recover the lost data packet D3 through SD-RS FEC encoding and decoding. After successful recovery, the complete data is delivered to the upper-layer protocol;
[0096] Step 3: Slide the window
[0097] After FEC encoding and decoding, the receiving end successfully recovers the lost data packet D3. The current receiving window status is: [D1, D2, D3, P1, P2], where D1, D2, and D3 are original data packets, and P1 and P2 are redundant data packets. The receiving end updates the buffer queue and marks the received data packets: the bitmap is [1, 1, 1, 1, 1, 1, 1], indicating that all data packets (including redundant packets) have been received.
[0098] When all data packets (including redundant packets) within the received window have been confirmed received, the receiving window moves forward. At this time, the receiving end moves the window forward by N + M = 7 data packets and starts receiving a new batch of data packets. The new data packets will be sent in order to ensure that the data packets in the window are confirmed in a timely manner. The sending end checks the ACK confirmation of the receiving end. If it is confirmed that the data packet has been received, the sending end moves the window forward. At the same time, the sending end dynamically adjusts the window size and the number of redundant packets according to the packet loss rate P loss and the current network conditions. If the packet loss rate is low, the sending end reduces the redundant packet M and maintains a smaller window to improve throughput. If the packet loss rate is high, the sending end increases the redundant packet M and increases the window size to enhance the packet loss recovery ability.
[0099] S5: Dynamically adjust the window size according to the packet loss rate. When the packet loss rate is low, reduce the window size, and the window size is not less than 10 data packets to improve throughput and increase the balanced coding delay to balance the growth amplitude; when the packet loss rate is high, increase the window size, and the window size is not higher than 50 data packets to ensure that the FEC encoding can effectively recover the lost data packets; apply the TCP sliding window to the FEC encoding; the receiving window time becomes longer, and moderately reduce the window size.
[0100] Preferably, when P loss < P th , increase the window size W to improve throughput, with exponential growth:
[0101] W = W + α
[0102] Set the window growth factor α and stop growing when reaching W max ;
[0103] When P loss > P th , shrink the window, with multiplicative reduction:
[0104] W = β × W
[0105] Set β to ensure that the window does not drop suddenly and is not less than W min ;
[0106] When P loss < P th , the sending end increases the window size:
[0107] W = W + α
[0108] Upper bound constraint. If W > W max , then W = W max ;
[0109] When P loss > P th , the sender reduces the window size:
[0110] W = β × W
[0111] Lower bound constraint. If W < W min , then W = Wmin.
[0112] Preferably, when the FEC encoding time or decoding time is long, the window is moderately reduced, and the window size is adjusted in an exponential or linear reduction manner to reduce the additional delay caused by encoding and decoding consumption; when the encoding or decoding process becomes faster, the window size is moderately increased, and the redundant packets of FEC encoding recover more lost data packets, thereby enhancing the data recovery ability; when increasing the window, the increased encoding consumption time is controlled within an acceptable range;
[0113] When the jitter rate is high, the arrival time of data packets fluctuates greatly, and the window should be moderately reduced to reduce the time consumption of encoding and decoding and at the same time reduce network latency; when the network transmission is stable and the jitter rate is low, increase the window size to ensure that more original data packets participate in encoding.
[0114] Furthermore, set the parameter W 0 = 10, the maximum window size Wmax = 50, the minimum window size W min = 5, the growth factor α = 1.5, the reduction factor β = 0.8, the packet loss rate threshold = 0.1, the initial window size is W 0 = 10, the packet loss rate P loss = 0.05;
[0115] Since P loss < P th , the window size increases according to the exponential factor α:
[0116] Wnew = 10 × 1.5 = 15
[0117] The new window size W = 15 is less than Wmax = 50, so transmission continues.
[0118] Assume the packet loss rate P loss = 0.05 is low, the window continues to increase Wnew = 15 × 1.5 = 22.5, and the window size W = 22.5 is still less than Wmax = 50, so the window continues to increase.
[0119] Assume that the packet loss rate suddenly rises to P loss = 0.12 (higher than the threshold P th = 0.1). The sender will reduce the window size by the multiplication factor β:
[0120] Wnew = 22.5 × 0.8 = 18W
[0121] The new window size W = 18 is still greater than Wmin = 5W, and this window size continues to be used for transmission.
[0122] If the packet loss rate continues to increase to P loss = 0.15, then the window size continues to be reduced:
[0123] Wnew = 18 × 0.8 = 14.4
[0124] The new window size W = 14.4 is still greater than Wmin = 5, and it continues to be reduced.
[0125] If the packet loss rate continues to rise to P loss = 0.2, then the window continues to be reduced:
[0126] Wnew = 14.4 × 0.8 = 11.52
[0127] Since Wnew > Wmin = 5, the current window size continues to be used.
[0128] After introducing the method of the exemplary embodiment of the present invention, next, with reference to Figure 2 an error correction system for packet loss based on a sliding window according to an exemplary embodiment of the present invention will be described. The system includes:
[0129] A parameter initialization module for setting the number of original data packets N, the number of redundant data packets M, the FEC encoding time, and the FEC decoding time, and determining a preliminary window size according to the FEC encoding and decoding times, packet loss rate, code rate, and jitter rate information;
[0130] An encapsulation and encoding module for redundantly encoding data packets using a forward error correction code, generating M redundant data packets for every N original data packets, and the sender sequentially sending N + M data packets based on a sliding window;
[0131] A data verification module for the receiver to maintain a receiving window, store the received data packets, and perform error correction using redundant packets. If the number of lost packets does not exceed the number of redundant packets M, the data is decoded and restored, and the sliding window moves forward; if the number of lost packets exceeds M, it enters the retransmission request stage;
[0132] A data packet detection module for detecting lost data packets using an acknowledgment mechanism. If within T timeoutIf no ACK is received within or NACK is received, the sender retransmits the missing data packets;
[0133] A dynamic adjustment module is used to dynamically adjust the window size according to the packet loss rate. When the packet loss rate is low, the window size is reduced, and the window size is not less than 10 data packets to improve the throughput and increase the balanced coding delay to balance the growth amplitude; when the packet loss rate is high, the window size is increased to increase the packet loss error correction recovery rate, and the window size is not higher than 50 data packets to ensure that the FEC coding can effectively recover the lost data packets; the TCP sliding window is applied to the FEC coding; when the receiving window time becomes longer, the window size is appropriately reduced.
[0134] After introducing the methods and apparatuses of the exemplary embodiments of the present invention, next, reference is made to Figure 3 The computer-readable storage medium of the exemplary embodiment of the present invention is described. Please refer to Figure 3 , which shows that the computer-readable storage medium is an optical disc 30, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will implement the steps recorded in the above method embodiments. For example, the number of original data packets N, the number of redundant data packets M, the FEC encoding time, and the FEC decoding time are set. According to the FEC encoding and decoding time, packet loss rate, code rate, and jitter rate information, the initial window size is determined; the data packets are redundantly encoded using a forward error correction code, and M redundant data packets are generated for every N original data packets. The sender sequentially sends N + M data packets based on the sliding window; the receiver maintains the receiving window, stores the received data packets, and uses the redundant packets for error correction. If the number of lost packets does not exceed the number of redundant packets M, the data is decoded and recovered, and the sliding window moves forward; if the number of lost packets exceeds M, it enters the retransmission request stage; a confirmation mechanism is used to detect the lost data packets. If no ACK is received within T timeout If no ACK is received within or NACK is received, the sender retransmits the missing data packets; the window size is dynamically adjusted according to the packet loss rate. When the packet loss rate is low, the window size is reduced, and the window size is not less than 10 data packets to improve the throughput and increase the balanced coding delay to balance the growth amplitude; when the packet loss rate is high, the window size is increased to increase the packet loss error correction recovery rate, and the window size is not higher than 50 data packets to ensure that the FEC coding can effectively recover the lost data packets; the TCP sliding window is applied to the FEC coding; when the receiving window time becomes longer, the window size is appropriately reduced; the specific implementation manners of each step are not repeated here.
[0135] It should be noted that examples of the computer-readable storage medium may further include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other optical and magnetic storage media, which will not be elaborated herein one by one.
[0136] After introducing the methods, apparatuses, and media of the exemplary embodiments of the present invention, next, reference is made to Figure 4 a computing device for packet loss error correction based on a sliding window according to an exemplary embodiment of the present invention.
[0137] Figure 4 The block diagram of an exemplary computing device 40 suitable for implementing the embodiments of the present invention is shown. The computing device 40 may be a computer system or a server. Figure 4 The shown computing device 40 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.
[0138] As Figure 4 shown, the components of the computing device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 connecting different system components (including the system memory 402 and the processing unit 401).
[0139] The computing device 40 typically includes a variety of computer system-readable media. These media can be any available media accessible by the computing device 40, including volatile and non-volatile media, removable and non-removable media.
[0140] The system memory 402 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 4021 and / or cache memory 4022. The computing device 40 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, ROM 4023 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, commonly referred to as a "hard disk drive"). Although not shown in Figure 4As shown, a disk drive for reading and writing a removable non-volatile disk (such as a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (such as a CD-ROM, DVD-ROM or other optical media) can be provided. In these cases, each drive can be connected to the bus 403 through one or more data medium interfaces. The system memory 402 may include at least one program product having a set (such as at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0141] A program / utility 4025 having a set (at least one) of program modules 4024 can be stored, for example, in the system memory 402, and such program modules 4024 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data, and the implementation of a network environment may be included in each or some combination of these examples. The program modules 4024 generally perform the functions and / or methods in the embodiments described in the present invention.
[0142] The computing device 40 can also communicate with one or more external devices 404 (such as a keyboard, a pointing device, a display, etc.). Such communication can be carried out through an input / output (I / O) interface 405. And, the computing device 40 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through a network adapter 406. As Figure 4 shown, the network adapter 406 communicates with other modules (such as the processing unit 401, etc.) of the computing device 40 through the bus 403. It should be understood that although Figure 4 not shown in the figure, other hardware and / or software modules can be used in combination with the computing device 40.
[0143] The processing unit 401 executes various functional applications and data processing by running the programs stored in the system memory 402. For example, it sets the number N of original data packets, the number M of redundant data packets, the FEC encoding time, and the FEC decoding time, and determines a preliminary window size according to the FEC encoding and decoding time, packet loss rate, code rate, and jitter rate information; performs redundant encoding on the data packets using a forward error correction code, generating M redundant data packets for every N original data packets, and the sending end sequentially sends N + M data packets based on a sliding window; the receiving end maintains a receiving window, stores the received data packets, and uses the redundant packets for error correction. If the number of lost packets does not exceed the number M of redundant packets, the data is decoded and recovered, and the sliding window moves forward; if the number of lost packets exceeds M, it enters the retransmission request stage; a confirmation mechanism is used to detect lost data packets. If within T timeoutIf no ACK is received or NACK is received within, the sender retransmits the missing data packets, dynamically adjusts the window size according to the packet loss rate. When the packet loss rate is low, the window size is reduced, and the window size is not less than 10 data packets to improve throughput and increase the balanced coding delay to balance the growth rate. When the packet loss rate is high, the window size is increased to increase the packet loss error correction recovery rate, and the window size is not higher than 50 data packets to ensure that the FEC coding can effectively recover the lost data packets. Apply the TCP sliding window to the FEC coding; when the receiving window time becomes longer, moderately reduce the window size.
[0144] The specific implementation methods of each step will not be repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the synchronous escape wiring device based on multi-commodity flow are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above can be further divided and embodied by multiple units / modules.
[0145] In the description of the present invention, it should be noted that the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0146] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be repeated here.
[0147] In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be in electrical, mechanical, or other forms.
[0148] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, in each embodiment of the present invention, each functional unit may be integrated into a processing unit, may exist separately physically for each unit, or two or more units may be integrated into one unit.
[0150] If the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0151] Finally, it should be noted that: the above-mentioned embodiments are only specific implementation manners of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes, or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
[0152] In addition, although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution.
Claims
1. A packet loss correction method based on sliding window, characterized in that: include: Set the number of original data packets N, the number of redundant data packets M, the FEC encoding time and the FEC decoding time, and determine the initial window size based on the FEC encoding and decoding time, packet loss rate, bit rate and jitter rate information; The forward error correction code is used to encode the data packets redundantly. Every N original data packets generate M redundant data packets. The sender sends N+M data packets in sequence based on the sliding window. The receiving end maintains a receiving window, stores received data packets, and uses redundant packets for error correction. If the number of lost packets does not exceed the number of redundant packets M, the data is decoded and recovered; If the number of lost packets exceeds M, the retransmission request phase is entered; Use the confirmation mechanism to detect lost data packets. If timeout If no ACK is received or a NACK is received within a period of time, the sender retransmits the missing data packet; Dynamically adjust the window size according to the packet loss rate. When the packet loss rate is low, reduce the window size. The window size should not be less than 10 packets to improve throughput, and increase the balanced coding delay to balance the growth rate. When the packet loss rate is high, increase the window size and increase the packet loss error correction recovery rate. The window size should not be higher than 50 packets to ensure that FEC coding can effectively recover lost packets. Apply the TCP sliding window to FEC coding. When the receiving window time becomes longer, appropriately reduce the window size.
2. The packet loss error correction method based on sliding window as claimed in claim 1, characterized in that: The method adopts a forward error correction code to perform redundant encoding on the data packets, generates M redundant data packets for every N original data packets, and the transmitting end sequentially sends N+M data packets based on a sliding window, including: Assume that each window of the sender contains N original data packets and M redundant data packets, that is, N+M data packets are transmitted each time. At initialization, the size of the sliding window is N+M, and each window will send N data packets and M redundant data packets in turn; The sender performs FEC encoding on N original data packets and M redundant data packets each time. The encoded data packets are divided into original data packets and redundant packets. The redundant packets are generated by SD-RS FEC encoding and decoding, so that even if some data packets are lost, the receiver can recover the complete data. The receiving end performs decoding processing based on the received data packets and FEC header information. If the received data packets are insufficient and the number of lost data packets is less than or equal to the number of redundant packets M, the receiving end uses FEC decoding to recover the lost data packets; if the number of lost data packets K>M, the receiving end cannot recover and needs to request retransmission.
3. The packet loss error correction method based on sliding window as claimed in claim 1, characterized in that: The receiving end maintains a receiving window, stores received data packets, and uses redundant packets for error correction, including: Set the window size W r =N+M, the receiving end creates a cache queue to store received data packets, waits for data packets to arrive, and records the data packet index and receiving status; when a data packet arrives, it determines whether the data packet number belongs to the current window range; if the data packet belongs to the current window range, it is stored in the receiving window and the bitmap is updated, marking it as received; if the data packet exceeds the current window range, it is temporarily stored and waits for the window range to slide until it enters the valid window and then processed; maintain a bitmap to mark the received data packets and the lost data packets; If all N+M data packets are received, no error correction is required and the window slides; if the number of lost packets K≤M, FEC is used for recovery; if K>M, the sender is requested to retransmit the lost data packets.
4. The packet loss error correction method based on sliding window as claimed in claim 1, characterized in that: The receiving end maintains a receiving window, stores received data packets, and uses redundant packets for error correction, and also includes: When K≤M, extract the received data packets D1,D2,...,D N-K and M redundant packets P1, P2, ..., P M ,The RS code reconstructs the lost data packet through finite field operations. After recovering the complete data, it delivers it to the upper layer protocol, and the window slides to prepare to receive new data packets; When K>M, a NACK is sent to request the sender to resend the lost data packet, wait for the retransmitted data, store it in the window after receiving it, and try to decode it again.
5. The packet loss error correction method based on sliding window as claimed in claim 1, characterized in that: The confirmation mechanism is used to detect lost data packets, combined with the timeout retransmission mechanism. timeout If no ACK is received or a NACK is received within a certain period, the sender retransmits the missing data packet, including: If T timeout If no ACK or NACK is received within 10 seconds, the lost data packet is resent. If the same data packet times out continuously, the timeout period is increased and the loss rate P is recorded. loss , adaptively adjust M. When all the data packets in the window receive ACK, the window moves forward by N data packets and continues to send a new batch of data packets; Maintain a receive window W r , store received packets, use bitmap to mark received and lost packets, set ACK timeout Tack timeout ,If the complete data is not received within the time out, a retransmission is actively requested. When the data packet is completely received, the sliding window moves forward.
6. The packet loss error correction method based on sliding window as claimed in claim 1, characterized in that: The window size is dynamically adjusted according to the packet loss rate. When the packet loss rate is low, the window size is reduced, and the window size is not less than 10 packets to improve the throughput, and the balanced coding delay is increased to balance the growth rate; when the packet loss rate is high, the window size is increased, and the window size is not higher than 50 packets to ensure that the FEC coding effectively recovers the lost data packets; Apply TCP sliding window to FEC encoding; The receive window time becomes longer and the window size is appropriately reduced, including: When P loss <P th When increasing the window size W, the throughput increases exponentially: W=W+α Set the window growth factor α to reach W max Stop growing; When P loss >P th When , the window is reduced and the multiplication is reduced: W=β×W Set β to ensure that the window does not drop sharply and does not fall below W min ; When P loss <P th , the sender increases the window size: W=W+α Upper limit constraint, if W>W max , then W=W max ; When P loss >P th , the sender reduces the window size: W=β×W Lower limit constraint, if W <W min , then W=W min .
7. The packet loss error correction method based on sliding window as claimed in claim 1, characterized in that: The window size is dynamically adjusted according to the packet loss rate. When the packet loss rate is low, the window size is reduced, and the window size is not less than 10 packets to improve the throughput, and the balanced coding delay is increased to balance the growth rate; when the packet loss rate is high, the window size is increased, and the window size is not higher than 50 packets to ensure that the FEC coding effectively recovers the lost data packets; the TCP sliding window is applied to the FEC coding; The receive window time becomes longer, and the window size is appropriately reduced, which also includes: When the FEC encoding or decoding time is long, the window size is appropriately reduced, and the window size is adjusted by exponential or linear window reduction to reduce the additional delay caused by encoding and decoding consumption; when the encoding or decoding process becomes faster, the window size is appropriately increased, and the redundant packets encoded by FEC recover more lost data packets, thereby improving data recovery capabilities; when the window is increased, the increased encoding consumption time is controlled within an acceptable range; When the jitter rate is high, the arrival time of the data packet fluctuates greatly, and the window should be appropriately reduced. Reducing the window size reduces the time consumption of encoding and decoding, and reduces network delay. When the network transmission is stable and the jitter rate is low, increase the window size to ensure that more original data packets participate in the encoding. The FEC encoding operations of multiple data packets are processed in parallel, and each core is responsible for the encoding of a part of the data packets. During encoding, N original data packets and M redundant packets are divided into multiple blocks, and each block is processed independently. By encoding and decoding each block independently, it can be executed in parallel on multiple cores. By optimizing the memory access mode and data locality, the data can be stored in the cache of the same processing core as much as possible during the parallel computing process, reducing the delay of memory access; FPGA, ASIC and GPU are used to perform FEC encoding and decoding tasks, which improves the computing speed and reduces energy consumption.
8. A packet loss correction system based on sliding window, characterized in that: include: The parameter initialization module is used to set the number of original data packets N, the number of redundant data packets M, the FEC encoding time and the FEC decoding time, and determine the initial window size according to the FEC encoding and decoding time, packet loss rate, bit rate and jitter rate information; The encapsulation coding module is used to perform redundant coding on the data packets using forward error correction codes, generating M redundant data packets for every N original data packets, and the sending end sends N+M data packets in sequence based on the sliding window; The data check module is used to maintain the receiving window at the receiving end, store the received data packets, and use the redundant packets for error correction. If the number of lost packets does not exceed the number of redundant packets M, the data is decoded and recovered; If the number of lost packets exceeds M, the retransmission request phase is entered; The data packet detection module is used to detect the lost data packets using the confirmation mechanism. timeout If no ACK is received or a NACK is received within a period of time, the sender retransmits the missing data packet; The dynamic adjustment module is used to dynamically adjust the window size according to the packet loss rate. When the packet loss rate is low, the window size is reduced, and the window size is not less than 10 data packets to improve throughput, and the balanced coding delay is increased to balance the growth rate; when the packet loss rate is high, the window size is increased to increase the packet loss error correction recovery rate, and the window size is not higher than 50 data packets to ensure that FEC coding can effectively recover lost data packets; the TCP sliding window is applied to FEC coding; the receiving window time becomes longer, and the window size is appropriately reduced.
9. A computing device, comprising: at least one processor, memory, and input-output unit; The memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the steps of the sliding window-based packet loss correction method according to any one of claims 1 to 7.
10. A computer-readable storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the steps of the packet loss error correction method based on a sliding window as claimed in any one of claims 1 to 7.
Citation Information
Cited By
Low-altitude aircraft communication decision-making method and device and readable storage medium
CN120675682A
Optimization method and system for signaling data type communication transmission
CN120979608A
An optimization method and system for signaling data type communication transmission
CN120979608B
Industrial visual data processing method of adaptive space-time window based on Netty
CN121582756A