Data transmission method and device

By adjusting the number of valid data blocks in the Ethernet data frame, the transmission rate drop caused by Ethernet cable failure is solved, and the effect of maintaining a high Ethernet rate and adapting to the MAC layer rate in the event of a failure is achieved.

CN120074740APending Publication Date: 2025-05-30HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311631375.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In Ethernet, due to construction dragging, poor crimping of cables, and aging of crystal head crimping, cables or optical cables are prone to failure, resulting in at least one pair of Ethernet cables in Ethernet that cannot communicate network, which in turn affects the bandwidth and user experience of the link.

Method used

By adjusting the number of valid data blocks in the data frame transmitted by the communication device, in the event that some faulty wire pairs occur on the Ethernet cable, the communication device can still maintain a high Ethernet rate when transmitting data. The specific method is to adjust the number of valid data blocks in the transmitted data frame according to the ratio of the first rate and the second rate to ensure that the data transmission process can adapt to the rate at which the MAC layer transmits data.

Benefits of technology

It is realized that when the Ethernet cable is partially faulty, the rate of the communication device transmitting effective data can be adapted to the transmission rate of the MAC layer, maintaining the modulation format and baud rate of the normal pair, ensuring that the transmission data frame rate of the Ethernet cable remains unchanged, and the changes to the PMA layer are small, the hardware implementation complexity is low, and the delay is small.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074740A_ABST
    Figure CN120074740A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and device, and the method comprises the steps: a first communication device transmits a first data frame to a second communication device, and the first data frame comprises a first number of effective data blocks; under the condition that a first rate is different from a second rate, the first communication device adjusts the number of valid data blocks in a transmitted data frame from the first number to a second number according to the first rate and the second rate, an adjusted second data frame is obtained, the length of the first data frame is the same as that of the second data frame, and the second data frame is the same as the first data frame. The first rate is a rate at which the first communication device transmits valid data in a data frame, and the second rate is a rate at which a media access control (MAC) layer of the first communication device transmits data; and the first communication device transmits the second data frame to the second communication device. In the scheme of the embodiment of the invention, the rate when the communication equipment transmits the valid data can be adapted to the transmission rate of the MAC layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication, and more particularly, to a method and apparatus for data transmission. Background Art

[0002] Traditional Ethernet usually uses Ethernet cables such as cables or optical fibers as transmission media. For example, 10BASE-T and 100BASE-TX defined by the IEEE802.3 standard are Ethernet that transmits 10Mb / s or 100Mb / s in duplex or full duplex over 2 pairs of twisted pairs, and 1000BASE-T, 2.5GBASE-T, 5GBASE-T, and 10GBASE-T are Ethernet that transmits 1Gb / s, 2.5Gb / s, 5Gb / s, and 10Gb / s in full duplex over 4 pairs of twisted pairs. In the actual application of Ethernet, due to reasons such as construction dragging, poor crimping of cable connectors, and aging of connector crimping pieces, cables or optical fibers are prone to failure, which easily causes at least one pair of Ethernet cables in the Ethernet to be unable to perform network communication.

[0003] At present, since 1000BASE-T, 2.5GBASE-T, 5GBASE-T, and 10GBASE-T defined by the above standards all require four pairs of twisted pairs to achieve network communication, if the above-mentioned line pair failure occurs, it will negotiate to a mode that supports 10BASE-T and 100BASE-TX according to the standard, and the transmission rate will drop significantly to 10Mb / s or 100Mb / s, thus directly affecting the bandwidth of the link and the user experience.

[0004] Therefore, how to maintain a high Ethernet rate in the case of partial failure of Ethernet cables has become an urgent problem to be solved currently. Summary of the Invention

[0005] This application provides a method and apparatus for data transmission. By adjusting the number of valid data blocks in the data frames transmitted by the communication device, when there are partial faulty line pairs in the Ethernet cable, the communication device can still maintain a high Ethernet rate when transmitting data.

[0006] In a first aspect, a data transmission method is provided, including: a first communication device transmits a first data frame to a second communication device, and the first data frame includes a first number of valid data blocks; when a first rate is different from a second rate, the first communication device adjusts the number of valid data blocks in the transmitted data frame from the first number to a second number according to the first rate and the second rate, obtaining an adjusted second data frame, where the first data frame and the second data frame have the same length, and where the first rate is the rate of valid data in the data frame transmitted by the first communication device, and the second rate is the rate of data transmitted by the media access control (MAC) layer of the first communication device; the first communication device transmits the second data frame to the second communication device.

[0007] The method shown in the first aspect can be applied to the scenario of Ethernet data transmission. In the Ethernet scenario, at least two communication devices achieve network communication and data transmission at a certain rate through at least one pair of Ethernet cables. Among them, the communication device can be a terminal device such as a personal computer, a printer, a camera, or a network device such as a switch, and the Ethernet cable can be a twisted pair or an optical fiber. For example, when the Ethernet communication standard is 2.5GBASE-T, the first communication device and the second communication device are interconnected through 4 pairs of twisted pairs to achieve full-duplex transmission of 2.5 Gb / s of valid data.

[0008] In the technical solution of this application, when the first rate is different from the second rate, the first communication device will adjust the number of valid data blocks in the transmitted data frame. The above situation where the first rate is different from the second rate can occur when some of the Ethernet cables have failed pairs, or when only some of the Ethernet cables in the link are selected for transmission. Exemplarily, when the Ethernet communication standard is 2.5GBASE-T or 5GBASE-T, the rate of valid data in the first data frame transmitted by the four pairs of twisted pairs between communication devices is 2.5 Gb / s or 5 Gb / s. If two of the four pairs of twisted pairs fail, the other two pairs in normal working condition can still achieve a transmission rate of 1.25 Gb / s or 2.5 Gb / s, that is, the first rate can be 1.25 Gb / s or 2.5 Gb / s. However, since the second rate of data transmission by the MAC layer of the communication device is not particularly flexible and not every MAC layer rate is supported. For example, the optional second rate of the MAC layer can only be 1 Gb / s, 2.5 Gb / s, 5 Gb / s, etc. Then when the first rate is 1.25 Gb / s, only the closest second rate of 1 Gb / s can be selected. At this time, the first rate is different from the second rate, and when the first rate is 2.5 Gb / s, the second rate of 2.5 Gb / s can be selected. At this time, the first rate is the same as the second rate.

[0009] It should be noted that the above first rate is the rate at which the first communication device transmits the valid data in the data frame, rather than the rate at which the first communication device transmits the data frame. For example, when the Ethernet communication standard is 2.5GBASE-T and there are no faulty wire pairs, the rate at which the communication device transmits the valid data in the first data frame is 2.5 Gb / s. Also, since in this Ethernet communication standard, the length of the first data frame is 2048 bits, and the length of the valid data is 1600 bits. Therefore, the corresponding transmission rate of the first data frame is 3.2 Gb / s. In the technical solution of this application, the rate at which the valid data in the data frame is transmitted between communication devices is mainly introduced.

[0010] It should be understood that in the application scenario of Ethernet, before the first communication device sends the first data frame or the second data frame, the physical layer of the first communication device encodes the valid data sent by the media access control (MAC) layer, and then obtains the first data frame or the second data frame. And the physical coding sublayer (PCS) in the physical layer can encode the data from the interface into blocks during the encoding process, and then obtain the valid data blocks. For example, under the communication standards of 2.5GBASE-T, 5GBASE-T or 10GBASE-T, PCS adds a bit as a control word Data / Ctrl header to 64-bit data from the interface during the encoding process, and the valid data block is a 64B / 65B code block. In the embodiments of this application, the valid data block can be the above 64B / 65B data block, or 128B / 129B data block, 256B / 257B data block, etc. that may appear in the future. In the embodiments of this application, the method for the PCS to perform forward error correction (FEC) encoding can be Reed-Solomon (RS) codes encoding, convolutional codes, low-density parity-check (LDPC) codes, Polar codes, etc.

[0011] In other embodiments of this application, different Ethernet standards can correspond to different first quantities. For example, under the communication standards of 2.5GBASE-T or 5GBASE-T, the first quantity is 25, and under the communication standard of 10GBASE-T, the first quantity is 50.

[0012] In the actual application of Ethernet, due to reasons such as construction dragging, poor crimping of cable connectors, and aging of connector crimping pieces, Ethernet cables such as cables or optical fibers are prone to failures, which can easily cause communication failures between at least one pair of Ethernet cables in the Ethernet. In the solution of the embodiment of the present application, when the first rate is different from the second rate, the first communication device can adjust the number of valid data blocks in the data frame, or in other words, adjust the length of the valid data in the data frame, so that the data transmission process can adapt to the second rate, that is, the rate at which the MAC layer transmits data. In other words, the technical solution of the present application reduces the rate of the first communication device transmitting valid data from the first rate to the same as the second rate to adapt to the rate at which the MAC layer transmits data. Moreover, the overall encoding process of the physical coding sublayer of the first communication device does not change, or in other words, the lengths of the first data frame and the second data frame do not change. Therefore, the modulation format and baud rate of the normal line pair when the first rate and the second rate are the same can be maintained.

[0013] Furthermore, the present application can achieve that in the above fault scenario, the rate at which the communication device transmits valid data can adapt to the transmission rate of the MAC layer, and by keeping the modulation format and baud rate of the normal line pair unchanged, the rate of the data frame transmitted by the Ethernet cable connected to the communication device remains unchanged. Moreover, the modification to the PMA layer of the communication device is very small, the hardware implementation complexity is low, and the latency is small.

[0014] In combination with the first aspect, in some implementation manners of the first aspect, the first communication device adjusts the number of valid data blocks in the transmitted data frame from the first number to the second number according to the first rate and the second rate, including: the first communication device adjusts the total number of bits of the valid data in the transmitted data frame from the third number to the fourth number according to the ratio of the first rate to the second rate, the ratio of the third number to the fourth number is the same as the ratio of the first rate to the second rate, the third number is the total number of bits of the valid data blocks of the first number, and the fourth number is the total number of bits of the valid data blocks of the second number.

[0015] It should be understood that, from the above, the technical solution of the present application reduces the rate of the first communication device for transmitting valid data from the first rate to the same as the second rate to adapt to the rate of the MAC layer for transmitting data. To achieve the reduction of the rate of the first communication device for transmitting valid data, the length of the valid data in the data frame transmitted by the first communication device needs to be reduced. Also, since the rate of the normal wire pair for transmitting the data frame remains unchanged, and the ratio of the transmission rate of the valid data to the transmission rate of the data frame is the ratio of the length of the valid data in the data frame to the length of the data frame, therefore, by adjusting the total number of bits of the valid data in the transmitted data frame from the third quantity to the fourth quantity, and the ratio of the third quantity to the fourth quantity is the same as the ratio of the first rate to the second rate, the length of the valid data transmitted by the first communication device is reduced, and the rate of the valid data can be reduced from the first rate to the same as the second rate.

[0016] Combined with the first aspect, in some implementation manners of the first aspect, the first communication device adjusts the number of bits of the valid data in the transmitted data frame from the third quantity to the fourth quantity according to the ratio of the first rate and the second rate, including: the first communication device adjusts the number of valid data blocks in the transmitted data frame from the first quantity to the second quantity according to the ratio of the first rate and the second rate, where the ratio of the first quantity to the second quantity is the same as the ratio of the third quantity to the fourth quantity.

[0017] It should be understood that the length of the valid data is the product of the number of valid data blocks and the length of each valid data block. Therefore, the ratio of the number of valid data blocks before and after adjustment is the same as the ratio of the length of the valid data before and after adjustment. Furthermore, by adjusting the number of valid data blocks in the data frame, the length of the valid data in the data frame can be adjusted.

