Patent Description:
This application relates to the field of data processing, and in particular, to a data processing method and apparatus.

In a communications technology, data may be transferred between interfaces. Specifically, the interface may be, for example, a serializer/deserializer (serializer/deserializer, SerDes)-based interface.

To improve SerDes performance and to further improve data transmission performance, a training frame (training frame) may be transferred between interfaces, and the interfaces may further adjust a related parameter of a SerDes based on the training frame.

However, currently, an effect of optimizing SerDes performance by transferring a training frame between interfaces is not good. <CIT> describes methods for detecting and decoding adaptive equalization training frames (having a frame marker comprised of a string of binary ones and binary zeroes). Training frames are detected by shifting the received data; inserting at least one binary value at one end of the shifted received data to generate a modified version of the received data; applying a logic function to the received data and the modified version of the received data that identifies when corresponding bit positions have different values; and detecting the frame marker when an output of the logic function has a first binary value in an approximate middle of a string of a second binary value. The training frames are decoded using a distance between the approximate center of the frame maker and a predefined binary value in an output of the logic function.

Embodiments of this application provide a data processing method and apparatus, to improve an effect of optimizing SerDes performance by transferring a training frame between interfaces.

According to a first aspect, an embodiment of this application provides a data processing method, and the method may be performed by, for example, a first interface. The method includes: The first interface obtains a first encoding sequence. The first encoding sequence may include a plurality of sign bits, and the first encoding sequence may be sent by a second interface to the first interface. After obtaining the first encoding sequence, the first interface may parse the first encoding sequence. A signal transferred between interfaces may be a voltage signal, and information is exchanged by using a specific value of the voltage signal, namely, a voltage value. The first encoding sequence may be an encoding sequence obtained after a voltage signal sent by the second interface is encoded. When a voltage value sent by the second interface to the first interface jumps, a bit error is likely to occur in an encoded value received by the first interface, and the bit error is tolerable. Therefore, in this embodiment of this application, the first interface can also correctly parse the first encoding sequence when a tolerable bit error occurs in the first encoding sequence. For a target sign bit in the first encoding sequence, if a value of the target sign bit is different from a preset value of the target sign bit, the first encoding sequence is parsed based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit. The target sign bit is one or more sign bits in which a bit error is likely to occur. It can be learned that, according to the solution in this embodiment of this application, for the target sign bit in which a bit error is likely to occur, if a bit error occurs in the target sign bit, in other words, the value of the target sign bit is different from the preset value of the target sign bit, the first interface can also correctly parse the first encoding sequence. This improves efficiency of obtaining a training frame through parsing by the first interface, and correspondingly improves an effect of optimizing SerDes performance by transferring a training frame between interfaces.

In a possible implementation, parsing the first encoding sequence in this embodiment of this application may mean identifying whether the first encoding sequence is a frame marker encoding sequence of the training frame.

In a possible implementation, both a control field encoding sequence and a status field encoding sequence of the training frame use <NUM>*i sign bits to indicate logical bit information. Therefore, parsing the first encoding sequence in this embodiment of this application may be: When the first encoding sequence includes the status field encoding sequence or the control field encoding sequence, the first interface encodes the first encoding sequence to obtain a second encoding sequence.

In a possible implementation, IEEE Std <NUM>™-<NUM> Clause <NUM> specifies that the training frame is encoded through NRZ code, and IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM> specifies that the training frame is encoded by through PAM4. Therefore, the first encoding sequence may be an NRZ encoding sequence, that is, an encoding sequence that is encoded through NRZ encoding, or may be a PAM4 encoding sequence, that is, an encoding sequence that is encoded through PAM4.

In a possible implementation, in the frame marker encoding sequence of the training frame specified in IEEE Std <NUM>™-<NUM> Clause <NUM> and IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM>, voltage values corresponding to the first <NUM> sign bits are the same, voltage values corresponding to the last <NUM> sign bits are the same, and the voltage values corresponding to the first <NUM> sign bits are different from the voltage values corresponding to the last <NUM> sign bits. In this case, a bit error is likely to occur in the <NUM>th sign bit and the <NUM>th sign bit that are received by the first interface. In addition, the inventor finds, through research, that a bit error is also likely to occur in a sign bit that is close to the <NUM>th sign bit, for example, the <NUM>th sign bit and the <NUM>th sign bit. Correspondingly, a bit error is also likely to occur in a sign bit that is close to the <NUM>th sign bit, for example, the <NUM>th sign bit and the <NUM>th sign bit. Therefore, if the first encoding sequence obtained by the first interface is similar to the frame marker encoding sequence of the training frame, the target sign bit may include m+n sign bits, where both m and n are integers greater than or equal to <NUM>. Specifically, when m+n is equal to <NUM>, the target sign bit includes one sign bit. In this case, the target sign bit may include a first sign bit or a second sign bit, the first sign bit is adjacent to the second sign bit, and a preset value of the first sign bit is different from a preset value of the second sign bit. The first sign bit herein may be, for example, the <NUM>th sign bit above, and the second sign bit herein may be, for example, the <NUM>th sign bit above. When m+n is greater than <NUM>, the target sign bit may include m+n consecutive sign bits, preset values of the first m sign bits in the m+n consecutive sign bits are the same, preset values of the last n sign bits in the m+n consecutive sign bits are the same, and the preset values of the first m sign bits are different from the preset values of the last n sign bits. In other words, the last sign bit in the first m consecutive sign bits may be the first sign bit, and the <NUM>st sign bit in the last n consecutive sign bits may be the second sign bit. In addition, the control field encoding sequence follows the frame marker encoding sequence of the training frame, and a value of the <NUM>st sign bit in the control field encoding sequence may also be different from a value of the last sign bit in the frame marker encoding sequence. Therefore, a bit error is also likely to occur in the last sign bit in the frame marker encoding sequence. The inventor finds, through research, that a bit error is also likely to occur in a sign bit that is close to the last sign bit in the frame marker encoding sequence, for example, the second-to-last sign bit and the third-to-last sign bit in the frame marker encoding sequence. In view of this, if the first encoding sequence is similar to the frame marker encoding sequence of the training frame, the target sign bit may include the last k sign bits in the first encoding sequence, where k is an integer greater than or equal to <NUM>.

In a possible implementation, when the voltage value sent by the second interface jumps, sign bits in which a bit error occurs in the encoded value received by the first interface are symmetric. In other words, a quantity of sign bits in which a bit error is likely to occur before a level jump is the same as a quantity of sign bits in which a bit error is likely to occur after the level jump. Therefore, m and n may be the same.

