CODING AND DECODING METHOD AND DEVICE, AND SYSTEM
20180278270 ยท 2018-09-27
Inventors
- Xiaoshu Si (Wuhan, CN)
- Dao PAN (Johannesburg, ZA)
- Fanglin Sun (Shenzhen, CN)
- Xiaofeng Zhang (Shenzhen, CN)
- Tao OUYANG (Wuhan, CN)
Cpc classification
H03M13/6516
ELECTRICITY
H03M13/1102
ELECTRICITY
H03M13/611
ELECTRICITY
H03M13/17
ELECTRICITY
International classification
H03M13/17
ELECTRICITY
H03M13/00
ELECTRICITY
H04L1/00
ELECTRICITY
H03M13/35
ELECTRICITY
Abstract
Embodiments of the present disclosure provide an FEC coding and decoding method and device, and a system. A transmit end determines a forward error correction FEC coding type according to a length of to-be-coded data in burst data, and performs coding according to the determined FEC coding type. A receive end determines a forward error correction FEC decoding type according to a length of to-be-decoded data in burst data, and performs decoding according to the determined FEC decoding type. The FEC coding and decoding method provided in the embodiments of the present disclosure improves utilization of a communication resource is improved, and saves a communication resource.
Claims
1. A method of coding data, wherein the method is implemented by a transmit device and comprises: performing one-codeword forward error correction (FEC) coding on to-be-coded data according to a first FEC coding type; when the to-be-coded data is not entirely coded, continually performing one-codeword FEC coding on the remaining to-be-coded data by using a second FEC coding type, wherein a length of parity bits of the first FEC coding type is longer than a length of parity bits of the second FEC coding type; and sending coded data to a receive device to enable the receive device to decode the received coded data according to a length of the received coded data.
2. The method according to claim 1, wherein the first FEC coding type is selected according to a length of the to-be-coded data and a correspondence between a data length and a FEC coding type.
3. The method according to claim 1, wherein the second FEC coding type is selected according to a length of remaining to-be-coded data after the performed one-codeword FEC coding and a correspondence between a data length and a FEC coding type.
4. The method according to claim 1, wherein the first FEC coding type comprises at least one of a shortened LDPC (16200, 14400) code and a full LDPC (16200, 14400) code.
5. The method according to claim 1, wherein the second FEC coding type comprises at least one of a shortened LDPC (5940, 5040) code and a full LDPC (5940, 5040) code.
6. The method according to claim 4, wherein the performing one-codeword FEC coding on the to-be-coded data according to a first FEC coding type comprising: performing one-codeword coding on the to-be-coded data by using the full LDPC (16200, 14400) code if the length of the to-be-coded data is greater than 14400; and performing one-codeword coding on the to-be-coded data by using the shortened LDPC (16200, 14400) code if the length of the to-be-coded data is less than or equal to 14400 and is greater than 10080.
7. A method of decoding data, wherein the method is implemented by a receive device and comprises: receiving data from a transmit device; and decoding the data by: performing one-codeword forward error correction (FEC) decoding on to-be-decoded data according to a first FEC decoding type, when the to-be-decoded data is not entirely decoded, continually performing one-codeword FEC decoding on the remaining to-be-decoded data by using a second FEC decoding type, wherein a length of parity bits of the first FEC coding type is longer than a length of parity bits of the second FEC coding type.
8. The method according to claim 7, wherein the first FEC decoding type is selected according to a length of the to-be-coded data and a correspondence between a data length and a FEC decoding type.
9. The method according to claim 7, wherein the second FEC decoding type is selected according to a length of remaining to-be-coded data after the performed one-codeword FEC decoding and a correspondence between a data length and a FEC decoding type.
10. The method according to claim 7, wherein the first FEC decoding type comprises at least one of a shortened LDPC (16200, 14400) code and a full LDPC (16200, 14400) code.
11. The method according to claim 7, wherein the second FEC decoding type comprises at least one of a shortened LDPC (5940, 5040) code and a full LDPC (5940, 5040) code.
12. A device for coding data, comprising a processor, a memory, a sending device, and a communications interface, wherein the memory stores instructions for implementing a coding method, and the processor is connected to both the memory and the sending device through the communications interface; and when the processor invokes the instructions in the memory, the following steps are executed: performing one-codeword forward error correction (FEC) coding on to-be-coded data according to a first FEC coding type; and, when the to-be-coded data is not entirely coded, continually performing one-codeword FEC coding on the remaining to-be-coded data by using a second FEC coding type, wherein a length of parity bits of the first FEC coding type is longer than a length of parity bits of the second FEC coding type; wherein sending device sends coded data to a receive device to enable the receive device to decode the received coded data according to a length of the received coded data.
13. The device according to claim 12, wherein the first FEC coding type is selected according to a length of the to-be-coded data and a correspondence between a data length and a FEC coding type.
14. The device according to claim 12, wherein the second FEC coding type is selected according to a length of remaining to-be-coded data after the performed one-codeword FEC coding and a correspondence between a data length and a FEC coding type.
15. The device according to claim 12, wherein the first FEC coding type comprises at least one of a shortened LDPC (16200, 14400) code and a full LDPC (16200, 14400) code.
16. The device according to claim 12, wherein the second FEC coding type comprises at least one of a shortened LDPC (5940, 5040) code and a full LDPC (5940, 5040) code.
17. A device for decoding data, wherein the decoding device comprises: a receiving device that receives data; a processor, a memory, and a communications interface, wherein the memory stores instructions for implementing a decoding method, and the processor is connected to both the memory and the receiving device through the communications interface; and when the processor invokes the instructions in the memory, the following steps are executed: performing one-codeword forward error correction (FEC) decoding on to-be-decoded data according to a first FEC decoding type, and, when the to-be-decoded data is not entirely decoded, continually performing one-codeword FEC decoding on the remaining to-be-decoded data by using a second FEC decoding type, wherein a length of parity bits of the first FEC coding type is longer than a length of parity bits of the second FEC coding type.
18. The device according to claim 17, wherein the first FEC decoding type is selected according to a length of the to-be-coded data and a correspondence between a data length and a FEC decoding type.
19. The device according to claim 17, wherein the second FEC decoding type is selected according to a length of remaining to-be-coded data after the performed one-codeword FEC decoding and a correspondence between a data length and a FEC decoding type.
20. The device according to claim 17, wherein the first FEC decoding type comprises at least one of a shortened LDPC (16200, 14400) code and a full LDPC (16200, 14400) code.
21. The device according to claim 17, wherein the second FEC decoding type comprises at least one of a shortened LDPC (5940, 5040) code and a full LDPC (5940, 5040) code.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0025] To describe the technical solutions in the embodiments of the present disclosure or in the prior art more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments or the prior art. Apparently, the accompanying drawings in the following description show some embodiments of the present disclosure, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
DESCRIPTION OF EMBODIMENTS
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the following clearly describes the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0041]
[0042] As shown in
[0043] Methods, devices, and systems that are provided in all embodiments of the present disclosure may be applied to the system shown in
[0044]
[0045] At a transmit end, that is, specifically the CNU in
[0046] The burst data is carried in a corresponding RB, and is more or less affected by noise during transmission, and as a result a bit error rate is increased. To enhance an anti-noise capability of the system and reduce the bit error rate during transmission, a feasible method is as follows: performing coding on original burst data in a forward error correction (FEC) manner, and generating parity information, so that the receive end can restore the original burst data by using the parity information. FEC coding has a correction capability. When performing decoding, the receive end can not only discover an error, but also determine a location of an error element and perform automatic correction. Information about error element correction does not need to be stored or fed back, and real-time quality is good.
[0047] There are multiple FEC coding types, such as low-density parity-check (LDPC) code, Reed-Solomon (RS) code, and convolution code (CC). A same FEC coding type may have different code lengths according to different code rates. For example, the LDPC coding includes coding types of at least three code lengths, which are respectively LDPC coding of a 16200-bit code length, LDPC coding of a 5940-bit code length, and LDPC coding of a 1120-bit code length. As shown in
[0048] In Embodiment 1, this embodiment of the present disclosure provides a burst data coding and decoding method and a system, which can be applied to a scenario in which communication is performed by using a burst mode. Preferably, the method may be applied to an EPoC system shown in
[0049] This embodiment of the present disclosure provides a burst data coding method that can be used by a transmit end, and the method includes: determining an FEC coding type according to a length of to-be-coded data in burst data and a correspondence between a data length and a forward error correction FEC coding type, where there are at least two different data length ranges that are respectively corresponding to two different FEC coding types; and performing coding according to the determined FEC coding type.
[0050] Optionally, the determining an FEC coding type according to a length of to-be-coded data in burst data and a correspondence between a data length and a forward error correction FEC coding type and the performing coding according to the determined FEC coding type specifically include: when L.sub.1>K.sub.1, determining the first FEC coding type corresponding to K.sub.1, and performing coding on the burst data by using the first FEC coding type, where L.sub.1 is the length of the to-be-coded data, and K.sub.1 is a threshold corresponding to the first FEC coding type; or when K.sub.p?1?L.sub.1>K.sub.p, determining the p.sup.th FEC coding type corresponding to K.sub.p, performing coding on the burst data by using the p.sup.th FEC coding type, where K.sub.p is a threshold corresponding to the p.sup.th FEC coding type, and K.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC coding type; or when L.sub.1?K.sub.m, determining the m.sup.th FEC coding type corresponding to K.sub.m, and performing coding on the burst data by using the m.sup.th FEC coding type, where K.sub.m is a threshold corresponding to the m.sup.th FEC coding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and K.sub.p?1>K.sub.p.
[0051] Optionally, the determining an FEC coding type according to a length of to-be-coded data in burst data and a correspondence between a data length and a forward error correction FEC coding type and the performing coding according to the determined FEC coding type specifically include: when the length of the to-be-coded data in the burst data is greater than K.sub.1, determining the first FEC coding type corresponding to K.sub.1, and performing one-codeword coding by using the first FEC coding type, where K.sub.1 is a threshold corresponding to the first FEC coding type; or when the length of the to-be-coded data in the burst data is less than or equal to K.sub.p?1 and is greater than K.sub.p, determining the p.sup.th FEC coding type corresponding to K.sub.p, and performing one-codeword coding by using the p.sup.th FEC coding type, where K.sub.p is a threshold corresponding to the p.sup.th FEC coding type, and K.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC coding type; or when the length of the to-be-coded data in the burst data is less than or equal to K.sub.m and is greater than 0, determining the m.sup.th FEC coding type corresponding to K.sub.m, and performing coding on the to-be-coded data in the burst data by using the m.sup.th FEC coding type, or performing one-codeword coding by using the m.sup.th FEC coding type, where K.sub.m is a threshold corresponding to the m.sup.th FEC coding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and K.sub.p?1>K.sub.p.
[0052] Optionally, the threshold K.sub.1 corresponding to the first FEC coding type, the threshold K.sub.p?1 corresponding to the p?1.sup.th FEC coding type, the threshold K.sub.p corresponding to the p.sup.th FEC coding type, and the threshold K.sub.m corresponding to the m.sup.th FEC coding type are determined by using a principle that a total length of a parity bit included in data formed by performing coding on the burst data is the shortest.
[0053] Specifically, K.sub.1 may be equal to a value obtained by multiplying k.sub.2 by an integer part of a quotient obtained by dividing t.sub.1 by t.sub.2; K.sub.p?1 may be equal to a value obtained by multiplying k.sub.p by an integer part of a quotient obtained by dividing t.sub.p?1 by t.sub.p; K.sub.p may be equal to a value obtained by multiplying k.sub.p+1 by an integer part of a quotient obtained by dividing t.sub.p by t.sub.p+1; and K.sub.m may be equal to a value obtained by multiplying k.sub.m by an integer part of a quotient obtained by dividing t.sub.m?1 by t.sub.m, where t.sub.1, t.sub.2, t.sub.p?1, t.sub.p, t.sub.m?1, and t.sub.m are respectively lengths of one-codeword parity bits of the first FEC coding type, the second FEC coding type, the p?1.sup.th FEC coding type, the p.sup.th FEC coding type, the m?1.sup.th FEC coding type, and the m.sup.th FEC coding type; and k.sub.2, k.sub.p, k.sub.p+1, and k.sub.m are respectively lengths of one-codeword information bits of the second FEC coding type, the p.sup.th FEC coding type, the p+1.sup.th FEC coding type, and the m.sup.th FEC coding type.
[0054] Optionally, the coding method further includes: determining a length of the burst data, and determining, according to the length of the burst data and the correspondence between a data length and an FEC coding type, an FEC coding type or an FEC coding type sequence corresponding to the length of the burst data; and the performing coding according to the determined FEC coding type specifically includes: performing coding according to the determined FEC coding type or FEC coding type sequence.
[0055] The following gives a detailed description of solutions in this embodiment of the present disclosure with reference to specific scenarios.
[0056] First, the FEC coding type is determined according to the length of to-be-coded data in the burst data and the correspondence between a data length and a forward error correction FEC coding type.
[0057] Because burst data is comparatively independently sent, burst data sent each time is also independent. For example, in the EPoC system, data sent from a CNU to a CMC includes pieces of burst data, and a start and an end of the burst data have a corresponding flag. It should be noted that, as shown in
[0058] The to-be-coded data in the burst data may refer to the entire burst data, or may refer to remaining to-be-coded data in the burst data. It may be understood that, when coding starts to be performed, the entire burst data is not coded, and therefore, the entire burst data is the to-be-coded data. The burst data may need to be divided into multiple codewords so as to be coded, so that in a coding process, a case in which coding of a part of the burst data is already completed, and a remaining part of data still waits to be coded inevitably occurs. Certainly, when an amount of the burst data is relatively small, in a case in which coding may be completed by using one codeword, the to-be-coded data refers to the burst data.
[0059] In a relatively mature communications technology, a length of burst data may be determined, that is, a coding device may know a length of burst data that needs to be coded. The EPoC system is used as an example. Before the transmit end performs coding, the coding device at the transmit end knows a size of corresponding burst data that needs to be coded. Specifically, before sending the burst data once, the transmit end may send, to the CMC or OLT, a report (Report) message carrying upstream bandwidth information required by the transmit end. The CMC or OLT may reply a gating (Gate) message carrying corresponding bandwidth authorization information. The transmit end may know a size of to-be-sent burst data according to the corresponding bandwidth authorization information, that is, a size of the burst data in this embodiment. In addition, the device at the transmit end may send to-be-sent burst data carrying a corresponding start and end flag. The decoding device (such as the CMC) may determine a length of the received burst data by using a burst start flag and a burst end flag that are carried in an RB. In another application scenario, a specific method of determining a data length is a conventional technology, and details are not described herein again.
[0060] Certainly, before the coding type is determined, the length of the to-be-coded data in the corresponding burst data needs to be determined. It may be understood that, determining the length of the to-be-coded data in the burst data is a step before the coding method introduced in this embodiment of the present disclosure starts. It should be noted that, in this embodiment of the present disclosure, during the determining an FEC coding type according to a length of to-be-coded data and a correspondence between a data length and an FEC coding type, the FEC coding type may not be determined only after an accurate length of the to-be-coded data is determined. In fact, in an optional solution, when the length of the to-be-coded data is greater than or equal to a threshold, the corresponding coding type may be determined. Specifically, for example, a corresponding coding device generally includes a buffer, a buffering device, or a storage device. The coding device temporarily stores or stores data after receiving the data, and then collects statistics about a length of the temporarily stored or stored data. Optionally, for example, a counting manner may be used. After a count value reaches a set threshold, it indicates that the length of the to-be-coded data is greater than or equal to a corresponding threshold, so that a corresponding FEC coding type can be determined, and meanwhile, next counting starts. Certainly, optionally, a corresponding FEC coding type may be determined according to a length of the entire burst data after the length of the entire burst data is determined.
[0061] The correspondence between a data length and an FEC coding type may be specifically represented as a mapping table, may be specifically represented as a logical correspondence, may be a direct correspondence, or may be an indirect correspondence. A specific representation manner of the correspondence is not limited in this embodiment of the present disclosure. The correspondence may be configured when the system performs networking, or may be configured by a network management system after networking is performed; and may be acquired and stored by a corresponding coding device, or may be determined after a corresponding coding device and decoding device negotiate. A specific source of the correspondence is not limited in this embodiment of the present disclosure. It should be noted that, the data length herein may be a range. For example, a data length greater than 10080 bits may be corresponding to an FEC coding type, and a data length less than or equal to 10080 bits and greater than 2550 bits may be corresponding to another coding type. Certainly, it may also be understood that, each data length greater than 10080 bits, that is, all data lengths greater than 10080 bits, such as 10081 bits and 14450 bits, is corresponding to an FEC coding type. Each data length less than or equal to 10080 bits and greater than 2550 bits, that is, 2551 bits, 2552 bits . . . 10080 bits, is corresponding to another coding type.
[0062] Optionally, the determining a forward error correction FEC coding type according to a length of to-be-coded data in burst data and a correspondence between a data length and an FEC coding type specifically includes: determining, according to the length of the to-be-coded data in the data, a data length range to which the length of the to-be-coded data belongs; and determining the FEC coding type according to the data length range.
[0063] Specifically, in an optional solution, when discovering that the length of the to-be-coded data L.sub.1>K.sub.1, the coding device determines the first FEC coding type corresponding to K.sub.1, and performs coding on the burst data by using the first FEC coding type, where K.sub.1 is a threshold corresponding to the first FEC coding type. Optionally, when discovering that L.sub.1>K.sub.1, the coding device may search for the first FEC coding type according to a correspondence between K.sub.1 and the first FEC coding type, and performs coding on the entire burst data by using the first FEC coding type. Alternatively, L.sub.1>K.sub.1 may be set as a trigger condition. When the condition is met, the coding device performs coding on the entire burst data by using the first FEC coding type, and in this case, the correspondence between K.sub.1 and the first FEC coding type is indirect. Specifically, a corresponding step may be implemented by using a corresponding array, or may be implemented by using a field programmable gate array (FPGA), or may be implemented by using a processor, or may be implemented by using another manner. This embodiment of the present disclosure sets no limitation thereto. Accordingly, when K.sub.p?1?L.sub.1>K.sub.p, the p.sup.th FEC coding type corresponding to K.sub.p is determined, coding is performed on the burst data by using the p.sup.th FEC coding type, where K.sub.p is a threshold corresponding to the p.sup.th FEC coding type, and K.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC coding type; or when L.sub.1?K.sub.m, the m.sup.th FEC coding type corresponding to K.sub.m is determined, and coding is performed on the burst data by using the m.sup.th FEC coding type, where K.sub.m is a threshold corresponding to the m.sup.th FEC coding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and K.sub.p?1>K.sub.p. Herein, m and p may be any number within respective value ranges. Because K.sub.p?1>K.sub.p, and p may be any number within the range, it is obvious that K.sub.1, K.sub.2 . . . K.sub.p?1, K.sub.p . . . K.sub.m?1, K.sub.m are sequentially decreased in terms of a numerical value. In this embodiment, the coding device supports at least two FEC coding manners, and certainly, for a case in which only one FEC coding manner is supported, the method provided in this embodiment can also be used.
[0064] As is described above, the length of the to-be-coded data in the burst data refers to a length of the remaining to-be-coded data. When coding starts to be performed, the entire burst data is the to-be-coded data. The FEC coding type may not be determined only after the accurate length of the to-be-coded data and a length of coded data are determined. In fact, in an optional solution, in a real-time coding process, if the length of the to-be-coded data is greater than or equal to a threshold, one-codeword coding is performed, and the length of the remaining to-be-coded data continues to be determined. That is, it only needs to be determined that the length of the to-be-coded data is greater than a threshold, and it is not necessarily required to know the accurate length of the to-be-coded data. In an optional solution, when the length of the to-be-coded data in the burst data is greater than K.sub.1, the first FEC coding type corresponding to K.sub.1 is determined, and one-codeword coding is performed by using the first FEC coding type, where K.sub.1 is a threshold corresponding to the first FEC coding type; or when the length of the to-be-coded data in the burst data is less than or equal to K.sub.p?1 and is greater than K.sub.p, the p.sup.th FEC coding type corresponding to K.sub.p is determined, and one-codeword coding is performed by using the p.sup.th FEC coding type, where K.sub.p is a threshold corresponding to the p.sup.th FEC coding type, and K.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC coding type; or when the length of the to-be-coded data in the burst data is less than or equal to K.sub.m and is greater than 0, the m.sup.th FEC coding type corresponding to K.sub.m is determined, and coding is performed on the to-be-coded data in the burst data by using the m.sup.th FEC coding type, or one-codeword coding is performed by using the m.sup.th FEC coding type, where K.sub.m is a threshold corresponding to the m.sup.th FEC coding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and K.sub.p?1>K.sub.p. In this solution, the coding device determines, by using the length of the remaining to-be-coded data, an FEC coding type used for one codeword; and after one codeword is obtained by coding, determines an FEC coding type of another codeword according to a length of still remaining to-be-coded data, until coding of the entire burst data is completed.
[0065] In the foregoing several manners, optionally, K.sub.1, K.sub.p?1, K.sub.p, and K.sub.m may be determined by using the principle that a total length of a parity bit included in data formed by performing coding on the burst data is the shortest. Optionally, K.sub.1 is equal to a value obtained by multiplying k.sub.2 by an integer part of a quotient obtained by dividing t.sub.1 by t.sub.2; K.sub.p?1 is equal to a value obtained by multiplying k.sub.p by an integer part of a quotient obtained by dividing t.sub.p?1 by t.sub.p; K.sub.p is equal to a value obtained by multiplying k.sub.p+1 by an integer part of a quotient obtained by dividing t.sub.p by t.sub.p+1; and K.sub.m is equal to a value obtained by multiplying k.sub.m by an integer part of a quotient obtained by dividing t.sub.m?1 by t.sub.m, where t.sub.1, t.sub.2, t.sub.p?1, t.sub.p, t.sub.m?1, and t.sub.m are respectively lengths of one-codeword parity bits of the first FEC coding type, the second FEC coding type, the p?1.sup.th FEC coding type, the p.sup.th FEC coding type, the m?1.sup.th FEC coding type, and the m.sup.th FEC coding type; and k.sub.2, k.sub.p, k.sub.p+1, and k.sub.m are respectively lengths of one-codeword information bits of the second FEC coding type, the p.sup.th FEC coding type, the p+1.sup.th FEC coding type, and the m.sup.th FEC coding type.
[0066] Optionally, in another optional solution, the method may further be as follows: first determining a length of the burst data; determining, according to the length of the burst data and the correspondence between a data length and an FEC coding type, an FEC coding type or an FEC coding type sequence corresponding to the length of the burst data; and performing coding according to the determined FEC coding type or FEC coding type sequence.
[0067] The following further describes this embodiment of the present disclosure by using LDPC coding as an example.
TABLE-US-00001 TABLE 1 LDPC coding Length of an Length of a types information bit (k) Code length (n) parity bit (t) 1 14400 (k.sub.1) 16200 (n.sub.1) 1800 (t.sub.1) 2 5040 (k.sub.2) 5940 (n.sub.2) 900 (t.sub.2) 3 850 (k.sub.3) 1120 (n.sub.3) 270 (t.sub.3)
[0068] As shown in Table 1, the LDPC coding is used as an example, it is assumed that the coding device supports LDPC coding having three types of code lengths. It may be understood that, the coding device may further have another FEC coding manner, where the another FEC coding manner may also have multiple types of code lengths, and even multiple types of FEC coding manners may be used in a hybrid manner. This embodiment of the present disclosure sets no limitation thereto.
[0069] In an implementation manner, as shown in
[0070] In another implementation manner, as shown in
[0071] In solutions shown in
[0072] Specifically, K.sub.1 and K.sub.2 may be set according to the following manner. It may be seen that, lengths of parity bits corresponding to three LDPC types are respectively t.sub.1=n.sub.1?k.sub.1, t.sub.2=n.sub.2?k.sub.2, and t.sub.3=n.sub.3?k.sub.3, where t.sub.1>t.sub.2>t.sub.3. num1=[t.sub.1/t.sub.2] and num2=[t.sub.2/t.sub.3] are calculated, where [n] is a modulo operation and is used to indicate an integer that is not greater than n. That is, the modulo operation is performed on a quotient obtained by dividing t.sub.1 by t.sub.2, and the modulo operation is performed on a quotient obtained by dividing t.sub.2 by t.sub.3. K.sub.1=num1*k.sub.1 and K.sub.2=num2*k.sub.2 are set. With reference to the three LDPC types in Table 1, lengths of parity bits of the three LDPC types may be separately obtained: t.sub.1=1800, t.sub.2=900, and t.sub.3=270. It may be obtained, according to the foregoing rule, that num1=2 and num2=3, so that K.sub.1=10080 and K.sub.2=2550.
[0073] It should be noted that, in a solution shown in
[0074] Optionally, an implementation manner may further be that a threshold is set. Coding is performed on a part of the burst data whose length is greater than the threshold by using an FEC coding type whose code rate is the highest; coding is performed on a remaining part according to an optimal FEC coding type supported by the device or system, and a combination of various FEC coding types for an optimal coding is determined for each data length range.
[0075] In another optional solution, a coding type may be determined according to a total length of the burst data. After the length of the burst data is determined, the correspondence between a data length and an FEC coding type is queried according to the length of the burst data; an FEC coding type or FEC coding type sequence corresponding to the length of the burst data is determined; and finally, coding is performed according to the determined FEC coding type or FEC coding type sequence. In this case, a corresponding FEC coding type sequence may be a combination of a series of coding types. The correspondence between a data length and an FEC coding type may be represented as a mapping table, or may be represented in other manners. The embodiment of the present disclosure sets no limitation. When the correspondence is represented as a table, optionally, the correspondence in a case (LDPC coding types in Table 1 are still used as an example) may be shown in Table 2. In the table, [L.sub.1/k.sub.1] is a value obtained by performing a modulo operation on a quotient obtained by dividing L.sub.1 by k.sub.1, and T.sub.1, T.sub.2, and T.sub.3 are respectively codewords of the first, the second, and the third LDPC coding types in Table 1, where a value of {[L.sub.1/k.sub.1]+1}*T.sub.3 may sequentially be 1T.sub.3, 2T.sub.3, or 3T.sub.3 as L.sub.1 changes; and a value of {[(L.sub.1?5040)/k.sub.1]+1}T.sub.3 may sequentially be 1T.sub.3, 2T.sub.3, or 3T.sub.3 as L.sub.1 changes. Table 2 only shows a combination of three FEC coding types. In fact, when FEC coding types that have more types of code lengths exist, the combination may be richer, and a code rate may be higher. Table 2 is only a part of the mapping table, and it may be understood that, when the length of the burst data is greater than 14400 bits, a difference lies in a quantity of T.sub.1. Coding is still performed according to a correspondence in Table 2 between L.sub.1 and a remainder obtained by dividing the length of the burst data by 14400 bits.
TABLE-US-00002 TABLE 2 Length L.sub.1 of burst data Coding type sequence (0, 2550] {[L.sub.1/k.sub.1] + 1} * T.sub.3 (2550, 5040] T.sub.2 (5040, 7590] T.sub.2 + {[(L.sub.1 ? 5040)/k.sub.1] + 1}T.sub.3 (7590, 10080] 2T.sub.2 or T.sub.1 (10080, 14400] T.sub.1
[0076] It may be understood that, when a corresponding data length is not enough for performing one-codeword coding, coding may be performed by using a shortened code (shortened code) manner. Certainly, coding performed by using shortened code of an FEC coding type still belongs to coding performed by using the FEC coding type. For example, coding performed on a codeword by using shortened code of the first LDPC coding type still belongs to coding performed by using the first LDPC coding type. Specifically, as shown in
[0077] Corresponding to the coding method, an embodiment of the present disclosure further provides a decoding method.
[0078] As shown in
[0079] Optionally, the determining an FEC decoding type according to a length of to-be-decoded data in burst data and a correspondence between a data length and a forward error correction FEC decoding type and the performing decoding according to the determined FEC decoding type specifically include: when L.sub.2>N.sub.1, determining the first FEC decoding type corresponding to N.sub.1, and performing decoding on the burst data by using the first FEC decoding type, where L.sub.2 is the length of the to-be-decoded data, and N.sub.1 is a threshold corresponding to the first FEC decoding type; or when N.sub.p?1?L.sub.2>N.sub.p, determining the p.sup.th FEC decoding type corresponding to N.sub.p, performing decoding on the burst data by using the p.sup.th FEC decoding type, where N.sub.p is a threshold corresponding to the p.sup.th FEC decoding type, and N.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC decoding type; or when L.sub.2?N.sub.m, determining the m.sup.th FEC decoding type corresponding to N.sub.m, and performing decoding on the burst data by using the m.sup.th FEC decoding type, where N.sub.m is a threshold corresponding to the m.sup.th FEC decoding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and N.sub.p?1>N.sub.p.
[0080] Optionally, the determining an FEC decoding type according to a length of to-be-decoded data in burst data and a correspondence between a data length and a forward error correction FEC decoding type and the performing decoding according to the determined FEC decoding type specifically include: when the length of the to-be-decoded data in the burst data is greater than N.sub.1, determining the first FEC decoding type corresponding to N.sub.1, and performing one-codeword decoding by using the first FEC decoding type, where N.sub.1 is a threshold corresponding to the first FEC decoding type; or when the length of the to-be-decoded data in the burst data is less than or equal to N.sub.p?1 and is greater than N.sub.p, determining the p.sup.th FEC decoding type corresponding to N.sub.p, and performing one-codeword decoding by using the p.sup.th FEC decoding type, where N.sub.p is a threshold corresponding to the p.sup.th FEC decoding type, and N.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC decoding type; or when the length of the to-be-decoded data in the burst data is less than or equal to N.sub.m and is greater than 0, determining the m.sup.th FEC decoding type corresponding to N.sub.m, and performing decoding on remaining to-be-decoded data in the burst data by using the m.sup.th FEC decoding type, or performing one-codeword decoding by using the m.sup.th FEC decoding type, where N.sub.m is a threshold corresponding to the m.sup.th FEC decoding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and N.sub.p?1>N.sub.p.
[0081] Optionally, the threshold N.sub.1 corresponding to the first FEC decoding type, the threshold N.sub.p?1 corresponding to the p?1.sup.th FEC decoding type, the threshold N.sub.p corresponding to the p.sup.th FEC decoding type, and the threshold N.sub.m corresponding to the m.sup.th FEC decoding type are determined by using a principle that a total length of a parity bit carried in the burst data is the shortest. Optionally, N.sub.1 is equal to a value obtained by multiplying n.sub.2 by an integer part of a quotient obtained by dividing t.sub.1 by t.sub.2; N.sub.p?1 is equal to a value obtained by multiplying n.sub.p by an integer part of a quotient obtained by dividing t.sub.p?1 by t.sub.p; N.sub.p is equal to a value obtained by multiplying n.sub.p+1 by an integer part of a quotient obtained by dividing t.sub.p by t.sub.p+1; and N.sub.m is equal to a value obtained by multiplying n.sub.m by an integer part of a quotient obtained by dividing t.sub.m?1 by t.sub.m, where t.sub.1, t.sub.2, t.sub.p?1, t.sub.p, t.sub.m?1, and t.sub.m are respectively lengths of one-codeword parity bits of the first FEC coding type, the second FEC coding type, the p?1.sup.th FEC coding type, the p.sup.th FEC coding type, the m?1.sup.th FEC coding type, and the m.sup.th FEC coding type; and n.sub.2, n.sub.p, n.sub.p+1, and n.sub.m are respectively one-codeword lengths of the second FEC coding type, the p.sup.th FEC coding type, the p+1.sup.th FEC coding type, and the m.sup.th FEC coding type.
[0082] Optionally, the decoding method further includes: determining a length of the burst data; the determining a forward error correction FEC decoding type according to a length of to-be-decoded data in the burst data specifically includes: determining, according to the length of the burst data and the correspondence between a data length and an FEC decoding type, an FEC decoding type or FEC decoding type sequence corresponding to the length of the burst data; and the performing decoding according to the determined FEC decoding type specifically includes: performing decoding according to the determined FEC decoding type or FEC decoding type sequence.
[0083] It may be understood that, the burst data decoding method provided in this embodiment of the present disclosure is used with the coding method provided above. Thresholds and the like that are used in the decoding method are corresponding to thresholds in the coding method. It should be noted that, in the coding method, an FEC coding type is determined according to a length of to-be-coded data, and in the decoding method, the FEC decoding type is determined according to the length of the to-be-decoded data. For burst data in transmission, the length of the to-be-coded data herein is not equal to the length of the to-be-decoded data. Coded data generated after coding is performed on the to-be-coded data is the to-be-decoded data. However, there is a correspondence between a length of to-be-coded data in burst data and a length of to-be-decoded data formed by performing coding.
[0084] The following describes in detail the decoding method with reference to specific application scenarios.
[0085] The FEC coding type of the to-be-decoded data is corresponding to the length of the to-be-decoded data, and the FEC decoding type is corresponding to the FEC coding type. There is a correspondence between to-be-coded data and to-be-decoded data obtained after coding. For a codeword, a length of the codeword is divided into two parts, which are respectively a length of an information bit and a length of a parity bit, where the length of the information bit represents a length of to-be-sent data when coding is performed, that is, a length of the to-be-coded data; and a code length of a codeword obtained after coding represents a length of the to-be-decoded data. It may be seen from
[0086] According to description for the foregoing coding method, it may be understood that, as the length of the to-be-coded data increases linearly, a parity bit in a coding process monotonically increases. That is, a longer length of the to-be-coded data indicates a longer (or equal) total length of the parity bit increased in the coding process and a longer total length of coded data. That is, lengths of to-be-decoded data that is formed by performing coding on to-be-coded data of different lengths are different, so that the decoding device may correctly perform decoding.
[0087] It should be understood that, the coding method in this embodiment is in a one-to-one correspondence with the decoding method, that is, corresponding parameters and thresholds in the decoding device are corresponding to corresponding parameters and thresholds in the coding device. For example, thresholds K.sub.1, K.sub.p?1, K.sub.p, and K.sub.m in the coding process are respectively corresponding to thresholds N.sub.1, N.sub.p?1, N.sub.p, and N.sub.m in a decoding process.
[0088] The to-be-decoded data in the burst data may refer to entire to-be-decoded burst data, or may refer to remaining to-be-decoded data in the burst data. It may be understood that, when decoding starts to be performed, entire burst data is not decoded, and therefore, the entire burst data is the to-be-decoded data. The burst data may need to be divided into multiple codewords so as to be decoded, so that in the decoding process, a case in which decoding of a part of the burst data is already completed, and a remaining part of data still waits to be decoded inevitably occurs. Certainly, when an amount of the burst data is relatively small, in a case in which decoding may be completed by using one codeword, the to-be-decoded data refers to the entire burst data.
[0089] It should be noted that, in this embodiment of the present disclosure, during the determining an FEC decoding type according to a length of to-be-decoded data and a correspondence between a data length and an FEC decoding type, the FEC decoding type may not be determined only after an accurate length of the to-be-decoded data is determined. In fact, in an optional solution, when the length of the to-be-decoded data is greater than a threshold, the corresponding decoding type may be determined. Specifically, for example, a corresponding decoding device generally includes a buffer, a buffering device, or a storage device. The decoding device temporarily stores or stores data after receiving the data, and then collects statistics about a length of the temporarily stored or stored data. Optionally, for example, a counting manner may be used. After a count value reaches a set threshold, it indicates that the length of the to-be-decoded data is greater than or equal to a corresponding threshold, so that a corresponding FEC decoding type can be determined, and meanwhile, next counting starts. Certainly, optionally, a corresponding FEC decoding type may also be determined according to a length of the entire burst data after the length of the entire burst data is determined.
[0090] As shown in Table 1, LDPC decoding is used as an example, it is assumed that the decoding device supports LDPC decoding having three types of code lengths. It may be understood that, the decoding device may further have another FEC decoding manner, where the another FEC decoding manner may also have multiple types of code lengths, and even multiple types of FEC decoding manners may be used in a hybrid manner. This embodiment of the present disclosure sets no limitation thereto.
[0091] In an implementation manner, as shown in
[0092] In another implementation manner, as shown in
[0093] In solutions of
[0094] In another optional solution, a decoding type may be determined according to a total length of the burst data. After the length of the burst data is determined, an FEC decoding type or FEC decoding type sequence corresponding to the length of the burst data is determined according to the length of the burst data and the correspondence between a data length and an FEC decoding type; and at last, decoding is performed according to the determined FEC decoding type or FEC decoding type sequence. In this case, a corresponding FEC decoding type sequence may be a combination of a series of decoding types. The correspondence between a data length and an FEC decoding type may be represented as a mapping table, or may be represented in other manners. The present disclosure sets no limitation. The corresponding mapping table is corresponding to Table 2. A range of a length of to-be-decoded burst data generated after coding is performed by using a fixed coding type sequence is also fixed, so that a decoding type sequence corresponding to the coding type sequence used for performing coding may be determined according to the length of to-be-decoded burst data.
[0095] According to the burst data coding method and decoding method, and the corresponding communications system that are provided in this embodiment of the present disclosure, a transmit end determines a forward error correction FEC coding type according to a length of to-be-coded data in burst data, and performs coding according to the determined FEC coding type. A receive end determines a forward error correction FEC decoding type according to a length of to-be-decoded data in received burst data, and performs decoding according to the determined FEC decoding type. The burst data coding method and decoding method, and the corresponding communications system that are provided in this embodiment of the present disclosure support different FEC coding and decoding types. Compared with a single FEC coding and decoding type, a coding and decoding type is flexibly selected according to the data length, thereby reducing a parity bit that needs to be sent, reducing redundancy, and improving utilization of a communication resource. In addition, because the transmit end and the receive end independently select an FEC coding and decoding type according to the data length, a corresponding FEC parameter does not need to be transmitted, thereby reducing a communication resource.
[0096] It may be understood that, when a corresponding data length is not enough for performing one-codeword decoding, decoding may be performed by using a shortened code (shortened code) manner. Certainly, decoding performed by using shortened code of an FEC decoding type still belongs to decoding performed by using the FEC decoding type. For example, decoding performed on a codeword by using shortened code of the first LDPC decoding type still belongs to decoding performed by using the first LDPC decoding type. Specifically, as shown in
[0097] In Embodiment 2, this embodiment of the present disclosure provides a burst data coding device, a burst data decoding device, and a corresponding communications system. The coding device and decoding device that are provided in this embodiment of the present disclosure may implement corresponding functions by using the coding method and decoding method that are provided in Embodiment 1, and in Embodiment 1, the corresponding coding method and decoding method may be implemented by using the coding device and decoding device that are provided in this embodiment. The two embodiments are based on a same principle, and implementation steps and technical details may be mutually supportive.
[0098] As shown in
[0099] Optionally, the FEC coding type determining module is specifically configured to: when L.sub.1>K.sub.1, determine the first FEC coding type corresponding to K.sub.1, where L.sub.1 is the length of the to-be-coded data, and K.sub.1 is a threshold corresponding to the first FEC coding type; or when K.sub.p?1?L.sub.1>K.sub.p, determine the p.sup.th FEC coding type corresponding to K.sub.p, where K.sub.p is a threshold corresponding to the p.sup.th FEC coding type, and K.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC coding type; or when L.sub.1?K.sub.m, determine the m.sup.th FEC coding type corresponding to K.sub.m, where K.sub.m is a threshold corresponding to the m.sup.th FEC coding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and K.sub.p?1>K.sub.p. The coding module is specifically configured to perform coding on the burst data by using the FEC coding type determined by the FEC coding type determining module.
[0100] Optionally, the FEC coding type determining module is specifically configured to: when the length of the to-be-coded data in the burst data is greater than K.sub.1, determine the first FEC coding type corresponding to K.sub.1, where K.sub.1 is a threshold corresponding to the first FEC coding type; or when the length of the to-be-coded data in the burst data is less than or equal to K.sub.p?1 and is greater than K.sub.p, determine the p.sup.th FEC coding type corresponding to K.sub.p, where K.sub.p is a threshold corresponding to the p.sup.th FEC coding type, and K.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC coding type; or when the length of the to-be-coded data in the burst data is less than or equal to K.sub.m and is greater than 0, determine the m.sup.th FEC coding type corresponding to K.sub.m, where K.sub.m is a threshold corresponding to the m.sup.th FEC coding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and K.sub.p?1>K.sub.p. The coding module is specifically configured to perform one-codeword coding according to the FEC coding type determined by the FEC coding type determining module.
[0101] Optionally, the threshold K.sub.1 corresponding to the first FEC coding type, the threshold K.sub.p?1 corresponding to the p?1.sup.th FEC coding type, the threshold K.sub.p corresponding to the p.sup.th FEC coding type, and the threshold K.sub.m corresponding to the m.sup.th FEC coding type are determined by using a principle that a total length of a parity bit included in data formed by performing coding on the burst data is the shortest. Optionally, K.sub.1 is equal to a value obtained by multiplying k.sub.2 by an integer part of a quotient obtained by dividing t.sub.1 by t.sub.2; K.sub.p?1 is equal to a value obtained by multiplying k.sub.p by an integer part of a quotient obtained by dividing t.sub.p?1 by t.sub.p; K.sub.p is equal to a value obtained by multiplying k.sub.p+1 by an integer part of a quotient obtained by dividing t.sub.p by t.sub.p+1; and K.sub.m is equal to a value obtained by multiplying k.sub.m by an integer part of a quotient obtained by dividing t.sub.m?1 by t.sub.m, where t.sub.1, t.sub.2, t.sub.p?1, t.sub.p, t.sub.m?1, and t.sub.m are respectively lengths of one-codeword parity bits of the first FEC coding type, the second FEC coding type, the p?1.sup.th FEC coding type, the p.sup.th FEC coding type, the m?1.sup.th FEC coding type, and the m.sup.th FEC coding type; and k.sub.2, k.sub.p, k.sub.p+1, and k.sub.m are respectively lengths of one-codeword information bits of the second FEC coding type, the p.sup.th FEC coding type, the p+1.sup.th FEC coding type, and the m.sup.th FEC coding type.
[0102] Optionally, the coding device further includes a data length determining module, configured to determine a length of the burst data. The FEC coding type determining module is specifically configured to: query the correspondence between a data length and an FEC coding type according to the length of the burst data, and determine an FEC coding type or an FEC coding type sequence corresponding to the length of the burst data; and the coding module is specifically configured to perform coding according to the determined FEC coding type or FEC coding type sequence.
[0103] In a scenario, the foregoing coding device may be a device in
[0104] As shown in
[0105] Optionally, the FEC decoding type determining module is specifically configured to: when L.sub.2>N.sub.1, determine the first FEC decoding type corresponding to N.sub.1, where L.sub.2 is the length of the to-be-decoded data, and N.sub.1 is a threshold corresponding to the first FEC decoding type; or when N.sub.p?1?L.sub.2>N.sub.p, determine the p.sup.th FEC decoding type corresponding to N.sub.p, where N.sub.p is a threshold corresponding to the p.sup.th FEC decoding type, and N.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC decoding type; or when L.sub.2?N.sub.m, determine the m.sup.th FEC decoding type corresponding to N.sub.m, where N.sub.m is a threshold corresponding to the m.sup.th FEC decoding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and N.sub.p?1>N.sub.p. The decoding module is specifically configured to perform decoding on the burst data according to the FEC decoding type determined by the FEC decoding type determining module.
[0106] Optionally, the FEC decoding type determining module is specifically configured to: when the length of the to-be-decoded data in the burst data is greater than N.sub.1, determine the first FEC decoding type corresponding to N.sub.1, where N.sub.1 is a threshold corresponding to the first FEC decoding type; or when the length of the to-be-decoded data in the burst data is less than or equal to N.sub.p?1 and is greater than N.sub.p, determine the p.sup.th FEC decoding type corresponding to N.sub.p, where N.sub.p is a threshold corresponding to the p.sup.th FEC decoding type, and N.sub.p?1 is a threshold corresponding to the p?1.sup.th FEC decoding type; or when the length of the to-be-decoded data in the burst data is less than or equal to N.sub.m and is greater than 0, determine the m.sup.th FEC decoding type corresponding to N.sub.m, where N.sub.m is a threshold corresponding to the m.sup.th FEC coding type, where m is an integer greater than or equal to 2, p is any integer in a range that is from 2 to m and that includes 2 and m, and N.sub.p?1>N.sub.p. The decoding module performs one-codeword decoding according to the FEC decoding type determined by the FEC decoding type determining module.
[0107] Optionally, the threshold K.sub.1 corresponding to the first FEC decoding type, the threshold K.sub.p?1 corresponding to the p?1.sup.th FEC decoding type, the threshold K.sub.p corresponding to the p.sup.th FEC decoding type, and the threshold K.sub.m corresponding to the m.sup.th FEC decoding type are determined by using a principle that a total length of a parity bit carried in the burst data is the shortest. Optionally, N.sub.1 is equal to a value obtained by multiplying n.sub.2 by an integer part of a quotient obtained by dividing t.sub.1 by t.sub.2; N.sub.p?1 is equal to a value obtained by multiplying n.sub.p by an integer part of a quotient obtained by dividing t.sub.p?1 by t.sub.p; N.sub.p is equal to a value obtained by multiplying n.sub.p+1 by an integer part of a quotient obtained by dividing t.sub.p by t.sub.p+1; and N.sub.m is equal to a value obtained by multiplying n.sub.m by an integer part of a quotient obtained by dividing t.sub.m?1 by t.sub.m, where t.sub.1, t.sub.2, t.sub.p?1, t.sub.p, t.sub.m?1, and t.sub.m are respectively lengths of one-codeword parity bits of the first FEC coding type, the second FEC coding type, the p?1.sup.th FEC coding type, the p.sup.th FEC coding type, the m?1.sup.th FEC coding type, and the m.sup.th FEC coding type; and n.sub.2, n.sub.p, n.sub.p+1, and n.sub.m are respectively one-codeword lengths of the second FEC coding type, the p.sup.th FEC coding type, the p+1.sup.th FEC coding type, and the m.sup.th FEC coding type.
[0108] Optionally, the decoding device further includes a data length determining module, configured to determine a length of the burst data. The FEC decoding type determining module is specifically configured to: query the correspondence between a data length and an FEC coding type according to the length of the burst data, and determine an FEC decoding type or an FEC decoding type sequence corresponding to the length of the burst data; and the decoding module is specifically configured to perform decoding according to the determined FEC decoding type or FEC decoding type sequence.
[0109] In a scenario, the foregoing decoding device may be a device in
[0110] According to the burst data coding device and decoding device, and the corresponding communications system that are provided in this embodiment of the present disclosure, the coding device at a transmit end determines a forward error correction FEC coding type according to a length of to-be-coded data in the burst data, and performs coding according to the determined FEC coding type. The decoding device at a receive end determines a forward error correction FEC decoding type according to a length of to-be-decoded data in received burst data, and performs decoding according to the determined FEC decoding type. The burst data coding device and decoding device, and the corresponding communications system that are provided in this embodiment of the present disclosure support different FEC coding and decoding types. Compared with a single FEC coding and decoding type, a coding and decoding type is flexibly selected according to the data length, thereby reducing a parity bit that needs to be sent, reducing redundancy, and improving utilization of a communication resource. In addition, because the transmit end and the receive end independently select an FEC coding and decoding type according to the data length, a corresponding FEC parameter does not need to be transmitted, thereby reducing a communication resource.
[0111] The communications system mentioned in Embodiment 1 and Embodiment 2 of the present disclosure includes the coding device and the decoding device that are provided in Embodiment 2. By using methods provided in Embodiment 1, it is implemented that a transmit end and a receive end independently select an FEC coding and decoding type according to a data length, and FEC coding and decoding can be implemented without a need to transmit a corresponding FEC parameter, thereby reducing a communication resource. Certainly, an FEC decoding type of the decoding device at the receive end is corresponding to an FEC coding type of the coding device at the transmit end. After a coding rule is configured, a length of to-be-coded data, a length of coded data, that is, a length of to-be-decoded data, an FEC coding type, and an FEC decoding type have a one-to-one correspondence. That is, a determined length of the to-be-coded data is corresponding to a determined FEC coding type. The length of the to-be-decoded data formed by performing coding by using the determined FEC coding type is also determined. The determined length of the to-be-decoded data is corresponding to a determined FEC decoding type, and original data can be restored by performing decoding on the to-be-decoded data by using the determined FEC decoding type.
[0112] A person of ordinary skill in the art may understand that all or a part of the steps of the method embodiments may be implemented by a program instructing relevant hardware. The program may be stored in a computer readable storage medium. When the program runs, the steps of the method embodiments are performed. The foregoing storage medium includes: any medium that can store program code, such as a ROM, a RAM, a magnetic disk, or an optical disc.
[0113] Finally, it should be noted that the foregoing embodiments are merely intended for describing the technical solutions of the present disclosure, but not for limiting the present disclosure. Although the present disclosure 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 or all technical features thereof, without departing from the scope of the technical solutions of the embodiments of the present disclosure.