A high burst solution application layer codec method

By optimizing the encoder and decoder parameter settings and buffer queue operations in the application layer encoding and decoding methods, the problem of high decoding failure rate under high burst conditions is solved, and low-latency and highly reliable data transmission is achieved.

CN119945625BActive Publication Date: 2025-10-21FUZHOU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510199121.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-22
Publication Date
2025-10-21
Estimated Expiration
2045-02-22

AI Technical Summary

Technical Problem

Existing application-layer FEC schemes, such as RS codes and CRLNC codes, have a high probability of decoding failure in high burst environments, and the retransmission mechanism introduces a large delay in high round-trip delay channels, making it difficult to meet the requirements of ultra-reliable low-latency communication.

Method used

An application-layer encoding and decoding method for solving high bursts is adopted. By initializing the encoder and decoder parameters, using the first and second buffer queues, GF(28) encoding and decoding recovery operations are performed. Combined with encoding window, interleaving depth and code rate optimization, the probability of decoding failure is reduced.

Benefits of technology

In high-burst environments, it significantly reduces the probability of decoding failure, reduces retransmission latency, and improves the real-time performance and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119945625B_ABST
    Figure CN119945625B_ABST
Patent Text Reader

Abstract

The application provides an application layer coding and decoding method for solving high burst, wherein at the application layer, data transmitted by an upper layer is received through a first buffer queue, a source data packet is taken out from the first buffer queue by an encoder, a packet header is encapsulated, and a coding operation is performed, and then the source data packet and a coded packet are transmitted through a sending end socket; a data packet is obtained from a receiving end socket through a second buffer queue, the data packet is taken out from the second buffer queue by a decoder, and a decoding recovery operation is performed according to packet header information, and then the recovered data packet is sorted and sequentially transmitted to the upper layer. The scheme can have a lower decoding failure probability than Reed-Solomon (RS) and Caterpillar RLNC (CRLNC) in a high burst channel environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of application layer data transmission, and particularly relates to an application layer coding and decoding method for solving high burst problems. Background Art

[0002] Ultra-reliable and low-latency communication (URLLC) is one of the three major scenarios in 5G systems. Providing ultra-high reliability and extremely low transmission latency, it is a key communication technology for industrial automation, telemedicine, and intelligent transportation. During wireless data transmission, factors such as interference, multipath effects, and attenuation can cause transmission errors. Furthermore, network congestion, outdated routing tables, and buffer overflows can also cause packet loss. To ensure high data transmission reliability, upper-layer protocols typically employ retransmission mechanisms to address packet loss. However, in scenarios with high real-time requirements, such as streaming media and control signaling, retransmissions can introduce significant latency, which is particularly noticeable in channels with high round-trip times (RTTs). Therefore, to mitigate retransmission delays, forward error correction (FEC) must be incorporated into upper-layer protocols.

[0003] Traditional application-layer FEC schemes, such as LDPC-staircase, RS codes, and CRLNC codes, all suffer from low reliability in high-burst environments. Increasing the code length or coding window can improve reliability, but this comes with significant coding complexity. Summary of the Invention

[0004] In view of this, and in view of the defects and shortcomings of the existing technology, the purpose of the present invention is to provide an application layer encoding and decoding method to solve high-burst problems, which can have a lower decoding failure probability than traditional application layer FEC schemes such as RS code and CRLNC code in a high-burst environment.

[0005] The implementation of the scheme includes: Step S1, initializing the encoder parameters and the sending end socket parameters, caching the data packets sent from the upper layer into the queue, and the encoder continuously takes the source data packets from the queue for header encapsulation and GF(2 8) encoding operation, and finally sending the source data packet and the encoded packet via the socket. Step S2: Initialize the decoder parameters and the receiving end socket parameters, buffer the incoming data packets into a queue, and the decoder continuously extracts data packets from the queue and performs decoding and recovery operations based on the packet header information. Finally, the recovered data packets are sorted and transmitted to the upper layer in sequence. This scheme can achieve a lower decoding failure probability than Reed-Solomon (RS) and Caterpillar RLNC (CRLNC) codes in high-burst channel environments.

[0006] The technical solution specifically adopted by the present invention to solve the technical problem is:

[0007] A method for solving high-burst application layer coding and decoding, at the application layer,

[0008] The encoder receives the data transmitted by the upper layer through the first buffer queue, takes out the source data packet from the first buffer queue, performs header encapsulation and performs GF(2 8 ) after the encoding operation, the source data packet and the encoded packet are sent through the sending end socket;

[0009] The decoder obtains data packets from the receiving end socket through the second cache queue, takes out the data packets from the second cache queue, performs decoding and recovery operations based on the data packet header information, sorts the recovered data packets, and transmits them to the upper layer in sequence.

[0010] Furthermore, before the first cache queue receives data transmitted by the upper layer, initialization is performed, including:

[0011] Initialize encoder parameters: set the encoding window size w e , the coding interleaving depth v, the coding packet sending step length l, and the code rate R are:

[0012] Initialize the sending end socket parameters: set it to UDP transmission, and bind the peer IP and port address entered by the terminal to the socket;

[0013] And initialize a queue Q s , as the first cache queue, it is used to store the source data packets sent by the upper-layer application. The parameter of the semaphore sem_t is added to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive.

