Coding method and device and decoding method and device

By making the data packets and verification packets meet the formula A×B=0 in RS encoding, and using multi-frame data packets and verification packets for recovery, the problem of inefficient use of verification packets is solved, and more efficient packet recovery and redundant data reduction is achieved.

CN120415633APending Publication Date: 2025-08-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410137107.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-30
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the existing RS encoding method, the verification packet can only be used to restore lost data in the corresponding data packet, resulting in inefficient use of verification packets and waste of redundant data.

Method used

By making the data packet and verification packet meet the formula A×B=0, the verification packet, data packet and its pre and subsequent data packets and verification packets are restored, the efficiency of verification packets is improved and redundant data waste is reduced.

Benefits of technology

It improves the efficiency of verification packet usage, reduces redundant data waste, and enhances the ability to recover data packets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120415633A_ABST
    Figure CN120415633A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, and relates to the field of computers. The method is used for performing RS coding and decoding on data. The method comprises the following steps: obtaining a data packet a, and obtaining a verification packet b according to the data packet a; wherein the check packet b and the data packet a meet the following formula: A * B = 0. Wherein A is the check matrix of the data packet a, the elements in B are obtained based on the check packet b, the data packet a, the data packet before the data packet a and the check packet of the data packet before the data packet a, and the check matrixes of the data packets adjacent to A and the data packet a are different.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and in particular, to an encoding method and apparatus, and a decoding method and apparatus Background Art

[0002] Currently, in the process of data transmission, the forward error correction (FEC) method can be used to ensure the reliability of data transmission

[0003] When data is sent from a sending device to a receiving device by using the FEC method, the sending device first performs Reed-Solomon (RS) encoding on the data to be transmitted to obtain encoded data (the encoded data includes the data to be transmitted and check data), and sends the encoded data to the receiving device. After receiving the encoded data, the receiving device can recover the lost data through decoding

[0004] Specifically, when performing RS encoding on data, the sending device can divide the data to be transmitted into data packets of a preset size, and encode the data packets to obtain check packets corresponding to the data packets. In this way, after the receiving device receives the above data packets and check packets, if there are lost data packets, the lost data packets can be recovered to obtain complete data packets by using the non-lost data in the data packets and the check packets through decoding

[0005] However, according to the above encoding method, the check packets can only be used to recover the lost data in the data packets corresponding to the check packets, which results in a low utilization efficiency of the check packets Summary of the Invention

[0006] This application provides an encoding method and apparatus and a decoding method and apparatus

[0007] In a first aspect, an encoding method is provided. The method includes: obtaining a data packet (hereinafter referred to as data packet a). Obtaining a check packet (hereinafter referred to as check packet b) according to data packet a. Wherein, check packet b and data packet a satisfy the following formula: A×B = 0. Wherein, A is the check matrix of data packet a, the elements in B are obtained based on check packet b, data packet a, the data packets before data packet a, and the check packets of the data packets before data packet a, and A is different from the check matrix of the data packet adjacent to data packet a

[0008] In the above method, in the process of obtaining the check packet b from the data packet a, since the check packet b and the data packet a satisfy the above formula A×B = 0, when decoding the data packet on the decoding side, on the one hand, the data packet a can be recovered by using the check packet b, the data packet a, the data packets before the data packet a, the check packets of the data packets before the data packet a, and the formula A×B = 0. On the other hand, the data packets before the data packet a can be recovered by using the check packet b, the data packet a, the data packets before the data packet a, the check packets of the data packets before the data packet a, and the formula A×B = 0, thereby improving the utilization efficiency of the check packet and reducing the waste of redundant data.

[0009] In one implementation, the above data packet a is the j-th frame data packet, the check packet b is the j-th frame check packet, the data packets before the data packet a are the data packets from the (j - t)-th frame to the (j - 1)-th frame, and the check packets of the data packets before the data packet a are the check packets from the (j - t)-th frame to the (j - 1)-th frame, where j and t are positive integers and j > t, and B satisfies: B = (concat(a j ,b j ) + concat(a j-1 ,b j-1 ) +... + concat(a j-t ,b j-t ))). Here, a j is the j-th frame data packet, b j is the j-th frame check packet, and concat() is the merging function.

[0010] Through the above implementation, the sum result B of the data at the corresponding positions in the consecutive t + 1 frame data packets and check packets (i.e., B = (concat(a j ,b j ) + concat(a j-1 ,b j-1 ) +... + concat(a j-t ,b j-t ))) can satisfy A×B = 0. In this way, when recovering the data packet on the decoding side, on the one hand, the above check packet b can be used to recover the data packets from the (j - t)-th frame to the j-th frame, thereby improving the utilization efficiency of the check packet and reducing the problem of waste of redundant data. On the other hand, through the above implementation, the t + 1 frame check packets can all be used to recover the same frame data packet (for example, the above j-th frame check packet b can be used to recover the data packet a. In addition, it can be understood that the check packets from the (j + 1)-th frame to the (j + t)-th frame can also be used to recover the data packet a). Therefore, the amount of lost packet data that can be recovered in the data packet can be increased, thereby further improving the utilization efficiency of the check packet and reducing the waste of redundant data.

[0011] In one implementation, the t + 1 check matrices of the t + 1 data packets from the (j - t)-th frame to the j-th frame are different. The check matrix of the j-th data packet is the check matrix corresponding to the result of the modulo operation of j with t + 1, and there is a preset corresponding relationship between the check matrix and the modulo operation result.

[0012] In the above implementation, on the one hand, it is considered that t + 1 different check matrices can be set so that when determining the check packets corresponding to consecutive t + 1 data packets respectively, different check matrices can be selected from the t + 1 check matrices to calculate the check packets. Thus, when recovering a data packet, t + 1 check packets can be used for recovery, so as to improve the utilization efficiency of the check packets and reduce the waste of redundant data. Further, in the above implementation, by using the modulo operation method, the check matrix of the j-th data packet can be quickly determined.

[0013] In one implementation, different check matrices include the same preset sub-matrix.

[0014] In the above implementation, since the same preset sub-matrix is included in different check matrices, when decoding a data packet, the data packet can be decoded only by using the data packet and the check packet of this frame without using other data outside this frame data packet and the check packet.

[0015] Second, a decoding method is provided. The method includes: receiving a data packet and a check packet. According to the received data packet and check packet, a complete data packet is recovered. The complete data packet and the check packet satisfy the following formula: C × D = 0. Where C is the check matrix of the complete data packet; the elements in D are obtained based on the check packet, the complete data packet, p data packets before and / or after the complete data packet, and the check packets of p data packets before and / or after the complete data packet. C is different from the check matrix of the data packet adjacent to the complete data packet, and p is a positive integer.

[0016] In the above method, since the complete data packet (hereinafter referred to as complete data packet a) and the check packet (hereinafter referred to as check packet b) satisfy the above formula C × D = 0, when decoding the data packet on the decoding side, the above check packet b, p data packets before and / or after the complete data packet a, the check packets corresponding to the p data packets, and the formula C × D = 0 can be used to recover the complete data packet a. In addition, when recovering p data packets before and / or after the complete data packet a, the above check packet b, p data packets before and / or after the complete data packet a, the check packets corresponding to the p data packets, and the formula C × D = 0 can also be used to recover the p data packets, thereby improving the utilization efficiency of the check packets and reducing the waste of redundant data.

[0017] In one implementation, any one of the complete data packet and the p-frame data packets before and / or after the complete data packet is the first data packet. The check packet of the first data packet is the first check packet, and the first check packet and the first data packet satisfy the following formula: A × B = 0. Wherein, A is the check matrix of the first data packet, and the elements in B are obtained based on the first check packet, the first data packet, the t-frame data packets before the first data packet, and the t-frame check packets before the first check packet. A is different from the target matrix, and the target matrix is the check matrix of the data packet adjacent to the first data packet. t is a positive integer, and t ≤ p.

[0018] In the above implementation, since any one of the complete data packet and the p-frame data packets before and / or after the complete data packet (i.e., the first data packet) and the check packet of the first data packet (i.e., the first check packet) satisfy the formula: A × B = 0, therefore, on the one hand, when recovering the first data packet, the first check packet, the undropped packet data in the first data packet, the t-frame data packets before the first data packet, the t-frame checks before the first check packet, and the formula A × B = 0 can be used to recover the first data packet. In addition, the first check packet, the undropped packet data in the first data packet, the t-frame data packets before the first data packet, the t-frame checks before the first check packet, and the formula A × B = 0 can also be used to recover the t-frame data packets before the first data packet, thereby improving the utilization efficiency of the check packet and reducing the problem of redundant data waste.

[0019] In one implementation, the p-frame data packets before and / or after the complete data packet include: the p-frame data packets before the complete data packet, the p-frame data packets after the complete data packet, or the p-frame data packets before and after the complete data packet. The complete check packet is the j-th frame check packet. The data packets before the complete data packet are the data packets from the (j - p)-th frame to the (j - 1)-th frame. The data packets of the p frames after the complete data packet are the data packets from the (j + 1)-th frame to the (j + p)-th frame. The p-frame data packets before and after the complete data packet are the union of the data packets from the (j - m)-th frame to the (j - 1)-th frame and the data packets from the (j + 1)-th frame to the (j + n)-th frame, where n + m = p.

[0020] In one implementation, the check matrices of the p-frame data packets before and / or after the complete data packet are different. The check matrix of the complete data packet is the check matrix corresponding to the result of the modulo operation of j and t + 1, and there is a preset corresponding relationship between the check matrix and the modulo operation result.

