A data transmission method, comprising: obtaining Q first code block streams, wherein Q is an integer greater than 1, a coding type of the first code block stream is M1/N1 bit coding, M1 is a positive integer, N1 is an integer not less than M1, and each code block in the first code block stream comprises a synchronization header area of (N1-M1) bits and a non-synchronization header area of M1 bits; and placing non-synchronization header areas of code blocks in the Q first code block streams into a to-be-sent second code block stream, wherein a coding type of the second code block stream is M1/N1 bit coding, each code block in the second code block stream comprises a synchronization header area of (N1-M1) bits and a non-synchronization header area of M1 bits, and a non-synchronization header area of a code block in the Q first code block streams is carried in a non-synchronization header area of a code block in the second code block stream; wherein the second code block stream comprises at least one data unit; one data unit in the at least one data unit comprises a head code block and at least one data code block; or one data unit in the at least one data unit comprises a head code block, at least one data code block, and a tail code block; or one data unit in the at least one data unit comprises at least one data code block and a tail code block; the at least one data code block comprises at least one first-type data code block, or the at least one data code block comprises at least one first-type data code block and at least one second-type data code block; a non-synchronization header area of a code block in the Q first code block streams is carried in a non-synchronization header area of a first-type data code block in the second code block stream; and type indication information corresponding to a code block in the Q first code block streams is carried in a non-synchronization header area of any one of the head code block, the second-type data code block, and the tail code block in the second code block stream; and type indication information corresponding to a code block is used to indicate information carried in a synchronization header area of the code block. obtaining Q first code block streams, wherein Q is an integer greater than 1, a coding type of the first code block stream is M1/N1 bit coding, M1 is a positive integer, N1 is an integer not less than M1, and each code block in the first code block stream comprises a synchronization header area of (N1-M1) bits and a non-synchronization header area of M1 bits; and placing non-synchronization header areas of code blocks in the Q first code block streams into a to-be-sent second code block stream, wherein a coding type of the second code block stream is M1/N1 bit coding, each code block in the second code block stream comprises a synchronization header area of (N1-M1) bits and a non-synchronization header area of M1 bits, and a non-synchronization header area of a code block in the Q first code block streams is carried in a non-synchronization header area of a code block in the second code block stream; wherein the second code block stream comprises at least one data unit; one data unit in the at least one data unit comprises a head code block and at least one data code block; or one data unit in the at least one data unit comprises a head code block, at least one data code block, and a tail code block; or one data unit in the at least one data unit comprises at least one data code block and a tail code block; the at least one data code block comprises at least one first-type data code block, or the at least one data code block comprises at least one first-type data code block and at least one second-type data code block; a non-synchronization header area of a code block in the Q first code block streams is carried in a non-synchronization header area of a first-type data code block in the second code block stream; and type indication information corresponding to a code block in the Q first code block streams is carried in a non-synchronization header area of any one of the head code block, the second-type data code block, and the tail code block in the second code block stream; and type indication information corresponding to a code block is used to indicate information carried in a synchronization header area of the code block.