Data processing method and device

By introducing control information into the physical layer module of the communication device to determine the working mode, the problem of high power consumption of the physical layer module in traditional technology is solved, and the low power consumption mode when processing invalid data is realized, which improves energy efficiency.

CN120128645APending Publication Date: 2025-06-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311683913.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-07
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

When the communication device transmits data, the physical layer module is always in normal mode, resulting in excessive power consumption. Especially when sending IDLE code streams, the physical layer transmits invalid data, causing waste.

Method used

By introducing control information into the physical layer module of the communication device, indicating whether valid data is included in the data stream, thereby determining the operating mode. Specifically, the first module (such as the MAC layer module) acquires the data flow and control information, and sends it to the physical layer module. The physical layer module decides to use a normal mode or a low-power mode when processing the data flow based on the control information.

Benefits of technology

It effectively reduces the power consumption of the physical layer module, especially when processing invalid data, by switching to low-power mode, unnecessary processing and transmission are reduced and energy efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120128645A_ABST
    Figure CN120128645A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method which is applied to a communication device serving as a sending end. The communication device comprises a first module and a second module, wherein the second module is a physical layer module. The first module obtains the first data flow and control information and sends the first data flow and the control information to the second module, and the control information indicates whether the first data flow comprises valid data or not. The second module determines a working mode of the second module when the second module processes the first data stream according to the control information, and the working mode comprises a normal mode or a low-power-consumption mode. In other words, the physical layer module is not always in the normal mode, but can determine whether the first data stream includes valid data according to the control information, thereby determining the own working mode. By adopting the scheme, the physical layer module can work in a normal mode and also can work in a low-power-consumption mode, so that the power consumption of the physical layer module is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and in particular, to a data processing method and apparatus. Background Art

[0002] When a communication device transmits data, it can process the data according to the seven-layer Open System Interconnection (OSI) model. The first layer of the OSI seven-layer model is the physical layer, and the second layer is the data link layer, which includes the Media Access Control (MAC) layer. Among them, after the MAC layer on the sending side receives the data sent by the upstream device or the upper-layer service, it sends the received data to the physical layer. When the MAC layer does not receive the data sent by the upstream device or the upper-layer service, it will send an idle (IDLE) code stream to the physical layer to ensure the continuity of the physical layer code stream. The physical layer on the receiving side will send all the data streams from the sending side to the MAC layer on the receiving side for processing, including valid data and IDLE data. After the MAC layer removes the IDLE data, it then sends the valid data to other devices or the upper-layer service. During the period when the MAC layer on the sending side sends the IDLE code stream, the physical layer actually transmits invalid data, and the processing of invalid data by the physical layer has the problem of wasting power consumption.

[0003] Therefore, there is an urgent need for a solution to solve the above problems. Summary of the Invention

[0004] The embodiments of this application provide a data processing method, which can effectively reduce the power consumption of the physical layer module.

[0005] In a first aspect, the embodiments of this application provide a data processing method, which can be applied to a communication device acting as a sending end. The communication device includes a first module and a second module, and the second module is a physical layer module. The first module can obtain a first data stream and control information, and the control information can indicate whether the first data stream includes valid data. After the first module obtains the first data stream and the control information, it sends the first data stream and the control information to the second module. After the second module receives the first data stream and the control information, it can determine the working mode of the second module when processing the first data stream according to the control information. The working mode can include a normal mode or a low-power mode. In other words, the second module as the physical layer module does not always operate in the normal mode, but can determine whether the first data stream includes valid data according to the control information, so as to determine its own working mode. With this solution, the physical layer module may operate in the normal mode or the low-power mode. Compared with the traditional technology in which the physical layer module always operates in the normal mode, this solution can effectively reduce the power consumption of the physical layer module.

[0006] In a possible implementation, the first module may be a MAC layer module. In other words, the MAC layer module may send control information indicating whether the first data stream includes valid data to the physical layer module, so that the physical layer module can determine its working mode when processing the first data stream based on this control information, so that the physical layer module can work in a low-power mode when the data included in the first data stream is invalid data, thereby effectively reducing the power consumption of the physical layer module.

[0007] In a possible implementation, the first module may be a physical layer sub-module different from the second module. For this case, the physical layer sub-module may send control information indicating whether the first data stream includes valid data to the second module, so that the second module can determine its working mode when processing the first data stream based on this control information, so that the second module can work in a low-power mode when the data included in the first data stream is invalid data, thereby effectively reducing the power consumption of the physical layer module.

[0008] In a possible implementation, the first data stream includes multiple code blocks, and the second module determines the working mode of the second module when processing the first data stream according to the control information. In a specific implementation, the working mode corresponding to each of the multiple code blocks when the second module processes them can be determined according to the control information. In other words, the working mode of the second module can be accurate to the code block granularity, thereby effectively reducing the power consumption of the physical layer module.

[0009] In a possible implementation, the control information includes sub-control information corresponding to each of the multiple code blocks, and each sub-control information indicates whether the code block corresponding to it includes valid data. Correspondingly, the second module can determine the working mode when processing the code block corresponding to the sub-control information according to each sub-control information. By adopting this method, the working mode of the second module can be accurate to the code block granularity, thereby effectively reducing the power consumption of the physical layer module.

[0010] In a possible implementation, if the foregoing multiple code blocks include a first code block and a second code block, and the control information indicates that the first code block includes valid data and the second code block does not include valid data. Then the second module can determine that the working mode of the second module when processing the first code block is the normal mode, and determine that the working mode of the second module when processing the second code block is the low-power mode. By adopting this method, when the second module processes the second code block, it can work in a low-power mode, thereby reducing the power consumption of the physical layer module.

[0011] In a possible implementation, if the control information indicates that each code block included in the first data stream includes valid data, the second module may, according to the control information, determine that the working mode of the second module when processing each code block included in the first data stream is the normal mode.

[0012] In a possible implementation, if the control information indicates that each code block included in the first data stream does not include valid data, the second module may, according to the control information, determine that the working mode of the second module when processing each code block included in the first data stream is the low-power mode. In this way, the second module operates in the low-power mode when processing the entire first data stream, thereby effectively reducing the power consumption of the physical layer module.

[0013] In a possible implementation, the physical layer module includes a physical coding sublayer (PCS) module. When the second module operates in the low-power mode, the PCS sub-module does not perform scrambling and / or forward error correction (FEC) coding operations. In other words, if the PCS sub-module operates in the low-power mode, the PCS sub-module does not perform scrambling operations and / or FEC coding operations on the first data stream, thereby reducing the power consumption of the PCS sub-module and correspondingly reducing the power consumption of the entire physical layer module.

[0014] In a possible implementation, the physical layer module includes a physical medium attachment (PMA) sub-module and a physical media dependent (PMD) sub-module. In order to balance the number of 0s and 1s in the data stream finally received by the PMD sub-module, in one example, when the working mode of the second module when processing the first data stream is the low-power mode, the PMA sub-module may change the first data stream sent to the PMD module into a pseudo-random code sequence, so that the number of 0s and 1s in the data stream received by the PMD sub-module is balanced.

[0015] In a possible implementation, the PCS sub-module performs a scrambling operation on the first data stream in the normal mode, stops performing a scrambling operation on the first data stream in the low-power mode, and when the PCS sub-module switches from the low-power mode to the normal mode, the scrambling seed used by the PCS sub-module to perform a scrambling operation on the first data stream is continuous with the scrambling seed used in the previous scrambling operation on the first data stream, so that the receiving end can normally descramble the received data stream.

[0016] In a possible implementation, before the first module acquires the first data stream and control information, it may acquire a second data stream, which may include indication information for indicating whether the first data stream includes valid data. Correspondingly, for this case, when the first module acquires the first data stream, it may generate control information capable of indicating whether the first data stream includes valid data based on the indication information.

[0017] In a possible implementation, the data obtained by processing the first data stream by the PCS sub-module and the data obtained by processing the second database by the PCS sub-module are within different alignment marker (AM) windows. The alignment word insertion sub-module included in the PCS sub-module is used to insert an AM. The data between two adjacent AMs can be understood as the data within an AM window. In a specific example, the data obtained by processing the second data stream by the PCS sub-module is between the first AM and the second AM, and the data obtained by processing the first data stream by the PCS sub-module is between the third AM and the fourth AM. In a specific example, the second AM and the third AM are the same, that is, the second data stream and the first data stream are the data within two adjacent AM windows. In another example, the second AM and the third AM may also be different.

[0018] In a possible implementation, the indication information can indicate the proportion of valid data included in the first data stream, and the code blocks carrying the valid data in the first data stream are evenly distributed in the first data stream. The second module may determine whether each code block included in the first data stream includes valid data according to the indication information.

[0019] In a possible implementation, the indication information may be carried by an Ethernet frame. In other words, the second data stream includes an Ethernet frame that carries the indication information. Correspondingly, the second module may parse the second data stream to obtain the Ethernet frame and acquire the indication information carried in the Ethernet frame, so as to determine the working mode of the second module when processing the first data stream based on the indication information.

[0020] In a possible implementation, a new Ethernet frame type can be defined, and this type of Ethernet frame is used to carry the foregoing indication information. In a possible implementation, the new Ethernet frame type can be indicated by the start frame delimiter (SFD) field of the Ethernet frame. In other words, in one example, the SFD field of the Ethernet frame can be used to indicate that the Ethernet frame carries the foregoing indication information. For this case, the second module can parse the second data stream to obtain the Ethernet frame, and determine that the Ethernet frame carries the indication information according to the SFD field of the Ethernet frame. Further, the indication information carried in the Ethernet frame can be obtained to facilitate determining the working mode of the second module when processing the first data stream based on the indication information.