[0021] In the above implementation, on the one hand, considering that t + 1 different parity matrices can be set, when determining the parity packets corresponding to consecutive t + 1 data packets respectively, different parity matrices can be selected from the t + 1 parity matrices to calculate the parity packets. Thus, when recovering a frame of data packets, t + 1 parity packets can be used for recovery, so as to improve the utilization efficiency of the parity packets and reduce the waste of redundant data. Further, in the above implementation, by using the modulo operation method, the parity matrix of the j-th frame of data packets can be quickly determined.

[0022] In one implementation, different parity matrices include the same preset sub-matrix.

[0023] In the above implementation, since the same preset sub-matrix is included in different parity matrices, when decoding a frame of data packets, the frame of data packets can be decoded only by using the frame of data packets and the parity packet of this frame without using other data outside this frame of data packets and the parity packet.

[0024] Thirdly, a coding device is provided. The coding device includes: an acquisition unit for acquiring data packets; a processing unit for obtaining a parity packet according to the data packets. The parity packet and the data packet satisfy the following formula: A×B = 0, where A is the parity matrix of the data packet, and the elements in B are obtained based on the parity packet, the data packet, the data packets before the data packet, and the parity packets of the data packets before the data packet, and A is different from the parity matrix of the data packet adjacent to the data packet.

[0025] In one implementation, the above data packet a is the j-th frame of data packets, the parity packet b is the j-th frame of parity packets, the data packets before the data packet a are the data packets from the (j - t)-th frame to the (j - 1)-th frame, and the parity packets of the data packets before the data packet a are the parity packets from the (j - t)-th frame to the (j - 1)-th frame. j and t are positive integers, j > t, and B satisfies: B=(concat(a j ,b j )+concat(a j-1 ,b j-1 )+...+concat(a j-t ,b j-t ))). Where a j is the j-th frame of data packets, b j is the j-th frame of parity packets, and concat() is a merging function.

[0026] In one implementation, the t + 1 parity matrices of the t + 1 frames of data packets from the (j - t)-th frame to the j-th frame are different. The parity matrix of the j-th frame of data packets is the parity matrix corresponding to the result of the modulo operation of j and t + 1, and there is a preset corresponding relationship between the parity matrix and the modulo operation result.

[0027] In one implementation, different check matrices include the same preset sub-matrix.

[0028] In a fourth aspect, a decoding device is provided. The decoding device includes: a receiving unit for receiving a data packet and a check packet; and a processing unit for recovering a complete data packet according to the received data packet and check packet, where the complete data packet and the check packet satisfy the following formula: C×D = 0, where C is the check matrix of the complete data packet, and the elements in D are obtained based on the check packet, the complete data packet, the p-frame data packets before and / or after the complete data packet, and the check packets of the p-frame data packets before and / or after the complete data packet. C is different from the check matrix of the data packet adjacent to the complete data packet, and p is a positive integer.

[0029] In one implementation, any one of the complete data packet and the p-frame data packets before and / or after the complete data packet is a first data packet. The check packet of the first data packet is a first check packet, and the first check packet and the first data packet satisfy the following formula: A×B = 0, where A is the check matrix of the first data packet, and the elements in B are obtained based on the first check packet, the first data packet, the t-frame data packets before the first data packet, and the t-frame check packets before the first check packet. A is different from the target matrix, where the target matrix is the check matrix of the data packet adjacent to the first data packet, and t is a positive integer, and t ≤ p.

[0030] In one implementation, the p-frame data packets before and / or after the complete data packet include: the p-frame data packets before the complete data packet, the p-frame data packets after the complete data packet, or the p-frame data packets before and after the complete data packet. The complete check packet is the j-th frame check packet, the data packets before the complete data packet are the data packets from the (j - p)-th frame to the (j - 1)-th frame, the data packets of the p frames after the complete data packet are the data packets from the (j + 1)-th frame to the (j + p)-th frame, and the p-frame data packets before and after the complete data packet are the union of the data packets from the (j - m)-th frame to the (j - 1)-th frame and the data packets from the (j + 1)-th frame to the (j + n)-th frame, where n + m = p.

[0031] In one implementation, the check matrices of the p-frame data packets before and / or after the complete data packet are different, and the check matrix of the complete data packet is the check matrix corresponding to the result of the modulo operation of j and t + 1, and there is a preset corresponding relationship between the check matrix and the modulo operation result.

[0032] In one implementation, different check matrices include the same preset sub-matrix.

[0033] In a fifth aspect, a data processing device is provided, including a memory and a processor. The memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to implement the method in the first aspect or any implementation manner of the first aspect, or to implement the method in the second aspect or any implementation manner of the second aspect.

[0034] In a sixth aspect, a computer-readable storage medium is provided, characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are run on a processor, the method in the first aspect or any implementation manner of the first aspect, or the method in the second aspect or any implementation manner of the second aspect is implemented.

[0035] In a seventh aspect, a computer program product is provided, characterized in that the computer program product includes instructions, and when the instructions are run on a processor, the method in the first aspect or any implementation manner of the first aspect, or the method in the second aspect or any implementation manner of the second aspect is implemented. Description of the Drawings

[0036] Figure 1 It is a schematic structural diagram of a transmission system provided by an embodiment of the present application;

[0037] Figure 2 It is a schematic structural diagram of a storage system provided by an embodiment of the present application;

[0038] Figure 3 It is one of the schematic flowcharts of a data processing method provided by an embodiment of the present application;

[0039] Figure 4 It is another schematic flowchart of a data processing method provided by an embodiment of the present application;

[0040] Figure 5 It is yet another schematic flowchart of a data processing method provided by an embodiment of the present application;

[0041] Figure 6 It is still another schematic flowchart of a data processing method provided by an embodiment of the present application;

[0042] * Figure 7 It is one of the schematic structural diagrams of an encoding device provided by an embodiment of the present application;

[0043] Figure 8 It is one of the schematic structural diagrams of a decoding device provided by an embodiment of the present application;

[0044] Figure 9 It is a schematic structural diagram of a data processing device provided by an embodiment of the present application. Detailed implementation manners

[0045] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Among them, in order to clearly describe the technical solutions in the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and terms such as "first" and "second" do not necessarily mean different. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner for easy understanding.

[0046] To facilitate the understanding of the technical solutions provided in the embodiments of the present application, the application scenarios of the embodiments of the present application will be introduced by way of example first. The technical solutions provided in the embodiments of the present application can be used in various application scenarios for encoding and decoding data according to Reed-Solomon (RS) coding:

[0047] In one application scenario, the data processing method provided in the embodiments of the present application can be used to encode and decode data according to RS coding during data transmission.

[0048] Specifically, as Figure 1 shown, it is a schematic structural diagram of a transmission system provided in the embodiments of the present application. The transmission system 10 includes a sending device 101 and a receiving device 102. Among them, the sending device 101 can be connected to the receiving device 102 wirelessly, wiredly or by using a transmission network.

[0049] Among them, the sending device 101 can encode the data to be transmitted according to the data processing method provided in the embodiments of the present application, and send the encoded data to the receiving device 102. The receiving device 102 can decode the received encoded data according to the data processing method provided in the embodiments of the present application.

[0050] In the actual application process, the functions of the above-mentioned sending device 101 and receiving device 102 can be implemented by electronic devices such as personal computers (including desktop computers, laptop computers, handheld computers, and notebook computers, etc.), ultra-mobile personal computers (UMPCs), or smart phones, servers, etc.; alternatively, the functions of the above-mentioned sending device 101 and receiving device 102 can also be implemented by some hardware / software devices in the above-mentioned electronic devices. The embodiments of the present application do not impose special restrictions on the specific forms of the sending device 101 and the receiving device 102.

[0051] In another application scenario, the data processing method provided by the embodiments of the present application can also be used to encode and decode data according to RS coding during the data access process.

[0052] Specifically, Figure 2 The figure shows a schematic structural diagram of a storage system provided by an embodiment of the present application. The storage system 20 can be a device or a cluster of devices for storing data. The storage system 20 includes a control device 201 and a storage device 206.

[0053] Among them, the storage device 206 is used for persistent storage of data. Exemplarily, as Figure 2 shown, the storage device 206 may include one or more hard disks 207 for persistent storage.

[0054] The control device 201 is configured to write data to the storage device 206 or read data from the storage device 206 after obtaining a data access request. Among them, on the one hand, the data access request obtained by the control device 201 can come from within the storage system 20. For example, the data access request can be generated by an application program running in the storage system 20. On the other hand, the data access request obtained by the control device 201 can come from outside the storage system 20. For example, the data access request can be sent to the storage system 20 by an access device 21 outside the storage system 20 through a network.

[0055] Among them, during the process of writing data to the storage device 206, the control device 201 can perform RS coding on the data to be stored according to the data processing method provided by the embodiments of the present application, and send the encoded data obtained by encoding to the storage device 206 for storage. In addition, during the process of reading data from the storage device 206, the control device 201 can decode the encoded data read according to the data processing method provided by the embodiments of the present application. At this time, it can be understood that: the process of encoding data and the process of decoding data are both executed by the control device 201.

[0056] Specifically, the control device 201 may include one or more of a processor 202, a memory 203, a front-end interface 204, and a back-end interface 205. Among them, the processor 202 may be a central processing unit (CPU) for processing data access requests from outside the storage system (such as the access device 21) and also for processing requests occurring inside the storage system. Exemplarily, when the processor 202 receives a write data request sent by the access device 21 through the front-end interface 204, it temporarily stores the data to be stored in these write data requests in the memory 203. When the total amount of data to be stored in the memory 203 reaches a certain threshold, the processor 203 performs RS encoding on these data to be stored according to the data processing method provided in the embodiments of the present application, and sends the encoded data to the storage device 206 through the back-end interface for persistent storage. Another example is that when the processor 202 receives a read data request sent by the access device 21 through the front-end interface 204, it reads the corresponding encoded data from the storage device 206 according to the data identifier in the read data request, and decodes the read encoded data according to the data processing method provided in the embodiments of the present application.

