Method and device for rate matching and polar encoding

11265108 · 2022-03-01

Assignee

Inventors

Cpc classification

International classification

Abstract

The present disclosure provides an encoding method and apparatus, and relates to the field of communications technologies, to reduce an encoding latency and complexity, and the amount of computation of real-time construction. The encoding method includes: obtaining information bits; determining a puncturing pattern, where the puncturing pattern includes an element in a puncturing set and an element in a shortening set, and the puncturing set and the shortening set have no intersection set; and performing, by using the determined puncturing pattern, rate matching on data obtained after the information bits are encoded.

Claims

1. A device for rate matching, comprising: a memory, and at least one processor, wherein the at least one processor is configured to: obtain information bits; determine a puncturing pattern, wherein the puncturing pattern comprises an element in a puncturing set and an element in a shortening set, the puncturing set and the shortening set have no intersection set; and perform, by using the determined puncturing pattern, rate matching on data obtained after the obtained information bits are encoded.

2. The device according to claim 1, wherein the puncturing pattern comprises |P| elements, |P| being equal to N−M, N being a mother code length, M being a code length, and N being equal to 2.sup.┌log.sup.2 .sup.M┐.

3. The device according to claim 1, wherein a quantity of elements in the puncturing pattern is |P|, when a code rate R is larger than ½, a quantity of elements in the shortening set |P2| is equal to └|P|×R1┘, and a quantity of elements in the puncturing set |P1| is equal to |P|−|P2|, R1 being ¾ or R; or when the code rate R is less than ⅓ and an information bit length is less than or equal to 64, or when R is equal to ⅓ and the code length M is not greater than 128, the quantity of elements in the puncturing set |P1| is equal to P, and the quantity of elements in the shortening set |P2| is equal to 0; or when the code rate R is larger than ⅓ and less than or equal to ½, or when the code rate R is less than ⅓ and the information bit length K is greater than 64, or when the code rate R is equal to ⅓ and the code length M is greater than 128, the quantity of elements in the shortening set |P2| is equal to └|P|×R2┘, and the quantity of elements in the puncturing set |P1| is equal to |P|−|P2|, wherein R2 is ⅔ or ½.

4. The device according to claim 1, wherein elements in the shortening set are selected from an initial sequence v1 with a length N, and elements in the puncturing set are selected from a bits reversal sequence v2 with a length N; and the initial sequence v1 is {0, 1, 2, . . . , N−1}, and the bits reversal sequence v2 is a sequence obtained by performing bits reversal on a binary form of each element in the initial sequence v1.

5. The device according to claim 4, wherein a quantity of elements in the puncturing set is |P1| and a quantity of elements in the shortening set is |P2|, the puncturing set comprises leading |P1| elements in the reversal sequence v2, and the shortening set comprises last |P2| elements in the initial sequence v1.

6. The device according to claim 4, wherein a quantity of elements in the puncturing set is |P1| and a quantity of elements in the shortening set is |P2|, and the at least one processor is further configured to: determine whether a first condition is met, the first condition comprising a code rate R is equal to ⅓, an information bit length K is less than 64, a code length M is greater than 128, an intersection set of leading |P1| elements in the reversal sequence v2 and the last |P2| elements in the initial sequence v1 is not an empty set, and a quantity of elements in the intersection set is |P1∩P2|, in response to the determination that the first condition is met, determine that the puncturing set comprises a first element set and a third element, the first element set comprising elements in the leading |P1| elements in the reversal sequence v2 other than |P1∩P2| elements, the third element set comprising leading C.sub.p elements in the reversal sequence v2 other than the first element set, and the |P1∩P2| elements comprising elements in the intersection set of the leading |P1| elements in the reversal sequence v2 and the last |P2| elements in the initial sequence v1, and determine that the shortening set comprises a second element set and a fourth element set, the second element set comprising elements in the last |P2| elements in the initial sequence v1 other than the |P1∩P2| elements, and the fourth element set comprising last C.sub.s elements in the initial sequence v1 other than the second element set and the third element set; and determine whether a second condition is met, the second condition comprising the code rate R is equal to ⅓, the information bit length K is less than 64, and the code length M is greater than 128, in response to the determination that the second condition is not met, determine that the puncturing set comprises leading |P1| elements in the bits reversal sequence v2, and the shortening set comprises last |P2| elements in the initial sequence v1 other than the elements in the puncturing set.

7. A device for encoding, comprising: a memory and at least one processor, wherein the at least one processor is configured to: obtain information bits, determine a frozen set comprising a first frozen subset, a second frozen subset, and a third frozen subset, wherein the third frozen subset is determined based on the first frozen subset and the second frozen subset, and the third frozen subset comprises elements with lowest reliability in an initial sequence v1 other than elements in the first frozen subset and elements in the second frozen subset; and perform polar encoding on the obtained information bits by using the determined frozen set.

8. A device for encoding, comprising: a memory and at least one processor, wherein the at least one processor is configured to: obtain information bits, determine a frozen set comprising a first frozen subset, a second frozen subset, and a third frozen subset, and the third frozen subset being determined based on the first frozen subset and the second frozen subset; and perform polar encoding on the obtained information bits by using the determined frozen set, wherein the second frozen set comprises |P2| elements, when a code rate R is larger than ½, a quantity of elements in the second frozen subset |F2| is equal to └|P|×R1┘, and a quantity of elements in the first frozen subset |F1| is equal to |P|−|P2|, wherein R1 is equal to ¾ or the code rate R, |P| is equal to N−M, N is a mother code length, M is a code length and N is equal to 2.sup.┌log.sup.2 .sup.M ┐; or when the code rate R is smaller than ⅓ and an information bit length K is less than or equal to 64, or when R is equal to ⅓ and the code length M is not greater than 128, the quantity of elements in the first frozen subset |F1| is equal to |P|, and the quantity of elements in the second frozen subset |F2| is equal to 0; or when the code rate R is larger than ⅓ and less than or equal to ½, or when the code rate R is less than ⅓ and the information bit length K is greater than 64, or when the code rate R is ⅓ and the code length M is greater than 128, the quantity of elements in the second frozen subset |F2| is equal to └|P|×R2┘, and the quantity of elements in the first frozen subset |F1| is equal to |P|−|F2|, wherein R2 is ⅔ or ½.

9. The device according to claim 8, wherein the first frozen subset comprises leading |F1| elements in an initial sequence v1 with a length N, and the second frozen subset comprises last |F2| elements in a bits reversal sequence v2 with a length N; and the initial sequence v1 is {0, 1, 2, . . . , N−1}, and the bits reversal sequence v2 is a sequence obtained by performing bits reversal on a binary form of each element in the initial sequence v1.

10. The device according to claim 8, wherein the third frozen subset comprises M−K elements with lowest reliability in the initial sequence other than the elements in the first frozen subset and the elements in the second frozen subset, wherein K is the information bit length.

