Gel codeword structure encoding and decoding method, apparatus, and related device

10879937 ยท 2020-12-29

Assignee

Inventors

Cpc classification

International classification

Abstract

An H.sub.C of a code B is first transformed into an H.sup.B. A parity bit of the code B is obtained by performing an operation on the H.sup.B and an information bit of the code B. The parity bit is used to perform RS coding on a code A, to obtain a parity bit of the code A. A check code of a GEL code is obtained by performing an operation on the parity bits of the code B and the code A. Finally, a single bit parity check bit is added. The code A is defined in a finite field GF (2.sup.l1), the code B is defined in a finite field GF (2.sup.l2), and l.sub.1 and l.sub.2 are positive integers. A success rate of decoding the code A in the first row can be improved using this method.

Claims

1. A generalized error-locating (GEL) codeword structure encoding method in a communication network, comprising: determining, by a processor of a sending device, a target check matrix H.sup.B by performing elementary transformation on an original check matrix H.sub.C of a code B; determining, by the sending device, a parity bit of the code B by performing a first operation on the target check matrix H.sup.B and an information bit of the code B; determining, by the sending device, to use the parity bit of the code B as an information bit of a code A to perform Reed-Solomon (RS) coding on the code A; determining, by the sending device, a check code of a GEL code by performing a second operation on the parity bit of the code B and a result determined after RS coding is performed on the code A; and adding, by the sending device, a single bit parity check (SPC) parity bit to the GEL code, wherein the SPC parity bit is used to check an error location in the code A at a first layer during a decoding process to increase a success rate of decoding the code A to improve an efficiency of the decoding process for communications, wherein the code A is a row code, the code B is a column code, the code A is defined in a finite field Galois field (GF) (2.sup.l1), the code B is defined in a finite field GF (2.sup.l2), and l.sub.1 and l.sub.2 are positive integers, such that an exact division constraint does not exist between l.sub.1 and l.sub.2 to reduce a complexity of decoding the code B to improve a performance of the GEL code for communications; and transmitting, by the sending device, data encoded with the GEL code to a receiving device over the communication network.

2. The method according to claim 1, wherein a formula for determining the parity bit of the code B by performing the first operation on the target check matrix H.sup.B and the information bit of the code B comprises:
H.sub.l.sup.BR.sub.j,j{1, . . . ,k.sub.A.sup.l}, where H.sub.l.sup.B represents a target check matrix H.sup.B that is of a code B and that is at an l.sup.th layer of a GEL codeword structure, R.sub.j represents an information bit of the code B, and K.sub.A.sup.l represents an information bit that is of a code A and that is at the l.sup.th layer.

3. The method according to claim 1, wherein a formula to use the parity bit of the code B as the information bit of the code A to perform Reed-Solomon (RS) coding on the code A comprises:
r(x)=k(x)mod g(x) and r(x)=r.sub.0x.sup.0+ . . . +r.sub.n.sub.A.sub.k.sub.A.sub.1x.sup.n.sup.A.sup.k.sup.A.sup.1, wherein r (x) represents a parity bit of the code A, k (x) represents the information bit of the code A, and g (x) represents a generator polynomial of RS coding.

4. The method according to claim 1, wherein determining a check code of a GEL code by performing a second operation on the parity bit of the code B and a result determined after RS coding is performed on the code A comprises:
Parity.sub.l={r.sub.0+H.sub.l.sup.BR.sub.k.sub.A.sub.1, . . . ,r.sub.n.sub.A.sub.k.sub.A.sub.1+H.sub.l.sup.BR.sub.k.sub.A.sub.1}, wherein Parity.sub.l represents a check code that is of a GEL code and that is at the l.sup.th layer.