[0021] In a possible implementation, when the first module obtains the second data stream, it can first determine whether there is valid data in the first data stream, and then generate a second data stream including the indication information based on the determination result of whether there is valid data in the first data stream. As a specific example, the first module can determine whether there is valid data in the first data stream according to the traffic ratio of valid data and invalid data and the data volume of valid data, where the traffic ratio of valid data and invalid data can characterize the distribution of valid data and invalid data, and the data volume of valid data can indicate the specific amount of valid data. Combining the foregoing distribution of valid data and invalid data, it is possible to determine whether there is valid data in the first data stream.

[0022] In a second aspect, an embodiment of the present application provides a data processing method, which can be applied to a communication device, and the communication device serves as a receiving end. The communication device includes a first module and a second module, and the second module is a physical layer module. The first module can receive a first data stream, and the first data stream includes indication information that can indicate whether there is valid data in the second data stream. After the first module obtains the first data stream including the indication information, it can send the indication information included in the first data stream to the second module. Correspondingly, the second module determines the working mode of the second module when processing the second data stream according to the indication information. The working mode can include a normal mode or a low-power mode. In other words, as the physical layer module, the second module is not always in the normal mode, but can determine whether there is valid data in the second data stream according to the indication information, so as to determine its own working mode. With this solution, the physical layer module may work in the normal mode or the low-power mode. Compared with the traditional technology in which the physical layer module is always in the normal mode, this solution can effectively reduce the power consumption of the physical layer module.

[0023] In a possible implementation, the first module is a Media Access Control (MAC) layer module or a physical layer sub-module, and the physical layer sub-module is different from the second module.

[0024] In a possible implementation, the first data stream and the second data stream are within different Alignment Word (AW) windows.

[0025] In a possible implementation, the second data stream is between a first AW and a second AW, and the first data stream is between a third AW and a fourth AW.

[0026] In a possible implementation, the indication information is specifically used to indicate the proportion of valid data included in the first data stream, and the code blocks carrying the valid data in the first data stream are evenly distributed in the first data stream.

[0027] In a possible implementation, the second data stream includes an Ethernet frame, and the Ethernet frame carries the indication information.

[0028] In a possible implementation, the Start Frame Delimiter (SFD) of the Ethernet frame indicates that the Ethernet frame carries the indication information.

[0029] In a possible implementation, the first data stream includes a plurality of code blocks. The second module determines the working mode of the second module when processing the first data stream according to the indication information. In a specific implementation, the working mode corresponding to each of the plurality of code blocks when the second module processes them can be determined according to the indication information. By adopting this method, the working mode of the second module can be accurate to the code block granularity, thereby effectively reducing the power consumption of the physical layer module.

[0030] In a possible implementation, if the foregoing plurality of code blocks include a first code block and a second code block, and the indication information indicates that the first code block includes valid data and the second code block does not include valid data. Then the second module can determine that the working mode of the second module when processing the first code block is the normal mode, and determine that the working mode of the second module when processing the second code block is the low-power mode. Since the working mode of the second module when processing the second code block is the low-power mode, therefore, this solution can reduce the power consumption of the physical layer module.

[0031] In a possible implementation, if the indication information indicates that each of the code blocks included in the first data stream includes valid data. Then the second module can determine that the working mode of the second module when processing each of the code blocks included in the first data stream is the normal mode.

[0032] In a possible implementation, if the indication information indicates that none of the code blocks included in the first data stream contains valid data, the second module may, according to the indication information, determine that the working mode of the second module when processing each code block included in the first data stream is the low-power mode, thereby effectively reducing the power consumption of the physical layer module.

[0033] In a possible implementation, when the second module operates in the low-power mode, it can be understood that the second module stops processing the received data stream. As a specific example, for the PMA sub-module included in the physical layer module, if the PMA sub-module operates in the low-power mode, the PMA sub-module discards the data from the PMD sub-module. In this way, the PCS sub-module cannot receive the data from the PMA sub-module. Correspondingly, the PCS sub-module does not need to perform processing operations such as FEC decoding and descrambling, thereby reducing the power consumption of the PCS sub-module and correspondingly reducing the power consumption of the entire physical layer module.

[0034] In a third aspect, an embodiment of the present application provides a communication device, which includes a first module and a second module, and the second module is a physical layer module; the first module is configured to obtain a first data stream and control information, where the control information indicates whether the first data stream contains valid data; and send the first data stream and the control information to the second module; the second module is configured to determine, according to the control information, the working mode of the second module when processing the first data stream, and the working mode includes: a normal mode or a low-power mode.

[0035] In a possible implementation, the first module is a media access control (MAC) layer module or a physical layer sub-module, and the physical layer sub-module is different from the second module.

[0036] In a possible implementation, the first data stream includes multiple code blocks, and the second module is specifically configured to: determine, according to the control information, the working mode corresponding to each of the multiple code blocks when the second module processes the code blocks.

[0037] In a possible implementation, the control information includes sub-control information corresponding to each of the multiple code blocks, and each sub-control information indicates whether the code block corresponding to it contains valid data.

[0038] In a possible implementation, the multiple code blocks include a first code block and a second code block. The control information indicates that the first code block includes valid data and the second code block does not include valid data. Specifically, the second module is configured to: determine, according to the control information, that the working mode of the second module when processing the first code block is the normal mode, and determine that the working mode of the second module when processing the second code block is the low-power mode.

[0039] In a possible implementation, the control information indicates that each code block included in the first data stream includes valid data. Specifically, the second module is configured to: determine that the working mode of the second module when processing each code block included in the first data stream is the normal mode.

[0040] In a possible implementation, the control information indicates that each code block included in the first data stream does not include valid data. Specifically, the second module is configured to: determine that the working mode of the second module when processing each code block included in the first data stream is the low-power mode.

[0041] In a possible implementation, the physical layer module includes a PCS sub-module. When the working mode of the second module when processing the first data stream is the low-power mode, the PCS sub-module does not perform a scrambling operation and / or a forward error correction (FEC) encoding operation on the first data stream.

[0042] In a possible implementation, the physical layer module includes a physical medium attachment (PMA) sub-module and a physical medium dependent (PMD) sub-module. The PMA sub-module is configured to send a pseudo-random code sequence to the PMD sub-module when the working mode of the second module when processing the first data stream is the low-power mode.

[0043] In a possible implementation, the physical layer module includes a physical coding sub-layer (PCS) sub-module. The PCS sub-module performs a scrambling operation on the first data stream in the normal mode, stops performing a scrambling operation on the first data stream in the low-power mode, and when the PCS sub-module switches from the low-power mode to the normal mode, the scrambling seed used by the PCS sub-module to perform a scrambling operation on the first data stream is continuous with the scrambling seed used in the previous scrambling operation on the first data stream.

[0044] In a possible implementation, the first module is further configured to obtain a second data stream, where the second data stream includes indication information indicating whether the first data stream includes valid data. Specifically, the first module is configured to: obtain the first data stream and generate the control information according to the indication information.

[0045] In a possible implementation, the physical layer module includes a PCS sub-module, and data obtained by processing the first data stream by the PCS sub-module and data obtained by processing the second data stream by the PCS sub-module are in different AM windows.

[0046] In a possible implementation, the physical layer module includes a PCS sub-module, data obtained by processing the second data stream by the PCS sub-module is between a first alignment word flag AM and a second alignment word flag AM, and data obtained by processing the first data stream by the PCS sub-module is between a third AM and a fourth AM.

[0047] In a possible implementation, the indication information is specifically used to indicate the proportion of valid data included in the first data stream, and code blocks carrying valid data in the first data stream are evenly distributed in the first data stream.

[0048] In a possible implementation, the second data stream includes an Ethernet frame, and the Ethernet frame carries the indication information.

[0049] In a possible implementation, a start frame delimiter SFD field of the Ethernet frame indicates that the Ethernet frame carries the indication information.

[0050] In a possible implementation, the first module is specifically configured to: determine the traffic proportion of valid data and invalid data, and the data volume of the valid data; determine whether the first data stream includes valid data according to the traffic proportion and the data volume of the valid data, and generate the second data stream including the indication information.

[0051] Fourthly, an embodiment of the present application provides a communication device, which includes a first module and a second module, and the second module is a physical layer module; the first module is configured to receive a second data stream, where the second data stream includes indication information indicating whether the first data stream includes valid data; send the indication information to the second module, where the second module is a physical layer module; the second module is configured to determine, according to the indication information, an operating mode of the second module when processing the first data stream, and the operating mode includes: a normal mode or a low-power mode.

[0052] In a possible implementation, the first module is a media access control MAC layer module or a physical layer sub-module, and the physical layer sub-module is different from the second module.

[0053] In a possible implementation, the first data stream and the second data stream are in different alignment word flag AM windows.

[0054] In a possible implementation, the second data stream is between the first AM and the second AM, and the first data stream is between the third AM and the fourth AM.

[0055] In a possible implementation, the indication information is specifically used to indicate the proportion of valid data included in the first data stream, and the code blocks carrying the valid data in the first data stream are evenly distributed in the first data stream.

[0056] In a possible implementation, the second data stream includes Ethernet frames, and the Ethernet frames carry the indication information.

[0057] In a possible implementation, the start frame delimiter SFD of the Ethernet frame indicates that the Ethernet frame carries the indication information.

[0058] In a possible implementation, the first data stream includes a plurality of code blocks, and the second module is specifically configured to: determine the working mode corresponding to each of the plurality of code blocks when the second module processes the code blocks according to the indication information.

[0059] In a possible implementation, the plurality of code blocks include a first code block and a second code block, the control information indicates that the first code block includes valid data and the second code block does not include valid data, and the second module is specifically configured to: determine that the working mode of the second module when processing the first code block is the normal mode, and determine that the working mode of the second module when processing the second code block is the low power consumption mode according to the control information.