[0057] To facilitate understanding of the technical solutions provided in the embodiments of the present application, the related technologies involved in the embodiments of the present application are introduced below:

[0058] Currently, when using RS encoding to ensure data reliability, the encoding-side device can divide the data into data packets of a preset size (wherein, one data packet may include k data blocks, and k is a positive integer), and encode each data packet respectively to obtain the corresponding check packet for each data packet (wherein, one check packet may include r check blocks, and r is a positive integer). In this way, after the decoding-side device obtains the information combination including the above data packets and check packets, if the number of missing information blocks (specifically, the information blocks may include data blocks and / or check blocks) in the information combination does not exceed r, the missing information blocks can be recovered through decoding.

[0059] Specifically, taking the RS encoding of k data blocks x1, x2, x3,..., x k to obtain r check blocks x k+1 , x k+2 ,..., x n as an example:

[0060] According to the relevant principles of RS encoding, it can be known that k data blocks and r check blocks x1,..., x k , x k+1 ,..., x n can satisfy the following formula:

[0061]

[0062] Among them, A r×n is an r×n check matrix based on a finite field and full rank. The specific form of A r×n can be set according to actual needs. For example, A r×n can be composed of the transpose matrix of the Vandermonde matrix; for another example, A r×n can be composed of a Cauchy matrix.

[0063] It is easy to understand that r linear equations about x1,...,x k ,x k+1 ,...,x n can be constructed according to Formula 1. Therefore, on the one hand, during the encoding process, when determining the k data blocks x1, x2, x3,...,x k , r check blocks x k+1 ,x k+2 ,...,x n can be obtained according to Formula 1. On the other hand, during the decoding process, as long as the number of lost information blocks in x1,...,x k ,x k+1 ,...,x n does not exceed r, then the lost information blocks can be recovered using the above r linear equations.

[0064] In the embodiments of the present application, it is considered that the above related technologies have at least the following technical problems: A check packet can only be used to recover the lost packet data in a data packet corresponding to this check packet, which results in the problem of low utilization efficiency of the check packet.

[0065] The following introduces the technical solutions provided by the embodiments of the present application in combination with examples:

[0066] Regarding the technical problems existing in the above related technologies, in the embodiments of the present application, it is considered that: during the process of encoding a data packet a (where the data packet a may include k data blocks) to obtain a check packet b (the check packet b may include r check blocks), if the data packet a and the check packet b can satisfy the following formula (1):

[0067] A×B = 0 Formula (1)

[0068] Among them, A is the check matrix of the data packet a, the elements in B are obtained based on the check packet b, the data packet a, the data packets before the data packet a, and the check packets of the data packets before the data packet a, and A is different from the check matrix of the data packet adjacent to the data packet a.

[0069] In this way, during the decoding process, on the one hand, the data packet a can be recovered by using the check packet b, the data packet a, the data packets before the data packet a, the check packets of the data packets before the data packet a, and the formula A×B = 0. On the other hand, the data packets before the data packet a can be recovered by using the check packet b, the data packet a, the data packets before the data packet a, the check packets of the data packets before the data packet a, and the formula A×B = 0, thereby improving the utilization efficiency of the check packets and reducing the waste of redundant data.

[0070] For example, B in the above formula (1) can be obtained based on the check packet b, the data packet a, a frame of data packet c before the data packet a, and the check packet d of the data packet c. Exemplarily, B satisfies the following formula (2):

[0071] B = (concat(a,b)+concat(c,d)) Formula (2)

[0072] Where concat() is a merging function.

[0073] Specifically, assume that the first frame of data packet includes k data blocks x 1,1 ,x 1,2 ,...,x 1,k , and the check packet corresponding to the first frame of data packet includes r check blocks x 1,k+1 ,x 1,k+2 ,...,x 1,n ; the second frame of data packet includes k data blocks x 2,1 ,x 2,2 ,...,x 2,k , and the check packet corresponding to the second frame of data packet includes r check blocks x 2,k+1 ,x 2,k+2 ,...,x 2,n ; the third frame of data packet includes k data blocks x 3,1 ,x 3,2 ,...,x 3,k , and the check packet corresponding to the third frame of data packet includes r check blocks x 3,k+1 ,x 3,k+2 ,...,x 3,n . For ease of description, in the embodiments of the present application, the data blocks and check blocks are collectively referred to as information blocks, and the corresponding data packets and check packets are called an information combination.

[0074] On the one hand, B obtained from the first information combination and the second information combination can be expressed as the following formula (3):

[0075]

[0076] Furthermore, the first information combination and the second information combination satisfy the following formula (4):

[0077]

[0078] Among them, A1 can be any r×n parity-check matrix based on a finite field and with full rank, and the specific form of A1 can be set according to actual needs. For example, A1 can be composed of the transpose matrix of a Vandermonde matrix; for another example, A1 can be composed of a Cauchy matrix.

[0079] It can be understood that r linear equations about x 1,1 ,...,x 1,n and x 2,1 ,...,x 2,n can be obtained according to formula (4).

[0080] On the other hand, B obtained from the second information combination and the third information combination can be expressed as the following formula (5):

[0081]

[0082] Furthermore, the first information combination and the second information combination satisfy the following formula (6):

[0083]

[0084] Among them, A2 can be any r×n parity-check matrix based on a finite field and with full rank, and the specific form of A2 can be set according to actual needs. For example, A2 can be composed of the transpose matrix of a Vandermonde matrix; for another example, A2 can be composed of a Cauchy matrix. Among them, the parity-check matrix A1 in formula (4) above is different from the parity-check matrix A2 in formula (6).

[0085] It can be understood that r linear equations about x 2,1 ,...,x 2,n and x 3,1 ,...,x 3,n can be obtained according to formula (6).

[0086] Therefore, when there are missing information blocks in the above three information combinations, among the r linear equations obtained by using formula (4) and the r linear equations obtained by using formula (6), at most 2r missing information blocks in the above three information combinations can be recovered. Further, when there is no missing data in the first information combination and the third information combination, in the above example, at most 2r lost packets in the second information combination can be recovered (in this case, it is illustrated by taking the matrix obtained by splicing A1 and A2 as a full-rank matrix. When the matrix obtained by splicing A1 and A2 is not a full-rank matrix, the maximum number of lost packets that can be recovered is less than 2r. Among them, the maximum number of lost packets that can be recovered is related to the rank of the matrix obtained by splicing A1 and A2).

[0087] It can be seen that, on the one hand, in the example shown in the above formulas (3)-(6), the check blocks in one information combination can be used to recover the data in multiple information combinations (for example, the check blocks in the second information combination participate in the operations in both formulas (3) and (5), so the check blocks in the second information combination can be used to recover the data in the first information combination, the second information combination, and the third information combination). Further, even if the number of missing information blocks in one information combination is small or there is no lost packet, the check blocks in this information combination can still be used to recover the information blocks in other information combinations, reducing the problem of redundant data waste. On the other hand, in the example shown in the above formulas (3)-(6), without changing the ratio of data blocks to check blocks in the information combination (taking one information combination including k data blocks and r check blocks as an example), the number of lost packets that can be recovered in one information combination can be increased, so that the number of lost packets that can be recovered in one information combination is greater than r (for example, in the above example, the maximum number of lost packets that can be recovered in the second information combination can reach 2r).

[0088] Next, in combination with Figure 1 the data transmission scenario shown, the data processing method provided by the embodiments of the present application will be introduced in detail.

[0089] In the first example, taking two frames of data packets and check packets satisfying the above formula (1) as an example, the method provided by the embodiments of the present application will be introduced. As Figure 3 shown, the method may include:

[0090] S301. The sending device 101 obtains the data to be transmitted.

[0091] Among them, the data to be transmitted may include one or more frames of data packets. Among them, one frame of data packet may include k data blocks. For the number of data blocks included in the data packet, there is no limitation in the embodiments of the present application.

[0092] For ease of description, in the embodiments of the present application, a frame of data packet and the corresponding check packet of the data packet are referred to as an "information combination". In actual application, other names can also be used to represent the above information combination. For example, the "information combination" can also be referred to as a "data frame" or a "data unit", etc.

[0093] S302. The sending device 101 encodes each data packet in the data to be transmitted to obtain the corresponding check packet for each data packet.

[0094] Among them, a frame of check packets may include r check blocks.

[0095] Taking the calculation of the check packet corresponding to the jth frame of data packet as an example, where j is a positive integer, S302 may specifically include:

[0096] S3021. The sending device 101 obtains the jth frame of data packet.

[0097] Among them, the jth frame of data packet may include k data blocks x j,1 , x j,2 ,..., x j,k .

[0098] S3022. The sending device 101 determines the jth frame of check packet according to the jth frame of data packet.

[0099] Among them, the jth frame of check packet may include r check blocks x j,k+1 , x j,k+2 ,..., x j,n . Where n = j + k.

[0100] Among them, the jth frame of data packet and the jth frame of check packet, and the (j - 1)th frame of data packet and the (j - 1)th frame of check packet (where the (j - 1)th frame of data packet and the (j - 1)th frame of check packet are represented as x j-1,1 , x j-1,2 ,..., x j-1,n ) satisfy the following formula (7):

[0101]

[0102] Among them, A is the check matrix of the jth frame of data packet.

[0103] In one implementation, two check matrices A1 and A2 can be preset. Among them, A1 and A2 can be respectively any r×n check matrices based on a finite field and full rank, and A2 is different from A1. The specific forms of A1 and A1 can be set according to actual needs. For example, A1 can be composed of the transpose matrix of a Vandermonde matrix. Exemplarily, A1 can be A2 can be where a1, a2,..., a n are n distinct non - zero elements in the finite field GF(q). For another example, A2 and A1 can be composed of Cauchy matrices respectively.

