Communication method and apparatus

By sending a fast alignment flag (RAM) to trigger fast channel switching on Ethernet interface devices, the problem of power wastage in Ethernet interface devices at low traffic is solved, achieving more efficient energy saving.

WO2026145102A1PCT designated stage Publication Date: 2026-07-09HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-12-22
Publication Date
2026-07-09

AI Technical Summary

Technical Problem

In digital communication networks, Ethernet interface devices need to remain operational even under low traffic conditions, resulting in wasted power consumption, and existing energy-saving technologies have limited effectiveness.

Method used

By sending a fast alignment flag (RAM), the channel of the Ethernet interface device is triggered to quickly switch from a non-working state to a working state. The lock period of RAM is shorter than that of the traditional alignment flag (AM), which reduces the channel wake-up time and improves energy efficiency.

Benefits of technology

It effectively reduces the time for Ethernet interface devices to switch from non-working to working states, increases the time for channels to remain in sleep mode, and improves energy efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025144280_09072026_PF_FP_ABST
    Figure CN2025144280_09072026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application is a communication method. A first apparatus may send a first RAM to a second apparatus, wherein the first RAM is used for triggering the first apparatus to start receiving, by means of a first channel, data sent by the first apparatus, the first channel being a channel through which the first apparatus sends data to the second apparatus. Compared with conventional technologies in which a second apparatus triggers, on the basis of a received AM, the start of receiving, by means of a first channel, data sent by a first apparatus, since the locking period of an RAM is far less than the locking period of the AM, the present solution is used such that the second apparatus can quickly perform an operation of switching the first channel from a non-operating state to an operating state. Correspondingly, the first channel can be quickly switched from the non-operating state to the operating state, thereby effectively reducing the time for the first channel to be switched from the non-operating state to the operating state, and correspondingly improving the energy saving effect.
Need to check novelty before this filing date? Find Prior Art

Description

A communication method and apparatus

[0001] This application claims priority to Chinese Patent Application No. 202411996892.5, filed with the State Intellectual Property Office of China on December 31, 2024, entitled "A Communication Method and Apparatus", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of communications, and in particular to a communication method and apparatus. Background Technology

[0003] In digital communication networks, especially campus networks, traffic exhibits typical tidal characteristics; for example, traffic during the night is generally much lower than the network's bandwidth. Currently, even when there is no traffic on the network, Ethernet interface devices need to remain operational. For instance, the physical layer (PHY) of Ethernet interface devices remains active, resulting in significant power consumption waste.

[0004] Currently, to reduce the power consumption of Ethernet interface devices, some channels of the Ethernet interface device can be shut down during low traffic periods, and then the shut-down channels can be activated when traffic increases, thereby achieving energy saving. However, even so, the energy saving effect is still limited.

[0005] Therefore, a solution is urgently needed to address the above problems. Summary of the Invention

[0006] This application provides a communication method that can improve the energy efficiency of Ethernet interface devices.

[0007] Firstly, this application provides a communication method applicable to a first device. The first device sends a first rapid alignment marker (RAM) to a second device. The first RAM triggers the first device to begin receiving data transmitted by the first device through a first channel, which is the channel through which the first device transmits data to the second device. In one example, before sending the first RAM to the second device, the first channel is in a non-working state; that is, the first device can transmit data (e.g., service data) to the second device without using the first channel. Using this solution, compared to the conventional technology where the second device triggers the start of receiving data transmitted by the first device through the first channel based on a received alignment marker (AM), the locking period of the RAM is much shorter than the locking period of the AM. Therefore, this solution allows the second device to quickly complete the operation of switching the first channel from a non-working state to a working state. Consequently, the first channel can quickly switch from a non-working state to a working state, effectively reducing the time required for the first channel to switch from a non-working state to a working state. Thus, given a fixed amount of time without transmission traffic on the first channel, this solution can increase the actual time the first channel is in a dormant state, thereby improving energy efficiency. The lock period of RAM can be understood as the distance between adjacent RAMs, and the lock period of AM can be understood as the distance between adjacent AMs.

[0008] In one possible implementation, to ensure the reliability of channel state switching, the first device can send N RAMs to the second device. The first RAM can be the last RAM sent by the first device among the N RAMs. The first RAM is also the last RAM among the N RAMs received by the second device. That is, the first device sends N RAMs to the second device, and the last RAM among these N RAMs serves as the switching boundary between the first and second devices for switching the first channel from a non-working state to a working state. Both devices switch based on the same switching boundary, allowing the first channel to quickly complete the switch from a non-working state to a working state after the second device receives the first RAM, thereby reducing the wake-up time of the first channel and improving energy efficiency.

[0009] In one possible implementation, the first device can send the N RAMs to the second device through multiple channels between the first and second devices. These multiple channels include a first channel and a second channel that is in operation. That is, the first device can send N RAMs to the second device through each of these multiple channels. Correspondingly, the second device can receive N RAMs through each of these multiple channels. After receiving multiple first RAMs through the multiple channels, the second device can perform skew correction on the received first RAMs to align them with the multiple channels. After aligning the multiple channels, the second device can then begin receiving data through the first channel.

[0010] In one possible implementation, the data between any two RAMs transmitted on the second channel can be either service data or idle data. As a concrete example, if the first device is sending service data to the second device during the transmission interval between any two RAMs, then the data between any two RAMs transmitted on the second channel is service data. If the first device has no service data to send to the second device during the transmission interval between any two RAMs, then the data between any two RAMs transmitted on the second channel is idle data. Because the first channel has not yet switched to an active state, it cannot be used to transmit service data; therefore, the data between any two RAMs transmitted on the first channel can be idle data.

[0011] In one possible implementation, any two adjacent RAMs among the N RAMs are spaced apart by a first preset length of data. This first preset length can be determined, for example, based on the correction capability of the second device; specifically, it can be the length that enables the second device to successfully align the aforementioned multiple channels.

[0012] In one possible implementation, the first preset length of data includes a first number of forward error correction (FEC) codewords, where the first number is a positive integer. In this case, the second device can perform RAM locking operations at intervals of the first number of FEC codewords.

[0013] In one possible implementation, the first quantity is greater than or equal to 1 and less than or equal to 32. For example, the first quantity is 2, 4, or 8. The smaller the first quantity, the shorter the wake-up time of the first channel, and correspondingly, the better the energy-saving effect of this solution.

[0014] In one possible implementation, after sending the first RAM, the first device can, in response to sending the first RAM to the second device, begin sending data to the second device through the first channel. That is, after sending the first RAM, the first device no longer waits for AM (Active Mode), but quickly begins sending data to the second device through the first channel. The first RAM serves as the switching boundary for the first device to switch the state of the first channel from a non-working state to a working state. This approach effectively reduces the wake-up time of the first channel, thereby significantly improving energy efficiency.

[0015] In one possible implementation, before sending the first RAM to the second device, or in other words, before sending the aforementioned N RAMs to the second device, the first device may send a first indication message to the second device. This first indication message instructs the second device to begin receiving data sent by the first device through the first channel after receiving the first RAM. In one example, to ensure the reliability of the first indication message, the first device may send multiple first indication messages to the second device; for example, the first device may send three first indication messages to the second device. Correspondingly, after receiving the first indication message, the second device may continue receiving the aforementioned N RAMs and lock them so that it can begin receiving data sent by the first device through the first channel after receiving the first RAM.

[0016] In one possible implementation, the N RAMs sent by the first device to the second device are located within the same AM cycle. For two adjacent AM cycles sent from the first device to the second device, the N RAMs are all located between these two AM cycles. For ease of description, these two adjacent AM cycles are referred to as the first AM and the second AM, with the first AM preceding the second AM. Therefore, the aforementioned N RAMs are all located between the first AM and the second AM.

[0017] In one possible implementation, the aforementioned first indication information is also located between the first AM and the second AM, that is, the aforementioned N RAMs and the first indication information are both located within the same AM cycle. In this case, the time from when the first device sends the first indication information to when it sends the N RAMs can be reduced to within one AM cycle, thereby effectively reducing the wake-up time of the first channel.

[0018] In one possible implementation, for ease of description, the first of the aforementioned N RAMs is referred to as the "second RAM". In one example, the first indication information may also indicate the data length between the first RAM and the second RAM. In this way, the second device can determine the timing to start receiving the aforementioned N RAMs and locking the second RAM based on the data length between the first RAM and the second RAM, so that the second device can receive and lock the N RAMs sent by the second device.

[0019] In one possible implementation, a second preset length of data is spaced between the first indication information and the second RAM. This second preset length can be a pre-set default value. For example, the second preset length of data can be a second number of FEC codewords; this embodiment does not specifically limit the second number, and the second number can be a positive integer. In a scenario where the first device sends multiple first indication messages to the second device, the second preset length of data spaced between the first indication information and the second RAM can be the second preset length of data spaced between the first first indication information and the second RAM.

[0020] In one possible implementation, each of the N RAMs carries a sequence number, which is used by the second device to determine the number of RAMs received. That is, the second device can determine the number of RAMs it has received based on the sequence numbers in the received RAMs. Thus, when the second device has received N RAMs, upon receiving the last RAM (i.e., the first RAM), it can begin receiving data through the first channel in response to receiving that first RAM.

[0021] In one possible implementation, the sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N. In this scenario, the second device can have consecutive sequence numbers in the N RAMs it receives, and upon receiving the RAM with sequence number 1 (i.e., the first RAM), it starts receiving data through the first channel in response to receiving the first RAM.

[0022] In one possible implementation, for any given RAM, the serial number carried by that RAM can be carried through any available field within that RAM. In one example, when the RAM includes CD3 and CD7 fields, the serial number can be carried by either the CD3 or CD7 field. Accordingly, the second device can parse the serial number based on either the CD3 or CD7 field in the RAM, thereby determining the number of RAMs it has received. Here, CD in CD3 and CD7 represents a countdown.

[0023] In one possible implementation, before sending the first indication information to the second device, the first device may also send a channel detection message to the second device via a second channel. This channel detection message instructs the second device to detect the first channel. Furthermore, the first device also sends a third RAM and a preset code block to the second device via the first channel. The third RAM and the preset code block are used by the second device to detect the first channel. Using this method, the channel quality of the first channel can be detected to determine its quality.

[0024] In one possible implementation, the third RAM carries a first value. Specifically, the first value may be carried by the CD3 or CD7 field of the third RAM. For example, the first value may be 255.

[0025] In one possible implementation, the first device may further receive a channel detection response message sent by the second device, the channel detection response message indicating that the first channel has passed the detection. Correspondingly, in response to receiving the channel detection response message, the first device may send the first indication information to the second device through the second channel. That is, the first device may only initiate the process of switching the first channel from a non-working state to a working state after determining that the channel quality of the first channel meets the requirements, thereby ensuring that the transmission quality of the service flow transmitted through the first channel is guaranteed after the first channel is switched to a working state.