[0018] Combined with the first aspect, in some implementation manners of the first aspect, the first communication device adjusts the number of valid data blocks in the transmitted data frame from the first quantity to the second quantity according to the first rate and the second rate, including: the first communication device adjusts the preset number of bits filled by the physical coding sublayer (PCS) when encoding the data frame according to the first rate and the second rate, where the first data frame encoded by the PCS of the first communication device includes the first quantity of valid data blocks and the first preset number of bits filled, the second data frame encoded by the PCS of the first communication device includes the second quantity of valid data blocks and the second preset number of bits filled, and the sum of the bits of the first quantity of valid data blocks and the first preset number of bits is the same as the sum of the bits of the second quantity of valid data blocks and the second preset number of bits.

[0019] It should be understood that the encoding process of the PCS of the communication device includes encoding and scrambling valid data blocks, encoding data frames, FEC encoding, etc. Among them, when the first rate is the same as the second rate, during the process of encoding the data frame, the PCS will collect a first number of valid data blocks and fill a first preset number of bit positions to obtain a first data frame. For example, the first preset number of bit positions may include 0 or random numbers and the check bits of FEC encoding. In the embodiments of the present application, when the first rate is different from the second rate, the PCS will collect a second number of valid data blocks, and then the number of bit positions filled is adjusted from the first preset number to the second preset number, and finally a second data frame with the same length as the first data frame is obtained.

[0020] In combination with the first aspect, in some implementation manners of the first aspect, the rate at which the first communication device transmits the valid data in the first data frame is a third rate, and the method further includes: the first communication device adjusts the clock frequencies when encoding and scrambling the valid data blocks of the PCS of the first communication device according to the third rate and the second rate.

[0021] In combination with the first aspect, in some implementation manners of the first aspect, when the first communication device transmits the first data frame, the clock frequencies when the PCS of the first communication device encodes and scrambles the valid data blocks are n 1 and m 1 respectively; the first communication device adjusts the clock frequencies when encoding and scrambling the valid data blocks of the PCS of the first communication device according to the third rate and the second rate, including: the first communication device adjusts the clock frequencies when encoding and scrambling the valid data blocks of the PCS of the first communication device to n 2 and m 2 respectively according to the ratio of the third rate to the second rate, where the ratio of the n 1 and the n 2 is the same as the ratio of the third rate to the second rate, and the ratio of the m 1 and the m 2 is the same as the ratio of the third rate to the second rate.

[0022] In combination with the first aspect, in some implementation manners of the first aspect, the rate at which the first communication device transmits the valid data in the first data frame is a third rate, and the method further includes: the first communication device adjusts the clock frequency when encoding the data frame of the PCS of the first communication device according to the third rate and the first rate.

[0023] In combination with the first aspect, in some implementation manners of the first aspect, when the first communication device transmits the first data frame, the clock frequency when encoding the first data frame is h 1; The first communication device adjusts the clock frequency when encoding the PCS data frame of the first communication device according to the third rate and the first rate, including: the first communication device adjusts the clock frequency when encoding the PCS data frame of the first communication device to h according to the ratio of the third rate to the first rate 2 , where the h 1 and the h 2 have the same ratio as the ratio of the third rate to the first rate.

[0024] It should be understood that when there is a faulty pair in the above Ethernet cable, both the rate of data transmission at the MAC layer and the rate of effective data transmission in at least one pair of Ethernet cables in the new link change. Therefore, in order to adapt to the adjusted rate, it is necessary to adjust the clock frequencies of each module in the physical layer of the first communication device. Among them, the module for encoding and scrambling the effective data block receives the effective data from the MAC layer, so it is necessary to adjust the clock frequency based on the ratio of the second rate at the MAC layer to the above third rate. And the module for encoding the data frame is used to send the data frame to the Ethernet cable, so it is necessary to adjust the clock frequency based on the ratio of the first rate to the third rate.

[0025] In combination with the first aspect, in some implementation manners of the first aspect, the effective data block is a 64B / 65B code block.

[0026] Optionally, the effective data block may also be a 64B / 66B code block or a 32B / 33B code block, etc., or 128B / 129B code blocks, 256B / 257B code blocks, etc. that may appear in the future.

[0027] In combination with the first aspect, in some implementation manners of the first aspect, the way for the PCS of the first communication device to perform FEC encoding is low-density parity-check LDPC encoding.

[0028] Optionally, the way for the PCS to perform forward error correction FEC encoding may also be Reed-Solomon codes (RS codes) encoding, convolutional codes, polar codes, etc.

[0029] In combination with the first aspect, in some implementation manners of the first aspect, the first communication device is a network device or a terminal device.

[0030] For example, the terminal device may be a personal computer, a printer, a camera, etc., and the network device may be a switch, etc.

[0031] In combination with the first aspect, in some implementation manners of the first aspect, the first communication device and the second communication device perform network communication and data transmission through at least one pair of twisted pairs or optical fibers.

[0032] For example, one of a pair of optical fibers is used to transmit data signals, and the other is used to receive data signals; the two wires of a pair of twisted-pair wires respectively transmit differential signals with equal amplitudes and opposite phases.

[0033] In a second aspect, a data transmission method is provided, including: when a fourth rate is different from a fifth rate, a second communication device adjusts the number of valid data blocks obtained by decoding a data frame from a first number to a second number, where the fourth rate is the rate at which the second communication device receives valid data in the data frame, the fifth rate is the rate at which the media access control (MAC) layer of the second communication device receives data, and the first number is the number of valid data blocks obtained by the second communication device decoding a first data frame when the fourth rate and the fifth rate are the same; the second communication device receives a second data frame from a first communication device, and the second data frame includes the second number of valid data blocks; the second communication device decodes the second data frame to obtain the second number of valid data blocks.

[0034] It should be understood that the first communication device and the second communication device are connected through an Ethernet cable. Therefore, the value of the first rate is the same as the value of the fourth rate, and the value of the second rate is the same as the value of the fifth rate. Or rather, when the first rate is different from the second rate, the fourth rate is also different from the fifth rate. Furthermore, after the first communication device adjusts the number of valid data blocks in the transmitted data frame, the second communication device also needs to adjust the number of valid data blocks obtained by decoding the data frame, which is the second number. Finally, the second communication device can obtain the second number of valid data blocks in the second data frame by decoding the second data frame sent by the first communication device.

[0035] Correspondingly, the decoding process of the second communication device is opposite to the encoding process of the first communication device, including FEC decoding, separating valid data blocks, descrambling, and decoding valid data blocks, etc. What the second communication device adjusts is the number of valid data blocks obtained when separating valid data blocks.

[0036] The implementation manner of the second aspect is the decoding process corresponding to the implementation manner of the encoding in the first aspect. Its specific implementation manner and beneficial effects can refer to the description of the first aspect and will not be elaborated here.

[0037] In combination with the second aspect, in some implementations of the second aspect, the second communication device adjusts the number of valid data blocks obtained by decoding the data frame from the first number to the second number according to the fourth rate and the fifth rate, including: the second communication device adjusts the total number of bits of the valid data obtained by decoding the data frame from the third number to the fourth number according to the ratio of the fourth rate to the fifth rate, where the ratio of the third number to the fourth number is the same as the ratio of the fourth rate to the fifth rate, the third number is the total number of bits of the valid data blocks of the first number, and the fourth number is the total number of bits of the valid data blocks of the second number.

[0038] In combination with the second aspect, in some implementations of the second aspect, the second communication device adjusts the total number of bits of the valid data obtained by decoding the data frame from the third number to the fourth number according to the ratio of the fourth rate to the fifth rate, including: the second communication device adjusts the number of valid data blocks obtained by decoding the data frame from the first number to the second number according to the ratio of the fourth rate to the fifth rate, where the ratio of the first number to the second number is the same as the ratio of the third number to the fourth number.

[0039] In combination with the second aspect, in some implementations of the second aspect, the second communication device adjusts the number of valid data blocks obtained by decoding the data frame from the first number to the second number according to the fourth rate and the fifth rate, including: the second communication device adjusts the preset number of bits discarded by the PCS when decoding the data frame according to the fourth rate and the fifth rate, where the first data frame decoded by the PCS of the second communication device includes the first number of valid data blocks and the first preset number of bits to be discarded, the second data frame decoded by the PCS of the second communication device includes the second number of valid data blocks and the second preset number of bits to be discarded, and the sum of the bits of the first number of valid data blocks and the first preset number of bits is the same as the sum of the bits of the second number of valid data blocks and the second preset number of bits.

[0040] In combination with the second aspect, in some implementations of the second aspect, the rate at which the second communication device receives the valid data in the first data frame is the sixth rate, and the method further includes: the second communication device adjusts the clock frequency when the PCS of the second communication device decodes the data frame according to the sixth rate and the fourth rate.

[0041] In combination with the second aspect, in some implementations of the second aspect, when the second communication device receives the first data frame, the clock frequency at which the PCS of the second communication device decodes the first data frame is h 3; The second communication device adjusts the clock frequency when the second communication device decodes the PCS data frame according to the sixth rate and the fourth rate, including: the second communication device adjusts the clock frequency when the second communication device decodes the PCS data frame to h according to the ratio of the sixth rate and the fourth rate. 4 , where the h 3 and the h 4 have the same ratio as the ratio of the sixth rate and the fourth rate.

[0042] Combining with the second aspect, in some implementation manners of the second aspect, the rate at which the second communication device receives the valid data in the first data frame is the sixth rate, and the method further includes: the second communication device adjusts the clock frequency when the second communication device descrambles the PCS and decodes the valid data block according to the sixth rate and the fifth rate.

[0043] Combining with the second aspect, in some implementation manners of the second aspect, when the second communication device receives the first data frame, the clock frequencies for descrambling the PCS and decoding the valid data block in the first data frame are n 3 and m 3 respectively; the second communication device adjusts the clock frequency when the second communication device descrambles the PCS and decodes the valid data block according to the sixth rate and the fifth rate, including: the second communication device adjusts the clock frequency when the second communication device descrambles the PCS and decodes the valid data block to n 4 and m 4 , where the ratio of the n 3 and the n 4 is the same as the ratio of the sixth rate and the fifth rate, and the ratio of the m 3 and the m 4 is the same as the ratio of the sixth rate and the fifth rate.

[0044] Combining with the second aspect, in some implementation manners of the second aspect, the valid data block is a 64B / 65B code block.

[0045] Optionally, the valid data block may also be a 64B / 66B code block or a 32B / 33B code block, etc., or 128B / 129B code blocks, 256B / 257B code blocks, etc. that may appear in the future.

[0046] Combining with the second aspect, in some implementation manners of the second aspect, the way of performing FEC encoding by PCS is low density parity check LDPC encoding.

[0047] Optionally, the way for PCS to perform forward error correction (FEC) encoding can also be Reed-Solomon codes (RS codes) encoding, convolutional codes, Polar codes, etc.

[0048] Combined with the second aspect, in some implementation manners of the second aspect, the second communication device is a network device or a terminal device.

[0049] For example, the terminal device can be a personal computer, a printer, a camera, etc., and the network device can be a switch, etc.

[0050] Combined with the second aspect, in some implementation manners of the second aspect, the second communication device and the first communication device perform network communication and data transmission through at least a pair of twisted pairs or optical fibers.

[0051] For example, one of a pair of optical fibers is used to transmit data signals, and the other is used to receive data signals; the two wires of a pair of twisted pairs respectively transmit differential signals with equal amplitudes and opposite phases.