[0104] Among them, when the sending device 101 calculates the check packets corresponding to each frame data packet in turn, it can alternately use one of A1 and A2 for encoding. For example, when determining the j - th frame check packet corresponding to the j - th frame data packet, it can use the frame sequence number of the data packet (i.e., j) and the result of the modulo operation with 2 (i.e., the result of j mod 2) to determine to select one of A1 and A2 for calculation.

[0105] For example, when j is odd, the j - th frame data packet and the j - th frame check packet, as well as the (j - 1)-th frame data packet and the (j - 1)-th frame check packet satisfy the following formula (8).

[0106]

[0107] Among them, when j is odd, after substituting the j - th frame data packet, and the (j - 1)-th frame data packet and the (j - 1)-th frame check packet into formula (8), the j - th frame check packet can be calculated.

[0108] In addition, when j is 1, that is, when there is no data packet before the j - th frame data packet, the (j - 1)-th frame data packet and the (j - 1)-th frame check packet can be set to "0" so as to calculate the 1 - st frame check packet using formula (8).

[0109] When j is even, the j - th frame data packet and the j - th frame check packet, as well as the (j - 1)-th frame data packet and the (j - 1)-th frame check packet satisfy the following formula (9).

[0110]

[0111] Among them, when j is even, after substituting the j - th frame data packet, and the (j - 1)-th frame data packet and the (j - 1)-th frame check packet into formula (9), the j - th frame check packet can be calculated.

[0112] In addition, it should be noted that in the above S3022, two pre - set check matrices A1 and A2 are used and one of the two check matrices is selected according to the result of the modulo operation of j and 2 to determine the j - th frame check packet. In the actual application process, more check matrices (for example, 3 or more check matrices) can also be pre - set, and then one of the more check matrices can be selected to determine the j - th frame check packet. As long as the check matrix corresponding to the j - th frame data packet is different from the check matrix corresponding to the adjacent frame data packet. In this regard, the embodiments of the present application may not be limited.

[0113] S303. The sending device 101 sends the multiple frames of data packets and the check packets obtained through the above S302 to the receiving device 102.

[0114] Among them, the process of the sending device 101 sending the multiple frames of data packets and the check packets obtained through the above S302 to the receiving device 102 can refer to the related technology and will not be elaborated here.

[0115] S304. The receiving device 102 decodes the received data packets and check packets.

[0116] Taking the example that there are w lost packets in the i-th frame of data packets in multiple information combinations, the process of decoding the i-th frame of data packets at this time includes:

[0117] S3041. The receiving device 102 obtains the i-th frame of data packets and the i-th frame of check packets.

[0118] It should be noted that in the embodiments of the present application, for the convenience of description, the lost information blocks in the information combination are simply referred to as "lost packets". In actual application processes, other names can also be used to represent the lost information blocks in the information combination, such as "lost data" or "information blocks to be recovered", etc., and there is no limitation in the embodiments of the present application.

[0119] S3042. The receiving device 102 restores the i-th frame of complete data packets according to the i-th frame of data packets and the i-th frame of check packets.

[0120] It should be noted that for the convenience of understanding in the embodiments of the present application, the restored data packets are called complete data packets.

[0121] Among them, when i is odd or even, one of the following two aspects is respectively adopted to recover the lost packets in the i-th frame of data packets:

[0122] On the one hand, when i is odd, it can be obtained from the encoding process of S3022:

[0123] The i-th frame of complete data packets and the i-th frame of check packets (denoted as x i,1 ,...,x i,k ,...,x i,n ) and the (i - 1)-th frame of complete data packets and the (i - 1)-th frame of check packets (denoted as x i-1,1 ,...,x i-1,k ,...,x i-1,n ) satisfy the following formula (10):

[0124]

[0125] That is to say, based on the above formula (10), when the complete packet of the (i - 1)-th frame and the check packet of the (i - 1)-th frame are known, and the number of lost packets in the complete packet of the i-th frame and the check packet of the i-th frame is less than r (i.e., w < r), the lost packets in the complete packet of the i-th frame can be determined according to the packets of the i-th frame, the check packet of the i-th frame, the complete packet of the (i - 1)-th frame, and the check packet of the (i - 1)-th frame.

[0126] And the complete packet of the i-th frame and the check packet of the i-th frame (denoted as x i,1 ,..., x i,k ,..., x i,n ) and the complete packet of the (i + 1)-th frame and the check packet of the (i - 1)-th frame (denoted as x i+1,1 ,..., x i+1,k ,..., x i+1,n ) satisfy the following formula (11):

[0127]

[0128] That is to say, based on the above formula (11), when the complete packet of the (i + 1)-th frame and the check packet of the (i + 1)-th frame are known, and the number of lost packets in the complete packet of the i-th frame and the check packet of the i-th frame is less than r (i.e., w < r), the lost packets in the complete packet of the i-th frame can be determined according to the packets of the i-th frame, the check packet of the i-th frame, the complete packet of the (i + 1)-th frame, and the check packet of the (i + 1)-th frame.

[0129] In addition, when the number of lost packets in the complete packet of the i-th frame and the check packet of the i-th frame is greater than r (i.e., w > r), the above formula (10) and formula (11) can also be combined. Thus, according to the packets of the i-th frame, the check packet of the i-th frame, the complete packet of the (i - 1)-th frame, the check packet of the (i - 1)-th frame, the complete packet of the (i + 1)-th frame, and the check packet of the (i + 1)-th frame, the lost packets in the complete packet of the i-th frame and the check packet of the i-th frame can be determined. At this time, up to 2r lost packets in the complete packet of the i-th frame and the check packet of the i-th frame can be recovered (the number of lost packets that can be recovered at this time is related to the rank of the matrix obtained by splicing A1 and A2).

[0130] On the other hand, when i is an even number, from the encoding process of S302, it can be obtained that: the complete packet of the i-th frame and the check packet of the i-th frame (denoted as x i,1 ,..., x i,k ,..., x i,n ) and the complete packet of the (i - 1)-th frame and the check packet of the (i - 1)-th frame (denoted as x i-1,1 ,..., x i-1,k ,..., x i-1,n ) satisfy the following formula (12):

[0131]

[0132] That is to say, based on the above formula (12), when the complete data packet of the (i - 1)-th frame and the check packet of the (i - 1)-th frame are known, and the number of lost packets in the complete data packet of the i-th frame and the check packet of the i-th frame is less than r (i.e., w < r), the lost packets in the complete data packet of the i-th frame can be determined according to the data packet and check packet of the i-th frame, and the complete data packet and check packet of the (i - 1)-th frame.

[0133] And the complete data packet of the i-th frame and the check packet of the i-th frame (denoted as x i,1 ,..., x i,k ,..., x i,n ) and the complete data packet of the (i + 1)-th frame and the check packet of the (i - 1)-th frame (denoted as x i+1,1 ,..., x i+1,k ,..., x i+1,n ) satisfy the following formula (13):

[0134]

[0135] That is to say, based on the above formula (11), when the complete data packet of the (i + 1)-th frame and the check packet of the (i + 1)-th frame are known, and the number of lost packets in the complete data packet of the i-th frame and the check packet of the i-th frame is less than r (i.e., w < r), the lost packets in the complete data packet of the i-th frame can be determined according to the data packet and check packet of the i-th frame, and the complete data packet and check packet of the (i + 1)-th frame.

[0136] In addition, when the number of lost packets in the complete data packet of the i-th frame and the check packet of the i-th frame is greater than r (i.e., w > r), the above formula (12) and formula (13) can also be combined. Thus, according to the data packet and check packet of the i-th frame, the complete data packet and check packet of the (i - 1)-th frame, and the complete data packet and check packet of the (i + 1)-th frame, the lost packets in the complete data packet of the i-th frame and the check packet of the i-th frame can be determined. At this time, at most 2r lost packets in the complete data packet of the i-th frame and the check packet of the i-th frame can be recovered (the number of lost packets that can be recovered at this time is related to the rank of the matrix obtained by splicing A1 and A2).

[0137] In one implementation, during the encoding process of the above S3022, the check matrices A1 and A2 may include the same sub-matrix (hereinafter referred to as the "preset sub-matrix") so that the check matrices A1 and A2 are respectively composed of the preset sub-matrix and other matrices spliced together.

[0138] For the convenience of description below, the preset sub-matrix included in both A1 and A2 is called A0; in addition, A1 is composed of the preset sub-matrix A0 and the matrix A1' spliced together, that is, A1 can be expressed as A2 is composed of the preset sub-matrix A0 and the matrix A2' spliced together, that is, A2 can be expressed as

[0139] Then the process of determining the j-th frame check packet in the above S3022 may include:

[0140] On the one hand, when j is odd, the above formula (8) can be expressed as the following formula (14):

[0141]

[0142] Among them, A0 and A1' can be any matrices based on a finite field and full rank, and the number of columns of both A0 and A1' is n, and the sum of the number of rows of A0 and A1' is r. For ease of description hereinafter, the number of rows of A1' is denoted as r', then the number of rows of A0 can be expressed as r - r'. Among them, the specific forms of A0 and A1' can be set according to actual needs.

[0143] Exemplarily, when A0 is A1' can be

[0144] Furthermore, when j is odd, the above formula (8) can be expressed as the following formula (15):

[0145]

[0146] On the other hand, when j is even, the above formula (9) can be expressed as the following formula (16):

[0147]