[0026] In one possible implementation, the first device may send the channel detection message to the second device in response to detecting an acceleration command. The acceleration command instructs the first device to increase the rate at which it sends data to the second device. That is, upon receiving the acceleration command, the first device initiates a process to perform channel detection on the first channel, so that if the channel quality of the first channel meets the requirements, it can then initiate a process to switch the first channel from a non-operating state to an operating state.

[0027] Secondly, the application provides a communication method applicable to a second device. The second device receives a first RAM sent by a first device. This first RAM triggers the second device to begin receiving data sent by the first device through a first channel, where the first channel is the channel through which the first device sends data to the second device. Using this solution, compared to conventional techniques where the second device triggers to receive data sent by the first device through the first channel based on a received AM (Advanced Media Access Message), the locking period of the RAM is much shorter than the locking period of the AM. Therefore, this solution allows the second device to quickly switch the first channel from a non-working state to a working state. Consequently, the first channel can quickly switch from a non-working state to a working state, effectively reducing the time required for the first channel to switch from a non-working state to a working state. Thus, given a fixed amount of time without transmission traffic on the first channel, this solution can increase the actual time the first channel is in a dormant state, thereby improving energy efficiency.

[0028] In one possible implementation, receiving the first RAM sent by the first device includes: receiving N RAMs sent by the first device, wherein the first RAM is the last RAM received by the second device among the N RAMs.

[0029] In one possible implementation, the N RAMs are spaced apart by a first preset length of data between any two adjacent RAMs.

[0030] In one possible implementation, the data of the first preset length includes: a first number of forward error correction (FEC) codewords, where the first number is a positive integer.

[0031] In one possible implementation, the first quantity is greater than or equal to 1 and less than or equal to 32.

[0032] In one possible implementation, the method further includes: in response to receiving the first RAM, starting to receive data sent by the first device through the first channel, so that the first channel switches to a non-working state with the first RAM as the switching boundary, thereby reducing the wake-up time of the first channel and improving energy saving effect.

[0033] In one possible implementation, before receiving the first RAM sent by the first device, the method further includes: receiving first indication information sent by the first device, the first indication information instructing the second device to start receiving data sent by the first device through the first channel after receiving the first RAM.

[0034] In one possible implementation, the N RAMs sent by the first device to the second device are all located between the first alignment mark AM and the second alignment mark AM, where the first AM and the second AM are two adjacent AMs.

[0035] In one possible implementation, the first indication information is located between the first AM and the second AM.

[0036] In one possible implementation, the first AM is the AM preceding the second AM, and the first indication information also indicates the data length of the interval between the first AM and the second RAM, wherein the second RAM is the first RAM among N RAMs including the first RAM.

[0037] In one possible implementation, the first indication information and the second RAM are spaced apart by a second preset length of data.

[0038] In one possible implementation, each of the N RAMs carries a sequence number, which is used by the second device to determine the number of received RAMs.

[0039] In one possible implementation, the sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N.

[0040] In one possible implementation, the serial number is carried via a countdown CD3 field or a CD7 field in RAM.

[0041] In one possible implementation, before receiving the first indication information sent by the first device, the method further includes: receiving a channel detection message sent by the first device through a second channel, the channel detection message being used to instruct the second device to detect the first channel, the second channel being different from the first channel, the second channel being in an active state and the first channel being in a non-active state; and receiving a third RAM and a preset code block sent by the first device through the first channel, the third RAM and the preset code block being used by the second device to detect the first channel.

[0042] In one possible implementation, the third RAM carries the first value.

[0043] In one possible implementation, the second device can detect the first channel based on a third RAM and a preset code block. Furthermore, in response to the first channel passing the detection, the second device sends a channel detection response message to the first device, the channel detection response message indicating that the first channel has passed the detection. Correspondingly, receiving the first indication information sent by the first device includes: receiving the first indication information sent by the first device through the second channel, the first indication information being sent by the first device to the second device in response to receiving the channel detection response message.

[0044] In one possible implementation, receiving the first fast alignment mark RAM sent by the first device includes: receiving the first RAM sent by the first device through the first channel and the second channel.

[0045] In one possible implementation, the data transmitted between two adjacent RAMs on the first channel is idle data; the data transmitted between two adjacent RAMs on the second channel is service data or idle data.

[0046] Thirdly, this application provides a communication device applied to a first device, the device comprising: a transmitting unit for transmitting a first fast alignment mark RAM to a second device, the first RAM being used to trigger the second device to start receiving data transmitted by the first device through a first channel, the first channel being a channel through which the first device transmits data to the second device.

[0047] In one possible implementation, the sending unit is specifically configured to: send N RAMs to the second device, wherein the first RAM is the last RAM received by the second device among the N RAMs.

[0048] In one possible implementation, the N RAMs are spaced apart by a first preset length of data between any two adjacent RAMs.

[0049] In one possible implementation, the data of the first preset length includes: a first number of forward error correction (FEC) codewords, where the first number is a positive integer.

[0050] In one possible implementation, the first quantity is greater than or equal to 1 and less than or equal to 32.

[0051] In one possible implementation, the transmitting unit is further configured to: in response to transmitting the first RAM to the second device, begin transmitting data to the second device via the first channel.

[0052] In one possible implementation, the sending unit is further configured to send a first indication message to the second device before sending the first RAM to the second device, the first indication message indicating that the second device will begin receiving data sent by the first device through the first channel after receiving the first RAM.

[0053] In one possible implementation, the N RAMs sent by the first device to the second device are all located between the first alignment mark AM and the second alignment mark AM, where the first AM and the second AM are two adjacent AMs.

[0054] In one possible implementation, the first indication information is located between the first AM and the second AM.

[0055] In one possible implementation, the first AM is the AM preceding the second AM, and the first indication information also indicates the data length of the interval between the first AM and the second RAM, wherein the second RAM is the first RAM among N RAMs including the first RAM.

[0056] In one possible implementation, the first indication information and the second RAM are spaced apart by a second preset length of data.

[0057] In one possible implementation, each of the N RAMs carries a sequence number, which is used by the second device to determine the number of received RAMs.

[0058] In one possible implementation, the sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N.

[0059] In one possible implementation, the serial number is carried via a countdown CD3 field or a CD7 field in RAM.

[0060] In one possible implementation, the sending unit is further configured to send a channel detection message to the second device via a second channel before sending the first indication information to the second device. The channel detection message is used to instruct the second device to detect the first channel. The second channel is different from the first channel, and the second channel is in an active state while the first channel is in a non-active state. The unit also sends a third RAM and a preset code block to the second device via the first channel. The third RAM and the preset code block are used by the second device to detect the first channel.

[0061] In one possible implementation, the third RAM carries the first value.

[0062] In one possible implementation, the apparatus further includes: a receiving unit, configured to receive a channel detection response message sent by the second apparatus, the channel detection response message indicating that the first channel has passed detection; the step of sending the first indication information to the second apparatus includes: in response to receiving the channel detection response message, sending the first indication information to the second apparatus through the second channel.

[0063] In one possible implementation, the sending unit is specifically used to send the first RAM to the second device through the first channel and the second channel.

[0064] In one possible implementation, the data transmitted between two adjacent RAMs on the first channel is idle data; the data transmitted between two adjacent RAMs on the second channel is service data or idle data.

[0065] In one possible implementation, sending the channel detection message to the second device via the second channel includes: in response to detecting an acceleration command, sending the channel detection message to the second device, the acceleration command indicating an increase in the rate at which the first device sends data to the second device.

[0066] Fourthly, this application provides a communication device applied to a second device, the device comprising: a receiving unit for receiving a first fast alignment mark RAM sent by a first device, the first RAM being used to trigger the second device to start receiving data sent by the first device through a first channel, the first channel being a channel through which the first device sends data to the second device.

[0067] In one possible implementation, the receiving unit is specifically configured to: receive N RAMs sent by the first device, wherein the first RAM is the last RAM received by the second device among the N RAMs.

[0068] In one possible implementation, the N RAMs are spaced apart by a first preset length of data between any two adjacent RAMs.

[0069] In one possible implementation, the data of the first preset length includes: a first number of forward error correction (FEC) codewords, where the first number is a positive integer.

[0070] In one possible implementation, the first quantity is greater than or equal to 1 and less than or equal to 32.

[0071] In one possible implementation, the receiving unit is further configured to: in response to receiving the first RAM, begin receiving data sent by the first device through the first channel.

[0072] In one possible implementation, the receiving unit is further configured to receive first indication information sent by the first device before receiving the first RAM sent by the first device, the first indication information instructing the second device to start receiving data sent by the first device through the first channel after receiving the first RAM.

[0073] In one possible implementation, the N RAMs sent by the first device to the second device are all located between the first alignment mark AM and the second alignment mark AM, where the first AM and the second AM are two adjacent AMs.

[0074] In one possible implementation, the first indication information is located between the first AM and the second AM.

[0075] In one possible implementation, the first AM is the AM preceding the second AM, and the first indication information also indicates the data length of the interval between the first AM and the second RAM, wherein the second RAM is the first RAM among N RAMs including the first RAM.

[0076] In one possible implementation, the first indication information and the second RAM are spaced apart by a second preset length of data.

[0077] In one possible implementation, each of the N RAMs carries a sequence number, which is used by the second device to determine the number of received RAMs.

[0078] In one possible implementation, the sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N.

[0079] In one possible implementation, the serial number is carried via a countdown CD3 field or a CD7 field in RAM.

[0080] In one possible implementation, the receiving unit is further configured to receive a channel detection message sent by the first device via a second channel before receiving the first indication information sent by the first device. The channel detection message is used to instruct the second device to detect the first channel. The second channel is different from the first channel, and the second channel is in an active state while the first channel is in a non-active state. The receiving unit also receives a third RAM and a preset code block sent by the first device via the first channel. The third RAM and the preset code block are used by the second device to detect the first channel.

[0081] In one possible implementation, the third RAM carries the first value.

[0082] In one possible implementation, the apparatus further includes: a sending unit, configured to send a channel detection response message to the first apparatus in response to the first channel passing detection, the channel detection response message indicating that the first channel has passed detection; the receiving of the first indication information sent by the first apparatus includes: receiving the first indication information sent by the first apparatus through the second channel, the first indication information being sent by the first apparatus to the second apparatus in response to receiving the channel detection response message.

[0083] In one possible implementation, the receiving unit is specifically configured to: receive the first RAM sent by the first device through the first channel and the second channel.

[0084] In one possible implementation, the data transmitted between two adjacent RAMs on the first channel is idle data; the data transmitted between two adjacent RAMs on the second channel is service data or idle data.