[0052] In a third aspect, a data transmission device is provided. The device is applied to the first communication device and includes: a transmission module, configured to: transmit a first data frame to the second communication device, where the first data frame includes a first number of valid data blocks; an adjustment module, configured to: in a case where the first rate is different from the second rate, according to the first rate and the second rate, adjust the number of valid data blocks in the transmitted data frame from the first number to a second number to obtain an adjusted second data frame, where the first data frame and the second data frame have the same length, where the first rate is the rate of the valid data in the data frame transmitted by the first communication device, and the second rate is the rate of data transmission by the media access control (MAC) layer of the first communication device; the transmission module is specifically configured to: the first communication device transmits the second data frame to the second communication device.

[0053] Combined with the third aspect, in some implementation manners of the third aspect, the adjustment module is specifically configured to: according to the ratio of the first rate to the second rate, adjust the total number of bit positions of the valid data in the transmitted data frame from a third number to a fourth number, where the ratio of the third number to the fourth number is the same as the ratio of the first rate to the second rate, the third number is the total number of bit positions of the first number of valid data blocks, and the fourth number is the total number of bit positions of the second number of valid data blocks.

[0054] In combination with the third aspect, in some implementation manners of the third aspect, the adjustment module is specifically configured to: the first communication device adjusts the number of valid data blocks in the transmitted data frame from the first number to the second number according to the ratio of the first rate to the second rate, where the ratio of the first number to the second number is the same as the ratio of the third number to the fourth number.

[0055] In combination with the third aspect, in some implementation manners of the third aspect, the adjustment module is specifically configured to: the first communication device adjusts the preset number of padding bits when the physical coding sublayer (PCS) encodes the data frame according to the first rate and the second rate, where the first data frame encoded by the PCS of the first communication device includes the first number of valid data blocks and the first preset number of padding bits, the second data frame encoded by the PCS of the first communication device includes the second number of valid data blocks and the second preset number of padding bits, and the sum of the bits of the first number of valid data blocks and the first preset number of padding bits is the same as the sum of the bits of the second number of valid data blocks and the second preset number of padding bits.

[0056] In combination with the third aspect, in some implementation manners of the third aspect, the rate of the valid data in the first data frame transmitted by the first communication device is the third rate, and the adjustment module is further configured to: adjust the clock frequencies when the PCS of the first communication device encodes and scrambles the valid data blocks according to the third rate and the second rate.

[0057] In combination with the third aspect, in some implementation manners of the third aspect, when the first communication device transmits the first data frame, the clock frequencies when the PCS of the first communication device encodes and scrambles the valid data blocks are n 1 and m 1 respectively; the adjustment module is specifically configured to: adjust the clock frequencies when the PCS of the first communication device encodes and scrambles the valid data blocks to n 2 and m 2 respectively according to the ratio of the third rate to the second rate, where the ratio of n 1 to n 2 is the same as the ratio of the third rate to the second rate, and the ratio of m 1 to m 2 is the same as the ratio of the third rate to the second rate.

[0058] In combination with the third aspect, in some implementation manners of the third aspect, the rate of the valid data in the first data frame transmitted by the first communication device is the third rate, and the adjustment module is further configured to: adjust the clock frequency when the PCS of the first communication device encodes the data frame according to the third rate and the first rate.

[0059] In combination with a third aspect, in some implementations of the third aspect, when the first communication device transmits the first data frame, the clock frequency during encoding of the first data frame is h 1 ; the first communication device adjusts the clock frequency when encoding the PCS-encoded data frame of the first communication device according to the third rate and the first rate, including: the first communication device adjusts the clock frequency when encoding the PCS-encoded data frame of the first communication device to h according to the ratio of the third rate to the first rate 2 , where the h 1 and the h 2 have the same ratio as the ratio of the third rate to the first rate.

[0060] A fourth aspect provides a data transmission device applied to a second communication device, including: an adjustment module, configured to: when the fourth rate is different from the fifth rate, adjust the number of valid data blocks obtained by decoding a data frame from a first number to a second number, where the fourth rate is the rate of valid data in the data frame received by the second communication device, the fifth rate is the rate of data received by the media access control (MAC) layer of the second communication device, and the first number is the number of valid data blocks obtained by the second communication device decoding a first data frame when the fourth rate is the same as the fifth rate; a receiving module, configured to: receive a second data frame from a first communication device, where the second data frame includes the second number of valid data blocks; a decoding module, configured to: decode the second data frame to obtain the second number of valid data blocks.

[0061] In combination with the fourth aspect, in some implementations of the fourth aspect, the adjustment module is specifically configured to: according to the ratio of the fourth rate to the fifth rate, adjust the total number of bits of the valid data obtained by decoding the data frame from a third number to a fourth number, where the ratio of the third number to the fourth number is the same as the ratio of the fourth rate to the fifth rate, the third number is the total number of bits of the valid data blocks of the first number, and the fourth number is the total number of bits of the valid data blocks of the second number.

[0062] In combination with the fourth aspect, in some implementations of the fourth aspect, the adjustment module is specifically configured to: according to the ratio of the fourth rate to the fifth rate, adjust the number of valid data blocks obtained by decoding the data frame from the first number to the second number, where the ratio of the first number to the second number is the same as the ratio of the third number to the fourth number.

[0063] In combination with the fourth aspect, in some implementations of the fourth aspect, the adjustment module is specifically configured to: adjust a preset number of discarded bits when the PCS decodes a data frame according to the fourth rate and the fifth rate, where the first data frame decoded by the PCS of the second communication device includes the first number of valid data blocks and the first preset number of bits to be discarded, the second data frame decoded by the PCS of the second communication device includes the second number of valid data blocks and the second preset number of bits to be discarded, and the sum of the bits of the first number of valid data blocks and the first preset number of bits is the same as the sum of the bits of the second number of valid data blocks and the second preset number of bits.

[0064] In combination with the fourth aspect, in some implementations of the fourth aspect, the rate at which the second communication device receives the valid data in the first data frame is the sixth rate, and the adjustment module is further configured to: adjust the clock frequency when the PCS of the second communication device decodes a data frame according to the sixth rate and the fourth rate.

[0065] In combination with the fourth aspect, in some implementations of the fourth aspect, when the second communication device receives the first data frame, the clock frequency at which the PCS of the second communication device decodes the first data frame is h 3 ; the adjustment module is specifically configured to: adjust the clock frequency when the PCS of the second communication device decodes a data frame to h according to the ratio of the sixth rate and the fourth rate 4 where the h 3 and the h 4 have the same ratio as the ratio of the sixth rate and the fourth rate.

[0066] In combination with the fourth aspect, in some implementations of the fourth aspect, the rate at which the second communication device receives the valid data in the first data frame is the sixth rate, and the adjustment module is further configured to: the second communication device adjusts the clock frequency when the PCS of the second communication device descrambles and decodes valid data blocks according to the sixth rate and the fifth rate.

[0067] In combination with the fourth aspect, in some implementations of the fourth aspect, when the second communication device receives the first data frame, the clock frequencies for descrambling and decoding the valid data blocks in the first data frame are n 3 and m 3 respectively; the adjustment module is specifically configured to: adjust the clock frequencies for descrambling and decoding the valid data blocks by the PCS of the second communication device to n 4 and m 4 according to the ratio of the sixth rate and the fifth rate, where the ratio of the n 3 and the n 4 is the same as the ratio of the sixth rate and the fifth rate, and the m3 and this m 4 The ratio is the same as the ratio of the sixth rate to the fifth rate.

[0068] In a fifth aspect, the present application provides a first communication device, including: a processor, a memory, and instructions stored on the memory and executable on the processor. When the instructions are executed, the first communication device is caused to perform the method in any possible implementation manner in the first aspect.

[0069] In a sixth aspect, the present application provides a second communication device, including: a processor, a memory, and instructions stored on the memory and executable on the processor. When the instructions are executed, the second communication device is caused to perform the method in any possible implementation manner in the second aspect.

[0070] In a seventh aspect, the present application provides a data transmission system, including a sending device and a receiving device. The sending device includes a module for performing the method in any possible implementation manner in the first aspect, and the receiving device includes a module for performing the method in any possible implementation manner in the second aspect.

[0071] In an eighth aspect, the present application provides a chip, including a processor, a memory, and a data interface. The processor reads instructions stored on the memory through the data interface, so that the chip performs the method in any possible implementation manner in the first aspect or the second aspect.

[0072] In a ninth aspect, the present application provides a computer program product, which includes: a computer program (which can also be referred to as code or instructions). When the computer program is executed, a computer is caused to perform the method in any possible implementation manner in the above-mentioned first aspect or the second aspect.

[0073] In a tenth aspect, the present application provides a computer-readable storage medium for storing computer program instructions. When the computer program instructions are executed on a computer, the computer is caused to perform the method in any possible implementation manner in the above-mentioned first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 is a system architecture diagram of an Ethernet provided by an embodiment of the present application.

[0075] Figure 2 is a schematic diagram of the seven-layer Open Systems Interconnection model provided by an embodiment of the present application.

[0076] Figure 3 is a schematic diagram of the encoding process of a physical coding sublayer provided by an embodiment of the present application.

[0077] Figure 4 It is a schematic diagram of a cable detection technology provided by an embodiment of the present application.

[0078] Figure 5 It is a schematic flowchart of a data transmission method provided by an embodiment of the present application.

[0079] Figure 6 It is a schematic flowchart of another data transmission method provided by an embodiment of the present application.

[0080] Figure 7 It is a flowchart of data encoding and decoding provided by an embodiment of the present application.

[0081] Figure 8 It is a schematic structural diagram of a data transmission device provided by an embodiment of the present application.

[0082] Figure 9 It is a schematic structural diagram of another data transmission device provided by an embodiment of the present application.

[0083] Figure 10 It is a schematic diagram of the hardware structure of a data transmission device provided by an embodiment of the present application. Detailed implementation manners

[0084] Next, the technical solutions in the present application will be described with reference to the accompanying drawings.

[0085] Ethernet is a computer local area network technology, which is defined by the IEEE 802.3 standard organized by the IEEE. The communication standard of Ethernet stipulates contents including the connection of the physical layer, electronic signals, and the medium access layer protocol, etc. Traditional Ethernet usually uses cables or optical fibers as transmission media. For example, Ethernet can establish a connection through the twisted pairs in the cable, or Ethernet can also establish a connection through the optical fibers in the optical cable.

[0086] Figure 1 Shows a system architecture diagram of an Ethernet in an embodiment of the present application. As Figure 1 shown, the system of this Ethernet includes a first communication device and a second communication device. Network communication and data transmission at a certain rate are achieved between the physical layer (PHY) chips of the first communication device and the PHY chips of the second communication device through four pairs of Ethernet cables, that is, Figure 1 each double-arrow straight line shown is used to indicate the full-duplex transmission of a pair of Ethernet cables. Each pair of Ethernet cables can be the above-mentioned each pair of twisted pairs or each pair of optical fibers. Among them, one of the optical fibers in a pair is used to send data signals, and the other is used to receive data signals; the two wires of a pair of twisted pairs respectively transmit differential signals with equal amplitudes and opposite phases, and the advantage is that the ability to resist external electromagnetic interference is relatively strong, improving the reliability of transmission and reception. For example,Figure 1 The communication standard of the Ethernet shown may be 1000BASE-T, 2.5GBASE-T, 5GBASE-T or 10GBASE-T defined by the IEEE802.3 standard. Or rather, Figure 1 the Ethernet shown may be an Ethernet that transmits 1 Gb / s, 2.5 Gb / s, 5 Gb / s and 10 Gb / s in full duplex over 4 pairs of twisted-pair cables.