5. The method according to claim 1, wherein a subcode constraint of the code A and a subcode constraint of the code B comprise:
[n.sub.A,k.sub.A.sub.i,d.sub.A.sub.i].sub.q.sub.A and [n.sub.B,k.sub.B.sub.i,d.sub.B.sub.i].sub.q.sub.B
r.sub.A.sub.i=n.sub.Ak.sub.A.sub.i and r.sub.B.sub.i=n.sub.Bk.sub.B.sub.i
d.sub.A.sub.1d.sub.A.sub.2 . . . d.sub.A.sub.m
d.sub.B.sub.1d.sub.B.sub.2 . . . d.sub.B.sub.m
B.sub.1B.sub.2 . . . B.sub.m, wherein n.sub.A represents a code length of a code A, n.sub.B represents a code length of a code B, k.sub.Ai represents an information bit of a code A in an i.sup.th row, k.sub.Bi represents an information bit of a code B in the i.sup.th row, d.sub.Ai represents a minimum code distance between codes A in the i.sup.th row, r.sub.Ai represents a length of a parity bit of a code A in the i.sup.th row, and r.sub.Bi represents a length of a parity bit of a code B in the i.sup.th row.

6. A generalized error-locating (GEL) codeword structure decoding method in a communication network, comprising: receiving, by a receiving device, data encoded with a GEL code from a sending device over the communication network; determining, by a processor of the receiving device, prior information of a code A at each layer, wherein the prior information of the code A at each layer is a location of an error occurring when a code B is decoded at an upper layer, prior information of a code A at a first layer is a single bit parity check (SPC) parity bit added when a sending device performs GEL coding to encode the data with the GEL code, wherein the SPC parity bit is used to check an error location in the code A at the first layer during a decoding process to increase a success rate of decoding the code A to improve an efficiency of the decoding process for communications; recovering the code A at each layer by using a check matrix H.sup.B that is of the code B and that is the same as that of the sending device; decoding the recovered code A at each layer, to determine an erroneous code B and a syndrome of the code B; and decoding the erroneous code B by using the syndrome of the code B, and correcting the erroneous code B, wherein the code A is a row code, the code B is a column code, the code A is defined in a finite field Galois field (GF) (2.sup.l1), the code B is defined in a finite field GF (2.sup.l2), and l.sub.1 and l.sub.2 are positive integers, such that an exact division constraint does not exist between l.sub.1 and l.sub.2 to reduce a complexity of decoding the code B to improve a performance of the GEL code for communications.

7. The method according to claim 6, further comprising: when an error occurs when the code B is decoded at the upper layer, in a process of decoding a code B at a current layer, first rolling back to correct the code B at the upper layer.

8. A sending device, comprising: a memory and a processor, wherein the memory and the processor are interconnected, the memory stores computer instructions which, when executed by the processor, cause the sending device to: determine a target check matrix H.sup.B by performing elementary transformation on an original check matrix H.sub.C of a code B, determine a parity bit of the code B by performing a first operation on the target check matrix H.sup.B and an information bit of the code B, determine to use the parity bit of the code B as an information bit of a code A to perform Reed-Solomon (RS) coding on the code A; determine a check code of a generalized error-locating (GEL) code by performing a second operation on the parity bit of the code B and a result determined after RS coding is performed on the code A; and add a single bit parity check (SPC) parity bit to the GEL code, wherein the SPC parity bit is used to check an error location in the code A at a first layer during a decoding process to increase a success rate of decoding the code A to improve an efficiency of the decoding process for communications, wherein the code A is a row code, the code B is a column code, the code A is defined in a finite field Galois field (GF) (2.sup.l1), the code B is defined in a finite field GF (2.sup.l2), and l.sub.1 and l.sub.2 are positive integers, such that an exact division constraint does not exist between l.sub.1 and l.sub.2 to reduce a complexity of decoding the code B to improve a performance of the GEL code for communications; and transmit data encoded with the GEL code to a receiving device over the communication network.

9. The sending device according to claim 8, wherein a formula to determine the parity bit of the code B by performing the first operation on the target check matrix H.sup.B and the information bit of the code B comprises:
H.sub.l.sup.BR.sub.j,j{1, . . . ,k.sub.A.sup.l}, where H.sub.l.sup.B represents a target check matrix H.sup.B that is of a code B and that is at an l.sup.th layer of a GEL codeword structure, R.sub.j represents an information bit of the code B, and K.sub.A.sup.l represents an information bit that is of a code A and that is at the l.sup.th layer.

