Encoding method, decoding method, and optical module
An encoding method, a decoding method, and an optical module are described relating to data transmission technologies. The method, carried out by an optical module includes obtaining an optical transmission mode used for signal transmission. The method further includes receiving a signal on which outer-code encoding has been performed. The optical module determines, based on the optical transmission mode, an inner-code encoding scheme to be used by the optical module to perform inner-code encoding on the signal on which outer-code encoding has been performed. The method further includes performing, by using the inner-code encoding scheme, inner-code encoding on the signal on which outer-code encoding has been performed. The optical module outputs a signal on which inner-code encoding has been performed. As a result, error correction performance of the Ethernet may be improved.
1 . An encoding method carried out by an optical module comprising at least one processor, the method comprising:
obtaining an optical transmission mode used for signal transmission;
receiving a first signal on which outer-code encoding has been performed;
determining, based on the optical transmission mode, an inner-code encoding scheme to be used by the optical module to perform inner-code encoding on the first signal;
performing, by using the inner-code encoding scheme, inner-code encoding on the first signal to obtain a second signal; and
outputting the second signal,
wherein the optical module comprises:
a selection subassembly, and
a component code encoder; and
wherein the performing the inner-code encoding on the first signal comprises:
selecting, by the selection subassembly, a target candidate signal from a plurality of candidate signals according to the inner-code encoding scheme,
providing the target candidate signal to the component code encoder, and
performing, by the component code encoder based on the target candidate signal, inner-code encoding on the first signal.
2 . The method according to claim 1 , wherein the obtaining the optical transmission mode used for signal transmission comprises:
receiving indication information from a transmitting device, and determining the optical transmission mode based on the indication information.
3 . The method according to claim 2 , wherein the indication information of the transmitting device is obtained through Ethernet auto-negotiation between the transmitting device and a receiving device, or the indication information of the transmitting device is obtained from a network controller.
4 . The method according to claim 1 , wherein the obtaining the optical transmission mode used for the signal transmission comprises:
determining the optical transmission mode based on a write operation performed by the control device on an identifier that indicates the optical transmission mode.
5 . The method according to claim 1 , wherein the optical transmission mode comprises a point-to-point optical transmission mode or a point-to-multipoint optical transmission mode; in the point-to-point optical transmission mode, the second signal is transmitted from a transmitting device to a receiving device by using a single channel; and in the point-to-multipoint optical transmission mode, the second signal is transmitted from the transmitting device to the receiving device in a single channel-to-multichannel manner.
6 . The method according to claim 5 , wherein the determining, based on the optical transmission mode, the inner-code encoding scheme to be used by the optical module to perform the inner-code encoding on the first signal comprises:
querying a correspondence between the optical transmission mode and an encoding scheme based on the optical transmission mode, to obtain the inner-code encoding scheme,
wherein the correspondence comprises: the point-to-point optical transmission mode corresponds to a spatially coupled encoding scheme, and the point-to-multipoint optical transmission mode corresponds to a block algebraic encoding scheme.
7 . The method according to claim 6 , wherein the spatially coupled encoding scheme comprises: encoding by using a zipper code; and
wherein the block algebraic encoding scheme comprises: encoding by using a Hamming code or a BCH code.
8 . An inner-code decoding method carried out by an optical module comprising at least one processor, the method comprising:
obtaining an optical transmission mode used for signal transmission;
receiving a first signal on which inner-code decoding is to be performed;
determining based on the optical transmission mode, an inner-code decoding scheme to be used by the optical module to perform the inner-code decoding on the first signal;
performing, by using the inner-code decoding scheme, the inner-code decoding on the first signal to obtain a second signal; and
outputting the second signal, so as to perform outer-code decoding on the first signal on which the inner-code decoding has been performed,
wherein the optical module comprises:
a selection subassembly, and
a component code decoder; and
wherein the performing the inner-code decoding on the first signal by using the inner-code decoding scheme comprises:
selecting, by the selection subassembly, a target candidate signal from a plurality of candidate signals according to the inner-code decoding scheme,
providing the target candidate signal to the component code decoder; and
performing, by the component code decoder, inner-code decoding on the first signal based on the target candidate signal.
9 . The method according to claim 8 , wherein the obtaining the optical transmission mode used for signal transmission comprises:
receiving indication information from a receiving device, and
determining the optical transmission mode based on the indication information.
10 . The method according to claim 9 , wherein the indication information of the receiving device is obtained through Ethernet auto-negotiation between the receiving device and a transmitting device, or the indication information of the receiving device is obtained from a network controller.
11 . The method according to claim 8 , wherein the obtaining the optical transmission mode used for the signal transmission comprises:
determining the optical transmission mode based on a write operation performed by the control device on an identifier that indicates the optical transmission mode.
12 . The method according to claim 8 , wherein the optical transmission mode comprises a point-to-point optical transmission mode or a point-to-multipoint optical transmission mode; in the point-to-point optical transmission mode, the signal is transmitted from the transmitting device to the receiving device by using a single channel; and in the point-to-multipoint optical transmission mode, the signal is transmitted from the transmitting device to the receiving device in a single channel-to-multichannel manner.
13 . An optical module comprising one or more processors configured to cause the optical module to carry out operations of:
receiving a first signal on which outer-code encoding has been performed;
obtaining an optical transmission mode used for signal transmission;
determining, based on the optical transmission mode, an inner-code encoding scheme to be used by the optical module to perform inner-code encoding on the first signal;
performing, by using the inner-code encoding scheme, inner-code encoding on the first signal to obtain a second signal; and
outputting the second signal,
wherein the optical module comprises:
a selection subassembly, and
a component code encoder; and
wherein the performing the inner-code encoding on the first signal comprises:
selecting, by the selection subassembly, a target candidate signal from a plurality of candidate signals according to the inner-code encoding scheme,
providing the target candidate signal to the component code encoder, and
performing, by the component code encoder based on the target candidate signal, inner-code encoding on the first signal.
14 . The optical module according to claim 13 , wherein wherein the obtaining the optical transmission mode used for the signal transmission comprises:
receiving indication information from a transmitting device, and
determining the optical transmission mode based on the indication information.
15 . The optical module according to claim 14 , wherein the indication information of the transmitting device is obtained through Ethernet auto-negotiation the transmitting device and a receiving device, or the indication information of the transmitting device is obtained from a network controller.
16 . The optical module according to claim 13 , wherein the obtaining the optical transmission mode used for the signal transmission comprises:
determining the optical transmission mode based on a write operation performed by the control device on an identifier that indicates the optical transmission mode.
17 . An optical module comprising one or more processors configured to cause the optical module to carry out the operations of:
receiving a first signal on which inner-code decoding is to be performed;
obtaining an optical transmission mode used for signal transmission;
determining, based on the optical transmission mode, an inner-code decoding scheme to be used by the optical module to perform inner-code decoding on the first signal;
performing, by using the inner-code decoding scheme, the inner-code decoding on the first signal to obtain a second signal; and
outputting the second signal, so as to perform outer-code decoding on the first signal on which the inner-code decoding has been performed,
wherein the optical module comprises:
a selection subassembly, and
a component code decoder; and
wherein the performing the inner-code decoding on the first signal by using the inner-code decoding scheme comprises:
selecting, by the selection subassembly, a target candidate signal from a plurality of candidate signals according to the inner-code decoding scheme,
providing the target candidate signal to the component code decoder; and
performing, by the component code decoder, inner-code decoding on the first signal based on the target candidate signal.
18 . The optical module according to claim 17 , wherein the one or more processors is configured to cause the optical module to:
receive indication information from a receiving device, and determine the optical transmission mode based on the indication information.
19 . The optical module according to claim 18 , wherein the indication information of the receiving device is obtained through Ethernet auto-negotiation between the receiving device and a transmitting device, or the indication information of the receiving device is obtained from a network controller.
20 . The optical module according to claim 17 , wherein the obtaining the optical transmission mode used for the signal transmission comprises:
determining the optical transmission mode based on a write operation performed by the control device on an identifier that indicates the optical transmission mode.