[0014] Furthermore, the encoder takes out the source data packet from the first buffer queue, performs header encapsulation and performs GF(2 8 ) encoding operation, the process of sending the source data packet and the encoded packet through the sending end socket is as follows:

[0015] The encoder determines the s Does the head point to a null pointer? If so, Q s If the queue is empty, the encoder continues to wait; if Q s If the head is not a null pointer, take out Q s The data pointed to by the head pointer is put into the encoder;

[0016] The encoder encapsulates the corresponding information of the source data packet as the packet header according to the source data packet information; the encoder initializes a variable id source , assigned a value of 0; each time a source data packet is encapsulated, id source Add one; id when encapsulating source As the stream_id information in the source data packet header, the source data packet length is as the pl_size information in the header, and the other parameters are set to -1;

[0017] Buffer the source data packet into the encoding window E w Among them, E w Implemented using deque container;

[0018] If E w Size S e satisfy:

[0019] S e >w e v

[0020] Then E w Remove the source data packet at the starting position in the buffer and cache the new source data packet; if it is not satisfied, cache the new source data packet directly;

[0021] Send the source data packet to the corresponding port in the set peer IP through the sendto() function in the socket;

[0022] According to the set step size l, determine whether to generate a coded packet by calculating the following formula:

[0023] F=id source modl

[0024] If F≠0, re-execute from queue Q s Determine whether the header points to a null pointer; if F=0, generate a coded packet;

[0025] The encoder initializes a variable id repair , assigned a value of 0; each time a coded packet is encapsulated, id repair plus one; id repair As a random number seed, w is then randomly generated by the Mersenne selection algorithm eThe randomly generated coding coefficients are limited to 0-255 by taking the remainder 256, and the generated w is defined e The set of coding coefficients is M;

[0026] Initialize a character array R of size 2048 and assign it to 0; according to the interleaving depth v, take out E w The v-1th source data packet in the set M is GF(2 8 ) and then multiply it with R by GF(2 8 ) and the result is assigned to R; and so on, loop out E w The nv-1 source data packets in M ​​are subjected to the same operation as the n-th coding coefficient in M ​​until the following equation is satisfied, then the loop is exited;

[0027] S e <nv-1

[0028] After jumping out of the loop, the content of R is used as the payload part of the encoded packet to encapsulate the corresponding packet header, id repair As the repair_id information in the packet header, E w The source_id of the source data packet at the starting position is used as the first_pkt_id information in the packet header, the source_id of the source data packet at the ending position is used as the last_pkt_id information in the packet header, the corresponding position of the last non-zero element in the character array R is used as the pl_size information in the packet header, and the rest of the parameters are set to -1;

[0029] Send the encoded packet to the corresponding port in the set peer IP through the sendto() function in the socket.

[0030] Furthermore, before the second buffer queue obtains the data packet from the receiving end socket, initialization is performed, including:

[0031] Initialize decoder parameters: set the maximum size w of the decoding window d , interleaving depth v;

[0032] Initialize the receiving end socket parameters: set it to UDP transmission and bind the port number to be monitored to the socket;

[0033] Initialize a queue Q r , as the second cache queue, is used to store the data packets received by the receiving socket, and add the parameter of the semaphore sem_t to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive.

[0034] Furthermore, the decoder takes out data packets from the second buffer queue, performs decoding and recovery operations based on the data packet header information, and sorts the recovered data packets and transmits them to the upper layer in sequence. The specific process is as follows:

[0035] Set up a thread so that the receiving socket continuously receives data through the recv() function and caches it in queue Q r middle;

[0036] If Q r If the head is not a null pointer, take out Q r The data pointed to by the head pointer is placed in the decoder;

[0037] Extract the packet header information of the data packet. If repair_id = -1 and source_id ≠ -1, the received data packet is the source data packet; if repair_id ≠ -1 and source_id = -1, the received data packet is the coded data packet; if both are not -1 or both are -1, the data packet is wrong and is discarded directly;

[0038] The decoder initializes a variable id inorder Variable, assigned value 0; if the received data packet is the source data packet, determine whether the following formula is satisfied;

[0039] source_id=id inorder

[0040] If satisfied, it is directly passed to the upper application, id inorder plus one;

[0041] If not satisfied, store in decoding window D w And generate the corresponding unit vector and insert it into D w The corresponding decoding matrix C d If the received packet is a coded packet, determine whether the following formula is satisfied:

[0042] last_pkt_id≤id inorder

[0043] If the conditions are met, the encoded packet is useless and is discarded directly;

[0044] If not satisfied, store in decoding window D w And according to the first_pkt_id and last_pkt_id in the encoding packet header, calculate the encoding coefficient length S r ;

[0045] S r =last_pkt_id-first_pkt_id+1

[0046] By S rand interleaving depth v to calculate the effective coding coefficient length S v ;

[0047]

[0048] Then repair_id is used as a random number seed to generate S through the Mersenne selection algorithm. v A random number is obtained and limited to 0-255 by taking the modulo 256; r Insert v-1 zeros in the middle of the random numbers, and finally get a length of S r The coding coefficient of D w The corresponding decoding matrix C d middle;

[0049] If a new data packet is inserted, D w The size of w d Within, and C d If the rank is not full, repeat the above: take Q from r The data pointed to by the head pointer is put into the decoder;