[0087] It should be understood that the transmission rates of 1 Gb / s, 2.5 Gb / s, 5 Gb / s and 10 Gb / s of the above Ethernet are all the rates of the valid data in the data frame, rather than the transmission rate of the data frame in the Ethernet cable. For example, if the length of the data frame is 100 bit and the data frame actually carries 90 bit of valid data, and if the transmission rate of the data frame in the Ethernet cable is 1 Gb / s, then the transmission rate of the valid data in the data frame is 900 Mb / s. For the convenience of description, the "transmission rate" mentioned below refers to the transmission rate of the valid data, and the "data frame transmission rate" refers to the transmission rate of the data frame. The ratio of the "transmission rate" to the "data frame transmission rate" is the ratio of the length of the valid data in the data frame to the length of the data frame.

[0088] In the embodiments of the present application, the first communication device and the second communication device may be network devices such as switches. Or rather, Figure 1 the scenario shown is the interconnection between two network devices. Optionally, one of the first communication device and the second communication device may also be a network device such as a switch, and the other may be a terminal device such as a personal computer, a printer, a camera, etc., that is, Figure 1 the scenario shown is the interconnection between a network device and a terminal device. In some other embodiments of the present application, Figure 1 the scenario shown may also be the interconnection between two terminal devices, such as the interconnection between a personal computer and a camera.

[0089] Optionally, in some other embodiments of the present application, the system architecture of the Ethernet may further include more communication devices. Or rather, in the system architecture of the Ethernet, more than 2 communication devices may be included to achieve interconnection. For example, the PHY chip of the first communication device is connected to the second communication device through two of the four pairs of Ethernet cables, and is connected to the third communication device through the remaining two pairs of Ethernet cables. Similarly, the PHY chips of the first communication device and the fourth communication device are interconnected with the second communication device and the third communication device through Ethernet cables, and finally a scenario of interconnection of four communication devices is formed.

[0090] Taking the communication standards of the Ethernet as 2.5GBASE-T and 5GBASE-T as an example, Figure 1The transmission rate of each pair of Ethernet cables or each pair of twisted - pair cables shown is 625 Mb / s and 1.25 Gb / s respectively. Thus, the transmission rate of four pairs of twisted - pair cables is 2.5 Gb / s and 5 Gb / s. Among them, data in Ethernet is transmitted in one - dimensional PAM16 symbols. Each PAM16 symbol carries 4 bits of information, and the effective information is 3.125 bits. Correspondingly, the data - frame transmission rates of 2.5GBASE - T and 5GBASE - T are 3.2 Gb / s (2.5 * 4 / 3.125) and 6.4 Gb / s respectively. When the communication standard of Ethernet is 2.5GBASE - T, each pair of twisted - pair cables transmits at a baud rate of 200 M Bd; when the communication standard of Ethernet is 5GBASE - T, each pair of twisted - pair cables transmits at a baud rate of 400 M Bd. The content described in this paragraph, as well as the specific encoding and transmission processes, will be introduced below and will not be elaborated here.

[0091] It should be understood that pulse - amplitude modulation (PAM) is a modulation method in which the amplitude of a pulsed carrier signal changes with an analog signal (which can also be called the original signal). The baud rate is used to represent the modulation rate of the pulsed carrier signal carried on the original signal. It can be understood as the number of times the baud modulation state changes per unit time, or in other words, the number of PAM symbol elements transmitted per unit time.

[0092] For ease of understanding, the following combines Figure 2 and Figure 3 to introduce the encoding process of Ethernet involved in the embodiments of this application.

[0093] Figure 2 shows a schematic structural diagram of the Open System Interconnect (OSI) seven - layer model. As Figure 2 shown, OSI divides the network into seven layers from bottom to top, namely the physical layer, data - link layer, network layer, transport layer, session layer, presentation layer, and application layer. Among them, the four layers from the physical layer to the transport layer are responsible for the data transmission of the underlying physical network, and the three layers from the session layer to the application layer are responsible for the data transmission between hosts.

[0094] Furthermore, as Figure 2As shown, the data link layer may include a logic link control (LLC) layer, a media access control (MAC) layer, etc., and the physical layer may include a reconciliation sublayer (RS), a physical coding sub-layer (PCS), a physical media attachment (PMA) layer, a physical media dependent (PMD) layer, etc.

[0095] The MAC layer is responsible for assembling the "0" and "1" bit streams of the physical layer into frames and performing error checking through the error checking information at the end of the frame. The MAC sub-layer adds the physical address of the destination computer to the data frame. When this data frame reaches the MAC layer at the receiving end, it checks whether the address matches its own address, or checks whether the data frame needs to be forwarded according to the forwarding table it stores. If they match, it is sent to the upper layer; if the address in the frame does not match its own address, it checks whether the data frame needs to be forwarded according to the forwarding table it stores. In the embodiments of the present application, the MAC layer is used to transmit valid data to the physical layer.

[0096] The RS and the 10 Gigabit Media Independent Interface (XGMII) are between the MAC layer and the PCS. The RS processes the serial / parallel and parallel / serial conversions of the MAC layer serial data stream and the XGMII parallel data stream, as well as link status monitoring. The XGMII interfaces with the MAC layer upward and provides transmission capabilities through a 32-bit wide bus. In some other embodiments of the present application, the interface between the MAC layer and the physical layer may also be other media independent interfaces (MII) such as the 40 Gigabit Media Independent Interface (XLGMII) or the 100 Gigabit Media Independent Interface (CGMII). The present application does not make any limitations in this regard.

[0097] The PCS mainly completes the encoding and decoding of the physical layer. For example, in the transmission direction, it encodes the XGMII signal and then sends the encoded signal to the PMA layer; in the reception direction, it decodes the signal received from the PMA into the corresponding XGMII signal. The PCS can have various encoding methods, such as 8B / 10B, 64B / 65B, or 64B / 66B, etc. The specific encoding process depends on the Ethernet communication standard. The PCS layer can also perform forward error correction (FEC) encoding, mainly to implement the error correction process of bit errors.

[0098] It should be understood that FEC is an error control method, which means that the signal is pre-encoded according to a certain algorithm before being sent into the transmission channel, adding redundant codes with the characteristics of the signal itself, and decoding the received signal according to the corresponding algorithm at the receiving end, so as to find out the error codes generated during the transmission process and correct them. The FEC technology can reduce the bit error rate and effectively improve the performance of the system. In some embodiments of the present application, the FEC encoding can be Reed-Solomon codes (RS codes) encoding, convolutional codes, low-density parity-check codes (LDPC) codes, Polar codes, etc.

[0099] In the Ethernet communication standards such as 2.5GBASE-T, 5GBASE-T, and 10GBASE-T in the embodiments of the present application, the PCS encodes the 64-bit valid data from the XGMII by 64B / 65B to form 64B / 65B data blocks, performs low-density parity-check codes (LDPC) encoding by collecting multiple 64B / 65B data blocks to obtain a 2048-bit LDPC frame, and then maps it to 512 Gray code PAM16 symbols, and then transmits it to the 4-lane PMA layer.

[0100] Figure 3 It shows the architecture and data encoding process of a PCS in the embodiments of the present application. Among them, the data will pass through modules such as 64B / 65B encoding, Scrambler, LDPC encoder, random number replacement, and PAM16 mapping in the PCS.

[0101] The PCS receives data from the MAC layer through the XGMII. Among them, the XGMII has a bit width of 32 bits, and a total of 64 bits of 2 XGMIIs form a data block.

[0102] The 64B / 65B encoding module appends 1 bit as a control word Data / Ctrl header at the very front of each received 64-bit data block to indicate whether the data block is a data block or a control block (where header-0 represents data and header-1 represents control), thus forming a 65-bit data block.

[0103] The purpose of the scrambling module is to reduce consecutive 0s or 1s in the data block and make the spectrum of the scrambled signal more suitable for baseband transmission, ultimately obtaining the scrambled 64B / 65B data block. For ease of description, the scrambled 65-bit data block will be referred to as the valid data block hereinafter to indicate that the data block contains the valid information sent by the MAC layer.

[0104] Exemplarily, as Figure 3 shown, taking 2.5GBASE-T and 5GBASE-T as examples, the PCS collects 25 64B / 65B data blocks to obtain a sequence of data blocks or a group of data blocks. A 1-bit channel attachment code is added at the very front of the group of data blocks, and 97 0s or 97 random numbers are appended at the end of the group of data blocks, ultimately forming a 1723-bit data frame. This 1723-bit data frame generates a 2048-bit LDPC data frame through the LDPC(1723,2048) encoder, where a total of 325 LDPC check bits are appended to protect the integrity of each 1723-bit data frame. Optionally, to eliminate long consecutive 0s, the random number replacement module replaces the above 97 0s with random numbers.

[0105] Finally, the PAM16 mapping module maps the encoded LDPC frame to PAM16 according to the Gray mapping rule, obtaining 512 PAM16 symbols. Each PAM16 symbol can represent 4-bit information. As mentioned above, each LDPC frame totals 2048 bits, and the valid data is 25 * 64 bits in the 25 64B / 65B data blocks collected by the PCS. Therefore, the valid information carried by each PAM16 symbol is 3.125 bits (25 * 64 / 512 = 3.125). So through the LDPC encoder and the PAM16 mapping module, 2.5GBASE-T and 5GBASE-T transmit at baud rates of 200M (2500 / (3.125 * 4)) Bd and 400M (5000 / (3.125 * 4)) Bd on each pair of twisted pairs.

[0106] Another exemplarily, the PCS encoding process defined in 10GBASE-T is the same as Figure 3Slightly different, where the PCS collects 50 64B / 65B data blocks to obtain a data block group, adds a channel attachment code at the very front of the data block group, and appends an 8-bit cyclic redundancy check (CRC) at the back of the data block group, finally forming a 3259-bit data frame. Among them, the data frame includes 3*512 bits transmitted in an unprotected manner, 1723 bits of data transmitted in a protected manner by LDPC(1723,2048), and 325 bits of LDPC check bits, totaling 7*512 bits.

[0107] Finally, a total of 512 128DSQ encodings are required (3*512 + 4*512 = 512 7-bit tag frames, and there are a total of 128 encodings corresponding to 7 bits), that is, 1024 PAM16 (one 128DSQ is formed by two PAM16 back to back) symbol matrices. Finally, it is equivalent that each PAM16 symbol carries 3.125 bits of information (64*50 / 1024 = 3.125), and the baud rate on the twisted pair is 800M (10000 / (3.125*4)) Bd.

[0108] The PMA layer is mainly used to implement the connection of the PCS to multiple physical media, mainly including: adapting the PCS lane to the PMD lane, changing the number of PMD lanes, data clock transformation, etc. The PMD layer is mainly used to define the physical interface parameters for connecting the transmission medium. For example, the optical signal wavelength of the optical interface, the type of connected optical fiber, the transmission distance, etc. The medium dependent interface (MDI) interfaces downward to the underlying transmission medium, that is, the above-mentioned cable or optical cable.

[0109] The PMA mainly performs five main functions: PHY Control, PMA Transmit, PMA Receive, Link Monitor, and Clock Recovery. For example, the PMA Transmit function includes four transmitters that generate pulse amplitude modulation signals for four pairs of wires, which are then transmitted to the MDI through Tomlinson-Harashima precoding (THP), a transmit filter, a digital-to-analog converter (DAC), and an analog filter. The four transmitters refer to the same clock TX_TCLK and need to meet the same electrical performance indicators. When the physical layer is in Master mode, TX_TCLK refers to the local clock; when the physical layer is in Slave mode, TX_TCLK refers to the recovered clock. The PMA Receive function includes four receivers that recover the pulse amplitude modulation signals of the four pairs of wires. To achieve good performance, the Receive function performs equalization, echo interference suppression, crosstalk suppression, etc. on the received signals. In addition, pair swaps and crossovers are detected and processed through the training sequence. The PHY Control function defines functions such as Training, transmit control, Power Backoff (PBO), signal-to-interference plus noise ratio (SNR) detection, counting, and fast retransmission.