[0060] In a possible implementation, the control information indicates that each of the code blocks included in the first data stream includes valid data, and the second module is specifically configured to: determine that the working mode of the second module when processing each of the code blocks included in the first data stream is the normal mode.

[0061] In a possible implementation, the control information indicates that none of the code blocks included in the first data stream includes valid data, and the second module is specifically configured to: determine that the working mode of the second module when processing each of the code blocks included in the first data stream is the low power consumption mode.

[0062] In a possible implementation, the second module includes a physical medium attachment sublayer PMA sub-module and a physical medium dependent layer PMD sub-module. When the working mode of the second module when processing the first data stream is the low power consumption mode, the PMA sub-module discards the data from the PMD sub-module.

[0063] Fifth aspect, an embodiment of the present application provides a device. The device includes a processor and a memory. The memory is used to store instructions or computer programs. The processor is used to execute the instructions or computer programs in the memory to execute the method according to any one of the above first aspects, or execute the method according to any one of the above second aspects.

[0064] Sixth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions or computer programs, which when running on a computer, cause the computer to execute the method according to any one of the above first aspects, or cause the computer to execute the method according to any one of the above second aspects.

[0065] Seventh aspect, an embodiment of the present application provides a computer program product including instructions or computer programs, which when running on a computer, cause the computer to execute the method according to any one of the above first aspects, or cause the computer to execute the method according to any one of the above second aspects.

[0066] Eighth aspect, an embodiment of the present application provides a chip, including an interface circuit and a processing circuit. The interface circuit is used to receive and / or send data, and the processing circuit is used to process data.

[0067] In one example, the chip can be applied to a communication device as a sending end. For this case:

[0068] The interface circuit is used to obtain a first data stream and control information, where the control information indicates whether the first data stream includes valid data; send the first data stream and the control information to the processing circuit, and the processing circuit is applied to a physical layer module. The processing circuit is used to determine the working mode of the processing circuit when processing the first data stream according to the control information, and the working mode includes: normal mode or low-power mode.

[0069] In another example, the chip can be applied to a communication device as a receiving end. For this case:

[0070] The interface circuit is used to receive a second data stream, where the second data stream includes indication information indicating whether the first data stream includes valid data; send the indication information to the processing circuit, and the processing circuit is applied to a physical layer module.

[0071] The processing circuit is used to determine the working mode of the processing circuit when processing the first data stream according to the indication information, and the working mode includes: normal mode or low-power mode.

[0072] In a ninth aspect, an embodiment of the present application provides an optical module, including an interface circuit and a digital signal processor (DSP). The interface circuit is configured to receive and / or transmit data, and the DSP is configured to process the data.

[0073] In one example, the optical module can be applied to a communication device acting as a transmitting end. For this case:

[0074] The interface circuit is configured to obtain a first data stream and control information, where the control information indicates whether the first data stream includes valid data; and transmit the first data stream and the control information to the DSP. The DSP is configured to determine, according to the control information, an operating mode of the DSP when processing the first data stream, and the operating mode includes: a normal mode or a low-power mode.

[0075] In another example, the optical module can be applied to a communication device acting as a receiving end. For this case:

[0076] The interface circuit is configured to receive a second data stream, where the second data stream includes indication information indicating whether the first data stream includes valid data; and transmit the indication information to the DSP.

[0077] The DSP is configured to determine, according to the indication information, an operating mode of the DSP when processing the first data stream, and the operating mode includes: a normal mode or a low-power mode.

[0078] In a tenth aspect, an embodiment of the present application provides a communication system, including: a communication device that executes the method according to any one of the above first aspects, and a communication device that executes the method according to any one of the above second aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can be obtained according to these drawings without creative efforts.

[0080] Figure 1 It is a schematic diagram of an exemplary application scenario;

[0081] Figure 2 It is a schematic flowchart of a data processing method provided by an embodiment of the present application;

[0082] Figure 3A schematic structural diagram of a data stream provided by an embodiment of the present application;

[0083] Figure 4 A schematic structural diagram of an Ethernet frame provided by an embodiment of the present application;

[0084] Figure 5 A schematic flowchart of another data processing method provided by an embodiment of the present application;

[0085] Figure 6 A schematic diagram of a data processing method provided by an embodiment of the present application;

[0086] Figure 7 A schematic structural diagram of a communication device provided by an embodiment of the present application;

[0087] Figure 8 A schematic structural diagram of a chip provided by an embodiment of the present application;

[0088] Figure 9 A schematic structural diagram of an optical module provided by an embodiment of the present application;

[0089] Figure 10 A schematic structural diagram of a device provided by an embodiment of the present application. Detailed implementation manners

[0090] An embodiment of the present application provides a data processing method, which can effectively reduce the power consumption of the physical layer module.

[0091] For the convenience of understanding, the MAC layer and the physical layer in the OSI seven-layer model are first introduced in combination with a specific scenario.

[0092] See Figure 1 , this figure is a schematic diagram of an exemplary application scenario.

[0093] As Figure 1 shown, whether it is the sending end or the receiving end, both include a MAC layer and a physical layer, and the physical layer can include a PCS, a PMA, and a PMD.

[0094] As the sending end, its MAC layer can receive data sent by the upstream device or the upper-layer service. If it does not receive the data sent by the upstream device or the upper-layer service, the MAC layer will insert an IDLE bit stream. Specifically, after the MAC layer of the sending end receives the data sent by the upstream device or the upper-layer service, it can encapsulate the data to form a MAC frame. If the MAC layer does not receive the data sent by the upstream device or the upper-layer service, the MAC layer will insert an IDLE bit stream and generate a corresponding MAC frame based on the IDLE bit stream.

[0095] The MAC layer of the sending end sends the MAC frame to the physical layer of the sending end. As an example, a reconciliation sublayer (RS) is included between the MAC layer and the physical layer. The physical layer may include PCS, PMA, and PMD. Communication may occur between the RS and the PCS through a medium independent interface (MII) channel. Among them, the MII channel is a virtual channel or a logical channel.

[0096] The RS may convert the serial MAC frame into a parallel data stream and transfer the data stream to the PCS through the MII channel.

[0097] The PCS may process the data stream received through the MII channel. In a specific example, the PCS may first encode and rate-match the data stream, and then transcode the data stream after encoding and rate matching. For example, 64B / 66B encoding and 256B / 257B transcoding are performed. Further, a scrambling operation is performed on the transcoded data stream. After performing the scrambling operation, AM is added to the data stream obtained after performing the scrambling operation. After adding AM, FEC encoding is further performed on the data stream after adding AM. After performing FEC encoding, distribution and interleaving may be performed on the data after performing FEC encoding to distribute the interleaved data to the PMA.

[0098] The PMA may modulate the data from the PCS into a signal supported by the channel for transmission.

[0099] The PMD is a signal transmitter for transmitting the signal modulated by the PMA through the transmission medium.

[0100] The physical layer of the receiving end receives the signal transmitted on the foregoing transmission medium, processes the signal, and then transfers it to the MAC layer of the receiving end. As described above, the physical layer of the receiving end also includes PMD, PMA, and PCS.

[0101] The PMD of the receiving end first receives the signal transmitted on the transmission medium. Then, the PMA demodulates the signal. The data obtained after the PMA demodulation is transferred to the PCS, and the operations performed by the PCS on the received data are the inverse operations performed by the PCS of the foregoing sending end. Specifically, the PCS may sequentially perform operations such as FEC decoding and descrambling on the data to obtain a data stream. Further, the data stream is processed by the RS and transferred to the MAC. At this point, the MAC of the receiving end can obtain the MAC frame sent by the sending end and further process the MAC frame. For example, the MAC frame is parsed and sent to the upstream device or the upper-layer service.

[0102] In traditional technologies, for the transmitting end, after the MAC layer receives data sent by an upstream device or an upper-layer service, it can send the received data to the physical layer. When the MAC layer does not receive data sent by an upstream device or an upper-layer service, it will send an IDLE bitstream to the physical layer. Therefore, regardless of whether the upstream device or the upper-layer service sends valid data to the MAC layer, the physical layer will receive data. Correspondingly, the physical layer will process the received data. That is to say, regardless of whether the upstream device or the upper-layer service sends valid data to the MAC layer, the physical layer is always in a normal state. The normal state of the physical layer of the transmitting end means performing the aforementioned scrambling, FEC encoding, etc. operations on the currently received data stream (valid data stream or IDLE data stream). Correspondingly, the physical layer of the receiving end is also always in a normal state. The normal state of the physical layer of the receiving end means performing the aforementioned descrambling, FEC decoding, etc. operations on the currently received data stream (valid data stream or IDLE data stream).

[0103] To reduce the power consumption of the physical layer of a communication device, an embodiment of the present application provides a data processing method.

[0104] It should be noted that for a communication device, it may include a MAC layer module and a physical layer module. The MAC layer module is used to implement the functions implemented by the aforementioned MAC layer, and the physical layer module is used to implement the functions implemented by the aforementioned physical layer. For the physical layer, it may include multiple sub-modules, and each sub-module is used to implement specific physical layer functions. For example, the physical layer module includes a PCS sub-module, a PMA sub-module, and a PMD sub-module. The PCS sub-module is used to implement the functions implemented by the aforementioned PCS, the PMA sub-module is used to implement the functions implemented by the aforementioned PMA, and the PMD sub-module is used to implement the functions implemented by the aforementioned PMD. In one example, the PCS sub-module can also be further divided into corresponding sub-modules according to the functions it implements. For example, the PCS sub-module may include a codeword processing sub-module, a scrambling sub-module, an FEC encoding sub-module, an alignment word insertion sub-module, etc. The codeword processing sub-module can be used to encode the data stream and perform rate matching, and then transcode the data stream after encoding and rate matching. The scrambling sub-module is used to perform the scrambling operation, the FEC encoding sub-module is used to perform the FEC encoding, and the alignment word insertion sub-module is used to insert the alignment word flag.