[0085] Fifthly, this application provides a device including a communication interface, the communication interface being used to perform data transmission and reception operations as described in the first aspect and any one of the first aspects above; or, the communication interface being used to perform data transmission and reception operations as described in the second aspect and any one of the second aspects above.

[0086] Optionally, the device further includes a processor, the processor being configured to perform the data processing operations in the method described in the first aspect and any one of the first aspects above; or, the processor being configured to perform the data processing operations in the method described in the second aspect and any one of the second aspects above.

[0087] In one possible implementation, the device further includes a memory for storing instructions or computer programs, and the processor for executing the instructions or computer programs in the memory to trigger the method described in the first aspect above and any one of the first aspects above; or, the processor is configured to execute the instructions or computer programs in the memory to perform the method described in the second aspect above and any one of the second aspects above.

[0088] In a sixth aspect, this application provides a communication device, the communication device including an interface circuit, the interface circuit being used to perform data transmission and reception operations in the methods described in the first aspect and any one of the first aspects above; or, the interface circuit being used to perform data transmission and reception operations in the methods described in the second aspect and any one of the second aspects above.

[0089] Optionally, the communication device further includes a processing circuit, which is configured to perform the data processing operation in the method described in the first aspect and any one of the first aspects above; or, the processing circuit is configured to perform the data processing operation in the method described in the second aspect and any one of the second aspects above.

[0090] In one example, the communication device is a network device, a chip, or an optical module, and the chip may be, for example, a PHY chip.

[0091] In a seventh aspect, this application provides a computer-readable storage medium, including instructions or a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any one of the first aspects above, or, when run on a computer, causes the computer to perform the methods described in the second aspect and any one of the second aspects above.

[0092] Eighthly, this application provides a computer program product comprising instructions or a computer program, which, when run on a computer, causes the computer to perform the methods described in the first aspect and any one of the first aspects above, or causes the computer to perform the methods described in the second aspect and any one of the second aspects above.

[0093] Ninthly, this application provides a communication system, including a first device for performing the method described in the first aspect and any one of the first aspects above, and a second device for performing the method described in the second aspect and any one of the second aspects above.

[0094] In a tenth aspect, embodiments of this application provide a chip system for performing the methods described in the first aspect and any one of the first aspects above, or for performing the methods described in the second aspect and any one of the second aspects above. Attached Figure Description

[0095] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0096] Figure 1a shows a schematic diagram of a transmitting end device and a receiving end device;

[0097] Figure 1b shows a schematic diagram of a scenario using EEE technology;

[0098] Figure 1c shows a schematic diagram of a channel-level energy-saving scheme;

[0099] Figure 1d shows a schematic diagram of a process for switching a channel from a non-working state to a working state;

[0100] Figure 2a is a schematic diagram of an exemplary application scenario of an embodiment of this application;

[0101] Figure 2b is a schematic diagram of another exemplary application scenario of the present application embodiment;

[0102] Figure 2c is a schematic diagram of another exemplary application scenario of this application embodiment;

[0103] Figure 3 is a schematic diagram of signaling interaction of a communication method provided in an embodiment of this application;

[0104] Figure 4a shows a schematic diagram of a RAM structure;

[0105] Figure 4b is a schematic diagram of data sent from a first device to a second device according to an embodiment of this application;

[0106] Figure 4c is a schematic diagram of data sent from a first device to a second device according to another embodiment of this application;

[0107] Figure 4d is a schematic diagram of a two-layer frame carrying first indication information provided in an embodiment of this application;

[0108] Figure 5 is a signaling interaction diagram of another communication method provided in an embodiment of this application;

[0109] Figure 6a is a schematic diagram of a first device performing channel state switching according to an embodiment of this application;

[0110] Figure 6b is a schematic diagram of a channel state switching state performed by a second device according to an embodiment of this application;

[0111] Figure 6c is a schematic diagram of a first device performing channel state switching according to an embodiment of this application;

[0112] Figure 6d is a schematic diagram of a channel state switching state performed by a second device according to an embodiment of this application;

[0113] Figure 7 is a schematic diagram of the structure of a communication device provided in an embodiment of this application;

[0114] Figure 8 is a structural schematic diagram of another communication device provided in an embodiment of this application;

[0115] Figure 9 is a schematic diagram of another communication device provided in an embodiment of this application;

[0116] Figure 10 is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation

[0117] This application provides a communication method and apparatus that, based on a channel-level energy-saving control scheme, reduces the time required to switch a channel from a non-working state to a working state, thereby improving energy-saving performance.

[0118] The device mentioned in the embodiments of this application can be an Ethernet interface or a device including an Ethernet interface. A device including an Ethernet interface can be, for example, a network device including an Ethernet interface, or a component (e.g., a chip or board) on a network device including an Ethernet interface. This application does not specifically limit the scope of the device.

[0119] The Ethernet interface mentioned in this application embodiment includes an Ethernet media access control (MAC) layer device and a physical layer (PHY) device that support data transmission at a certain rate. Refer to Figure 1a for understanding; Figure 1a shows a schematic diagram of a transmitting end device and a receiving end device. Both the transmitting end device and the receiving end device include an Ethernet interface. The transmitting end device refers to the communication device acting as a data sender, and the receiving end device refers to the communication device acting as a data receiver. Considering that data traffic is bidirectional, the roles of the transmitting end device and the receiving end device shown in Figure 1a can be interchanged in some other scenarios.

[0120] As shown in Figure 1a, both the transmitting and receiving devices include a MAC layer (referred to as MAC in Figure 1a) and a physical layer (referred to as PHY in Figure 1a). The physical layer includes a physical coding sublayer (PCS), a physical medium attachment (PMA), and a physical medium dependent (PMD). PCS, PMA, and PMD are PHY devices. Additionally, a reconciliation sublayer (RS) may be included between the MAC layer and the physical layer. RS and PCS can communicate via a medium independent interface (MII) channel. The MII channel can be a virtual or logical channel. In some scenarios, PCS may also be referred to as FEC.

[0121] In one example, the aforementioned MAC layer device can be a MAC chip, and the physical layer device can be a PHY chip.

[0122] In another example, the aforementioned MAC layer device and physical layer device can be different functional circuits on the same chip.

[0123] When transmitting data, communication devices can process the data according to the seven-layer model of Open Systems Interconnection (OSI). The first layer of the OSI seven-layer model is the Physical Layer, the second layer is the Data Link Layer, and the Data Link Layer includes the MAC layer. The Physical Layer can include the aforementioned PCS, PMA, and PMD.

[0124] The MAC layer of the transmitting device can generate MAC frames. The MAC layer of the transmitting device sends the MAC frames to the physical layer of the transmitting device. In scenarios where an RS is included between the MAC layer and the physical layer, the RS can convert the serial MAC frames into a parallel data stream and pass the data stream to the PCS through the MII channel.

[0125] The PCS can process the data stream received through the MII channel. In a specific example, the PCS can first encode (e.g., 64B / 66B encoding) and rate match the data stream, and then transcode (e.g., 256B / 257B transcoding) the encoded and rate-matched data stream. Further, scrambling is performed on the transcoded data stream. After scrambling, alignment marker (AM) insertion is performed on the scrambled data stream to add AM. After adding AM, forward error correction (FEC) encoding is performed on the AM-encoded data stream, and interleaving and distribution are performed on the FEC-encoded data to distribute the interleaved data to m PCS lanes connected to the PMA, where "PCS lane" can be abbreviated as "PCSL". In one example, FEC encoding can be performed using Reed-Solomon (RS) codes. "FEC encoding using RS codes" can also be called RS-FEC encoding. Correspondingly, the FEC codewords obtained by encoding can be called RS-FEC codewords.

[0126] Currently, the bandwidth of a single PCSL is 25Gbps. For a 100GE Ethernet interface, the number of PCSLs is 4; for a 200GE Ethernet interface, the number of PCSLs is 8; for a 400GE Ethernet interface, the number of PCSLs is 16; and for an 800GE Ethernet interface, the number of PCSLs is 32.

[0127] PMA can perform m:n bit multiplexing on data from PCS (i.e., data from m PCSLs), mapping the data transmitted in the m PCSLs to n physical channels, so that the data carried by these n physical channels can be subsequently sent to the receiving device. The n physical channels can be physical channels connecting the transmitting and receiving devices. The n physical channels can also be internal physical channels of the transmitting device, such as attachment unit interfaces (AUIs). When the n physical channels are internal physical channels of the transmitting device, the transmitting device can further map the data on the internal physical channels of the transmitting device to the physical channels connecting the transmitting and receiving devices to send the data to the receiving device. Wherein:

[0128] The AUI (Automatic Interface) can be, for example, a serdes. The physical channel connecting the transmitting and receiving devices can be a serializer / deserializer (serdes), an optical channel, or an electrical channel. An optical channel can be, for example, an optical fiber, and an electrical channel can be, for example, a cable.

[0129] The physical layer of the receiving device also includes PMD, PMA, and PCS. The operations performed by the physical layer of the receiving device are the inverse operations performed by the physical layer of the data sending device, which will not be described in detail here.

[0130] In another example, although not shown in Figure 1a, both the transmitting and receiving devices may include two parts or two PMAs. Assuming the transmitting (or receiving) device includes PMA1 and PMA2, ​​PMA1 connects to the PCS and PMA2, ​​and PMA2 connects to PMA1 and PMD. The PMA and PMD can be interconnected via an AUI, which includes, but is not limited to, SerDes. The PMD and PMA2 connected to it may belong to the PHY module or other modules, such as optical modules or other electrical modules; this is not limited here.

[0131] In the Ethernet protocol defined by the IEEE standard, when traffic is low, Energy-Efficient Ethernet (EEE) technology is used to put the physical layer into a low-power idle (LPI) mode to save power. Specifically, EEE technology specifies that after a task is completed, some power-consuming components of the PHY layer of the Ethernet interface are turned off to save energy, and the turned-off power-consuming components are woken up before the next task arrives.

[0132] Please refer to Figure 1b, which shows a schematic diagram of a scenario for EEE technology.

[0133] As shown in Figure 1b, "active" indicates that the transmitting device is sending data to the receiving device, and "idle" indicates that the transmitting device is not sending data to the receiving device. In Figure 1b, Ts is the time it takes for the energy-consuming element to enter the sleep state from the working state (i.e., sleep time), Tw is the time it takes for the energy-consuming element to switch from the sleep state to the working state (i.e., wake-up time), and Tq is the energy-saving time that the energy-consuming element can achieve when it is actually in the sleep state.