[0110] The following combines the attached Figures 4 to 7 to introduce the technical solution of this application.

[0111] In the actual application of Ethernet, due to reasons such as construction dragging, loose crimping of cable connectors, and aging of connector crimping tabs, Ethernet cables such as cables or optical fibers are prone to failures, which can easily cause at least one pair of Ethernet cables in the Ethernet to be unable to communicate. At present, since the above-mentioned standards of 1000BASE-T, 2.5GBASE-T, 5GBASE-T, and 10GBASE-T all require four pairs of twisted pairs to achieve network communication, if the above-mentioned line pair failure occurs, it will self-negotiate to a mode that supports 10BASE-T and 100BASE-TX according to the standard, and the transmission rate will drop significantly to 10 Mb / s or 100 Mb / s, thus directly affecting the link bandwidth and user experience.

[0112] In the embodiments of the present application, the current cable detection method can be adopted to determine the Ethernet cable in a normal working state. For example, virtual cable test (VCT) technology can be selected for cable detection, and time domain reflectometry (TDR) technology is used to detect whether the cable state is faulty or normal. The TDR detection principle is similar to that of radar. The working mode is to actively send a pulse signal to the cable and detect the reflection result of the sent pulse signal to detect whether the cable fails. When the sent pulse signal passes through the end of the cable or the fault point of the cable, part or all of the pulse energy will be reflected back to the original sending source. The VCT technology obtains the time when the signal reaches the fault point or returns according to the transmission of the measurement pulse signal in the wire, and then converts the corresponding time into a distance value. Through the VCT technology, the cable state, whether the fault distance is polarity-swapped, insertion signal attenuation, return signal attenuation, etc. can be detected.

[0113] Figure 4 The schematic diagram of the VCT technology is shown. As Figure 4 shown, interface #1 of communication device A is connected to interface #2 of communication device B through a cable, and there is a fault point between the cables. After configuring VCT detection on interface #1, the system will generate a pulse signal, and after reaching the fault point, part of the energy is reflected back. Assuming that the length from network device A to the fault point is L, the time interval between sending the pulse and receiving the reflected pulse is T, and the speed of the signal propagating in the cable is V, the formula (1) for calculating the length of the fault point from interface #1 is as follows:

[0114] L = (V×T) / 2 (1)

[0115] When L is less than the total length of the cable, it indicates that there is a fault point in the cable.

[0116] According to the PCS and PMA layer analysis as Figure 2 and Figure 3 shown, theoretically, under the communication standards of 2.5GBASE-T and 5GBASE-T, the Ethernet cable in a normal working state can still maintain a high transmission rate. For example, if two pairs of the four pairs of Ethernet cables are damaged, the other two pairs of Ethernet cables in a normal working state can still achieve a transmission rate of 1.25 Gb / s or 2.5 Gb / s. At this time, only the PMA layer needs to retain the two pairs of cables in a normal working state and work according to the modulation format and baud rate of the normal mode. Keeping the modulation format unchanged can result in small configuration changes to the PMA layer and can also maintain a high communication rate. The reason for keeping the baud rate unchanged is that the baud rate is related to the equalization coefficient of the line channel. If adjusted, the equalization coefficient of the line channel needs to be retrained, which will bring a large rate switching delay.

[0117] However, in the specific implementation, if the transmission rate of the four pairs of Ethernet cables is 1.25 Gb / s, the transmission rate of the XGMII between the PCS and the MAC layer is preferably also 1.25 Gb / s, so that the transmission rates at both ends of the physical layer are exactly equal. However, since the rate of the MAC layer is not particularly flexible and not every MAC rate can be supported. For example, the optional MAC rates can only be 1 Gb / s, 2.5 Gb / s, 5 Gb / s, etc. Then, when the transmission rate of the Ethernet cable is 1.25 Gb / s, only the closest 1 Gb / s can be selected as the transmission rate of the MAC layer. Since the operating rate of the MAC layer is only 1 Gb / s, there is a redundant bandwidth of 0.25 Gb / s in the physical layer.

[0118] To solve the problem of the mismatch between the MAC layer rate and the Ethernet cable transmission rate, the Figure 5 embodiment of the present application Figure 1 shows a data transmission method 500, where the method 500 includes steps 510 to 530 and can be applied to

[0119] the first communication device shown in Figure 1 or the sending device in the Ethernet system. Through the number of valid data blocks in the data frame transmitted by the communication device, the method 500 can maintain a relatively high total transmission rate of the Ethernet even when there are some faulty line pairs in the Ethernet cable, and the transmission rate of the valid data can adapt to a specific MAC rate, with the least configuration change in the PMA layer, low hardware implementation complexity, and small delay.

[0120] Step 510: The first communication device transmits a first data frame to the second communication device, and the first data frame includes a first number of valid data blocks.

[0121] Among them, the data transmission scenario between the first communication device and the second communication device can be Figure 1 the Ethernet scenario shown in Figure 1For example, step 510 is that the first communication device performs data transmission or network communication with the second communication device through the four pairs of Ethernet cables. For example, when the Ethernet communication standard is 2.5GBASE-T, the transmission rate of the effective data of the first data frame is 2.5Gb / s, and the data frame transmission rate of the first data frame is 3.2Gb / s. When the Ethernet communication standard is 5GBASE-T, the transmission rate of the effective data of the first data frame is 5Gb / s, and the data frame transmission rate of the first data frame is 6.4Gb / s.

[0122] It should be understood that Figure 1 This is just an example. In the embodiment of the present application, the number of Ethernet cables in the first Ethernet link may also be any value greater than or equal to 2, such as 8 pairs, 16 pairs, etc.

[0123] Step 520: When the first rate is different from the second rate, the first communication device adjusts the number of valid data in the transmitted data frame from the first number to the second number according to the first rate and the second rate.

[0124] The first rate is the rate at which the first communication device transmits valid data in a data frame, and the second rate is the rate at which the media access control MAC layer of the first communication device transmits data. The situation where the first rate is different from the second rate may occur when a partial fault line pair appears in the Ethernet cable, or when only one pair of fault lines is selected. Figure 1 When some of the multiple pairs of Ethernet cables are shown. Exemplarily, when the Ethernet communication standard is 2.5GBASE-T, the rate at which the four twisted pairs between the communication devices transmit the valid data in the first data frame is 2.5Gb / s. If one of the four twisted pairs fails, the other three twisted pairs in normal working condition can still achieve a transmission rate of 1.875Gb / s (2.5*3 / 4), that is, the first rate can be 1.875Gb / s. However, since the first rate of data transmission at the MAC layer of the communication device is not particularly flexible, not every MAC layer rate can be supported. For example, the optional first rate of the MAC layer can only be 1Gb / s, 2.5Gb / s, 5Gb / s, etc. When the first rate is 1.875Gb / s, only the closest second rate of 1Gb / s can be selected. At this time, there will be a situation where the first rate is different from the second rate.

[0125] The second rate is not greater than the first rate. For example, when the first rate is 1.25 Gb / s, the second rate can be selected as 1 Gb / s, in which case the second rate is less than the first rate; when the first rate is 2.5 Gb / s, the second rate can be selected as 2.5 Gb / s, in which case the second rate is the same as the first rate.

[0126] At present, the optional second rate can be standard rates such as 1 Gb / s, 2.5 Gb / s, 5 Gb / s, etc. In some other embodiments of the present application, the flexible adjustment of the MAC layer rate can be achieved through Flexible Ethernet (FlexE) technology. For example, when the second Ethernet link in step 520 is 3 pairs out of 4 pairs of Ethernet cables, the MAC rate can be adjusted to 1.5 Gb / s through FlexE technology, thereby making the optional second rate more. The above 1.5 Gb / s is only an example, and the present application does not make any limitation on the MAC rate flexibly adjusted by FlexE technology.

[0127] Taking Figure 3 the PCS-encoded data frame process shown as an example, PCS encodes the data frame through the LDPC method, and the valid data block in step 520 is Figure 3 the 64B / 65B code block in. In step 520, the PCS of the first communication device can adjust the number of valid data blocks collected when encoding the data frame. For example, it can be adjusted to 20 64B / 65B code blocks, so that the amount of valid data in the data frame is reduced, and thus the first rate of data transmission over the Ethernet cable can be reduced to the same as the second rate, or in other words, the first rate can be adapted to the second rate.

[0128] In the embodiments of the present application, the implementation manner of step 520 can be to adjust the preset number of padding bit positions when the PCS of the first communication device performs FEC encoding on the data frame. For example, taking Figure 3 the encoding process shown as an example, the original preset number of padding bit positions when encoding the data frame is 97 0s or 97 random numbers and 1 channel additional code, or in other words, 98 bit positions are filled once when collecting 25 valid data blocks, and then the above first data frame is obtained through LDPC encoding. In the embodiments of the present application, the preset number of padding bit positions can be modified to 422 0s (97+(25 - 20)*65) or 422 random numbers and 1 channel additional code, or in other words, 423 bit positions are filled once when collecting 20 valid data blocks, and then the above second data frame is obtained through LDPC encoding.

[0129] It should be noted that the valid data block can be Figure 3 the 64B / 65B data block shown, or it can also be 128B / 129B data blocks, 256B / 257B data blocks, etc. that may appear in the future. The present application does not make any limitation on this. The FEC encoding method of PCS can be Figure 3 the LDPC encoding shown, or it can also be the reed-solomon codes (RScodes) encoding, convolutional code, polar code, etc. mentioned above.

[0130] Step 530: The first communication device transmits the second data frame to the second communication device.

[0131] Specifically, the data frame transmission rate of the second data frame remains unchanged compared with that before adjustment. However, since the length of the valid data in the second data frame is less than the length of the valid data in the first data frame, the rate of transmitting valid data per pair of Ethernet cables can be reduced, so that the above first rate can adapt to the second rate of the MAC layer for transmitting data.

[0132] Finally, the first communication device transmits the adjusted data frame to the second communication device through Figure 3 the PAM mapping module shown. Correspondingly, when the second communication device receives the adjusted data frame, it also needs to correspondingly adjust the data decoding process.

[0133] Method 500 can enable the rate of Ethernet cable data transmission to adapt to the MAC layer rate of the communication device, and keep the modulation format and baud rate of the normal wire pairs unchanged to achieve the same data frame transmission rate per pair of Ethernet cables. Moreover, the modification to the PMA layer is very small, the hardware implementation complexity is low, and the delay is small.

[0134] Correspondingly, Figure 6 Embodiment of the present application Figure 1 shows another data transmission method 600, where method 600 includes steps 610 to 630 and can be applied to Figure 1 the second communication device shown, or the receiving device in the Ethernet system. Method 600 can be applied to

[0135] Step 610: When the fourth rate is different from the fifth rate, the second communication device adjusts the number of valid data blocks obtained by decoding the data frame from the first number to the second number.

[0136] Wherein, the fourth rate is the rate of the valid data in the data frame received by the second communication device, the fifth rate is the rate of the media access control (MAC) layer of the second communication device for receiving data, and the first number is the number of valid data blocks obtained by the second communication device decoding the first data frame when the fourth rate is the same as the fifth rate.