[0105] Next, in combination with the accompanying drawings, the data processing method provided by the embodiment of the present application will be introduced.

[0106] See Figure 2 , which is a schematic flowchart of a data processing method provided by an embodiment of the present application. Figure 2 The method shown can be applied to a communication device, and this communication device serves as the transmitting end.

[0107] In the embodiments of the present application, the communication device mentioned may be a network device such as a switch or a router, or a part of the components on the network device, such as a single board or a line card on the network device, or a functional module on the network device, or a chip for implementing the method of the present application, or a server or an optical module, etc. The embodiments of the present application do not make specific limitations. The communication devices may be directly connected to each other, for example, but not limited to, through an Ethernet cable or an optical cable.

[0108] In the embodiments of the present application, the communication device that executes Figure 2 the method described above includes a first module and a second module. The second module is a physical layer module, which is different from the first module and is a module with a lower level than the first module.

[0109] In one example, the first module may be a MAC layer module.

[0110] In another example, the first module may be a physical layer sub-module. For example, it is a PCS sub-module of the physical layer, or a sub-module of the PCS sub-module of the physical layer, such as the aforementioned codeword processing sub-module.

[0111] Figure 2 The method shown may include the following S101-S103.

[0112] S101: The first module obtains a first data stream and control information, and the control information indicates whether the first data stream includes valid data.

[0113] In the embodiments of the present application, the first data stream is a data segment containing multiple bits (bit).

[0114] In one example, when the first module is a MAC layer module, the first data stream includes MAC frame data. In a specific implementation of S101, the first module may generate the first data stream and the control information.

[0115] In one example, when the first module is a physical layer sub-module, in a specific implementation of S101, it may receive the first data stream and the control information sent by the MAC layer module. For this case, the first data stream is a data stream obtained by converting MAC frame data. In a specific example, when the MAC layer module sends the first data stream and the control information to the physical layer sub-module, for every 64-bit data sent by the MAC layer module to the physical layer sub-module, it also sends 1-bit control signal to the physical layer sub-module at the same time, and this control signal is used to indicate whether the 64-bit data is valid data.

[0116] For the first data stream, it may include multiple code blocks, and each code block is a data segment containing multiple bits. In one example, the length of the code block is the length of the information bits corresponding to the FEC codeword obtained after the PCS sub-module performs FEC encoding on the code block. In one example, if the FEC codeword is a Reed-Solomon (RS) code, the length of the code block is 514 symbols, where one symbol includes 10 bits. That is to say, a code block is a data segment including 5140 bits. Among them, for a code block in the first data stream, it can be obtained by transcoding 80 64-bit data sent by the MAC layer. Specifically, every 4 of the 80 64-bit data sent by the MAC layer can be used as a group, that is: the 80 64-bit data sent by the MAC layer can include 20 groups of data, and a group of data includes 256-bit data. By performing 256B / 257B transcoding on each 256-bit data, 257-bit data can be obtained. Therefore, a code block can include 257 * 20 = 5140 bits of data.

[0117] For a code block, if the control signals corresponding to each of the 80 64-bit data included in the code block indicate that the corresponding 64-bit data is invalid data, the control information corresponding to the code block indicates that the code block does not include valid data. Correspondingly, if the control signals corresponding to each of the 80 64-bit data included in the code block indicate that the corresponding 64-bit data is valid, the control information corresponding to the code block indicates that the code block includes valid data.

[0118] As an example, the control information is global control information, which is used to indicate whether there is valid data in the entire first data stream. For example, the control information corresponds to a bit, and the value of this bit indicates whether there is valid data in the entire first data stream. When the value of this bit is 1, it indicates that there is valid data in the first data stream, and when the value of this bit is 0, it indicates that there is no valid data in the first data stream.

[0119] As another example, the control information can be control information with finer granularity, and the control information can indicate whether each of the multiple code blocks includes valid data. As a specific example, the control information may include sub-control information corresponding to each of the multiple code blocks. For any sub-control information, it is used to indicate whether the code block corresponding to the sub-control information includes valid data. For example, the sub-control information corresponds to a bit. When the value of this bit is 0, it indicates that the code block corresponding to the sub-control information does not include valid data, and when the value of this bit is 1, it indicates that the code block corresponding to the sub-control information includes valid data.

[0120] In the embodiments of the present application, the valid data refers to the data sent by the upstream device of the MAC layer or the upper-layer service to the MAC layer. Or, the valid data can be data other than the IDLE bitstream.

[0121] S102: The first module sends the first data stream and the control information to the second module.

[0122] S103: The second module determines the working mode of the second module when processing the first data stream according to the control information, and the working mode includes: normal mode or low-power mode.

[0123] After the first module obtains the first data stream and the control information, it can send the first data stream and the control information to the second module. For example, when the first module is a MAC layer module, the MAC layer module can send the first data stream and the control information to the PCS sub-module of the physical layer. Another example is that when the first module is a physical layer sub-module, the first module can send the first data stream and the control information to a physical layer sub-module with a lower level than itself.

[0124] After the second module receives the first data stream and the control information, it can determine whether the first data stream includes valid data according to the control information, so as to determine its own working mode when processing the first data stream. Among them, the working mode can be the normal mode or the low-power mode. The so-called normal mode can be understood as processing the received data stream according to the normal process. For example, performing operations such as scrambling and FEC encoding on the received data stream normally. The so-called low-power mode can be understood as stopping processing the received data stream. For example, for the PCS sub-module included in the physical layer module, if the PCS sub-module works in the low-power mode, the PCS sub-module does not perform scrambling operations and / or FEC encoding operations on the first data stream, thereby reducing the power consumption of the PCS sub-module and correspondingly reducing the power consumption of the entire physical layer module.

[0125] In one example, when the foregoing control information is global control information, in the specific implementation of S103, a certain working mode can be determined according to the control information, and when processing the entire first data stream, it works in this working mode. For example, if the control information indicates that the first data stream includes valid data, the second module can determine that its own working mode when processing the entire first data stream is the normal mode. Another example is that if the control information indicates that the first data stream does not include valid data, the second module can determine that its own working mode when processing the entire first data stream is the low-power mode.

[0126] In yet another example, when the foregoing control information includes sub-control information respectively corresponding to each of multiple code blocks in the first data stream, in specific implementation, S103 may determine, according to the control information, the working modes respectively corresponding to the second module when processing each of the multiple code blocks. Specifically, the second module may process the valid data in the first data stream according to the control information and not process the invalid data in the first data stream. In other words, for the valid data in the first data stream, the second module operates in the normal mode to process the valid data according to the normal process. For the invalid data in the first data stream, the second module operates in the low-power mode so as not to process the invalid data.

[0127] As a specific example, if the foregoing multiple code blocks include a first code block and a second code block, and the control information indicates that the first code block includes valid data and the second code block does not include valid data. For example, the sub-control information corresponding to the first code block indicates that the first code block includes valid data, and the sub-control information corresponding to the second code block indicates that the second code block does not include valid data. Then the second module may determine, according to the control information, that the working mode of the second module when processing the first code block is the normal mode, and determine that the working mode of the second module when processing the second code block is the low-power mode. For this case, the PCS sub-module may perform scrambling and FEC encoding operations on the first code block and not perform scrambling and FEC encoding operations on the second code block.

[0128] As yet another specific example, if the control information indicates that all of the code blocks included in the first data stream include valid data. For example, the sub-control information corresponding to each code block indicates that the code block corresponding to it includes valid data, then the second module may determine, according to the control information, that the working modes of the second module when processing all of the code blocks included in the first data stream are all the normal mode. For this case, the PCS sub-module may perform scrambling and FEC encoding operations on all of the code blocks in the first data stream.

[0129] As another specific example, if the control information indicates that none of the code blocks included in the first data stream include valid data. For example, the sub-control information corresponding to each code block indicates that the code block corresponding to it does not include valid data, then the second module may determine, according to the control information, that the working modes of the second module when processing all of the code blocks included in the first data stream are all the low-power mode. For this case, the PCS sub-module may not perform scrambling and FEC encoding operations on all of the code blocks in the first data stream, thereby effectively reducing the power consumption of the PCS sub-module. Correspondingly, the power consumption of the entire physical layer module is reduced.

[0130] As described above, when the PCS sub-module operates in the low-power mode, it does not perform scrambling and / or FEC encoding operations on the first data stream. In this way, the data stream sent by the PCS sub-module to the PMA sub-module may have an imbalance in the number of 0s and 1s. To balance the number of 0s and 1s in the data stream finally received by the PMD sub-module, in one example, when the working mode of the second module for processing the first data stream is the low-power mode, for example, when the second module processes the aforementioned second code block, the PMA sub-module can convert the first data stream sent to the PMD module into a pseudo-random binary sequence (PRBS), so that the number of 0s and 1s in the data stream received by the PMD sub-module is balanced. Among them, the pseudo-random binary sequence can also be called a pseudo-random code sequence.

[0131] In the embodiment of the present application, when the PCS sub-module scrambles the first data stream, it can generate corresponding scrambling information based on the scrambling seed, and then use the scrambling information to scramble the first data stream. For multiple code blocks in the first data stream that need to perform scrambling operations, the scrambling seeds used for scrambling each code block are different, and, in the order of performing scrambling operations on the multiple code blocks, the scrambling seeds used for performing scrambling operations on the multiple code blocks are consecutive. This is to facilitate the receiving end to normally descramble the received data stream.