[0134] It's easy to understand that, given a fixed IDLE time, a larger Ts+Tw results in a smaller actual energy-saving time Tq, and consequently, a worse energy-saving effect. Conversely, a smaller Ts+Tw results in a larger actual energy-saving time Tq, and consequently, a better energy-saving effect. When Ts+Tw = 0, the ideal 0 bits and 0 watts can be achieved, meaning energy consumption is directly proportional to link utilization.

[0135] However, due to limitations in device materials and manufacturing processes, it is difficult to achieve Ts+Tw=0. IEEE 802.3 has standardized a series of Ethernet interfaces. For example, the 802.3ae version released in 2002 standardized the EEE of the 10G BASE-T interface, requiring Ts=2.56 microseconds (us) and Tw=4.88us, that is: Ts+Tw=52.56us.

[0136] With Ts+Tw = 52.56µs, when network utilization is 10%, the energy consumption is equivalent to 88% of that when network utilization is 100%, resulting in poor energy saving. When network utilization is 20%, the energy consumption is equivalent to 81% of that when network utilization is 100%, also resulting in poor energy saving. When network utilization is 30%, the energy consumption is the same as that when network utilization is 100%, with almost no energy saving. The energy consumption mentioned here can include the energy consumption of the transmitting device and / or the energy consumption of the receiving device.

[0137] For a BASE-R optical link with a rate of 100 gigabits per second (Gbps), when Ts+Tw = 52.56us, the energy consumption level of a network utilization rate of 30% is equivalent to that of a network utilization rate of 100%, resulting in no energy saving effect; even if the network utilization rate is 2%, the energy consumption level is equivalent to 81% of the energy consumption of a network utilization rate of 100%.

[0138] Moreover, the higher the Ethernet interface speed, the smaller the Ts+Tw value needs to be to achieve energy saving. However, due to limitations in device materials and processes, it is difficult to guarantee a smaller Ts+Tw value.

[0139] In conclusion, current EEE technology does not perform well in terms of energy saving.

[0140] To improve the energy efficiency of communication devices, a channel-level energy-saving control method can be adopted in one example. Specifically, flexible lane (FlexLane) technology can be used, which allows some channels to be shut down to save energy when traffic is low. Refer to Figure 1c for understanding; Figure 1c shows a schematic diagram of a channel-level energy-saving scheme. As shown in Figure 1c, FlexLane technology divides the Ethernet interface into multiple channels. Figure 1c shows four channels, which are referred to here as virtual channels or logical channels. When traffic is high, more channels can be opened to transmit traffic; when traffic is low, some channels can be shut down to save energy. In some scenarios, the channels obtained by dividing the Ethernet interface can also be called sub-physical layers (subPHYs). That is, in this application, a subPHY is a logical channel obtained by dividing the Ethernet interface. For example, a 400GE Ethernet interface can be divided into four subPHYs, each with a rate of 100Gbps.

[0141] As described above in Figure 1b, both opening and closing the channel require a certain amount of time. The channel opening time corresponds to Tw, and the channel closing time corresponds to Ts. Due to factors such as the manufacturing process of the devices corresponding to the channel, Tw + Ts is rarely equal to 0, resulting in poor energy-saving performance of the flexible lane technology. However, reducing Tw + Ts can improve the energy-saving effect of the flexible lane technology.

[0142] Currently, when it is necessary to switch a channel from a non-working state to a working state, the transmitting and receiving devices can trigger the switch based on the AM boundary. Refer to Figure 1d for understanding; Figure 1d illustrates a flowchart of a channel switching process from a non-working state to a working state. Figure 1d uses an example where the transmitting and receiving devices include one working channel (channel 1) and three non-working channels (channels 2 to 4). Figure 1d shows the data streams transmitted on the subPHY of the transmitting device and the subPHY of the receiving device, respectively.

[0143] As shown in Figure 1d:

[0144] After receiving the speed-up command, the transmitting device initiates a speed-up operation, increasing the number of channels used to transmit data to the receiving device. The transmitting device sends a lane check message to the receiving device through the active channels, notifying the receiving device to switch one or more inactive channels to active status. For ease of description, the channels that need to be switched from inactive to active status are referred to as "channels to be added". After sending the aforementioned lane check message, the transmitting device can send AM and IDLE signals on the channels to be added (Figure 1d illustrates this using three channels as an example). After receiving the lane check message, the receiving device can begin locking onto AM signals received on the channels to be added. After successfully locking onto several (e.g., two) AM signals consecutively on the channels to be added, the receiving device sends a response to the transmitting device.

[0145] After receiving a response, the transmitting device can send anchor messages to the receiving device. The transmitting device's Ethernet interface can send multiple anchor messages (three are shown in Figure 1d). Based on the anchor messages, the first AM (Advanced Media Access Message) after the 36 RAM bytes following the anchor messages are sent triggers a switch in the channel state. Specifically, when sending the first AM, the transmitting device can begin sending a data stream through the channel (subPHY) that needs to be switched to active state. Correspondingly, when receiving the first AM, the receiving device begins receiving data through the channel that needs to be switched to active state.

[0146] However, using the scheme shown in Figure 1d, the time (corresponding to Tw) required from receiving the speed-up command to the channel completing the switch from non-working to working state is relatively long, at least the time corresponding to two AM cycles. Assuming the channel (e.g., subPHY) rate is 20Gbps, a complete AM cycle corresponds to 2048 code words (CWs), each CW being 5440 bits, then Ts = 2048 * 5440 * 2 / 20 = 222.8 μs; assuming the channel rate is 100Gbps, a complete AM cycle corresponds to 2048 CWs, each CW being 5440 bits, then Ts = 2048 * 5440 * 2 / 100 = 111.4 μs. In other words, the Tw corresponding to the channel is on the order of hundreds of microseconds, which is quite long, resulting in poor energy-saving performance of FlexLane technology.

[0147] In view of this, embodiments of this application provide an energy-saving solution and device that can reduce the Tw of the channel, thereby improving the energy-saving effect.

[0148] Before introducing the solutions provided in the embodiments of this application, we will first introduce the possible application scenarios of this application.

[0149] Referring to Figures 2a to 2c, which illustrate three exemplary application scenarios of embodiments of this application.

[0150] As shown in Figure 2a, the transmitting and receiving devices are interconnected via SERDES. Both the transmitting and receiving devices include a MAC layer module, a PCS module, and a PMA module. The interconnection method shown in Figure 2a can be applied to scenarios such as chip interconnection, device interconnection, and board interconnection.

[0151] As shown in Figure 2b, the transmitting and receiving devices are interconnected via an optical lane. Both the transmitting and receiving devices include a MAC layer module, a PCS module, a PMA module, and an optical module. In both the transmitting and receiving devices, the PMA module and optical module are interconnected via SERDES. The optical module of the transmitting device includes a DSP, a driver, and a laser diode (LD). The optical module of the receiving device includes a photodiode (PD), a trans-impedance amplifier (TIA), and a DSP. The interconnection method shown in Figure 2b can be applied to short-distance or medium-distance optical interconnects. The DSP in the optical module can, for example, be an optical digital signal processor (oDSP). The optical module can be either a pluggable or non-pluggable type; this embodiment does not limit the type. Furthermore, this embodiment does not limit the speed of the optical module.

[0152] The difference between the scenario shown in Figure 2c and the scenario shown in Figure 2b is that neither the optical module of the transmitting device nor the optical module of the receiving device includes a DSP. The interconnection method shown in Figure 2c can be applied to short-distance optical interconnection.

[0153] In the scenarios shown in Figures 2a to 2c, both the transmitting and receiving devices can be network devices, such as switches or routers.

[0154] It should be noted that Figures 2a to 2c show three possible application scenarios, but the application scenarios of this solution are not limited to these three scenarios.

[0155] Next, referring to Figure 3, the communication method provided in the embodiments of this application will be described. Figure 3 is a schematic diagram of signaling interaction of a communication method provided in an embodiment of this application.

[0156] The method shown in Figure 3 can be applied to any of the application scenarios in Figures 2a to 2c. The first device in Figure 3 corresponds to the transmitting device in Figures 2a to 2c, and the second device in Figure 3 corresponds to the receiving device in Figures 2a to 2c. Wherein:

[0157] The first device corresponds to the transmitting device in Figures 2a to 2c, meaning that the first device can be the transmitting device in Figures 2a to 2c, or it can be a part of the transmitting device in Figures 2a to 2c. For example, the first device can be the transmitting device in Figure 2a; or the first device can be the transmitting device in Figure 2b, or the first device can be a chip in the transmitting device in Figure 2b that includes MAC, PCS, and PMA; or the first device can be the transmitting device in Figure 2c, or the first device can be a chip in the transmitting device in Figure 2c that includes MAC, PCS, and PMA.

[0158] The second device corresponds to the receiving device in Figures 2a to 2c. This means that the second device can be either the receiving device in Figures 2a to 2c or a part of the receiving device in Figures 2a to 2c. For example, the second device can be the receiving device in Figure 2a; or, the second device can be the receiving device in Figure 2b, or, the second device can be a chip in the receiving device in Figure 2b that includes a MAC, PCS, and PMA; or, the second device can be the receiving device in Figure 2c, or, the second device can be a chip in the receiving device in Figure 2c that includes a MAC, PCS, and PMA.

[0159] The first channel mentioned in Figure 3 refers to the end-to-end channel between the transmitting device and the receiving device. As shown in Figures 2a to 2c, the end-to-end channel between the transmitting device and the receiving device can include multiple sub-channels.

[0160] In the scenario shown in Figure 2a, the multi-segment sub-channels include: a sub-channel (i.e., subPHY) between the MAC and PMA of the transmitting device, a sub-channel between TX1 and RX1, and a sub-channel (i.e., subPHY) between the MAC and PMA of the receiving device.

[0161] In the scenarios shown in Figures 2b and 2c, each of the multiple sub-channels includes: a sub-channel (i.e., subPHY) between the MAC and PMA of the transmitting device, a sub-channel between TX1 and RX1, a sub-channel between RX1 and TX2, a sub-channel between TX2 and RX2, a sub-channel between RX2 and TX3, a sub-channel between TX3 and RX3, and a sub-channel (i.e., subPHY) between the MAC and PMA of the receiving device.

[0162] The method shown in Figure 3 includes the following steps S101-S102.

[0163] S101: The first device sends a first RAM to the second device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel. The first channel is the channel through which the first device sends data to the second device.

[0164] S102: The second device receives the first RAM sent by the first device.

[0165] In this application, a first device sends a first RAM to a second device, and correspondingly, the second device can receive the first RAM sent by the first device. This first RAM is used to trigger the second device to begin receiving data sent by the first device through a first channel. As an example, after receiving the first RAM, the second device can, in response to receiving the first RAM, begin receiving data sent by the first device through the first channel. That is, after receiving the first RAM, the second device no longer waits for AM (Active Data), but quickly begins receiving data sent by the first device through the first channel. The first RAM serves as the switching boundary for the second device to switch the state of the first channel from a non-operating state to an operating state.