In a possible implementation, both the control field encoding sequence and the status field encoding sequence of the training frame specified in IEEE Std <NUM>™-<NUM> Clause <NUM> and IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM> use eight sign bits to indicate logical bit information. If values of the first four sign bits are the same as values of the last four sign bits, a value of the logical bit information indicated by the eight sign bits is <NUM>; or if values of the first four sign bits are different from values of the last four sign bits, a value of the logical bit information indicated by the eight sign bits is <NUM>. The <NUM>*i sign bits indicating the logical bit information are referred to as a first encoding sub-sequence. If the first encoding sub-sequence is the control field encoding sequence or the status field encoding sequence of the training frame, a value of i may be equal to <NUM>. A value of the logical bit information indicated by the first encoding sub-sequence may be <NUM> or <NUM>. Therefore, a voltage value corresponding to the ith sign bit may be different from a voltage value corresponding to the (i+<NUM>)th sign bit in the first encoding sub-sequence. In this case, a bit error may occur in both the ith sign bit and the (i+<NUM>)th sign bit in the first encoding sub-sequence. In addition, the control field encoding sequence of the training frame may include one or more first encoding sub-sequences, and values of logical bits indicated by two adjacent first encoding sub-sequences may be the same or may be different. In other words, a value of the last sign bit in a current first encoding sub-sequence may be different from a value of the <NUM>st sign bit in a next first encoding sub-sequence. In this case, a bit error may occur in both the <NUM>st sign bit and the last sign bit, namely, the (<NUM>*i)th sign bit, in the first encoding sub-sequence. Therefore, the target sign bit may include any one or more of the <NUM>st sign bit in the first encoding sub-sequence, the ith sign bit in the first encoding sub-sequence, the (i+<NUM>)th sign bit in the first encoding sub-sequence, and the (<NUM>*i)th sign bit in the first encoding sub-sequence.

In a possible implementation, a specific value of each sign bit in the first encoding sub-sequence is not specified in IEEE Std <NUM>™-<NUM> Clause <NUM> and IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM>, but the value of each sign bit in the first encoding sub-sequence needs to comply with a rule that values of the first i sign bits are the same and values of the last i sign bits are the same. The first interface may determine a preset value of the <NUM>st sign bit and a preset value of the ith sign bit based on a preset value of a sign bit between the <NUM>st sign bit and the ith sign bit. In an embodiment, an actual value of the sign bit between the <NUM>st sign bit and the ith sign bit may be determined as the preset value of the sign bit between the <NUM>st sign bit and the ith sign bit. Correspondingly, a preset value of the (i+<NUM>)th sign bit and a preset value of the (<NUM>*i)th sign bit are determined based on a preset value of a sign bit between the (i+<NUM>)th sign bit and the (<NUM>*i)th sign bit. After the preset value of the target sign bit is determined, when the value of the target sign bit is different from the preset value, parsing is performed based on the fact that the value of the target sign bit is equal to the preset value.

In a possible implementation, if the first encoding sequence is a PAM4 encoding sequence, a value of each sign bit in the status field encoding sequence and the control field encoding sequence of the training frame may be only <NUM> or <NUM>. In addition, if the first encoding sequence is the status field encoding sequence or the control field encoding sequence, it indicates that the first interface has successfully received the frame marker encoding sequence of the training frame from the second interface. In this case, to further improve an effect of optimizing SerDes performance by transferring the training frame between the first interface and the second interface, for the control field encoding sequence and the status field encoding sequence of the training frame, error tolerance may be further relaxed. Specifically, the target sign bit may further include a first sign bit sequence and a second sign bit sequence. The first sign bit sequence includes the <NUM>nd sign bit to the (i-<NUM>)th sign bit in the first encoding sub-sequence, and the second sign bit sequence includes the (i+<NUM>)th sign bit to the (<NUM>*i-<NUM>)th sign bit in the first encoding sub-sequence. Herein, a value of i is an integer greater than or equal to <NUM>. For example, the value of i may be <NUM>.

In a possible implementation, it is considered that the preset value of the <NUM>st sign bit and the preset value of the ith sign bit are determined based on a value of each sign bit in the first sign bit sequence, and the preset value of the (i+<NUM>)th sign bit and the preset value of the (<NUM>*i)th sign bit are determined based on a value of each sign bit in the second sign bit sequence. If a bit error occurs in a sign bit in the first sign bit sequence, an actual value of the sign bit in the first sign bit sequence cannot be determined as a preset value of the sign bit in the first sign bit sequence, and consequently the preset value of the <NUM>st sign bit and the preset value of the ith sign bit cannot be determined. Correspondingly, if a bit error occurs in a sign bit in the second sign bit sequence, the preset value of the (i+<NUM>)th sign bit and the preset value of the (<NUM>*i)th sign bit cannot be determined. To resolve this problem, a preset value of each sign bit in the first sign bit sequence may be determined based on the value of each sign bit in the first sign bit sequence. For PAM4 encoding sequence, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable; an encoded value obtained after the bit error is slightly likely to be <NUM> or <NUM>, and this bit error is intolerable. Similarly, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable; an encoded value obtained after the bit error is slightly likely to be <NUM> or <NUM>, and this bit error is intolerable. Therefore, when the value of each sign bit in the first sign bit sequence is <NUM> or <NUM>, the preset value of each sign bit in the first sign bit sequence is determined as <NUM>. When the value of each sign bit in the first sign bit sequence is <NUM> or <NUM>, the preset value of each sign bit in the first sign bit sequence is determined as <NUM>. A preset value of each sign bit in the second sign bit sequence is also determined in this way.

In a possible implementation, for the frame marker encoding sequence, a bit error is also very likely to occur in the first several sign bits in the frame marker encoding sequence. However, if an error tolerance degree of the frame marker encoding sequence is too high, a non-frame marker encoding sequence may be identified as the frame marker encoding sequence. For a PAM4 encoding sequence, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable. Therefore, when the first encoding sequence is a PAM4 encoding sequence, and the first encoding sequence is similar to the frame marker encoding sequence of the training frame, the target sign bit may include the first p sign bits in the first encoding sequence, where p is greater than or equal to <NUM> and less than or equal to a first threshold.

In a possible implementation, for a PAM4 encoding sequence, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable. Similarly, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable. Therefore, if the first encoding sequence is a PAM4 encoding sequence, during specific implementation of "parsing, if a value of a target sign bit is different from a preset value in the first encoding sequence, the first encoding sequence based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit", for example, a difference between the value of the target sign bit and the preset value of the target sign bit may be determined. If the difference is equal to <NUM>, the first encoding sequence is parsed based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit. Otherwise, it may be considered that the parsing fails, and the first encoding sequence is discarded.

According to a second aspect, an embodiment of this application provides a data processing apparatus. The apparatus includes an obtaining unit and a parsing unit. The obtaining unit is configured to obtain a first encoding sequence. The parsing unit is configured to parse, if a value of a target sign bit is different from a preset value of the target sign bit in the first encoding sequence, the first encoding sequence based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit.

In a possible implementation, the parsing unit is specifically configured to: if the value of the target sign bit is different from the preset value of the target sign bit in the first encoding sequence, determine the first encoding sequence as a frame marker encoding sequence of a training frame.

In a possible implementation, the parsing unit is specifically configured to: if the value of the target sign bit is different from the preset value of the target sign bit in the first encoding sequence, encode the first encoding sequence to obtain a second encoding sequence.

In a possible implementation, the first encoding sequence includes a control field encoding sequence of a training frame and/or a status field encoding sequence of the training frame.

In a possible implementation, the first encoding sequence is a non-return-to-zero encoding sequence or a four-level pulse amplitude modulation encoding sequence.