[0148] Among them, the content of A0 refers to the above formula (14). In addition, similar to A1': A2' can be any matrix based on a finite field and full rank, and the number of columns of A2' is n, the number of rows of A2' is denoted as r', and the specific form of A2' can be set according to actual needs.

[0149] Exemplarily, when A0 is A1' is A2' can be expressed as

[0150] Furthermore, when j is even, the above formula (9) can be expressed as the following formula (17):

[0151]

[0152] That is to say, in the process of determining the j-th frame check packet in S3022 above, the j-th frame check packet can be calculated using the above formula (14) or formula (16) according to whether j is odd or even. In this way, since whether j is odd or even, the j-th frame data packet and the j-th frame check packet both satisfy the following formula (18):

[0153]

[0154] In this way, in the process of decoding the j-th frame data packet and the j-th frame check packet, when the number of lost packets in the j-th frame data packet and the j-th frame check packet does not exceed r - r', whether j is odd or even, the following formula (19) can be used to determine the complete j-th frame data packet:

[0155]

[0156] Among them, the derivation process of formula (19) is as follows: When j is 1, that is, when there is no data packet before the j-th frame data packet, in the case of setting each information block in the (j - 1)-th frame data packet and the (j - 1)-th frame check packet to "0", it can be known that formula (20):

[0157]

[0158] That is

[0159] Also, from formula (18), the following formula (21) can be known:

[0160]

[0161] Combining formula (20) and formula (21), it can be known that:

[0162]

[0163] And so on, it can be known that: Whether j is odd or even, formula (19) is satisfied. Therefore, in the process of decoding the j-th frame data packet and the j-th frame check packet, when the number of lost packets in the j-th frame data packet and the j-th frame check packet does not exceed r', whether j is odd or even, formula (19) can be used to determine the complete j-th frame data packet.

[0164] Next, taking A0 as A1' as A2' as as an example, the process of decoding the i-th frame data packet and the i-th frame check packet in S3042 is introduced.

[0165] Specifically, the process of decoding the i-th frame data packet and the i-th frame check packet in S3042 can be divided into three cases:

[0166] Case 1: When the number of lost packets w in the i-th frame data packet and the i-th frame check packet does not exceed r - r', regardless of whether i is odd or even, the complete i-th frame data packet can be determined using the following formula (22):

[0167]

[0168] Case 2: The number of lost packets w in the i-th frame data packet and the i-th frame check packet exceeds r - r' but does not exceed r.

[0169] On the one hand, when i is odd, the complete i-th frame data packet can be determined using the following formula (23) or formula (24):

[0170]

[0171]

[0172] Among them, considering that when decoding the i-th frame data packet and the i-th frame check packet using formula (24), it is necessary to wait for the i + 1-th frame data packet and the i + 1-th frame check packet to be received and decoded before the i-th frame data packet and the i-th frame check packet can be decoded, which may increase the decoding delay. Therefore, it is possible to preferentially use formula (23) to decode the i-th frame data packet and the i-th frame check packet.

[0173] On the other hand, when i is even, the complete i-th frame data packet can be determined using the following formula (25) or formula (26):

[0174]

[0175]

[0176] Among them, considering that when decoding the i-th frame data packet and the i-th frame check packet using formula (25), it is necessary to wait for the i + 1-th frame data packet and the i + 1-th frame check packet to be received and decoded before the i-th frame data packet and the i-th frame check packet can be decoded, which may increase the decoding delay. Therefore, it is possible to preferentially use formula (25) to decode the i-th frame data packet and the i-th frame check packet.

[0177] Case 3: The number of lost packets w in the i-th frame data packet and the i-th frame check packet exceeds r but does not exceed r + r'.

[0178] On the one hand, when i is odd, the complete i-th frame data packet can be determined using the following formula (27):

[0179]

[0180] Among them, 0 r-r'is a column vector of all 0s with length r - r'.

[0181] On the other hand, when i is even, the complete data packet of the i-th frame can be determined using the following formula (288):

[0182]

[0183] where 0 r' is a column vector of all 0s with length r - r'.

[0184] The following combines examples to introduce the process of encoding using the above formulas (15) and (17) and decoding using formulas (22) - (27):

[0185] Take an example where one data packet frame includes 3 data blocks and one parity packet frame includes 2 parity blocks. Additionally, assume that the elements a1, a2,..., a n in the parity-check matrix used for encoding are values in the finite field GF(7), where a m = m - 1, 1 ≤ m ≤ 5.

[0186] In addition, the information blocks to be transmitted include: 0, 1, 2, 3, 4, 5, 2, 4, 6. Then the data to be transmitted can be divided into 3 data packet frames: the 3 data blocks in the first data packet frame: 0, 1, 2; the 3 data blocks in the second data packet frame: 3, 4, 5; the 3 data blocks in the third data packet frame: 2, 4, 6.

[0187] The encoding process is as follows:

[0188] From formula (15), it can be known that the parity blocks x 1,3 and x 1,4 in the first parity packet satisfy the following formula (29):

[0189]

[0190] Solving formula (29) shows that: x 1,3 = 6, x 1,4 = 2.

[0191] In addition, from formula (16), it can be known that the parity blocks x 2,3 and x 2,4 in the second parity packet satisfy the following formula (30):

[0192]

[0193] Solving formula (30) shows that: x 2,3 = 2, x 2,4 = 3.

[0194] In addition, as can be seen from formula (15), the check blocks x 3,3 and x 3,4 in the third frame check packet satisfy the following formula (31):

[0195]

[0196] Solving formula (31) shows that: x 3,3 = 3, x 3,4 = 6.

[0197] That is to say, the three information combinations sent by the sending device are: 0, 1, 2, 6, 2; 3, 4, 5, 2, 3; 3, 4, 5, 3, 6.

[0198] After that, after the receiving device receives three frames of data packets and check packets, if all 3 data blocks in the first frame of data packet are lost (the received first frame of data packet and check packet can be expressed as x 1,0 , x 1,1 , x 1,2 , 6, 2), and the first data block in the second frame of data packet is also lost (that is, the received second frame of data packet and check packet are x 2,0 , 4, 5, 2, 3).

[0199] Then the decoding process of each frame of data packet and check packet is as follows:

[0200] On the one hand, as can be seen from formula (22): Furthermore, the first data block x 2,0 = 3 in the second frame of data packet is restored. On the other hand, the 3 data blocks in the first frame of data packet can be restored from formula (30): 0, 1, 2.

[0201] In the above embodiments, the method provided in the embodiments of the present application is mainly introduced by taking two frames of data packets and check packets satisfying the above formula (1) as an example. In actual application, more frames of data packets and check packets can also satisfy the above formula (1). Next, taking three frames of data packets and check packets satisfying the above formula (1) as an example, the method provided in the embodiments of the present application is introduced. As Figure 4 shown, the method may include:

[0202] S401. The sending device 101 waits to transmit data.

[0203] Among them, the data to be transmitted may include one or more frames of data packets.

[0204] S402. The sending device 101 encodes each data packet in the data to be transmitted to obtain a check packet corresponding to each data packet.

[0205] Among them, one frame of check packet may include r check blocks.

[0206] Taking the calculation of the check packet corresponding to the j-th frame data packet as an example, where j is a positive integer, S402 may specifically include:

[0207] S4021. The sending device 101 obtains the j-th frame data packet.

[0208] Among them, the j-th frame data packet may include k data blocks x j,1 , x j,2 ,..., x j,k .

[0209] S4022. The sending device 101 determines the j-th frame check packet according to the j-th frame data packet.

[0210] Among them, the j-th frame check packet may include r check blocks x j,k+1 , x j,k+2 ,..., x j,n . Where n = j + k.

[0211] Among them, the j-th frame data packet and the j-th frame check packet, the j - 1-th frame data packet and the j - 1-th frame check packet (where the j - 1-th frame data packet and the j - 1-th frame check packet are represented as x j-1,1 , x j-1,2 ,..., x j-1,n ) and the j - 2-th frame data packet and the j - 2-th frame check packet (where the j - 2-th frame data packet and the j - 2-th frame check packet are represented as x j-2,1 , x j-2,2 ,..., x j-2,n ), satisfy the following formula (32):

[0212]

[0213] Among them, A is the check matrix of the j-th frame data packet.

[0214] In one implementation, three check matrices A1, A2, and A3 may be preset. Among them, A1, A2, and A3 may be respectively any r×n check matrices based on a finite field and full rank, and A1, A2, and A3 are different. Among them, the specific forms of A1, A2, and A3 may be set according to actual needs. For example, A1, A2, and A3 may be composed of the transposed matrices of Vandermonde matrices. For another example, A1, A2, and A3 may be respectively composed of Cauchy matrices.

[0215] Among them, when the sending device 101 calculates the check packets corresponding to each frame of data packets in sequence, it can alternately use one of A1, A2, and A3 for encoding. For example, when determining the j-th frame check packet corresponding to the j-th frame of data packet, it can use the frame sequence number of the data packet (i.e., j) and the modulo operation result of 3 (i.e., the result of j mod 3) to determine to select one of A1, A2, and A3 for calculation.

[0216] For example, when the result of j mod 3 is 1, the j-th frame data packet and the j-th frame check packet, the (j - 1)-th frame data packet and the (j - 1)-th frame check packet, and the (j - 2)-th frame data packet and the (j - 2)-th frame check packet satisfy the following formula (33). When the result of j mod 3 is 2, then the j-th frame data packet and the j-th frame check packet, the (j - 1)-th frame data packet and the (j - 1)-th frame check packet, and the (j - 2)-th frame data packet and the (j - 2)-th frame check packet satisfy the following formula (34). When the result of j mod 3 is 0, then the j-th frame data packet and the j-th frame check packet, the (j - 1)-th frame data packet and the (j - 1)-th frame check packet, and the (j - 2)-th frame data packet and the (j - 2)-th frame check packet satisfy the following formula (35):

