Search

EP-4742565-A1 - RATE MATCHING METHOD AND COMMUNICATION APPARATUS

EP4742565A1EP 4742565 A1EP4742565 A1EP 4742565A1EP-4742565-A1

Abstract

Embodiments of this application provide a rate matching method and a communication apparatus. In the method, a to-be-encoded sequence is encoded based on a basis sequence corresponding to small packet encoding, to obtain a first codeword sequence whose length is 32 bits; then the first codeword sequence is interleaved to obtain a second codeword sequence; and finally, the second codeword sequence is punctured from back to front based on a value E, to obtain a third codeword sequence, where the value E indicates a quantity of bits of the second codeword sequence after rate matching, and E is a positive integer less than 32. According to the method, a code distance characteristic of a punctured first codeword sequence can be improved, so that a Hamming distance between different valid codewords is as large as possible, thereby improving decoding performance.

Inventors

  • QIN, Kangjian
  • ZHANG, Huazi
  • WANG, XIANBIN
  • TONG, JIAJIE
  • LIU, KE
  • WANG, JUN
  • DU, YINGGANG

Assignees

  • Huawei Technologies Co., Ltd.

Dates

Publication Date
20260513
Application Date
20230728

Claims (18)

  1. A rate matching method, comprising: encoding a to-be-encoded sequence based on a first encoding sequence, to obtain a first codeword sequence whose length is 32 bits, wherein the first encoding sequence is a basis sequence corresponding to small packet encoding; interleaving the first codeword sequence to obtain a second codeword sequence; puncturing the second codeword sequence based on a value E, to obtain a third codeword sequence, wherein the value E indicates a quantity of bits of the second codeword sequence after rate matching, and E is a positive integer less than 32; and outputting the third codeword sequence.
  2. The method according to claim 1, wherein the interleaving the first codeword sequence comprises: interleaving the first codeword sequence based on a first interleaving pattern, wherein the first interleaving pattern is used for resetting positions of all or a part of the 32 bits of the first codeword sequence.
  3. The method according to claim 2, wherein the first encoding sequence is a matrix with 32 rows and 11 columns, the first encoding sequence is shown in the following table, i represents a row index of the matrix, and M represents a column index of the matrix. i M i,0 M i,1 M i,2 M i,3 M i,4 M i,5 M i,6 M i,7 M i,8 M i,9 M i,10 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 2 1 0 0 1 0 0 1 0 1 1 1 3 1 0 1 1 0 0 0 0 1 0 1 4 1 1 1 1 0 0 0 1 0 0 1 5 1 1 0 0 1 0 1 1 1 0 1 6 1 0 1 0 1 0 1 0 1 1 1 7 1 0 0 1 1 0 0 1 1 0 1 8 1 1 0 1 1 0 0 1 0 1 1 9 1 0 1 1 1 0 1 0 0 1 1 10 1 0 1 0 0 1 1 1 0 1 1 11 1 1 1 0 0 1 1 0 1 0 1 12 1 0 0 1 0 1 0 1 1 1 1 13 1 1 0 1 0 1 0 1 0 1 1 14 1 0 0 0 1 1 0 1 0 0 1 15 1 1 0 0 1 1 1 1 0 1 1 16 1 1 1 0 1 1 1 0 0 1 0 17 1 0 0 1 1 1 0 0 1 0 0 18 1 1 0 1 1 1 1 1 0 0 0 19 1 0 0 0 0 1 1 0 0 0 0 20 1 0 1 0 0 0 1 0 0 0 1 21 1 1 0 1 0 0 0 0 0 1 1 22 1 0 0 0 1 0 0 1 1 0 1 23 1 1 1 0 1 0 0 0 1 1 1 24 1 1 1 1 1 0 1 1 1 1 0 25 1 1 0 0 0 1 1 1 0 0 1 26 1 0 1 1 0 1 0 0 1 1 0 27 1 1 1 1 0 1 0 1 1 1 0 28 1 0 1 0 1 1 1 0 1 0 0 29 1 0 1 1 1 1 1 1 1 0 0 30 1 1 1 1 1 1 1 1 1 1 1 31 1 0 0 0 0 0 0 0 0 0 0
  4. The method according to claim 2 or 3, wherein a length of the to-be-encoded sequence is K, and when K is any value in 3 to 11, the first interleaving pattern is shown in Table #1 or Table #2 below: Table #1 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 17 8 28 12 5 16 26 20 24 24 31 28 6 1 13 5 15 9 18 13 23 17 2 21 16 25 9 29 14 2 22 6 4 10 19 14 10 18 29 22 7 26 11 30 27 3 3 7 1 11 12 15 25 19 21 23 20 27 0 31 8 Table #2 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 16 4 4 8 15 12 10 16 12 20 20 24 24 28 28 1 14 5 7 9 1 13 17 17 11 21 21 25 25 29 29 2 3 6 9 10 8 14 5 18 2 22 22 26 26 30 30 3 0 7 6 11 13 15 19 19 18 23 23 27 27 31 31 wherein i represents an (i+1) th position of the second codeword sequence, P(i) represents a bit that is in a (P(i)+1) th position of the first codeword sequence and that is placed in the (i+1) th position of the second codeword sequence, and 0≤i≤31.
  5. The method according to claim 2 or 3, wherein a length of the to-be-encoded sequence is K, and when K is equal to 3, the first interleaving pattern is shown in Table #3: Table #3 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 28 4 22 8 2 12 1 16 4 20 27 24 18 28 10 1 14 5 16 9 29 13 31 17 13 21 17 25 9 29 11 2 25 6 8 10 30 14 15 18 3 22 6 26 24 30 5 3 23 7 26 11 21 15 20 19 12 23 19 27 0 31 7 or when K is equal to 4, the first interleaving pattern is shown in Table #4: Table #4 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 20 8 6 12 12 16 13 20 9 24 28 28 7 1 29 5 14 9 3 13 25 17 0 21 4 25 27 29 5 2 21 6 15 10 24 14 23 18 11 22 31 26 26 30 18 3 1 7 17 11 19 15 8 19 22 23 2 27 16 31 10 or when K is equal to 5, the first interleaving pattern is shown in Table #5: Table #5 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 4 8 3 12 16 16 25 20 24 24 21 28 15 1 17 5 0 9 13 13 10 17 6 21 27 25 19 29 7 2 14 6 5 10 11 14 29 18 23 22 9 26 26 30 12 3 8 7 28 11 2 15 31 19 1 23 18 27 22 31 20 or when K is equal to 6, the first interleaving pattern is shown in Table #6: Table #6 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 29 4 7 8 25 12 5 16 3 20 20 24 22 28 10 1 16 5 21 9 4 13 6 17 15 21 8 25 13 29 19 2 26 6 1 10 28 14 9 18 14 22 2 26 31 30 27 3 24 7 0 11 30 15 17 19 12 23 23 27 18 31 11 or when K is equal to 7, the first interleaving pattern is shown in Table #7: Table #7 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 17 4 22 8 1 12 7 16 19 20 29 24 20 28 28 1 26 5 3 9 8 13 12 17 31 21 6 25 16 29 11 2 24 6 21 10 10 14 23 18 14 22 25 26 13 30 5 3 9 7 0 11 18 15 2 19 15 23 27 27 30 31 4 or when K is equal to 8, the first interleaving pattern is shown in Table #8: Table #8 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 15 8 31 12 27 16 1 20 29 24 12 28 9 1 17 5 10 9 18 13 7 17 20 21 4 25 13 29 5 2 16 6 8 10 6 14 26 18 3 22 0 26 14 30 19 3 28 7 2 11 11 15 22 19 23 23 21 27 25 31 24 or when K is equal to 9, the first interleaving pattern is shown in Table #9: Table #9 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 7 8 1 12 3 16 27 20 20 24 18 28 9 1 16 5 23 9 0 13 8 17 28 21 4 25 22 29 24 2 12 6 6 10 31 14 29 18 15 22 19 26 14 30 13 3 10 7 21 11 26 15 17 19 5 23 11 27 2 31 25 or when K is equal to 10, the first interleaving pattern is shown in Table #10: Table #10 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 16 4 25 8 3 12 23 16 7 20 21 24 29 28 28 1 15 5 24 9 1 13 0 17 19 21 6 25 14 29 9 2 11 6 8 10 20 14 13 18 2 22 30 26 27 30 18 3 10 7 4 11 26 15 5 19 12 23 31 27 22 31 17 or when K is equal to 11, the first interleaving pattern is shown in Table #11: Table #11 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 27 8 4 12 7 16 10 20 24 24 23 28 5 1 29 5 19 9 21 13 12 17 16 21 31 25 9 29 17 2 18 6 6 10 20 14 25 18 14 22 8 26 3 30 11 3 15 7 22 11 0 15 13 19 28 23 1 27 2 31 26 wherein i represents an (i+1) th position of the second codeword sequence, P(i) represents a bit that is in a (P(i)+1) th position of the first codeword sequence and that is placed in the (i+1) th position of the second codeword sequence, and 0≤i≤31.
  6. The method according to claim 2, wherein the first encoding sequence is a matrix with 32 rows and 11 columns, the first encoding sequence is shown in the following table, i represents a row index of the matrix, and M represents a column index of the matrix: i M i,0 Mi ,1 M i,2 M i,3 M i,4 M i,5 M i,6 M i,7 M i,8 M i,9 M i,10 0 1 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 2 1 0 1 0 0 0 1 0 0 0 1 3 1 1 1 0 0 0 0 0 0 1 1 4 1 0 0 1 0 0 1 0 1 1 1 5 1 1 0 1 0 0 0 0 0 1 1 6 1 0 1 1 0 0 0 0 1 0 1 7 1 1 1 1 0 0 0 1 0 0 1 8 1 0 0 0 1 0 0 1 1 0 1 9 1 1 0 0 1 0 1 1 1 0 1 10 1 0 1 0 1 0 1 0 1 1 1 11 1 1 1 0 1 0 0 0 1 1 1 12 1 0 0 1 1 0 0 1 1 0 1 13 1 1 0 1 1 0 0 1 0 1 1 14 1 0 1 1 1 0 1 0 0 1 1 15 1 1 1 1 1 0 1 1 1 1 0 16 1 0 0 0 0 1 1 0 0 0 0 17 1 1 0 0 0 1 1 1 0 0 1 18 1 0 1 0 0 1 1 1 0 1 1 19 1 1 1 0 0 1 1 0 1 0 1 20 1 0 0 1 0 1 0 1 1 1 1 21 1 1 0 1 0 1 0 1 0 1 1 22 1 0 1 1 0 1 0 0 1 1 0 23 1 1 1 1 0 1 0 1 1 1 0 24 1 0 0 0 1 1 0 1 0 0 1 25 1 1 0 0 1 1 1 1 0 1 1 26 1 0 1 0 1 1 1 0 1 0 0 27 1 1 1 0 1 1 1 0 0 1 0 28 1 0 0 1 1 1 0 0 1 0 0 29 1 1 0 1 1 1 1 1 0 0 0 30 1 0 1 1 1 1 1 1 1 0 0 31 1 1 1 1 1 1 1 1 1 1 1
  7. The method according to claim 2 or 6, wherein a length of the to-be-encoded sequence is K, and when K is any value in 3 to 11, the first interleaving pattern is shown in the following table: i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 31 4 28 8 26 12 9 16 22 20 15 24 0 28 10 1 21 5 25 9 29 13 11 17 4 21 27 25 14 29 24 2 8 6 7 10 18 14 18 18 30 22 12 26 19 30 23 3 6 7 3 11 20 15 17 19 5 23 2 27 1 31 13 wherein i represents an (i+1) th position of the second codeword sequence, P(i) represents a bit that is in a (P(i)+1) th position of the first codeword sequence and that is placed in the (i+1) th position of the second codeword sequence, and 0≤i≤31.
  8. The method according to claim 2 or 6, wherein a length of the to-be-encoded sequence is K, and when K is equal to 3, the first interleaving pattern is shown in Table #12: Table #12 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 26 4 8 8 4 12 3 16 7 20 23 24 29 28 18 1 24 5 27 9 30 13 0 17 21 21 28 25 14 29 19 2 11 6 13 10 31 14 25 18 6 22 10 26 15 30 9 3 17 7 22 11 5 15 2 19 20 23 16 27 1 31 12 or when K is equal to 4, the first interleaving pattern is shown in Table #13: Table #13 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 3 8 10 12 20 16 21 20 14 24 26 28 12 1 2 5 24 9 6 13 17 17 1 21 7 25 23 29 9 2 5 6 25 10 15 14 11 18 19 22 0 26 22 30 29 3 31 7 28 11 16 15 13 19 8 23 4 27 27 31 18 or when K is equal to 5, the first interleaving pattern is shown in Table #14: Table #14 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 28 4 31 8 6 12 27 16 17 20 15 24 5 28 25 1 1 5 7 9 21 13 18 17 10 21 23 25 16 29 12 2 13 6 9 10 19 14 30 18 11 22 14 26 22 30 20 3 24 7 26 11 4 15 0 19 3 23 29 27 8 31 2 or when K is equal to 6, the first interleaving pattern is shown in Table #15: Table #15 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 27 4 22 8 17 12 9 16 6 20 2 24 8 28 18 1 12 5 3 9 7 13 10 17 25 21 13 25 21 29 16 2 15 6 5 10 26 14 14 18 24 22 4 26 0 30 23 3 30 7 1 11 31 15 28 19 20 23 11 27 29 31 19 or when K is equal to 7, the first interleaving pattern is shown in Table #16: Table #16 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 8 4 28 8 3 12 12 16 16 20 30 24 2 28 26 1 5 5 1 9 13 13 20 17 0 21 10 25 27 29 19 2 14 6 15 10 18 14 11 18 24 22 17 26 21 30 9 3 22 7 6 11 29 15 4 19 25 23 23 27 31 31 7 or when K is equal to 8, the first interleaving pattern is shown in Table #17: Table #17 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 26 4 18 8 13 12 23 16 3 20 30 24 20 28 14 1 31 5 0 9 29 13 12 17 2 21 7 25 21 29 9 2 25 6 4 10 10 14 22 18 6 22 1 26 24 30 16 3 28 7 27 11 19 15 8 19 11 23 5 27 17 31 15 or when K is equal to 9, the first interleaving pattern is shown in Table #18: Table #18 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 1 4 27 8 31 12 6 16 23 20 2 24 29 28 14 1 3 5 18 9 20 13 13 17 26 21 7 25 8 29 15 2 5 6 10 10 0 14 30 18 25 22 16 26 24 30 21 3 12 7 11 11 22 15 28 19 9 23 19 27 4 31 17 or when K is equal to 10, the first interleaving pattern is shown in Table #19: Table #19 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 27 4 18 8 13 12 11 16 12 20 5 24 30 28 26 1 6 5 2 9 7 13 1 17 16 21 10 25 24 29 14 2 19 6 8 10 3 25 21 18 4 22 31 26 23 30 29 3 17 7 15 11 22 15 9 19 20 23 0 27 9 31 28 or when K is equal to 11, the first interleaving pattern is shown in Table #20: Table #20 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 5 4 29 8 16 12 12 16 18 20 15 24 11 28 9 1 25 5 2 9 7 13 20 17 27 21 0 25 14 29 28 2 10 6 31 10 8 14 17 18 24 22 13 26 6 30 19 3 23 7 30 11 1 15 21 19 26 23 3 27 4 31 22 wherein i represents an (i+1) th position of the second codeword sequence, P(i) represents a bit that is in a (P(i)+1) th position of the first codeword sequence and that is placed in the (i+1) th position of the second codeword sequence, and 0≤i≤31.
  9. A rate matching method, comprising: performing row interleaving on a first encoding sequence, to obtain a second encoding sequence, wherein the first encoding sequence is a basis sequence corresponding to small packet encoding; encoding a to-be-encoded sequence based on the second encoding sequence, to obtain a second codeword sequence whose length is 32 bits; puncturing the second codeword sequence based on a value E, to obtain a third codeword sequence, wherein the value E indicates a quantity of bits of the second codeword sequence after rate matching, and E is a positive integer less than 32; and outputting the third codeword sequence.
  10. The method according to claim 9, wherein the performing row interleaving on the first encoding sequence comprises: performing row interleaving on the first encoding sequence based on a first interleaving pattern, wherein the first interleaving pattern is used for resetting positions of all or a part of 32 rows in the first encoding sequence.
  11. The method according to claim 10, wherein the first encoding sequence is a matrix with 32 rows and 11 columns, the first encoding sequence is shown in the following table, i represents a row index of the matrix, and M represents a column index of the matrix: i M i,0 M i,1 M i,2 M i,3 M i,4 M i,5 M i,6 M i,7 M i,8 M i,9 M i,10 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 1 2 1 0 0 1 0 0 1 0 1 1 1 3 1 0 1 1 0 0 0 0 1 0 1 4 1 1 1 1 0 0 0 1 0 0 1 5 1 1 0 0 1 0 1 1 1 0 1 6 1 0 1 0 1 0 1 0 1 1 1 7 1 0 0 1 1 0 0 1 1 0 1 8 1 1 0 1 1 0 0 1 0 1 1 9 1 0 1 1 1 0 1 0 0 1 1 10 1 0 1 0 0 1 1 1 0 1 1 11 1 1 1 0 0 1 1 0 1 0 1 12 1 0 0 1 0 1 0 1 1 1 1 13 1 1 0 1 0 1 0 1 0 1 1 14 1 0 0 0 1 1 0 1 0 0 1 15 1 1 0 0 1 1 1 1 0 1 1 16 1 1 1 0 1 1 1 0 0 1 0 17 1 0 0 1 1 1 0 0 1 0 0 18 1 1 0 1 1 1 1 1 0 0 0 19 1 0 0 0 0 1 1 0 0 0 0 20 1 0 1 0 0 0 1 0 0 0 1 21 1 1 0 1 0 0 0 0 0 1 1 22 1 0 0 0 1 0 0 1 1 0 1 23 1 1 1 0 1 0 0 0 1 1 1 24 1 1 1 1 1 0 1 1 1 1 0 25 1 1 0 0 0 1 1 1 0 0 1 26 1 0 1 1 0 1 0 0 1 1 0 27 1 1 1 1 0 1 0 1 1 1 0 28 1 0 1 0 1 1 1 0 1 0 0 29 1 0 1 1 1 1 1 1 1 0 0 30 1 1 1 1 1 1 1 1 1 1 1 31 1 0 0 0 0 0 0 0 0 0 0
  12. The method according to claim 10 or 11, wherein the first interleaving pattern is shown in Table #21 or Table #22 below: Table #21 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 17 8 28 12 5 16 26 20 24 24 31 28 6 1 13 5 15 9 18 13 23 17 2 21 16 25 9 29 14 2 22 6 4 10 19 14 10 18 29 22 7 26 11 30 27 3 3 7 1 11 12 15 25 19 21 23 20 27 0 31 8 Table #22 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 16 4 4 8 15 12 10 16 12 20 20 24 24 28 28 1 14 5 7 9 1 13 17 17 11 21 21 25 25 29 29 2 3 6 9 10 8 14 5 18 2 22 22 26 26 30 30 3 0 7 6 11 13 15 19 19 18 23 23 27 27 31 31 wherein i represents an (i+1) th row in the first encoding sequence, P(i) represents a row element that corresponds to a (P(i)+1) th row in the first encoding sequence and that is placed in an (i+1) th row in the second encoding sequence, and 0≤i≤31.
  13. The method according to claim 10 or 11, wherein a length of the to-be-encoded sequence is K, 3≤K≤11, and when K is equal to 3, the first interleaving pattern is shown in Table #23: Table #23 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 28 4 22 8 2 12 1 16 4 20 27 24 18 28 10 1 14 5 16 9 29 13 31 17 13 21 17 25 9 29 11 2 25 6 8 10 30 14 15 18 3 22 6 26 24 30 5 3 23 7 26 11 21 15 20 19 12 23 19 27 0 31 7 or when K is equal to 4, the first interleaving pattern is shown in Table #24: Table #24 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 20 8 6 12 12 16 13 20 9 24 28 28 7 1 29 5 14 9 3 13 25 17 0 21 4 25 27 29 5 2 21 6 15 10 24 14 23 18 11 22 31 26 26 30 18 3 1 7 17 11 19 15 8 19 22 23 2 27 16 31 10 or when K is equal to 5, the first interleaving pattern is shown in Table #25: Table #25 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 4 8 3 12 16 16 25 20 24 24 21 28 15 1 17 5 0 9 13 13 10 17 6 21 27 25 19 29 7 2 14 6 5 10 11 14 29 18 23 22 9 26 26 30 12 3 8 7 28 11 2 15 31 19 1 23 18 27 22 31 20 or when K is equal to 6, the first interleaving pattern is shown in Table #26: Table #26 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 29 4 7 8 25 12 5 16 3 20 20 24 22 28 10 1 16 5 21 9 4 13 6 17 15 21 8 25 13 29 19 2 26 6 1 10 28 14 9 18 14 22 2 26 31 30 27 3 24 7 0 11 30 15 17 19 12 23 23 27 18 31 11 or when K is equal to 7, the first interleaving pattern is shown in Table #27: Table #27 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 17 4 22 8 1 12 7 16 19 20 29 24 20 28 28 1 26 5 3 9 8 13 12 17 31 21 6 25 16 29 11 2 24 6 21 10 10 14 23 18 14 22 25 26 13 30 5 3 9 7 0 11 18 15 2 19 15 23 27 27 30 31 4 or when K is equal to 8, the first interleaving pattern is shown in Table #28: Table #28 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 15 8 31 12 27 16 1 20 29 24 12 28 9 1 17 5 10 9 18 13 7 17 20 21 4 25 13 29 5 2 16 6 8 10 6 14 26 18 3 22 0 26 14 30 19 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 3 28 7 2 11 11 15 22 19 23 23 21 27 25 31 24 or when K is equal to 9, the first interleaving pattern is shown in Table #29: Table #29 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 7 8 1 12 3 16 27 20 20 24 18 28 9 1 16 5 23 9 0 13 8 17 28 21 4 25 22 29 24 2 12 6 6 10 31 14 29 18 15 22 19 26 14 30 13 3 10 7 21 11 26 15 17 19 5 23 11 27 2 31 25 or when K is equal to 10, the first interleaving pattern is shown in Table #30: Table #30 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 16 4 25 8 3 12 23 16 7 20 21 24 29 28 28 1 15 5 24 9 1 13 0 17 19 21 6 25 14 29 9 2 11 6 8 10 20 14 13 18 2 22 30 26 27 30 18 3 10 7 4 11 26 15 5 19 12 23 31 27 22 31 17 or when K is equal to 11, the first interleaving pattern is shown in Table #31: Table #31 i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) i P(i) 0 30 4 27 8 4 12 7 16 10 20 24 24 23 28 5 1 29 5 19 9 21 13 12 17 16 21 31 25 9 29 17 2 18 6 6 10 20 14 25 18 14 22 8 26 3 30 11 3 15 7 22 11 0 15 13 19 28 23 1 27 2 31 26 wherein i represents an (i+1) th row in the first encoding sequence code, P(i) represents a row element that is in a (P(i)+1) th row in the first encoding sequence and that is placed in an (i+1) th row in the second encoding sequence, and 0≤i≤31.
  14. A communication apparatus, comprising a module or a unit configured to perform the method according to any one of claims 1 to 8, or a module or a unit configured to perform the method according to any one of claims 9 to 13.
  15. A communication apparatus, comprising at least one processor, wherein the at least one processor is coupled to at least one memory, and the at least one processor is configured to execute a computer program or instructions stored in the at least one memory, to cause the communication apparatus to perform the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 13.
  16. A chip, comprising a processor and a communication interface, wherein the communication interface is configured to: receive a to-be-encoded sequence, and send the to-be-encoded sequence to the processor; the processor encodes and interleaves the to-be-encoded sequence according to the method according to any one of claims 1 to 8, to obtain a third codeword sequence; and the communication interface is further configured to output the third codeword sequence; or the communication interface is configured to: receive a to-be-encoded sequence, and send the to-be-encoded sequence to the processor; the processor encodes, based on a second encoding sequence, the to-be-encoded sequence according to the method according to any one of claims 9 to 13, to obtain a third codeword sequence; and the communication interface is configured to output the third codeword sequence.
  17. A computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are run on a computer, the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 13 is implemented.
  18. A computer program product, wherein the computer program product comprises computer program code, and when the computer program code is run on a computer, the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 13 is implemented.