11. A device for encoding, comprising: a memory and at least one processor, wherein the at least one processor is configured to: obtain information bits, determine a frozen set comprising a first frozen subset, a second frozen subset, and a third frozen subset, and the third frozen subset being determined based on the first frozen subset and the second frozen subset; and perform polar encoding on the obtained information bits by using the determined frozen set, wherein the at least one processor is further configured to: determine a puncturing pattern, wherein the puncturing pattern comprises a puncturing set and a shortening set, and the puncturing set and the shortening set have no intersection set; and perform rate matching on the encoded information bits by using the determined puncturing pattern.

12. The device according to claim 11, wherein a quantity of elements in the shortening set is the same as the quantity of elements in the second frozen set, and a quantity of elements in the puncturing set is the same as the quantity of elements in the first frozen subset.

13. A rate matching method, comprising: obtaining information bits; determining a puncturing pattern, wherein the puncturing pattern comprises an element in a puncturing set and an element in a shortening set, and the puncturing set and the shortening set have no intersection set; and performing, by using the determined puncturing pattern, rate matching on data obtained after the obtained information bits are encoded.

14. The method according to claim 13, wherein the puncturing pattern comprises |P| elements, |P| being equal to N−M, N being a mother code length, M being a code length, and N being equal to 2.sup.┌log.sup.2 .sup.M┐; when a code rare R is larger than ½, a quantity of elements in the shortening set |P2| is equal to └|P|×R1┘, and a quantity of elements in the puncturing set |P1| is equal to |P|−|P2|, wherein R1 is ¾ or R; or when the code rate is less than ⅓ and an information bit length K is less than or equal to 64, or when the code rate R is equal to ⅓ and the code length M is not greater than 128, the quantity of elements in the puncturing set |P1| is equal to |P|, and the quantity of elements in the shortening set |P2| is equal to 0; or when the code rate R is larger than ⅓ and less than or equal to ½, or when the code rate R is less than ⅓ and the information bit length K is greater than 64, or when the code rate R is ⅓ and the code length M is greater than 128, the quantity of elements in the shortening set |P2| is equal to └|P|×R2┘, and the quantity of elements in the puncturing set |P1| is equal to |P|−|P2|, wherein R2 is ⅔ or ½.

15. A polar encoding method, comprising: obtaining information bits; determining a frozen set, wherein the frozen set comprises a first frozen subset, a second frozen subset, and a third frozen subset, the third frozen subset is determined based on the first frozen subset and the second frozen subset, and the third frozen subset comprises elements with lowest reliability in an initial sequence other than elements in the first frozen subset and elements in the second frozen subset; and performing polar encoding on the obtained information bits by using the determined frozen set.

16. A polar encoding method, comprising: obtaining information bits; determining a frozen set, wherein the frozen set comprises a first frozen subset, a second frozen subset, and a third frozen subset, and the third frozen subset is determined based on the first frozen subset and the second frozen subset; and performing polar encoding on the obtained information bits by using the determined frozen set, wherein the second frozen set comprises |P2| elements, when a code rate R is larger than ½, a quantity of elements in the second frozen subset |F2| is equal to └|P|×R1┘, and a quantity of elements in the first frozen subset |F1| is equal to |P|−|P2|, wherein R1 is ¾ or the code rate R, |P| is equal to N−M, N is a mother code length, M is a code length, and N is equal to 2.sup.┌log.sup.2 .sup.M┐; or when the code rate R is less than ⅓ and an information bit length K is less than or equal to 64, or when the code rate R is equal to ⅓ and the code length M is not greater than 128, the quantity of elements in the first frozen subset |F1| is equal to |P|, and the quantity of elements in the second frozen subset |F2| is equal to 0; or when the code rate R is larger than ⅓ and less than or equal to ½, or when the code rate R is less than ⅓ and the information bit length K is greater than 64, or when the code rate R is equal to ⅓ and the code length M is greater than 128, the quantity of elements in the second frozen subset |F2| is equal to └|P|×R2┘, and the quantity of elements in the first frozen subset |F1| is equal to |P|−|F2|, wherein R2 is ⅔ or ½.

17. A computer program product comprising a non-transitory computer-readable medium storing computer executable instructions, that when executed by at least one processor, cause the at least one processor to: obtain information bits; determine a puncturing pattern, wherein the puncturing pattern comprises an element in a puncturing set and an element in a shortening set, and the puncturing set and the shortening set have no intersection set; and perform, by using the determined puncturing pattern, rate matching on data obtained after the obtained information bits are encoded.

18. A computer program product comprising a non-transitory computer-readable medium storing computer executable instructions, that when executed by at least one processor, cause the at least one processor to: obtain information bits; determine a frozen set, wherein the frozen set comprises a first frozen subset, a second frozen subset, and a third frozen subset, third frozen subset is determined based on the first frozen subset and the second frozen subset, and the third frozen subset comprises elements with lowest reliability in an initial sequence other than elements in the first frozen subset and elements in the second frozen subset; and perform polar encoding on the obtained information bits by using the determined frozen set.

19. A computer program product, comprising computer executable instructions stored on a non-transitory computer-readable medium, wherein when the instructions are executed by at least one processor, the instructions cause the at least one processor to: obtain information bits; determine a puncturing pattern, wherein the puncturing pattern comprises an element in a puncturing set and an element in a shortening set, and the puncturing set and the shortening set have no intersection set; and perform, by using the determined puncturing pattern, rate matching on data obtained after the obtained information bits are encoded.

20. A computer program product, comprising computer executable instructions stored on a non-transitory computer-readable medium, wherein when the instructions are executed by at least one processor, the instructions cause the at least one processor to: obtain information bits; determine a frozen set, wherein the frozen set comprises a first frozen subset, a second frozen subset, and a third frozen subset, the third frozen subset is determined based on the first frozen subset and the second frozen subset, and the third frozen subset comprises elements with lowest reliability in an initial sequence other than elements in the first frozen subset and elements in the second frozen subset; and perform polar encoding on the obtained information bits by using the determined frozen set.

Description

BRIEF DESCRIPTION OF DRAWINGS

(1) FIG. 1 is a schematic diagram of a polar encoding process according to an embodiment of the present disclosure;

(2) FIG. 2 shows a puncturing pattern generation process according to an embodiment of the present disclosure;

(3) FIG. 3(a), FIG. 3(b) and FIG. 3(c) show simulation results according to an embodiment of the present disclosure;

(4) FIG. 4 is a flow chart of generating a frozen set according to an embodiment of the present disclosure;

(5) FIG. 5 is a flow chart of jointly generating a puncturing pattern and a frozen set according to an embodiment of the present disclosure;

(6) FIG. 6 is a schematic structural diagram of an encoding device for generating a puncturing pattern according to an embodiment of the present disclosure; and

(7) FIG. 7 is a schematic diagram of a logical structure of an encoding device for generating a puncturing pattern according to an embodiment of the present disclosure.

DESCRIPTION OF EMBODIMENTS