[0132] As can be seen from the previous description, when the PCS sub-module processes the first data stream, its working mode can be switched between the normal mode and the low-power mode. In the embodiment of the present application, when the PCS sub-module switches from the low-power mode to the normal mode, the scrambling seed used by the PCS sub-module to perform the scrambling operation on the first data stream is consecutive with the scrambling seed used for the previous scrambling operation on the first data stream. For example:

[0133] The first data stream includes code block 1, code block 2, code block 3, and code block 4. Valid data is included in code block 1 and code block 4, and no valid data is included in code block 2 and code block 3. When the PCS sub-module processes code block 1, its working mode is the normal mode. Therefore, the PCS sub-module performs a scrambling operation on code block 1, and the scrambling seed used by the PCS sub-module for the scrambling operation on code block 1 is a. When the PCS sub-module processes code block 2 and code block 3, its working mode switches to the low-power mode. Therefore, the PCS sub-module does not perform a scrambling operation on code block 2 and code block 3. When the PCS sub-module processes code block 4, its working mode switches to the normal mode. Therefore, the PCS sub-module performs a scrambling operation on code block 4, and the scrambling seed used by the PCS sub-module for the scrambling operation on code block 4 is b, which is consecutive with the scrambling seed a used by the PCS sub-module in the previous scrambling operation.

[0134] From the above description, it can be seen that with the solution of the embodiment of the present application, for the communication device acting as the sending end, its physical layer module may work in the normal mode or the low-power mode. When the data to be sent is invalid data, the physical layer module works in the low-power mode. Compared with the traditional technology where the physical layer module is always in the normal mode, this solution can effectively reduce the power consumption of the physical layer module.

[0135] In an example, before executing S101, the first module may also obtain a second data stream, which may be the data stream obtained by the first module before obtaining the first data stream. The second data stream may include indication information for indicating whether the first data stream includes valid data. Correspondingly, for this case, when the first module obtains the first data stream, it may generate control information that can be used to indicate whether the first data stream includes valid data based on the indication information.

[0136] In a specific example, when the first module obtains the second data stream, it may receive the indication information sent by the upper-layer module and generate a second data stream including the indication information based on the indication information.

[0137] In yet another specific example, the first module may first determine whether the first data stream includes valid data, and then generate a second data stream including the indication information based on the determination result of whether the first data stream includes valid data. In one example, when the first module determines whether the first data stream includes valid data, in a specific implementation, it may determine whether the first data stream includes valid data according to the traffic ratio of valid data to invalid data and the data volume of valid data. Among them, the traffic ratio of valid data to invalid data can characterize the distribution of valid data and invalid data. The data volume of valid data can indicate the specific amount of valid data. Combining the foregoing distribution of valid data and invalid data, it is possible to determine whether the first data stream includes valid data. For example: Suppose there are 10 code blocks that can be accommodated within an AM window, the traffic ratio of valid data to invalid data is 20:1, and the data volume of valid data occupies 20 code blocks. This means the distribution of valid data and invalid data is: 20 code blocks of valid data → 1 code block of invalid data. Currently, the second data stream includes 10 code blocks of valid data, and the other 10 code blocks of valid data need to be carried in the subsequent first data stream. Therefore, it can be determined that the first data stream includes valid data. Another example: Suppose there are 10 code blocks that can be accommodated within an AM window, the traffic ratio of valid data to invalid data is 1:20, and the valid data occupies 1 code block. This means the distribution of valid data and invalid data is: 1 code block of valid data → 20 code blocks of invalid data. Currently, one code block in the second data stream includes valid data. Therefore, it can be determined that the first data stream does not include valid data.

[0138] Regarding the first data stream and the second data stream, in one example, the data processed by the PCS sub-module from the first data stream and the data processed by the PCS sub-module from the second database are in different AM windows. Regarding the AM window, it should be noted that as mentioned above, the PCS sub-module may include an alignment word insertion sub-module, and the alignment word insertion sub-module is used to insert an AM. The data between two adjacent AMs can be understood as the data within an AM window. In a specific example, the data processed by the PCS sub-module from the second data stream is between the first AM and the second AM, and the data processed by the PCS sub-module from the first data stream is between the third AM and the fourth AM. In a specific example, the second AM and the third AM are the same, that is, the second data stream and the first data stream are the data within two adjacent AM windows. In yet another example, the second AM and the third AM may also be different, and the embodiments of the present application do not make specific limitations.

[0139] For ease of description, the AM window of the second data stream is referred to as the first AM window.

[0140] As described above, the first module may be a MAC layer module or a physical layer sub-module. In one example, when the first module is a MAC layer sub-module, the indication information may be, for example, in one of the code blocks included between the first AM and the second AM. For example, an IDLE code block is included between the first AM and the second AM, and the indication information is included in the IDLE code block. In yet another example, when the first module is a physical layer sub-module, the indication information may be located, for example, in the first AM.

[0141] It can be understood in combination with Figure 3 as follows. Figure 3 FIG. is a schematic structural diagram of a data stream provided by an embodiment of the present application. As Figure 3 shown, the second data stream 310 is located between AM 301 (i.e., the first AM) and AM 302 (i.e., the second AM), and the first data stream 320 is located between AM 302 (i.e., the third AM) and AM 304 (i.e., the fourth AM). The indication information 311 is carried by a code block in the second data stream 310. Among them: The data obtained after the code blocks in the first data stream 310 and the second data stream 320 are subjected to FEC encoding by the PCS sub-module can be referred to as a codeword. The embodiment of the present application does not specifically limit the format of the indication information. In a specific example, the indication information may be, for example, an Ethernet frame. In other words, the second data stream includes an Ethernet frame, and the Ethernet frame carries the indication information. In one example, a new Ethernet frame type can be defined, and this type of Ethernet frame is used to carry the foregoing indication information. In a possible implementation manner, the new Ethernet frame type can be indicated by the SFD field of the Ethernet frame. In other words, in one example, the SFD field of the Ethernet frame can be used to indicate that the Ethernet frame carries the foregoing indication information.

[0142] Regarding the indication information, it should be noted that:

[0143] In one example, for the multiple code blocks included in the first data stream, the indication information includes sub-indication information corresponding to each of the multiple code blocks, and each sub-indication information indicates whether the corresponding code block includes valid data.

[0144] In yet another example, the indication information is specifically used to indicate the proportion of valid data included in the first data stream. Additionally, to facilitate error correction and other control of the first data stream, the code blocks carrying the valid data in the first data stream are evenly distributed in the first data stream. In this way, the second module can also determine whether each code block included in the first data stream contains valid data based on this indication information. For example: Suppose the first data stream includes 8 code blocks and the aforementioned proportion of valid data is 1 / 2. Then, the first, third, fifth, and seventh code blocks of the first data stream contain valid data, and the second, fourth, sixth, and eighth code blocks of the first data stream do not contain valid data. Suppose again that the first data stream includes 8 code blocks and the aforementioned proportion of valid data is 1 / 4. Then, the first and fifth code blocks of the first data stream contain valid data, and the other code blocks do not contain valid data.

[0145] Regarding the Ethernet frame, it is now understood in conjunction with Figure 4 as follows. Figure 4 FIG. is a schematic structural diagram of an Ethernet frame provided by an embodiment of the present application. As Figure 4 shown, the Ethernet frame includes: a preamble field, an SFD field, a msg-field field, and a frame check sequence (FCS) field. Among them, the SFD field is used to indicate that the Ethernet frame carries the aforementioned indication information, and the msg-field field can be used to carry the aforementioned proportion of valid data. For example, 3 bits of the msg-field field indicate the proportion of valid data. When the value of these 3 bits is 1, it means the proportion of valid data is 1 / 8. When the value of these 3 bits is 2, it means the proportion of valid data is 2 / 8, and so on. Details are not listed here one by one.

[0146] In one example, after the first module sends the second data stream to the second module, the second module can send the second data stream to the receiving end. Correspondingly, the receiving end can determine the working mode of its physical layer module based on the indication information in the second data stream.

[0147] Next, in conjunction with Figure 5 the steps performed by the communication device as the receiving end will be described. Similar to the communication device as the sending end, the communication device as the receiving end also includes a first module and a second module. Regarding the first module and the second module, reference can be made to the relevant description part above, and no repeated description will be made here.

[0148] Refer to Figure 5 , which is a schematic flowchart of yet another data processing method provided by an embodiment of the present application. Figure 5 The described method may include the following S201 - S203.

[0149] S201: The first module receives a second data stream, and the second data stream includes indication information indicating whether valid data is included in the first data stream.

[0150] The first module receiving the second data stream may be the first module receiving the second data stream from a sending end.

[0151] In one example, when the first module is a physical layer sub-module, the indication information may be carried in the first AM, for example. When the first module is a MAC layer module, the indication information may be located in a certain code block included between the first AM and the second AM.

[0152] Regarding the content and format of the first AM, the second AM, the indication information, and the relationship between the first data stream and the second data stream, reference may be made to the relevant descriptions in the above embodiments, and no repeated description will be given here.

[0153] S202: The first module sends the indication information to a second module.

[0154] S203: The second module determines, according to the indication information, a working mode of the second module when processing the first data stream, and the working mode includes: a normal mode or a low power consumption mode.

[0155] After the first module receives the second data stream, it may extract the indication information in the second data stream and send the indication information to the second module, so that the second module can determine its working mode when processing the subsequently received first data stream based on the indication information. Among them, the working mode may be a normal mode or a low power consumption mode. The so-called normal mode can be understood as processing the received data stream according to a normal process. For example, the PMA sub-module sends the received data stream to the PCS sub-module, and the PCS sub-module performs processing operations such as FEC decoding and descrambling on the received data stream. The so-called low power consumption mode can be understood as stopping processing the received data stream. For example, for the PMA sub-module included in the physical layer module, if the PMA sub-module operates in the low power consumption mode, the PMA sub-module discards the data from the PMD sub-module. In this way, the PCS sub-module will not receive the data from the PMA sub-module, and correspondingly, the PCS sub-module does not need to perform processing operations such as FEC decoding and descrambling, thereby reducing the power consumption of the PCS sub-module and correspondingly reducing the power consumption of the entire physical layer module.