10. The sending device according to claim 9, wherein a formula to use the parity bit of the code B as the information bit of the code A to perform Reed-Solomon (RS) coding on the code A comprises:
r(x)=k(x)mod g(x),r(x)=r.sub.0x.sup.0+ . . . +r.sub.n.sub.A.sub.k.sub.A.sub.1x.sup.n.sup.A.sup.k.sup.A.sup.1, wherein r (x) represents a parity bit of the code A, k (x) represents the information bit of the code A, and g (x) represents a generator polynomial of RS coding.

11. The sending device according to claim 9, wherein to determine the check code of the GEL code by performing the second operation on the parity bit of the code B and the result determined after RS coding is performed on the code A, the computer instructions, when executed by the processor, cause the sending device to use the following:
Parity.sub.l={r.sub.0+H.sub.l.sup.BR.sub.k.sub.A.sub.1, . . . ,r.sub.n.sub.A.sub.k.sub.A.sub.1+H.sub.l.sup.BR.sub.k.sub.A.sub.1}, wherein Parity.sub.l represents a check code that is of a GEL code and that is at the l.sup.th layer.

12. The sending device according to claim 8, wherein a formula to use the parity bit of the code B as the information bit of the code A to perform Reed-Solomon (RS) coding on the code A comprises:
r(x)=k(x)mod g(x),r(x)=r.sub.0x.sup.0+ . . . +r.sub.n.sub.A.sub.k.sub.A.sub.1x.sup.n.sup.A.sup.k.sup.A.sup.1, wherein r (x) represents a parity bit of the code A, k (x) represents the information bit of the code A, and g (x) represents a generator polynomial of RS coding.

13. The sending device according to claim 12, wherein to determine the check code of the GEL code by performing the second operation on the parity bit of the code B and the result determined after RS coding is performed on the code A, the computer instructions, when executed by the processor, cause the sending device to use the following:
Parity.sub.l={r.sub.0+H.sub.l.sup.BR.sub.k.sub.A.sub.1, . . . ,r.sub.n.sub.A.sub.k.sub.A.sub.1+H.sub.l.sup.BR.sub.k.sub.A.sub.1}, wherein Parity.sub.l represents a check code that is of a GEL code and that is at the l.sup.th layer.

14. The sending device according to claim 8, wherein to determine the check code of the GEL code by performing the second operation on the parity bit of the code B and the result determined after RS coding is performed on the code A, the computer instructions, when executed by the processor, cause the sending device to use the following:
Parity.sub.l={r.sub.0+H.sub.l.sup.BR.sub.k.sub.A.sub.1, . . . ,r.sub.n.sub.A.sub.k.sub.A.sub.1+H.sub.l.sup.BR.sub.k.sub.A.sub.1}, wherein Parity.sub.l represents a check code that is of a GEL code and that is at the l.sup.th layer.

15. The sending device according to claim 8, wherein a subcode constraint of the code A and a subcode constraint of the code B comprise:
[n.sub.A,k.sub.A.sub.i,d.sub.A.sub.i].sub.q.sub.A and [n.sub.B,k.sub.B.sub.i,d.sub.B.sub.i].sub.q.sub.B
r.sub.A.sub.i=n.sub.Ak.sub.A.sub.i and r.sub.B.sub.i=n.sub.Bk.sub.B.sub.i
d.sub.A.sub.1d.sub.A.sub.2 . . . d.sub.A.sub.m
d.sub.B.sub.1d.sub.B.sub.2 . . . d.sub.B.sub.m
B.sub.1B.sub.2 . . . B.sub.m, where n.sub.A represents a code length of a code A, n.sub.B represents a code length of a code B, k.sub.Ai represents an information bit of a code A in an i.sup.th row, k.sub.Bi represents an information bit of a code B in the i.sup.th row, d.sub.Ai represents a minimum code distance between codes A in the i.sup.th row, r.sub.Ai represents a length of a parity bit of a code A in the i.sup.th row, and r.sub.Bi represents a length of a parity bit of a code B in the i.sup.th row.

