Patent Description:
For a communication system that is very sensitive to a delay, after receiving data, a receive end device needs to complete processing of the data in a very short time and reply with an acknowledgment character ACK (Acknowledgment). For example, in a Bluetooth system, an interval between a time point at which a mobile phone completes sending data and a time point at which the mobile phone receives an ACK of a primary headset is <NUM>, and after the primary headset and a secondary headset receive all information sent by the mobile phone, there is a <NUM> time margin for decoding and data reporting. For a system that requires low power consumption, for example, a Bluetooth system, power of information reporting is usually limited. Consequently, a reporting rate of information bits is further limited. Currently, the Bluetooth system usually uses an encoding manner in which no channel code or convolutional code is used. When there is no code, a receive end may report received data while making a judgment, to meet a limit of completing decoding and data reporting in <NUM>. However, performance of the Bluetooth system is poor. When convolutional code is used, because a decoding algorithm of the convolutional code is a Viterbi decoding algorithm, the Viterbi decoding algorithm with traceback may also meet the limit of completing decoding and data reporting in <NUM>. However, the performance of the Bluetooth system needs to be further improved. For ease of description, in this application, duration from a time point at which all data sent by the mobile phone is received by the primary headset and/or the secondary headset to a time point at which the primary headset and/or the secondary headset continues to perform decoding and reporting is referred to as a delay of decoding and reporting, and the delay of decoding and reporting needs to meet a <NUM> margin limit.

In conclusion, in an existing encoding manner, performance of a low-power communication system cannot be effectively improved when a delay limit of decoding and reporting is met.

<CIT> provides a method for encoding data in a wireless communication network. A communication device obtains an information bit sequence of a bit length K and a code length M. When M is greater than or equal to a first threshold and K is greater than or equal to a second threshold, the device divides the information bit sequence into p subsequences that are of an equal length K1. Then the device encodes each of the p subsequence to obtain p encoded subsequences. The device rate-matches each of the p encoded subsequences to obtain p rate matched subsequences, concatenates the p rate matched subsequences to obtain the output sequence of the code length M, then outputs the output sequence.

<CIT> provides a polar coding method and a coding device. The method comprises: acquiring information block to be transmitted and a target code length M of a polar code; determining the code length N of a parent code employed for polar coding, insofar as the target code length M is greater than N, if a coding parameter of the information block satisfies a preset criterion, dividing a bit sequence of the information to be coded into p subsections, independently polar coding the p subsections respectively to produce p coding bit sequences of which the length is the length of the parent code for the respective subsections, performing rate matching with respect respectively to p coding results to produce p coding bit sequences of which the length is the target code length of the subsections; and merging the rate matched p coding bit sequences to produce a coding bit sequence of which the length is M, where p is an integer greater than or equal to <NUM>. The coding method reduces the number of times that a repeating rate matching solution is used, thus mitigating performance loss brought forth by repetition.

<CIT> relates to wireless communications and, more particularly, to methods and apparatus for segmenting uplink control information prior for encoding using a polar code prior to transmission. An exemplary method that may be performed by a wireless device generally includes iteratively segmenting a group of K information bits into a plurality of segments, encoding the information bits of each of the plurality of segments using a polar code to generate a plurality of encoded segments, and transmitting the plurality of encoded segments.

Embodiments of this application provide a polar code segment encoding method, a communication device and a computer-readable storage medium, to effectively improve performance of a low-power communication system when a delay limit of decoding and reporting is met.

The invention is defined by the attached set of claims. Further details of the disclosed methods, devices and system are provided in the following, which are helpful for understanding the claimed invention.

The following clearly describes technical solutions in embodiments of this application in detail with reference to accompanying drawings. In descriptions of the embodiments of this application, unless otherwise stated, "/" indicates "or". For example, A/B may indicate A or B. The term "and/or" in this specification merely describes an association relationship for describing associated objects, and indicates that three relationships may exist. For example, A and/or B may indicate the following three cases: Only A exists, both A and B exist, and only B exists. In addition, in the descriptions of the embodiments of this application, "a plurality of" means two or more.

The terms "first" and "second" mentioned below are merely intended for description, and shall not be understood as an indication or implication of relative importance or implicit indication of a quantity of indicated technical features. Therefore, a feature limited by "first" or "second" may explicitly or implicitly include one or more features. In the descriptions of the embodiments of this application, unless otherwise specified, "a plurality of" means two or more.

<FIG> shows a network architecture of a Bluetooth communication system <NUM> according to an embodiment of this application. As shown in <FIG>, the communication system <NUM> may include a terminal device <NUM> and a Bluetooth headset <NUM>.

The Bluetooth communication system <NUM> is based on a Bluetooth technology. The Bluetooth technology is an open global specification for wireless data and voice communication. The Bluetooth technology is based on a low-cost short-range wireless connection, and is a special short-range wireless connection technology for establishing communication environments for fixed and mobile devices. The Bluetooth technology enables some portable mobile devices and computer devices today to connect to the Internet without requiring cables, and to access the Internet wirelessly. The Bluetooth technology replaces an infrared technology, to be applied to computers and mobile communication products with advantages of low costs, low power consumption, a short range, a high frequency (a frequency hopping technology), and high confidentiality.

The terminal device <NUM> may be fixed, or may be mobile. In some embodiments of this application, the terminal device <NUM> may be implemented as a mobile device, user equipment (User Equipment, UE), a terminal (terminal), a UE unit, a UE station, a mobile device, or the like. This is not limited in this embodiment of this application.

The Bluetooth headset <NUM> may be fixed, or may be mobile. A distance between the Bluetooth headset <NUM> and the terminal device <NUM> falls within a preset range. As shown in <FIG>, the Bluetooth headset may be divided into an audio-left channel headset and an audio-right channel headset. One of the audio left-channel headset and the audio-right channel headset is a primary headset of the Bluetooth headset <NUM>, and the other is a secondary headset of the Bluetooth headset <NUM>.

The Bluetooth communication system <NUM> is very sensitive to a delay. After receiving data, the Bluetooth headset needs to process the data in a very short time and reply with an acknowledgment message. Currently, interval duration from a time point at which the terminal device <NUM> completes sending the data to a time point the terminal device <NUM> receives an ACK of the primary headset is <NUM>.

<FIG> is a schematic diagram of data transmission according to an embodiment of this application, where T1 represents a receiving delay of the secondary headset; T2 represents duration in which the secondary headset receives a power-off procedure; T3 represents a processing delay of a media access control (Media Access Control, MAC) layer; T4 represents duration in which the secondary headset receives a power-on procedure; T5 represents duration in which the secondary headset sends a notification message to the primary headset, and the notification message is used to notify that the primary headset has received data; T6 represents a synchronization delay and a receiving delay of the primary headset; T7 represents waiting duration of a receiving window; T8 represents duration in which the primary headset receives a power-off procedure; T9 represents a processing delay of a MAC layer; T10 represents duration in which the primary headset sends a power-on procedure; T11 represents a receiving delay of a mobile phone; and t represents duration in which the secondary headset performs decoding and reporting. For example, duration of T1 is about <NUM>, duration of T2 is <NUM>, duration of T3 is about <NUM>, duration of T4 is <NUM>, duration of T5 is <NUM>, duration of T6 is <NUM>, duration of T7 is <NUM>, duration of T8 is <NUM>, duration of T9 is <NUM>, duration of T10 is <NUM>, and duration of T11 is <NUM>. As shown in <FIG>, after receiving all information sent by the mobile phone, the secondary headset has at µs time margin to complete decoding and data reporting, where t=<NUM>-T1-T2-T3-T4-T5-T6-T7-T8-T9-T10-T11, and t=<NUM>.

For a system that requires low power consumption, for example, a Bluetooth system, power of information reporting is usually limited. Consequently, a reporting rate of reporting information bits to the MAC layer is limited to the power of information reporting. For ease of description, in this application, duration from a time point at which all data sent by the terminal device is received by the primary headset and/or the secondary headset to a time point at which the primary headset and/or the secondary headset performs decoding and reporting is referred to as a delay of decoding and reporting, and the delay of decoding and reporting needs to be less than or equal to t. If the delay of decoding and reporting exceeds t, the mobile phone cannot accurately receive the acknowledgment message fed back by the primary headset.

