A data transmission method, comprising: determining synchronization header indication information that is used to indicate a frame header location of a first code stream, wherein the first code stream is obtained by encoding service data; decoding the first code stream to obtain a second code stream, inserting frame header indication information that is used to indicate a frame header location of the second code stream into the second code stream according to the synchronization header indication information; and mapping the second code stream and the frame header indication information into an optical channel payload unit, OPU, in an optical channel data unit, ODU, frame characterized in that the service data is common public radio interface, CPRI, service data and the first code stream is a 66B code stream, and the second code stream is a 64B code stream wherein the method further comprises, before the decoding the first code stream, periodically marking the synchronization header indication information at the frame header location of the first code stream by: identifying a second code block with a character /S/ in the first code stream; and marking a location of the second code block as second synchronization header indication information; and the inserting frame header indication information that is used to indicate a frame header location of the second code stream into the second code stream according to the synchronization header indication information comprises: inserting the frame header indication information into the second code stream before the second synchronization header indication information according to the second synchronization header indication information in the first code stream. determining synchronization header indication information that is used to indicate a frame header location of a first code stream, wherein the first code stream is obtained by encoding service data; decoding the first code stream to obtain a second code stream, inserting frame header indication information that is used to indicate a frame header location of the second code stream into the second code stream according to the synchronization header indication information; and mapping the second code stream and the frame header indication information into an optical channel payload unit, OPU, in an optical channel data unit, ODU, frame characterized in that the service data is common public radio interface, CPRI, service data and the first code stream is a 66B code stream, and the second code stream is a 64B code stream wherein the method further comprises, before the decoding the first code stream, periodically marking the synchronization header indication information at the frame header location of the first code stream by: identifying a second code block with a character /S/ in the first code stream; and marking a location of the second code block as second synchronization header indication information; and the inserting frame header indication information that is used to indicate a frame header location of the second code stream into the second code stream according to the synchronization header indication information comprises: inserting the frame header indication information into the second code stream before the second synchronization header indication information according to the second synchronization header indication information in the first code stream. identifying a second code block with a character /S/ in the first code stream; and marking a location of the second code block as second synchronization header indication information; and the inserting frame header indication information that is used to indicate a frame header location of the second code stream into the second code stream according to the synchronization header indication information comprises: inserting the frame header indication information into the second code stream before the second synchronization header indication information according to the second synchronization header indication information in the first code stream.