16. A receiving device, comprising: a memory and a processor, wherein the memory and the processor are interconnected, the memory stores computer instructions which, when executed by the processor, cause the receiving device to: receive data encoded with a GEL code from a sending device over the communication network; determine prior information of a code A at each layer, wherein the prior information of the code A at each layer is a location of an error occurring when a code B is decoded at an upper layer, prior information of a code A at a first layer is a single bit parity check (SPC) parity bit added when a sending device performs generalized error-locating (GEL) coding to encode the data with the GEL code, wherein the SPC parity bit is used to check an error location in the code A at the first layer during a decoding process to increase a success rate of decoding the code A to improve an efficiency of the decoding process for communications, recover the code A at each layer by using a check matrix H.sup.B that is of the code B and that is the same as that of the sending device, decode the recovered code A at each layer, to determine an erroneous code B and a syndrome of the code B, and decode the erroneous code B by using the syndrome of the code B, and correct the erroneous code B, wherein the code A is a row code, the code B is a column code, the code A is defined in a finite field Galois field (GF) (2.sup.l1), the code B is defined in a finite field GF (2.sup.l2), and l.sub.1 and l.sub.2 are positive integers, such that an exact division constraint does not exist between l.sub.1 and l.sub.2 to reduce a complexity of decoding the code B to improve a performance of the GEL code for communications.

17. The receiving device according to claim 16, wherein the computer instructions, when executed by the processor, further cause the receiving device to: when an error occurs when the code B is decoded at the upper layer, in a process of decoding a code B at a current layer, first roll back to correct the code B at the upper layer.

Description

BRIEF DESCRIPTION OF DRAWINGS

(1) FIG. 1 is a schematic diagram of a sending device according to an embodiment of this application;

(2) FIG. 2 is a schematic diagram of a GEL codeword structure encoding method according to an embodiment of this application;

(3) FIG. 3 is a schematic diagram of a GEL codeword structure according to an embodiment of this application;

(4) FIG. 4 is a schematic diagram of a GEL codeword structure encoding procedure according to an embodiment of this application;

(5) FIG. 5 is another schematic diagram of a GEL codeword structure encoding method according to an embodiment of this application;

(6) FIG. 6 is a schematic diagram of a receiving device according to an embodiment of this application;

(7) FIG. 7 is a schematic diagram of a GEL codeword structure decoding method according to an embodiment of this application;

(8) FIG. 8 is a schematic diagram of a GEL codeword structure decoding procedure according to an embodiment of this application;

(9) FIG. 9 is another schematic diagram of a sending device according to an embodiment of this application; and

(10) FIG. 10 is another schematic diagram of a receiving device according to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

(11) Embodiments of this application provide a GEL codeword structure encoding and decoding method, an apparatus, and a related device, so as to reduce complexity of implementation, improve performance of a GEL code, and improve decoding efficiency.

(12) Forward error correction (FEC) is a method for improving reliability of data communication, and has a function of correcting data. In a unidirectional communication channel, once an error is found, a receiving device no longer has a permission to request transmission. Therefore, when an error occurs during transmission, the receiving device can correct erroneous data by using FEC. In FEC, a GEL codeword structure is a commonly used encoding structure and decoding structure. The GEL codeword structure includes a row code and a column code, and a check code of a GEL code is obtained by performing an encoding operation on a parity bit of the column code by using the row code, thereby completing encoding of data. Before sending data, a sending device encodes data by using the GEL codeword structure. After receiving data, the receiving device decodes the data by using the GEL codeword structure, and corrects erroneous data. Before data is exchanged between the sending device and the receiving device, the sending device and the receiving device first agree on a GEL codeword structure encoding manner, or before receiving data sent by the sending device, the receiving device first obtains a GEL codeword structure encoding manner of the sending device.

(13) FIG. 1 is a sending device 100 provided in an embodiment of this application. The sending device 100 includes a memory 101, a processor 102, and a transceiver 103. The memory 101, the processor 102, and the transceiver 103 are interconnected by using a bus 104, and the sending device 100 may further include a communications interface 105.

(14) The processor 102, the memory 101, the transceiver 103, and the communications interface 105 may implement mutual communication connections by using the bus 104, or may implement communication by using other means such as wireless transmission.