In a possible implementation, the target sign bit includes m+n sign bits in the first encoding sequence and/or the last k sign bits in the first encoding sequence, where m is greater than or equal to <NUM>, n is greater than or equal to <NUM>, and k is greater than or equal to <NUM> and less than or equal to a second threshold. When m+n is equal to <NUM>, the target sign bit includes a first sign bit or a second sign bit, a preset value of the first sign bit is different from a preset value of the second sign bit, and the first sign bit is adjacent to the second sign bit. When m+n is greater than <NUM>, the m+n sign bits are consecutive, preset values of the first m sign bits in the m+n sign bits are the same, preset values of the last n sign bits in the m+n sign bits are the same, and the preset values of the first m sign bits are different from the preset values of the last n sign bits.

In a possible implementation, m is equal to n.

In a possible implementation, the first encoding sequence includes a first encoding sub-sequence, the first encoding sub-sequence includes <NUM>*i sign bits, the first encoding sub-sequence is used to indicate logical bit information, and the target sign bit includes any one or more of the following sign bits: the <NUM>st sign bit in the first encoding sub-sequence, the ith sign bit in the first encoding sub-sequence, the (i+<NUM>)th sign bit in the first encoding sub-sequence, and the (<NUM>*i)th sign bit in the first encoding sub-sequence.

In a possible implementation, i is greater than or equal to <NUM>, a preset value of the <NUM>st sign bit and a preset value of the ith sign bit are determined based on a preset value of a sign bit between the <NUM>st sign bit and the ith sign bit, and a preset value of the (i+<NUM>)th sign bit and a preset value of the (<NUM>*i)th sign bit are determined based on a preset value of a sign bit between the (i+<NUM>)th sign bit and the (<NUM>*i)th sign bit.

In a possible implementation, if the first encoding sequence is a four-level pulse amplitude modulation encoding sequence, the target sign bit further includes a first sign bit sequence or a second sign bit sequence. The first sign bit sequence includes the <NUM>nd sign bit to the (i-<NUM>)th sign bit in the first encoding sub-sequence, and the second sign bit sequence includes the (i+<NUM>)th sign bit to the (<NUM>*i-<NUM>)th sign bit in the first encoding sub-sequence.

In a possible implementation, a preset value of each sign bit in the first sign bit sequence is determined in the following manner: if a value of each sign bit in the first sign bit sequence is <NUM> or <NUM>, determining that the preset value of each sign bit in the first sign bit sequence is <NUM>; or if a value of each sign bit in the first sign bit sequence is <NUM> or <NUM>, determining that the preset value of each sign bit in the first sign bit sequence is <NUM>. A preset value of each sign bit in the second sign bit sequence is determined in the following manner: if a value of each sign bit in the second sign bit sequence is <NUM> or <NUM>, determining that the preset value of each sign bit in the second sign bit sequence is <NUM>; or if a value of each sign bit in the second sign bit sequence is <NUM> or <NUM>, determining that the preset value of each sign bit in the second sign bit sequence is <NUM>.

In a possible implementation, when the first encoding sequence is a four-level pulse amplitude modulation encoding sequence, the target sign bit includes the first p sign bits in the first encoding sequence, where p is greater than or equal to <NUM> and less than or equal to a first threshold.

In a possible implementation, when the first encoding sequence is a four-level pulse amplitude modulation encoding sequence, the parsing unit is specifically configured to: if a difference between the value of the target sign bit and the preset value of the target sign bit is equal to <NUM>, parse the first encoding sequence based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit.

According to a third aspect, an embodiment of this application provides a data processing device. The data processing device includes a processor and a memory. The memory is configured to store instructions or a computer program. The processor is configured to execute the instructions or the computer program in the memory to perform the method according to any implementation of the first aspect.

According to a fourth aspect, an embodiment of this application provides a computer-readable storage medium, including instructions or a computer program. When the computer-readable storage medium runs on a computer, the computer is enabled to perform the method according to any implementation of the first aspect.

According to a fifth aspect, an embodiment of this application provides a computer program product including instructions or a computer program. When the computer program product runs on a computer, the computer is enabled to perform the method according to any implementation of the first aspect.

To describe the technical solutions in embodiments of this application or in the conventional technology more clearly, the following briefly describes the accompanying drawings required in embodiments or the conventional technology. It is clear that the accompanying drawings in the following descriptions show some embodiments of this application, and persons of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.

Embodiments of this application provide a data processing method and apparatus, to resolve a problem that an effect of optimizing SerDes performance by transferring a training frame between interfaces is not good in the conventional technology.

For ease of understanding, an application scenario of embodiments of this application is first briefly described.

<FIG> is a schematic diagram of an example application scenario according to an embodiment of this application.

In the scenario shown in <FIG>, data may be transferred between an interface <NUM> and an interface <NUM>. As shown in <FIG>, the interface <NUM> includes a training module <NUM> and a SerDes <NUM>. The SerDes <NUM> includes a transmitter (transmitter) 112a and a receiver (receiver) 112b. The interface <NUM> includes a training module <NUM> and a SerDes <NUM>. The SerDes <NUM> includes a transmitter 122b and a receiver 122a. When the interface <NUM> transfers data to the interface <NUM>, the interface <NUM> may send the data to the interface <NUM> by using the transmitter 112a of the interface <NUM>, and the interface <NUM> receives the data from the interface <NUM> by using the receiver 122a. Similarly, when the interface <NUM> transfers data to the interface <NUM>, the interface <NUM> may send the data to the interface <NUM> by using the transmitter 122b, and the interface <NUM> receives the data from the interface <NUM> by using the receiver 112b.

To improve performance of data transmission between the interface <NUM> and the interface <NUM>, the interface <NUM> and the interface <NUM> may adjust a related parameter of a SerDes by transferring a training frame. For example, the interface <NUM> may send a first training frame to the interface <NUM>, the interface <NUM> feeds back a second training frame to the interface <NUM> based on the first training frame received from the interface <NUM>, and the training module <NUM> of the interface <NUM> may parse the second training frame, and adjust a related parameter of the SerDes <NUM> based on a parsing result, for example, adjust an equalizer coefficient (equalizer coefficient) of the transmitter of the interface <NUM>. Similarly, the training module of the interface <NUM> may also be configured to adjust a related parameter of the SerDes <NUM>.

It should be noted that both the interface <NUM> and the interface <NUM> may be Ethernet interfaces, and the interface <NUM> and the interface <NUM> each may include at least a media access control (media access control, MAC) layer, a physical coding sublayer (physical coding sublayer, PCS), a physical medium attachment (physical medium attachment, PMA) sublayer (sublayer), and a physical medium dependent (Physical Medium Dependent, PMD) sublayer. The SerDes in this embodiment of this application, for example, the SerDes <NUM> and the SerDes <NUM> shown in <FIG>, is located at the PMD sublayer. A transmission medium between the interface <NUM> and the interface <NUM> may be a cable or a copper cable.

Currently, the Institute of Electrical and Electronics Engineers (Institute of Electrical and Electronics Engineers, IEEE) specifies a frame structure and an encoding scheme of a training frame. Both IEEE Std <NUM>™-<NUM> Clause <NUM> and IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM> specify that the training frame includes a frame marker (frame marker), a control field (control field), a status field (status field), and a training sequence (one or more training patterns).