[0050] If a new data packet is inserted into D w After, D w The size exceeds w d , then remove D w The packet at the starting position in C is removed d The corresponding coefficient in ;

[0051] If a new data packet is inserted into D w After that, C d Full rank; definition D w The set of data packets in is Y d , then the source data packet set X is recovered according to the following formula;

[0052]

[0053] Sort the source data packet set X by source_id and then pass it to the upper-layer application in order.

[0054] Furthermore, the receiving end is also provided with an array space for caching source data packets, which is used to cache the data packets that have been successfully resumed for uploading recently, so as to adjust the coding coefficients of the coding packets.

[0055] An application layer encoding and decoding system for solving high bursts, arranged at the application layer of a computer system, comprising: a first cache queue, a second cache queue, an encoder and a decoder;

[0056] The first buffer queue receives data transmitted by the upper layer, and the encoder takes out the source data packet from the first buffer queue to perform header encapsulation and GF (2 8) after the encoding operation, the source data packet and the encoded packet are sent through the sending end socket;

[0057] The decoder obtains data packets from the receiving end socket through the second cache queue, takes out the data packets from the second cache queue, performs decoding and recovery operations according to the data packet header information, sorts the recovered data packets, and transmits them to the upper layer in sequence.

[0058] Furthermore, before the first cache queue receives data transmitted by the upper layer, initialization is performed, including:

[0059] Initialize encoder parameters: set the encoding window size w e , the coding interleaving depth v, the coding packet sending step length l, and the code rate R are:

[0060] Initialize the sending end socket parameters: set it to UDP transmission, and bind the peer IP and port address entered by the terminal to the socket;

[0061] And initialize a queue Q s , as the first cache queue, used to store source data packets from upper-layer applications, add the semaphore sem_t parameter to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive;

[0062] The encoder determines the s Does the head point to a null pointer? If so, Q s If the queue is empty, the encoder continues to wait; if Q s If the head is not a null pointer, take out Q s The data pointed to by the head pointer is put into the encoder;

[0063] The encoder encapsulates the corresponding information of the source data packet as the packet header according to the source data packet information; the encoder initializes a variable id source , assigned a value of 0; each time a source data packet is encapsulated, id source Add one; id when encapsulating source As the stream_id information in the source data packet header, the source data packet length is as the pl_size information in the header, and the other parameters are set to -1;

[0064] Buffer the source data packet into the encoding window E w Among them, E w Implemented using deque container;

[0065] If E w Size S e satisfy:

[0066] S e >we v

[0067] Then E w Remove the source data packet at the starting position in the buffer and cache the new source data packet; if it is not satisfied, cache the new source data packet directly;

[0068] Send the source data packet to the corresponding port in the set peer IP through the sendto() function in the socket;

[0069] According to the set step size l, determine whether to generate a coded packet by calculating the following formula:

[0070] F=id source modl

[0071] If F≠0, re-execute from queue Q s Determine whether the header points to a null pointer; if F=0, generate a coded packet;

[0072] The encoder initializes a variable id repair , assigned a value of 0; each time a coded packet is encapsulated, id repair plus one; id repair As a random number seed, w is then randomly generated by the Mersenne selection algorithm e The randomly generated coding coefficients are limited to 0-255 by taking the remainder 256, and the generated w is defined e The set of coding coefficients is M;

[0073] Initialize a character array R of size 2048 and assign it to 0; according to the interleaving depth v, take out E w The v-1th source data packet in the set M is GF(2 8 ) and then multiply it with R by GF(2 8 ) and the result is assigned to R; and so on, loop out E w The nv-1 source data packets in M ​​are subjected to the same operation as the n-th coding coefficient in M ​​until the following equation is satisfied, then the loop is exited;

[0074] S e <nv-1

[0075] After jumping out of the loop, the content of R is used as the payload part of the encoded packet to encapsulate the corresponding packet header, id repair As the repair_id information in the packet header, E wThe source_id of the source data packet at the starting position is used as the first_pkt_id information in the packet header, the source_id of the source data packet at the ending position is used as the last_pkt_id information in the packet header, the corresponding position of the last non-zero element in the character array R is used as the pl_size information in the packet header, and the rest of the parameters are set to -1;

[0076] Send the encoded packet to the corresponding port in the set peer IP through the sendto() function in the socket.

[0077] Furthermore, before the second buffer queue obtains the data packet from the receiving end socket, initialization is performed, including:

[0078] Initialize decoder parameters: set the maximum size w of the decoding window d , interleaving depth v;

[0079] Initialize the receiving end socket parameters: set it to UDP transmission, bind the port number to be monitored to the socket; initialize a queue Q r , as the second cache queue, used to store the data packets received by the receiving socket, and add the semaphore sem_t parameter to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive;

[0080] The decoder takes out data packets from the second buffer queue, performs decoding and recovery operations based on the data packet header information, sorts the recovered data packets, and transmits them to the upper layer in sequence. The specific process is as follows:

[0081] Set up a thread so that the receiving socket continuously receives data through the recv() function and caches it in queue Q r middle;

[0082] If Q r If the head is not a null pointer, take out Q r The data pointed to by the head pointer is placed in the decoder;

[0083] Extract the packet header information of the data packet. If repair_id = -1 and source_id ≠ -1, the received data packet is the source data packet; if repair_id ≠ -1 and source_id = -1, the received data packet is the coded data packet; if both are not -1 or both are -1, the data packet is wrong and is discarded directly;