[0166] Furthermore, after sending the first RAM, the first device can respond by sending the first RAM to the second device and begin sending data to the second device through the first channel. That is, after sending the first RAM, the first device no longer waits for AM, but quickly begins sending data to the second device through the first channel. The first RAM serves as the switching boundary for the first device to switch the state of the first channel from the non-working state to the working state.

[0167] In one example, the second device starting to receive data transmitted by itself through the first channel may include: the second device starting to receive data through its own subPHY included in the first channel. Similarly, the first device starting to transmit data to the second device through the first channel may include: the first device starting to transmit data to the second device through its own subPHY included in the first channel.

[0168] It should be noted that, for the first channel, the states of the multiple sub-channels included in the first channel should be consistent. This application does not limit the state switching control method for the other sub-channels included in the first channel besides the subPHY of the first device and the subPHY of the second device.

[0169] In one example, to ensure the reliability of channel state switching, the first device can send N RAMs to the second device. The first RAM can be the last RAM sent by the first device among the N RAMs. The first RAM is also the last RAM among the N RAMs received by the second device. That is, the first device sends N RAMs to the second device, and the last RAM among these N RAMs serves as the switching boundary between the first and second devices for switching the first channel from a non-working state to a working state. Both devices switch based on the same switching boundary, allowing the first channel to quickly complete the switch from a non-working state to a working state after the second device receives the first RAM.

[0170] The embodiments of this application do not specifically limit the specific value of N. N can be an integer greater than or equal to 2. For example, the value of N can be 36.

[0171] In this application, each of the N RAMs has the same structure. As an example, the RAM is a bit block of a specific length, for example, the length of the RAM is 120 bits. In one example, the structure of the RAM can be as shown in Figure 4a, which shows a schematic diagram of a RAM structure. The RAM structure shown in Figure 4a is modified based on the AM structure corresponding to 200G specified in IEEE 802.3. Specifically, the positions of CM3-CM5 and CM0-CM2 in the AM corresponding to 200G are interchanged, UP0 in the AM corresponding to 200G is modified to CD7, and UP1 in the AM corresponding to 200G is modified to CD3, thus obtaining the AM shown in Figure 4a.

[0172] In one example, each of the N RAMs carries a sequence number, which is used by the second device to determine the number of RAMs received. That is, the second device can determine the number of RAMs it has received based on the sequence numbers in the received RAMs. In this way, when the second device has received N RAMs, it can start receiving data through the first channel in response to receiving the last RAM (i.e., the first RAM).

[0173] In a specific example, the sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N. Taking N as 36 as an example, the first RAM sent by the first device carries sequence number 36, the second RAM sent by the first device carries sequence number 35, and so on, with the 35th RAM sent by the first device carrying sequence number 2, and the 36th RAM sent by the first device carrying sequence number 1. In this scenario, the second device can have consecutive sequence numbers in the N RAMs it receives, and upon receiving the RAM with sequence number 1 (i.e., the first RAM), it will start receiving data through the first channel in response to receiving the first RAM.

[0174] In another example, the sequence number carried in the i-th RAM sent by the first device is i, where i is an integer greater than or equal to 1 and less than or equal to N. Taking N as 36 as an example, the first RAM sent by the first device carries sequence number 1, the second RAM sent by the first device carries sequence number 2, and so on, with the 35th RAM sent by the first device carrying sequence number 35, and the 36th RAM sent by the first device carrying sequence number 36. In this scenario, the second device can have consecutive sequence numbers in the N RAMs it receives, and upon receiving the RAM with sequence number 36 (i.e., the first RAM), it will start receiving data through the first channel in response to receiving the first RAM.

[0175] In this application, for any RAM, the serial number carried by the RAM can be carried through any available field in the RAM. In one example, when the RAM includes CD3 and CD7 fields, for example, when the RAM adopts the structure shown in Figure 4a, the serial number can be carried by either the CD3 field or the CD7 field. In one example, there can be a certain relationship between the value carried by the CD3 field and the value carried by the CD7 field. For example, the value carried by the CD3 field can be obtained by inverting each bit of the CD7 field. For example, if the value carried by the CD3 field is 00000100, then the value carried by the CD7 field is 1111011.

[0176] In this application, the first device can send the N RAMs to the second device through multiple channels between the first device and the second device. These multiple channels include a first channel and a second channel that is in operation. That is, the first device can send N RAMs to the second device through each of these multiple channels. Correspondingly, the second device can receive N RAMs through each of these multiple channels. For any RAM (referred to as the fourth RAM) sent by the first device through these multiple channels, after receiving the fourth RAM through each of these multiple channels, the second device can perform deskew on the received fourth RAMs to align them with the multiple channels. Similarly, after receiving multiple first RAMs through these multiple channels, the second device can perform deskew on the received first RAMs to align them with the multiple channels, and after aligning the multiple channels, the second device can begin receiving data through the first channel.

[0177] In one example, the first device transmits data between any two adjacent RAMs of the N RAMs, spaced by a first preset length. The data between any two RAMs transmitted on the second channel can be either service data or idle (IDLE) data; this embodiment does not specifically limit this. As a concrete example, if the first device is sending service data to the second device during the time interval between any two RAM transmissions, then the data between any two RAMs transmitted on the second channel is service data. If the first device has no service data to send to the second device during the time interval between any two RAM transmissions, then the data between any two RAMs transmitted on the second channel is IDLE. Because the first channel has not yet switched to a working state, it cannot be used to transmit service data; therefore, the data between any two RAMs transmitted on the first channel can be IDLE.

[0178] This application does not specifically limit the first preset length. The first preset length can be determined, for example, based on the correction capability of the second device. Specifically, the first preset length can be a length that ensures the second device can successfully perform correction on multiple of the aforementioned fourth RAMs. The first device can, for example, negotiate its capabilities with the second device to determine the first preset length.

[0179] In one example, the data of the first preset length may include a preset number of bits, or the data of the first preset length may include a first number of FEC codewords. The first number is a positive integer. This application does not specifically limit the first number; as long as the interval between two adjacent RAMs is the first number of FEC codewords, it can ensure that the second device can successfully perform bias correction on multiple of the aforementioned fourth RAMs. As a specific example, the first number can be an integer greater than or equal to 1 and less than or equal to 32, for example, the first number is 8, or 4, or 2.

[0180] In one example, before executing S101, the first device may also send a first indication message to the second device. The first indication message instructs the second device to start receiving data sent by the first device through the first channel after receiving the first RAM. In one example, to ensure the reliability of the first indication message, the first device may send multiple first indication messages to the second device; for example, the first device may send three first indication messages to the second device.

[0181] After receiving the multiple first instruction messages, the second device can further receive the aforementioned N RAMs, and after receiving the aforementioned first RAMs, it quickly begins to receive data through the first channel.

[0182] In one example, the N RAMs sent by the first device to the second device are located within the same AM cycle. For two adjacent AMs sent by the first device to the second device, the N RAMs are all located between these two AMs. For ease of description, these two adjacent AMs are referred to as the first AM and the second AM, respectively. The first AM is the AM preceding the second AM; that is, the first device first sends the first AM to the second device, and after sending the first AM, it sends the second AM. Therefore, the aforementioned N RAMs are all located between the first AM and the second AM.

[0183] In one example, the aforementioned first indication information is also located between the first AM and the second AM, that is, the aforementioned N RAMs and the first indication information are both located within the same AM cycle. In this case, using the solution of the embodiments of this application, the time from when the first device sends the first indication information to when it sends the N RAMs can be reduced to within 1 AM cycle, thereby effectively reducing the wake-up time of the first channel.

[0184] In another example, the aforementioned first indication information and the aforementioned N RAMs can also be located in different AM cycles. Assuming that the third AM is the AM preceding the first AM in the AM sent by the first device to the second device, the first indication information can be located between the first AM and the third AM.

[0185] This application does not specifically limit the content of the first indication information. In one example, the first indication information includes at least information for indicating that the first channel is switched from a non-working state to a working state.

[0186] In another example, for ease of description, the first of the aforementioned N RAMs will be referred to as the "second RAM". In one example, the first indication information may also indicate the data length between the first RAM and the second RAM. In this way, the second device can determine the timing for starting to receive the aforementioned N RAMs and locking the second RAM based on the data length between the first RAM and the second RAM, so that the second device can receive and lock the N RAMs sent by the second device.

[0187] Regarding the second device locking RAM, its principle is the same as that of the second device locking AM. Both involve matching specific fields in RAM with a preset pattern. For example, matching the 48 bits of data CM3-CM5 and CM0-CM2 in RAM with the preset pattern. If the match is successful, it indicates that RAM locking is successful. In this application, although the principle of RAM locking is the same as that of AM locking, the structure of RAM in this application is different from that of AM. Therefore, the fields used for RAM locking and AM locking will also be different. Correspondingly, the preset pattern used for RAM locking is also different from that used for AM locking.

[0188] In one example, the data between the first indication information and the second RAM is spaced by a second preset length. This second preset length can be a pre-set default value. For example, the data of the second preset length can be a second number of FEC codewords. This embodiment does not specifically limit the second number; the second number can be a positive integer. As a specific example, the second number can be an integer greater than or equal to 30 and less than or equal to 20; for example, the second number can be 40. In a scenario where the first device sends multiple first indication messages to the second device, the data between the first indication information and the second RAM spaced by the second preset length can be the data between the first first indication information and the second RAM spaced by the second preset length.

[0189] In one example, the data length between the aforementioned first RAM and the second RAM can be calculated by the first device when sending the aforementioned first indication information. Refer to Figures 4b and 4c for further understanding. Figure 4b is a schematic diagram of data sent from a first device to a second device according to an embodiment of this application. Figure 4c is a schematic diagram of data sent from a first device to a second device according to another embodiment of this application.

[0190] As shown in Figure 4b, which illustrates the example where the first indication information and N RAMs are all located in the same AM cycle, the first device sends three first indication messages to the second device, followed by the sending of N RAMs. When sending the first indication message to the second device, the first device can determine the interval 401 between the first AM and the first indication message. Correspondingly, the interval 402 between the first indication message and the second RAM is fixed (e.g., 40 FEC codewords). Therefore, based on intervals 401 and 402, the first device can determine the data length 403 of the interval between the first AM and the second RAM. Specifically, the data length 403 of the interval between the first AM and the second RAM is equal to the sum of 402 and 401.