Description

TECHNICAL FIELD Embodiments of this application relate to the channel coding field, and more specifically, to a rate matching method and a communication apparatus. BACKGROUND Long term evolution (long term evolution, LTE)-Reed-Muller (Reed Muller, RM) code is a method for encoding a small packet (or referred to as a very short message or a small block) of 3 bits to 11 bits in an existing new radio (new radio, NR) standard. A specific encoding process is as follows. It is assumed that a small packet sequence/a very short message sequence before encoding is c0, c1, ..., cK-1 (3≤K≤11), and a codeword sequence after LTE-RM code encoding is d0, d1, ..., dN-1, where N=32. When a length E of an actually transmitted codeword sequence is less than a length N of the encoded codeword sequence d0, d1, ..., dN-1, a corresponding rate matching manner is: puncturing the codeword sequence d0, d1, ..., dN-1 from back to front, to be specific, starting from the last bit position of the codeword sequence d0, d1, ..., dN-1 toward the front, puncturing bits in consecutive (32-E) bit positions. However, when a value of E is small, that is, a quantity of to-be-punctured bits is large, a performance bad point occurs on an output sequence after rate matching, and decoding performance is poor. SUMMARY Embodiments of this application provide a rate matching method, to improve a code distance characteristic of a punctured first codeword sequence, thereby improving decoding performance. According to a first aspect, a rate matching method is provided. The method includes: encoding a to-be-encoded sequence based on a first encoding sequence, to obtain a first codeword sequence whose length is 32 bits, where the first encoding sequence is a basis sequence corresponding to small packet encoding; interleaving the first codeword sequence to obtain a second codeword sequence; puncturing the second codeword sequence based on a value E, to obtain a third codeword sequence, where the value E indicates a quantity of bits of the second codeword sequence after rate matching, and E is a positive integer less than 32; and outputting a third codeword sequence. In the foregoing technical solution, before rate matching is performed on the first codeword sequence, the first codeword sequence is first interleaved based on the first encoding sequence, so that a code distance characteristic of a punctured first codeword sequence can be improved, and a Hamming distance between different valid codewords is as large as possible. In this way, a probability that a decoder incorrectly decodes a valid codeword into another valid codeword is reduced. That is, decoding performance is improved, and a probability of occurrence of a performance bad point is reduced. A code distance refers to a Hamming distance between two codewords. For example, a codeword whose length is 4 and that is obtained by encoding a message 1 (that is, a to-be-encoded sequence #1) is C1=[0 0 0 0], and another codeword whose length is 4 and that is obtained by encoding a message 2 (that is, a to-be-encoded sequence #2) is C2=[0 0 1 1]. In this case, a code distance between the two codewords is a quantity of different elements in corresponding positions in C1 and C2, and the code distance between C1 and C2 is 2. It is assumed that interleaving is not performed before puncturing, and puncturing is directly performed from back to front. If puncturing is performed in two positions, corresponding codewords obtained by puncturing C1 and C2 are C1'=[0 0] and C2'=[0 0], the code distance between the two codewords after puncturing is 0, and the two codewords are completely the same. Therefore, a decoder cannot distinguish whether the message 1 or the message 2 is sent by a transmitter. However, if C1 and C2 are interleaved, and 1st two elements are interleaved to 3rd and 4th positions, C1 becomes [0 0 0 0], and C2 becomes [1 1 0 0]. Then, puncturing is performed in two positions from back to front, so that C1"=[0 0], C2"=[1 1], and the code distance after puncturing is 2. In this way, the decoder can easily distinguish whether the message 1 or the message 2 is sent by the transmitter, thereby improving decoding performance after puncturing. In some implementations of the first aspect, interleaving the first codeword sequence includes: interleaving the first codeword sequence based on a first interleaving pattern, where the first interleaving pattern is used for resetting positions of all or a part of the 32 bits of the first codeword sequence. In some implementations of the first aspect, the first encoding sequence is a matrix with 32 rows and 11 columns, and the first encoding sequence is shown in the following table: iMi,0Mi,1Mi,2Mi,3Mi,4Mi,5Mi,6Mi,7Mi,8Mi,9Mi,10011000000001111100000011210010010111310110000101411110001001511001011101610101010111710011001101811011001011910111010011101010011101111111001101011210010101111131101010101114100011010011511001111011161110111001017100111001001811011111000191000