Specifically, IEEE Std <NUM>™-<NUM> Clause <NUM> specifies the following:.

IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM> specifies the following:.

When a training frame is transferred between interfaces, a bit error may inevitably occur. For example, an encoding sequence sent by the interface <NUM> is "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", in other words, the encoding sequence sent by the interface <NUM> is a frame marker encoding sequence, but an encoding sequence received by the interface <NUM> is "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", in other words, a bit error occurs in the encoding sequence received by the interface <NUM>. In this case, the interface <NUM> does not identify the received encoding sequence as the frame marker (frame marker) encoding sequence. The interface <NUM> does not identify an encoding sequence after the encoding sequence "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>" as the control field (control field) encoding sequence either. Consequently, the interface <NUM> cannot obtain the complete first training frame through correct parsing. Correspondingly, the interface <NUM> cannot return the second training frame to the interface <NUM> either. Consequently, the interface <NUM> cannot adjust the equalizer coefficient of the transmitter based on the second training frame, and the interface <NUM> cannot optimize SerDes performance in time. Similarly, if a bit error occurs in the control field and the status field of the training frame, the foregoing problem is also caused. Consequently, a training frame encoding sequence needs to be repeatedly transferred between the interface <NUM> and the interface <NUM>, and it is difficult to achieve an objective of optimizing SerDes performance.

The interface <NUM> and the interface <NUM> herein may be interfaces that support the IEEE <NUM> and IEEE <NUM>. 3cd standards. The interface <NUM> may be a 10GBASE-KR interface, a 40GBASE-KR4 interface, a 40GBASE-CR4 interface, a 25GBASE-KR interface, a 25GBASE-CR interface, a 50GBASE-KR2 interface, a 50GBASE-CR2 interface, a 100GBASE-KR4 interface, a 100GBASE-CR4 interface, a 50GBASE-CR interface, a 100GBASE-CR2 interface, a 200GBASE-CR4 interface, or the like. Correspondingly, the interface <NUM> also may be a 10GBASE-KR interface, a 40GBASE-KR4 interface, a 40GBASE-CR4 interface, a 25GBASE-KR interface, a 25GBASE-CR interface, a 50GBASE-KR2 interface, a 50GBASE-CR2 interface, a 100GBASE-KR4 interface, a 100GBASE-CR4 interface, a 50GBASE-CR interface, a 100GBASE-CR2 interface, a 200GBASE-CR4 interface, or the like.

Embodiments of this application provide a data processing method, so that an interface that receives a training frame can still correctly parse the training frame when a few bit errors occur in the training frame. With reference to the accompanying drawings, the following describes the data processing method provided in embodiments of this application.

<FIG> is a schematic flowchart of a data processing method according to an embodiment of this application. For example, the data processing method shown in <FIG> may be implemented by performing S101 and S102. An example in which the method shown in <FIG> is performed by a first interface is used for description.

In this embodiment of this application, the first encoding sequence may be from a second interface. Specifically, the first encoding sequence may be obtained by encoding a voltage signal sent by the second interface. The first interface and the second interface may be located on different devices. In some embodiments, the device may be a network device, a server, a storage device, or the like. The network device may be a switch or a router.

The first encoding sequence is not specifically limited in this embodiment of this application. Corresponding to the application scenario shown in <FIG>, the first encoding sequence may be one or more of a frame marker encoding sequence of a training frame, a control field encoding sequence of the training frame, and a status field encoding sequence of the training frame.

The first encoding sequence may include a plurality of sign bits, and one sign bit may include one or more bits. Specifically, a quantity of bits included in one sign bit is determined based on an encoding scheme of the first encoding sequence. For example, IEEE Std <NUM>™-<NUM> Clause <NUM> specifies that the training frame is encoded by using NRZ code. Because the NRZ code has only two values: <NUM> and <NUM>, if the first encoding sequence is an NRZ encoding sequence, one sign bit may include one bit, and a value of the one bit may be <NUM> or <NUM>. IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM> specifies that the training frame is encoded through PAM4. Because PAM4 code has four values: <NUM>, <NUM>, <NUM>, and <NUM>, if the first encoding sequence is a PAM4 encoding sequence, one sign bit may include two bits, and values of the two bits may be <NUM>, <NUM>, <NUM>, and <NUM>. In this embodiment of this application, the first encoding sequence may be an NRZ encoding sequence, that is, an encoding sequence that is encoded through NRZ encoding, or may be a PAM4 encoding sequence, that is, an encoding sequence that is encoded through PAM4. The encoding scheme of the first encoding sequence may be determined by the first interface and the second interface through auto negotiation (auto negotiation, AN). After the auto negotiation, the second interface may send the first encoding sequence to the first interface based on a negotiation result.

S102: Parse, if a value of a target sign bit is different from a preset value of the target sign bit in the first encoding sequence, the first encoding sequence based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit.

After obtaining the first encoding sequence, the first interface may parse the first encoding sequence to determine information that is carried by the first encoding sequence. A signal sent by the second interface to the first interface is a voltage signal. When a voltage value sent by the second interface to the first interface jumps, a bit error is likely to occur in an encoded value received by the first interface, and the bit error is tolerable. However, in the conventional technology, once a bit error occurs in the first encoding sequence, the first interface cannot correctly parse the first encoding sequence. Consequently, an effect of optimizing SerDes performance by transferring the training frame between the first interface and the second interface is affected. In this embodiment of this application, for the target sign bit in the first encoding sequence, if the value of the target sign bit is different from the preset value of the target sign bit, the first encoding sequence may be parsed based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit. The target sign bit is one or more sign bits in which a bit error is likely to occur.

For the preset value of the target sign bit, it should be noted that, in some embodiments, the voltage signal sent by the second interface to the first interface needs to comply with a protocol specification. For the training frame, the protocol may be IEEE Std <NUM>™-<NUM> Clause <NUM> or IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM>. Correspondingly, a value of each sign bit in the first encoding sequence also complies with a specific rule. The preset value of the target sign bit is a theoretical value that complies with the protocol specification.

A preset value of one sign bit is described by using an example.

IEEE Std <NUM>™-<NUM> specifies that a frame marker of the training frame encoded by using the NRZ code is "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", preset values corresponding to the <NUM>st sign bit to the <NUM>th sign bit in the frame marker encoding sequence are all <NUM>, and preset values corresponding to the <NUM>th sign bit to the <NUM>nd sign bit in the frame marker encoding sequence are all <NUM>. The control field encoding sequence and the status field encoding sequence of the training frame use eight sign bits to indicate logical bit information. Values of the eight sign bits are also specified in IEEE Std <NUM>™-<NUM>, to be specific, may be "<NUM><NUM>", "<NUM><NUM>", "<NUM><NUM>", or "<NUM><NUM>". For the control field encoding sequence and the status field encoding sequence of the training frame, in the eight sign bits indicating the logical bit information, preset values of the first four sign bits are the same, and the preset values may be <NUM> or <NUM>. Preset values of the last four sign bits are also the same, and the preset values may be <NUM> or <NUM>. When a value of the logical bit information is <NUM>, the preset values of the first four sign bits are different from the preset values of the last four sign bits; or when a value of the logical bit information is <NUM>, the preset values of the first four sign bits are the same as the preset values of the last four sign bits.