[0191] As shown in Figure 4c, which illustrates the example where the first indication information and N RAMs are located in different AM cycles, the first device sends three first indication messages to the second device, followed by the sending of N RAMs. When sending the first indication message to the second device, the first device can determine the interval 404 between the first AM and the first indication message. Correspondingly, the interval 405 between the first indication message and the second RAM is fixed (e.g., 40 FEC codewords). Therefore, based on intervals 404 and 405, the first device can determine the data length 406 of the interval between the first AM and the second RAM. Specifically, the data length 406 of the interval between the first AM and the second RAM is equal to 405 minus 404.

[0192] This application does not specifically limit the message format carrying the first indication information. In one example, the first indication information can be carried by a MAC frame. Refer to Figure 4d for understanding. Figure 4d is a schematic diagram of a Layer 2 frame structure carrying the first indication information provided by this application embodiment. As shown in Figure 4d, the Layer 2 frame includes: a PREAMBLE field, a start Frame delimiter (SFD) field, a reserved field, a message field (MSG_FIELD), a padding field, and a frame check sequence (FCS) field. Wherein:

[0193] The PREAMBLE field can have a value of 7B, which is defined by the standard Ethernet standard and will not be repeated here.

[0194] The SFD field is used to indicate that the Layer 2 frame is used for FlexLane negotiation, and the value of this field can be, for example, 0x3B.

[0195] Both reserved and padding are reserved.

[0196] The FCS field carries the Frame Check Sequence. The value of this field is determined in the same way as in standard Ethernet, and will not be repeated here. When either the first or second device does not support the FCS function, the value of this field is 0.

[0197] The MSG_FIELD field is used to carry first indication information, as shown in Figure 4b. The MSG_FIELD field includes:

[0198] The Message Type (MSG_TYPE) field indicates that the message indicates an increase in speed, i.e., switching the channel from a non-working state to a working state.

[0199] The SubPHYStatInd (SPSI) field consists of multiple bits, each indicating the status of a subPHY. Bit 0 corresponds to the smallest subPHY number. A bit value of 1 indicates that the subPHY corresponding to that bit is in an active state, meaning that the subPHY corresponding to that bit has been switched to an active state.

[0200] The codeword count (CWCnt) field carries the number of FEC codewords between the aforementioned first AM and second RAM.

[0201] Reserved field, currently undefined.

[0202] As described above, the solution of this application embodiment, compared to the conventional technology where the second device starts receiving data sent by the first device through the first channel based on the received AM trigger, has a much shorter RAM locking period than the AM locking period. Therefore, this solution allows the second device to quickly complete the operation of switching the first channel from a non-working state to a working state. Consequently, the first channel can quickly switch from a non-working state to a working state, effectively reducing the time required for the first channel to switch from a non-working state to a working state, and thus improving energy efficiency.

[0203] In one example, before the first device sends the first instruction information to the second device, the first device and the second device may also execute S201-S204 as shown in FIG5. FIG5 is a signaling interaction diagram of another communication method provided in the embodiments of this application.

[0204] By executing S201-S204, the channel quality of the first channel is ensured to meet the requirements. Then, with the channel quality of the first channel meeting the requirements, the first device sends a first instruction message to the second device and executes the method steps shown in Figure 2 to switch the first channel from a non-working state to a working state. The requirement that the channel quality of the first channel meets the requirements can be understood as the quality of the data transmitted through the first channel meeting the requirements (e.g., a low bit error rate) after the first channel is switched to a working state.

[0205] S201: The first device sends a channel detection message to the second device through the second channel, the channel detection message being used to instruct the second device to detect the first channel.

[0206] As described above, the second channel is also the channel through which the first device sends data to the second device. The difference between the second channel and the first channel is that the first channel is in a non-working state, while the second channel is in a working state.

[0207] This application does not specifically limit the format of the channel detection message, as long as the channel detection message can indicate that the first channel is being detected. In one example, the channel detection message can be carried by a Layer 2 frame. For example, when the Layer 2 frame adopts the structure shown in Figure 4c, the channel detection message is carried by the message field of the Layer 2 frame. In one example, the message type field and SPSI field in the message field can indicate that the Layer 2 frame carries the channel detection message. For example, the message type field in the message field indicates the message type of channel detection, and the bit corresponding to the first channel in the SPSI field is set (e.g., set to 1), thereby indicating that the first channel is being detected. In this scenario, the codeword count field in the message field can be reserved.

[0208] In one example, the first device may send the channel detection message to the second device in response to detecting an acceleration command. The acceleration command instructs to increase the rate at which the first device sends data to the second device. This application does not specifically limit the content of the acceleration command; in one example, the acceleration command may include a target rate, where the target rate is the rate at which the first device sends data to the second device after performing the acceleration operation. This application also does not specifically limit the object that generates the acceleration command; in one example, the acceleration command may be generated by a controller; in another example, the acceleration command may be generated by the processor of the network device to which the first device belongs, which will not be described in detail here.

[0209] S202: The second device receives the channel detection message sent by the first device through the second channel.

[0210] The second device can receive the channel detection message sent by the first device through the second channel. After receiving the channel detection message, the second device can initiate the channel detection process for the first channel.

[0211] S203: The first device sends a third RAM and a preset code block to the second device through the first channel. The third RAM and the preset code block are used by the second device to detect the first channel.

[0212] S204: The second device receives the third RAM and the preset code block sent by the first device through the first channel.

[0213] After sending a channel detection message to the second device, the first device can send data to the second device through the first channel, so that the second device can detect the channel quality of the first channel based on the quality of the data received from the first channel.

[0214] In a specific example, the first device can send a third RAM and a preset code block to the second device through a first channel. Specifically, the first device can send multiple third RAMs and multiple preset code blocks to the second device through the first channel, wherein the data between any two adjacent third RAMs in the multiple third RAMs is the preset code block.

[0215] Similar to the data spaced between any two adjacent RAMs of the aforementioned N RAMs by a first preset length, any two adjacent third RAMs of the plurality of third RAMs are also spaced between data of a certain length, for example, the length of a third number of FEC codewords. The third number can be an integer greater than or equal to 1, for example, 2, 4, or 8.

[0216] In one example, each of the third RAMs carries a first value, which can be any value different from the aforementioned N; for example, the first value can be 255. In a specific example, the first value can be carried through the CD3 field or the CD7 field of the third RAM.

[0217] The embodiments of this application do not specifically limit the preset code block. The preset code block may be a PCS code block, for example, the preset code block may be an IDLE code block.

[0218] In one example, after receiving the third RAM and the preset code block, the second device can lock the third RAM. After locking the third RAM, the FEC codeword can be further recovered based on the data received through the first channel, and the FEC codeword can be decoded to determine the error rate of the FEC codeword. The error rate of the FEC codeword mentioned here may include one or more of the following: symbol error ratio (SER), bit error ratio (BER), or codeword error ratio (CER). The error rate of the FEC codeword can be used to characterize the channel quality of the first channel, and the second device can determine that the channel quality of the first channel meets the requirements when the error rate of the FEC codeword is low. As a specific example, the second device can determine that the channel quality of the first channel meets the requirements based on the low error rates determined by a certain number of FEC codewords. This application embodiment does not specifically limit the certain number; this certain number can be set according to actual conditions.

[0219] For details on how to lock the third RAM, please refer to the previous section on RAM locking; it will not be repeated here.

[0220] In this application, since the locking period of the third RAM is much shorter than the locking period of the AM, the second device performs channel detection on the first channel based on the third RAM and the preset code block, which is much more efficient than the locking efficiency of the two AMs shown in Figure 1d. Therefore, the method shown in Figure 5 can effectively reduce the time required for channel detection of the first channel compared to Figure 1d.

[0221] In one example, if the second device determines that the first channel has passed the detection, it can send a channel detection response message to the first device, which indicates that the first channel has passed the detection. Passing the detection means that the channel quality of the first channel meets the requirements. Accordingly, upon receiving the channel detection response message, the first device can send first indication information to the second device and execute the method steps shown in Figure 3 to switch the first channel from a non-working state to a working state.

[0222] This application does not specifically limit the format of the channel detection response message. In one example, the channel detection response message can be carried by a Layer 2 frame. For example, when the Layer 2 frame adopts the structure shown in Figure 4c, the channel detection response message is carried by the message field of the Layer 2 frame. In one example, the message type field in the message field can indicate that the Layer 2 frame carries the channel detection response message. For example, the message type field in the message field indicates the message type as channel detection response. Optionally, the bit corresponding to the first channel in the SPSI field is set (e.g., set to 1), thereby indicating that the first channel has passed detection. In this scenario, the codeword count field in the message field can be reserved.

[0223] Additionally, during the time period when the first device sends the third RAM and preset code block to the second device through the first channel, the first device can send a fifth RAM to the second device through the second channel. The fifth RAM carries a second value different from the first value; for example, the second value could be 36. Furthermore, the first device can send multiple fifth RAMs to the second device through the second channel, where the data between any two adjacent fifth RAMs is service data or IDLE. In one example, any two adjacent fifth RAMs are also separated by a certain length of data, for example, the length of a fourth number of FEC codewords. The fourth number can be an integer greater than or equal to 1; for example, the fourth number could be 2, 4, or 8.

[0224] Based on the methods provided in the above embodiments, a possible embodiment of the present application will be described next with reference to FIG6a and FIG6b.

[0225] Figure 6a is a schematic diagram of a first device performing channel state switching according to an embodiment of this application. Figure 6b is a schematic diagram of a second device performing channel state switching according to an embodiment of this application.

[0226] The first device and the second device include at least four end-to-end channels. Figure 6a shows the four subPHYs corresponding to the first device, and Figure 6b shows the four subPHYs corresponding to the second device. Two of these four end-to-end channels (corresponding to channel 1 and channel 2) are in operation, while the other two channels (corresponding to channel 3 and channel 4) are inactive.

[0227] As shown in Figure 6a:

[0228] 1. The first device detects the speed-up command, initiates the speed-up operation, and increases the number of channels used for data transmission.

[0229] Specifically, the first device determines that channels 3 and 4 will be added and sends data to the second device. That is, it determines that channels 3 and 4 are the channels to be added.

[0230] 2. The first device sends three channel detection messages to the second device.

[0231] 3. After the last channel detection message is sent, send a RAM with the value 36 on channel 1 and channel 2, and send an IDLE code block and a RAM with the value 255 on the channel to be added.

[0232] In Figures 6a and 6b, RAM(255) represents a RAM carrying the value 255, and RAM(36) represents a RAM carrying the value 36.

[0233] 4. After receiving the channel detection response message sent by the second device, the first device sends three first indication messages to the second device, and plans to perform boundary switching on the last RAM of the 36 RAMs following the first indication messages.

[0234] As shown in Figure 6b:

[0235] 1. The second device receives the channel detection message sent by the first device, performs RAM locking on the channel to be added based on the channel detection message, and receives the IDLE code block and RAM carrying the value 255 on the channel to be added.