An existing Bluetooth system usually uses an encoding manner in which no channel code or convolutional code is used. Although the foregoing two encoding manners may meet a delay requirement, performance of the Bluetooth system needs to be improved. In this application, performance of the entire system is improved by using polar code. Polar (Polar) code is the first encoding manner that is theoretically proven to reach a Shannon capacity, and has characteristics of high performance and low encoding and decoding complexity. In different code lengths, especially for code based on a finite field, performance of the polar code is much better than Turbo code and LDPC code. Currently, the polar code has become an encoding manner for new radio (New radio, NR) control information of the 3rd generation partnership project protocol (3rd Generation Partnership Project, 3GPP).

The polar code is linear block code, a generation matrix of the polar code is FN, and an encoding process of the polar code is <MAT> is a binary row vector with a length N (namely, a code length). FN is a matrix of N×N, and <MAT>. Herein, <MAT>, and <MAT> is defined as a Kronecker (Kronecker) product of log<NUM> N matrices F<NUM>.

In the encoding process of the polar code, some bits in <MAT> are used to carry information, and are referred to as information bits. A set of indexes of these bits is recorded as I. The other bits are set to be fixed values pre-appointed by a transmit end and a receive end, and are referred to as fixed bits. A set of indexes of these bits is represented by a complementary set Ic of I. The fixed bits are usually set to <NUM>. However, the fixed bits may be randomly set provided that the transmit end and the receive end reach an agreement in advance.

For the polar code, encoding and decoding are performed based on a segment code length (a power of <NUM>). A longer segment code length indicates a stronger error correcting capability and greater complexity. Therefore, an appropriate segment code length is usually selected after performance and complexity are weighed. The polar code is linear block code. If a transmitted data packet is large, which far exceeds a maximum segment code length set by the polar code, in this case, segment processing may be performed on transmitted data.

There are two existing polar code segmentation manners in <NUM>. In a first segmentation manner, an information bit sequence is evenly divided into two segments. If an information bit length of the information bit sequence cannot be divided by <NUM>, zero-padding is performed at a front end of a first segment in the two segments. When polar code segment encoding is performed in the first segmentation manner, rate matching needs to be performed on all segments, that is, a segment code length of each segment obtained after polar code encoding is converted to an actually required length in a manner of puncturing, shortening, or repetition. It may be understood that the actually required length meets the power of <NUM>.