IEEE Std <NUM>. 3cd™-<NUM> specifies that a format of a frame marker of the training frame encoded through PAM4 is "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", preset values corresponding to the <NUM>st sign bit to the <NUM>th sign bit in the frame marker encoding sequence are all <NUM>, and preset values corresponding to the <NUM>th sign bit to the <NUM>nd sign bit in the frame marker encoding sequence are all <NUM>. The control field encoding sequence and the status field encoding sequence of the training frame use eight sign bits to indicate logical bit information. 3cd™-<NUM> specifies that values of the eight sign bits may be "<NUM><NUM>", "<NUM><NUM>", "<NUM><NUM>", or "<NUM><NUM>". For the control field encoding sequence and the status field encoding sequence of the training frame, in the eight sign bits indicating the logical bit information, preset values of the first four sign bits are the same, and the preset values may be <NUM> or <NUM>. Preset values of the last four sign bits are also the same, and the preset values may be <NUM> or <NUM>. When a value of the logical bit information is <NUM>, the preset values of the first four sign bits are different from the preset values of the last four sign bits, in other words, the eight sign bits are <NUM><NUM> or <NUM><NUM>; or when a value of the logical bit information is <NUM>, the preset values of the first four sign bits are the same as the preset values of the last four sign bits, in other words, the eight sign bits are <NUM><NUM> or <NUM><NUM>.

Parsing the first encoding sequence in this embodiment of this application may include at least one of the following two aspects. The first aspect means identifying whether the first encoding sequence is the frame marker encoding sequence of the training frame. Specifically, when the first encoding sequence includes <NUM> sign bits, a bit error may occur in a target sign bit in the <NUM> sign bits, and the other sign bits comply with the protocol specification on the frame marker, the first interface may determine the first encoding sequence as the frame marker encoding sequence of the training frame, instead of discarding the first encoding sequence like in the conventional technology. For example, if the encoding scheme of the first encoding sequence is NRZ, when the first interface determines that a value of a sign bit other than the target sign bit complies with the specification of IEEE Std <NUM>™-<NUM> Clause <NUM>, the first interface may determine the first encoding sequence as the frame marker encoding sequence of the training frame. For another example, if the encoding scheme of the first encoding sequence is PAM4, when the first interface determines that a value of a sign bit other than the target sign bit complies with the specification of IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM>, the first interface may determine the first encoding sequence as the frame marker encoding sequence of the training frame.

As described above, both the control field encoding sequence and the status field encoding sequence of the training frame use eight sign bits to indicate logical bit information. Therefore, the second aspect means that, when the first encoding sequence includes the status field encoding sequence or the control field encoding sequence, the first interface encodes the first encoding sequence to obtain a second encoding sequence. The second encoding sequence herein may be used to indicate the logical bit information indicated by the status field encoding sequence or the control field encoding sequence.

It can be learned from the foregoing descriptions that, according to the solution in this embodiment of this application, for the target sign bit in which a bit error is likely to occur, if a bit error occurs in the target sign bit, in other words, the value of the target sign bit is different from the preset value of the target sign bit, the first interface may also correctly parse the first encoding sequence.

When the voltage value sent by the second interface to the first interface jumps, a bit error is likely to occur in the encoded value received by the first interface. The target sign bit includes one or more sign bits in which a bit error is likely to occur. The following specifically describes the target sign bit.

In some embodiments, in the frame marker encoding sequence of the training frame, voltage values corresponding to the first <NUM> sign bits are the same, voltage values corresponding to the last <NUM> sign bits are the same, and the voltage values corresponding to the first <NUM> sign bits are different from the voltage values corresponding to the last <NUM> sign bits. In this case, a bit error is likely to occur in the <NUM>th sign bit and the <NUM>th sign bit that are received by the first interface. In addition, the inventor finds, through research, that a bit error is also likely to occur in a sign bit that is close to the <NUM>th sign bit, for example, the <NUM>th sign bit and the <NUM>th sign bit. Correspondingly, a bit error is also likely to occur in a sign bit that is close to the <NUM>th sign bit, for example, the <NUM>th sign bit and the <NUM>th sign bit. Therefore, when the first encoding sequence obtained by the first interface is similar to the frame marker encoding sequence of the training frame, for example, if the first interface and the second interface determine an encoding scheme of the training frame as NRZ through auto negotiation, and the first encoding sequence is similar to the frame marker encoding sequence specified in IEEE Std <NUM>™-<NUM> Clause <NUM>, or if the first interface and the second interface determine an encoding scheme of the training frame as PAM4 through auto negotiation, and the first encoding sequence is similar to the frame marker encoding sequence specified in IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM>, that the first interface parses the first encoding sequence includes determining whether the first encoding sequence is the frame marker encoding sequence of the training frame. In this case, the target sign bit may include m+n sign bits, where both m and n are integers greater than or equal to <NUM>.

Specifically, when m+n is equal to <NUM>, the target sign bit includes one sign bit. In this case, the target sign bit may include a first sign bit or a second sign bit, the first sign bit is adjacent to the second sign bit, and a preset value of the first sign bit is different from a preset value of the second sign bit. The first sign bit herein may be, for example, the <NUM>th sign bit above, and the second sign bit herein may be, for example, the <NUM>th sign bit above. For example, for a training frame encoded by using NRZ code, when the first encoding sequence received by the first interface is "<NUM><NUM><NUM>111Y <NUM><NUM><NUM><NUM>" or "<NUM><NUM><NUM><NUM> Y000 <NUM><NUM><NUM>", the first interface may parse the first encoding sequence based on "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", where a value of Y may be <NUM> or <NUM>. For another example, for a training frame encoded through PAM4, when the first encoding sequence received by the first interface is "<NUM><NUM><NUM>333X <NUM><NUM><NUM><NUM>" or " <NUM><NUM><NUM> X000 <NUM><NUM><NUM>", the first interface may parse the first encoding sequence based on "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", where a value of X may be any one of <NUM>, <NUM>, <NUM>, and <NUM>.

When m+n is greater than <NUM>, the target sign bit may include m+n consecutive sign bits, preset values of the first m sign bits in the m+n consecutive sign bits are the same, preset values of the last n sign bits in the m+n consecutive sign bits are the same, and the preset values of the first m sign bits are different from the preset values of the last n sign bits. In other words, the last sign bit in the first m consecutive sign bits may be the first sign bit, and the <NUM>st sign bit in the last n consecutive sign bits may be the second sign bit. Specific values of m and n are not specifically limited in this embodiment of this application. In some embodiments, when the voltage value sent by the second interface jumps, sign bits in which a bit error occurs in the encoded value received by the first interface are symmetric. In other words, a quantity of sign bits in which a bit error is likely to occur before a level jump is the same as a quantity of sign bits in which a bit error is likely to occur after the level jump. Therefore, in some embodiments, m and n may be the same. For example, values of m and n are both <NUM>. For another example, values of m and n are both <NUM>. For still another example, values of m and n are both <NUM>.