(15) The memory 101 may include a volatile memory, for example, a random access memory (RAM); or the memory may include a nonvolatile memory, for example, a read-only memory (ROM), a flash memory, a hard disk (HDD), or a solid-state drive (SSD); or the memory 101 may include a combination of the memories of the foregoing types. When the technical solution provided in this application is implemented by using software, steps that need to be executed in the GEL codeword structure encoding method provided in FIG. 2 of this application are implemented. A computer instruction is stored in the memory 101 and is executed by the processor 102, and receiving and sending functions of the sending device 100 are implemented by the processor 102 by invoking the computer instruction in the memory 101 to control the transceiver 103.

(16) This application further provides a GEL codeword structure encoding method. In FIG. 1, the sending device 100 executes the method during running. The method is applied to a sending device, and a schematic flowchart of the method is shown in FIG. 2.

(17) 201. Obtain a target check matrix H.sup.B by performing elementary transformation on an original check matrix H.sub.C of a code B.

(18) In this embodiment of this application, the code B is a column code. First, elementary transformation needs to be performed on the original check matrix H.sub.C of the code B to obtain the target check matrix H.sup.B, so as to subsequently obtain parity bits of codes B according to layers.

(19) A matrix expression of the H.sub.C is:

(20) ( .Math. .Math. .Math. .Math. .Math. 1 5 10 .Math. 5 ( n B - 1 ) 1 3 6 .Math. 3 ( n B - 1 ) 1 2 .Math. n B - 1 ) n B n B ,

(21) where is a primitive element in a GF (2{circumflex over ()}l2) field.

(22) A matrix expression of the H.sup.B is: H.sup.B=GH.sub.C, where G is a row-elementary transformation matrix of n.sub.Bn.sub.B.

(23) 202. Obtain a parity bit of the code B by performing a first operation on the target check matrix H.sup.B and an information bit of the code B.

(24) Optionally, a formula for the first operation is:
H.sub.l.sup.BR.sub.j,j{1, . . . ,k.sub.A.sup.l}, where

(25) H.sup.B.sub.l represents an encoding matrix that is of a code B and that is at an l.sup.th layer of a GEL codeword structure, R.sub.j represents an information bit of the code B, and K.sub.A.sup.l represents an information bit that is of a code A and that is at the l.sup.th layer.

(26) 203. Use the parity bit of the code B as an information bit of a code A to perform Reed-Solomon RS coding on the code A.

(27) In the GEL codeword structure, the code A (which is a row code in this embodiment of this application) and the code B (a column code) are alternately encoded and alternately decoded. Therefore, the parity bit of the code B that is obtained through calculation is used as the information bit of the code A to perform RS coding on the code A.

(28) Optionally, a formula for RS coding is:
r(x)=k(x)mod g(x),r(x)=r.sub.0x.sup.0+ . . . +r.sub.n.sub.A.sub.k.sub.A.sub.1x.sup.n.sup.A.sup.k.sup.A.sup.1, where

(29) r (x) represents a parity bit of the code A, k (x) represents the information bit of the code A, and g (x) represents a generator polynomial of RS coding.

(30) 204. Obtain a check code of a GEL code by performing a second operation on the parity bit of the code B and a result obtained after RS coding is performed on the code A.

(31) Optionally, a formula for the second operation is:
Parity.sub.l={r.sub.0+H.sub.l.sup.BR.sub.k.sub.A.sub.1, . . . ,r.sub.n.sub.A.sub.k.sub.A.sub.1+H.sub.l.sup.BR.sub.k.sub.A.sub.1}, where

(32) Parity.sub.l represents a check code that is of a GEL code and that is at the l.sup.th layer.

(33) 205. Add a Single bit Parity Check (SPC) parity bit, where the SPC parity bit is used to check an error location in codes A at a first layer during decoding.

(34) To improve efficiency of decoding a code A at the first layer, the SPC parity bit is added to the entire GEL codeword structure, and is used by a receiving device to first check the error location in the codes A at the first layer according to the SPC parity bit in a decoding process.