(8) Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. In the following detailed descriptions, numerous specific details are set forth in order to provide a thorough understanding of the subject matter presented herein. However, it will be apparent to one skilled in the art that the subject matter may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the embodiments.

(9) The embodiments provided in the present invention are mainly applied to various communications systems supporting polar code encoding, including but not limited to a digital signal processing unit or a baseband processing unit in a communications system, and any functional unit or circuit supporting polar code encoding and decoding. All embodiments of the present invention may be applied to various network devices and terminals. The network device includes but is not limited to an LTE evolved E-UTRAN NodeB (eNB), a next generation NodeB (gNB), a relay node (RN), an access point device, and any network device accessing user equipment (UE). The terminal includes but is not limited to a mobile phone, an intelligent terminal, a tablet computer, a laptop computer, a video game console, a multimedia player, a computer, an access point (connected to a network by using a wireless link), and the like.

(10) In embodiments of this application, a puncturing pattern is a set of locations at which the encoded bits are discarded. On an input side of an encoder, the reliability at some locations (also referred to as subchannels) of bits is lower than a threshold and cannot be used for information bits transmission, and the bits at these locations are set to fixed bits. A set of locations of the fixed bits is called a frozen set. Rate matching means that encoded bits are retransmitted or punctured to match a bearer capability of a physical channel and reach a bit rate required for a transmission format during channel mapping. In embodiments of this application, rate matching is mainly implemented by using a puncturing pattern.

(11) FIG. 1 is a schematic diagram of a polar encoding process according to an embodiment of this application. The polar encoding process 100 shown in FIG. 1 mainly includes an encoding information generation process 110 and an encoding process 120. The encoding information generation process 110 includes determining a puncturing pattern 111 and/or determining a frozen set 112. Correspondingly, the encoding process 120 includes performing polar encoding 121 and/or performing rate matching 122. The puncturing pattern and the frozen set generated in the encoding information generation process 110 are used in the encoding process 120. The frozen set is used for selecting information bits in the polar encoding 121, and the puncturing pattern is used for performing rate matching in the rate matching 122.

(12) Specifically, in the encoding information generation process 110, the puncturing pattern is generated in the process of determining a puncturing pattern 111. The puncturing pattern includes a union set of a puncturing set and a shortening set, and the puncturing set and the shortening set have no intersection set. The puncturing set is a set of locations at which the encoded bits that generated by using a puncturing algorithm are discarded, and the shortening set is a set of locations at which encoded bits that generated by using a shortening algorithm are discarded. It should be understood that the puncturing algorithm and the shortening algorithm are merely examples, and any other improved algorithm or replacement algorithm similar to the puncturing algorithm or the shortening algorithm also falls within the protection scope of the present invention. In the encoding information generation process 110, the frozen set is generated in the process of determining a frozen set 112. The frozen set includes a union set of a first frozen subset, a second frozen subset, and a third frozen subset, and the third frozen subset is determined based on the first frozen subset and the second frozen subset.

(13) The puncturing pattern and the frozen set may be independently generated, or may be generated together. This is not limited in embodiments of the present disclosure.

(14) After the puncturing pattern and the frozen set are obtained, polar coding is performed in the polar encoding 121 by using the frozen set, and rate matching is performed in the rate matching 122 by using the puncturing pattern.

(15) The solution in this embodiment is a polar coding scheme that can meet both a low-latency requirement and a low-complexity requirement, and a polar coding scheme that achieves good performance when a channel and a code length frequently change.

(16) FIG. 2 shows a puncturing pattern generation process according to an embodiment of this application. Referring to FIG. 2, the process describes a puncturing pattern generation method in FIG. 1 in detail, and includes the following steps.

(17) S201: Obtain information bits.

(18) The information bits are usually a bit string including user data or processed user data.

(19) S202: Determine a puncturing pattern, where the puncturing pattern includes a union set of a puncturing set and a shortening set, and the puncturing set and the shortening set have no intersection set.

(20) In this embodiment, a puncturing algorithm and a shortening algorithm are jointly used to generate the puncturing pattern, where the puncturing algorithm is used to generate the puncturing set, and the shortening algorithm is used to generate the shortening set. It should be understood that the puncturing algorithm and the shortening algorithm are merely examples, and any other improved algorithm or replacement algorithm similar to the puncturing algorithm or the shortening algorithm also falls within the protection scope of the present invention. In this embodiment, the puncturing algorithm and the shortening algorithm are merely used as an example but not limitation.

(21) Optionally, the puncturing pattern includes |P|=N−M elements, where N=2.sup.┌log.sup.2 .sup.M┐ is a mother code length, M is a code length, a symbol ┌┐ represents rounding up, a symbol ∥ represents a quantity of elements in a set, and |P|, N, and M are all positive integers.

(22) Optionally, a quantity of elements in the puncturing set P1 is |P1| (which is a positive integer), and a quantity of elements in the shortening set P2 is |P2| (which is a positive integer). The quantity of elements in the two sets and the quantity |P| of elements of the puncturing pattern are determined based on the following:

(23) When R>½, |P2|=┌|P|×R1┐ and |P1|=|P|−|P2|, where a symbol └ ┘ represents rounding down, and R is a code rate, where R1 is ¾ or R.

(24) Alternatively, when R<⅓ and an information bits length K is less than or equal to 64, or when R is equal to ⅓ and the code length M is not greater than 128, the quantity of elements in the puncturing set |P1|=|P|, and the quantity of elements in the shortening set |P2|=0.

(25) Alternatively, when ⅓<R≤½, or when R<⅓ and an information bits length K is greater than 64, or when R=⅓ and the code length M is greater than 128, the quantity of elements in the shortening set |P2|=└|P|×R2┘, and the quantity of elements in the puncturing set |P1=|P|−|P2, where R2 is ⅔ or ½.

(26) Optionally, a method for selecting elements for the puncturing set and the shortening set may be as follows: elements in the shortening set are selected from an initial sequence v1 with length N, and elements in the puncturing set are selected from a bits reversal sequence v2 with length N. The initial sequence v1 with length N is {0, 1, 2, . . . , N−1}, and the bits reversal sequence v2 is a sequence obtained by performing bits reversal on a binary form of each element in the initial sequence v1.

(27) If an intersection set of leading |P1| elements in the reversal sequence v2 and last |P2| elements in the initial sequence v1 is empty, the puncturing set includes the leading |P1| elements in the bits reversal sequence v2, and the shortening set includes the last |P2| elements in the initial sequence v1.