In this case, for example, if the first encoding sequence is an NRZ encoding sequence, when the first encoding sequence received by the first interface is "<NUM><NUM><NUM>11YY <NUM><NUM><NUM><NUM>", "<NUM><NUM><NUM><NUM> YY00 <NUM><NUM><NUM>", "<NUM><NUM><NUM>1YYY <NUM><NUM><NUM><NUM>", "<NUM><NUM><NUM><NUM> YYY0 <NUM><NUM><NUM>", "<NUM><NUM><NUM>111Y Y000 <NUM><NUM><NUM>", "<NUM><NUM><NUM>11YY YY00 <NUM><NUM><NUM>", or "<NUM><NUM><NUM>1YYY YYY0 <NUM><NUM><NUM>", the first interface may parse the first encoding sequence based on "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", where a value of Y may be <NUM> or <NUM>. For another example, if the first encoding sequence is a PAM4 encoding sequence, when the first encoding sequence received by the first interface is "<NUM><NUM><NUM>33XX <NUM><NUM><NUM><NUM>", "<NUM><NUM><NUM><NUM> XX00 <NUM><NUM><NUM>", "<NUM><NUM><NUM>3XXX <NUM><NUM><NUM><NUM>", "<NUM><NUM><NUM><NUM> XXX0 <NUM><NUM><NUM>", "<NUM><NUM><NUM>333X X000 <NUM><NUM><NUM>", "<NUM><NUM><NUM>33XX XX00 <NUM><NUM><NUM>", or "<NUM><NUM><NUM>3XXX XXX0 <NUM><NUM><NUM>", the first interface may parse the first encoding sequence based on "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", where a value of X may be any one of <NUM>, <NUM>, <NUM>, and <NUM>.

In addition, the control field encoding sequence follows the frame marker encoding sequence of the training frame, and a value of the <NUM>st sign bit in the control field encoding sequence may also be different from a value of the last sign bit in the frame marker encoding sequence. Therefore, a bit error is also likely to occur in the last sign bit in the frame marker encoding sequence. The inventor finds, through research, that a bit error is also likely to occur in a sign bit that is close to the last sign bit in the frame marker encoding sequence, for example, the second-to-last sign bit and the third-to-last sign bit in the frame marker encoding sequence. In view of this, if the first encoding sequence is similar to the frame marker encoding sequence of the training frame, the target sign bit may include the last k sign bits in first encoding sequence, where k is an integer greater than or equal to <NUM>. For example, a value of k may be <NUM>, <NUM>, or <NUM>. For example, if the first encoding sequence is an NRZ encoding sequence, when the first encoding sequence received by the first interface is "<NUM><NUM><NUM><NUM><NUM><NUM><NUM>000Y", "<NUM><NUM><NUM><NUM><NUM><NUM>00YY", or "<NUM><NUM><NUM><NUM><NUM><NUM><NUM>0YYY", the first interface may parse the first encoding sequence based on "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", where a value of Y may be <NUM> or <NUM>. For another example, if the first encoding sequence is a PAM4 encoding sequence, when the first encoding sequence received by the first interface is "<NUM><NUM><NUM><NUM><NUM><NUM><NUM>000X", "<NUM><NUM><NUM><NUM><NUM><NUM>00XX", or "<NUM><NUM><NUM><NUM><NUM><NUM>0XXX", the first interface may parse the first encoding sequence based on "<NUM><NUM><NUM><NUM><NUM><NUM><NUM><NUM>", where a value of X may be any one of <NUM>, <NUM>, <NUM>, and <NUM>.

Both the control field encoding sequence and the status field encoding sequence of the training frame use eight sign bits to indicate logical bit information. If values of the first four sign bits are the same as values of the last four sign bits, a value of the logical bit information indicated by the eight sign bits is <NUM>; or if values of the first four sign bits are different from values of the last four sign bits, a value of the logical bit information indicated by the eight sign bits is <NUM>. In this embodiment of this application, <NUM>*i sign bits indicating the logical bit information are referred to as a first encoding sub-sequence. If the first encoding sub-sequence is the control field encoding sequence or the status field encoding sequence of the training frame, a value of i may be equal to <NUM>. A value of the logical bit information indicated by the first encoding sub-sequence may be <NUM> or <NUM>. Therefore, a voltage value corresponding to the ith sign bit may be different from a voltage value corresponding to the (i+<NUM>)th sign bit in the first encoding sub-sequence. In this case, a bit error may occur in both the ith sign bit and the (i+<NUM>)th sign bit in the first encoding sub-sequence. In addition, the control field encoding sequence of the training frame may include one or more first encoding sub-sequences, and values of logical bits indicated by two adjacent first encoding sub-sequences may be the same or may be different. In other words, a value of the last sign bit in a current first encoding sub-sequence may be different from a value of the <NUM>st sign bit in a next first encoding sub-sequence. In this case, a bit error may occur in both the <NUM>st sign bit and the last sign bit, namely, the (<NUM>*i)th sign bit, in the first encoding sub-sequence. Therefore, the target sign bit may include any one or more of the <NUM>st sign bit in the first encoding sub-sequence, the ith sign bit in the first encoding sub-sequence, the (i+<NUM>)th sign bit in the first encoding sub-sequence, and the (<NUM>*i)th sign bit in the first encoding sub-sequence.

A difference from the frame marker encoding sequence is that a specific value of each sign bit in the first encoding sub-sequence is not specified in IEEE Std <NUM>™-<NUM> Clause <NUM> and IEEE Std <NUM>. 3cd™-<NUM> Clause <NUM>, but the value of each sign bit in the first encoding sub-sequence needs to comply with a rule that values of the first i sign bits are the same and values of the last i sign bits are the same. In this embodiment of this application, the first interface may determine a preset value of the <NUM>st sign bit and a preset value of the ith sign bit based on a preset value of a sign bit between the <NUM>st sign bit and the ith sign bit. In an embodiment, an actual value of the sign bit between the <NUM>st sign bit and the ith sign bit may be determined as the preset value of the sign bit between the <NUM>st sign bit and the ith sign bit. For example, if the values of the first i sign bits in the first encoding sub-sequence are "Y00Y", the first interface may determine preset values of the <NUM>nd sign bit and the <NUM>rd sign bit as <NUM>, and further determine both preset values of the <NUM>st sign bit and the <NUM>th sign bit as <NUM>. For another example, if the values of the first i sign bits in the first encoding sub-sequence are "X33X", the first interface may determine preset values of the <NUM>nd sign bit and the <NUM>rd sign bit as <NUM>, and further determine both preset values of the <NUM>st sign bit and the <NUM>th sign bit as <NUM>. Correspondingly, a preset value of the (i+<NUM>)th sign bit and a preset value of the (<NUM>*i)th sign bit are determined based on a preset value of a sign bit between the (i+<NUM>)th sign bit and the (<NUM>*i)th sign bit.