In the first segmentation manner, rate matching needs to be performed, which increases implementation complexity and is not applicable to a low-power system. In addition, the first segmentation manner may not meet a delay requirement of decoding and reporting. For example, <FIG> is a schematic diagram of a delay of decoding and reporting of a first segmentation manner according to an embodiment of this application. For example, in the Bluetooth communication system, a Bluetooth bandwidth is less than or equal to <NUM> Mb/s (megabit per second), a reporting bandwidth is equal to <NUM> Mb/s, and a code rate is equal to <NUM>/<NUM>. If an information bit length K<NUM> of a second segment (segment #<NUM>) in the two segments is <NUM>, and a segment code length N<NUM> is <NUM>, a reporting time of the second segment is K<NUM> / <NUM> (microsecond), namely, <NUM>, which exceeds the <NUM> delay limit of decoding and reporting.

In a second segmentation manner, an information bit sequence is divided into n segments based on a maximum segment code length, and code rates corresponding to the n segments are equal. Segment code lengths of the first n-<NUM> segments in the n segments are the maximum segment code length, and information bit lengths of the first n-<NUM> segments may be determined based on the maximum segment code length and the code rates; an information bit length of the last segment in the n segments may be determined; and then a segment code length of the last segment may be determined based on the code rate and the information bit length of the last segment.

In the second segmentation manner, rate matching does not need to be performed. Compared with the first segmentation manner, implementation complexity is reduced. However, the second segmentation manner may alternatively not meet the delay limit of decoding and reporting. For example, <FIG> is a schematic diagram of a delay of decoding and reporting of a second segmentation manner according to an embodiment of this application. For example, in the Bluetooth communication system, a Bluetooth bandwidth is less than or equal to <NUM> Mb/s, a reporting bandwidth is equal to <NUM> Mb/s, and a code rate is equal to <NUM>/<NUM>. If a segment code length N<NUM> of an (n-<NUM>)th segment (segment #n-<NUM>) in the n segments is <NUM>, and an information bit length K<NUM> is <NUM>, a reporting time of the (n-<NUM>)th segment is <NUM>. If an information bit length K<NUM> of an nth segment (segment #n-<NUM>) in the n segments is <NUM>, and a segment code length N<NUM> is <NUM>, a receiving time of the nth segment is <NUM>/<NUM> Mb/s, namely, <NUM>, and a delay of decoding and reporting after data of the nth segment is received is <NUM>-<NUM>, namely, <NUM>, which exceeds the <NUM> delay limit of decoding and reporting. In the second segmentation manner, if the information bit length of the nth segment is small, all of receiving duration, decoding duration, and reporting duration are relatively small. In this case, the delay of decoding and reporting is limited to reporting duration of the (n-<NUM>)th segment.

In this application, it is hoped that the performance of the entire system is improved by using the polar code. In addition, a new segmentation method is proposed by using a characteristic that the polar code is linear block code, to meet a delay limit on decoding and reporting of a low-power system in this application.

An embodiment of this application provides a polar code segment encoding method. <FIG> is a schematic flowchart of a polar code segment encoding method according to the claimed invention.

As shown in <FIG>, the polar code segment encoding method provided in this embodiment of this application includes but is not limited to steps S501 to S505. The following further describes possible implementations of the method embodiment.

S501: Determine, based on a length of to-be-encoded information bits and a code rate, a code length N after encoding, where N is a positive integer.

Optionally, based on the foregoing analysis, the determining, based on a length of to-be-encoded information bits and a code rate, a code length N after encoding includes: determining a theoretical code length L based on the length K<NUM> of the to-be-encoded information bits and the code rate R, where a value of the theoretical code length is ceil(K<NUM>/R), and ceil(x) represents rounding up X; and determining N based on the theoretical code length and the minimum segment code length <NUM>^a, where a value of N is ceil(L / <NUM>^a) * <NUM>^a. According to the determining manner of the code length N , it is ensured that an actual code length N after encoding is an integer multiple of the minimum segment code length.

It should be noted that in this embodiment of this application, it is proposed that segment code lengths of all segments corresponding to the code length N need to be equal to a power of <NUM>, and a segment code length of each segment is greater than or equal to a preset minimum segment code length. It may be understood that in the foregoing case, a sum (that is, the actual code length after encoding) of the segment code lengths of all the segments is an integer multiple of the minimum segment code length. In the determining manner of the code length N, rate matching does not need to be performed, and implementation complexity is not increased. Therefore, the determining manner is applicable to a low-power system.

S502: Determine, based on N, a minimum segment code length, and a maximum segment code length, a reserved segment quantity of each type of segments in segments of b-a+<NUM> types of segment code lengths and a reserved code length corresponding to N, where a value of the minimum segment code length is <NUM>^a, a value of the maximum segment code length is <NUM>^b, the b-a+<NUM> types of segment code lengths of the segments are <NUM>^c, a, b, and c are positive integers, a<b, and a≤c≤b.

Optionally, if the value of the minimum segment code length is <NUM>^a, and the value of the maximum segment code length is <NUM>^b , the segments of the b-a+<NUM> types of segment code lengths may be determined based on the minimum segment code length and the maximum segment code length, the b-a+<NUM> types of segment code lengths of the segments are <NUM>^c, a, b, and c are positive integers, a < b, and a≤c≤b.

In this embodiment of this application, the actual code length N is divided into S segments. The S segments include one or more types of segments in the b-a+<NUM> types of segments that correspond to the b-a+<NUM> types of segment code lengths. A delay of decoding and reporting is mainly limited to the last y segments of the S segments, where S and y are positive integers, and y is less than or equal to S.

It may be understood that in this embodiment of this application, a segment code length of each type of segments is equal to the power of <NUM>. Therefore, implementation complexity can be relatively reduced in the solution provided in this embodiment of this application.

Optionally, segment code lengths of the last y segments of the S segments are less than segment code lengths of the first S-y segments of the S segments.

It may be understood that a smaller information bit length of a segment (in a same code rate, a smaller segment code length of the segment) indicates shorter duration of decoding and reporting. That the segment code lengths of the last y segments are less than the segment code lengths of the first S-y segments helps reduce the delay of decoding and reporting.

Optionally, a segment code length of an (i+<NUM>)th segment in the S segments is less than or equal to a segment code length of an (i+<NUM>)th segment in the S segments.

It may be understood that, to avoid a case in which the delay of decoding and reporting is limited to reporting duration of the penultimate segment because an information bit length (a segment code length) of the last segment is much smaller than an information bit length (a segment code length) of the penultimate segment, in this embodiment of this application, a segment code length of a (j+<NUM>)th segment in the last y segments is less than or equal to a segment code length of a jth segment in the last y segments, so that the segment code lengths of the last y segments are in a decreasing trend.

In some embodiments of this application, to implement that the segment code lengths of the last y segments of the S segments are less than the segment code lengths of the first S-y segments of the S segments, and the segment code length of the (j+<NUM>)th segment of the last y segments is less than or equal to the segment code length of the jth segment of the last y segments, after the code length N is determined, a specific quantity of segments are pre-reserved for a segment type whose segment code length is small in the b-a+<NUM> types of segments.

Optionally, the determining, based on N, a minimum segment code length, and a maximum segment code length, a reserved segment quantity of each type of segments in segments of b-a+<NUM> types of segment code lengths and a reserved code length corresponding to N, where a value of the minimum segment code length is <NUM>^a, a value of the maximum segment code length is <NUM>^b , the b-a+<NUM> types of segment code lengths of the segments are <NUM>^c, a, b, and c are positive integers, a<b, and a≤c≤b includes: determining the segments of the b-a+<NUM> types of segment code lengths based on the minimum segment code length and the maximum segment code length, where the value of the minimum segment code length is <NUM>^a, the value of the maximum segment code length is <NUM>^b, the b-a+<NUM> types of segment code lengths of the segments are <NUM>^c, a, b, and c are positive integers, a<b, and a≤c≤b; orderly determining a reserved segment quantity of an ith type of segments in the b-a+<NUM> types of segments based on the b-a+<NUM> types of segment code lengths of the segments from the smallest to the largest and based on N and the segment code length of each type of segments in the b-a+<NUM> types of segments, where the reserved segment quantity of the ith type of segments is greater than or equal to a reserved segment quantity of an (i+<NUM>)th type of segments in the b-a+<NUM> types of segments; and determining the reserved code length corresponding to N based on the reserved segment quantity of each type of segments and the segment code length of each type of segments.

Optionally, the determining, based on N, a minimum segment code length, and a maximum segment code length, a reserved segment quantity of each type of segments in segments of b-a+<NUM> types of segment code lengths and a reserved code length corresponding to N includes: if N < p * <NUM>^a, determining that a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^a is <MAT>, and a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^j is <NUM>, where a<j≤b and p≥<NUM>; if <MAT>, determining that a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^j is <NUM>, a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^c+<NUM> is <MAT>, and a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^v is p, where a≤c≤b-<NUM>, a≤v≤c, and c+<NUM><j≤b; or if <MAT>, determining that the reserved segment quantity of each type of segments is p; and determining the reserved code length Nres based on the reserved segment quantity of each type of segments, where <MAT>, and mc,N represents a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^c.

Relative to a receiving rate, when a reporting rate is very low, reporting of a last segment is not completed after a current segment is received. This causes a great impact on the delay of decoding and reporting. In this embodiment of this application, a value of p may be determined based on an actual case. Relative to the receiving rate, a lower reporting rate indicates a larger value of p.

Through implementation of the solution provided in this embodiment of this application, an adverse impact of a low reporting rate on the delay of decoding and reporting can be effectively reduced.

It should be noted that a Bluetooth bandwidth is equal to B<NUM>, a reporting bandwidth is equal to B<NUM>, and a code rate is R<NUM>. N corresponds to the S segments, and the segment code length of the ith segment and the segment code length of the (i+<NUM>)th segment in the S segments are N<NUM> and N<NUM>. Receiving duration of the (i+<NUM>)th segment is <MAT>, and reporting duration of the ith segment is <MAT>. If <MAT>, reporting of the ith segment is not ended after receiving of the (i+<NUM>)th segment is ended. Consequently, a start point of reporting of the (i+<NUM>)th segment is affected, and in this case, <MAT>. Therefore, in the foregoing case, a final delay of decoding and reporting may be affected. In this application, N<NUM>≥N<NUM>. To reduce an impact of reporting of the ith segment on reporting of the (i+<NUM>)th segment, N<NUM>=N<NUM> may be set. Therefore, in this embodiment of this application, to effectively reduce an impact of reporting of the ith segment on the delay of decoding and reporting, p segments are pre-reserved for segments of a same segment code length.

For example, the value of p is <NUM>. If the minimum segment code length is <NUM>, namely, <NUM>^<NUM>, and the maximum segment code length is <NUM>, namely, <NUM>^<NUM>, a reserved segment quantity of each type of segments in segments of four types of segment code lengths and the reserved code length corresponding to N are determined based on N , the minimum segment code length, and the maximum segment code length. This step includes: determining, based on the minimum segment code length and the maximum segment code length, that the four types of segment code lengths are <NUM>, <NUM>, <NUM>, and <NUM>; and determining the reserved segment quantity of each type of segments in the four types of segments and the reserved code length corresponding to N, as shown in Table <NUM>.

It may be understood that m<NUM>,N represents a reserved segment quantity of the segments whose segment code lengths are <NUM>, m<NUM>,N represents a reserved segment quantity of the segments whose segment code lengths are <NUM>, m<NUM>,N represents a reserved segment quantity of the segments whose segment code lengths are <NUM>, and m<NUM>,N represents a reserved segment quantity of the segments whose segment code lengths are <NUM>. The value of p is <NUM>. If N < <NUM>, the reserved code length corresponding to N is <MAT>; if <NUM>≤N<<NUM>, the reserved code length corresponding to N is p*<NUM>^<NUM>, namely, <NUM>; if <NUM>≤N <<NUM>, the reserved code length corresponding to N is p*(<NUM>^<NUM> + <NUM>^<NUM>), namely, <NUM>; if <NUM> ≤N <<NUM>, the reserved code length corresponding to N is p*(<NUM>^<NUM> +<NUM>^<NUM> +<NUM>^<NUM>), namely, <NUM>; or if <NUM>≤N, the reserved code length corresponding to N is p*(<NUM>^<NUM> + <NUM>^<NUM> + <NUM>^<NUM> + <NUM>^<NUM>), namely, <NUM>.

Examples in which the value of N is <NUM>, <NUM>, <NUM>, and <NUM> are used for description. When the value of N is <NUM>, the reserved segment quantity corresponding to m<NUM>,N is <MAT>, namely, <NUM>, the reserved segment quantities of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, and the reserved code length corresponding to N is <NUM>; <NUM>-<NUM> when the value of N is <NUM>, the reserved segment quantity corresponding to m<NUM>,N is <MAT>, namely, <NUM>, the reserved segment quantities of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, and the reserved code length corresponding to N is <NUM>; when the value of N is <NUM>, the reserved segment quantity corresponding to m<NUM>,N is <NUM>-<NUM> <MAT>, namely, <NUM>, the reserved segment quantities of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, and the reserved code length corresponding to N is <NUM>; and when the value of N is <NUM>, the reserved segment quantity corresponding to m<NUM>,N is <MAT>, namely, <NUM>, the reserved segment quantities of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, and the reserved code length corresponding to N is <NUM>.

Optionally, the determining, based on N, a minimum segment code length, and a maximum segment code length, a reserved segment quantity of each type of segments in segments of b-a+<NUM> types of segment code lengths and a reserved code length corresponding to N includes: determining the b-a+<NUM> types of segments based on the minimum segment code length and the maximum segment code length; if N < <NUM>^a, determining that the reserved segment quantity of each type of segments is <NUM>; if <MAT>, determining that a reserved segment quantity of segments whose segment code lengths are <NUM>^j is <NUM>, and a reserved segment quantity of segments whose segment code lengths are <NUM>^v is <NUM>, where a≤c≤b-<NUM>, a≤v≤c, and c<j≤b; or if <MAT>, determining that the reserved segment quantity of each type of segments is <NUM>; and determining the reserved code length Nres based on the reserved segment quantity of each type of segments, where <MAT>, and mc,N represents a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^c. <MAT> indicates that superposition is performed on <NUM>^i with i changes, and a≤i≤c.

It may be understood that the solution in this embodiment of this application is a special case in which the value of p is <NUM>. In this embodiment of this application, there is no need to reserve a plurality of segments for segments of a same segment code length. This solution is applicable to a case of <MAT>.

For example, if the minimum segment code length is <NUM>, namely, <NUM>^<NUM>, and the maximum segment code length is <NUM>, namely, <NUM>^<NUM>, a reserved segment quantity of each type of segments in segments of four types of segment code lengths and the reserved code length corresponding to N are determined based on N , the minimum segment code length, and the maximum segment code length. This step includes: determining, based on the minimum segment code length and the maximum segment code length, that the four types of segment code lengths are <NUM>, <NUM>, <NUM>, and <NUM>; and determining the reserved segment quantity of each type of segments in the four types of segments and the reserved code length corresponding to N, as shown in Table <NUM>.

It may be understood that if N < <NUM>, the reserved code length corresponding to N is <NUM>; if <NUM> ≤ N < <NUM>, the reserved code length corresponding to N is <NUM>^<NUM> ; if <NUM> ≤ N < <NUM> , the reserved code length corresponding to N is <NUM>^<NUM> + <NUM>^<NUM>, namely, <NUM>; if <NUM> ≤ N < <NUM> , the reserved code length corresponding to N is <NUM>^<NUM> + <NUM>^<NUM> + <NUM>^<NUM>, namely, <NUM>; or if <NUM> < N , the reserved code length corresponding to N is <NUM>^<NUM> + <NUM>^<NUM> + <NUM>^<NUM> + <NUM>^<NUM>, namely, <NUM>.

It can be learned from the foregoing example that in this embodiment of this application, a specific quantity of segments may be pre-reserved for segments whose segment code lengths are short, and a sum of segment code lengths of the reserved segments is the reserved code length.

S503: Orderly determine a segment quantity of each type of segments based on N , the reserved code length, a segment code length of each type of segments, and the reserved segment quantity of each type of segments and based on the segment code lengths from the largest to the smallest, where a sum of segment quantities of all types of segments is equal to S, N corresponds to S segments, and a segment code length of an ith segment in the S segments is greater than or equal to a segment code length of an (i+<NUM>)th segment in the S segments.

Optionally, the orderly determining a segment quantity of each type of segments based on N, the reserved code length, a segment code length of each type of segments, and the reserved segment quantity of each type of segments and based on the segment code lengths from the largest to the smallest includes: orderly determining a remaining segment quantity of each type of segments based on N, the reserved code length, and the segment code length of each type of segments and based on the segment code lengths from the largest to the smallest, where the remaining segment quantity of each type of segments is a remaining segment quantity of each type of segments corresponding to a remaining code length that is obtained by subtracting the reserved code length from N; and determining the segment quantity of each type of segments based on the reserved segment quantity of each type of segments and the remaining segment quantity of each type of segments.

In this embodiment of this application, the remaining code length obtained by subtracting the reserved code length from N is segmented again. The orderly determining a remaining segment quantity of each type of segments based on the segment code lengths from the largest to the smallest is as follows: preferentially allocating the remaining code length to a segment type whose segment code length is large.

It may be understood that a smaller segment quantity indicates better system performance. In an optional embodiment of step S503, to meet the delay limit of decoding and reporting, a quantity of segments is first reserved for a segment type whose segment code length is small. When the delay limit of decoding and reporting is met, in this embodiment of this application, the remaining code length is preferentially allocated to the segment type whose segment code length is large, so that a total segment quantity is as small as possible, even if S is as small as possible.

Optionally, the orderly determining a remaining segment quantity of each type of segments based on N, the reserved code length, and the segment code length of each type of segments and based on the segment code lengths from the largest to the smallest includes: if N < <NUM>^a, determining that a remaining segment quantity zc,N that corresponds to N and that is of the segments whose segment code lengths are <NUM>^c is <NUM>, and a remaining segment quantity za,N that corresponds to N and that is of the segments whose segment code lengths are <NUM>^a is <NUM>, where a<c≤b; or if N≥<NUM>^a, orderly determining the remaining segment quantity of each type of segments based on the segment code lengths from the largest to the smallest, and determining that a remaining segment quantity zb,N that corresponds to N and that is of segments whose segment code lengths are <NUM>^b is <MAT>, and a remaining segment quantity zc,N that corresponds to N and that is of the segments whose segment code lengths are <NUM>^c is <MAT>, where a≤c<b, and floor(x) represents rounding down X.

For example, if the minimum segment code length is <NUM>, namely, <NUM>^<NUM>, and the maximum segment code length is <NUM>, namely, <NUM>^<NUM>, it is determined, based on the minimum segment code length and the maximum segment code length, that the four types of segment code lengths are <NUM>, <NUM>, <NUM>, and <NUM>. Examples in which the value of N is <NUM>, <NUM>, <NUM>, and <NUM> are used for description. When the value of N is <NUM>, the reserved segment quantities of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, the reserved code length corresponding to N is <NUM>, and the remaining code length is <NUM>; when the value of N is <NUM>, the reserved segment quantities of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, the reserved code length corresponding to N is <NUM>, and the remaining code length is <NUM>; when the value of N is <NUM>, the reserved segment quantities of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, the reserved code length corresponding to N is <NUM>, and the remaining code length is <NUM>; and when the value of N is <NUM>, the reserved segment quantities of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, the reserved code length corresponding to N is <NUM>, and the remaining code length is <NUM>. When the value of N is <NUM>, <NUM>, and <NUM>, corresponding remaining segment quantities of the four types of segments are shown in Table <NUM>.

It may be understood that z<NUM>,N represents a reserved segment quantity of the segments whose segment code lengths are <NUM>, z<NUM>,N represents a reserved segment quantity of the segments whose segment code lengths are <NUM>, z<NUM>,N represents a reserved segment quantity of the segments whose segment code lengths are <NUM>, and z<NUM>,N represents a reserved segment quantity of the segments whose segment code lengths are <NUM>. It can be learned from the foregoing example that in this embodiment of this application, a remaining segment quantity can be first allocated to a segment type whose segment code length is large.

Optionally, the determining the segment quantity of each type of segments based on the reserved segment quantity of each type of segments and the remaining segment quantity of each type of segments includes: determining a segment quantity Mc,N that corresponds to N and that is of the segments whose segment code lengths are <NUM>^c, where Mc,N = mc,N + zc,N, and a≤c≤b.

It may be understood that the segment quantity of the segments whose segment code lengths are <NUM>^c is equal to a reserved segment quantity of the segments whose segment code lengths are <NUM>^c plus a remaining segment quantity of the segments whose segment code lengths are <NUM>^c.

For example, if the minimum segment code length is <NUM>, and the maximum segment code length is <NUM>, it is determined, based on the minimum segment code length and the maximum segment code length, that the four types of segment code lengths are <NUM>, <NUM>, <NUM>, and <NUM>. When the value of N is <NUM>, the reserved segment quantities that correspond to N and that are of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>, and the remaining segment quantities that correspond to N and that are of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>. Therefore, segment quantities that correspond to N and that are of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>.

S504: Determine a target information bit length of each segment based on the code rate and a segment code length of each segment in the S segments.

Optionally, the determining a target information bit length of each segment based on the code rate and a segment code length of each segment in the S segments includes: determining that a target information bit length of a segment whose segment code length is <NUM>^c in the S segments is ceil(<NUM>^c * R).

It may be understood that in this embodiment of this application, segment code rates of the S segments almost equal, and a segment code rate of a segment=a target information bit length of the segment/a segment code length of the segment. In this embodiment of this application, the target information bit length of each segment is determined based on the code rate R and the segment code length of each segment. To ensure that the target information bit length of the segment is a positive integer, (<NUM>^c * R) is rounded up. Therefore, a sum of target information bit lengths of the S segments is greater than or equal to the length K<NUM> of the to-be-encoded information bits.

It should be noted that in a same channel environment and a same segment code rate, a larger segment code length of a segment indicates a lower packet error rate and better performance. Therefore, a segment with a larger segment code length in the S segments has better performance.

Optionally, a difference between the sum of the target information bit lengths of the S segments and the length of the to-be-encoded information bits is k<NUM>, and <MAT>. To ensure that the sum of the target information bit lengths of the S segments is equal to the length of the to-be-encoded information bits, the determining a target information bit length of each segment based on the code rate and a segment code length of each segment in the S segments includes: when the segment code length of the ith segment in the S segments is <NUM>^e, determining that a target information bit length of the ith segment is ceil(<NUM>^e*R)-k<NUM>, and a target information bit length of a segment that is in segments other than the ith segment in the S segments and whose segment code length is <NUM>^c is ceil(<NUM>^c*R). <NUM>≤i≤S, i may be equal to <NUM>, equal to S, or equal to another predetermined value. This is not specifically limited in this embodiment of this application.

Optionally, if the ith segment in the S segments is an Sth segment in the S segments, the determining a target information bit length of each segment based on the code rate and a segment code length of each segment in the S segments includes: if <MAT>, determining that a target information bit length of a segment whose segment code length is <NUM>^c is ceil(<NUM>^c*R), where a≤c≤b; or if <MAT>, determining that a target information bit length of a segment whose segment code length is <NUM>^c is ceil(<NUM>^c*R), target information bit lengths that correspond to N and that are of the first Ma,N -<NUM> segments in Ma,N segments whose segment code lengths are <NUM>^a are ceil(<NUM>^a*R), and a target information bit length of an (Ma,N)th segment in the Ma,N segments is <MAT>, where the (Ma,N)th segment is an Sth segment in the S segments, and a<c≤b.

Optionally, the determining a target information bit length of each segment based on the code rate and a segment code length of each segment in the S segments includes: determining a reference information bit length of each segment; and determining the target information bit length of each segment based on the reference information bit length of each segment and the segment quantity of each type of segments.

It should be noted that in this embodiment of this application, the reference information bit length of each segment is determined first, and then the target information bit length of each segment is adjusted based on the reference information bit length and an actual requirement.

Optionally, the reference information bit length of the segment whose segment code length is <NUM>^c in the S segments is ceil (<NUM>^c*R).

Optionally, the determining a target information bit length of each segment based on the code rate and a segment code length of each segment in the S segments includes: if <MAT>, determining that a reference information bit length that corresponds to N and that is of a segment whose segment code length is <NUM>^c is ceil(<NUM>^c*R), where a≤c≤b; or if <MAT>, determining that a reference information bit length that corresponds to N and that is of a segment whose segment code length is <NUM>^c is ceil(<NUM>^c*R), reference information bit lengths of the first Ma,N-<NUM> segments in Ma,N segments are ceil(<NUM>^a*R), and a reference information bit length of an (Ma,N)th segment in the Ma,N segments is <MAT>, where the (Ma,N)th segment is an Sth segment in the S segments, and a<c≤b; and determining the target information bit length of each segment based on the reference information bit length of each segment and the segment quantity of each type of segments.

Optionally, the determining the target information bit length of each segment based on the reference information bit length of each segment and the segment quantity of each type of segments includes: determining the target information bit length of each segment according to an allocation principle. The allocation principle is that on the basis of the reference information bit length of each segment, a first information bit length is totally added to f segments whose segment code lengths are the largest in the S segments, h segments whose segment code lengths are not the largest in the S segments are reduced by totally the first information bit length, a segment with a smaller segment code length in the segments whose segment code lengths are not the largest has a smaller segment code rate, and a sum of target information bit lengths of the S segments is K<NUM>, where f and h are positive integers.

It should be noted that a segment with a larger segment code length has better performance in a case of a same segment code rate. In this embodiment of this application, based on the reference information bit length, the target information bit length of each segment is adjusted, so that segment code rates of the segments whose segment code lengths are the largest in the S segments are increased, and segment code rates of the segments whose segment code lengths are not the largest in the S segments are decreased, thereby properly improving system performance of the segments whose segment code lengths are the largest, degrading system performance of the segments whose segment code lengths are not the largest, and implementing overall improvement of system performance. In addition, the segments whose segment code lengths are not the largest are segments of packet trailers of the S segments, and a segment having a smaller segment code length is more backward. Therefore, information bit lengths of the segments whose segment code lengths are not the largest may be adjusted, so that a segment with a smaller segment code length in the segments whose segment code lengths are not the largest has a smaller segment code rate. This improves overall system performance, and can further reduce the delay of decoding and reporting.

Optionally, the determining the target information bit length of each segment based on the reference information bit length of each segment and the segment quantity of each type of segments includes: determining a target information bit length of a first segment, where the target information bit length of the first segment is equal to a reference information bit length of the first segment plus a second information bit length, and the first segment is a segment whose segment code length is the largest in the S segments; and determining a target information bit length of a second segment, where the target information bit length of the second segment is equal to a reference information bit length of the second segment minus a third information bit length, and the second segment is a segment whose segment code length is not the largest in the S segments. In the S segments, h segments whose segment code lengths are not the largest are reduced by totally f times of the second information bit length, and a segment with a smaller segment code length in the segments whose segment code lengths are not the largest has a smaller segment code rate, where a sum of target information bit lengths of the S segments is K<NUM>, f is a segment quantity of segments whose segment code lengths are the largest in the S segments, and h is a positive integer greater than or equal to <NUM>.

Optionally, the determining the target information bit length of each segment based on the reference information bit length of each segment and the segment quantity of each type of segments includes: if a segment code length of a segment whose segment code length is the largest in the S segments is <NUM>^a, determining that a target information bit length of the segment whose segment code length is <NUM>^a is equal to a reference information bit length of the segment whose segment code length is <NUM>^a; or if a segment code length of a segment whose segment code length is the largest in the S segments is <NUM>^r, determining that a target information bit length of the segment whose segment code length is <NUM>^r is a reference information bit length of the segment whose segment code length is <NUM>^r plus <MAT>, and a target information bit length of a segment whose segment code length is <NUM>^c is a reference information bit length of the segment whose segment code length is <NUM>^c minus ∂c*Mr,N, where a≤c<r, ∂c is a proportion parameter, and ∂c is a positive integer.

It should be noted that <NUM><∂c+<NUM>≤<NUM>∂c, so that the segment code rates of the segments whose segment code lengths are not the largest are in a decreasing trend.

For example, if the minimum segment code length is <NUM>, and the maximum segment code length is <NUM>, it is determined, based on the minimum segment code length and the maximum segment code length, that the four types of segment code lengths are <NUM>, <NUM>, <NUM>, and <NUM>. The value of N is <NUM>, the value of K<NUM> is <NUM>, and the code rate is <NUM>. It can be learned from derivation of the solution in this embodiment of this application that the segment quantities that correspond to N and that are of the four types of segments are <NUM>, <NUM>, <NUM>, and <NUM>. It is assumed that values of ∂<NUM>, ∂<NUM>, and ∂<NUM> are <NUM>, <NUM>, and <NUM>. In this case, information bit lengths of the segments whose segment code lengths are <NUM> are <NUM>, information bit lengths of the segments whose segment code lengths are <NUM> are <NUM>, information bit lengths of the segments whose segment code lengths are <NUM> are <NUM>, and information bit lengths of the segments whose segment code lengths are <NUM> are <NUM>. Segment code rates of the four types of segments are <NUM>, <NUM>, <NUM>, <NUM>, and <NUM>. Therefore, it can be learned that the segment code lengths of the four types of segments are in a decreasing trend, and the segment code rates of the four types of segments are also in a decreasing trend.

Based on the foregoing example, <FIG> is a schematic diagram of a delay of decoding and reporting according to an embodiment of this application. If a reporting bandwidth is equal to <NUM> Mb/s, a reporting delay of a last segment is equal to <NUM>. Because a time difference of decoding and reporting of the last segment may be ignored, the delay of decoding and reporting is approximately equal to <NUM>, which meets the <NUM> delay limit of decoding and reporting.

Based on the foregoing example, the value of K<NUM> is <NUM>, and the code rate is <NUM>. Under same network parameters, segmentation is performed based on the first segmentation manner, a to-be-encoded information sequence is divided into two parts, an information bit length of a second segment is <NUM>, and a segment code length is <NUM>. The delay of decoding and reporting is approximately equal to <NUM>, which far exceeds the <NUM> delay limit of decoding and reporting. Under same network parameters, segmentation is performed based on the first segmentation manner, a to-be-encoded information sequence is divided into two parts, a segment code length of a second segment is <NUM>, and an information bit length is <NUM>. The delay of decoding and reporting is also approximately equal to <NUM>, which far exceeds the <NUM> delay limit of decoding and reporting.

Based on the foregoing analysis, the solution proposed in this embodiment of this application can greatly optimize the delay of decoding and reporting.

It should be noted that in this embodiment of this application, when the segment quantities Mb,N of the segments whose segment code lengths are the largest are large, an information bit length added for the segments whose segment code lengths are the largest in the S segments is excessively large. In addition, the information bit length reduced for the segments whose segment code lengths are not the largest in the S segments is excessively large.

Optionally, to resolve the foregoing problem, if Mb,N > T, and T is a positive integer, the determining the target information bit length of each segment based on the reference information bit length of each segment and the segment quantity of each type of segments includes: determining that target information bit lengths of the first T segments in Mb,N segments whose segment code lengths are <NUM>^b are a reference information bit length of the segment whose segment code length is <NUM>^b plus <MAT>, target information bit lengths of the last Mb,N-T segments in the Mb,N segments are equal to the reference information bit length of the segment whose segment code length is <NUM>^b , and a target information bit length of a segment whose segment code length is <NUM>^c is a reference information bit length of the segment whose segment code length is <NUM>^c minus ∂c*T, where a≤c<b, ∂c is a positive integer, and ∂c+<NUM>>∂c.

It should be noted that, to resolve the foregoing problem, in this embodiment of this application, information bits are added for only the first T segments in the Mb,N segments whose segment code lengths are <NUM>^b, and the information bit length is properly reduced, with T as a reference amount, for the segments whose segment code lengths are not the largest. In this embodiment of this application, segment code rates of the first T segments are greater than segment code rates of the last Mb,N-T segments.

S505: Perform polar code encoding on the to-be-encoded information bits based on the target information bit length of each segment.

According to the claimed invention, the performing polar code encoding on the to-be-encoded information bits based on the target information bit length of each segment includes: orderly allocating the to-be-encoded information bits to the S segments based on the target information bit length of each segment, and performing polar code encoding on information bits of each segment.

Optionally, the performing polar code encoding on the to-be-encoded information bits based on the target information bit length of each segment includes: if <MAT>, orderly allocating the to-be-encoded information bits to the S segments based on the target information bit length of each segment, and performing polar code encoding on information bits of each segment; or if <MAT>, performing zero-padding on to-be-encoded information bits whose information bit length is K<NUM>, where the information bit length of the to-be-encoded information bits after zero-padding is <MAT>, orderly allocating the to-be-encoded information bits after zero-padding to the S segments based on the target information bit length of each segment, and performing polar code encoding on information bits of each segment.

It may be understood that in this embodiment of this application, a round up operation is used in a process of determining the target information bit length of each segment, so that the sum of the target information bit lengths of the S segments corresponding to N is greater than the length of the to-be-encoded information bits. In this embodiment of this application, through a zero-padding operation, the length of the to-be-encoded information bits after zero-padding is equal to the sum of the target information bit lengths of the S segments. This helps subsequently perform polar code encoding on each segment.

Optionally, the performing zero-padding on to-be-encoded information bits whose information bit length is K<NUM> includes: performing zero-padding at a preset location in the to-be-encoded information bits whose information bit length is K<NUM>.

Optionally, zero-padding is performed at a front end of the to-be-encoded information bits whose information bit length is K<NUM>, or zero-padding is performed at a tail end of the to-be-encoded information bits whose information bit length is K<NUM>.

In this embodiment of this application, the segments of the b-a+<NUM> types of segment code lengths are determined based on the minimum segment code length and the maximum segment code length, the value of the minimum segment code length is <NUM>^a, and the value of the maximum segment code length is <NUM>^b; and the code length N after encoding is divided into the S segments based on the minimum segment code length and the b-a+<NUM> types of segment code lengths of the segments, the segment code length of the ith segment in the S segments is greater than or equal to the segment code length of the (i+<NUM>)th segment in the S segments, and the to-be-encoded information bits are allocated to the S segments for polar code encoding. In the proposed solution, rate matching does not need to be performed, so that overheads brought by rate matching are avoided. In addition, segment code lengths of segments of a packet trailer of a data packet after segmentation are in a decreasing trend. This can effectively improve performance of a low-power communication system when a low delay requirement is met. In addition, in this embodiment of this application, based on the reference information bit length, the target information bit length of each segment is adjusted, so that the segment code rates of the segments whose segment code lengths are the largest in the S segments are increased, and the segment code rates of the segments whose segment code lengths are not the largest in the S segments are decreased, thereby improving the overall system performance. In addition, the information bit lengths of the segments whose segment code lengths are not the largest are adjusted, so that a segment with a smaller segment code length in the segments whose segment code lengths are not the largest has a smaller segment code rate. This improves the overall system performance, can further reduce the delay of decoding and reporting, matches an existing communication system, and reduces modifications to the existing system.

<FIG> is a schematic diagram of a principle of polar code segment encoding and segment decoding according to an embodiment of this application. A transmit end determines, according to the polar code segment encoding method provided in the embodiments of this application, segment code lengths of S segments corresponding to to-be-encoded information bits and information bits of the S segments, and performs polar code segment encoding based on the segment code lengths of the S segments and the information bits of the S segments. A receive end determines, according to the polar code segment encoding method provided in the embodiments of this application, the segment code lengths of the S segments corresponding to the to-be-encoded information bits and the information bits of the S segments. After receiving data, the receive end performs polar code segment decoding based on the segment code lengths of the S segments and the information bits of the S segments. After decoding, whether the received data is correct is determined through check. If the received data is correct, ACK information is replied to the transmit end, to tell the transmit end that this time of receiving is correct. If the CRC check fails, the receive end considers that the data received this time is incorrect, and the receive end feeds back or replies negative acknowledgment (NACK) information to the transmit end, to tell the transmit end that this time of receiving is incorrect, so that the transmit end performs retransmission. After receiving retransmitted information, the receive end continuously performs polar code segment decoding, and check whether retransmitted data is correct. The transmit end may be the terminal device <NUM> or the Bluetooth headset <NUM> shown in the Bluetooth communication system in <FIG>. The receive end may be the terminal device <NUM> or the Bluetooth headset <NUM> shown in the Bluetooth communication system in <FIG>.

<FIG> shows a terminal device <NUM> according to an embodiment of this application. As shown in <FIG>, the terminal device <NUM> may include one or more terminal device processors <NUM>, a memory <NUM>, a communication interface <NUM>, a receiver <NUM>, a transmitter <NUM>, a coupler <NUM>, an antenna <NUM>, a terminal device interface <NUM>, and a Bluetooth module <NUM>. These components may be connected through a bus <NUM> or in another manner. In <FIG>, an example in which the components are connected through the bus is used.

The communication interface <NUM> may be configured to perform communication between the terminal device <NUM> and another communication device, for example, a network device. Specifically, the network device may be the network device <NUM> shown in <FIG>. Specifically, the communication interface <NUM> may be a <NUM> communication interface, or may be a communication interface of future new radio. In addition to a wireless communication interface, a wired communication interface <NUM> may be further configured for the terminal device <NUM>, for example, a local access network (local access network, LAN) interface. The transmitter <NUM> may be configured to transmit a signal output by the terminal device processor <NUM>. The receiver <NUM> may be configured to receive a mobile communication signal received by the antenna <NUM>.

In some embodiments of this application, the transmitter <NUM> and the receiver <NUM> may be considered as a wireless modem. In the terminal device <NUM>, there may be one or more transmitters <NUM> and receivers <NUM>. The antenna <NUM> may be configured to convert electromagnetic energy in a transmission line into an electromagnetic wave in free space, or convert an electromagnetic wave in free space into electromagnetic energy in a transmission line. The coupler <NUM> is configured to divide the mobile communication signal received by the antenna <NUM> into a plurality of channels, and allocate the plurality of channels of signals to the plurality of receivers <NUM>.

In addition to the transmitter <NUM> and the receiver <NUM> shown in <FIG>, the terminal device <NUM> may further include another communication component, for example, a GPS module or a wireless fidelity (wireless fidelity, Wi-Fi) module. In addition to wireless communication, a wired network interface (for example, a LAN interface) may be further configured for the terminal device <NUM>, to support wired communication.

The terminal device <NUM> may further include input/output modules. The input/output modules may be configured to implement interaction between the terminal device <NUM> and a terminal device/an external environment, and may mainly include an audio input/output module, a key input module, a display, and the like. Specifically, the input/output module may further include a camera, a touchscreen, a sensor, and the like. All the input/output modules communicate with the terminal device processor <NUM> through the terminal device interface <NUM>.

The memory <NUM> is coupled to the terminal device processor <NUM>, and is configured to store various software programs and/or a plurality of groups of instructions. Specifically, the memory <NUM> may include a high-speed random access memory, and may also include a nonvolatile memory, for example, one or more magnetic disk storage devices, a flash memory device, or another nonvolatile solid-state storage device. The memory <NUM> may store an operating system (referred to as a system for short below), for example, an embedded operating system such as Android, iOS, Windows, or Linux. The memory <NUM> may further store a network communication program. The network communication program may be used to communicate with one or more additional devices, one or more terminal devices, and one or more network devices.

In some embodiments of this application, the memory <NUM> may be configured to store an implementation program of the polar code segment encoding method provided in one or more embodiments of this application on the terminal device <NUM> side. For implementation of the polar code segment encoding method provided in one or more embodiments of this application, refer to the foregoing embodiments.

The terminal device processor <NUM> may be configured to read computer-readable instructions and execute the computer-readable instructions. Specifically, the terminal device processor <NUM> may be configured to call a program stored in the memory <NUM>, for example, the implementation program of the polar code segment encoding method provided in one or more embodiments of this application on the terminal device <NUM> side, and execute instructions included in the program.

It may be understood that the terminal device <NUM> may be the terminal device <NUM> in the communication system <NUM> shown in <FIG>, and may be implemented as a handheld device, a vehicle-mounted device, a wearable device, a computing device, user equipment in various forms, a mobile station (English: Mobile Station, MS for short), a terminal (terminal), or the like.

It should be noted that the terminal device <NUM> shown in <FIG> is merely an implementation of the embodiments of this application, and in actual application, the terminal device <NUM> may further include more or fewer components. This is not limited herein.

<FIG> shows a schematic diagram of a structure of a polar code segment encoding apparatus according to this application. The polar code segment encoding apparatus <NUM> may also be the terminal device <NUM> or the Bluetooth headset <NUM> in <FIG>. The polar code segment encoding apparatus <NUM> may include a code length determining unit <NUM>, a reservation unit <NUM>, a segment quantity determining unit <NUM>, an information bit length determining unit <NUM>, and an encoding unit <NUM>.

The code length determining unit <NUM> is configured to determine, based on a length of to-be-encoded information bits and a code rate, a code length N after encoding, where N is a positive integer.

The reservation unit <NUM> is configured to determine, based on N , a minimum segment code length, and a maximum segment code length, a reserved segment quantity of each type of segments in segments of b-a+<NUM> types of segment code lengths and a reserved code length corresponding to N, where a value of the minimum segment code length is <NUM>^a, a value of the maximum segment code length is <NUM>^b , the b-a+<NUM> types of segment code lengths of the segments are <NUM>^c, a, b, and c are positive integers, a<b, and a≤c≤b.

The segment quantity determining unit <NUM> is configured to orderly determine a segment quantity of each type of segments based on N, the reserved code length, a segment code length of each type of segments, and the reserved segment quantity of each type of segments and based on the segment code lengths from the largest to the smallest, where a sum of segment quantities of all types of segments is equal to S, N corresponds to S segments, and a segment code length of an ith segment in the S segments is greater than or equal to a segment code length of an (i+<NUM>)th segment in the S segments.

The information bit length determining unit <NUM> is configured to determine a target information bit length of each segment based on the code rate and a segment code length of each segment in the S segments.

The encoding unit <NUM> is configured to perform polar code encoding on the to-be-encoded information bits based on the target information bit length of each segment.

Optionally, the code length determining unit <NUM> is specifically configured to: determine a theoretical code length L based on the length K<NUM> of the to-be-encoded information bits and the code rate R, where a value of the theoretical code length is ceil(K<NUM>/R), and ceil(x) represents rounding up x; and determine N based on the theoretical code length and the minimum segment code length <NUM>^a, where a value of N is ceil(L/<NUM>^a) * <NUM>^a.

Optionally, the reservation unit <NUM> is specifically configured to: determine the segments of the b-a+<NUM> types of segment code lengths based on the minimum segment code length and the maximum segment code length, where the value of the minimum segment code length is <NUM>^a, the value of the maximum segment code length is <NUM>^b, the b-a+<NUM> types of segment code lengths of the segments are <NUM>^c, a, b, and c are positive integers, a<b, and a≤c≤b; orderly determine a reserved segment quantity of an ith type of segments in the b-a+<NUM> types of segments based on the b-a+<NUM> types of segment code lengths of the segments from the smallest to the largest and based on N and the segment code length of each type of segments in the b-a+<NUM> types of segments, where the reserved segment quantity of the ith type of segments is greater than or equal to a reserved segment quantity of an (i+<NUM>)th type of segments in the b-a+<NUM> types of segments; and determine the reserved code length corresponding to N based on the reserved segment quantity of each type of segments and the segment code length of each type of segments.

Optionally, the reservation unit <NUM> is specifically configured to: if N < p*<NUM>^a, determine that a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^a is <MAT>, and a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^j is <NUM>, where a < j ≤ b, and p ≥ <NUM>; if <MAT>, determine that a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^j is <NUM>, a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^c+<NUM> is <MAT>, and a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^v is p, where a≤c≤b-<NUM>, a≤v≤c, and c+<NUM><j≤b; or if <MAT>, determine that the reserved segment quantity of each type of segments is p; and determine the reserved code length Nres based on the reserved segment quantity of each type of segments, where <MAT>, and mc,N represents a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^c.

Optionally, the reservation unit <NUM> is specifically configured to: if N < <NUM>^a, determine that the reserved segment quantity of each type of segments is <NUM>; if <MAT>, determine that a reserved segment quantity of segments whose segment code lengths are <NUM>^j is <NUM>, and a reserved segment quantity of segments whose segment code lengths are <NUM>^v is <NUM>, where a≤c≤b-<NUM>, a≤v≤c, and c<j≤b; or if <MAT>, determine that the reserved segment quantity of each type of segments is <NUM>; and determine the reserved code length Nres based on the reserved segment quantity of each type of segments, where <MAT>, and mc,N represents a reserved segment quantity that corresponds to N and that is of segments whose segment code lengths are <NUM>^c.

Optionally, the segment quantity determining unit <NUM> includes a remaining segment quantity determining unit <NUM> and a segment quantity determining subunit <NUM>.

The remaining segment quantity determining unit <NUM> is configured to orderly determine a remaining segment quantity of each type of segments based on N, the reserved code length, and the segment code length of each type of segments and based on the segment code lengths from the largest to the smallest, where the remaining segment quantity of each type of segments is a remaining segment quantity of each type of segments corresponding to a remaining code length that is obtained by subtracting the reserved code length from N.

The segment quantity determining subunit <NUM> is configured to determine the segment quantity of each type of segments based on the reserved segment quantity of each type of segments and the remaining segment quantity of each type of segments.

Optionally, the remaining segment quantity determining unit <NUM> is specifically configured to: if N < <NUM>^a, determine that a remaining segment quantity zc,N that corresponds to N and that is of the segments whose segment code lengths are <NUM>^c is <NUM>, and a remaining segment quantity za,N that corresponds to N and that is of the segments whose segment code lengths are <NUM>^a is <NUM>, where a<c≤b; or if N≥<NUM>^a, orderly determine the remaining segment quantity of each type of segments based on the segment code lengths from the largest to the smallest, and determine that a remaining segment quantity zb,N that corresponds to N and that is of segments whose segment code lengths are <NUM>^b is <MAT>, and a remaining segment quantity zc,N that corresponds to N and that is of the segments whose segment code lengths are <NUM>^c is <MAT>, where a≤c<b, and floor(x) represents rounding down X.

Optionally, the segment quantity determining subunit <NUM> is specifically configured to: determine a segment quantity Mc,N that corresponds to N and that is of the segments whose segment code lengths are <NUM>^c, where Mc,N = mc,N + zc,N, and a≤c≤b.

Optionally, the information bit length determining unit <NUM> is specifically configured to: determine that a target information bit length of a segment whose segment code length is <NUM>^c in the S segments is ceil(<NUM>^c*R).

Optionally, the information bit length determining unit <NUM> is specifically configured to: if <MAT>, determine that a target information bit length of a segment whose segment code length is <NUM>^c is ceil(<NUM>^c*R), where a≤c≤b; or if <MAT>, determine that a target information bit length of a segment whose segment code length is <NUM>^c is ceil(<NUM>^c * R), target information bit lengths that correspond to N and that are of the first Ma,N-<NUM> segments in Ma,N segments whose segment code lengths are <NUM>^a are ceil(<NUM>^a*R), and a target information bit length of an (Ma,N)th segment in the Ma,N segments is <MAT>, where the (Ma,N)th segment is an Sth segment in the S segments, and a<c≤b.

Optionally, the information bit length determining unit <NUM> includes a reference information bit length determining unit <NUM> and a target information bit length determining unit <NUM>.

The reference information bit length determining unit <NUM> is configured to determine a reference information bit length of each segment.

The target information bit length determining unit <NUM> is configured to determine the target information bit length of each segment based on the reference information bit length of each segment and the segment quantity of each type of segments.

Optionally, the reference information bit length determining unit <NUM> is specifically configured to: if <MAT>, determine that a reference information bit length that corresponds to N and that is of a segment whose segment code length is <NUM>^c is ceil(<NUM>^c * R), where a≤c≤b; or if <MAT>, determine that a reference information bit length that corresponds to N and that is of a segment whose segment code length is <NUM>^c is ceil(<NUM>^c*R), reference information bit lengths of the first Ma,N-<NUM> segments in Ma,N segments are ceil(<NUM>^a*R), and a reference information bit length of an (Ma,N)th segment in the Ma,N segments is <MAT>, where the (Ma,N)th segment is an Sth segment in the S segments, and a<c≤b.

Optionally, the reference information bit length of the segment whose segment code length is <NUM>^c in the S segments is ceil(<NUM>^c*R).

Optionally, the target information bit length determining unit <NUM> is specifically configured to determine the target information bit length of each segment according to an allocation principle. The allocation principle is that on the basis of the reference information bit length of each segment, a first information bit length is added to f segments whose segment code lengths are the largest in the S segments, h segments whose segment code lengths are not the largest in the S segments are reduced by totally the first information bit length, a segment code rate of a (j+<NUM>)th segment in the h segments is less than or equal to a segment code rate of a jth segment in the h segments, a segment code length of the (j+<NUM>)th segment is less than or equal to a segment code length of the jth segment, and a sum of target information bit lengths of the S segments is K<NUM>, where f and h are positive integers, and a segment code rate of a segment=a target information bit length of the segment/a segment code length of the segment.

Optionally, the target information bit length determining unit <NUM> is specifically configured to: determine a target information bit length of a first segment, where the target information bit length of the first segment is equal to a reference information bit length of the first segment plus a second information bit length, and the first segment is a segment whose segment code length is the largest in the S segments; and determine a target information bit length of a second segment, where the target information bit length of the second segment is equal to a reference information bit length of the second segment minus a third information bit length, and the second segment is a segment whose segment code length is not the largest in the S segments. In the S segments, h segments whose segment code lengths are not the largest are reduced by totally f times of the second information bit length, where a segment code rate of a (j+<NUM>)th segment in the h segments is less than or equal to a segment code rate of a jth segment in the h segments, a segment code length of the (j+<NUM>)th segment is less than or equal to a segment code length of the jth segment, a sum of target information bit lengths of the S segments is K<NUM>, f is a segment quantity of segments whose segment code lengths are the largest in the S segments, and h is a positive integer greater than or equal to <NUM>.

Optionally, the target information bit length determining unit <NUM> is specifically configured to: if a segment code length of a segment whose segment code length is the largest in the S segments is <NUM>^a, determine that a target information bit length of the segment whose segment code length is <NUM>^a is equal to a reference information bit length of the segment whose segment code length is <NUM>^a ; or if a segment code length of a segment whose segment code length is the largest in the S segments is <NUM>^r, determine that a target information bit length of the segment whose segment code length is <NUM>^r is a reference information bit length of the segment whose segment code length is <NUM>^r plus <MAT>, and a target information bit length of a segment whose segment code length is <NUM>^c is a reference information bit length of the segment whose segment code length is <NUM>^c minus ∂c*Mr,N, where a≤c<r, ∂c is a proportion parameter, and ∂c is a positive integer.

Optionally, if Mb,N > T, and T is a positive integer, the target information bit length determining unit <NUM> is specifically configured to: determine that target information bit lengths of the first T segments in Mb,N segments whose segment code lengths are <NUM>^b are a reference information bit length of the segment whose segment code length is <NUM>^b plus <MAT>, target information bit lengths of the last Mb,N-T segments in the Mb,N segments are equal to the reference information bit length of the segment whose segment code length is <NUM>^b, and a target information bit length of a segment whose segment code length is <NUM>^c is a reference information bit length of the segment whose segment code length is <NUM>^c minus ∂c*T, where a≤c<b, ∂c is a positive integer, and ∂c+<NUM>>∂c.

Optionally, the encoding unit <NUM> is specifically configured to: orderly allocate the to-be-encoded information bits to the S segments based on the target information bit length of each segment, and perform polar code encoding on information bits of each segment.

Optionally, the encoding unit <NUM> is specifically configured to: if <MAT>, orderly allocate the to-be-encoded information bits to the S segments based on the target information bit length of each segment, and perform polar code encoding on information bits of each segment; or if <MAT>, perform zero-padding on to-be-encoded information bits whose information bit length is K<NUM>, where the information bit length of the to-be-encoded information bits after zero-padding is <MAT>, orderly allocate the to-be-encoded information bits after zero-padding to the S segments based on the target information bit length of each segment, and perform polar code encoding on information bits of each segment.

An embodiment of this application further provides a chip system <NUM>, including one or more processors <NUM> and an interface circuit <NUM>. The processor <NUM> is connected to the interface circuit <NUM>.

The processor <NUM> may be an integrated circuit chip and has a signal processing capability. In an implementation process, steps in the foregoing methods can be implemented by a hardware integrated logical circuit in the processor <NUM>, or by instructions in a form of software. The processor <NUM> may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or another programmable logic device, a discrete gate or a transistor logic device, or a discrete hardware component. The processor <NUM> may implement or perform the methods and steps that are disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor, any conventional processor, or the like.

The interface circuit <NUM> may send or receive data, instructions, or information. The processor <NUM> may process data, instructions, or other information received through the interface circuit <NUM>, and send, through the interface circuit <NUM>, information obtained after processing.

Optionally, the chip system further includes a memory <NUM>. The memory <NUM> may include a read-only memory and a random access memory, and provide operation instructions and data for the processor. A part of the memory <NUM> may further include a non-volatile random access memory (NVRAM).

Optionally, the memory <NUM> stores an executable software module or a data structure, and the processor <NUM> may perform a corresponding operation by invoking an operation instruction stored in the memory (where the operation instruction may be stored in an operating system).

Optionally, the chip system may be used in the terminal device or the Bluetooth headset related to the embodiments of this application.

An embodiment of this application further provides a computer-readable storage medium. The method described in the foregoing method embodiments may be all or partially implemented by using software, hardware, firmware, or any combination thereof. If implemented in software, the function may be stored as one or more instructions or code on the computer-readable medium or transmitted on a computer-readable medium. The computer-readable medium may include a computer storage medium and a communication medium, and may further include any medium capable of transferring a computer program from one place to another. The storage medium may be any available medium accessible to a computer.

In an optional design, the computer-readable medium may include a RAM, a ROM, an EEPROM, a CD-ROM or another optical disc memory, a magnetic disk memory or another magnetic storage device, or any other medium that may be used for carrying or required program code is stored in a form of an instruction or a data structure, and is accessible to a computer. In addition, any connection may be appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, a server, or another remote source by using a coaxial cable, a fiber optical cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies (for example, infrared ray, radio, and microwave), the coaxial cable, the fiber optical cable, the twisted pair, the DSL, or the wireless technologies such as infrared ray, radio and microwave are included in the definition of a medium. Disks and discs as used herein include optical discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, and discs reproduce data optically using lasers. The combination described above should also be included in the scope of the computer-readable medium.

Claim 1:
A polar code segment encoding method, performed by a communication device, the method comprising:
determining (S501), based on a length of to-be-encoded information bits and a code rate, a code length N after encoding, wherein N is a positive integer;
determining (S502), based on N , a minimum segment code length, and a maximum segment code length,
(a) a pre-reserved quantity of segments in each type of segments, wherein each type of segment has a corresponding segment code length, and there are b - a +<NUM> types of segments and corresponding b - a +<NUM> segment code lengths, a value of the minimum segment code length is <NUM>^a, a value of the maximum segment code length is <NUM>^b , the b - a +<NUM> segment code lengths of the segments are <NUM>^c, a, b, and c are positive integers, and
(b) a reserved code length corresponding to N , wherein the reserved code length corresponding to N is determined according to the pre-reserved quantity of segments in each type of segments and the corresponding segment code lengths;
determining (S503), according to the corresponding segment code lengths in order from the largest to the smallest, a total segment quantity of segments in each type of segments based on N, the reserved code length, a segment code length of each type of segment, and the pre-reserved quantity of segments in each type of segments , wherein a sum of the total segment quantities of segments of all types of segments is equal to S, N is divided into the S segments, each one of the S segments corresponds to one of the type of segments, and a segment code length of an ith segment in the S segments is greater than or equal to a segment code length of an (i+<NUM>)th segment in the S segments;
determining (S504) a target information bit length for each segment based on the code rate and a segment code length of each segment in the S segments; orderly allocating the to be-encoded information bits to the S segments based on the target information bit length of each segment and
performing (S505), for each one of the S segments, polar code encoding on the to-be-encoded information bits.