[0084] The decoder initializes a variable id inorder Variable, assigned value 0; if the received data packet is the source data packet, determine whether the following formula is satisfied;

[0085] source_id=id inorder

[0086] If satisfied, it is directly passed to the upper application, id inorder plus one;

[0087] If not satisfied, store in decoding window D w And generate the corresponding unit vector and insert it into D w The corresponding decoding matrix C d If the received packet is a coded packet, determine whether the following formula is satisfied:

[0088] last_pkt_id≤id inorder

[0089] If the conditions are met, the encoded packet is useless and is discarded directly;

[0090] If not satisfied, store in decoding window D w And according to the first_pkt_id and last_pkt_id in the encoding packet header, calculate the encoding coefficient length S r ;

[0091] S r =last_pkt_id-first_pkt_id+1

[0092] By S r and interleaving depth v to calculate the effective coding coefficient length S v ;

[0093]

[0094] Then repair_id is used as a random number seed to generate S through the Mersenne selection algorithm. v A random number is obtained and limited to 0-255 by taking the modulo 256; r Insert v-1 zeros in the middle of the random numbers, and finally get a length of S r The coding coefficient of D w The corresponding decoding matrix C d middle;

[0095] If a new data packet is inserted, D w The size of w d Within, and C d If the rank is not full, repeat the above: take Q from r The data pointed to by the head pointer is put into the decoder;

[0096] If a new data packet is inserted into D w After, D w The size exceeds w d , then remove D wThe packet at the starting position in C is removed d The corresponding coefficient in ;

[0097] If a new data packet is inserted into D w After that, C d Full rank; definition D w The set of data packets in is Y d , then the source data packet set X is recovered according to the following formula;

[0098]

[0099] Sort the source data packet set X by source_id and then pass it to the upper-layer application in order.

[0100] And, an electronic device includes a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the steps of the above-mentioned method for solving the high-burst application layer encoding and decoding are implemented.

[0101] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned application layer encoding and decoding method for solving high burst.

[0102] Compared with the existing technology, the present invention and its preferred solution not only have a lower decoding failure probability than RS code and CRLNC code in a high-burst environment, but also do not require feedback retransmission, and the coded packets are dispersed in the source data packet, making it more real-time. BRIEF DESCRIPTION OF THE DRAWINGS

[0103] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0104] Figure 1 A system block diagram for implementing the solution of an embodiment of the present invention;

[0105] Figure 2 A diagram showing a packet header design for data packet encapsulation according to an embodiment of the present invention;

[0106] Figure 3 Schematic diagram of a channel packet loss model simulated in an example of the present invention;

[0107] Figure 4 Schematic diagram of the variation of decoding failure probability with burst length relative to RS code in an embodiment of the present invention;

[0108] Figure 5 FIG. 1 is a schematic diagram showing how the decoding failure probability varies with the bit rate relative to CRLNC in an embodiment of the present invention. DETAILED DESCRIPTION

[0109] To make the features and advantages of this patent more clearly understood, the following embodiments are specifically described in detail as follows:

[0110] It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meaning as commonly understood by those skilled in the art to which this application belongs.

[0111] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0112] like Figure 1-Figure 4 As shown, this embodiment provides an application layer encoding and decoding method for solving high burst, including the following steps:

[0113] Step S1: Initialize the encoder parameters and the sender socket parameters. The data packets sent from the upper layer are cached in the queue. The encoder continuously takes the source data packets from the queue for header encapsulation and GF(2 8 ) encoding operation, and finally sending the source data packet and the encoded packet through the socket;

[0114] Step S2: Initialize the decoder parameters and the receiving end socket parameters, cache the incoming data packets into a queue, and the decoder continuously takes out data packets from the queue and performs decoding and recovery operations based on the data packet header information. Finally, the recovered data packets are sorted and transmitted to the upper layer in order.

[0115] Preferably, during the actual transmission process, the receiving end also needs to cache the data packet that has been successfully restored and uploaded recently to adjust the coding coefficient of the coded packet to further reduce the probability of decoding failure.

[0116] In this embodiment, step S1 specifically includes the following steps:

[0117] Step S11: Initialize encoder parameters: set the encoding window size w e , the coding interleaving depth v, the coding packet sending step length l, according to l, the code rate R can be calculated as

[0118]

[0119] Step S12: Initialize the sending end socket parameters: set to UDP transmission, and bind the peer IP and port address input by the terminal to the socket;

[0120] Step S13: Initialize a queue Q s , responsible for storing the source data packets sent by the upper-layer application, and adding the parameters of the semaphore sem_t to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive, that is, they cannot be performed at the same time;

[0121] Step S14: The encoder determines the s Does the head point to a null pointer? If so, Q s If the queue is empty, the encoder continues to wait;

[0122] Step S15: If Q s If the head is not a null pointer, take out Q s The data pointed to by the head pointer is put into the encoder;

[0123] Step S16: The encoder encapsulates the source data packet with the corresponding information as a packet header according to the source data packet information. The encoder initializes a variable id source , assigned a value of 0. Each time a source data packet is encapsulated, id source Will increase by 1. When encapsulating id source The source data packet is used as the stream_id information in the packet header, the source data packet length is used as the pl_size information in the packet header, and the other parameters are set to -1;