In this embodiment of this application, if the first encoding sequence is a PAM4 encoding sequence, a value of each sign bit in the status field encoding sequence and the control field encoding sequence of the training frame may be only <NUM> or <NUM>. In addition, if the first encoding sequence is the status field encoding sequence or the control field encoding sequence, it indicates that the first interface has successfully received the frame marker encoding sequence of the training frame from the second interface. In this case, to further improve an effect of optimizing SerDes performance by transferring the training frame between the first interface and the second interface, in some embodiments, for the control field encoding sequence and the status field encoding sequence of the training frame, error tolerance may be further relaxed. Specifically, the target sign bit may further include a first sign bit sequence and a second sign bit sequence. The first sign bit sequence includes the <NUM>nd sign bit to the (i-<NUM>)th sign bit in the first encoding sub-sequence, and the second sign bit sequence includes the (i+<NUM>)th sign bit to the (<NUM>*i-<NUM>)th sign bit in the first encoding sub-sequence. Herein, a value of i is an integer greater than or equal to <NUM>. For example, the value of i may be <NUM>.

In addition, it is considered that the preset value of the <NUM>st sign bit and the preset value of the ith sign bit are determined based on a value of each sign bit in the first sign bit sequence, and the preset value of the (i+<NUM>)th sign bit and the preset value of the (<NUM>*i)th sign bit are determined based on a value of each sign bit in the second sign bit sequence. If a bit error occurs in a sign bit in the first sign bit sequence, an actual value of the sign bit in the first sign bit sequence cannot be determined as a preset value of the sign bit in the first sign bit sequence, and consequently the preset value of the <NUM>st sign bit and the preset value of the ith sign bit cannot be determined. Correspondingly, if a bit error occurs in a sign bit in the second sign bit sequence, the preset value of the (i+<NUM>)th sign bit and the preset value of the (<NUM>*i)th sign bit cannot be determined. To resolve this problem, in this embodiment of this application, a preset value of each sign bit in the first sign bit sequence may be determined based on the value of each sign bit in the first sign bit sequence. It should be noted that, for the PAM4 code, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable; an encoded value obtained after the bit error is slightly likely to be <NUM> or <NUM>, and this bit error is intolerable. Similarly, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable; an encoded value obtained after the bit error is slightly likely to be <NUM> or <NUM>, and this bit error is intolerable. Therefore, in some embodiments, when the value of each sign bit in the first sign bit sequence is <NUM> or <NUM>, the preset value of each sign bit in the first sign bit sequence is determined as <NUM>. When the value of each sign bit in the first sign bit sequence is <NUM> or <NUM>, the preset value of each sign bit in the first sign bit sequence is determined as <NUM>. A preset value of each sign bit in the second sign bit sequence is also determined in this way. For example, when a value of the first sign bit sequence is "<NUM>", it may be considered that a preset value of the first sign bit sequence is "<NUM>"; or when a value of the first sign bit sequence is "<NUM>", it may be considered that a preset value of the first sign bit sequence is "<NUM>". In other words, when the first encoding sub-sequence received by the first interface is "X22X X11X", the first interface may parse the first encoding sub-sequence based on "<NUM><NUM>".

In some embodiments, for a PAM4 encoding sequence, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable. Similarly, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable. Therefore, if the first encoding sequence is a PAM4 encoding sequence, during specific implementation of S102, for example, a difference between the value of the target sign bit and the preset value of the target sign bit may be determined. If the difference is equal to <NUM>, the first encoding sequence is parsed based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit. Otherwise, it may be considered that the parsing fails, and the first encoding sequence is discarded. For example, if the preset value is <NUM>, and the value of the target sign bit is <NUM>, the first encoding sequence is parsed based on the fact that the value of the target sign bit is <NUM>. For another example, if the preset value is <NUM>, and the value of the target sign bit is <NUM>, the first encoding sequence is parsed based on the fact that the value of the target sign bit is <NUM>.

As described above, if the first encoding sequence is similar to the frame marker encoding sequence of the training frame, a bit error is likely to occur in the first sign bit and the second sign bit that are received by the first interface. In addition, a bit error is also likely to occur in a sign bit that is close to the first sign bit, for example, one or two sign bits before the first sign bit. Correspondingly, a bit error is also likely to occur in a sign bit that is close to the second sign bit, for example, one or two sign bits after the second sign bit. In some embodiments, a possibility that a bit error occurs in the first sign bit is higher than a possibility that a bit error occurs in one sign bit before the first sign bit, and a possibility that a bit error occurs in the second sign bit is higher than a possibility that a bit error occurs in one sign bit after the second sign bit. In addition, a possibility that a bit error occurs in the last sign bit is higher than a possibility that a bit error occurs in the second-to-last sign bit. Therefore, if the first encoding sequence is a PAM4 encoding sequence, when the target sign bit includes the m+n consecutive sign bits, or when the target sign bit includes the last k sign bits in the first encoding sequence, different error tolerance degrees may be set for the sign bits, and a sign bit with a higher bit error probability has a higher error tolerance degree. For example, error tolerance granularities of the first sign bit and the second sign bit are the highest, and error tolerance degrees of the one or two sign bits before the first sign bit are relatively low. An error tolerance degree may be determined by using a value of a sign bit. For a sign bit with a high error tolerance degree, regardless of a value of the sign bit, parsing is performed based on a preset value of the sign bit. For a sign bit with a relatively low error tolerance degree, it may be further determined whether a difference between a value of the sign bit and a preset value of the sign bit is equal to <NUM>. When the difference is equal to <NUM>, the first encoding sequence is parsed based on the fact that the value of the sign bit is equal to the preset value.

This may be understood with reference to Table <NUM>. In Table <NUM>, a value of X may be any one of <NUM>, <NUM>, <NUM>, and <NUM>, and x indicates that a difference between a value and a preset value is equal to <NUM>. To be specific, when the preset value is <NUM>, the value of x is <NUM>; or when the preset value is <NUM>, the value of x is <NUM>. When the first encoding sequence is shown in Table <NUM>, the first encoding sequence may be determined as the frame marker encoding sequence.

It should be noted that Table <NUM> is merely an example for description for ease of understanding, and various cases included in this embodiment of this application are not exhaustively listed. When no conflict occurs, the target sign bit may be a combination of the cases shown in Table <NUM>.

In some embodiments, for the frame marker encoding sequence, a bit error is also very likely to occur in the first several sign bits in the frame marker encoding sequence. However, if an error tolerance degree of the frame marker encoding sequence is too high, a non-frame marker encoding sequence may be identified as the frame marker encoding sequence. Considering the foregoing descriptions, for a PAM4 encoding sequence, for a sign bit whose preset value is <NUM>, if a bit error occurs in the sign bit, an encoded value obtained after the bit error is very likely to be <NUM>, and this bit error is tolerable. However, for an NRZ encoding sequence, a value of each sign bit is only <NUM> or <NUM>. For an encoding sequence that is similar to the frame marker encoding sequence, it is difficult to determine whether a bit error occurs in the first several sign bits. Therefore, when the first encoding sequence is a PAM4 encoding sequence, and the first encoding sequence is similar to the frame marker encoding sequence of the training frame, the target sign bit may include the first p sign bits in the first encoding sequence, where p is greater than or equal to <NUM> and less than or equal to a first threshold. The first threshold herein may be, for example, equal to <NUM> or <NUM>. In an example, when a value of one or more of the current p sign bits is <NUM>, the first encoding sequence may be parsed based on the fact that values of the first p sign bits are all <NUM>.

According to the data processing method provided in this embodiment, embodiments of this application further provide a corresponding apparatus. The following describes the apparatus with reference to the accompanying drawings.