[0217]

[0218]

[0219]

[0220] In addition, when j is 1, that is, there is no information combination before the j-th information combination, the information blocks in the (j - 1)-th information combination and the (j - 2)-th information combination can be set to "0" so as to calculate the r check blocks in the first information combination using formula (6).

[0221] S403. The sending device 101 sends the multi-frame data packets and check packets obtained through the above S402 to the receiving device 102.

[0222] S404. The receiving device 102 decodes the received multi-frame data packets and check packets.

[0223] Taking the example that there are w lost packets in the i-th frame data packet among multiple information combinations, the process of decoding the i-th frame data packet at this time includes:

[0224] S4041. The receiving device 102 obtains the i-th frame data packet and the i-th frame check packet.

[0225] S4042. The receiving device 102 restores the complete i-th frame data packet according to the i-th frame data packet and the i-th frame check packet.

[0226] According to the result of i modulo 3, one of the following three methods can be used to recover the packet loss in the i-th frame:

[0227] First, when the result of i modulo 3 is 1, then:

[0228] From the above formula (33), it can be obtained that the data packet of the i-th frame and the check packet of the i-th frame, the data packet of the i-1-th frame and the check packet of the i-1-th frame, and the data packet of the i-2-th frame and the check packet of the i-2-th frame satisfy the following formula (36):

[0229]

[0230] From the above formula (34), it can be obtained that the data packet of the i-th frame and the check packet of the i-th frame, the data packet of the i-1-th frame and the check packet of the i-1-th frame, and the data packet of the i-2-th frame and the check packet of the i-2-th frame satisfy the following formula (37):

[0231]

[0232] From the above formula (35), it can be obtained that the data packet of the i-th frame and the check packet of the i-th frame, the data packet of the i-1-th frame and the check packet of the i-1-th frame, and the data packet of the i-2-th frame and the check packet of the i-2-th frame satisfy the following formula (38):

[0233]

[0234] It can be understood that according to one or more of the above formulas (36) to (38), as well as the i-2th frame data packet and the i-2th frame check packet to the i+2th frame data packet and the i+2th frame check packet, the lost packets in the i-th frame data packet and the i-th frame check packet can be recovered. At this time, at most 3r lost packets in the i-th frame data packet and the i-th frame check packet can be recovered (the number of lost packets that can be recovered at this time is related to the rank of the matrix obtained by splicing A1, A2, and A3).

[0235] In one implementation, during the encoding process of S4022 above, the check matrices A1, A2, and A3 may include the same submatrix (hereinafter referred to as the "preset submatrix"), so that the check matrices A1, A2, and A3 are respectively composed of the preset submatrix and other matrices.

[0236] For ease of description, the preset submatrix included in A1, A2, and A3 is referred to as A0. In addition, A1 is composed of the preset submatrix A0 and the matrix A1', that is, A1 can be expressed as A2 is composed of the preset sub-matrix A0 and the matrix A2', that is, A1 can be expressed as A3 is composed of the preset sub-matrix A0 and the matrix A3', that is, A3 can be expressed as Among them, A0, A1', A2' and A3' can be any matrices based on a finite field and with full rank, and the number of columns of A0, A1', A2' and A3' is all n. The number of rows of A0 is denoted as r', and the number of rows of A1', A2' and A3' is denoted as r - r'.

[0237] Then the process of determining the j-th frame check packet in S4022 above may include:

[0238] On the one hand, when the result of j modulo 3 is 1 (i.e., j mod 3 = 1), the j-th frame data packet and the j-th frame check packet, the (j - 1)-th frame data packet and the (j - 1)-th frame check packet, and the (j - 2)-th frame data packet and the (j - 2)-th frame check packet satisfy the following formula (39):

[0239]

[0240] On the other hand, when the result of j modulo 3 is 2 (i.e., j mod 3 = 2), the j-th frame data packet and the j-th frame check packet, the (j - 1)-th frame data packet and the (j - 1)-th frame check packet, and the (j - 2)-th frame data packet and the (j - 2)-th frame check packet satisfy the following formula (40):

[0241]

[0242] On yet another hand, when the result of j modulo 3 is 0 (i.e., j mod 3 = 0), the j-th frame data packet and the j-th frame check packet, the (j - 1)-th frame data packet and the (j - 1)-th frame check packet, and the (j - 2)-th frame data packet and the (j - 2)-th frame check packet satisfy the following formula (41):

[0243]

[0244] From the same reasoning of the derivation process of formula (19), it can be known that in the process of decoding the j-th frame data packet and the j-th frame check packet, when the number of lost packets in the j-th frame data packet and the j-th frame check packet does not exceed r', regardless of the result of j modulo 3, the following formula (42) can be used to determine the complete j-th frame data packet:

[0245]

[0246] Next, in combination with the encoding process according to formula (39) - formula (41), the decoding process of the i-th frame data packet and the i-th frame check packet will be introduced. The decoding process of the i-th frame data packet and the i-th frame check packet can be divided into the following 4 cases:

[0247] Case 1: When the number of lost packets w in the i-th frame data packet and the i-th frame check packet does not exceed r', regardless of the result of j modulo 3, the following formula (43) can be used to determine the complete i-th frame data packet:

[0248]

[0249] Case 2: When the number of lost packets w in the i-th frame data packet and the i-th frame check packet exceeds r' but does not exceed r, and the i - 2-th frame data packet and the i - 2-th frame check packet, and the i - 1-th frame data packet and the i - 1-th frame check packet have been successfully decoded. Then, determine one of the formulas (39) - (41) according to the result of i modulo 3, and use the i - 2-th frame data packet and the i - 2-th frame check packet, and the i - 1-th frame data packet and the i - 1-th frame check packet to recover the complete i-th frame data packet.

[0250] Case 3: When the number of lost packets w in the i-th frame data packet and the i-th frame check packet exceeds r but does not exceed 2r - r', and the i - 2-th frame data packet and the i - 2-th frame check packet, the i - 1-th frame data packet and the i - 1-th frame check packet, and the i + 1-th frame data packet and the i + 1-th frame check packet have been successfully decoded. Then, according to the different results of i modulo 3, use the following formulas (44) - (46) respectively to recover the complete i-th frame data packet.

[0251] When the result of i modulo 3 is 1, the following formula (44) can be used respectively to recover the complete i-th frame data packet:

[0252]

[0253] When the result of i modulo 3 is 2, the following formula (45) can be used respectively to recover the complete i-th frame data packet:

[0254]

[0255] When the result of i modulo 3 is 3, the following formula (46) can be used respectively to recover the complete i-th frame data packet:

[0256]

[0257] Case 4: When the number of lost packets w in the i-th frame data packet and the i-th frame check packet exceeds 2r - r' but does not exceed 3r - 2r', and the i - 2-th frame data packet and the i - 2-th frame check packet, the i - 1-th frame data packet and the i - 1-th frame check packet, the i + 1-th frame data packet and the i + 1-th frame check packet, and the i + 2-th frame data packet and the i + 2-th frame check packet have been successfully decoded. Then, according to the different results of i modulo 3, use the following formulas (47) - (49) respectively to recover the complete i-th frame data packet.

[0258] When the result of i modulo 3 is 1, the following formula (47) can be used to recover the complete i-th frame data packet:

[0259]

[0260] When the result of i modulo 3 is 2, the following formula (48) can be used to recover the complete data packet of the i-th frame:

[0261]

[0262] When the result of i modulo 3 is 0, the following formula (49) can be used to recover the complete data packet of the i-th frame:

[0263]

[0264] In the processes of the above S301 - S304 and S401 - S404, the working processes of the sending device 101 and the receiving device 102 are respectively introduced when two frames of data packets and check packets satisfy the above formula (1) and when three frames of data packets and check packets satisfy the above formula (1). In actual application processes, more frames of data packets and check packets can also satisfy the above formula (1).

[0265] Next, taking the case where t + 1 frames of data packets and check packets satisfy the above formula (1) (where t is a positive integer) as an example, the encoding process of the sending device 101 will be introduced. As Figure 5 shown, the method may include:

[0266] S501. The sending device 201 obtains a data packet (hereinafter referred to as data packet a).

[0267] For example, when t = 1 (that is, when two frames of data packets and check packets satisfy the above formula (1)), data packet a may be the j-th data packet in S3021.

[0268] For another example, when t = 2 (that is, when three frames of data packets and check packets satisfy the above formula (1)), data packet a may be the j-th data packet in S4021.

[0269] S502. The sending device 201 obtains a check packet (hereinafter referred to as check packet b) according to data packet a.

[0270] Among them, data packet a and check packet b satisfy formula (1):

[0271] A × B = 0 Formula (1)

[0272] Among them, A is the check matrix of data packet a, the elements in B are obtained based on check packet b, data packet a, the data packets before data packet a, and the check packets of the data packets before data packet a, and A is different from the check matrix of the data packet adjacent to data packet a.

[0273] In one implementation, the above data packet a is the j-th frame data packet, the check packet b is the j-th frame check packet, the data packets before the data packet a are the data packets of the (j - t)-th frame to the (j - 1)-th frame, and the check packets of the data packets before the data packet a are the check packets of the (j - t)-th frame to the (j - 1)-th frame. Here, j and t are positive integers, j > t, and B satisfies:

[0274] B = (concat(a j , b j ) + concat(a j-1 , b j-1 ) +... + concat(a j-t , b j-t )) Formula (50)

[0275] Where a j is the j-th frame data packet, b j is the j-th frame check packet, and concat() is a merging function.

[0276] For example, when t = 1, the above formula (1) can be the formula (7) in S3022, and formula (50) can be expressed as the following formula (51). The implementation process of S502 can refer to the content of the above S3022.