[0137] It should be understood that the first communication device and the second communication device are connected by an Ethernet cable. Therefore, the value of the first rate is the same as the value of the fourth rate, and the value of the second rate is the same as the value of the fifth rate. Or rather, in the case where the first rate is different from the second rate, the fourth rate is also different from the fifth rate. Furthermore, after the first communication device adjusts the number of valid data blocks in the transmitted data frame, the second communication device also needs to adjust the number of valid data blocks obtained by decoding the data frame in order to obtain the second number of valid data blocks in the second data frame.

[0138] Step 620: The second communication device receives the second data frame from the first communication device.

[0139] Step 620 corresponds to the first communication device transmitting the second data frame to the second communication device in step 530.

[0140] Step 630: The second communication device decodes the second data frame to obtain the second number of valid data blocks.

[0141] Correspondingly, the decoding process of the second communication device is the reverse of the encoding process of the first communication device, including FEC decoding, separating valid data blocks, descrambling, and decoding valid data blocks, etc. What step 610 adjusts is the number of valid data blocks obtained when separating valid data blocks.

[0142] The implementation manner of method 600 is the decoding process corresponding to the implementation manner of the encoding of method 500. Its specific implementation manner and beneficial effects can refer to the description of method 500 and will not be elaborated here.

[0143] The implementation processes of method 500 and method 600 will be specifically introduced below in combination with embodiments. Taking the Ethernet communication standard of 2.5GBASE-T as an example to introduce the embodiments:

[0144] The system architecture of the Ethernet is as Figure 1 shown. When all four pairs of Ethernet cables are working properly, the first communication device transmits the first data frame to the second communication device, and the transmission rate of the valid data in the first data frame is 2.5 Gb / s. The PCS encoding process of the first communication device is as Figure 3 shown.

[0145] If only 2 pairs of the Ethernet cables in the normal working state are determined through the above VCT technology, a new Ethernet link can be determined from the Ethernet cables in the normal working state, and the new Ethernet link includes the 2 pairs of Ethernet cables in the normal working state. At this time, the first rate of the first communication device is 1.25 Gb / s (2.5 * 2 / 4). Correspondingly, the data frame transmission rate of the 2 pairs of Ethernet cables is 1.6 Gb / s. Optionally, the MAC layer rates or the second rates not greater than the first rate are 100 Mb / s and 1 Gb / s. Therefore, the first communication device can select 1 Gb / s, which is closest to the first rate, as the second rate, that is, the second rate at which the first communication device transmits data at the MAC layer is 1 Gb / s.

[0146] According to the above, since the second rate of 1 Gb / s at the MAC layer is different from the first rate of 1.25 Gb / s, in step 520, the modulation format and baud rate of the 2 pairs of Ethernet cables in the second Ethernet link are kept unchanged, and by adjusting the number of valid data blocks in the data frame, the transmission rate of the valid data of the Ethernet cable can be adapted to the rate of the MAC layer and the Ethernet link still maintains a high total transmission rate.

[0147] In step 520, the first communication device can adjust the number of valid data blocks in the data frame transmitted by the first communication device according to the ratio of the first rate and the second rate. Specifically, the first communication device can adjust the number of valid data blocks collected when the PCS of the first communication device performs FEC encoding on the data frame, that is Figure 3 the number of 64B / 65B data blocks collected when the PCS shown performs LDPC encoding on the data frame. When the Ethernet communication standard is 2.5GBASE-T, the adjustment basis is the following formulas (2) and (3):

[0148] n × 65 + x = m × 1723 (2)

[0149] (n × 65) / (25 × 65) = m × V 2 / V 1 (3)

[0150] where n, x, and m are all positive integers. n is the number of 64B / 65B data blocks after adjustment, x is the sum of the filled channel additional codes and 0 bits or random numbers, and the total length of their addition should be a multiple of 1723. m is the number of LDPC codewords, which can be used for LDPC(1723, 2048) encoding. (n × 65) is the number of bits of valid data in the second data frame after adjustment, and (25 × 65) is the number of bits of valid data in the first data frame before adjustment. V 1 is the first rate, V 2is the second rate. Substituting the above cases where the second rate is 1.25 Gb / s and the third rate is 1 Gb / s into the above formula, we can get that n is 20, x is 423, and m is 1. That is, the number of valid data blocks in the data frame transmitted by the first communication device is adjusted from Figure 3 the 25 shown in the figure to 20, or in other words, the number of 64B / 65B data blocks collected when encoding the LPDC data frame is 20.

[0151] The basis for determining the number of adjusted valid data blocks according to the ratio of the first rate and the second rate lies in formula (4):

[0152] S = V / (N × a) (4)

[0153] Where S is the baud rate of each pair of Ethernet cables, V is the total transmission rate of the Ethernet cables, N is the amount of valid information carried by each PAM symbol, and a is the number of Ethernet cables in the Ethernet link. For example, when the Ethernet communication standard is 2.5GBASE-T, V is 2.5 Gb / s, N is 3.125 (25 * 64 / 512), and the value of a is 4. Therefore, when the Ethernet communication standard is 2.5GBASE-T, according to the formula, the baud rate of each pair of Ethernet cables is 200 M Bd.

[0154] In the case where only 2 pairs of Ethernet cables are available as mentioned above, the transmission rate of the MAC layer or the second rate is 1 Gb / s. Since the baud rate remains unchanged and the rate of transmitting valid data and the number of Ethernet cables change, the amount of valid information carried by each PAM symbol changes. Substituting S = 200 M Bd, a = 2, and V = 1 Gb / s into the formula, we can get that N is 2.5 bit / symbol, that is, the valid information carried by each symbol is reduced to 2.5 bit.

[0155] Also, since the number of PAM16 symbols in the LDPC encoding process is finally 512, the valid data is 512 * 2.5 = 20 * 64 bit. Therefore, when the number of 64B / 65B data blocks collected by the PCS when encoding the LDPC data frame is 20, the transmission rate of transmitting valid data by 2 pairs of Ethernet cables can adapt to the second rate of the MAC layer, which is 1 Gb / s. Or in other words, the first rate drops from 1.25 Gb / s to the same as the second rate of 1 Gb / s. According to formula (4), the ratio of the second rate and the first rate is the same as the ratio of N before and after adjustment. And since the number of PAM symbols remains unchanged during the encoding process, the ratio of N before and after adjustment is the ratio of the length of the valid data. Furthermore, the ratio of the second rate and the first rate is the same as the ratio of the length of the valid data before and after adjustment and the ratio of the number of valid data blocks.

[0156] According to what is said above, since the PCS only collects 20 64B / 65B data blocks, the PCS replaces the reduced 5 64B / 65B data blocks after adjustment with 0s or random numbers. Or rather, compared with the original, 97 more 0s or random numbers are added, and the PCS newly adds 325 ((25 - 20) * 65) 0s or random numbers, so as to keep the original LDPC encoding process unchanged and enable the transmission rate of the data frame to still be maintained at 1.6 Gb / s. It is realized that in the process of Ethernet data transmission, the transmission rate of the effective data can be adapted to the third rate of the MAC layer, and the Ethernet cable can still maintain the original high data frame transmission rate.

[0157] In the embodiment of the present application, for Figure 3 the PCS encoding process shown, the specific way to adjust the number of 64B / 65B data blocks can be to adjust the preset number of filling bit positions when LDPC-encoding the data frame. For example, when 4 pairs of Ethernet cables are working properly, 98 bit positions (97 bits of 0 and 1 bit of channel additional code) are filled when the PCS collects 25 64B / 65B data blocks, and then the LDPC check bit is filled through LDPC encoding to obtain a first data frame; in the case where only 2 pairs of Ethernet cables are working properly as described above, 423 bit positions (422 bits of 0 and 1 bit of channel additional code) are filled when the PCS collects 20 64B / 65B data blocks, and then the LDPC check bit is filled through LDPC encoding to obtain a second data frame. To ensure the DC balance of the transmitted data, the 422 bits of 0 can also be directly replaced with 422 bits of random numbers.

[0158] In addition, for ease of description, the rate at which the original four pairs of Ethernet cables transmit valid data is referred to as the third rate (2.5 Gb / s in this embodiment). Since the transmission rate of the Ethernet link changes from the third rate to the first rate and the transmission rate of the MAC layer changes from the third rate to the second rate, it is necessary to adjust the clock frequency of the modules when the PCS performs LDPC encoding. First, the 64B / 65B encoding process and scrambling process of the PCS layer are performed before adjusting the number of valid data blocks. Therefore, the clock frequencies of the 64B / 65B encoding module and the scrambling module need to be adjusted based on the ratio of the third rate to the second rate. In the case of the above embodiment, the clock frequencies of the 64B / 65B encoding module and the scrambling module are adjusted to 2 / 5 of the original (1 Gb / s: 2.5 Gb / s). Second, the LDPC encoding, random number replacement, PAM16 mapping, etc. processes of the PCS layer are performed after adjusting the number of valid data blocks. Therefore, the clock frequencies of the above modules need to be adjusted based on the ratio of the third rate to the first rate. In the case of the above embodiment, the clock frequencies of the LDPC encoding, random number replacement, PAM16 mapping, etc. modules are adjusted to 1 / 2 of the original (1.25 Gb / s: 2.5 Gb / s).

[0159] Correspondingly, the second communication device needs to simultaneously adjust the decoding process, so that when receiving the adjusted second data frame sent by the first communication device, it can successfully separate the second number of valid data blocks in the second data frame. Figure 7 A schematic flowchart showing the encoding and decoding of data is shown. As Figure 7 shown, the encoding process includes processes such as 64B / 65B encoding, scrambling, filling bit positions, and LDPC encoding. The corresponding decoding process includes LDPC decoding, deleting bit positions, descrambling, and 64B / 65B decoding processes. Among them, the number of valid data blocks separated from the data frame becomes 20, and the number of deleted bit positions is modified from the original 98 bits to Figure 6 the 423 bits shown, and finally 20 64B / 65B data blocks are obtained.

[0160] It should be noted that the first communication device and the second communication device are connected by Ethernet cables. Therefore, the first rate of the valid data in the data frame transmitted by the first communication device is the same as the fourth rate of the valid data in the data frame received by the second communication device, and the second rate of the data transmitted by the MAC layer of the first communication device is the same as the fifth rate of the data transmitted by the MAC layer of the second communication device. The second communication device adjusts the number of valid data blocks obtained after decoding the data frame based on the fourth rate and the fifth rate. The specific adjustment process is similar to the adjustment process of the first communication device above and will not be elaborated here.

[0161] Correspondingly, the clock frequencies of modules such as LDPC decoding, bit deletion, descrambling, and 64B / 65B decoding in the second communication device also need to be adjusted according to the above-mentioned fourth rate, fifth rate, and the sixth rate when the second communication device receives the first data frame. The adjustment process is similar to that of the first communication device in adjusting the clock frequency, and will not be elaborated herein.

[0162] Exemplarily, the above example introduced the case where only 2 pairs of the 4 pairs of Ethernet cables are in normal working condition. Now, the case where 3 pairs of the 4 pairs of Ethernet cables are in normal working condition will be introduced. The specific encoding process is as described in the above example and will not be elaborated herein. At this time, the transmission rate of the 3 pairs of Ethernet cables, or the first rate, is 1.875 Gb / s.

