A polar code segment encoding method, performed by a communication device, the method comprising: determining, 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, 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 + 1 types of segments and corresponding b - a +1 segment code lengths, a value of the minimum segment code length is 2^ a, a value of the maximum segment code length is 2 ^ b, the b - a + 1 segment code lengths of the segments are 2 ^ 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, 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 i th segment in the S segments is greater than or equal to a segment code length of an (i+1) th segment in the S segments; determining 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, for each one of the S segments, polar code encoding on the to-be-encoded information bits. determining, 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, 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 + 1 types of segments and corresponding b - a +1 segment code lengths, a value of the minimum segment code length is 2^ a, a value of the maximum segment code length is 2 ^ b, the b - a + 1 segment code lengths of the segments are 2 ^ 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; (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 + 1 types of segments and corresponding b - a +1 segment code lengths, a value of the minimum segment code length is 2^ a, a value of the maximum segment code length is 2 ^ b, the b - a + 1 segment code lengths of the segments are 2 ^ 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, 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 i th segment in the S segments is greater than or equal to a segment code length of an (i+1) th segment in the S segments; determining 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, for each one of the S segments, polar code encoding on the to-be-encoded information bits.