[0156] In one example, when specifically implemented, S203 can determine a certain working mode according to the indication information and work in this working mode when processing the entire first data stream. For example, if the control information indicates that the first data stream includes valid data, the second module can determine that its working mode when processing the entire first data stream is the normal mode. Another example is that if the control information indicates that the first data stream does not include valid data, the second module can determine that its working mode when processing the entire first data stream is the low-power mode.

[0157] In another example, when specifically implemented, S203 can determine the working modes respectively corresponding to the second module when processing each of the multiple code blocks according to the indication information. Specifically, the second module can process the valid data in the first data stream according to the indication information and not process the invalid data in the first data stream. In other words, for the valid data in the first data stream, the second module works in the normal mode to process the valid data according to the normal process. For the invalid data in the first data stream, the second module works in the low-power mode so as not to process the invalid data.

[0158] As a specific example, if the foregoing multiple code blocks include a first code block and a second code block, and the indication information indicates that the first code block includes valid data and the second code block does not include valid data. Then the second module can determine that the working mode of the second module when processing the first code block is the normal mode, and determine that the working mode of the second module when processing the second code block is the low-power mode. For this situation, the PMA sub-module can send the first code block to the PCS sub-module so that the PCS sub-module can perform FEC decoding and descrambling operations on the first code block. Correspondingly, the PMA sub-module can discard the second code block. In this way, the PCS sub-module will not receive the second code block. Correspondingly, the PCS sub-module does not need to perform FEC decoding and descrambling operations on the second code block, thereby reducing the power consumption of the PCS sub-model and correspondingly reducing the power consumption of the physical layer module.

[0159] As another specific example, if the indication information indicates that all the code blocks included in the first data stream include valid data. Then the second module can determine that the working modes of the second module when processing each of the code blocks included in the first data stream are all the normal mode. For this situation, the PMA sub-module can send each of the code blocks included in the first data stream to the PCS sub-module so that the PCS sub-module can perform FEC decoding and descrambling operations on each of the code blocks.

[0160] As another specific example, if the indication information indicates that none of the code blocks included in the first data stream contains valid data, the second module may, according to the indication information, determine that the working mode of the second module when processing each code block included in the first data stream is the low-power mode. For this case, the PMA sub-module may discard the entire first data stream. In this way, the PCS sub-module will not receive the first data stream. Correspondingly, the PCS sub-module does not need to perform FEC decoding and descrambling operations on the first data stream, thereby reducing the power consumption of the PCS sub-module and correspondingly reducing the power consumption of the physical layer module.

[0161] As can be seen from the above description, for the communication device as the receiving end using the solution of the embodiment of the present application, its physical layer module may work in the normal mode or the low-power mode. When the received data is invalid data, the physical layer module works in the low-power mode. Compared with the traditional technology where the physical layer module is always in the normal mode, this solution can effectively reduce the power consumption of the physical layer module.

[0162] The data processing method provided by the embodiment of the present application has been introduced above. Next, taking the foregoing first module as the MAC layer module and the second module as the physical layer module as an example, a possible implementation manner of the present application will be introduced.

[0163] It can be understood in combination with Figure 6 which is Figure 6 a schematic diagram of a data processing method provided by the embodiment of the present application.

[0164] As Figure 6 shown, whether it is the sending end or the receiving end, it includes a MAC layer module and a physical layer module, and the physical layer module can further include a PCS sub-module, a PMA sub-module, and a PMD sub-module.

[0165] The sending end and the receiving end can execute the following steps 1-9.

[0166] 1. The MAC layer module of the sending end obtains a second data stream, and the second data stream includes indication information.

[0167] 2. The MAC layer module of the sending end sends the second data stream to its own physical layer module, and its own physical layer module sends the second data stream to the receiving end. Among them:

[0168] The physical layer module of the sending end may process the second data stream and send the processed second data stream to the receiving end. Regarding the processing method of the second data stream by the physical layer module of the sending end, reference may be made to the description part of Figure 1 above, and no repeated description will be made here.

[0169] 3. The physical layer module at the receiving end receives the second data stream sent by the sending end and sends the second data stream to the physical layer module at the receiving end.

[0170] 4. The physical layer module at the receiving end parses the indication information and sends the indication information to the physical layer module at the receiving end.

[0171] 5. The MAC layer module at the sending end obtains the first data stream and control information, and the control information indicates whether the first data stream includes valid data.

[0172] 6. The MAC layer module at the sending end sends the first data stream and the control information to its own physical layer module. Among them:

[0173] For the code blocks carrying valid data in the first data stream, the PCS sub-module at the sending end performs scrambling and FEC encoding operations on them and then sends them to the PMA sub-module.

[0174] For the code blocks not carrying valid data in the first data stream, the PCS sub-module at the sending end does not perform scrambling and FEC encoding operations on them, and directly passes the code blocks transparently to the PMA sub-module.

[0175] 7. The physical layer module at the sending end sends the processed first data stream to the receiving end.

[0176] 8. Based on the foregoing indication information, the receiving end determines which code blocks in the first data stream include valid data and which code blocks do not include valid data. For the code blocks including valid data in the first data stream, the PMA sub-module sends the code blocks to the PCS sub-module, and the PCS sub-module performs operations such as FEC decoding and descrambling on them. For the code blocks not including valid data in the first data stream, the PMA sub-module directly discards the code blocks. Correspondingly, since the PCS sub-module does not receive the code blocks not including valid data, it does not need to perform operations such as FEC decoding and descrambling on the code blocks not including valid data.

[0177] 9. After the physical layer module at the receiving end processes the first data stream, it sends it to the MAC layer module at the receiving end, and the MAC layer module further processes the received data.

[0178] Based on the data processing method provided in the above embodiments, the embodiments of the present application further provide a corresponding communication device. Next, the communication device will be introduced with reference to the accompanying drawings.

[0179] See Figure 7 , this figure is a schematic structural diagram of a communication device provided by an embodiment of the present application. Figure 7 The shown communication device can be used to execute the data processing method provided in the above method embodiments.

[0180] Such asFigure 7 As shown, the communication device 700 includes a first module 701 and a second module 702, and the second module 702 is a physical layer module.

[0181] In one example, Figure 7 The communication device 700 shown is used to execute the data processing method performed by the communication device as the sending end in the above method embodiment. For this case:

[0182] The first module 701 is used to obtain a first data stream and control information, where the control information indicates whether the first data stream includes valid data; and send the first data stream and the control information to the second module 702;

[0183] The second module 702 is used to determine the working mode of the second module 702 when processing the first data stream according to the control information, and the working mode includes: normal mode or low power consumption mode.

[0184] In a possible implementation, the first module 701 is a media access control (MAC) layer module or a physical layer sub-module, and the physical layer sub-module is different from the second module 702.

[0185] In a possible implementation, the first data stream includes multiple code blocks, and the second module 702 is specifically used to: determine the working mode corresponding to each of the multiple code blocks when the second module 702 processes the code blocks according to the control information.

[0186] In a possible implementation, the control information includes sub-control information corresponding to each of the multiple code blocks, and each sub-control information indicates whether the code block corresponding to it includes valid data.

[0187] In a possible implementation, the multiple code blocks include a first code block and a second code block, and the control information indicates that the first code block includes valid data and the second code block does not include valid data. The second module 702 is specifically used to: determine that the working mode of the second module 702 when processing the first code block is the normal mode, and determine that the working mode of the second module 702 when processing the second code block is the low power consumption mode according to the control information.

[0188] In a possible implementation, the control information indicates that each of the code blocks included in the first data stream includes valid data, and the second module 702 is specifically used to: determine that the working mode of the second module 702 when processing each of the code blocks included in the first data stream is the normal mode.

[0189] In a possible implementation, the control information indicates that none of the code blocks included in the first data stream includes valid data, and the second module 702 is specifically configured to: determine that the working mode of the second module 702 when processing each code block included in the first data stream is the low-power mode.

[0190] In a possible implementation, the physical layer module includes a PCS sub-module. When the working mode of the second module 702 when processing the first data stream is the low-power mode, the PCS sub-module does not perform a scrambling operation and / or a forward error correction FEC encoding operation on the first data stream.

[0191] In a possible implementation, the physical layer module includes a physical medium attachment sub-layer PMA sub-module and a physical medium dependent layer PMD sub-module. The PMA sub-module is configured to send a pseudo-random code sequence to the PMD sub-module when the working mode of the second module 702 when processing the first data stream is the low-power mode.

[0192] In a possible implementation, the physical layer module includes a physical coding sub-layer PCS sub-module. The PCS sub-module performs a scrambling operation on the first data stream in the normal mode, stops performing a scrambling operation on the first data stream in the low-power mode, and when the PCS sub-module switches from the low-power mode to the normal mode, the scrambling seed used by the PCS sub-module to perform a scrambling operation on the first data stream is continuous with the scrambling seed used for the last scrambling operation on the first data stream.

[0193] In a possible implementation, the first module 701 is further configured to obtain a second data stream, where the second data stream includes indication information indicating whether the first data stream includes valid data; the first module 701 is specifically configured to: obtain the first data stream and generate the control information according to the indication information.

[0194] In a possible implementation, the physical layer module includes a PCS sub-module, and the data processed by the PCS sub-module for the first data stream and the data processed by the PCS sub-module for the second data stream are in different AM windows.

[0195] In a possible implementation, the physical layer module includes a PCS sub-module. The data processed by the PCS sub-module for the second data stream is between a first alignment word flag AM and a second alignment word flag AM, and the data processed by the PCS sub-module for the first data stream is between a third AM and a fourth AM.