[0236] The second device can perform channel detection on the channel to be added by receiving an IDLE code block and a RAM carrying a value of 255 on the channel to be added.

[0237] 2. The second device determines that the channel to be added has passed the detection and sends a channel detection response message to the first device.

[0238] 3. The second device receives the first instruction information sent by the first device and starts preparing to receive subsequent RAM.

[0239] 4. The second device receives RAM. The second device determines that it has received 36 RAMs. When the last RAM is received, the last received RAM (corresponding to the first RAM in the above embodiment) is used as the switching boundary, and the data stream is started to be received from the subPHY to be added (corresponding to the first channel in the above embodiment).

[0240] For the schemes shown in Figures 6a and 6b, the data length L between the first device sending the first indication information and sending the last RAM is: 3 * length of the first indication information + a1 * CWs + 40 * CWs + 36 * RAMs + 35 * a2 * CWs, where:

[0241] a1 is the number of FEC codewords between two adjacent first indication messages, and its value can be 2.

[0242] 40*CWs represents the data length between the first indication message and the first RAM.

[0243] 36*RAMs indicates a data length of 36 RAM bytes.

[0244] a2 represents the data length between two adjacent RAMs, and its value can be 2.

[0245] When the subPHY rate is 20Gbps, the duration corresponding to L is approximately 12.2 microseconds. When the subPHY rate is 100Gbps, the duration corresponding to L is approximately 6.1 microseconds.

[0246] Furthermore, using the schemes shown in Figures 6a and 6b, the time interval between the first device receiving the speed-up command and the first device receiving the channel detection response message is much shorter than the time required to lock the two AMs. Therefore, this scheme can effectively reduce the wake-up time of the first channel, thereby improving energy efficiency.

[0247] Figures 6c and 6d illustrate another possible embodiment of the present application. The flow executed by the first device in Figure 6c is the same as that executed by the first device in Figure 6a, and the flow executed by the second device in Figure 6d is the same as that executed by the second device in Figure 6b. The difference is that in the embodiments corresponding to Figures 6a and 6b, the 36 RAMs and 3 first indication information are located in the same AM cycle. However, in the embodiments shown in Figures 6c and 6d, the 36 RAMs and 3 first indication information are located in different AM cycles.

[0248] For the steps performed by the first device in Figure 6c, please refer to the description of Figure 6a above, and it will not be repeated here; for the steps performed by the second device in Figure 6d, please refer to the description of the corresponding Figure 6b above, and it will not be repeated here.

[0249] Based on the communication methods provided in the above embodiments, this application also provides a corresponding communication device. Next, the communication device provided in the embodiments of this application will be described in conjunction with the accompanying drawings.

[0250] Referring to Figure 7, this figure is a schematic diagram of the structure of a communication device provided in an embodiment of this application. The communication device 700 shown in Figure 7 is applied to a first device and is used to perform the steps performed by the first device in the above embodiments.

[0251] As shown in Figure 7, the communication device 700 includes a transmitting unit 701 and a processing unit 702, wherein the processing unit 702 is optional.

[0252] The sending unit 701 is used to send a first fast alignment mark RAM to the second device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel. The first channel is the channel through which the first device sends data to the second device.

[0253] The processing unit 702 is used to insert the first RAM.

[0254] In one possible implementation, the sending unit 701 is specifically used to: send N RAMs to the second device, wherein the first RAM is the last RAM received by the second device among the N RAMs.

[0255] In one possible implementation, the N RAMs are spaced apart by a first preset length of data between any two adjacent RAMs.

[0256] In one possible implementation, the data of the first preset length includes: a first number of forward error correction (FEC) codewords, where the first number is a positive integer.

[0257] In one possible implementation, the first quantity is greater than or equal to 1 and less than or equal to 32.

[0258] In one possible implementation, the sending unit 701 is further configured to: in response to sending the first RAM to the second device, start sending data to the second device through the first channel.

[0259] In one possible implementation, the sending unit 701 is further configured to send a first indication message to the second device before sending the first RAM to the second device, the first indication message indicating that the second device will start receiving data sent by the first device through the first channel after receiving the first RAM.

[0260] In one possible implementation, the N RAMs sent by the first device to the second device are all located between the first alignment mark AM and the second alignment mark AM, where the first AM and the second AM are two adjacent AMs.

[0261] In one possible implementation, the first indication information is located between the first AM and the second AM.

[0262] In one possible implementation, the first AM is the AM preceding the second AM, and the first indication information also indicates the data length of the interval between the first AM and the second RAM, wherein the second RAM is the first RAM among N RAMs including the first RAM.

[0263] In one possible implementation, the first indication information and the second RAM are spaced apart by a second preset length of data.

[0264] In one possible implementation, each of the N RAMs carries a sequence number, which is used by the second device to determine the number of received RAMs.

[0265] In one possible implementation, the sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N.

[0266] In one possible implementation, the serial number is carried via a countdown CD3 field or a CD7 field in RAM.

[0267] In one possible implementation, the sending unit 701 is further configured to send a channel detection message to the second device via a second channel before sending the first indication information to the second device. The channel detection message is used to instruct the second device to detect the first channel. The second channel is different from the first channel, and the second channel is in an active state while the first channel is in a non-active state. The third RAM and the preset code block are sent to the second device via the first channel. The third RAM and the preset code block are used by the second device to detect the first channel.

[0268] In one possible implementation, the third RAM carries the first value.

[0269] In one possible implementation, the apparatus further includes: a receiving unit, configured to receive a channel detection response message sent by the second apparatus, the channel detection response message indicating that the first channel has passed detection; the step of sending the first indication information to the second apparatus includes: in response to receiving the channel detection response message, sending the first indication information to the second apparatus through the second channel.

[0270] In one possible implementation, the sending unit 701 is specifically used to send the first RAM to the second device through the first channel and the second channel.

[0271] In one possible implementation, the data transmitted between two adjacent RAMs on the first channel is idle data; the data transmitted between two adjacent RAMs on the second channel is service data or idle data.

[0272] In one possible implementation, sending the channel detection message to the second device via the second channel includes: in response to detecting an acceleration command, sending the channel detection message to the second device, the acceleration command indicating an increase in the rate at which the first device sends data to the second device.

[0273] Referring to Figure 8, this figure is a schematic diagram of another communication device provided in an embodiment of this application. The communication device 800 shown in Figure 8 is applied to the second device and is used to perform the steps performed by the second device in the above embodiments.

[0274] As shown in Figure 8, the communication device 800 includes a receiving unit 801 and a processing unit 802, wherein the processing unit 802 is optional.

[0275] The receiving unit 801 is used to receive a first fast alignment mark RAM sent by the first device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel. The first channel is the channel through which the first device sends data to the second device.

[0276] Optionally, the processing unit 802 is used to lock the first RAM.

[0277] In one possible implementation, the receiving unit 801 is specifically configured to: receive N RAMs sent by the first device, wherein the first RAM is the last RAM received by the second device among the N RAMs.

[0278] In one possible implementation, the N RAMs are spaced apart by a first preset length of data between any two adjacent RAMs.

[0279] In one possible implementation, the data of the first preset length includes: a first number of forward error correction (FEC) codewords, where the first number is a positive integer.

[0280] In one possible implementation, the first quantity is greater than or equal to 1 and less than or equal to 32.

[0281] In one possible implementation, the receiving unit 801 is further configured to: in response to receiving the first RAM, begin receiving data sent by the first device through the first channel.

[0282] In one possible implementation, the receiving unit 801 is further configured to receive first indication information sent by the first device before receiving the first RAM sent by the first device, the first indication information indicating that the second device starts receiving data sent by the first device through the first channel after receiving the first RAM.

[0283] In one possible implementation, the N RAMs sent by the first device to the second device are all located between the first alignment mark AM and the second alignment mark AM, where the first AM and the second AM are two adjacent AMs.

[0284] In one possible implementation, the first indication information is located between the first AM and the second AM.

[0285] In one possible implementation, the first AM is the AM preceding the second AM, and the first indication information also indicates the data length of the interval between the first AM and the second RAM, wherein the second RAM is the first RAM among N RAMs including the first RAM.

[0286] In one possible implementation, the first indication information and the second RAM are spaced apart by a second preset length of data.

[0287] In one possible implementation, each of the N RAMs carries a sequence number, which is used by the second device to determine the number of received RAMs.

[0288] In one possible implementation, the sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N.

[0289] In one possible implementation, the serial number is carried via a countdown CD3 field or a CD7 field in RAM.

[0290] In one possible implementation, the receiving unit 801 is further configured to receive a channel detection message sent by the first device through a second channel before receiving the first indication information sent by the first device. The channel detection message is used to instruct the second device to detect the first channel. The second channel is different from the first channel, and the second channel is in an active state while the first channel is in a non-active state. The receiving unit 801 is also configured to receive a third RAM and a preset code block sent by the first device through the first channel. The third RAM and the preset code block are used by the second device to detect the first channel.

[0291] In one possible implementation, the third RAM carries the first value.

[0292] In one possible implementation, the apparatus further includes: a sending unit, configured to send a channel detection response message to the first apparatus in response to the first channel passing detection, the channel detection response message indicating that the first channel has passed detection; the receiving of the first indication information sent by the first apparatus includes: receiving the first indication information sent by the first apparatus through the second channel, the first indication information being sent by the first apparatus to the second apparatus in response to receiving the channel detection response message.

[0293] In one possible implementation, the receiving unit 801 is specifically configured to: receive the first RAM sent by the first device through the first channel and the second channel.

[0294] In one possible implementation, the data transmitted between two adjacent RAMs on the first channel is idle data; the data transmitted between two adjacent RAMs on the second channel is service data or idle data.

[0295] Referring to Figure 9, this figure is a schematic diagram of the structure of a communication device provided in an embodiment of this application. The communication device 900 shown in Figure 9 includes an interface circuit 901 and a processing circuit 902. The interface circuit 901 is used to receive and / or transmit data, and the processing circuit 902 is used to perform data processing. The processing circuit 902 is optional.

[0296] In a specific example, the communication device 900 is used to perform the steps performed by the first device as provided in the above embodiments. In this case:

[0297] The interface circuit 901 is used to send a first fast alignment mark RAM to the second device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel. The first channel is the channel through which the first device sends data to the second device.

[0298] Optionally, the processing circuit 902 is used to insert the first RAM.

[0299] In yet another specific example, the communication device 900 is used to perform the steps provided in the above embodiments by the second device. For this situation:

[0300] The interface circuit 901 is used to receive a first fast alignment mark RAM sent by the first device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel. The first channel is the channel through which the first device sends data to the second device.

[0301] Optionally, the processing circuit 902 is used to lock the first RAM.