(28) If the code rate R is equal to ⅓, the information bits length K is less than 64, the code length M is greater than 128, an intersection set of leading |P1| elements in the reversal sequence v2 and the last |P2| elements in the initial sequence v1 is not an empty set, and a quantity of elements in the intersection set is |P1∩P2|, the puncturing set includes a first element set and a third element set, the first element set includes elements in the leading |P1| elements in the reversal sequence v2 other than |P1∩P2| elements, the third element set includes leading C.sub.p elements in the reversal sequence v2 other than the first element set, and the |P1∩P2| elements include an element in the intersection set of the leading |P1| elements in the reversal sequence v2 and the last |P2| elements in the initial sequence v1; and the shortening set includes a second element set and a fourth element set, the second element set includes elements in the last |P2| elements in the initial sequence v1 other than the |P1∩P2| elements, and the fourth element set includes last C.sub.s elements in the initial sequence v1 other than the second element set and the third element set, where a maximum difference between C.sub.p and C.sub.s is 1, a sum of C.sub.p and C.sub.s is |P1∩P2|, and |P1∩P2|, C.sub.p, and C.sub.S are all positive integers.

(29) If the following conditions are not met: the code rate R is equal to ⅓, the information bits length K is less than 64, and the code length M is greater than 128, the puncturing set includes leading |P1| elements in the bits reversal sequence v2, and the shortening set includes last |P2| elements in the initial sequence v1 other than the elements in the puncturing set.

(30) Specifically, that the puncturing set P1 and the shortening set P2 have no intersection set may be implemented by using the following method. No intersection set means that the puncturing set P1 and the shortening set P2 have no common elements. The method is as follows:

(31) S2021: Obtain the leading |P1| elements in the reversal sequence v2 as the elements in the puncturing set P1:

(32) (a) Initialize the sequence v1 {0, 1, 2, . . . , N−1} with length N, where v1 is referred to as the initial sequence, and N is the mother code length.

(33) (b) Perform bits reverse on a binary sequence of each element in the initial sequence v1 with length N, to obtain a new sequence v2={0, N/2, . . . , N −1}, where v2 is referred to as the bits reversal sequence. Bits reverse performed on the binary sequence comprises, for example, a binary form of a sequence 1 is 0001 and a binary 1000 is obtained after bit reversal. In other words, the sequence 1 changes from 1 to 8. Herein, it is assumed that N is represented by using only four bits, and any other length is represented in a similar manner. It should be understood that this embodiment may support initial sequences with different lengths. Because the sequences have different lengths, elements in the sequences have different binary bit lengths. Any other modifications or replacements readily figured out by a person of ordinary skill in the art shall fall within the technical scope disclosed in the embodiments of the present invention.

(34) (c) Select the leading |P1| elements in the bits reversal sequence v2 and add to the puncturing set P1.

(35) S2022: Obtain the last |P2| elements in the initial sequence v1, and add the last |P2| elements to the shortening set.

(36) A method comprises: generating a sequence {N−|P2|, N−|P2|+1, N−|P2|+2, . . . , N−1} and adding the sequence {N−|P2|, N−|P2|+1, N−|P2|+2, . . . , N−1} to the set P2. A codeword of the puncturing pattern generated by using a truncation method is known, therefore, bits generated by the truncation method at puncturing locations are decoded as known codeword during decoding process.

(37) S2023: If the intersection set of the puncturing set P1 obtained in step S2021 and the shortening set P2 obtained in step S2022 is not an empty set, perform the following operations:

(38) If |P1∩P2|≠∅, where the symbol ∩ indicates an intersection set obtained from two sets, a quantity of elements in the intersection set is |P1∩P2, and ϕ indicates that a set is an empty set (in other words, two sets have no intersection set):

(39) when R is equal to ⅓, the information bits length K is less than 64, and the code length M is greater than 128, a repeated element is separately removed from the puncturing set and the shortening set, to obtain the first element set of the puncturing set and the second element set of the shortening set; then the first C.sub.p elements are selected from elements in the reversal sequence v2 other than the first element set to obtain the third element set, and the third element set is added to the puncturing set, where C.sub.p=└½.Math.|P1∩P2|┘ or C.sub.p=┌½.Math.|P1∩P2|; and the last C.sub.s elements are selected from elements in the initial sequence v1 other than the second element set and the third element set to obtain the fourth element set; in this case, the puncturing set includes the first element set and the third element set, and the shortening set includes the second element set and the fourth element set, where C.sub.s=┌½.Math.|P1∩P2┐ or C.sub.s=└½.Math.|P1∩P2|┘, the maximum difference between C.sub.p and C.sub.s is 1, and the sum of C.sub.p and C.sub.s is |P1∩P2|; or

(40) if the following conditions are not met: the code rate R is equal to ⅓, the information bits length K is less than 64, and the code length M is greater than 128, the puncturing set includes the leading |P1| elements in the bits reversal sequence v2, and the shortening set includes the last |P2| elements in the initial sequence v1 other than the elements in the puncturing set.

(41) Through processing in S2023, the intersection set of the puncturing set and the shortening may be ensured to be empty.

(42) S203: Perform rate matching on the information bits by using the determined puncturing pattern.

(43) A puncturing operation performed by using the determined puncturing pattern meets an output code rate requirement of a system.

(44) In this embodiment, a puncturing pattern may be flexibly generated for any different code rate and information bits length. In this embodiment, different code rates and information lengths are simulated, and performance degradation caused by using the solution in this embodiment is less than 0.3 dB compared with performance degradation caused by using a GA-construction-based Quasi-uniform Puncturing (QUP) algorithm. Table 1 lists performance simulation parameters.

(45) TABLE-US-00001 TABLE 1 Simulation parameters Channel AWGN Modulation BPSK Frozen set selection PW/GA Codeword construction CA-Polar with 11-bit CRC Puncturing pattern Proposed/QUP Decoding algorithm CA-SCL with L = 8 Information block size K = [200, 120, 80] Code rate R = [1/6, 1/3, 1/2, 2/3]

(46) A channel used for simulation is an AWGN channel, a modulation scheme is binary phase shift keying (BPSK). Frozen set selection manners are PW and GA. A codeword is constructed by using an 11-bit cyclic redundancy check aided polar (CA-Polar) code. A puncturing pattern is generated according to the method in the foregoing embodiment, and a comparison solution is a QUP solution. A cyclic redundancy check aided successive cancellation list (CA-SCL) with length 8 is used as a decoding algorithm. An information block size is 200, 120, or 80, and a code rate is ⅙, ⅓, ½, or ⅔. FIG. 3(a) to FIG. 3(c) show simulation results according to an embodiment of this application. It can be seen from the simulation results that, when the puncturing pattern in this embodiment is used for puncturing, performance degradation is very small compared with the GA-construction-based QUP solution, and density evolution or Gaussian approximation does not need to be performed, thereby the computing complexity decreased. The solution in the present invention features in a low latency and low complexity, and therefore can be applied to an application scenario of a low-latency system.

(47) According to this embodiment of the present invention, an advantage of an existing puncturing solution can be considered, the puncturing pattern is easy to be selected and implemented, and the requirements of low-latency and low-complexity can be met. When a code rate of encoding changes, a puncturing pattern may be generated quickly, and therefore a performance requirement may be met.