[0124] Step S17: Cache the source data packet into the encoding window E w Among them, E w Use deque container to implement. If E w Size S e satisfy

[0125] S e >w e v

[0126] Then E w Remove the source data packet at the starting position in the buffer and cache the new source data packet. If it is not satisfied, cache the new source data packet directly;

[0127] Step S18: Send the source data packet to the corresponding port in the set peer IP through the sendto() function in the socket;

[0128] Step S19: Determine whether to generate a coded packet by calculating the following formula according to the set step length l;

[0129] F=id source modl

[0130] If F≠0, repeat steps S4-S5. If F=0, generate a coded packet;

[0131] Step S110: The encoder initializes a variable id repair , assigned a value of 0. Each time a coded packet is encapsulated, id repair Plus one. id repair As a random number seed, w is then randomly generated by the Mersenne selection algorithm e The randomly generated coding coefficients are limited to 0-255 by taking the remainder 256, and the generated w is defined e The set of coding coefficients is M;

[0132] Step S111: Initialize a character array R of size 2048 and assign it a value of 0. According to the interleaving depth v, take out E w The v-1th source data packet in the set M is GF(2 8 ) and then multiply it with R by GF(2 8 ) and the result is assigned to R. Similarly, loop to take out E w The nv-1 source data packets in M ​​are subjected to the same operation as the n-th coding coefficient in M ​​until the following equation is satisfied, then the loop is exited;

[0133] S e <nv-1

[0134] Step S112: After exiting the loop, the content of R is used as the payload of the encoded packet, and the corresponding header is encapsulated for this part. repair As the repair_id information in the packet header, E w The source_id of the source data packet at the starting position is used as the first_pkt_id information in the packet header, the source_id of the source data packet at the ending position is used as the last_pkt_id information in the packet header, the corresponding position of the last non-zero element in the character array R is used as the pl_size information in the packet header, and the rest of the parameters are set to -1;

[0135] Step S113: Send the encoded packet to the corresponding port in the set peer IP through the sendto() function in the socket.

[0136] In this embodiment, the header design of the source data packet and the coded packet encapsulation is as follows: Figure 2 shown.

[0137] In this embodiment, step S2 specifically includes the following steps:

[0138] Step S21: Initialize decoder parameters: set the maximum size w of the decoding window d , interleaving depth v;

[0139] Step S22: Initialize the receiving end socket parameters: set to UDP transmission, and bind the port number to be monitored to the socket;

[0140] Step S23: Initialize a queue Q r , responsible for storing the data packets received by the receiving socket, and adding the semaphore sem_t parameter to make the two operations of storing data at the end of the team and getting data at the head of the team mutually exclusive;

[0141] Step S24: Set up a thread so that the receiving end socket continuously receives data through the recv() function and caches it in queue Q r middle;

[0142] Step S25: If Q r If the head is not a null pointer, take out Q r The data pointed to by the head pointer is placed in the decoder;

[0143] Step S26: Extract the packet header information of the data packet. If repair_id = -1 and source_id ≠ -1, the received packet is the source packet. If repair_id ≠ -1 and source_id = -1, the received packet is the coded packet. If both are not -1 or both are -1, the packet is wrong and is discarded directly.

[0144] Step S27: The decoder initializes a variable id inorder Variable, assigned value 0. If the received data packet is the source data packet, determine whether the following formula is satisfied;

[0145] source_id=id inorder

[0146] If satisfied, it is directly passed to the upper application, and id inorder plus one;

[0147] Step S28: If not satisfied, store in decoding window D w And generate the corresponding unit vector and insert it into D w The corresponding decoding matrix C d middle;

[0148] Step S29: If the received packet is a coded packet, determine whether the following equation is satisfied:

[0149] last_pkt_id≤id inorder

[0150] If the conditions are met, the encoded packet is useless and is discarded directly;

[0151] Step S210: If not satisfied, store in decoding window D wAnd according to the first_pkt_id and last_pkt_id in the encoding packet header, calculate the encoding coefficient length S r ;

[0152] S r =last_pkt_id-first_pkt_id+1

[0153] Step S211: Through S r and interleaving depth v to calculate the effective coding coefficient length S v ;

[0154]

[0155] Then repair_id is used as a random number seed to generate S through the Mersenne selection algorithm. v A random number is generated and limited to 0-255 by taking the modulo 256. r Insert v-1 zeros in the middle of the random numbers, and finally get a length of S r The coding coefficients are inserted into D w The corresponding decoding matrix C d middle;

[0156] Step S212: If a new data packet is inserted, D w The size of w d Within, and C d If the rank is not full, repeat steps S25-S211;

[0157] Step S213: If a new data packet is inserted into D w After, D w The size exceeds w d , then remove D w The packet at the starting position in C is removed d The corresponding coefficient in ;

[0158] Step S214: If a new data packet is inserted into D w After that, C d Full rank. Definition D w The set of data packets in is Y d , then the source data packet set X can be recovered according to the following formula;

[0159]

[0160] Step S215: Sort the source data packet set X by source_id, and then transmit them to the upper layer application in sequence.

[0161] Experimental simulation

[0162] In the simulation test of this example, the hardware is based on CPU i5-10400 and the software system is tested on Ubuntu 20.04 platform. The content of the data packet sent is randomly generated, and the data packet size is kept at 200 bytes. 10 random packets are generated for each test. 6 Each packet is passed to the encoder in sequence. Each data is tested 100 times and the final results are averaged.