[0163] Optionally, if the only optional second rates at the MAC layer are still 100 Mb / s and 1 Gb / s, the first communication device can select 2 pairs out of the 3 pairs of Ethernet cables for data transmission, which is the same as the situation in the above example. The reason is that if the second rate at the MAC layer is still selected as 1 Gb / s, selecting 3 pairs of Ethernet cables has the same effect as only selecting 2 pairs of Ethernet cables. Only selecting 2 pairs of Ethernet cables can also save the resources of the Ethernet link and reduce the waste of Ethernet cables.

[0164] Optionally, if the optional rates at the MAC layer include other rates flexibly adjusted by FlexE, such as 1.5 Gb / s, the first communication device can select the 3 pairs of Ethernet cables as the new Ethernet link. At this time, the second rate is 1.5 Gb / s and the first rate is 1.875 Gb / s. According to formulas (2) and (3), the value of n can be 20, the value of x can be 423, and the value of m can be 1. Furthermore, the number of valid data blocks in the data frame transmitted by the first communication device can be adjusted to 20, or in other words, the number of 64B / 65B data blocks collected when the PCS performs LDPC encoding on the data frame can be adjusted to 20, and the number of padding bits can be adjusted to 423 bits. The encoding process and the process of adjusting the clock frequency are the same as those above and will not be elaborated herein.

[0165] Exemplarily, if only 1 pair of Ethernet cables out of 4 pairs of Ethernet cables are in normal working condition, the first rate is 0.625 Gb / s. If the optional MAC rate is only 0.1 Gb / s, the second rate can be selected as 0.1 Gb / s. According to formulas (2) and (3), the value of n can be 4, the value of x can be 1463, and the value of m can be 1. Furthermore, the number of valid data blocks in the data frame transmitted by the first communication device is adjusted to 4, or rather, the number of 64B / 65B data blocks collected by the PCS during LDPC encoding of the data frame is adjusted to 4, and the number of padding bit positions is 1463 bit positions. Meanwhile, the clock frequencies of the 64B / 65B encoding module and the scrambling module are adjusted to 1 / 25 of the original (0.1 Gb / s: 2.5 Gb / s), and the clock frequencies of modules such as LDPC encoding, random number replacement, and PAM16 mapping are adjusted to 1 / 4 of the original (0.625 Gb / s: 2.5 Gb / s). The encoding process is similar to the above and will not be elaborated here.

[0166] The above examples only list the case where the value of m is 1. If the product of the ratio of the second rate to the first rate and the number of valid data blocks before adjustment is not an integer, the value of m can be selected as a positive integer greater than 1. For example, assuming the second rate is 0.94 Gb / s and the first rate is 1.25 Gb / s, substituting into formula (3) gives n = 18.8 × m. Substituting the relationship between the obtained n and m into formula (2), the value of m can be 5 and the value of n can be 94. Therefore, when the PCS of the first communication device performs LDPC encoding on the data frame, the total number of 64B / 65B data blocks in every 5 LDPC data frames is 94, and the number of 64B / 65B data blocks in at least 2 LDPC data frames is different. The total number of padding bit positions is 2505. The number of 64B / 65B data blocks and the number of padding bit positions in each data frame can be adjusted arbitrarily, but the lengths of both need to be 1723 bit for LDPC(1723, 2048) encoding.

[0167] Exemplarily, when the Ethernet communication standard is 5GBASE-T, the system architecture of the Ethernet is as Figure 1 shown. The first Ethernet link in step 510 includes 4 pairs of Ethernet cables, the third rate is 5 Gb / s, and the PCS encoding process of the first communication device is as Figure 3 shown. Since when only 2 pairs of Ethernet cables are in normal working condition, the first rate is 2.5 Gb / s and the optional MAC rates include 2.5 Gb / s, when the Ethernet communication standard is 5GBASE-T and 2 pairs of Ethernet cables are selected for data transmission, it is not necessary to adjust the number of valid data blocks in the data frame.

[0168] When the second Ethernet link in step 520 includes a pair of Ethernet cables, the first rate is 1.25 Gb / s. At this time, the optional MAC rate can be 1 Gb / s, so the second rate can be selected as 1 Gb / s. Substituting the first rate and the second rate into formulas (2) and (3), the value of n can be 20, the value of x can be 423, and the value of m can be 1. At this time, it is the same as the first example of the above embodiment, and will not be elaborated here.

[0169] In some other embodiments of the present application, the number of valid data blocks in the data frame transmitted by the first communication device can be adjusted multiple times. Exemplarily, as obtained above, when only three pairs of Ethernet cables or two pairs of Ethernet cables are working properly, the first communication device adjusts the number of valid data blocks in the transmitted data frame to 20. If at this time, due to a fault in the Ethernet link, only one pair of Ethernet cables is working properly, the first rate at this time is 0.625 Gb / s, the second rate is 0.1 Gb / s, and the first communication device can further adjust the number of valid data blocks in the transmitted data frame to 4.

[0170] In addition to the embodiments described above, the present application can also be applied to other scenarios. For example, it can be applied to the scenario of Ethernet optical fiber. For example, when the 100 Gb / s with four pairs of optical fibers working is reduced to only two pairs of optical fibers working, the second rate is 50 Gb / s, and the third rate is 40 Gb / s. At this time, according to formulas (2) and (3), the number of valid data blocks in the transmitted data frame can be adjusted to 20, or in other words, the number of valid data blocks collected by the PCS when performing FEC encoding on the data frame can be adjusted to 20. For another example, the number of Ethernet cables in the first Ethernet link in step 510 can be 8, 16 or even more, and the available MAC rates can also be more. The present application will not elaborate on this.

[0171] As described above in conjunction with Figures 1 to 7 , the method provided by the embodiments of the present application has been described in detail. Next, in conjunction with Figures 8 to 10 , the embodiments of the apparatus of the present application will be described in detail. It should be understood that the description of the method embodiments corresponds to the description of the apparatus embodiments. Therefore, the parts not described in detail can be referred to the previous method embodiments.

[0172] Figure 8 is a schematic structural diagram of a data transmission apparatus 800 provided by an embodiment of the present application. The apparatus 800 can be a network device, a terminal device, etc., such as network devices such as routers and switches, or terminal devices such as personal computers, printers, and cameras, or can also be a device module provided in a network device or a terminal device. For example, the apparatus 800 can be the first communication device in the above Figure 1 , or can also be a device module provided in the first communication device.Figure 8 The data transmission device 800 shown can be used to perform the corresponding steps of the method in the above Figure 5 shown embodiments to implement a process such as Figure 7 Ethernet data encoding. As Figure 8 shown, the device 800 includes a transmission module 810 and an adjustment module 820.

[0173] Specifically, the transmission module 810 is configured to: transmit a first data frame to a second communication device, where the first data frame includes a first number of valid data blocks;

[0174] The adjustment module 820 is configured to: when a first rate is different from a second rate, adjust the number of valid data blocks in the transmitted data frame from the first number to a second number according to the first rate and the second rate to obtain an adjusted second data frame, where the first data frame and the second data frame have the same length, and where the first rate is the rate of valid data in the data frame transmitted by the first communication device, and the second rate is the rate of data transmitted by the media access control (MAC) layer of the first communication device;

[0175] Specifically, the transmission module 810 is configured to: transmit the second data frame to the second communication device.

[0176] For the specific functions and beneficial effects of the transmission module 810 and the adjustment module 820, refer to the descriptions in the above embodiments. For the sake of brevity, they will not be elaborated here.

[0177] Correspondingly, Figure 9 is a schematic structural diagram of a data transmission device 900 provided by an embodiment of the present application. The device 900 can be a network device, a terminal device, etc., such as network devices like routers and switches, or terminal devices like personal computers, printers, cameras, etc., or can be a device module provided in a network device or a terminal device. For example, the device 900 can be the above Figure 1 second communication device, or can be a device module provided in the second communication device. Figure 9 The data transmission device 900 shown can be used to perform the corresponding steps of the method in the above Figure 6 shown embodiments to implement a process such as Figure 7 Ethernet data decoding. As Figure 9 shown, the device 900 includes an adjustment module 910, a receiving module 920, and a decoding module 930.

[0178] Among them, the adjustment module 910 is configured to: when the fourth rate is different from the fifth rate, adjust the number of valid data blocks obtained by decoding the data frame from the first number to the second number, where the fourth rate is the rate at which the second communication device receives valid data in the data frame, the fifth rate is the rate at which the media access control (MAC) layer of the second communication device receives data, and the first number is the number of valid data blocks obtained by the second communication device decoding the first data frame when the fourth rate is the same as the fifth rate;

[0179] The receiving module 920 is configured to: receive a second data frame from the first communication device, where the second data frame includes the second number of valid data blocks;

[0180] The decoding module 930 is configured to: decode the second data frame to obtain the second number of valid data blocks.

[0181] For the specific functions and beneficial effects of the adjustment module 910, the receiving module 920, and the decoding module 930, refer to the descriptions in the foregoing embodiments. For the sake of brevity, they will not be elaborated herein.

[0182] The apparatuses 800 and 900 herein may be embodied in the form of functional modules. The term "module" herein may be implemented in the form of software and / or hardware, and no specific limitation is made thereto.

[0183] For example, the "module" may be a software program, a hardware circuit, or a combination of the two that implements the foregoing functions. Exemplarily, next, taking the transmission module 810 as an example, the implementation manner of the transmission module 810 will be introduced. Similarly, the implementation manners of other modules, such as the adjustment module 820, the adjustment module 910, the receiving module 920, and the decoding module 930, may refer to the implementation manner of the transmission module 810.

[0184] As an example of a software functional unit, the transmission module 810 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the foregoing computing instance may be one or more. For example, the transmission module 810 may include code running on multiple hosts / virtual machines / containers.

[0185] As an example of a hardware functional unit, the transmission module 810 may include at least one computing device, such as a server, etc. Alternatively, the transmission module 810 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above PLD may be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0186] Therefore, the modules of the examples described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.

[0187] Figure 10 It is a schematic diagram of the hardware structure of a communication device 1000 according to an embodiment of the present application. For example, the communication device 1000 may be the network device or terminal device mentioned above, such as the Figure 1 first communication device or the second communication device in the above. Figure 10 The shown communication device 1000 can be used to execute the method of the above Figure 5 or Figure 6 shown embodiment to implement a data encoding or decoding process as shown in Figure 7 shown.

[0188] As Figure 10 shown, the communication device 1000 includes a processor 1001, a memory 1002, a communication interface 1003, and a bus 1004. Among them, the communication interface 1003 can be implemented in a wireless or wired manner, specifically, it can be a network card. The above processor 1001, memory 1002, and communication interface 1003 are connected through the bus 1004.

[0189] The communication interface 1003 may specifically include a transmitter and a receiver for the communication device to implement the above transceiver process.

[0190] The processor 1001 is used to execute the processing performed by the communication device in the above-mentioned embodiment. The memory 1002 includes an operating system 10021 and an application 10022, which are used to store programs, codes or instructions. When the processor or hardware device executes these programs, codes or instructions, the processing process involving the communication device in the method embodiment can be completed. Optionally, the memory 1002 may include a read-only memory (ROM) and a random access memory (RAM). Among them, the ROM includes a basic input / output system (BIOS) or an embedded system; the RAM includes an application and an operating system. When it is necessary to run the communication device 1000, it is started by the BIOS solidified in the ROM or the bootloader boot system in the embedded system, and the communication device 1000 is guided to enter a normal operating state. After the communication device 1000 enters a normal operating state, the application and operating system in the RAM are run, thereby completing the processing process involving the communication device 1000 in the method embodiment.

[0191] Understandably, Figure 10 Only a simplified design of the communication device 1000 is shown. In practical applications, the communication device may include any number of communication interfaces, processors or memories.