(48) The following describes an example embodiment using the foregoing puncturing pattern generation process. In this embodiment, encoding parameter information is M=12, K=6, and R=½.

(49) Step 1: Calculate a mother code length N=2.sup.┌log.sup.2 .sup.12┐=16 of a polar code.

(50) Step 2: Calculate a length |P|=N−M=4 of a puncturing pattern, where when the code rate R is not greater than ½, |P2|=└|P|/2┘=2, and |P1|=2.

(51) Step 3: Determine elements of the puncturing pattern:

(52) (1) Determine elements in P1: An initial sequence is v1={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, and a bits reversal sequence is v2={0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}; if two leading elements in v2 are selected and added to the set P1, P1={0, 8} is obtained.

(53) (2) Determine elements P2={14, 15} is obtained, and the bits at these locations are treated as known during decoding.

(54) (3) Determine the puncturing pattern: P=P1∪P2={0, 8, 14, 15}.

(55) In another embodiment, encoding parameter information is M=24, K=16, and R=⅔.

(56) Step 1: Calculate a mother code length N=2.sup.┌log.sup.2 .sup.24 ┐=32 of a polar code.

(57) Step 2: Calculate a length “|P|=N−M=8” of a puncturing pattern, where when the code rate R is greater than ½, |P2|=└|P|×⅔|=5 and |P1|=3 are obtained.

(58) Step 3: Determine elements of the puncturing pattern:

(59) (1) Determine elements in P1: An initial sequence is

(60) v1={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}, and a bits reversal sequence is

(61) v2 {0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31};

(62) if leading three elements in v2 are selected and added to the set P1, P1={0, 16, 8} is obtained.

(63) (2) Determine elements of P2: P2={27, 28, 29, 30, 31} is obtained, and bits at these locations are treated as known during decoding.

(64) (3) Determine the puncturing pattern: P=P1∪P2={0, 16, 8, 27, 28, 29, 30, 31}.

(65) The foregoing embodiments are only used to describe the puncturing pattern generation method, but are not limited to the foregoing encoding parameter information. It should be understood that a puncturing pattern may be obtained for any encoding parameter information by using the foregoing puncturing pattern generation methods. Any other modifications or replacements readily figured out by a person of ordinary skill in the art shall fall within the technical scope disclosed in the embodiments of the present invention.

(66) In an optional solution, a puncturing pattern may not need to be dynamically calculated based on a code rate and an information bits length. Generally, in a communications system, choices of the code rate and an information bits length are limited. In addition, once the code rate and an information bits length are selected, the code rate and the information bits length remain unchanged in a specific time period. Therefore, the puncturing pattern does not need to be dynamically calculated each time. Some code rates and information bits lengths that need to be used may be predefined. During encoding, after a code rate and an information bits length are obtained, a puncturing pattern may be directly obtained through table lookup.

(67) Specifically, the puncturing pattern is usually determined by using a modulation and coding scheme (MCS). According to the foregoing embodiment, the following puncturing pattern table may be obtained.

(68) TABLE-US-00002 TABLE 2 Puncturing pattern Index M K R Puncturing pattern 0 24 16 2/3 {0, 8, 16, 27, 28, 29, 30, 31} 1 240 120 1/2 {0, 128, 64, 192, 32, 160, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255} 2 56 42 3/4 {0, 2, 32, 59, 60, 61, 62, 63}

(69) It should be understood that the foregoing is merely an example, and does not represent all possible scenarios of an actually applied puncturing pattern. In actual encoding, corresponding puncturing patterns may be obtained for different code lengths, information bits lengths, and code rates. A standard index may be an MCS index, and the MCS index may be used to distinguish different code rates and/or different information bits lengths. The index is mainly used to determine encoding parameter information corresponding to the index. A specific definition may depend on an actual protocol definition. Any other modifications or replacements readily figured out by a person of ordinary skill in the art shall fall within the technical scope disclosed in the embodiments of the present invention.

(70) In this embodiment, puncturing patterns and frozen sets corresponding to some encoding parameter information are pre-calculated, so that the puncturing patterns and the frozen sets may be obtained quickly through table lookup. Therefore, an implementation is simple, and a low-latency requirement is met.

(71) FIG. 4 is a flow chart of generating a frozen set according to an embodiment of this application. Referring to FIG. 4, the method describes the frozen set generation method in FIG. 1 in detail, and includes the following steps.

(72) S401: Obtain information bits.

(73) S402: Determine a frozen set, where the frozen set is a union set of a first frozen subset, a second frozen subset, and a third frozen subset, and the third frozen subset is determined based on the first frozen subset and the second frozen subset.

(74) A quantity of elements in the first frozen subset is |F1|, and is the same as the quantity of elements in the puncturing set |P1| in the foregoing embodiments. A quantity of elements in the second frozen subset is |F2|, and is the same as the quantity of elements in the shortening set |P2| in the foregoing embodiments.

(75) In an embodiment, when R>½, the quantity of elements in the second frozen subset |F2|=└|P|×R1┘, and the quantity of elements in the first frozen subset |F1|=|P|−|P2|, where R1 is ¾ or R, |P|=N−M, N=2.sup.┌log.sup.2 .sup.M┐ is a mother code length, and M is a code length.

(76) Alternatively, when R<⅓ and an information bits length K is less than or equal to 64, or when R is equal to ⅓ and the code length M is not greater than 128, the quantity of elements in the first frozen subset |F1|=|P|, and the quantity of elements in the second frozen subset |F2|=0.

(77) Alternatively, when ⅓ CRS ½ or when R<⅓ and an information bits length K is greater than 64, or when R=⅓ and the code length M is greater than 128, the quantity of elements in the second frozen subset |F2|=└|P|×R2┘, and the quantity of elements in the first frozen subset |F1|=|P|−|F2|, where R2 is ⅔ or ½.

(78) After the quantity of elements in the first frozen subset and the quantity of elements in the second frozen subset are determined, elements in the frozen set F need to be further determined. A method is as follows: The first frozen subset includes leading |F1| elements in an initial sequence v1 with length N, and the second frozen subset includes last |F2| elements in a bits reversal sequence v2 with length N. The initial sequence v1 with length N is {0, 1, 2, . . . , N−1}, and the bits reversal sequence v2 is a sequence obtained by performing bits reversal on a binary form of each element in the initial sequence v1. The third frozen subset includes M−K elements with lowest reliability in the initial sequence other than the elements in the first frozen subset and the elements in the second frozen subset, where K is the information bits length, and M is the code length.

(79) Specifically, the method for determining an element in the frozen set is as follows:

(80) S4021: Determine elements of the first frozen subset, where the first frozen subset includes the leading |F1| elements in the initial sequence v1. In other words, the leading |F1| elements in the initial sequence v1 are selected as the elements in the first frozen subset F1, and F1={0, 1, 2, . . . , |P1|−1}.

(81) S4022: Determine an element in the second frozen subset, where the second frozen subset includes the last |F2| elements in the bits reversal sequence v2 with length N. In other words, the last |F2| elements in the bits reversal sequence v2 are selected and added to the second frozen subset F2.

(82) S4023: Determine the third frozen subset F3, where the third frozen subset includes the M−K elements with lowest reliability in the initial sequence other than the elements in the first frozen subset and the elements in the second frozen subset. In other words, the third frozen subset includes leading M−K elements in a sequence that is obtained after the elements of the first frozen subset and the elements of the second frozen subset are removed from a sequence obtained by sorting reliability measurement values at all locations in an input sequence in ascending order.

(83) Specifically, a method for determining the third frozen subset is as follows: First, a reliability measurement value at each of N locations in the input sequence is calculated by using a PW algorithm. Then, the reliability measurement values at each location of the input sequence are sorted in ascending order to obtain a sorted sequence S, elements included in the first frozen subset F1 and the second frozen subset F2 are removed from the sequence S to obtain a sequence S′, and the first M−K element of the sequence S′ are selected as the frozen subset F3.

(84) A method for calculating the reliability measurement value at each location is as follows: It is assumed that a location in the input sequence is i, and a binary of i is represented as i=B.sub.n-1, B.sub.n-2, . . . , B.sub.0, where B.sub.j∈{0,1}, j=[0, 1, . . . , n−1]. A calculation expression is as follows:

(85) W i = .Math. j = 0 n - 1 B j × 2 j × 1 4

(86) Herein, n=log.sub.2 N, and W.sub.i represents a reliability measurement value at the location i in the input sequence.

(87) S4024: The frozen set F is a union set of the determined first frozen subset F1, the determined second frozen subset F2, and the determined third frozen subset F3, in other words, F=F1∪F2∪F3.

(88) S403: Perform polar encoding on the information bits by using the frozen set F.

(89) According to this embodiment, the frozen set F may be quickly generated, to meet a low-latency requirement and a low-complexity requirement in an application scenario. With reference to the simulation performance in FIG. 3(a) to FIG. 3(c), when polar code encoding is performed by using the frozen set F in this embodiment, performance degradation is less than 0.3 dB compared with performance degradation caused by using the GA-based QUP algorithm, and complexity is greatly reduced. Therefore, a low-latency requirement in future 5G may be met.

(90) The following describes an example embodiment using the foregoing frozen set generation process. In this embodiment, encoding parameter information is M=12, K=6, and R=½.

(91) Step 1: Calculate a mother code length N=2.sup.┌log.sup.2 .sup.12┐=16 of a polar code.

(92) Step 2: Calculate a length |P|=N−M=4 of a puncturing pattern, where when a code rate R is not greater than ½, |F2=└|P|/2┘=2, and |F1|=2.

(93) Step 3: Determine the frozen set F.

(94) (1) Determine the elements of the first frozen subset F1: An initial sequence is v1={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, a bits reversal sequence is v2={0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}, and F1={0, 1}.

(95) (2) Determine the elements of the second frozen subset F2: F2={7, 15}.

(96) (3) Determine the third frozen subset F3: A sequence that is obtained based on the PW by sorting reliability at a bit location and with code length 16 is: S={0, 1, 2, 4, 8, 3, 5, 6, 9, 10, 12, 7, 11, 13, 14, 15}; because {0, 1, 7, 15} is already selected as the frozen set F, a set obtained by removing these elements is {2, 4, 8, 3, 5, 6, 9, 10, 12, 11, 13, 14}, then the leading six elements are selected and added to the set, and F3={2, 4, 8, 3, 5, 6}.

(97) (4) Determine the frozen set F=F1∪F2∪F3={0, 1, 2, 3, 4, 5, 6, 7, 8, 15}.

(98) In another instance, encoding parameter information is M=24, K=16, and R=⅔.

(99) Step 1: Calculate a mother code length N=2.sup.┌log.sup.2 .sup.24┐=32 of a polar code.

(100) Step 2: Calculate a length |P|=N−M=8 of a puncturing pattern, where when a code rate R is greater than ½, |F2|=└|P|×⅔┘=5, and |F1|=3.

(101) Step 3: Determine the frozen set F.

(102) (1) Determine the elements of the first frozen subset F1: An initial sequence is: v1={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31},

(103) a bits reversal sequence is: v2={0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31} and F1={0, 1, 2}.

(104) (2) Determine the elements of the second frozen subset F2: F2={27, 7, 23, 15, 31}.

(105) (3) Determine the elements of the third frozen subset F3: A sequence that is obtained based on the PW by sorting reliability at a bit location and with code length 16 is:

(106) S={0, 1, 2, 4, 8, 16, 3, 5, 6, 9, 10, 17, 12, 18, 20, 7, 24, 11, 13, 19, 14, 21, 22, 25, 26, 28, 15, 23, 27, 29, 30, 31};

(107) because {0, 1, 2, 7, 15, 23, 27, 31} is already selected as the frozen set, a set obtained by removing these elements is:

(108) {4, 8, 16, 3, 5, 6, 9, 10, 17, 12, 18, 20, 24, 11, 13, 19, 14, 21, 22, 25, 26, 28, 29, 30}, then leading eight elements are selected and added to the set, and F3={4, 8, 16, 3, 5, 6, 9, 10}.

(109) (4) Determine the frozen set F=F1∪F2∪F3={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 16, 23, 27, 31}.

(110) The foregoing instances are only used to describe the frozen set generation method, but are not limited to the foregoing encoding parameter information. It should be understood that a frozen subset may be obtained for any encoding parameter information by using the foregoing frozen set generation methods. Any other modifications or replacements readily figured out by a person of ordinary skill in the art shall fall within the technical scope disclosed in the embodiments of the present invention.

(111) In an optional solution, a frozen set may not need to be dynamically calculated based on a code rate and an information bits length. Generally, in a communications system, choices for a code rate and an information length are limited. In addition, once a code rate and an information bits length are selected, the code rate and the information bits length remain unchanged in a specific time period. Therefore, the frozen set does not need to be dynamically calculated each time. Some code rates and information bits lengths that need to be used may be predefined. During encoding, after a code rate and an information bits length are obtained, a frozen set may be directly obtained through table lookup.

(112) Specifically, the frozen set is usually determined by using a modulation and coding scheme (MCS). According to the foregoing embodiments, the following frozen set may be obtained as an example:

(113) TABLE-US-00003 TABLE 3 Frozen set Index M K R Frozen set 0 24 16 2/3 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 16, 23, 27, 31} 1 56 42 3/4 {0, 1, 2, 55, 15, 47, 31, 63, 4, 8, 16, 3, 32, 5, 6, 9, 10, 17, 12, 18, 33, 20}

(114) It should be understood that the foregoing is merely an example, and does not represent all possible scenarios of an actually applied frozen set. In actual encoding, corresponding frozen sets may be obtained for different code lengths, information bits lengths, and code rates. A standard index may be an MCS index, and is mainly used to determine encoding parameter information corresponding to the index. A specific definition may depend on an actual protocol definition. Any other modifications or replacements readily figured out by a person of ordinary skill in the art shall fall within the technical scope disclosed in the embodiments of the present invention.

(115) In this embodiment, puncturing patterns and frozen sets corresponding to some encoding parameter information are pre-calculated, so that the puncturing patterns and the frozen sets can be obtained quickly through table lookup. Therefore, an implementation is simple, and a low-latency requirement is met.

(116) In the foregoing embodiments, the puncturing pattern and the frozen set are independently generated. In a possible solution, a puncturing pattern and a frozen set may be jointly generated, in other words, both the puncturing pattern and the frozen set are generated.

(117) FIG. 5 is a flow chart of jointly generating a puncturing pattern P and a frozen set F according to an embodiment of the present disclosure. Referring to FIG. 5, in this embodiment, the frozen set F and the puncturing pattern P are jointly generated, and the puncturing pattern P and the frozen set F do not need to be separately generated. The following steps are included.

(118) S501 is the same as step S401.

(119) S502 is the same as S402. However, in this step, a quantity of elements in the puncturing pattern |P|=N−M, where N=2.sup.┌log.sup.2 .sup.M┐ is a mother code length, and M is a code length, a quantity of elements in a shortening set |P2|, and a quantity of elements in a puncturing set |P1| are all determined, and the quantity of elements in the shortening set |P2| is the same as a quantity of elements in a second frozen set |F2|, and the quantity of elements in the puncturing set |P1| is the same as a quantity of elements in a first frozen subset |F1|. Other details of this step are described in S402.

(120) S503: Determine the puncturing pattern P, where the puncturing pattern P includes a union set of the puncturing set P1 and the shortening set P2, and the puncturing set P1 and the shortening set P2 have no intersection set.

(121) A method for determining the puncturing pattern P is the same as that in step S202 in FIG. 2.

(122) S504: Perform encoding and rate matching by using the frozen set F and the puncturing pattern P.

(123) The following describes an example process for jointly generating a puncturing pattern P and a frozen set F. In this embodiment, input encoding parameter information is M=12, K=6, and R=½.

(124) Step 1: Calculate a mother code length N=2.sup.┌log.sup.2 .sup.12┐=16 of a polar code.

(125) Step 2: Calculate a length |P|=N−M=4 of a puncturing pattern, where when the code rate R is not greater than ½, |P2|=└|P|/2┘=2, and |P1|=2.

(126) Step 3: Determine the frozen set F:

(127) (1) Determine the elements of the first frozen subset F1: An initial sequence is v1={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, and a bits reversal sequence is v2={0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15}; and if two leading elements in the initial sequence are selected, F1={0, 1} is obtained.

(128) (2) Determine the elements of the second frozen subset F2: If the last two elements in the bits reversal sequence are selected, F2={7, 15}.

(129) (3) Determine the third frozen subset F3: A sequence that is obtained based on the PW by sorting reliability at a bit location and with code length 16 is: S={0, 1, 2, 4, 8, 3, 5, 6, 9, 10, 12, 7, 11, 13, 14, 15}; because {0, 1, 7, 15} is already selected as the frozen set, a set obtained by removing these elements is {2, 4, 8, 3, 5, 6, 9, 10, 12, 11, 13, 14}, then the first six elements are selected and added to the set, and F3={2, 4, 8, 3, 5, 6}.

(130) (4) Determine the frozen set F=F1∪F2∪F3={0, 1, 2, 3, 4, 5, 6, 7, 8, 15}.

(131) Step 4: Determine elements in the puncturing pattern P:

(132) (1) Determine elements of the puncturing set P1: If two leading elements in v2 are selected and added to the set v2, P1={0, 8} is obtained.

(133) (2) Determine elements of the shortening set P2: P2={14, 15}, and the bits at these locations are treated as known during decoding.

(134) (3) Determine the puncturing pattern P: P=P1∪P2={0, 8, 14, 15}.

(135) In another instance, encoding parameter information is M=24, K=16 and R=⅔.

(136) Step 1: Calculate a mother code length N=2.sup.┌log.sup.2 .sup.24┐=32 of a polar code.

(137) Step 2: Calculate a length |P|=N−M=8 of a puncturing pattern P, where when a code rate R is greater than ½, |P2=└|P|×⅔┘=5, and |P1|=3.

(138) Step 3: Determine the frozen set F:

(139) (1) Determine the element in the first frozen subset F1: An initial sequence v1 is: v1={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}, the bits reversal sequence v2 is v2={0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31};

(140) and if three leading elements in the initial sequence v1 are selected,

(141) F1={0, 1, 2} is obtained.

(142) (2) Determine the element in the second frozen subset F2: If the last five elements in the bits reversal sequence are selected, F2={27, 7, 23, 15, 31} is obtained.

(143) (3) Determine the third frozen subset F3: A sequence that is obtained based on the PW by sorting reliability at a bit location and with code length 16 is:

(144) S={0, 1, 2, 4, 8, 16, 3, 5, 6, 9, 10, 17, 12, 18, 20, 7, 24, 11, 13, 19, 14, 21, 22, 25, 26, 28, 15, 23, 27, 29, 30, 31};

(145) because {0, 1, 2, 7, 15, 23, 27, 31} is already selected as the frozen set F, a set obtained by removing these element is:

(146) {4, 8, 16, 3, 5, 6, 9, 10, 17, 12, 18, 20, 24, 11, 13, 19, 14, 21, 22, 25, 26, 28, 29, 30}, then eight leading elements are selected and added to the set, and F3={4, 8, 16, 3, 5, 6, 9, 10}.

(147) (4) Determine the frozen set F=F1∪F2∪F3={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 16, 23, 27, 31}.

(148) Step 4: Determine elements in the puncturing pattern:

(149) (1) Determine elements of the puncturing set P1: If three leading elements in v2 are selected and added to the set P1, P1={0, 16, 8} is obtained.

(150) (2) Determine element of the shortening set P2: P2={27, 28, 29, 30, 31}, and decoding is performed based on known values of bits at these locations.

(151) (3) Determine the puncturing pattern P: P=P1∪P2={0, 16, 8, 27, 28, 29, 30, 31}.

(152) The method for generating a frozen set and a puncturing pattern is described only by using the instances, but is not limited to the foregoing specified encoding parameter information. It should be understood that, for any encoding parameter information, a frozen set and a puncturing pattern may be obtained by using the foregoing method to generate a frozen set and a puncturing pattern. Any other modifications or replacements readily figured out by a person of ordinary skill in the art shall fall within the technical scope disclosed in the embodiments of the present invention.

(153) In the foregoing embodiment, the quantity of elements in each of the puncturing set and the shortening set, and the quantity of elements in each of the first frozen subset and the second frozen subset are generated at a time, and the puncturing pattern and the frozen set are obtained by using the initial sequence and the bits reversal sequence. This solution is simple and has low complexity.

(154) In an optional solution, a puncturing pattern and a frozen set may not need to be dynamically calculated based on a code rate and an information bits length. Generally, in a communications system, choices for a code rate and an information length are limited. In addition, once a code rate and an information bits length are selected, the code rate and the information length remain unchanged in a specific time period. Therefore, the puncturing pattern and the frozen set do not need to be dynamically calculated from time to time. Some code rates and information bits lengths that need to be used may be predefined. During encoding, after a code rate and an information bits length are obtained, a puncturing pattern and a frozen set may be directly obtained through table lookup.

(155) Specifically, the frozen set is usually determined by using a modulation and MCS. According to the foregoing embodiments, the following frozen set and puncturing pattern may be obtained as an example:

(156) TABLE-US-00004 TABLE 4 Frozen set and puncturing pattern Index M K R Puncturing pattern Frozen set 0 24 16 2/3 {0, 8, 16, 27, 28, 29, {0, 1, 2, 3, 4, 5, 30, 31} 6, 7, 8, 9, 10, 15, 16, 23, 27, 31} 1 56 42 3/4 {0, 128, 64, 192, 32, {0, 1, 2, 55, 15, 47, 160, 246, 247, 248, 249, 31, 63, 4, 8, 16, 3, 32, 250, 251, 252, 253, 254, 5, 6, 9, 10, 17, 12, 18, 255} 33, 20}

(157) It should be understood that the foregoing is merely an example, and does not represent all possible scenarios of an actually applied puncturing pattern and an actually applied frozen set. In actual encoding, corresponding puncturing patterns and frozen sets may be obtained for different code lengths, information bits lengths, and code rates. A standard index may be an MCS index, and is mainly used to determine encoding parameter information corresponding to the index. A specific definition may depend on an actual protocol definition. Any other modifications or replacements readily figured out by a person of ordinary skill in the art shall fall within the technical scope disclosed in the embodiments of the present invention.

(158) In this embodiment, puncturing patterns and frozen sets corresponding to some encoding parameter information are pre-calculated, so that the puncturing patterns and the frozen sets can be obtained quickly through table lookup. Therefore, an implementation is simple, and a low-latency requirement is met.

(159) The foregoing mainly describes the solutions provided in the embodiments of this disclosure from a perspective of an encoding process and generating a puncturing pattern and a frozen set by a device for encoding. It may be understood that, to implement the foregoing functions, the device for encoding may include corresponding hardware structures and/or software modules for executing the functions. A person of ordinary skill in the art should easily be aware that, in combination with the examples described in the embodiments disclosed in this application, algorithm steps may be implemented by hardware or a combination of hardware and computer software. Whether a function is performed by hardware or hardware driven by computer software depends on particular applications and design constraints of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of this disclosure.

(160) In the embodiments of this disclosure, the device for encoding may be divided into functional modules based on the foregoing method examples. For example, functional modules corresponding to various functions are obtained through division, or two or more functions may be integrated into one processing module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module. It should be noted that, in this embodiment of this disclosure, module division is an example, and is merely a logical function division. In an alternative implementation, another division manner may be used.

(161) When the functional modules corresponding to various functions are obtained through division, FIG. 6 is a schematic structural diagram of an encoding device for generating a puncturing pattern according to an embodiment of the present disclosure. The device 600 includes an obtaining unit 601 and a processing unit 602. The obtaining unit 601 is configured for the device to perform step S201 of obtaining information bits in FIG. 2. The processing unit 602 is configured for the device to perform step S202 of determining a puncturing pattern in FIG. 2, and the processing unit 602 is further configured for the device to perform step S402 of determining a frozen set in FIG. 4 and step S503 of determining a puncturing pattern in FIG. 5, and the processing unit 602 is further configured to support the device 600 in performing, by using the puncturing pattern, rate matching on data obtained after the information bits are encoded.

(162) Optionally, the device 600 may be a chip or an integrated circuit in another implementation.

(163) Optionally, when a part or all of the encoding methods in the foregoing embodiments are implemented by using software, FIG. 7 is a schematic diagram of a logical structure of an encoding device 700 for generating a puncturing pattern according to embodiments of the present disclosure. The device 700 includes a processor 702, which is configured to execute a program stored in a memory 701. When the program is executed, the device 700 is enabled to implement the puncturing pattern generation methods provided in the embodiments in FIG. 2 and FIG. 5, and the frozen set generation method provided in the embodiment in FIG. 4, and to perform encoding and rate matching respectively, by using a frozen set and a puncturing pattern, on data obtained after information bits are encoded. Optionally, the device 700 may further include the memory 701, a communications interface 704, or a bus 703. The memory 701 is configured to store the program and data. The communications interface 704 is configured for the device 700 to obtain the information bits or send encoded bit information. The processor 702, the memory 701, and the communications interface 704 are connected to each other by using the bus 703. The processor 702 may receive data from the communications interface 704 or the memory 701 by using the bus 703, or transmit the data to the memory 701 by using the bus 703 for storage, or send the data to the communications interface 704 for sending.

(164) Optionally, the memory 701 may be a physically independent unit, or may be integrated into the processor 702.

(165) The processor 702 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.

(166) The processor 702 may further include a hardware chip. The foregoing hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

(167) The memory 701 may include a volatile memory, for example, a random-access memory (RAM); the memory 701 may also include a non-volatile memory, for example, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or the memory 701 may further include a combination of the foregoing types of memories.

(168) The bus 703 may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, and or the like. The bus 703 may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent the bus 703 in FIG. 7, but this does not mean that there is only one bus or only one type of bus.

(169) In another embodiment of the present disclosure, a readable storage medium is further provided. The readable storage medium stores one or more computer-executable instructions, and a device (which may be a single-chip microcomputer, a chip, or the like) or a processor loads the one or more computer-executable instructions from the storage medium, to execute the base station or the terminal to complete the method provided in the embodiments of the present application. The foregoing readable storage medium may include: any medium that can store program code, such as a removable hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disc.

(170) In another embodiment of this disclosure, a computer program product is further provided. The computer program product includes one or more computer-executable instructions, and the one or more computer-executable instructions are stored in a computer-readable storage medium. At least one processor of a device may read the one or more computer-executable instructions from the computer-readable storage medium, and the at least one processor executes the one or more computer-executable instructions to implement the method provided in the embodiments of this disclosure.

(171) In the embodiments of this disclosure, the puncturing pattern is easy to be selected and implemented, and the frozen set can be quickly generated. In this way, the complexity is greatly reduced, and both a low-latency requirement and a low-complexity requirement can be met. When the code rate of encoding changes, the puncturing pattern and/or the frozen set can be quickly generated, so that the requirement of a low latency in the future 5G can be met.

(172) In conclusion, the foregoing descriptions are merely example implementations of the present disclosure, but are not intended to limit the protection scope of the present disclosure. Any variation or replacement within the technical scope disclosed in the present disclosure shall fall within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.