[0302] In one example, the device shown in Figure 9 can be a network device or a chip, wherein the chip can be, for example, a PHY chip.

[0303] In another example, the device shown in Figure 9 could be an optical module.

[0304] Referring to Figure 10, this figure is a schematic diagram of the structure of a device provided in an embodiment of this application.

[0305] In one example, the device 1000 shown in FIG10 can be used to perform the communication method provided in the above method embodiments.

[0306] Referring to Figure 10, the device 1000 includes a processor 1010 and a communication interface 1020. The processor 1010 is optional. The device 1000 can have one or more processors 1010; Figure 10 shows an example with one processor. The processor 1010 is used to execute the communication method provided in the above method embodiments.

[0307] Processor 1010 may be a central processing unit (CPU), an NP, or a combination of CPU and NP. Processor 1010 may further include hardware chips. The aforementioned hardware chips may be ASICs, programmable logic devices (PLDs), or combinations thereof. The aforementioned PLD may be complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), generic array logic (GALs), or any combination thereof.

[0308] The communication interface 1020 is used to receive and / or send data.

[0309] In a specific example, the device 1000 is used to perform the steps provided by the first device in the above embodiments. In this case:

[0310] The communication interface 1020 is used to send a first fast alignment mark RAM to the second device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel. The first channel is the channel through which the first device sends data to the second device.

[0311] Optionally, the processor 1010 is used to insert the first RAM.

[0312] In yet another specific example, the device 1000 is used to perform the steps provided in the above embodiments by the second device. In this case:

[0313] The communication interface 1020 is used to receive a first fast alignment mark RAM sent by the first device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel. The first channel is the channel through which the first device sends data to the second device.

[0314] Optionally, the processor 1010 is used to lock the first RAM.

[0315] In one example, the device 1000 further includes a memory 1030. The memory 1030 may include volatile memory, such as random-access memory (RAM); the memory 1030 may also include non-volatile memory, such as flash memory, hard disk drive (HDD), or solid-state drive (SSD); the memory 1030 may also include combinations of the above types of memory.

[0316] Optionally, the memory 1030 stores an operating system and programs, executable modules, or data structures, or subsets thereof, or extended sets thereof. The programs may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and handling hardware-based tasks. The processor 1010 can read the programs in the memory 1030 to implement the methods provided in the embodiments of this application.

[0317] In one example, the processor 1010, communication interface 1020, and memory 1030 can be connected via a bus system or other means, with Figure 10 showing an example of connection via bus system 1040.

[0318] The bus system 1040 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system 1040 can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used in Figure 10, but this does not indicate that there is only one bus or one type of bus.

[0319] This application provides a computer-readable storage medium, including instructions or a computer program, which, when run on a computer, causes the computer to perform the methods described in the above method embodiments.

[0320] This application provides a computer program product containing instructions or computer programs, which, when run on a computer, causes the computer to perform the methods described in the above method embodiments.

[0321] This application also provides a communication system, which includes the first device and the second device mentioned in the above embodiments, for executing the method provided in the above embodiments by the first device and the second device.

[0322] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0323] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0324] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical business division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

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

[0326] Furthermore, the various business units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software business unit.

[0327] If the integrated unit is implemented as a software business unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0328] Those skilled in the art will recognize that, in one or more of the examples above, the services described in this application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these services can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers.

[0329] The above specific embodiments further illustrate the purpose, technical solution and beneficial effects of this application. It should be understood that the above are only specific embodiments of this application.

[0330] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A communication method, characterized in that, Applied to a first device, the method includes: A first fast alignment mark RAM is sent to the second device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel, which is the channel through which the first device sends data to the second device.

2. The method according to claim 1, characterized in that, Sending the first RAM to the second device includes: N RAMs are sent to the second device, where the first RAM is the last RAM received by the second device among the N RAMs.

3. The method according to claim 2, characterized in that, Data of a first preset length is spaced between any two adjacent RAMs in the N RAMs.

4. The method according to claim 3, characterized in that, The first preset length of data includes: The first number of forward error correction (FEC) codewords, where the first number is a positive integer.

5. The method according to claim 4, characterized in that, The first quantity is greater than or equal to 1 and less than or equal to 32.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: In response to sending the first RAM to the second device, data is started to be sent to the second device through the first channel.

7. The method according to any one of claims 1-6, characterized in that, Before sending the first RAM to the second device, the method further includes: Send a first instruction message to the second device, the first instruction message instructing the second device to start receiving data sent by the first device through the first channel after receiving the first RAM.

8. The method according to claim 7, characterized in that, The N RAMs sent from the first device to the second device are all located between the first alignment mark AM and the second alignment mark AM, and the first AM and the second AM are two adjacent AMs.

9. The method according to claim 8, characterized in that, The first indication information is located between the first AM and the second AM.

10. The method according to claim 8 or 9, characterized in that, The first AM is the AM preceding the second AM, and the first indication information also indicates the data length of the interval between the first AM and the second RAM, wherein the second RAM is the first RAM among N RAMs including the first RAM.

11. The method according to any one of claims 2-5, characterized in that, Each of the N RAMs carries a serial number, which is used by the second device to determine the number of received RAMs.

12. The method according to claim 11, characterized in that, The sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N.

13. The method according to claim 11 or 12, characterized in that, The serial number is carried in the countdown CD3 field or CD7 field in RAM.

14. The method according to any one of claims 7-13, characterized in that, Before sending the first indication information to the second device, the method further includes: A channel detection message is sent to the second device through the second channel. The channel detection message is used to instruct the second device to detect the first channel. The second channel is different from the first channel. The second channel is in an active state, while the first channel is in a non-active state. The third RAM and preset code block are sent to the second device through the first channel. The third RAM and preset code block are used by the second device to detect the first channel.

15. The method according to claim 14, characterized in that, The third RAM carries the first value.

16. The method according to claim 14 or 15, characterized in that, The method further includes: Receive a channel detection response message sent by the second device, the channel detection response message being used to indicate that the first channel has passed the detection; Sending the first instruction information to the second device includes: In response to receiving the channel detection response message, the first indication information is sent to the second device through the second channel.

17. The method according to any one of claims 14-16, characterized in that, Sending the first fast alignment mark RAM to the second device includes: The first RAM is sent to the second device through the first channel and the second channel.

18. The method according to claim 17, characterized in that, The data transmitted on the first channel between two adjacent RAMs is idle. The data transmitted between two adjacent RAMs on the second channel is either service data or IDLE.

19. A communication method, characterized in that, Applied to a second device, the method includes: The device receives a first fast alignment mark RAM sent by the first device. The first RAM is used to trigger the second device to start receiving data sent by the first device through a first channel, whereby the first channel is the channel through which the first device sends data to the second device.

20. The method according to claim 19, characterized in that, The first RAM received by the first device includes: The device receives N RAMs sent by the first device, wherein the first RAM is the last RAM received by the second device among the N RAMs.

21. The method according to claim 20, characterized in that, Data of a first preset length is spaced between any two adjacent RAMs in the N RAMs.

22. The method according to claim 21, characterized in that, The first preset length of data includes: The first number of forward error correction (FEC) codewords, where the first number is a positive integer.

23. The method according to claim 22, characterized in that, The first quantity is greater than or equal to 1 and less than or equal to 32.

24. The method according to any one of claims 19-23, characterized in that, The method further includes: In response to receiving the first RAM, the system begins to receive data sent by the first device through the first channel.

25. The method according to any one of claims 19-24, characterized in that, Before receiving the first RAM sent by the first device, the method further includes: The device receives a first instruction message sent by the first device, which instructs the second device to start receiving data sent by the first device through the first channel after receiving the first RAM.

26. The method according to claim 25, characterized in that, The N RAMs sent from the first device to the second device are all located between the first alignment mark AM and the second alignment mark AM, and the first AM and the second AM are two adjacent AMs.

27. The method according to claim 26, characterized in that, The first indication information is located between the first AM and the second AM.

28. The method according to claim 26 or 27, characterized in that, The first AM is the AM preceding the second AM, and the first indication information also indicates the data length of the interval between the first AM and the second RAM, wherein the second RAM is the first RAM among N RAMs including the first RAM.

29. The method according to any one of claims 20-23, characterized in that, Each of the N RAMs carries a serial number, which is used by the second device to determine the number of received RAMs.

30. The method according to claim 29, characterized in that, The sequence number carried in the i-th RAM sent by the first device is N-i+1, where i is an integer greater than or equal to 1 and less than or equal to N.

31. The method according to claim 29 or 30, characterized in that, The serial number is carried in the countdown CD3 field or CD7 field in RAM.

32. The method according to any one of claims 25-31, characterized in that, Before receiving the first indication information sent by the first device, the method further includes: The second channel receives a channel detection message sent by the first device. The channel detection message is used to instruct the second device to detect the first channel. The second channel is different from the first channel. The second channel is in a working state, while the first channel is in a non-working state. The third RAM and preset code block sent by the first device are received through the first channel. The third RAM and preset code block are used by the second device to detect the first channel.

33. The method according to claim 32, characterized in that, The third RAM carries the first value.

34. The method according to claim 32 or 33, characterized in that, The method further includes: In response to the first channel passing the detection, a channel detection response message is sent to the first device, the channel detection response message being used to indicate that the first channel has passed the detection; The receipt of the first indication information sent by the first device includes: The first indication information sent by the first device is received through the second channel. The first indication information is sent by the first device to the second device in response to receiving the channel detection response message.

35. The method according to any one of claims 32-34, characterized in that, The receiving of the first fast alignment mark RAM sent by the first device includes: The first RAM is received from the first device through the first channel and the second channel.

36. The method according to claim 35, characterized in that, The data transmitted on the first channel between two adjacent RAMs is idle. The data transmitted between two adjacent RAMs on the second channel is either service data or IDLE.

37. A communication device, characterized in that, It includes a processor and a communication interface, wherein the communication interface is used to perform the receiving operation or the sending operation of any one of claims 1-36, and the processor is used to perform other operations of any one of claims 1-36 besides the receiving operation and the sending operation.

38. A communication system, characterized in that, The system includes: A first apparatus for performing the method according to any one of claims 1-18, and a second apparatus for performing the method according to any one of claims 19-36.

39. A chip, characterized in that, The chip includes an interface circuit and a processing circuit. The interface circuit is used to perform a receiving operation or a transmitting operation as described in any one of claims 1-36, and the processing circuit is used to perform other operations as described in any one of claims 1-36 besides the receiving operation and the transmitting operation.

40. A computer-readable storage medium, characterized in that, The system stores instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-36.

41. A computer program product, characterized in that, The computer program product includes instructions or a computer program that, when run on a computer, causes the computer to perform the method described in any one of claims 1-36.