[0163] The Gilbert packet loss model is used in the simulated bursty binary erasure channel of this example. Figure 3 As shown in Figure 1, the model is a two-state Markov chain. State G represents the "good" state, in which packet loss will not occur; state B represents the "bad" state, in which packet loss will inevitably occur. β represents the transition probability from the "bad" state to the "good" state, and γ represents the transition probability from the "good" state to the "bad" state. The expected channel burst error, E[B], is:

[0164]

[0165] The overall packet loss rate ε of the channel is:

[0166]

[0167] Figure 4 The performance of this scheme is compared with that of RS code, and the code rate R is 4 / 5. The code length of RS code is 255, the number of source data packets per block is 204, and the number of coded packets is 51. In order to ensure that the number of source data packets protected by each coded packet is consistent with that of RS code, the coding window size w of this scheme is set e = 204, step length l = 4. Simulations with different expected burst lengths E[B] were conducted to observe the changes in the decoding failure probability. It can be seen that under different burst environments, the decoding failure probability of this scheme is significantly lower than that of RS codes, and the higher the interleaving depth v, the lower the decoding failure probability.

[0168] Figure 5 The performance of this scheme is compared with that of CRLNC, keeping the coding window size w e =32, the maximum decoding window size w d = 48. By setting different expected burst lengths E[B] (16, 32, and 48, from left to right), the decoding failure probability at different code rates (1 / 2, 2 / 3, 4 / 5, 8 / 9, and 16 / 17) is tested. It can be seen that under different burst environments, the decoding failure probability of this scheme is significantly lower than that of the CRLNC code, and the higher the interleaving depth v, the lower the decoding failure probability.

[0169] In summary, it can be concluded that this scheme demonstrates higher reliability than RS code and CRLNC code in different high-burst environments, and is an excellent encoding and decoding scheme for current URLLC application scenarios.

[0170] Based on the same inventive concept, the present invention also provides a computer device, which includes: one or more processors and a memory for storing one or more computer programs; the program includes program instructions, and the processor is used to execute the program instructions stored in the memory. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is used to implement one or more instructions, specifically for loading and executing one or more instructions in a computer storage medium to implement the above method.

[0171] It should be further explained that, based on the same inventive concept, the present invention also provides a computer storage medium having a computer program stored thereon, which executes the above method when executed by a processor. The storage medium can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electrical, magnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.

[0172] It should be noted that, unless otherwise defined, the technical or scientific terms used in the present invention should have the usual meanings understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0173] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other manner. Any person skilled in the art may utilize the above-disclosed technical content to modify or modify the present invention into equivalent embodiments. However, any simple modifications, equivalent variations, and modifications to the above embodiments that do not depart from the technical content of the present invention and are based on the technical essence of the present invention remain within the scope of protection of the present invention.

[0174] This patent is not limited to the above-mentioned optimal implementation mode. Anyone can derive various other forms of application layer encoding and decoding methods for solving high bursts under the inspiration of this patent. All equal changes and modifications made according to the scope of the patent application of this invention should be covered by this patent.

Claims