(35) It should be noted that the code A is defined in a finite field GF (2.sup.l1), the code B is defined in a finite field GF (2.sup.l2), and l.sub.1 and l.sub.2 are positive integers. In this way, an exact division constraint does not exist between l.sub.1 and l.sub.2, and values of l.sub.1 and l.sub.2 may be approximate or equal, so that a finite field of the code A and a finite field of the code B may be approximate or equal, thereby reducing complexity of implementation, and effectively improving performance of the GEL code. This meets requirements of the system for low power consumption of products, and also improves performance of a communications transmission system.

(36) Optionally, a subcode constraint of the code A and a subcode constraint of the code B include:
[n.sub.A,k.sub.A.sub.i,d.sub.A.sub.i].sub.q.sub.A and [n.sub.B,k.sub.B.sub.i,d.sub.B.sub.i].sub.q.sub.B
r.sub.A.sub.i=n.sub.Ak.sub.A.sub.i and r.sub.B.sub.i=n.sub.Bk.sub.B.sub.i
d.sub.A.sub.1d.sub.A.sub.2 . . . d.sub.A.sub.m
d.sub.B.sub.1d.sub.B.sub.2 . . . d.sub.B.sub.m
B.sub.1B.sub.2 . . . B.sub.m, where

(37) n.sub.A represents a code length of a code A, n.sub.B represents a code length of a code B, k.sub.Ai represents an information bit of a code A in an i.sup.th row, k.sub.Bi represents an information bit of a code B in the i.sup.th row, d.sub.Ai represents a minimum code distance between codes A in the i.sup.th row, r.sub.Ai represents a length of a parity bit of a code A in the i.sup.th row, and r.sub.Bi represents a length of a parity bit of a code B in the i.sup.th row. An information bit of a code A and an information bit of a code B at each layer are designed in advance, and a minimum code distance between codes A and a minimum code distance between codes B at each layer are also designed in advance. In addition, a minimum code distance between codes A at the first layer is greater than or equal to a minimum code distance between codes A at a second layer, the minimum code distance between the codes A at the second layer is greater than or equal to a minimum code distance between codes A at a third layer, and so on. A minimum code distance between codes B at the first layer is less than or equal to a minimum code distance between codes B at the second layer, the minimum code distance between the codes B at the second layer is less than or equal to a minimum code distance between codes B at the third layer, and so on. As a result, after entire GEL coding is completed, check capabilities of all layers in the GEL codeword structure are equivalent. There is a subordinate relationship between all layers of codes B. The first layer belongs to the second layer, the second layer belongs to the third layer, and so on.

(38) FIG. 3 shows a GEL codeword structure obtained by using a GEL codeword structure encoding method described in an embodiment of this application. FIG. 3 is a 4-layer GEL codeword structure. The GEL codeword structure encoding method described in this embodiment of this application is not limited to being used in the 4-layer GEL codeword structure, and is applicable to a GEL codeword structure with two or more layers. Each row represents a code A, each column represents a code B, the code B is in a matrix form, the code A includes an information bit and a parity bit, a parity bit obtained by performing an operation on the code B is used as an information bit of the code A, a parity bit that is of the code A and that is obtained by performing RS coding by using the information bit of the code A is added to a parity bit that is of the code B and that is obtained through calculation, to obtain a check code of GEL.

(39) As shown in FIG. 4, in an embodiment of this application, an encoding sequence in a GEL codeword structure encoding method is that encoding is started from a last layer, until an SPC parity bit is added. As shown in FIG. 4, a 3-layer GEL codeword structure is encoded. A third layer is first encoded, a second layer is then encoded, and finally a first layer is encoded. An encoding sequence of each layer is to first calculate a parity bit of a code B at a current layer, then check a check code of the code B, and finally encode a code A at the current layer.

(40) FIG. 5 is a schematic diagram of both a procedure of the GEL codeword structure encoding method in FIG. 2 and the GEL codeword structure shown in FIG. 3. I represents an information bit, P represents a parity bit, I11 and I12 represent locations of information bits at the third layer, I21 represents a location of an information bit at the second layer, P21 represents a location of a parity bit at the second layer, and so on. k(x) represents an information bit of a code A, r (x) represents a parity bit of the code A, and a parity bit of a code B is obtained by using H.sup.BR described in the foregoing step 202.