[0277]

[0278] For another example, when t = 2, the above formula (1) can be the formula (32) in S4022, and formula (50) can be expressed as the following formula (52). The implementation process of S502 can refer to the content of the above S4022.

[0279]

[0280] In one implementation, the t + 1 check matrices of the t + 1 data packets from the (j - t)-th frame to the j-th frame are different. The check matrix of the j-th frame data packet is the check matrix corresponding to the result of the modulo operation of j and t + 1, and there is a preset corresponding relationship between the check matrix and the modulo operation result.

[0281] For example, when implementing S502 according to the process of the above S3022, as shown in formulas (14) - (16), the check matrices A1 and A2 can both include the preset sub-matrix A0.

[0282] For another example, when implementing S502 according to the process of the above S4022, as shown in formulas (39) - (41), the check matrices A1, A2, and A0 can all include the preset sub-matrix A0.

[0283] Corresponding to the encoding process of the above S501 - S502, the decoding process of the receiving device 202 is as Figure 6As shown, it may include:

[0284] S601. The receiving device 202 receives a data packet and a check packet.

[0285] For example, when t = 1, the implementation process of S601 may refer to the content of S3041 above.

[0286] For example, when t = 2, the implementation process of S601 may refer to the content of S4041 above.

[0287] S602. The receiving device 202 restores the complete data packet according to the received data packet and check packet.

[0288] Among them, the complete data packet and the check packet satisfy the following formula:

[0289] C×D = 0 Formula (53)

[0290] Among them, C is the check matrix of the complete data packet; the elements in D are obtained based on the check packet, the complete data packet, the p-frame data packets before and / or after the complete data packet, and the check packets of the p-frame data packets before and / or after the complete data packet. C is different from the check matrix of the data packet adjacent to the complete data packet, and p is a positive integer.

[0291] In one implementation, any one of the complete data packet and the p-frame data packets before and / or after the complete data packet is the first data packet. The check packet of the first data packet is the first check packet, and the first check packet and the first data packet satisfy the following formula (1):

[0292] A×B = 0 Formula (1)

[0293] Among them, A is the check matrix of the first data packet, the elements in B are obtained based on the first check packet, the first data packet, the t-frame data packets before the first data packet, and the t-frame check packets before the first check packet. A is different from the target matrix, and the target matrix is the check matrix of the data packet adjacent to the first data packet. t is a positive integer, and t ≤ p.

[0294] In one implementation, the p-frame data packets before and / or after the complete data packet include: the p-frame data packets before the complete data packet, the p-frame data packets after the complete data packet, or the p-frame data packets before and after the complete data packet. The complete check packet is the j-th frame check packet, the data packets before the complete data packet are the data packets from the (j - p)-th frame to the (j - 1)-th frame, the data packets of the p frames after the complete data packet are the data packets from the (j + 1)-th frame to the (j + p)-th frame, and the p-frame data packets before and after the complete data packet are the union of the data packets from the (j - m)-th frame to the (j - 1)-th frame and the data packets from the (j + 1)-th frame to the (j + n)-th frame, where n + m = p.

[0295] For example, when t=1, the implementation process of S602 may refer to the content of S3042 above.

[0296] For another example, when t=2, the implementation process of S602 may refer to the content of S4042 above.

[0297] It is understandable that the above Figures 3 - 6 The steps of encoding (ie, S302, S402, and S501-S502) and decoding (ie, S304, S404, and S601-S602) in the process shown can also be applied in other scenarios. Figure 2 In the data access scenario shown, the storage system 20 may encode data according to the above contents of S302, S402 or S501-S502, and decode data according to the above contents of S304, S404 or S601-S602.

[0298] It is understood that in order to implement the above embodiments, the device for performing the above encoding and decoding process includes hardware structures and / or software modules corresponding to the execution of each function. It should be readily apparent to those skilled in the art that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a manner driven by computer software depends on the specific application scenario and design constraints of the technical solution.

[0299] like Figure 7 The figure shows a schematic diagram of the structure of an encoding device provided by this application.

[0300] Specifically, the encoding device 70 can be used to implement the above Figures 3 - 5 The functions of the steps executed by the sending device 101 are described.

[0301] like Figure 7 As shown, the encoding device 70 includes: an acquisition unit 701 and a processing unit 702.

[0302] The acquiring unit 701 is configured to acquire a data packet.

[0303] The processing unit 702 is configured to obtain a verification packet according to the data packet, where the verification packet and the data packet satisfy the following formula:

[0304] A×B=0

[0305] Among them, A is the check matrix of the data packet, and the elements in B are obtained based on the check packet, the data packet, the data packet before the data packet, and the check packet of the data packet before the data packet. The check matrix of the data packet adjacent to A is different.

[0306] In one implementation, the above data packet a is the j-th frame data packet, the check packet b is the j-th frame check packet, the data packets before the data packet a are the data packets of the (j - t)-th frame to the (j - 1)-th frame, and the check packets of the data packets before the data packet a are the check packets of the (j - t)-th frame to the (j - 1)-th frame. j and t are positive integers, j > t, and B satisfies:

[0307] B = (concat(a j , b j ) + concat(a j-1 , b j-1 ) +... + concat(a j-t , b j-t ))

[0308] Wherein, a j is the j-th frame data packet, b j is the j-th frame check packet, and concat() is a merging function.

[0309] In one implementation, the t + 1 check matrices of the t + 1 data packets from the (j - t)-th frame to the j-th frame are different, and the check matrix of the j-th frame data packet is the check matrix corresponding to the result of the modulo operation of j with respect to t + 1. There is a preset correspondence between the check matrix and the modulo operation result.

[0310] In one implementation, different check matrices include the same preset sub-matrix.

[0311] As Figure 8 shown, it is a schematic structural diagram of a decoding device provided by the present application.

[0312] Specifically, the decoding device 80 can be used to implement the functions of each step performed by the above-mentioned Figures 3 - 5 receiving device 102.

[0313] As Figure 8 shown, the decoding device 80 includes: a receiving unit 801 and a processing unit 802. Wherein:

[0314] The receiving unit 801 is configured to receive data packets and check packets.

[0315] The processing unit 802 is configured to recover a complete data packet according to the received data packet and check packet. Wherein, the complete data packet and the check packet satisfy the following formula:

[0316] C × D = 0

[0317] Wherein, C is the check matrix of the complete data packet; the elements in D are obtained based on the check packet, the complete data packet, the p-frame data packets before and / or after the complete data packet, and the check packets of the p-frame data packets before and / or after the complete data packet. C is different from the check matrix of the data packet adjacent to the complete data packet, and p is a positive integer.

[0318] In one implementation, any one of the complete data packet and the p-frame data packets before and / or after the complete data packet is the first data packet. The check packet of the first data packet is the first check packet, and the first check packet and the first data packet satisfy the following formula: A×B = 0. Wherein, A is the check matrix of the first data packet, and the elements in B are obtained based on the first check packet, the first data packet, the t-frame data packets before the first data packet, and the t-frame check packets before the first check packet. A is different from the target matrix, and the target matrix is the check matrix of the data packet adjacent to the first data packet. t is a positive integer, and t ≤ p.

[0319] In one implementation, the p-frame data packets before and / or after the complete data packet include: the p-frame data packets before the complete data packet, the p-frame data packets after the complete data packet, or the p-frame data packets before and after the complete data packet. The complete check packet is the j-th frame check packet, the data packets before the complete data packet are the data packets from the (j - p)-th frame to the (j - 1)-th frame, the data packets of the p frames after the complete data packet are the data packets from the (j + 1)-th frame to the (j + p)-th frame, and the p-frame data packets before and after the complete data packet are the union of the data packets from the (j - m)-th frame to the (j - 1)-th frame and the data packets from the (j + 1)-th frame to the (j + n)-th frame, where n + m = p.

[0320] In one implementation, the check matrices of the p-frame data packets before and / or after the complete data packet are different. The check matrix of the complete data packet is the check matrix corresponding to the result of the modulo operation of j and t + 1, and there is a preset correspondence between the check matrix and the modulo operation result.

[0321] In one implementation, different check matrices include the same preset submatrix.

[0322] Figure 9 The figure shows a schematic structural diagram of a data processing device provided in this embodiment. The data processing device 90 may be a chip or a system-on-chip. Additionally, the data processing device 90 may include all or part of the hardware in devices such as switches, routers, virtual switches, desktop computers, tablet computers, desktops, laptops, handheld computers, notebooks, ultra-mobile personal computers, netbooks, and cellular phones, personal digital assistants, augmented reality / virtual reality devices, etc. that can perform RS encoding and decoding.

[0323] Wherein, the data processing device 90 may include some or all of the components such as a processor 901, a communication line 902, a memory 903, and at least one communication interface 904.

[0324] Among them, the processor 901 is used to execute the functions of each step performed by the above-mentioned Figures 3 - 5 transmitting device 201 described. Alternatively, the processor 901 is used to execute the above-mentioned Figure 3 , Figure 4 or Figure 6 functions of each step performed by the receiving device 201 described.

[0325] Specifically, the processor 901 may include a general-purpose central processing unit (CPU), and the processor 901 may also include a microprocessor, a Field Programmable Gate Array (FPGA), a digital signal processor (DSP), or an application-specific integrated circuit (ASIC), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0326] In a specific implementation, as an embodiment, the processor 901 may include one or more CPUs, such as Figure 9 CPU0 and CPU1 in

[0327] In a specific implementation, as an embodiment, the device 90 may include multiple processors, such as Figure 8 processor 901 and processor 906 in

[0328] In addition, the memory 903 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 903 can exist independently and be connected to the processor 901 through the communication line 902. The memory 903 can also be integrated with the processor 901.