[0196] In a possible implementation, the indication information is specifically used to indicate the proportion of valid data included in the first data stream, and the code blocks carrying the valid data in the first data stream are evenly distributed in the first data stream.

[0197] In a possible implementation, the second data stream includes Ethernet frames, and the Ethernet frames carry the indication information.

[0198] In a possible implementation, the Start Frame Delimiter (SFD) field of the Ethernet frame indicates that the Ethernet frame carries the indication information.

[0199] In a possible implementation, the first module 701 is specifically configured to: determine the traffic proportion of valid data and invalid data, and the data volume of the valid data; determine whether the first data stream includes valid data according to the traffic proportion and the data volume of the valid data, and generate the second data stream including the indication information.

[0200] In yet another example, Figure 7 The communication device 700 shown is used to execute the data processing method performed by the communication device as the receiving end in the above method embodiments. For this case:

[0201] The first module 701 is used to receive a second data stream, the second data stream includes indication information, and the indication information indicates whether the first data stream includes valid data; send the indication information to the second module 702, and the second module 702 is a physical layer module;

[0202] The second module 702 is used to determine the working mode of the second module 702 when processing the first data stream according to the indication information, and the working mode includes: normal mode or low power consumption mode.

[0203] In a possible implementation, the first module 701 is a Media Access Control (MAC) layer module or a physical layer sub-module, and the physical layer sub-module is different from the second module 702.

[0204] In a possible implementation, the first data stream and the second data stream are within different Alignment Word Mark (AM) windows.

[0205] In a possible implementation, the second data stream is between the first AM and the second AM, and the first data stream is between the third AM and the fourth AM.

[0206] In a possible implementation, the indication information is specifically used to indicate the proportion of valid data included in the first data stream, and the code blocks carrying the valid data in the first data stream are evenly distributed in the first data stream.

[0207] In a possible implementation, the second data stream includes Ethernet frames, and the Ethernet frames carry the indication information.

[0208] In a possible implementation, a start frame delimiter SFD of the Ethernet frame indicates that the Ethernet frame carries the indication information.

[0209] In a possible implementation, the first data stream includes a plurality of code blocks, and the second module 702 is specifically configured to: determine working modes respectively corresponding to the second module 702 when processing each of the plurality of code blocks according to the indication information.

[0210] In a possible implementation, the plurality of code blocks include a first code block and a second code block, the control information indicates that the first code block includes valid data and the second code block does not include valid data, and the second module 702 is specifically configured to: determine that the working mode of the second module 702 when processing the first code block is the normal mode, and determine that the working mode of the second module 702 when processing the second code block is the low power consumption mode.

[0211] In a possible implementation, the control information indicates that each of the code blocks included in the first data stream includes valid data, and the second module 702 is specifically configured to: determine that the working mode of the second module 702 when processing each of the code blocks included in the first data stream is the normal mode.

[0212] In a possible implementation, the control information indicates that none of the code blocks included in the first data stream includes valid data, and the second module 702 is specifically configured to: determine that the working mode of the second module 702 when processing each of the code blocks included in the first data stream is the low power consumption mode.

[0213] In a possible implementation, the second module 702 includes a physical medium attachment sublayer PMA sub-module and a physical medium dependent layer PMD sub-module. When the working mode of the second module 702 when processing the first data stream is the low power consumption mode, the PMA sub-module discards the data from the PMD sub-module.

[0214] The embodiments of the present application further provide a chip, as Figure 8 shown, Figure 8 is a schematic structural diagram of a chip provided by the embodiments of the present application. As Figure 8 shown, the chip 800 includes an interface circuit 801 and a processing circuit 802. The interface circuit 801 is used to receive and / or send data, and the processing circuit 802 is used to perform data processing.

[0215] In one example, the chip 800 can be applied to a communication device as a transmitting end. For this case:

[0216] The interface circuit 801 is used to obtain a first data stream and control information, where the control information indicates whether the first data stream includes valid data; and send the first data stream and the control information to the processing circuit 802, and the processing circuit 802 is applied to a physical layer module.

[0217] The processing circuit 802 is used to determine the working mode of the processing circuit 802 when processing the first data stream according to the control information, and the working mode includes: normal mode or low power consumption mode.

[0218] Regarding the specific operations performed by the interface circuit 801 and the processing circuit 802, reference can be made to the relevant description part of the data processing method for the communication device as a transmitting end in the above method embodiments, and no repeated description will be made here.

[0219] In another example, the chip 800 can be applied to a communication device as a receiving end. For this case:

[0220] The interface circuit 801 is used to receive a second data stream, where the second data stream includes indication information indicating whether the first data stream includes valid data; and send the indication information to the processing circuit 802, and the processing circuit 802 is applied to a physical layer module.

[0221] The processing circuit 802 is used to determine the working mode of the processing circuit 802 when processing the first data stream according to the indication information, and the working mode includes: normal mode or low power consumption mode.

[0222] Regarding the specific operations performed by the interface circuit 801 and the processing circuit 802, reference can be made to the relevant description part of the data processing method for the communication device as a receiving end in the above method embodiments, and no repeated description will be made here.

[0223] The embodiment of the present application also provides an optical module. See Figure 9 for understanding, Figure 9 which is a schematic structural diagram of an optical module provided by the embodiment of the present application.

[0224] As Figure 9 shown, the optical module 900 includes an interface circuit 901 and a DSP 902.

[0225] The interface circuit 901 is used to receive and / or send data;

[0226] The DSP 902 is used for data processing.

[0227] In one example, the optical module 900 can be applied to a communication device as a transmitting end. For this case:

[0228] The interface circuit 901 is used to obtain a first data stream and control information, where the control information indicates whether the first data stream includes valid data; and send the first data stream and the control information to the DSP 902;

[0229] The DSP 902 is used to determine the working mode of the DSP 902 when processing the first data stream according to the control information, and the working mode includes: normal mode or low power consumption mode.

[0230] Regarding the specific operations performed by the interface circuit 901 and the DSP 902, reference can be made to the relevant description part of the data processing method performed by the communication device as the transmitting end in the above method embodiments, and no repeated description will be given here.

[0231] In another example, the optical module 900 can be applied to a communication device as a receiving end. For this case:

[0232] The interface circuit 901 is used to receive a second data stream, where the second data stream includes indication information indicating whether the first data stream includes valid data, and send the indication information to the DSP 902;

[0233] The DSP 902 is used to determine the working mode of the DSP 902 when processing the first data stream according to the indication information, and the working mode includes: normal mode or low power consumption mode.

[0234] Regarding the specific operations performed by the interface circuit 901 and the DSP 902, reference can be made to the relevant description part of the data processing method performed by the communication device as the receiving end in the above method embodiments, and no repeated description will be given here.

[0235] It should be noted that for the aforementioned communication device 700, its hardware structure can be as Figure 10 shown in the figure, Figure 10 which is a schematic structural diagram of a device provided by an embodiment of the present application.

[0236] Please refer to Figure 10 as shown in the figure, the device 1000 includes: a processor 1010, a communication interface 1020, and a memory 1030. Among them, the number of processors 1010 in the device 1000 can be one or more. Figure 10Take a processor as an example. In the embodiments of the present application, the processor 1010, the communication interface 1020, and the memory 1030 can be connected through a bus system or other means. Among them, Figure 10 Take the connection through the bus system 1040 as an example.

[0237] The processor 1010 can be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The processor 1010 can further include a hardware chip. The above-mentioned hardware chip can be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0238] The memory 1030 can include a volatile memory, such as a random-access memory (RAM); the memory 1030 can also include a non-volatile memory, such as a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the memory 1030 can also include a combination of the above-mentioned types of memories. The memory 1030 can store the aforementioned indication information, for example.

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

[0240] The bus system 1040 can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus system 1040 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 it is only represented by a thick line in Figure 10 , but it does not mean that there is only one bus or one type of bus.

[0241] The embodiments of the present application provide a computer-readable storage medium, including instructions or a computer program, which, when running on a computer, cause the computer to execute the methods described in the above method embodiments. For example, when the instructions or the computer program run on a computer, the computer is caused to execute the data processing method performed by the communication device as the sending end described in the above method embodiments. Another example is that when the instructions or the computer program run on a computer, the computer is caused to execute the data processing method performed by the communication device as the receiving end described in the above method embodiments.

[0242] The embodiments of the present application provide a computer program product including instructions or a computer program, which, when running on a computer, cause the computer to execute the methods described in the above method embodiments. For example, when the computer program product runs on a computer, the computer is caused to execute the data processing method performed by the communication device as the sending end described in the above method embodiments. Another example is that when the computer program product runs on a computer, the computer is caused to execute the data processing method performed by the communication device as the receiving end described in the above method embodiments.

[0243] The embodiments of the present application further provide a communication system for executing the data processing method provided by the embodiments of the present application. Specifically, the communication system may include a sending end and a receiving end. The sending end is used to execute the data processing method performed by the communication device as the sending end provided in the above method embodiments, and the receiving end is used to execute the data processing method performed by the communication device as the receiving end provided in the above method embodiments.

[0244] The terms "first", "second", "third", "fourth", etc. (if any) in the description, claims and above-mentioned drawings of this application are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

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

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

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

[0248] In addition, the business units in each embodiment of this application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software business units.

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

[0250] Those skilled in the art should be able to realize that in the above one or more examples, the operations described in the present invention can be implemented by hardware, software, firmware, or any combination thereof. When implemented using software, these operations can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, where communication media includes any medium that facilitates the transfer of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0251] The above specific implementation manners further elaborate on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above is only the specific implementation manners of the present invention.

[0252] The above, the above embodiments are only used to illustrate the technical solutions of this application, rather than limiting it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of various embodiments of this application.