(41) FIG. 6 is a receiving device 600 provided in an embodiment of this application. The receiving device 600 includes a memory 601, a processor 602, and a transceiver 603. The memory 601, the processor 602, and the transceiver 603 are interconnected by using a bus 604, and the receiving device 600 may further include a communications interface 605.

(42) The processor 602, the memory 601, the transceiver 603, and the communications interface 605 may implement mutual communication connections by using the bus 604, or may implement communication by using other means such as wireless transmission.

(43) The memory 601 may include a volatile memory, for example, a random access memory; or the memory may include a nonvolatile memory, for example, a read-only memory, a flash memory, a hard disk, or a solid-state drive; or the memory 601 may include a combination of the memories of the foregoing types. When the technical solution provided in this application is implemented by using software, steps that need to be executed in the GEL codeword structure decoding method provided in FIG. 7 of this application are implemented. A computer instruction is stored in the memory 601 and is executed by the processor 602, and receiving and sending functions of the receiving device 600 are implemented by the processor 602 by invoking the computer instruction in the memory 601 to control the transceiver 603.

(44) This application further provides a GEL codeword structure decoding method. In FIG. 6, the receiving device 600 executes the method during running. The method is applied to a receiving device, and a schematic flowchart of the method is shown in FIG. 7.

(45) 701. Determine prior information of a code A at each layer, where the prior information of the code A at each layer is a location of an error occurring when a code B is decoded at an upper layer, prior information of a code A at a first layer is an SPC parity bit, and the SPC parity bit is a parity bit added when a sending device performs GEL coding.

(46) In a GEL codeword structure of this application, when the sending device encodes data, the SPC parity bit is added to the GEL codeword structure, where the SPC parity bit is used as the prior information of the code A at the first layer during decoding. In a decoding process, decoding and error correction are started and performed at the first layer, and decoding and error correction are performed at all layers sequentially until decoding and error correction at a last layer are completed. Prior information needs to be obtained during decoding of each layer. The prior information is generally a location of an error occurring when a code B is decoded at an upper layer. However, there is no upper layer for the code A at the first layer. Therefore, in this embodiment of this application, the SPC parity bit is added to the GEL codeword structure during encoding, so that the SCP parity bit is used as the prior information of the code A at the first layer during decoding.

(47) 702. Recover the code A at each layer by using a check matrix H.sup.B that is of the code B and that is the same as that of the sending device.

(48) 703. Decode the recovered code A at each layer, to obtain an erroneous column and a syndrome of the code B.

(49) After the code A at each layer is recovered according to the check matrix H.sup.B, the code A with the prior information is decoded, and an error value obtained by decoding the code A is the syndrome of the code B. Finally, an original syndrome of the code B is obtained through calculation by using the syndrome of the code B and a transformation matrix G A function of the original syndrome of the code B is to provide corresponding error status information for decoding of the code B. The original syndrome is used for the code B to calculate an error location. A relationship among the original check matrix H.sub.C of the code B, the target check matrix H.sup.B, and the transformation matrix G is H.sub.C=GH.sup.B.

(50) 704. Decode the erroneous code B by using the syndrome of the code B, and correct the erroneous code B.

(51) The code A is a row code, the code B is a column code, the code A is defined in a finite field GF (2.sup.l1), the code B is defined in a finite field GF (2.sup.l2), and l.sub.1 and l.sub.2 are positive integers.

(52) Optionally, when an error occurs when a code B is decoded at an upper layer, in a process of decoding a code B at a current layer, rollback is first performed to correct the code B at the upper layer, and then the code B at the current layer is decoded.

(53) For example, a decoding process is specifically described below.

(54) FIG. 8 is a schematic diagram of decoding by using an example in which a GEL codeword structure is a 3-layer codeword structure, and a specific decoding manner is as follows:

(55) A decoding process at a first layer is as follows:

(56) Step 1: Calculate an SPC parity bit (used as prior information of a code A) and recover a code A at the first layer.

(57) Step 2: Decode the code A at the first layer, so as to obtain a location (a column location) of an erroneous code B and a corresponding syndrome of the code B at the first layer.

(58) Step 3: Decode the erroneous code B by using the syndrome of the code B at the first layer, and correct the erroneous code B.

(59) A decoding process at a second layer is as follows:

(60) Step 1: Collect a decoding error location (used as prior information of a code A at the second layer) in codes B at the first layer, and recover the code A at the second layer.

(61) Step 2: Decode the code A at the second layer, so as to obtain a location of an erroneous code B and a corresponding syndrome of the code B at the second layer.

(62) Step 3: When an error occurs when a code B at the first layer is decoded, first roll back to correct the code B at the first layer, then decode the erroneous code B by using the syndrome of the code B at the second layer, and correct the erroneous code B.

(63) A decoding process at an m.sup.th layer is as follows:

(64) Step 1: Collect a decoding error location (used as prior information of a code A at the m.sup.th layer) of a code Bm1 (i.e., in codes B at the (m1).sup.th layer), and recover the code A at the m.sup.th layer.

(65) Step 2: Decode the code A at the m.sup.th layer, so as to obtain a location of an erroneous code B and a corresponding syndrome of the code B at the m.sup.th layer.

(66) Step 3: When an error occurs when a code B at the (m1).sup.th layer is decoded, first roll back to correct the code B at the (m1).sup.th layer, then decode the erroneous code B by using the syndrome of the code B at the m.sup.th layer, and correct the erroneous code B.

(67) After GEL decoding at all layers is completed, the entire decoding process ends.

(68) This application further provides a sending device 900, and the device may be implemented by using the sending device 100 shown in FIG. 1, or may be implemented by using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logic device, CPLD), a field programmable gate array (FPGA), generic array logic (GAL), or any combination thereof. The sending device 900 is configured to implement the method executed by the sending device shown in FIG. 2. When the method executed by the sending device shown in FIG. 2 is implemented by using software, the sending device 900 may be alternatively a software module.

(69) FIG. 9 is a schematic structural composition diagram of the sending device 900, and the sending device 900 includes a transformation unit 901, an operation unit 902, an encoding unit 903, and an adding unit 904. During working, the method executed by the sending device in the GEL codeword structure encoding method shown in FIG. 2 is executed.

(70) This application further provides a receiving device 1000, and the device may be implemented by using the receiving device 600 shown in FIG. 6, or may be implemented by using an ASIC or a PLD. The PLD may be a CPLD, an FPGA, GAL, or any combination thereof. The receiving device 1000 is configured to implement the method executed by the receiving device shown in FIG. 7. When the method executed by the receiving device shown in FIG. 2 is implemented by using software, the receiving device 1000 may be alternatively a software module.

(71) FIG. 10 is a schematic structural composition diagram of the receiving device 1000, and the receiving device 1000 includes a determining unit 1001, a recovery unit 1002, a decoding unit 1003, a correction unit 1004, and a rollback unit 1005. During working, the method executed by the receiving device in the GEL codeword structure decoding method shown in FIG. 7 is executed.

(72) An embodiment of this application further provides a computer storage medium. The computer storage medium may store a program. When being executed, the program includes all or some of the steps of the GEL codeword structure encoding and decoding method described in the foregoing method embodiments.

(73) It may be clearly understood by persons skilled in the art that, for ease and brevity of description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments, and details are not described herein again.

(74) In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, the unit division is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented by using some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.

(75) The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual requirements to achieve the objectives of the solutions of the embodiments.

(76) In addition, functional units in the embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software functional unit.

(77) When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the prior art, or all or some of the technical solutions may be implemented in the form of a software product. The software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to perform all or some of the steps of the methods described in the embodiments of this application. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.

(78) The foregoing embodiments are merely intended for describing the technical solutions of this application, but not for limiting this application. Although this application is described in detail with reference to the foregoing embodiments, persons of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features thereof, without departing from the spirit and scope of the technical solutions of the embodiments of this application.