[0192] The embodiment of the present application also provides a computer-readable medium, which stores a program code, and when the computer program code is run on a computer, the computer executes the method executed by the above network device. These computer-readable storages include but are not limited to one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM) and hard drive.

[0193] The embodiments of the present application also provide a chip, which is applied to a communication device. The chip includes: at least one processor, at least one memory, and an interface circuit. The interface circuit is responsible for the information interaction between the chip and the outside world. The at least one memory, the interface circuit, and the at least one processor are interconnected by lines. Instructions are stored in the at least one memory; the instructions are executed by the at least one processor to perform the operations of the communication device 1000 in the methods described in the above aspects. In a specific implementation process, the chip can be implemented in the form of a central processing unit (CPU), a micro controller unit (MCU), a micro processing unit (MPU), a digital signal processing (DSP), a system on chip (SoC), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or a programmable logic device (PLD).

[0194] The embodiments of the present application also provide a computer program product, which is applied to a communication device. The computer program product includes a series of instructions. When the instructions are run, they are used to perform the operations of the communication device in the methods described in the above aspects.

[0195] The embodiments of the present application also provide a data transmission system, which includes a sending device and a receiving device. The sending device includes a module for executing the above method embodiments. The sending device can be the device 800 or the communication device 1000 mentioned above, and the receiving device can be the device 900 or the communication device 1000 mentioned above.

[0196] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0197] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0198] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0199] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0200] In addition, in each embodiment of the present application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0201] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0202] As described above, it is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims described above.

Claims

1. A data transmission method, characterized in that, it includes: A first communication device transmits a first data frame to a second communication device, and the first data frame includes a first number of valid data blocks; When the first rate is different from the second rate, the first communication device adjusts the number of valid data blocks in the transmitted data frame from the first number to a second number according to the first rate and the second rate, to obtain an adjusted second data frame, where the lengths of the first data frame and the second data frame are the same, and wherein the first rate is the rate of valid data in the data frame transmitted by the first communication device, and the second rate is the rate of data transmitted by the media access control (MAC) layer of the first communication device; The first communication device transmits the second data frame to the second communication device.

2. The method according to claim 1, characterized in that, The first communication device adjusts the number of valid data blocks in the transmitted data frame from the first number to a second number according to the first rate and the second rate, including: The first communication device adjusts the total number of bits of valid data in the transmitted data frame from a third number to a fourth number according to the ratio of the first rate to the second rate, where the ratio of the third number to the fourth number is the same as the ratio of the first rate to the second rate, the third number is the total number of bits of the first number of valid data blocks, and the fourth number is the total number of bits of the second number of valid data blocks.

3. The method according to claim 2, characterized in that, The first communication device adjusts the number of bits of valid data in the transmitted data frame from a third number to a fourth number according to the ratio of the first rate to the second rate, including: The first communication device adjusts the number of valid data blocks in the transmitted data frame from the first number to the second number according to the ratio of the first rate to the second rate, where the ratio of the first number to the second number is the same as the ratio of the third number to the fourth number.

4. The method according to any one of claims 1 to 3, characterized in that, The first communication device adjusts the number of valid data blocks in the transmitted data frame from the first number to a second number according to the first rate and the second rate, including: The first communication device adjusts a preset number of padding bits when the physical coding sublayer (PCS) encodes the data frame according to the first rate and the second rate, where the first data frame encoded by the PCS of the first communication device includes the first number of valid data blocks and a first preset number of padding bits, the second data frame encoded by the PCS of the first communication device includes the second number of valid data blocks and a second preset number of padding bits, and the sum of the bits of the first number of valid data blocks and the first preset number of padding bits is the same as the sum of the bits of the second number of valid data blocks and the second preset number of padding bits.

5. The method according to any one of claims 1 to 4, wherein, the rate at which the first communication device transmits the valid data in the first data frame is a third rate, and the method further includes: the first communication device adjusts the clock frequency when performing PCS encoding and scrambling the valid data block of the first communication device according to the third rate and the second rate.

6. The method according to claim 5, wherein, When the first communication device transmits the first data frame, the clock frequencies of the PCS encoding and scrambling of the valid data block of the first communication device are n 1 and m 1 ; the first communication device adjusts the clock frequency when performing PCS encoding and scrambling the valid data block of the first communication device according to the third rate and the second rate, including: The first communication device adjusts the clock frequencies when encoding PCS and scrambling valid data blocks of the first communication device to n 2 and m 2 , respectively, according to the ratio of the third rate to the second rate, where the ratio of n 1 to n 2 is the same as the ratio of the third rate to the second rate, and the ratio of m 1 to m 2 is the same as the ratio of the third rate to the second rate.

7. The method according to any one of claims 1 to 6, wherein, the rate at which the first communication device transmits the valid data in the first data frame is a third rate, and the method further includes: the first communication device adjusts the clock frequency when performing PCS encoding of the data frame of the first communication device according to the third rate and the first rate.

8. The method according to claim 7, wherein, When the first communication device transmits the first data frame, the clock frequency during encoding of the first data frame is h 1 ; the first communication device adjusts the clock frequency when performing PCS encoding of the data frame of the first communication device according to the third rate and the first rate, including: The first communication device adjusts the clock frequency when encoding data frames of the PCS of the first communication device to h according to the ratio of the third rate to the first rate 2 , where the h 1 and the h 2 have the same ratio as the ratio of the third rate to the first rate.

9. A data transmission method, wherein, it includes: when a fourth rate is different from a fifth rate, a second communication device adjusts the number of valid data blocks obtained by decoding a data frame from a first number to a second number, wherein the fourth rate is the rate at which the second communication device receives the valid data in the data frame, the fifth rate is the rate at which the media access control (MAC) layer of the second communication device receives data, and the first number is the number of valid data blocks obtained by the second communication device decoding a first data frame when the fourth rate and the fifth rate are the same; the second communication device receives a second data frame from a first communication device, and the second data frame includes the second number of valid data blocks; the second communication device decodes the second data frame to obtain the second number of valid data blocks.

10. The method according to claim 9, wherein, the second communication device adjusts the number of valid data blocks obtained by decoding a data frame from the first number to the second number according to the fourth rate and the fifth rate, including: the second communication device adjusts the total number of bits of the valid data obtained by decoding the data frame from a third number to a fourth number according to the ratio of the fourth rate to the fifth rate, and the ratio of the third number to the fourth number is the same as the ratio of the fourth rate to the fifth rate, the third number is the total number of bits of the valid data blocks of the first number, and the fourth number is the total number of bits of the valid data blocks of the second number.

11. The method according to claim 10, wherein, the second communication device adjusts the total number of bits of the valid data obtained by decoding the data frame from the third number to the fourth number according to the ratio of the fourth rate to the fifth rate, including: The second communication device adjusts the number of valid data blocks obtained by decoding the data frame from the first number to the second number according to the ratio of the fourth rate to the fifth rate, where the ratio of the first number to the second number is the same as the ratio of the third number to the fourth number.

12. The method according to any one of claims 9 to 11, wherein, The second communication device adjusts the number of valid data blocks obtained by decoding the data frame from the first number to the second number according to the fourth rate and the fifth rate, including: The second communication device adjusts a preset number of bits discarded by the PCS when decoding the data frame according to the fourth rate and the fifth rate, where the first data frame decoded by the PCS of the second communication device includes the first number of valid data blocks and a first preset number of bits to be discarded, and the second data frame decoded by the PCS of the second communication device includes the second number of valid data blocks and a second preset number of bits to be discarded, and the sum of the bits of the first number of valid data blocks and the first preset number of bits is the same as the sum of the bits of the second number of valid data blocks and the second preset number of bits.

13. The method according to any one of claims 9 to 12, wherein, The rate at which the second communication device receives the valid data in the first data frame is the sixth rate, and the method further includes: The second communication device adjusts the clock frequency when the PCS of the second communication device decodes the data frame according to the sixth rate and the fourth rate.

14. The method according to claim 13, wherein, When the second communication device receives the first data frame, the clock frequency at which the PCS of the second communication device decodes the first data frame is h 3 ; The second communication device adjusts the clock frequency when the PCS of the second communication device decodes the data frame according to the sixth rate and the fourth rate, including: The second communication device adjusts the clock frequency when decoding the PCS data frame of the second communication device to h according to the ratio of the sixth rate to the fourth rate 4 , where the h 3 and the h 4 have the same ratio as the ratio of the sixth rate to the fourth rate.

15. The method according to any one of claims 9 to 14, wherein, The rate at which the second communication device receives the valid data in the first data frame is the sixth rate, and the method further includes: The second communication device adjusts the clock frequency when the PCS of the second communication device descrambles and decodes the valid data blocks according to the sixth rate and the fifth rate.

16. The method according to claim 15, wherein, In the case where the second communication device receives the first data frame, the clock frequencies for descrambling and decoding the valid data blocks in the first data frame are n 3 and m 3 ; The second communication device adjusts the clock frequency when the PCS of the second communication device descrambles and decodes the valid data blocks according to the sixth rate and the fifth rate, including: The second communication device adjusts the clock frequency when the PCS descrambling code and the decoded valid data block of the second communication device to n according to the ratio of the sixth rate to the fifth rate 4 and m 4 , wherein the ratio of n 3 to n 4 is the same as the ratio of the sixth rate to the fifth rate, and the ratio of m 3 to m 4 is the same as the ratio of the sixth rate to the fifth rate.

17. A data transmission device, wherein, The device is applied to a first communication device and includes: A transmission module for transmitting a first data frame to a second communication device, where the first data frame includes a first number of valid data blocks; An adjustment module, configured to: when a first rate is different from a second rate, adjust the number of valid data blocks in a transmitted data frame from the first number to a second number according to the first rate and the second rate, to obtain an adjusted second data frame, where the first data frame and the second data frame have the same length, and where the first rate is the rate of valid data in the data frame transmitted by the first communication device, and the second rate is the rate of data transmitted by the media access control (MAC) layer of the first communication device; The transmission module is specifically configured to: transmit the second data frame to the second communication device.

18. A data transmission device characterized in that The device is applied to a second communication device and includes: An adjustment module, configured to: when a fourth rate is different from a fifth rate, adjust the number of valid data blocks obtained by decoding a data frame from a first number to a second number, where the fourth rate is the rate of valid data in the data frame received by the second communication device, the fifth rate is the rate of data received by the media access control (MAC) layer of the second communication device, and the first number is the number of valid data blocks obtained by the second communication device decoding a first data frame when the fourth rate is the same as the fifth rate; A receiving module, configured to: receive a second data frame from a first communication device, where the second data frame includes the second number of valid data blocks; A decoding module, configured to: decode the second data frame to obtain the second number of valid data blocks.

19. A first communication device characterized in that it includes: A processor and a memory, where the memory is used to store a program or code, and the processor is used to call and run the program or code from the memory to execute the method according to any one of claims 1 to 8.

20. A second communication device characterized in that it includes: A processor and a memory, where the memory is used to store a program or code, and the processor is used to call and run the program or code from the memory to execute the method according to any one of claims 9 to 16.

21. A data transmission system characterized in that it includes a sending device and a receiving device, where the sending device includes a module for executing the method according to any one of claims 1 to 8, and the receiving device includes a module for executing the method according to any one of claims 9 to 16.

22. A chip characterized in that it is used to execute the method according to any one of claims 1 to 16.

23. A computer-readable medium characterized in that it includes computer program instructions, and when the computer program instructions run on a computing device, the computing device is caused to execute the method according to any one of claims 1 to 16.

Citation Information

Cited By

  • Data transmission method and apparatus

    EP4808023A1

  • Data transmission method and apparatus

    WO2025113419A1