<FIG> is a schematic diagram of a structure of a data processing apparatus according to an embodiment of this application. The data processing apparatus <NUM> shown in <FIG> may be configured to perform the data processing method shown in <FIG>. Specifically, the data processing apparatus <NUM> may include an obtaining unit <NUM> and a parsing unit <NUM>.

The obtaining unit <NUM> is configured to obtain a first encoding sequence. The parsing unit <NUM> is configured to parse, if a value of a target sign bit is different from a preset value of the target sign bit in the first encoding sequence, the first encoding sequence based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit.

In a possible implementation, the parsing unit <NUM> is specifically configured to: if the value of the target sign bit is different from the preset value of the target sign bit in the first encoding sequence, determine the first encoding sequence as a frame marker encoding sequence of a training frame.

In a possible implementation, the parsing unit <NUM> is specifically configured to:
if the value of the target sign bit is different from the preset value of the target sign bit in the first encoding sequence, encode the first encoding sequence to obtain a second encoding sequence.

In a possible implementation, when the first encoding sequence is a four-level pulse amplitude modulation encoding sequence, the parsing unit <NUM> is specifically configured to: if a difference between the value of the target sign bit and the preset value of the target sign bit is equal to <NUM>, parse the first encoding sequence based on the fact that the value of the target sign bit is equal to the preset value of the target sign bit.

Because the apparatus <NUM> is an apparatus corresponding to the data processing method corresponding to <FIG> described in the foregoing embodiment, specific implementations of the units in the apparatus <NUM> and the foregoing method embodiment are based on a same concept. Therefore, for specific implementations of the units in the apparatus <NUM>, refer to the descriptions of the data processing method corresponding to <FIG> in the foregoing method embodiment.

It should be noted that a hardware structure of the data processing apparatus <NUM> may be a structure shown in <FIG> is a schematic diagram of a structure of a data processing device according to an embodiment of this application.

As shown in <FIG>, the data processing device <NUM> includes a processor <NUM>, a communications interface <NUM>, and a memory <NUM>. There may be one or more processors <NUM> in the data processing device <NUM>. One processor is used as an example in <FIG>. In this embodiment of this application, the processor <NUM>, the communications interface <NUM>, and the memory <NUM> may be connected by using a bus system or in another manner. In <FIG>, for example, a bus system <NUM> is used for connection.

The processor <NUM> may be a central processing unit (central processing unit, CPU), a network processor (network processor, NP), or a combination of the CPU and the NP. The processor <NUM> may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable logic gate array (field-programmable logic gate array, FPGA), generic array logic (generic array logic, GAL), or any combination thereof.

The memory <NUM> may include a volatile memory (English: volatile memory), such as a random access memory (random access memory, RAM). The memory <NUM> may alternatively include a nonvolatile memory (English: nonvolatile memory), such as a flash memory (English: flash memory), a hard disk drive (hard disk drive, HDD), or a solid-state drive (solid-state drive, SSD). The memory <NUM> may alternatively include a combination of the foregoing types of memories. For example, the memory <NUM> may store a preset value of a frame marker encoding sequence of a training frame, and is configured to store preset values of <NUM>*i sign bits that are used to indicate logical bit information.

Optionally, the memory <NUM> stores an operating system, a program, and an executable module or a data structure, or a subset thereof, or an extended set thereof. The program may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks. The processor <NUM> may read the program in the memory <NUM>, to implement the data processing method in this embodiment of this application.

The bus system <NUM> may be a peripheral component interconnect (peripheral component interconnect, PCI) bus, an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The bus system <NUM> may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one bold line is used for representation in <FIG>, but this does not mean that there is only one bus or only one type of bus.

An embodiment of this application further provides a computer-readable storage medium, including instructions or a computer program. When the computer-readable storage medium runs on a computer, the computer is enabled to perform the data processing method in the foregoing embodiment.

An embodiment of this application further provides a computer program product including instructions or a computer program. When the computer program product runs on a computer, the computer is enabled to perform the data processing method in the foregoing embodiment.

The method in this application may be implemented on an Ethernet interface.

The apparatus and the device in this application each may be an Ethernet interface or a part of an Ethernet interface.

This application further provides a device. The device includes the Ethernet interface in the foregoing embodiment.

In this specification, the claims, and the accompanying drawings of this application, terms "first", "second", "third", "fourth", and the like (if existent) are intended to distinguish between similar objects but do not necessarily indicate a specific order or sequence. It should be understood that the terms used in such a way are interchangeable in proper circumstances, so that embodiments described herein can be implemented in other orders than the order illustrated or described herein. Moreover, terms "include", "contain" and any other variants thereof mean to cover the non-exclusive inclusion. For example, a process, a method, a system, a product, or a device that includes a list of steps or units is not necessarily limited to those expressly listed steps or units, but may include other steps or units not expressly listed or inherent to such the process, the method, the product, or the device.

It may be clearly understood by persons skilled in the art that, for the purpose of convenient and brief description, for a detailed working process of the system, the apparatus, and the unit, refer to a corresponding process in the foregoing method embodiment, and details are not described herein again.

In several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in another manner. For example, unit division is merely logical service division and may be other division during actual implementation. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, in other words, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual requirements to achieve the objectives of the solutions of embodiments.

In addition, service units in embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software service unit.

When the integrated unit is implemented in the form of a software service unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the conventional technology, or all or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions to enable a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the method described in embodiments of this application. The storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or a compact disc.

Persons skilled in the art should be aware that, in the foregoing one or more examples, the services described in the present invention may be implemented by hardware, software, firmware, or any combination thereof. When the services are implemented by the software, the services may be stored in a computer-readable medium or transmitted as one or more instructions or code in the computer-readable medium. The computer-readable medium includes a computer storage medium and a communications medium. The communications medium includes any medium that enables a computer program to be transmitted from one place to another. The storage medium may be any available medium accessible to a general-purpose or special-purpose computer.

Claim 1:
A data processing method performed by a first interface (<NUM>), the method comprising:
receiving (S101), from a second interface (<NUM>), a first encoding sequence, wherein a value of a target sign bit is different from a preset value of the target sign bit in the first encoding sequence; and
parsing (S102) the first encoding sequence as if the value of the target sign bit were equal to the preset value of the target sign bit;
wherein the first encoding sequence comprises a first encoding sub-sequence, the first encoding sub-sequence comprises <NUM>*i sign bits, wherein i is greater than or equal to <NUM>, the first encoding sub-sequence is used to indicate logical bit information, and the target sign bit comprises any one or more of the following sign bits: the <NUM>st sign bit in the first encoding sub-sequence, the ith sign bit in the first encoding sub-sequence, the (i+<NUM>)th sign bit in the first encoding sub-sequence, and the (<NUM>*i)th sign bit in the first encoding sub-sequence; and
characterised in that a preset value of the <NUM>st sign bit and a preset value of the ith sign bit are determined based on a preset value of a sign bit between the <NUM>st sign bit and the ith sign bit, and a preset value of the (i+<NUM>)th sign bit and a preset value of the (<NUM>*i)th sign bit are determined based on a preset value of a sign bit between the (i+<NUM>)th sign bit andthe (<NUM>*i)th sign bit.