[0329] Among them, the memory 903 stores computer instructions. The processor 901 can execute all or part of the steps in the method provided in this embodiment by executing the computer instructions stored in the memory 903.

[0330] Optionally, the computer-executable instructions in this embodiment can also be referred to as application code, and this embodiment does not make specific limitations on this.

[0331] In addition, the communication interface 904 uses any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0332] In addition, the communication line 902 is used to connect the components in the data processing device 90. Specifically, the communication line 902 can include a data bus, a power bus, a control bus, a status signal bus, etc. However, for the sake of clear illustration, various buses are labeled as the communication line 902 in the figure.

[0333] In addition, the data processing device 90 may further include a storage medium 905. The storage medium 905 is used to store computer instructions and various data for implementing the technical solution of this embodiment. So that when the data processing device 90 executes the above method of this embodiment, the computer instructions and various data stored in the storage medium 905 are loaded into the memory 903, so that the processor 901 can execute the computer instructions stored in the memory 903 to execute the method provided in this embodiment.

[0334] The method steps in this embodiment can be implemented in a hardware manner or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, PROM, EPROM, EEPROM, registers, hard disks, removable hard disks, CD-ROMs or any other form of storage medium well-known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in the data processing device. Of course, the processor and the storage medium can also exist as discrete components in the data processing device.

[0335] In the above embodiment, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in this embodiment are executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a communication device, a user device or other programmable devices. The computer program or instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program or instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center in a wired or wireless manner. The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center integrating one or more available media. The available medium can be a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); it can also be a semiconductor medium, such as an SSD.

[0336] In this embodiment, without special instructions and logical conflicts, the terms and / or descriptions between different implementation manners are consistent and can be referenced to each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.

[0337] In this embodiment, "at least one" means one or more, "a plurality of" means two or more, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, for elements where the singular forms "a", "an", and "the" appear, unless otherwise clearly specified in the context, it does not mean "one or only one", but means "one or more than one". For example, "a device" means one or more such devices. Furthermore, "at least one of..." means one or any combination of the subsequent associated objects. For example, "at least one of A, B, and C" includes A, B, C, AB, AC, BC, or ABC. In the text description of this embodiment, the character " / " generally represents an "or" relationship between the preceding and following associated objects; in the formula of this embodiment, the character " / " represents a "division" relationship between the preceding and following associated objects.

Claims

1. A coding method, characterized in that, The method includes: Obtain a data packet; According to the data packet, obtain a check packet, and the check packet and the data packet satisfy the following formula: A×B = 0 Where A is the check matrix of the data packet, and the elements in B are obtained based on the check packet, the data packet, the data packets before the data packet, and the check packets of the data packets before the data packet, and A is different from the check matrix of the data packet adjacent to the data packet.

2. The method according to claim 1, characterized in that, The data packet is the j-th frame data packet, the check packet is the j-th frame check packet, the data packets before the data packet are the (j - t)-th to (j - 1)-th frame data packets, and the check packets of the data packets before the data packet are the (j - t)-th to (j - 1)-th frame check packets. j and t are positive integers, j > t, and B satisfies: B = (concat(a j , b j )) + (concat(a j-1 , b j-1 )) +... + (concat(a j-t , b j-t )) Among them, a j is the data packet of the j-th frame, b j is the checksum packet of the j-th frame, and concat() is the merging function.

3. The method according to claim 1 or 2, characterized in that, The t + 1 check matrices of the t + 1 frame data packets from the (j - t)-th frame to the j-th frame are different. The check matrix of the j-th frame data packet is the check matrix corresponding to the modulo operation result of j and t + 1, and there is a preset corresponding relationship between the check matrix and the modulo operation result.

4. The method according to any one of claims 1 to 3, characterized in that The different check matrices include the same preset sub-matrix.

5. A decoding method, characterized in that, The method includes: Receive a data packet and a check packet; According to the received data packet and check packet, recover to obtain a complete data packet, and the complete data packet and the check packet satisfy the following formula: C×D = 0 Where C is the check matrix of the complete data packet; the elements in D are obtained based on the check packet, the complete data packet, the p frame data packets before and / or after the complete data packet, and the check packets of the p frame data packets before and / or after the complete data packet, and C is different from the check matrix of the data packet adjacent to the complete data packet, and p is a positive integer.

6. The method according to claim 5, wherein Any one of the complete data packet and the p frame data packets before and / or after the complete data packet is the first data packet, the check packet of the first data packet is the first check packet, and the first check packet and the first data packet satisfy the following formula: A×B = 0 Where A is the check matrix of the first data packet, and the elements in B are obtained based on the first check packet, the first data packet, the t frame data packets before the first data packet, and the t frame check packets before the first check packet, and A is different from the target matrix, and the target matrix is the check matrix of the data packet adjacent to the first data packet, and t is a positive integer, t ≤ p.

7. The method according to claim 6, wherein The check matrices of the p frame data packets before and / or after the complete data packet are different. The check matrix of the complete data packet is the check matrix corresponding to the modulo operation result of j and t + 1, and there is a preset corresponding relationship between the check matrix and the modulo operation result.

8. The method according to any one of claims 5-7, characterized in that, The different check matrices include the same preset sub-matrix.

9. An encoding device, characterized in that, The encoding device includes: An obtaining unit, configured to obtain a data packet; A processing unit, configured to obtain a check packet according to the data packet, and the check packet and the data packet satisfy the following formula: A×B = 0 Among them, A is the parity-check matrix of the data packet, the elements in B are obtained based on the parity-check packet, the data packet, the data packets before the data packet, and the parity-check packets of the data packets before the data packet, and the parity-check matrix of the data packet adjacent to A is different.

10. The encoding device according to claim 9, characterized in that, The data packet is the j-th frame data packet, the parity-check packet is the j-th frame parity-check packet, the data packets before the data packet are the data packets from the (j - t)-th frame to the (j - 1)-th frame, and the parity-check packets of the data packets before the data packet are the parity-check packets from the (j - t)-th frame to the (j - 1)-th frame. j and t are positive integers, j > t, and B satisfies: B = (concat(a j , b j ) + concat(a j-1 , b j-1 ) +... + concat(a j-t , b j-t )) where a j is the data packet of the j-th frame, b j is the checksum packet of the j-th frame, and concat() is the merging function.

11. The encoding device according to claim 9 or 10, characterized in that, The t + 1 parity-check matrices of the t + 1 data packets from the (j - t)-th frame to the j-th frame are different. The parity-check matrix of the j-th frame data packet is: the parity-check matrix corresponding to the result of the modulo operation of j and t + 1, and there is a preset corresponding relationship between the parity-check matrix and the modulo operation result.

12. The encoding device according to claim 10 or 11, characterized in that, The different parity-check matrices include the same preset sub-matrices.

13. A decoding device, characterized in that, The decoding device includes: a receiving unit for receiving data packets and parity-check packets; a processing unit for recovering a complete data packet according to the received data packet and parity-check packet, and the complete data packet and the parity-check packet satisfy the following formula: C × D = 0 Among them, C is the parity-check matrix of the complete data packet; the elements in D are obtained based on the parity-check packet, the complete data packet, p data packets before and / or after the complete data packet, and the parity-check packets of p data packets before and / or after the complete data packet. The parity-check matrix of the data packet adjacent to C is different, and p is a positive integer.

14. The decoding device according to claim 13, characterized in that, Any one of the complete data packet and p data packets before and / or after the complete data packet is the first data packet, the parity-check packet of the first data packet is the first parity-check packet, and the first parity-check packet and the first data packet satisfy the following formula: A × B = 0 Among them, A is the parity-check matrix of the first data packet, the elements in B are obtained based on the first parity-check packet, the first data packet, t data packets before the first data packet, and t parity-check packets before the first parity-check packet. A is different from the target matrix, and the target matrix is the parity-check matrix of the data packet adjacent to the first data packet. t is a positive integer, and t ≤ p.

15. The decoding device according to claim 13 or 14, characterized in that, The p data packets before and / or after the complete data packet include the p data packets before the complete data packet, the p data packets after the complete data packet, or the p data packets before and after the complete data packet. The complete parity-check packet is the j-th frame parity-check packet. The data packets before the complete data packet are the data packets from the (j - p)-th frame to the (j - 1)-th frame. The p data packets after the complete data packet are the data packets from the (j + 1)-th frame to the (j + p)-th frame. The p data packets before and after the complete data packet are the union of the data packets from the (j - m)-th frame to the (j - 1)-th frame and the data packets from the (j + 1)-th frame to the (j + n)-th frame, where n + m = p.

16. The decoding device according to any one of claims 14-16, characterized in that, The parity-check matrices of the p data packets before and / or after the complete data packet are different. The parity-check matrix of the complete data packet is: the parity-check matrix corresponding to the result of the modulo operation of j and t + 1, and there is a preset corresponding relationship between the parity-check matrix and the modulo operation result.

17. The decoding device according to any one of claims 13-16, characterized in that, Different check matrices include the same preset sub-matrix.

18. A data processing device, characterized in that, It includes a memory and a processor. The memory is used to store computer instructions, and the processor is used to call and run the computer instructions from the memory to implement the method described in any one of claims 1-4 or to implement the method described in any one of claims 5-8.

19. A computer-readable storage medium, characterized in that, Instructions are stored in the computer-readable storage medium. When the instructions are run on the processor, the method described in any one of claims 1-4 is implemented or the method described in any one of claims 5-8 is implemented.

20. A computer program product, characterized in that, The computer program product includes instructions. When the instructions are run on the processor, the method described in any one of claims 1-4 is implemented or the method described in any one of claims 5-8 is implemented.