Claims

1. A data processing method, characterized in that, the method is applied to a communication device, the communication device includes a first module and a second module, the second module is a physical layer module, and the method includes: the first module obtains a first data stream and control information, and the control information indicates whether the first data stream includes valid data; the first module sends the first data stream and the control information to the second module; the second module determines a working mode of the second module when processing the first data stream according to the control information, and the working mode includes: a normal mode or a low-power mode.

2. The method according to claim 1, characterized in that, the first module is a media access control (MAC) layer module or a physical layer sub-module, and the physical layer sub-module is different from the second module.

3. The method according to claim 1 or 2, characterized in that, the first data stream includes a plurality of code blocks, and the second module determines a working mode of the second module when processing the first data stream according to the control information, including: the second module determines working modes respectively corresponding to each of the plurality of code blocks when processing each of the plurality of code blocks according to the control information.

4. The method according to claim 3, characterized in that, the control information includes sub-control information respectively corresponding to each of the plurality of code blocks, and each sub-control information indicates whether the corresponding code block includes valid data.

5. The method according to claim 3 or 4, characterized in that, the plurality of code blocks includes a first code block and a second code block, the control information indicates that the first code block includes valid data and the second code block does not include valid data, and the second module determines working modes respectively corresponding to each of the plurality of code blocks when processing each of the plurality of code blocks according to the control information, including: the second module determines that the working mode of the second module when processing the first code block is the normal mode, and determines that the working mode of the second module when processing the second code block is the low-power mode.

6. The method according to claim 3 or 4, characterized in that, the control information indicates that each of the code blocks included in the first data stream includes valid data, and the second module determines working modes respectively corresponding to each of the plurality of code blocks when processing each of the plurality of code blocks according to the control information, including: the second module determines that the working mode of the second module when processing each of the code blocks included in the first data stream is the normal mode.

7. The method according to claim 3 or 4, characterized in that, the control information indicates that none of the code blocks included in the first data stream includes valid data, and the second module determines working modes respectively corresponding to each of the plurality of code blocks when processing each of the plurality of code blocks according to the control information, including: the second module determines that the working mode of the second module when processing each of the code blocks included in the first data stream is the low-power mode.

8. The method according to any one of claims 1-7, characterized in that, the physical layer module includes a Physical Coding Sublayer (PCS) sub-module. When the working mode of the second module for processing the first data stream is the low power consumption mode, the PCS sub-module does not perform scrambling operation and / or Forward Error Correction (FEC) coding operation on the first data stream.

9. The method according to any one of claims 1-8, characterized in that, the physical layer module includes a Physical Medium Attachment (PMA) sub-module and a Physical Medium Dependent (PMD) sub-module, and the method further includes: when the working mode of the second module for processing the first data stream is the low power consumption mode, the PMA sub-module sends a pseudo-random code sequence to the PMD sub-module.

10. The method according to any one of claims 1-9, characterized in that, the PCS sub-module included in the physical layer module performs a scrambling operation on the first data stream in the normal mode, stops performing the scrambling operation on the first data stream in the low power consumption mode, and when the PCS sub-module switches from the low power consumption mode to the normal mode, the scrambling seed used by the PCS sub-module for performing the scrambling operation on the first data stream is continuous with the scrambling seed used for the previous scrambling operation on the first data stream.

11. The method according to any one of claims 1-10, characterized in that, the method further includes: the first module obtains a second data stream, and the second data stream includes indication information for indicating whether the first data stream includes valid data; the first module obtains the first data stream and control information, including: the first module obtains the first data stream and generates the control information according to the indication information.

12. The method according to claim 11, characterized in that, the physical layer module includes a PCS sub-module, and the data obtained by the PCS sub-module after processing the first data stream and the data obtained by the PCS sub-module after processing the second data stream are in different Alignment Marker (AM) windows.

13. The method according to claim 11, characterized in that, the physical layer module includes a PCS sub-module, the data obtained by the PCS sub-module after processing the second data stream is between a first Alignment Marker (AM) and a second Alignment Marker (AM), and the data obtained by the PCS sub-module after processing the first data stream is between a third AM and a fourth AM.

14. The method according to any one of claims 11-13, characterized in that, the indication information is specifically used to indicate the proportion of valid data included in the first data stream, and the code blocks carrying the valid data in the first data stream are evenly distributed in the first data stream.

15. The method according to any one of claims 11-14, characterized in that, the second data stream includes an Ethernet frame, and the Ethernet frame carries the indication information.

16. The method according to claim 15, characterized in that, the Start Frame Delimiter (SFD) field of the Ethernet frame indicates that the Ethernet frame carries the indication information.

17. The method according to any one of claims 11-16, wherein, the first module obtaining a second data stream includes: the first module determining the traffic proportion of valid data and invalid data, and the data volume of the valid data; the first module determining whether the first data stream includes valid data according to the traffic proportion and the data volume of the valid data, and generating the second data stream including the indication information.

18. A data processing method, wherein, the method is applied to a communication device, the communication device includes a first module and a second module, the second module is a physical layer module, and the method includes: the first module receiving a second data stream, the second data stream includes indication information, and the indication information indicates whether the first data stream includes valid data; the first module sending the indication information to the second module, and the second module is a physical layer module; the second module determining a working mode of the second module when processing the first data stream according to the indication information, and the working mode includes: a normal mode or a low-power mode.

19. The method according to claim 18, wherein, the first module is a media access control (MAC) layer module or a physical layer sub-module, and the physical layer sub-module is different from the second module.

20. The method according to claim 18 or 19, wherein, the first data stream and the second data stream are within different alignment word flag (AM) windows.

21. The method according to claim 18 or 19, wherein, the second data stream is between a first AM and a second AM, and the first data stream is between a third AM and a fourth AM.

22. The method according to any one of claims 18-21, wherein, the indication information is specifically used to indicate the proportion of valid data included in the first data stream, and the code blocks carrying the valid data in the first data stream are evenly distributed in the first data stream.

23. The method according to any one of claims 18-22, wherein, the second data stream includes an Ethernet frame, and the Ethernet frame carries the indication information.

24. The method according to claim 23, wherein, a start-of-frame delimiter (SFD) of the Ethernet frame indicates that the Ethernet frame carries the indication information.

25. The method according to any one of claims 18-24, wherein, the first data stream includes a plurality of code blocks, and the second module determining the working mode of the second module when processing the first data stream according to the indication information includes: the second module determining the respective working modes corresponding to each of the plurality of code blocks when processing the plurality of code blocks according to the indication information.

26. The method according to claim 25, wherein, The multiple code blocks include a first code block and a second code block. The control information indicates that the first code block includes valid data and the second code block does not include valid data. The second module determines the working modes respectively corresponding to the second module when processing each of the multiple code blocks according to the indication information, including: The second module determines that the working mode of the second module when processing the first code block is the normal mode, and determines that the working mode of the second module when processing the second code block is the low-power mode.

27. The method according to claim 25, wherein, the control information indicates that each code block included in the first data stream includes valid data. The second module determines the working modes respectively corresponding to the second module when processing each of the multiple code blocks according to the indication information, including: The second module determines that the working mode of the second module when processing each code block included in the first data stream is the normal mode.

28. The method according to claim 25, wherein, the control information indicates that each code block included in the first data stream does not include valid data. The second module determines the working modes respectively corresponding to the second module when processing each of the multiple code blocks according to the indication information, including: The second module determines that the working mode of the second module when processing each code block included in the first data stream is the low-power mode.

29. The method according to any one of claims 18-28, wherein, the second module includes a Physical Medium Attachment (PMA) sub-module and a Physical Medium Dependent (PMD) sub-module. When the working mode of the second module when processing the first data stream is the low-power mode, the PMA sub-module discards the data from the PMD sub-module.

30. A communication device, wherein, the communication device includes a first module and a second module, and the second module is a physical layer module; the first module is configured to obtain a first data stream and control information, where the control information indicates whether the first data stream includes valid data; and send the first data stream and the control information to the second module; the second module is configured to determine the working mode of the second module when processing the first data stream according to the control information, and the working mode includes: normal mode or low-power mode.

31. A communication device, wherein, the communication device includes a first module and a second module, and the second module is a physical layer module; the first module is configured to receive a second data stream, where the second data stream includes indication information indicating whether the first data stream includes valid data; and send the indication information to the second module, and the second module is a physical layer module; the second module is configured to determine the working mode of the second module when processing the first data stream according to the indication information, and the working mode includes: normal mode or low-power mode.

32. A chip, characterized in that, the chip includes an interface circuit and a processing circuit; the interface circuit is used to obtain a first data stream and control information, and the control information indicates whether the first data stream includes valid data; the first data stream and the control information are sent to the processing circuit, and the processing circuit is applied to a physical layer module; the processing circuit is used to determine the working mode of the processing circuit when processing the first data stream according to the control information, and the working mode includes: normal mode or low-power mode.

33. A chip, characterized in that, the chip includes an interface circuit and a processing circuit; the interface circuit is used to receive a second data stream, the second data stream includes indication information, and the indication information indicates whether the first data stream includes valid data; the indication information is sent to the processing circuit, and the processing circuit is applied to a physical layer module; the processing circuit is used to determine the working mode of the processing circuit when processing the first data stream according to the indication information, and the working mode includes: normal mode or low-power mode.

34. A device, characterized in that, it includes: a processor and a memory; the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs and execute the method according to any one of claims 1-29.

35. A computer-readable storage medium, characterized in that, it includes instructions or computer programs, and when running on a computer, it causes the computer to execute the method according to any one of claims 1-29 above.

36. A communication system, characterized in that, the communication system includes: a communication device that executes the method according to any one of claims 1-17 above, and a communication device that executes the method according to any one of claims 18-29 above.