1. An application layer coding and decoding method for solving high burst, characterized by: At the application layer, The encoder receives the data transmitted by the upper layer through the first buffer queue, takes out the source data packet from the first buffer queue, performs header encapsulation and performs GF(2 8 ) after the encoding operation, the source data packet and the encoded packet are sent through the sending end socket; The decoder obtains data packets from the receiving end socket through the second buffer queue, takes the data packets from the second buffer queue, performs decoding and recovery operations based on the data packet header information, sorts the recovered data packets, and transmits them to the upper layer in order; Before the first cache queue receives data transmitted by the upper layer, initialization is performed, including: Initialize encoder parameters: set the encoding window size w e , the coding interleaving depth v, the coding packet sending step length l, and the code rate R are: Initialize the sending end socket parameters: set it to UDP transmission, and bind the peer IP and port address entered by the terminal to the socket; And initialize a queue Q s , as the first cache queue, used to store source data packets from upper-layer applications, add the semaphore sem_t parameter to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive; The encoder takes out the source data packet from the first buffer queue, performs header encapsulation and performs GF(2 8 ) encoding operation, the process of sending the source data packet and the encoded packet through the sending end socket is as follows: The encoder determines the s Does the head point to a null pointer? If so, Q s If the queue is empty, the encoder continues to wait; if Q s If the head is not a null pointer, take out Q s The data pointed to by the head pointer is put into the encoder; The encoder encapsulates the corresponding information of the source data packet as the packet header according to the source data packet information; the encoder initializes a variable id source , assigned a value of 0; each time a source data packet is encapsulated, id source Add one; id when encapsulating source As the stream_id information in the source data packet header, the source data packet length is as the pl_size information in the header, and the other parameters are set to -1; Buffer the source data packet into the encoding window E w Among them, E w Implemented using deque container; If E w Size S e satisfy: S e >w e v Then E w Remove the source data packet at the starting position in the buffer and cache the new source data packet; if it is not satisfied, cache the new source data packet directly; Send the source data packet to the corresponding port in the set peer IP through the sendto() function in the socket; According to the set step size l, determine whether to generate a coded packet by calculating the following formula: F=id source modl If F≠0, re-execute from queue Q s Determine whether the header points to a null pointer; if F=0, generate a coded packet; The encoder initializes a variable id repair , assigned a value of 0; each time a coded packet is encapsulated, id repair plus one; id repair As a random number seed, w is then randomly generated by the Mersenne selection algorithm e The randomly generated coding coefficients are limited to 0-255 by taking the remainder 256, and the generated w is defined e The set of coding coefficients is M; Initialize a character array R of size 2048 and assign it to 0; according to the interleaving depth v, take out E w The v-1th source data packet in the set M is GF(2 8 ) and then multiply it with R by GF(2 8 ) and the result is assigned to R; and so on, loop out E w The nv-1 source data packets in M ​​are subjected to the same operation as the n-th coding coefficient in M ​​until the following equation is satisfied, then the loop is exited; S e <nv-1 After jumping out of the loop, the content of R is used as the payload part of the encoded packet to encapsulate the corresponding packet header, id repair As the repair_id information in the packet header, E w The source_id of the source data packet at the starting position is used as the first_pkt_id information in the packet header, the source_id of the source data packet at the ending position is used as the last_pkt_id information in the packet header, the corresponding position of the last non-zero element in the character array R is used as the pl_size information in the packet header, and the rest of the parameters are set to -1; Send the encoded packet to the corresponding port in the set peer IP through the sendto() function in the socket; Before the second buffer queue obtains a data packet from the receiving end socket, initialization is performed, including: Initialize decoder parameters: set the maximum size w of the decoding window d , interleaving depth v; Initialize the receiving end socket parameters: set it to UDP transmission and bind the port number to be monitored to the socket; Initialize a queue Q r , as the second cache queue, used to store the data packets received by the receiving socket, and add the parameter of the semaphore sem_t to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive; The decoder takes out data packets from the second buffer queue, performs decoding and recovery operations based on the data packet header information, sorts the recovered data packets, and transmits them to the upper layer in sequence. The specific process is as follows: Set up a thread so that the receiving socket continuously receives data through the recv() function and caches it in queue Q r middle; If Q r If the head is not a null pointer, take out Q r The data pointed to by the head pointer is placed in the decoder; Extract the packet header information of the data packet. If repair_id = -1 and source_id ≠ -1, the received data packet is the source data packet; if repair_id ≠ -1 and source_id = -1, the received data packet is the coded data packet; if both are not -1 or both are -1, the data packet is wrong and is discarded directly; The decoder initializes a variable id inorder Variable, assigned value 0; if the received data packet is the source data packet, determine whether the following formula is satisfied; source_id=id inorder If satisfied, it is directly passed to the upper application, id inorder plus one; If not satisfied, store in decoding window D w And generate the corresponding unit vector and insert it into D w The corresponding decoding matrix C d middle; If the received packet is a coded packet, determine whether the following formula is satisfied: last_pkt_id≤id inorder If the conditions are met, the encoded packet is useless and is discarded directly; If not satisfied, store in decoding window D w And according to the first_pkt_id and last_pkt_id in the encoding packet header, calculate the encoding coefficient length S r ; S r =last_pkt_id-first_pkt_id+1 By S r and interleaving depth v to calculate the effective coding coefficient length S v ; Then repair_id is used as a random number seed to generate S through the Mersenne selection algorithm. v A random number is obtained and limited to 0-255 by taking the modulo 256; r Insert v-1 zeros in the middle of the random numbers, and finally get a length of S r The coding coefficient of D w The corresponding decoding matrix C d middle; If a new data packet is inserted, D w The size of w d Within, and C d If the rank is not full, repeat the above: take Q from r The data pointed to by the head pointer is put into the decoder; If a new data packet is inserted into D w After, D w The size exceeds w d , then remove D w The packet at the starting position in C is removed d The corresponding coefficient in ; If a new data packet is inserted into D w After that, C d Full rank; definition D w The set of data packets in is Y d , then the source data packet set X is recovered according to the following formula; Sort the source data packet set X by source_id and then pass it to the upper-layer application in order.

2. The method for solving high-burst application layer coding and decoding according to claim 1, characterized in that: The receiving end is also provided with an array space for caching source data packets, which is used to cache the data packets that have been successfully restored for uploading recently, so as to adjust the coding coefficients of the coding packets.

3. An application layer codec system for solving high burst problems, which is set at the application layer of a computer system and is characterized by: include: A first cache queue, a second cache queue, an encoder, and a decoder; The first buffer queue receives data transmitted by the upper layer, and the encoder takes out the source data packet from the first buffer queue to perform header encapsulation and GF (2 8 ) after the encoding operation, the source data packet and the encoded packet are sent through the sending end socket; The decoder obtains data packets from the receiving end socket through the second buffer queue, takes the data packets from the second buffer queue, performs decoding and recovery operations based on the data packet header information, sorts the recovered data packets, and transmits them to the upper layer in sequence; Before the first cache queue receives data transmitted by the upper layer, initialization is performed, including: Initialize encoder parameters: set the encoding window size w e , the coding interleaving depth v, the coding packet sending step length l, and the code rate R are: Initialize the sending end socket parameters: set it to UDP transmission, and bind the peer IP and port address entered by the terminal to the socket; And initialize a queue Q s , as the first cache queue, used to store source data packets from upper-layer applications, add the semaphore sem_t parameter to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive; The encoder determines the s Does the head point to a null pointer? If so, Q s If the queue is empty, the encoder continues to wait; if Q s If the head is not a null pointer, take out Q s The data pointed to by the head pointer is put into the encoder; The encoder encapsulates the corresponding information of the source data packet as the packet header according to the source data packet information; the encoder initializes a variable id source , assigned a value of 0; each time a source data packet is encapsulated, id source Add one; id when encapsulating source As the stream_id information in the source data packet header, the source data packet length is as the pl_size information in the header, and the other parameters are set to -1; Buffer the source data packet into the encoding window E w Among them, E w Implemented using deque container; If E w Size S e satisfy: S e >w e v Then E w Remove the source data packet at the starting position in the buffer and cache the new source data packet; if it is not satisfied, cache the new source data packet directly; Send the source data packet to the corresponding port in the set peer IP through the sendto() function in the socket; According to the set step size l, determine whether to generate a coded packet by calculating the following formula: F=id source modl If F≠0, re-execute from queue Q s Determine whether the header points to a null pointer; if F=0, generate a coded packet; The encoder initializes a variable id repair , assigned a value of 0; each time a coded packet is encapsulated, id repair plus one; id repair As a random number seed, w is then randomly generated by the Mersenne selection algorithm e The randomly generated coding coefficients are limited to 0-255 by taking the remainder 256, and the generated w is defined e The set of coding coefficients is M; Initialize a character array R of size 2048 and assign it to 0; according to the interleaving depth v, take out E w The v-1th source data packet in the set M is GF(2 8 ) and then multiply it with R by GF(2 8 ) and the result is assigned to R; and so on, loop out E w The nv-1 source data packets in M ​​are subjected to the same operation as the n-th coding coefficient in M ​​until the following equation is satisfied, then the loop is exited; S e <nv-1 After jumping out of the loop, the content of R is used as the payload part of the encoded packet to encapsulate the corresponding packet header, id repair As the repair_id information in the packet header, E w The source_id of the source data packet at the starting position is used as the first_pkt_id information in the packet header, the source_id of the source data packet at the ending position is used as the last_pkt_id information in the packet header, the corresponding position of the last non-zero element in the character array R is used as the pl_size information in the packet header, and the rest of the parameters are set to -1; Send the encoded packet to the corresponding port in the set peer IP through the sendto() function in the socket; Before the second buffer queue obtains a data packet from the receiving end socket, initialization is performed, including: Initialize decoder parameters: set the maximum size w of the decoding window d , interleaving depth v; Initialize the receiving end socket parameters: set it to UDP transmission, bind the port number to be monitored to the socket; initialize a queue Q r , as the second cache queue, used to store the data packets received by the receiving socket, and add the parameter of the semaphore sem_t to make the two operations of storing data at the end of the queue and getting data at the head of the queue mutually exclusive; The decoder takes out data packets from the second buffer queue, performs decoding and recovery operations based on the data packet header information, sorts the recovered data packets, and transmits them to the upper layer in sequence. The specific process is as follows: Set up a thread so that the receiving socket continuously receives data through the recv() function and caches it in queue Q r middle; If Q r If the head is not a null pointer, take out Q r The data pointed to by the head pointer is placed in the decoder; Extract the packet header information of the data packet. If repair_id = -1 and source_id ≠ -1, the received data packet is the source data packet; if repair_id ≠ -1 and source_id = -1, the received data packet is the coded data packet; if both are not -1 or both are -1, the data packet is wrong and is discarded directly; The decoder initializes a variable id inorder Variable, assigned value 0; if the received data packet is the source data packet, determine whether the following formula is satisfied; source_id=id inorder If satisfied, it is directly passed to the upper application, id inorder plus one; If not satisfied, store in decoding window D w And generate the corresponding unit vector and insert it into D w The corresponding decoding matrix C d middle; If the received packet is a coded packet, determine whether the following formula is satisfied: last_pkt_id≤id inorder If the conditions are met, the encoded packet is useless and is discarded directly; If not satisfied, store in decoding window D w And according to the first_pkt_id and last_pkt_id in the encoding packet header, calculate the encoding coefficient length S r ; S r =last_pkt_id-first_pkt_id+1 By S r and interleaving depth v to calculate the effective coding coefficient length S v ; Then repair_id is used as a random number seed to generate S through the Mersenne selection algorithm. v A random number is obtained and limited to 0-255 by taking the modulo 256; r Insert v-1 zeros in the middle of the random numbers, and finally get a length of S r The coding coefficient of D w The corresponding decoding matrix C d middle; If a new data packet is inserted, D w The size of w d Within, and C d If the rank is not full, repeat the above: take Q from r The data pointed to by the head pointer is put into the decoder; If a new data packet is inserted into D w After, D w The size exceeds w d , then remove D w The packet at the starting position in C is removed d The corresponding coefficient in ; If a new data packet is inserted into D w After that, C d Full rank; definition D w The set of data packets in is Y d , then the source data packet set X is recovered according to the following formula; Sort the source data packet set X by source_id and then pass it to the upper-layer application in order.

4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the application layer encoding and decoding method for solving high bursts as claimed in claim 1 or 2 are implemented.

Citation Information

Patent Citations

  • Adaptive end-to-end network coding transmission method

    CN107508655A

  • Network coding communication method for real-time reliable control

    CN119341690A