Encoding method, decoding method, apparatus, device, system, and readable storage medium
By grouping control and data blocks for encoding and decoding without transcoding, the method addresses inefficiencies in existing data transmission methods, improving efficiency and reducing resource usage in communication technology.
Patent Information
- Application Number
- JP2024540639
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-01-30
- Filing Date
- 2022-12-27
- Publication Date
- 2025-01-15
AI Technical Summary
Existing data transmission methods in communication technology, particularly in Ethernet, incur unnecessary delay, power consumption, and chip area occupation due to 64B/66B encoding and decoding processes, especially when high-speed physical links are used.
The proposed method involves encoding and decoding methods that group control and data blocks into target code blocks, performing 64B/66B encoding on these groups without transcoding, thereby improving efficiency and reducing delay, power consumption, and chip area occupation.
This approach enhances encoding and decoding efficiency by eliminating the need for transcoding, thus reducing unnecessary delays and resource consumption in data transmission processes.
Smart Images

Figure 2025501011000001_ABST
Abstract
Description
[Technical field]
[0001]
[0002] The present application relates to the field of communication technologies, and in particular to an encoding method, a decoding method, an apparatus, a device, a system, and a readable storage medium. [Background technology]
[0003] With the development of communication technology, data processing methods in the data transmission process are becoming more and more diverse. For example, packets of a media access control (MAC) layer are delivered to a physical coding sublayer (PCS) through a media independent interface (MII). For example, packets are delivered to a PCS through an 800 gigabit (G) MII, where 800G MII represents an MII operating at a MAC rate of 800 gigabits per second (Gb / s). The data bit width of the MII is 72 bits, which includes an 8-bit control block (transmission control, TXC) and a 64-bit data block (transmit data, TXD). TXC and TXD are obtained by processing the packet flow content from the MAC layer through a reconciliation sublayer (RS). The PCS performs coding based on the content of TXC / TXD to reduce overhead and provide the necessary synchronization and protection functions.
[0004] In the related technology, the PCS performs 64-bit (bit, B) / 66B coding on the control block and data block from the MII at the transmitting end to obtain a 66-bit code block. When data transmission is performed by using a high-speed physical link, every four 66-bit code blocks are transcoded into one 256B / 257B coding block with a length of 257 bits, and forward error correction (FEC) coding is performed on the 275-bit code block, and the FEC codeword obtained through FEC coding is transmitted. After receiving the FEC codeword, the receiving end performs FEC decoding on the FEC codeword to obtain a 275-bit code block. In the FEC decoding process, error correction is performed on the FEC codeword, and for the uncorrectable FEC codeword, the error bits in the FEC codeword are identified. Each 275-bit code block is de-transcoded into four 66-bit 64B / 66B encoded blocks, and these four 66-bit code blocks are decoded to obtain control and data blocks in the MII format.
[0005] Since FEC encoding can provide data protection function and most of the processing in PCS is performed based on 275-bit code blocks, 64B / 66B encoding and decoding process is not necessary. If 64B / 66B encoding and decoding process is retained, the subsequent transcoding / detranscoding process will cause unnecessary delay, power consumption, and chip area occupation. Summary of the Invention
[0006] The present application provides an encoding method, a decoding method, an apparatus, a device, a system, and a readable storage medium for improving encoding and decoding efficiency.
[0007] According to a first aspect, there is provided a method of encoding, the method comprising: nobtaining groups of n, where any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; and n performing a first encoding on the group to obtain a target code block, where the target code block is a data unit and the two of the code stream blocks; n the data unit includes a type determined based on the control blocks in the two groups of code stream blocks; n In the coding scheme determined based on the control block and the data block in each group, n the first encoding is obtained by performing the first encoding on the data blocks in the group.
[0008] According to the encoding method provided in this embodiment of the present application, the target code block is n 64B / 66B encoding is performed on each of the groups to obtain 2 n 2 66-bit code blocks are obtained, and n 2 of the code stream blocks including the control block and the data block can be encoded without the need to transcode the 66-bit code blocks. n The first encoding is performed on the group to obtain the first set of the first and second encodings. Thus, the encoding efficiency is improved, and the delay, power consumption, and chip area occupation caused by the encoding process are reduced.
[0009] In a possible implementation, the type indicates that the target code block is a data code block; and the data unit is a 2-byte code stream block. n The two groups of code stream blocks are n The data blocks are obtained by performing the first encoding on the data blocks in this group.
[0010] In a possible implementation, the type indicates that the target code block is a control code block; and the data unit includes a code block identifier ID and a code block content, where the code block content is the second code block of the code stream block. n The two groups of the code stream block are selected based on a sequence determined based on the control block and the data block. n the code block ID is obtained by performing the first encoding on the data blocks in the group of two code stream blocks; n The code block ID is obtained based on the control blocks and the data blocks in each group of code stream blocks, and the code block ID indicates the type of data block in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content.
[0011] In a possible implementation, the code block ID includes a first ID and a second ID, where the first ID indicates the type of the data block in each group of code stream blocks and the second ID indicates the location of the first encoded content of each group of code stream blocks in the code block content.
[0012] In a possible implementation, the code block ID comprises m bits, where m is an integer greater than or equal to four.
[0013] In a possible implementation, the code block ID has Hamming distance protection.
[0014] In a possible implementation, the target code block is an error code block, the error code block including error indication data.
[0015] According to the encoding method provided in this application, the first encoding can be performed on different types of code stream blocks to obtain a target code block, and therefore the method has wide application.
[0016] In a possible implementation, the target code block is a code stream block of the second bit based on an error detection result. n the error detection result is obtained by processing the two groups of the code stream block. n A code stream block is obtained based on the control blocks and the data blocks in this group. The erroneous code stream blocks are processed to distinguish erroneous data from correct data in a subsequent data transmission to ensure data reliability.
[0017] In a possible implementation, the error detection result is n the target code block includes a code stream block having a correct content sequence and a correct content, and the two code stream blocks having the correct content sequence and the correct content. n the error blocks are obtained by performing the first encoding based on the error blocks in the groups, the error blocks being n The content sequence error or content error is obtained based on the code stream blocks having the content sequence error or content error in this group.
[0018] In a possible implementation, the control block includes t bits and the data block includes 8t bits, where t is a positive integer.
[0019] In a possible implementation, the value of n is 2, the value of t is 8 and the target code block is 257 bits.
[0020] In a possible implementation, the two code stream blocks nAll of this group is from the Media Independent Interface MII.
[0021] In a possible implementation, after obtaining the target code block, the method further includes: performing a second encoding on the target code block based on an FEC code type to obtain first data; and transmitting the first data. The second encoding is performed on the target code block based on an FEC code type to obtain first data, so that a receiving end can perform error correction on the received first data to ensure data transmission accuracy.
[0022] According to a second aspect, a decoding method is provided, the method including the steps of: obtaining a target code block, where the target code block includes a type and a data unit; and performing a first decoding on the target code block based on the type and the data unit of the target code block to decode two code stream blocks. n obtaining groups of n, where any group of code stream blocks includes a data block and a control block obtained based on the type and the data unit, the data block being obtained by performing the first decoding on the data unit in a decoding scheme determined based on the type and the data unit, and n being an integer greater than 1.
[0023] According to the decoding method provided in the present application, two code stream blocks including a control block and a data block are decoded. n This group transcodes the target code block to obtain n 2 66-bit code blocks are obtained, and nThe target code block is obtained by performing a first decoding on the target code block without needing to decode 66-bit code blocks, thereby improving the decoding efficiency and reducing the delay, power consumption, and chip area occupation caused by the decoding process.
[0024] In a possible implementation, the type indicates that the target code block is a data code block; n A data block included in group i of code stream blocks in the groups is obtained by performing the first decoding on a content in the data unit that corresponds to group i of code stream blocks and has a length of 8t, where t is a positive integer, i is greater than or equal to 1, and 2. n or i is an integer less than or equal to 0 and 2 n An integer less than or equal to -1.
[0025] In a possible implementation, the type indicates that the target code block is a control code block, and the data unit includes a code block identifier ID and a code block content, the code block ID indicating a type of data block in each group of code stream blocks and a location of the first encoded content of each group of code stream blocks in the code block content; n A control block included in group i of the code stream block in the group is obtained based on the type and the code block ID, and the second control block of the code stream block is n A data block included in a group i of the code stream blocks in the group is obtained by performing the first decoding on the code block content in a decoding manner determined based on the type and the code block ID, where i is greater than or equal to 1 and is less than or equal to 2. nor i is an integer less than or equal to 0 and 2 n An integer less than or equal to -1.
[0026] In a possible implementation, the code block ID includes a first ID and a second ID, where the first ID indicates the type of the data block in each group of code stream blocks and the second ID indicates the location of the first encoded content of each group of code stream blocks in the code block content; the control blocks included in group i of code stream blocks are obtained based on the type, bits in the first ID and corresponding to group i of code stream blocks, and bits in the second ID and corresponding to group i of code stream blocks; and the data blocks included in group i of code stream blocks are obtained by performing the first decoding on the code block content in a decoding scheme determined based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks.
[0027] In a possible implementation, the type of the data blocks included in group i of code stream blocks is determined based on the content of the control blocks included in group i of code stream blocks and the content of the data blocks included in group i of code stream blocks.
[0028] In a possible implementation, the code block ID comprises m bits, where m is an integer greater than or equal to four.
[0029] In a possible implementation, the code block ID has Hamming distance protection.
[0030] In a possible implementation, the data unit includes a code block identifier ID, and the type and the code block ID indicate that the target code block is an error code block; n The control block included in each of the groups is a first value, and the second value of the code stream block is n A data block included in each of the groups is a second value, and the first value and the second value indicate that the code stream block is an error code stream block.
[0031] According to the decoding method provided in the present application, a first decoding is performed on a different type of target code block to obtain two code stream blocks. n It is possible to obtain a group of individuals. Therefore, this method has wide application.
[0032] In a possible implementation, the step of obtaining the target code block includes: receiving second data, where the second data is obtained based on forward error correction FEC encoded first data; and performing a second decoding on the second data to obtain the target code block, where the second decoding is an error correction process. has.
[0033] In a possible implementation, the target code block is an error code block obtained when error correction is performed on the second data but the error correction fails.
[0034] In a possible implementation, the step of obtaining a target code block includes: receiving second data, where the second data is obtained based on forward error correction FEC encoded first data; and performing second decoding on the second data to obtain the target code block, where the second decoding is an error detection process in which error correction is avoided.
[0035] In a possible implementation, the target code block is an error code block obtained when an error is detected from the second data but error correction is avoided.
[0036] In a possible implementation, the two code stream blocks n The group is obtained by performing the first decoding on the target code block based on an error detection result and the type and data unit of the target code block, and the error detection result is obtained based on the type and data unit of the target code block.
[0037] In a possible implementation, the error detection result includes a content sequence error or a content error of the target code block, and the second code stream block. n The groups are obtained by performing the first decoding on a second code block based on a type of the second code block and a data unit, the second code block being a code block obtained by transforming the target code block and having the same number of bits as the target code block, and the target code block in which an error occurs is processed so that a receiving end can distinguish between erroneous data and correct data to ensure data reliability.
[0038] In a possible implementation, the error detection result includes a content sequence error or a content error of the target code block, and the second code stream block. n These groups are the 2 n The first code stream block is obtained by transforming the first group of nThe groups are obtained by performing the first decoding on the target code block based on the type of the target code block and the data unit, and the target code block in which an error occurs is processed so that a receiving end can distinguish between erroneous data and correct data to ensure data reliability.
[0039] In a possible implementation, the control block includes t bits and the data block includes 8t bits, where t is a positive integer.
[0040] In a possible implementation, the value of n is 2, the value of t is 8 and the target code block is 257 bits.
[0041] In a possible implementation, the two code stream blocks n All of this group is in the Media Independent Interface (MII) format.
[0042] According to a third aspect, there is provided an encoding device, the device comprising: Code stream block 2 n a capture module configured to capture n groups, where any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; and The first two code stream blocks n a first encoding module configured to perform a first encoding on the group to obtain a target code block, where the target code block includes a data unit and the two of the code stream blocks; n the data unit includes a type determined based on the control blocks in the two groups of code stream blocks; n In the coding scheme determined based on the control block and the data block in each group, nobtained by performing the first encoding on the data blocks in the group; Equipped with.
[0043] In a possible implementation, the type indicates that the target code block is a data code block; and the data unit is a 2-byte code stream block. n The two groups of code stream blocks are n The data blocks are obtained by performing the first encoding on the data blocks in this group.
[0044] In a possible implementation, the type indicates that the target code block is a control code block; and the data unit includes a code block identifier ID and a code block content, where the code block content is the second code block of the code stream block. n The two groups of the code stream block are selected based on a sequence determined based on the control block and the data block. n the code block ID is obtained by performing the first encoding on the data blocks in the group of two code stream blocks; n The code block ID is obtained based on the control blocks and the data blocks in each group of code stream blocks, and the code block ID indicates the type of data block in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content.
[0045] In a possible implementation, the code block ID includes a first ID and a second ID, where the first ID indicates the type of the data block in each group of code stream blocks and the second ID indicates the location of the first encoded content of each group of code stream blocks in the code block content.
[0046] In a possible implementation, the code block ID comprises m bits, where m is an integer greater than or equal to four.
[0047] In a possible implementation, the code block ID has Hamming distance protection.
[0048] In a possible implementation, the target code block is an error code block, the error code block including error indication data.
[0049] In a possible implementation, the target code block is a code stream block of the second bit based on an error detection result. n the error detection result is obtained by processing the two groups of the code stream block. n The control block and the data block are obtained based on the group.
[0050] In a possible implementation, the error detection result is n the target code block includes a code stream block having a correct content sequence and a correct content, and the two code stream blocks having the correct content sequence and the correct content. n the error blocks are obtained by performing the first encoding based on the error blocks in the groups, the error blocks being n The content sequence error or content error is obtained based on the code stream blocks having the content sequence error or content error in this group.
[0051] In a possible implementation, the control block includes t bits and the data block includes 8t bits, where t is a positive integer.
[0052] In a possible implementation, the value of n is 2, the value of t is 8 and the target code block is 257 bits.
[0053] In a possible implementation, the two code stream blocks n All of this group is from the Media Independent Interface MII.
[0054] In a possible implementation, the apparatus further includes: a second encoding module configured to perform second encoding on the target code block based on a forward error correction FEC code type to obtain first data; and a transmitting module configured to transmit the first data.
[0055] According to a fourth aspect, there is provided a decoding device, the device comprising: an acquisition module configured to acquire a target code block, where the target code block includes a type and a data unit; and performing a first decoding on the target code block based on the type of the target code block and the data unit; n a decoding module configured to obtain groups of code stream blocks, where any group of code stream blocks includes a data block and a control block obtained based on the type and the data unit, the data block being obtained by performing the first decoding on the data unit in a decoding scheme determined based on the type and the data unit, and n being an integer greater than 1; Equipped with.
[0056] In a possible implementation, the type indicates that the target code block is a data code block; n A data block included in group i of code stream blocks in the groups is obtained by performing the first decoding on a content in the data unit that corresponds to group i of code stream blocks and has a length of 8t, where t is a positive integer, i is greater than or equal to 1, and 2. nor i is an integer less than or equal to 0 and 2 n An integer less than or equal to -1.
[0057] In a possible implementation, the type indicates that the target code block is a control code block, and the data unit includes a code block identifier ID and a code block content, the code block ID indicating a type of data block in each group of code stream blocks and a location of the first encoded content of each group of code stream blocks in the code block content; n A control block included in group i of the code stream block in the group is obtained based on the type and the code block ID, and the second control block of the code stream block is n A data block included in a group i of the code stream blocks in the group is obtained by performing the first decoding on the code block content in a decoding manner determined based on the type and the code block ID, where i is greater than or equal to 1 and is less than or equal to 2. n or i is an integer less than or equal to 0 and 2 n An integer less than or equal to -1.
[0058] In a possible implementation, the code block ID includes a first ID and a second ID, where the first ID indicates the type of the data block in each group of code stream blocks and the second ID indicates the location of the first encoded content of each group of code stream blocks in the code block content; the control blocks included in group i of code stream blocks are obtained based on the type, bits in the first ID and corresponding to group i of code stream blocks, and bits in the second ID and corresponding to group i of code stream blocks; and the data blocks included in group i of code stream blocks are obtained by performing the first decoding on the code block content in a decoding scheme determined based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks.
[0059] In a possible implementation, the type of the data blocks included in group i of code stream blocks is determined based on the content of the control blocks included in group i of code stream blocks and the content of the data blocks included in group i of code stream blocks.
[0060] In a possible implementation, the code block ID comprises m bits, where m is an integer greater than or equal to four.
[0061] In a possible implementation, the code block ID has Hamming distance protection.
[0062] In a possible implementation, the data unit includes a code block identifier ID, and the type and the code block ID indicate that the target code block is an error code block; nThe control block included in each of the groups is a first value, and the second value of the code stream block is n A data block included in each of the groups is a second value, and the first value and the second value indicate that the code stream block is an error code stream block.
[0063] In a possible implementation, the acquisition module is configured to: receive second data, where the second data is acquired based on the first data encoded by using a forward error correction FEC code type; and perform second decoding on the second data to acquire the target code block, where the second decoding is an error correction process.
[0064] In a possible implementation, the target code block is an error code block obtained when error correction is performed on the second data but the error correction fails.
[0065] In a possible implementation, the acquisition module is configured to: receive second data, where the second data is acquired based on first data encoded by using a forward error correction FEC code type; and perform second decoding on the second data to acquire the target code block, where the second decoding is an error detection process in which error correction is avoided.
[0066] In a possible implementation, the target code block is an error code block obtained when an error is detected from the second data but error correction is avoided.
[0067] In a possible implementation, the two code stream blocks nThe group is obtained by performing the first decoding on the target code block based on an error detection result and the type and data unit of the target code block, and the error detection result is obtained based on the type and data unit of the target code block.
[0068] In a possible implementation, the error detection result includes a content sequence error or a content error of the target code block, and the second code stream block. n The group is obtained by performing the first decoding on a second code block based on a type and a data unit of the second code block, the second code block being a code block obtained by transforming the target code block and having the same number of bits as the target code block.
[0069] In a possible implementation, the error detection result includes a content sequence error or a content error of the target code block, and the second code stream block. n These groups are the 2 n The first code stream block is obtained by transforming the first group of n The group is obtained by performing the first decoding on the target code block based on the type of the target code block and the data unit.
[0070] In a possible implementation, the control block includes t bits and the data block includes 8t bits, where t is a positive integer.
[0071] In a possible implementation, the value of n is 2, the value of t is 8 and the target code block is 257 bits.
[0072] A possible implementation is to use 2 of the code stream blocks. nAll of this group is in the Media Independent Interface (MII) format.
[0073] According to a fifth aspect, there is provided a network device comprising a processor, wherein the processor is coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the network device to implement an encoding method according to any one of the first aspect or possible implementations of the first aspect, or a decoding method according to any one of the second aspect or possible implementations of the second aspect.
[0074] According to a sixth aspect, there is provided a computer readable storage medium, said storage medium storing at least one program instruction or code, which when loaded and executed by a processor enables the computer to implement the encoding method according to any one of the first aspect or a possible implementation of the first aspect, or the decoding method according to any one of the second aspect or a possible implementation of the second aspect.
[0075] According to a seventh aspect, there is provided a communication system comprising a first network device and a second network device, the first network device configured to perform an encoding method according to any one of the first aspects or a possible implementation of the first aspect, and the second network device configured to perform a decoding method according to any one of the second aspects or a possible implementation of the second aspect.
[0076] According to an eighth aspect, another communication device is provided. The device comprises a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection path. The memory is configured to store instructions. The processor is configured to execute the instructions stored in the memory for controlling the transceiver to receive a signal and for controlling the transceiver to transmit a signal. Additionally, when the processor executes the instructions stored in the memory, the processor is enabled to perform an encoding method according to any one of the first aspects or a possible implementation of the first aspect, or a decoding method according to any one of the second aspects or a possible implementation of the second aspect.
[0077] For example, there may be one or more processors and there may be one or more memories.
[0078] For example, the memory may be integrated with the processor, or the memory and the processor may be located separately.
[0079] In a particular implementation process, the memory may be a non-transitory memory, such as a read-only memory (ROM). The memory and the processor may be integrated on the same chip, or may be separately located on different chips. The type of memory and the manner of arranging the memory and the processor are not limited in this application.
[0080] According to a ninth aspect, there is provided a computer program product comprising computer program code which, when executed on a computer, enables the computer to perform the encoding method according to any one of the first aspect or possible implementations of the first aspect, or the decoding method according to any one of the second aspect or possible implementations of the second aspect.
[0081] According to a tenth aspect there is provided a chip comprising a processor and configured to retrieve instructions from a memory and execute the instructions stored in the memory for enabling a communication device to which the chip is attached to perform an encoding method according to any one of the first aspect or possible implementations of the first aspect, or a decoding method according to any one of the second aspect or possible implementations of the second aspect.
[0082] According to an eleventh aspect, there is provided another chip. The chip comprises an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is configured to execute code in the memory. When the code is executed, the processor is configured to execute an encoding method according to any one of the first aspects or a possible implementation of the first aspect, or a decoding method according to any one of the second aspects or a possible implementation of the second aspect. [Brief description of the drawings]
[0083] [Figure 1] FIG. 1 is a schematic diagram of an implementation environment for the encoding and decoding methods according to an embodiment of the present application;
[0084] [Diagram 2] 1 is a flowchart of an encoding method according to an embodiment of the present application;
[0085] [Diagram 3] FIG. 2 is a schematic diagram of a process for obtaining a target code block according to an embodiment of the present application;
[0086] [Figure 4] FIG. 2 is a schematic diagram of a structure of a target code block according to an embodiment of the present application;
[0087] [Diagram 5]FIG. 2 is a schematic diagram of another target code block structure according to an embodiment of the present application;
[0088] [Figure 6] FIG. 2 is a schematic diagram of another target code block structure according to an embodiment of the present application;
[0089] [Figure 7] FIG. 2 is a schematic diagram of another target code block structure according to an embodiment of the present application;
[0090] [Figure 8] FIG. 2 is a schematic diagram of data blocks in four groups of code stream blocks according to an embodiment of the present application;
[0091] [Figure 9] FIG. 11 is a schematic diagram of data blocks in other four groups of code stream blocks according to an embodiment of the present application.
[0092] [Figure 10] FIG. 11 is a schematic diagram of data blocks in other four groups of code stream blocks according to an embodiment of the present application.
[0093] [Figure 11] FIG. 2 is a schematic diagram of a termination block according to an embodiment of the present application.
[0094] [Figure 12] FIG. 11 is a schematic diagram of data blocks in other four groups of code stream blocks according to an embodiment of the present application.
[0095] [Figure 13] FIG. 11 is a schematic diagram of data blocks in other four groups of code stream blocks according to an embodiment of the present application.
[0096] [Figure 14]FIG. 11 is a schematic diagram of data blocks in other four groups of code stream blocks according to an embodiment of the present application.
[0097] [Figure 15] FIG. 11 is a schematic diagram of data blocks in other four groups of code stream blocks according to an embodiment of the present application.
[0098] [Figure 16] FIG. 11 is a schematic diagram of data blocks in other four groups of code stream blocks according to an embodiment of the present application.
[0099] [Figure 17] FIG. 11 is a schematic diagram of data blocks in other four groups of code stream blocks according to an embodiment of the present application.
[0100] [Figure 18] FIG. 2 is a schematic diagram of another target code block structure according to an embodiment of the present application;
[0101] [Figure 19] 2 is a flowchart of a decoding method according to an embodiment of the present application;
[0102] [Figure 20] FIG. 2 is a schematic diagram of another target code block structure according to an embodiment of the present application;
[0103] [Figure 21] FIG. 2 is a schematic diagram of the structure of an encoding device according to an embodiment of the present application;
[0104] [Figure 22] FIG. 2 is a schematic diagram of the structure of a decoding device according to an embodiment of the present application;
[0105] [Diagram 23] FIG. 2 is a schematic diagram of the structure of a network device according to an embodiment of the present application;
[0106] [Figure 24] FIG. 2 is a schematic diagram of the structure of another network device according to an embodiment of the present application;
[0107] [Diagram 25] FIG. 2 is a schematic diagram of the structure of another network device according to an embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0108] The terms used in the implementation of the present application are merely used to describe specific embodiments of the present application, and are not intended to limit the present application. The following description will describe the embodiments of the present application with reference to the accompanying drawings.
[0109] In the field of communication technology, as the requirements for data transmission are continuously increasing, the requirements for transmission rate are also continuously increasing. Ethernet is a local area network technology. With the rapid development of Ethernet, the rate of data transmission through Ethernet is continuously increasing. For example, for 100 Gigabit Ethernet (GE), data transmission is performed at a transmission rate of 25 Gb / s for a single lane. Based on ensuring high-speed data transmission, in order to guarantee the reliability of data transmission, FEC encoding is introduced into the physical layer when Ethernet is used for data transmission, so that error bits in received data are corrected by transmitting FEC codewords obtained through encoding. Because of the presence of check codes in the FEC codewords, the transmission rate required for FEC codeword transmission is higher than the transmission rate required for the transmission of the same payload within the same duration.
[0110] In order to reduce the transmission rate required for FEC codeword transmission, transcoding is used in the Ethernet standard to reduce the overhead of code blocks before FEC encoding, thereby reducing the transmission rate required for FEC codeword transmission. For example, every four 64B / 66B encoded blocks are transcoded into one 256B / 257B encoded block. Since the overhead of one 275-bit code block is lower than that of four 66-bit code blocks, the transmission rate required for FEC codeword transmission and obtained based on the 275-bit code blocks is low. When data transmission is performed through a 100G lane, the transmission rate required for FEC codeword transmission and obtained based on the transcoding code block transmission is 103.125 Gb / s, which is the same as the transmission rate required for the transmission of 66-bit code blocks without FEC encoding.
[0111] After obtaining the FEC codeword, the receiving end decodes the FEC codeword to obtain a 275-bit code block, inverse transcodes the 275-bit code block into four 66-bit code blocks, and decodes the four 66-bit code blocks to obtain a control block and a data block in MII format. Error bits in the FEC codeword can be identified based on FEC error identification, and most of the processing in the PCS is performed based on the 275-bit code block. Therefore, the 64B / 66B encoding and decoding process and the corresponding transcoding / inverse transcoding process generate unnecessary delay, power consumption, and chip area occupation.
[0112] Therefore, the present embodiment provides an encoding method and a decoding method. In the encoding process, the target code block is a 2nd bit of the code stream block. n performing 64B / 66B encoding on each of the groups; and nThe 66-bit code blocks are obtained without the need to transcode them. In the decoding process, n This group transcodes the target code block to obtain n 2 66-bit code blocks are obtained, and n The 66-bit code blocks are obtained without needing to be decoded, thus improving both the encoding efficiency and the decoding efficiency, and reducing the delay, power consumption, and chip area occupation caused by the encoding and decoding processes.
[0113] The encoding and decoding methods provided in the embodiments of the present application are applicable to the current Ethernet interface scenario or other scenarios where data transmission is required. The implementation scenario shown in FIG. 1 is used as an example. This implementation scenario includes multiple chips, and information can be exchanged between these chips to implement data transmission. For example, both chip 102 and chip 104 support FEC encoding and FEC decoding, and the channel 105 between chip 102 and chip 104 can be used for transmitting FEC encoded data. In this case, chip 102 can transmit two of the code stream blocks. n The chip 104 may perform a first encoding on the group to obtain a target code block, perform a second encoding on the target code block based on the first FEC code type to obtain first data, and transmit the first data to the chip 104 through the channel 105. For example, an error bit may occur during the transmission of the first data through the channel 105, and the received data is referred to as the second data. After receiving the second data, the chip 104 may perform a second decoding on the second data by using the first FEC code type to obtain a target code block, and perform a first decoding on the target code block to obtain the second data of the code stream block. n You may get groups of this.
[0114] n is an integer greater than 1, and the first FEC code type includes, but is not limited to, any one or more serial combinations of an RS code, a Bose-Chaudhuri-Hocquenghem (BCH) code, a Hamming code, an extended-BCH code, an extended-Hamming code, a fire code, a turbo code, a turbo product code (TPC), a staircase code, and a low-density parity-check (LDPC) code.
[0115] Optionally, the implementation scenario shown in Fig. 1 may include multiple network devices. Chip 102 is located on a first network device 101, and chip 104 is located on a second network device 103. Each network device may include at least one chip. In Fig. 1, only one example in which there are two network devices and each network device includes one chip is used for explanation.
[0116] With reference to the implementation scenario shown in Fig. 1, an encoding method provided in one embodiment of the present application is shown in Fig. 2. For example, the encoding method provided in this embodiment of the present application is performed by the chip 102 in Fig. 1, and the method includes, but is not limited to, step 201 and step 202.
[0117] Step 201: n groups, where any group of codestream blocks includes a control block and a data block, and n is an integer greater than 1.
[0118] The number of code stream blocks is not limited in this embodiment of the present application, and n is an integer greater than 1. In a possible implementation,n All of the groups are from the MII. n The manner of obtaining the groups is not limited in this embodiment of the present application. For example, the MII is obtained by dividing the two groups of the code stream block into two groups. n To obtain the groups, n may be MII defined in the Institute of Electrical and Electronics Engineers (IEEE) 802.3 standard, such as IEEE 802.3-2018 and other versions of the IEEE 802.3 standard. For example, the value of n is 2, which indicates that four groups of code stream blocks are obtained.
[0119] A possible implementation is to use 2 of the code stream blocks. n For any one of the groups, the control block in any one of the groups of code stream blocks includes t bits and the data block in any one of the groups of code stream blocks includes 8t bits, where t is a positive integer and 8t represents 8 times t, which may alternatively be represented as 8*t. For example, the value of t is 8, and specifically, for any one of the groups of code stream blocks, the control block in any one of the groups of code stream blocks includes 8 bits and the data block in any one of the groups of code stream blocks includes 64 bits. In a possible implementation, the t bits included in the control block are all control bits, in other words, the control block includes t control bits, and the 8t bits included in the data block are all data, in other words, the data block includes 8t bits of data.
[0120] For example, a control block containing 8 control bits is represented as TXC<7:0>, a data block containing 64 bits of data is represented as TXD<63:0>, and the sequence of all bits in the control block and data block is from most significant bit (MSB) to least significant bit (LSB).
[0121] In a possible implementation, the data contained in TXD<63:0> includes, but is not limited to, MAC frame data and control data, and 8 bits are used as a data segment in TXD<63:0>. TXC<7:0> identifies each data segment in TXD<63:0> to perform different processing on the MAC frame data and control data so that the MAC frame data and control data can be correctly restored at the receiving end.
[0122] For example, to facilitate the following description, the names of the data segments are defined. In TXD<63:0>, the 8-bit MAC frame data is called a data character, which is represented by / D / and corresponds to TXC=0; the 8-bit control data is called a control character, which is represented by / C / and corresponds to TXC=1. For example, based on different meanings, the 8-bit control character ( / C / ) includes but is not limited to the following seven types: error control character (error character, / E / ), start control character (start character, / S / ), end control character (end character, / T / ), ordered set control character (ordered set character, / O / ), idle control character (idle character, / I / ), low power idle control character (low power idle, / LI / ), and another valid 8-bit control character. For the specific meanings and values of the control characters, please refer to IEEE 802.3-2018. The details will not be described again in this embodiment of the present application.
[0123] For example, when the control block of the code stream block is the first specified value, the data block of the code stream block does not include a control character, whereby the data block of the code stream block is called a MAC frame data block (data block, D), and the type of the code stream block is a data code stream block. The first specified value indicates that the type of the code stream block is a data code stream block. For example, the first specified value is 0x00, the TXC<7:0> of the code stream block is 0x00, the TXD<63:0> of the code stream block does not include a control character, the data block of the code stream block is a MAC frame data block, and the type of the code stream block is a data code stream block. When the control block of the code stream block is not the first specified value, the data block of the code stream block includes at least one control character, whereby the data block of the code stream block is called a control data block (control block, C), and the type of the code stream block is a control code stream block. For example, for a code stream block TXC<7:0>!=0x00, the code stream block TXD<63:0> contains at least one control character, the data block of the code stream block is a control data block, and the type of the code stream block is a control code stream block. For example, based on different functions, the control data block (C) includes, but is not limited to, the following seven types: error block (E), start block (S), terminate block (T), ordered set block (O), idle block (I), low power idle block (LPI), and another control data block.
[0124] Step 202: nA first encoding is performed on the group to obtain a target code block, where the target code block is a data unit and a code stream block. n the data unit includes a type determined based on the control blocks in the group, the data unit being one of two of the code stream blocks. n In the coding scheme determined based on the control blocks and data blocks in the groups, n The first encoding is performed on the data blocks in this group.
[0125] For example, in each group of code stream blocks, each control block is 8 bits and each data block is 64 bits. The first encoding is performed on four groups of code stream blocks to obtain one 257-bit target code block. For example, the target code block is a 257-bit encoded block. In this embodiment of the present application, n=2 is used as an example for explanation. When n is another value, the first encoding may be performed on every four groups of code stream blocks to obtain multiple target code blocks. For example, n=3, which indicates that eight groups of code stream blocks are obtained. The first encoding may be performed on the first four groups of code stream blocks to obtain one target code block, and the first encoding may be performed on the last four groups of code stream blocks to obtain one target code block.
[0126] A possible implementation is to use 2 of the code stream blocks. n Performing a first encoding on the group to obtain a target code block includes, but is not limited to, the following encoding scheme 1 and encoding scheme 2.
[0127] For coding scheme 1: The type of target code block is 2 of the code stream block.n The first encoding is determined as a data code block based on the control blocks in the group; n 2 of the code stream block based on the sequence of groups n A data unit is obtained for the data blocks in this group; a target code block is obtained based on the type and the data unit.
[0128] For example, for a target code block obtained in encoding method 1, the type indicates that the target code block is a data code block; the data unit is two of the code stream blocks. n 2 of the code stream block based on the sequence of groups n The first encoding is performed on the data blocks in this group.
[0129] A possible implementation is to use 2 of the code stream blocks. n If each of the control blocks in this group is a first specified value, it is determined that the type of the target code block is a data code block. For example, the control block in each group of code stream blocks is represented as TXC<7:0>, and the first specified value is 0x00. If the TXC<7:0> of each group of code stream blocks is 0x00, the type of each group of code stream blocks is a data code stream block.
[0130] In a possible implementation, the first encoding is n 2 of the code stream block based on the sequence of groups n The data units are obtained by performing the above steps on the data blocks in the group: n Based on the sequence of groups, the two bits of the code stream block are nThe method includes separately using the bits contained within the data block in the groups to obtain a data unit.
[0131] For example, j represents the sequence number of one of four groups of code stream blocks, where j=0, 1, 2, or 3. TXD_j<63:0> represents a data block in group j of code stream blocks, tx_coded<256:0> represents a target code block, and tx_coded <0> represents the type of the target code block, and tx_coded<(64j+64):(64j+1)> represents bits (64j+64) to (64j+1) of the target code block. In this case, each bit of tx_coded<256:0> is shown in Equation 1 and Equation 2 below: tx_coded <0> =1 (formula 1) tx_coded<(64j+64):(64j+1)>=TXD_j<63:0>, where j=0, 1, 2, or 3 (Equation 2)
[0132] In Equation 1, tx_coded <0> =1 indicates that the type is data code block. In Equation 2, tx_coded<(64j+64):(64j+1)>=TXD_j<63:0> indicates that the bits of the data block in each group of code stream blocks are used separately as the bits of the data unit.
[0133] For example, if j=0, then tx_coded<64:1>=TXD_0<63:0> indicates that bits 63 through 0 of the data blocks in group 0 of the code stream block are used as bits 64 through 1, respectively, of the target code block. If j=1, then tx_coded<128:65>=TXD_1<63:0> indicates that bits 63 through 0 of the data blocks in group 1 of the code stream block are used as bits 128 through 65, respectively, of the target code block. If j=2, then tx_coded<192:129>=TXD_2<63:0> indicates that bits 63 through 0 of the data blocks in group 2 of the code stream block are used as bits 192 through 129, respectively, of the target code block. For j=3, tx_coded<256:193>=TXD_3<63:0> indicates that bits 63 to 0 of the data blocks in group 3 of the code stream block are used as bits 256 to 193 of the target code block, respectively.
[0134] For example, Figure 3 is a schematic diagram of a process of acquiring a target code block. As shown in Figure 3, for the acquired four groups of code stream blocks, in each group of code stream blocks, each control block is represented as TXC<7:0>, and each data block is represented as TXD<63:0>. If TXC<7:0> in each of the four groups of code stream blocks is 0x00, the type of the target code block is a data code block. For example, the type of the target code block corresponds to bit 0 of the target code block, and bit 0 is set to 1, which indicates that the type is a data code block. This embodiment of the present application does not impose a restriction on the manner in which bit 0 is set to a value to indicate that the type is a data code block. Based on the sequence of the four groups of code stream blocks, the bits of the data blocks in the four groups of code stream blocks are used separately as the bits of the data unit to acquire a data unit. Therefore, the target bits can be acquired based on the type and the data unit.
[0135] For example, the structure of the obtained target code block is shown in Figure 4. Bit 0 of the target code block indicates the type of the target code block, and bit 0 is set to 1 to indicate that the type is a data code block. Bits 1 to 256 of the target code block indicate the data unit of the target code block, where D0 represents the 64 bits of the data block in group 0 of the code stream block, D1 represents the 64 bits of the data block in group 1 of the code stream block, D2 represents the 64 bits of the data block in group 2 of the code stream block, and D3 represents the 64 bits of the data block in group 3 of the code stream block.
[0136] For coding scheme 2: The type of the target code block is the 2 nA control code block is determined based on the control blocks in the group; a code block identifier (ID) is a code stream block identifier for each of the control blocks. n The code block ID is obtained based on the control blocks and data blocks in each group of code stream blocks, where the code block ID indicates the type of the data block in each group of code stream blocks and the location of the first encoding content of each group of code stream blocks in the code block content; the first encoding is the second encoding of the code stream block. n Based on the sequence determined based on the control blocks and data blocks in the group, two of the code stream blocks are n A code block content is obtained for the data blocks in the group; and a target code block is obtained based on the type and data unit, where the data unit includes a code block ID and a code block content. The code block ID value is the second of the code stream blocks corresponding to the target code block. n The code block ID value and the code stream block number are in one-to-one correspondence with the combination of the groups. n The correspondence between the combinations of the groups may be set as needed. For example, if the code block ID is 0x01, this corresponds to two consecutive code stream blocks corresponding to the target code block. n The first of these groups is the Start of the Ethernet frame, and the following two groups of code stream blocks. n - indicates that all of the 1 group are data of the Ethernet frame. Alternatively, if the code block ID is 0xF0, this indicates that the 2 consecutive code stream blocks corresponding to the target code block n Group 2 of groups n is the end of the Ethernet frame, and the preceding two n- indicates that all of the 1 group are data of the Ethernet frame. Alternatively, if the code block ID is 0xD1, this indicates that the 2 consecutive code stream blocks corresponding to the target code block n Indicates that all code stream blocks in this group are idle. n The correspondence between the combinations of the groups is not limited to the several cases listed in this embodiment of the present application. This is not limited in the present application. The code block ID values are examples, and the code block ID values and the code stream block 2 n Assuming that there is a one-to-one correspondence between the combinations of the groups, the actual application is not limited to the above example values, which is not limited in this embodiment of the present application.
[0137] For example, for a target code block obtained in encoding scheme 2, the type indicates that the target code block is a control code block; the data unit includes a code block ID and a code block content, where the code block content is the second code stream block. n Based on the sequence determined based on the control blocks and data blocks in the group, two of the code stream blocks are n The code block ID is obtained by performing a first encoding on the data blocks in the group, and the code block ID is obtained by performing a second encoding on the data blocks in the group. n The code block ID is obtained based on the control blocks and data blocks in each group of code stream blocks, and indicates the type of the data block in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content. n The sequence determined based on the control and data blocks in the group is n is the received sequence of this group.
[0138] A possible implementation is to use 2 of the code stream blocks. n If the control block in at least one of the groups is a second designated value, the type of the target code block is determined to be a control code block, where the second designated value indicates that the type of the code stream block is a control code stream block. n If the type of at least one of the groups is a control code stream block, the type of the target code block is a control code block. The second specified value is different from the first specified value. For example, the control block in each group of code stream blocks is represented as TXC<7:0>, and the first specified value is 0x00. If the TXC<7:0> of at least one of the groups of code stream blocks is the second specified value, i.e., not 0x00, the target code block is a control code block.
[0139] In a possible implementation, the code block ID is the 2 n Based on the control blocks and data blocks in this group, it is possible to obtain: n The type of data block in this group is 2 of the code stream block. n The code block ID of the target code block is obtained based on the type of the data blocks in the group of code stream blocks and the sequence of the group of code stream blocks. For example, the code block ID includes m bits, where m is a positive integer greater than or equal to 4. For example, the structure of the target code block is shown in Figure 5. The type corresponds to bit 0, the code block ID corresponds to bits (m-1) to 1, and the code block content corresponds to the remaining bits. For example, m=8 or m=12.
[0140] For example, the code block ID includes a first ID and a second ID, where the first ID indicates the type of data block in each group of code stream blocks, and the second ID indicates the location of the first encoded content of each group of code stream blocks in the code block content. For example, the structure of the target code block is shown in FIG. 6. The type corresponds to bit 0, the code block ID corresponds to bits (m-1) to 1, and the code block content corresponds to the remaining bits. Bits (m-1) to 1 are divided into two parts, where the first part including the least significant bits is the first ID and the second part including the most significant bits is the second ID. For example, the code block ID is 12 bits, where the first four least significant bits are the first ID and the last eight most significant bits are the second ID. The structure of the target code block is shown in FIG. 7. The type corresponds to bit 0, the first ID corresponds to bits 4 to 1, the second ID corresponds to bits 12 to 5, and the code block content corresponds to the remaining 244 bits. For example, the four bits included in the first ID indicate the type of the data block in each of the four groups of the code stream block. For example, if a data block of the code stream block is a MAC frame data block, the bit corresponding to the code stream block is 1; or if a data block of the code stream block is a control data block, the bit corresponding to the code stream block is 0.
[0141] Regardless of the above case of the code block ID, it should be noted that the code block ID may have Hamming distance protection.
[0142] In a possible implementation, for multiple cases of the type of data blocks in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content, the code block IDs corresponding to these cases are different. In other words, each unique code block ID indicates multiple cases of the type of data blocks in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content. For example, four groups of code stream blocks are used as an example for explanation. The types of data blocks in the four groups of code stream blocks include, but are not limited to, the following cases A1 to A8.
[0143] Case A1: A data block in the four groups of code stream blocks includes a data block of type error block.
[0144] For example, for case A1, the data blocks in the four groups of code stream blocks for different numbers and different locations of data blocks whose type is error block are shown in Figure 8, where C0 represents a control data block of a type other than error block. For example, for case 1 in Figure 8, the type of data blocks in the first group of code stream blocks is error block, and the type of data blocks in the remaining three groups of code stream blocks may be MAC frame data blocks or control data blocks of a type other than error block. The principles of the other cases in Figure 8 are the same as those of case 1. The details will not be described again in this specification.
[0145] Case A2: The data blocks in a group of four of the code stream blocks include only one data block of type start block.
[0146] For example, for case A2, the data blocks in the four groups of code stream blocks for different locations of the data blocks whose type is start block are shown in FIG. 9, where C1 represents a type of control data block other than start block, end block, error block, and ordered set block. For example, for case 1 in FIG. 9, the type of the data block in the first group of code stream blocks is start block, and the types of the data blocks in the remaining three groups of code stream blocks are all MAC frame data blocks. For case 2 in FIG. 9, the type of the data block in the first group of code stream blocks is C1, the type of the data block in the second group of code stream blocks is start block, and the types of the data block in the remaining two groups of code stream blocks are MAC frame data blocks. For case 3 in FIG. 9, the types of the data blocks in the first group of code stream blocks and the second group of code stream blocks are both C1, the type of the data block in the third group of code stream blocks is start block, and the type of the data block in the fourth group of code stream blocks is MAC frame data block. For case 4 in FIG. 9, the types of the data blocks in the first group of code stream blocks to the third group of code stream blocks are all C1, and the type of the data block in the fourth group of code stream blocks is start block.
[0147] Case A3: The data blocks in a group of four of the code stream blocks contain only one data block of type terminal block.
[0148] For example, for case A3, the data blocks in the four groups of code stream blocks for different locations of the data blocks whose type is terminal block are shown in FIG. 10, where C2 represents a type of control data block other than start block, terminal block, error block, and ordered set block. For example, for case 1 in FIG. 10, the type of the data block in the first group of code stream blocks is terminal block, and the types of the data blocks in the remaining three groups of code stream blocks are all C2. For case 2 in FIG. 10, the type of the data block in the first group of code stream blocks is MAC frame data block, the type of the data block in the second group of code stream blocks is terminal block, and the type of the data block in the remaining two groups of code stream blocks is C2. For case 3 in FIG. 10, the types of the data blocks in the first group of code stream blocks and the second group of code stream blocks are both MAC frame data block, the type of the data block in the third group of code stream blocks is terminal block, and the type of the data block in the fourth group of code stream blocks is C2. For case 4 in Figure 10, the types of the data blocks in the first group of code stream blocks to the third group of code stream blocks are all MAC frame data blocks, and the type of the data blocks in the fourth group of code stream blocks is termination blocks.
[0149] In a possible implementation, if a data block contains a termination control character ( / T / ), the type of the data block is a termination block. For example, different cases of termination blocks are shown in FIG. 11 based on different locations of the termination control character. In FIG. 11, the termination block is 64 bits, and every 8 bits is one byte; i indicates that the termination control character is byte i of the termination block, where i=0, 1, 2, 3, 4, 5, 6, or 7; / C3 / represents a control character other than the termination control character; and the padding bit may be 0. For the sorting of / T / , / D / , / C3 / , and padding bits in this implementation, please refer to the sorting shown in FIG. 11. The details will not be described again in this specification. In FIG. 11, the case where i=0 can be referred to as case 1, the case where i=1 can be referred to as case 2, and by analogy, the case where i=7 can be referred to as case 8.
[0150] Note that if the data blocks in the four groups of code stream blocks include only one data block whose type is an end block, the code block IDs are different for the end blocks corresponding to the end control characters in different locations. In other words, referring to Case 1-Case 4 shown in Figure 10 and Case 1-Case 8 shown in Figure 11, the code block IDs corresponding to the 32 cases are different.
[0151] Case A4: The data blocks in the four groups of code stream blocks include a data block of type ordered set block and do not include a data block of type start block or end block.
[0152] For example, for case A4, the data blocks in the four groups of code stream blocks for different numbers and different locations of data blocks whose type is ordered set block are shown in FIG. 12, where C4 represents a type of control data block other than start block, end block, error block, and ordered set block. For example, for case 1 in FIG. 12, the type of data blocks in the first group of code stream blocks is ordered set block, and the types of data blocks in the second group of code stream blocks to the fourth group of code stream blocks are all C4. For case 2 in FIG. 12, the type of data blocks in the second group of code stream blocks is ordered set block, and the types of data blocks in the three groups of code stream blocks other than the second group of code stream blocks are C4. For other cases in FIG. 12, please refer to the types and sequences of data blocks in the groups of code stream blocks in FIG. 12. Details will not be described again in this specification.
[0153] Case A5: The data blocks in the four groups of code stream blocks include a data block whose type is an ordered set block, and a data block whose type is a start block, and do not include a data block whose type is an end block.
[0154] For example, for case A5, the data blocks in the four groups of code stream blocks are shown in Figure 13 for different numbers and different locations of data blocks whose type is ordered set block, and different locations of data blocks whose type is start block, where C5 represents a type of control data block other than start block, end block, error block, and ordered set block. For example, for case 1 in Figure 13, the type of data blocks in the first group of code stream blocks is ordered set block, the type of data blocks in the second group of code stream blocks is start block, and the types of data blocks in the remaining two groups of code stream blocks are all MAC frame data block. For case 2, the type of data blocks in the first group of code stream blocks is ordered set block, the type of data blocks in the second group of code stream blocks is C5, the type of data blocks in the third group of code stream blocks is start block, and the type of data blocks in the fourth group of code stream blocks is MAC frame data block. For other cases in Figure 13, please refer to the types and sequences of data blocks in the group of code stream blocks in Figure 13. The details will not be described again in this specification.
[0155] Case A6: The data blocks in the four groups of code stream blocks include a data block of type end block and a data block of type ordered set block, and do not include a data block of type start block.
[0156] For example, for case A6, the data blocks in the four groups of code stream blocks are shown in FIG. 14 for different locations of data blocks whose type is terminal block and different numbers and different locations of data blocks whose type is ordered set block, where C6 represents a type of control data block other than start block, terminal block, error block, and ordered set block. For example, for case 1 in FIG. 14, the type of data blocks in the first group of code stream blocks is terminal block, the type of data blocks in the second group of code stream blocks is ordered set block, and the types of data blocks in the remaining two groups of code stream blocks are all C6. For case 2, the type of data blocks in the first group of code stream blocks is terminal block, the type of data blocks in the third group of code stream blocks is ordered set block, and the types of data blocks in the remaining two groups of code stream blocks are all C6. For other cases in FIG. 14, please refer to the types and sequences of data blocks in the groups of code stream blocks in FIG. 14. Details will not be described again in this specification.
[0157] In a possible implementation, if the data block includes a termination control character ( / T / ), the type of the data block is a termination block. The case of the termination block is the same as the case of the termination block in case A3, that is, the termination block is shown in FIG. 11. Details will not be described again in this specification. For example, referring to cases 1 to 11 shown in FIG. 14 and cases 1 to 8 shown in FIG. 11, the code block IDs corresponding to the 88 cases are different.
[0158] Case A7: The data blocks in the four groups of code stream blocks include a data block whose type is an end block and a data block whose type is a start block.
[0159] For example, for case A7, the data blocks in the four groups of code stream blocks for different locations of data blocks whose type is terminal block and data blocks whose type is start block are shown in FIG. 15, where C7 represents a type of control data block other than start block, terminal block, error block, and ordered set block. For example, for case 1 in FIG. 15, the type of data blocks in the first group of code stream blocks is terminal block, the type of data blocks in the second group of code stream blocks is start block, and the types of data blocks in the remaining two groups of code stream blocks are all MAC frame data blocks. For case 2, the type of data blocks in the first group of code stream blocks is terminal block, the type of data blocks in the second group of code stream blocks is C7, the type of data blocks in the third group of code stream blocks is start block, and the type of data blocks in the fourth group of code stream blocks is MAC frame data block. For other cases in FIG. 15, please refer to the types and sequences of data blocks in the groups of code stream blocks in FIG. 15. The details will not be explained again here.
[0160] In a possible implementation, if a data block includes a termination control character ( / T / ), the type of the data block is a termination block. The principle of the termination block is the same as that of the termination block in case A3, i.e., the termination block is shown in FIG. 11. Details will not be described again in this specification. For example, when a data block of type termination block precedes a data block of type start block, referring to cases 1 to 6 shown in FIG. 15 and cases 1 to 8 shown in FIG. 11, the code block IDs corresponding to the 48 cases are different. When a data block of type start block precedes a data block of type termination block, this indicates that four groups of code stream blocks correspond to a 32-byte data packet, and the termination control character is the seventh byte of the termination block, i.e., case 8 shown in FIG. 11.
[0161] Case A8: The data blocks in the four groups of code stream blocks include a data block whose type is an end block, a data block whose type is an ordered set block, and a data block whose type is a start block.
[0162] For example, for case A8, different locations of data blocks of type end block, different locations of data blocks of type start block, and different numbers and different locations of data blocks of type ordered set block, the data blocks in the four groups of code stream blocks are shown in Figure 16, where C8 represents a type of control data block other than start block, end block, error block, and ordered set block. For example, for case 1 in Figure 16, the type of data blocks in the first group of code stream blocks is end block, the type of data blocks in the second group of code stream blocks is ordered set block, the type of data blocks in the third group of code stream blocks is start block, and the type of data blocks in the fourth group of code stream blocks is MAC frame data block. For case 2, the type of the data blocks in the first group of code stream blocks is an end block, the type of the data blocks in the second group of code stream blocks is an ordered set block, the type of the data blocks in the third group of code stream blocks is C8, and the type of the data blocks in the fourth group of code stream blocks is a start block. For other cases in Figure 16, please refer to the types and sequences of data blocks in the groups of code stream blocks in Figure 16. The details will not be described again in this specification.
[0163] In a possible implementation, if the data block includes a termination control character ( / T / ), the type of the data block is a termination block. The principle of the termination block is the same as that of the termination block in case A3, that is, the termination block is shown in FIG. 11. Details will not be described again in this specification. For example, referring to cases 1 to 5 shown in FIG. 16 and cases 1 to 8 shown in FIG. 11, the code block IDs corresponding to the 40 cases are different.
[0164] It should be noted that for various cases included in Case A1 to Case A8, the code block IDs corresponding to these cases are different, and the values of the code block IDs corresponding to various cases are not limited in this embodiment of the present application.
[0165] For example, for the case where the type of data blocks in three of the four groups of code stream blocks in Case A1 to Case A8 is MAC frame data block, the code block ID includes, but is not limited to, the following two cases: Case 1: If the type of data blocks in the first group of code stream blocks is start block, and the type of data blocks in the remaining three groups of code stream blocks are all MAC frame data block, the code block ID is 0x5E, specifically, bits 1 to 8 of the target code block are 01111010. Case 2: If the type of data blocks in the first three groups of code stream blocks is all MAC frame data block, and the type of data blocks in the fourth group of code stream blocks is end block, corresponding to Cases 1 to 8 in FIG. 11, the code block ID is 0x07, 0x17, 0x27, 0x37, 0x47, 0x57, 0x67, and 0x77, respectively. In either Case 1 or Case 2, the LSB is the first transmitted bit.
[0166] For example, for cases A1 to A8 other than case 1 and case 2, the code block ID is 12 bits, and the first 8 bits of the code block ID are different from those of the code block ID in case 1 and case 2.
[0167] In a possible implementation, the first encoding is performed on two of the code stream blocks. n Based on the sequence determined based on the control blocks and data blocks in the group, two of the code stream blocks are nThe code block contents are obtained by performing the following on the data blocks in the group: n The data blocks in this group are 2 of the code stream blocks. n The control blocks and data blocks in the group are compressed based on the determined sequence to obtain the code block content. For example, n The data blocks in this group are compressed: 2 of the code stream blocks n Each bit in the data block in this group that has a value of 0 is compressed. For example, each bit in an idle block is 0. n If the type of the data block in this group is an idle block, each bit of the idle block is compressed.
[0168] In conclusion, the target code block can be obtained based on the type, code block ID, and code block content in various cases.
[0169] In a possible implementation, the target code block is an error code block that includes error indication data. For example, n Not all of the groups are data code stream blocks, and not all of the groups are data code stream blocks. n If none of these groups belong to any one of the above cases A1-A8, then the target code block is determined to be an errored code block, and the code block ID and code block content of the target code block are obtained, where the type and code block ID are used as error indication data in the errored code block. For example, bit 0 of the target code block corresponds to type, and bits 4-1 correspond to code block ID, where bit 0 is set to 0 and bits 4-1 are all set to 1.
[0170] In a possible implementation, the data blocks in the four groups of code stream blocks are shown in FIG. 17, where 0, 1, 2, and 3 indicate the sequence of the four groups of code stream blocks, C indicates that the type of the data block of the code stream block is control data block, and D indicates that the type of the data block of the code stream block is MAC frame data block. For example, for combination 0, the types of the data blocks in the four groups of code stream blocks are all control data blocks. For example, for each combination in FIG. 17, if all of the types of the data blocks in the four groups of code stream blocks are not MAC frame data code stream blocks and do not belong to any one of the above cases A1-A8, the target code block is determined to be an error code block. For example, for two groups of code stream blocks whose data block types are both MAC frame data blocks, if the type of the data block in one of the two groups of code stream blocks is any one of start block, ordered set block, idle block, or low power idle block, the target code block is an error code block.
[0171] In a possible implementation, when the target code block is an error code block, the structure of the target code block is shown in Figure 18. Bit 0 of the target code block corresponds to the type, where bit 0 is 0. Bits 4 to 1 correspond to the code block ID, where bits 4 to 1 are all 1's. Bits 256 to 5 correspond to the code block content. For example, the first 4 bits of the code block content are 0xE, and every 8 bits thereafter are 0x1E. As another example, every bit of the code block content is 0.
[0172] In another possible implementation, when the target code block is an error code block, the length of the code block ID of the target code block is not limited to the 4 bits shown in FIG. 18. For example, the length of the code block ID is 8 bits. Bit 0 of the target code block corresponds to the type, where bit 0 is 0. Bits 8 to 1 correspond to the code block ID, where bits 8 to 1 are all 1's. Bits 256 to 9 correspond to the code block content. For example, every 8th bit of the code block content is 0x1E. As another example, each bit of the code block content is 0.
[0173] According to the encoding method provided in this embodiment of the present application, the first encoding can be performed on different types of code stream blocks to obtain a target code block, so the method has wide application.
[0174] A possible implementation is to use 2 of the code stream blocks. n Performing the first encoding on the group to obtain the target code block is: n obtaining an error detection result based on the control blocks and the data blocks in the group; and detecting two of the code stream blocks based on the error detection result. n The processing of the groups of 1 and 2 of the processed code stream blocks n and performing a first encoding on the group to obtain a target code block. In other words, the target code block is obtained by selecting one of the two code stream blocks based on the error detection result. n The error detection result is obtained by processing groups of 2 n The control block and the data block in this group are obtained.
[0175] For example, 2 of the code stream blocks nObtaining an error detection result based on the control blocks and data blocks in this group is: n Based on the control blocks and data blocks in the groups, n obtaining the content and content sequence of the group of two code stream blocks; n The method includes obtaining an error detection result based on the content of the group and the content sequence. For example, n If the content sequence of the group is at least one case in the first error case set, the second error of the code stream block is n An error occurs in the content sequence of this group; or n If the content sequence of this group is not one of the cases in the first error case set, n The content sequence of this group is correct. n If the content of the group is at least one case in the second error case set, the second error case of the code stream block is n An error occurs in the content of this group; or n If the content of this group is not one of the cases in the second error case set, then the second error case of the code stream block is n The content of this group is correct.
[0176] In a possible implementation, two adjacent groups of code stream blocks are used as an example for illustration, and the first set of error cases includes, but is not limited to, the following four cases:
[0177] (1) If the type of the data block in the former group of code stream blocks is a start block, then the type of the data block in the latter group of code stream blocks is a type other than MAC frame data.
[0178] (2) if the type of the data block in the former group of code stream blocks is MAC frame data, then the type of the data block in the latter group of code stream blocks is a type other than MAC frame data or termination block.
[0179] (3) If the type of a data block in the former group of code stream blocks is a termination block, then the type of a data block in the latter group of code stream blocks is a type other than an idle block or an ordered set block.
[0180] (4) If the type of the data block in the first group of code stream blocks is an idle block or an ordered set block, the type of the data block in the second group of code stream blocks is a MAC frame data or an termination block.
[0181] In a possible implementation, one group of code stream blocks is used as an example for illustration, and the second set of error cases includes, but is not limited to, the following four cases:
[0182] (1) For codestream blocks in which a data block contains a start control character, the start control character is followed by other content that is not a data character.
[0183] (2) For codestream blocks in which the data block contains a data character, the data character is followed by other content that is not a data character or a terminating control character.
[0184] (3) For code-stream blocks whose data blocks contain an end control character, the end control character is followed by other content that is not an idle control character or an ordered-set control character.
[0185] (4) For code stream blocks in which a data block contains an idle control character or an ordered set control character, the idle control character or ordered set control character is followed by a data character or a termination control character.
[0186] For example, an error detection result is n The error block includes a group of content sequence errors or content errors, and the error block is two or more of the code stream blocks. n The first encoding is obtained based on the code stream blocks having a content sequence error or a content error in the group, and the second encoding is obtained based on the code stream blocks having a correct content sequence and a correct content, and the second encoding is obtained based on the code stream blocks having a correct content sequence and a correct content. n In other words, the error detection result is applied to the error blocks in the group to obtain the target code block. n If the group contains a content sequence error or a content error, the target code block is a code stream block having a correct content sequence and a correct content, and two of the code stream blocks are n The error blocks are obtained by performing a first encoding based on the error blocks in the groups, where the error blocks are n The error block is obtained based on the code stream block having the content sequence error or the content error in the group. For example, the error block includes an error control character. For example, for a code stream block having the content sequence error or the content error, the content of the code stream block is converted into the error control character to obtain the error block.
[0187] For example, if the first encoding produces a code stream block with the correct content sequence and the correct content, and nThe code block ID is determined to be a code stream block having a correct content sequence and a correct content, and the code block ID is determined to be a code stream block having a correct content sequence and a correct content, and the code block ID is determined to be a code stream block having a correct content sequence and a correct content, and the code stream ... n and the first encoding is obtained based on the error blocks in the group of two of the code stream blocks. n Based on the sequence determined based on the control blocks and data blocks in the group, the error blocks and the two code stream blocks are n It includes performing a correct content sequence in this group and a data block in the code stream block having a correct content to obtain the code block content. In a possible implementation, the error block is the error block in the above case A1, and the manner of obtaining the code block ID and the code block content is the same as the principle of the related content in the above case A1. The details will not be described again in this specification.
[0188] For example, 2 of the code stream blocks n If each of the groups is a code stream block having a content sequence error or a content error, then n The error blocks are located in the code stream block 2 n The first encoding is obtained based on the group of 2 n is performed on the error block to obtain a target code block, where the target code block is the error code block.
[0189] The erroneous code stream blocks are processed to distinguish the erroneous data from correct data in subsequent data transmissions to ensure data reliability.
[0190] For example, after the target code block is obtained, the method further includes: performing second encoding on the target code block based on the FEC code type to obtain first data; and transmitting the first data. The manner of performing second encoding on the target code block based on the FEC code type is not limited in this embodiment of the present application. The second encoding is performed on the target code block based on the FEC code type to obtain first data, so that the receiving end can perform error correction on the received first data to ensure data transmission accuracy.
[0191] According to the encoding method provided in this embodiment of the present application, the target code block is n 64B / 66B encoding is performed on each of the groups to obtain 2 n 2 66-bit code blocks are obtained, and n 2 of the code stream blocks including the control block and the data block can be encoded without the need to transcode the 66-bit code blocks. n The first encoding is performed on the group to obtain the first set of the first and second encodings. Thus, the encoding efficiency is improved, and the delay, power consumption, and chip area occupation caused by the encoding process are reduced.
[0192] The above description describes an encoding method provided in an embodiment of the present application. The following description describes a decoding method provided in an embodiment of the present application. With reference to the implementation scenario shown in Fig. 1, a decoding method provided in an embodiment of the present application is shown in Fig. 19. For example, the decoding method provided in this embodiment of the present application is performed by the chip 104 in Fig. 1, and the method includes but is not limited to step 1901 and step 1902.
[0193] Step 1901: Obtain a target code block, where the target code block includes a type and a data unit.
[0194] For example, referring to the implementation scenario in FIG. 1, chip 102 sends first data, which is encoded by using FEC code type, to chip 104 through channel 105. In the data transmission process, error bits may occur in the first data. The data in which error bits occur is referred to as second data, and chip 104 receives the second data through channel 105.
[0195] In a possible implementation, obtaining the target code block includes, but is not limited to, the following scheme A and scheme B.
[0196] Scheme A: Second data is received, where the second data is obtained based on the first data encoded by using an FEC code type; a second decoding is performed on the second data to obtain a target code block, where the second decoding is an error correction process.
[0197] For example, the target code block is an error code block obtained when error correction is performed on the second data but the error correction fails. For example, performing a second decoding on the second data to obtain the target code block includes: processing the second data based on an FEC code type to obtain a first codeword, performing an error correction process on the first codeword, and obtaining the target code block based on a result of the error correction process.
[0198] For example, the chip 104 has a function of an FEC decoder. If the FEC decoder determines that the number of error bits exceeds the error correction capability of the FEC decoder, in other words, that error correction cannot be performed on the first codeword, the FEC decoder identifies all code blocks in the first codeword as error code blocks. Therefore, if the result of the error correction process is that all code blocks in the first codeword are identified as error code blocks, the obtained target code block is an error code block.
[0199] For example, if the result of the error correction process is that the error correction for the first code word is successful, the code block obtained based on the corrected first code word is used as the obtained target code block, and the code block obtained based on the corrected first code word is the successfully corrected code block.
[0200] Scheme B: Second data is received, where the second data is obtained based on the first data encoded by using an FEC code type; a second decoding is performed on the second data to obtain a target code block, where the second decoding is an error detection process in which error correction is avoided.
[0201] For example, the target code block is an error code block obtained through an error detection process on the second data in which error correction is bypassed. For example, performing a second decoding on the second data to obtain the target code block includes: processing the second data based on an FEC code type to obtain a first codeword, performing an error detection and bypass correction process on the first codeword; and obtaining the target code block based on a result of the error detection process in which error correction is bypassed.
[0202] For example, the chip 104 has a function of an FEC decoder. When detecting that an error exists in the first codeword, the FEC decoder identifies all code blocks in the first codeword as erroneous code blocks. Therefore, if the result of the error detection process in which error correction is avoided is that all code blocks in the first codeword are identified as erroneous code blocks, the obtained target code block is the erroneous code block.
[0203] For example, if the result of the error detection process in which error correction is avoided is that the first code word is error-free, then the code block obtained based on the first code word is used as the obtained target code block, and the code block obtained based on the first code word is an error-free code block.
[0204] For example, a frame check sequence (FCS) frame check performed based on the target code block fails, for example, the target code block is 257 bits, the first 5 bits are 01111, and the remaining 252 bits are 01111, including but not limited to the following four cases:
[0205] (1) Each bit remains unchanged.
[0206] (2) The first 4 bits are 0x1 or 0xE, and every 8th bit in the remaining bits is 0x1E.
[0207] (3) In the first 248 bits, every 8 bits is 0x1E, and the last 4 bits are either 0x1 or 0xE.
[0208] (4) Each bit is 0.
[0209] For example, a target code block is shown in FIG. 20, where b represents a bit.
[0210] Step 1902: Perform a first decoding on the target code block based on the type and data unit of the target code block to obtain two pieces of the code stream block. n where any group of code stream blocks includes a data block and a control block obtained based on a type and a data unit, the data block is obtained by performing a first decoding on the data unit in a decoding scheme determined based on the type and the data unit, and n is an integer greater than 1.
[0211] For example, the target code block is 257 bits, and in each group of code stream blocks, the control block is 8 bits and the data block is 64 bits. An example in which the first decoding is performed on one target code block to obtain four groups (n=2) of code stream blocks is used for illustration. If multiple target code blocks are obtained, the first decoding is performed on each target code block to obtain two groups of code stream blocks. n For example, if two target code blocks are obtained, a first decoding may be performed on each of the two code blocks to obtain four groups of code stream blocks, in other words, a first decoding is performed on the two target code blocks to obtain eight groups of code stream blocks.
[0212] In a possible implementation, a first decoding is performed on the target code block based on the type of the target code block and the data unit to obtain two code stream blocks. n The method of obtaining this group includes, but is not limited to, the following decoding method 1 to decoding method 3.
[0213] In the decoding method 1, the type of the target code block is determined as a data code block based on the type of the target code block, where the data units of the target code block are 2 data units each having a length of 8t. n t is a positive integer; n The control blocks in this group are obtained based on the type of the target code block, and the first decoding is performed on two control blocks each having a length of 8t contained in the data unit. n The code stream block is divided into two parts. n The data blocks in this group are obtained.
[0214] For example, if the type indicates that the target code block is a data code block, a first decoding is performed on the target code block in decoding scheme 1 to obtain two pieces of the code stream block. n Groups of 2 are obtained. n A data block included in group i of the code stream blocks in the group is obtained by performing a first decoding on a content in the data unit that corresponds to group i of the code stream blocks and has a length of 8t, where i is greater than or equal to 1 and 2t. n or i is an integer less than or equal to 0 and 2 n An integer less than or equal to -1.
[0215] In a possible implementation, the type of the target code block is 1, which indicates that the target code block is a data code block, the data unit of the target code block includes four contents each having a length of 8t, and one content having a length of 8t corresponds to one group of code stream blocks. For example, the length of 8t is 64 bits. The control blocks in the four groups of code stream blocks are all set to 0x00, and the four 64-bit contents are used as the contents of the data blocks in the four groups of code stream blocks, respectively.
[0216] For example, j may represent the sequence number of one of four groups of codestream blocks, where j=0, 1, 2, or 3. RXC_j<7:0> denotes a control block in group j of the code stream block, RXD_j<63:0> denotes a data block in group j of the code stream block, rx_coded<256:0> denotes a target code block, and rx_coded <0> represents the type of the target code block, rx_coded<(64j+64):(64j+1)> represents bits (64j+64) to (64j+1) of the target code block, and the contents of RXC_j<7:0> and RXD_j<63:0> are shown in Equation 3 and Equation 4 below: RXC_j<7:0>=0x00, where j=0, 1, 2, or 3 (Equation 3) RXD_j<63:0>=rx_coded<(64j+64):(64j+1)>, where j=0, 1, 2, or 3 (Equation 4)
[0217] In Equation 3, RXC_j<7:0>=0x00 indicates that the control block in each group of code stream blocks is 0x00. In Equation 4, RXD_j<63:0>=rx_coded<(64j+64):(64j+1)> indicates that every 64 bits of a data unit is used as 64 bits of a data block in one group of code stream blocks.
[0218] For example, if j=0, then RXD_0<63:0>=rx_coded<64:1> indicates that bits 64 through 1 of the target code block are used as bits 63 through 0, respectively, of the data block in group 0 of the code stream block. If j=1, then RXD_1<63:0>=rx_coded<128:65> indicates that bits 128 through 65 of the target code block are used as bits 63 through 0, respectively, of the data block in group 1 of the code stream block. If j=2, then RXD_2<63:0>=rx_coded<192:129> indicates that bits 192 through 129 of the target code block are used as bits 63 through 0, respectively, of the data block in group 2 of the code stream block. For j=3, RXD_3<63:0>=rx_coded<256:193> indicates that bits 256 to 193 of the target code block are used as bits 63 to 0 of the data block in group 3 of the code stream block, respectively.
[0219] In the decoding method 2, the type of the target code block is determined as the control code block based on the type of the target code block, where the data unit of the target code block includes a code block ID and a code block content, the code block ID indicates the type of the data block in each group of the code stream block, and the code block content indicates the location of the first encoded content of each group of the code stream block; n The control blocks in the group are obtained based on the type and the code block ID, and a first decode is performed on the code block contents in a decoding scheme determined based on the type and the code block ID to obtain two of the code stream blocks. n The data blocks in this group are obtained.
[0220] For example, if the type indicates that the target code block is a control code block, a first decoding is performed on the target code block in decoding scheme 2 to obtain a second code stream block. n Groups of 2 are obtained. n A control block included in group i of the code stream block in the group is obtained based on the type and the code block ID, and n A data block included in a group i of the code stream blocks in the group is obtained by performing a first decoding on the code block content in a decoding manner determined based on the type and the code block ID, where i is greater than or equal to 1 and is equal to or greater than 2. n or i is an integer less than or equal to 0 and 2 n An integer less than or equal to -1.
[0221] In a possible implementation, the code block ID includes a first ID and a second ID, where the first ID indicates a type of data block in each group of code stream blocks, and the second ID indicates a location of the first encoded content of each group of code stream blocks in the code block content. n The control blocks in the group are obtained based on the type and the code block ID, and a first decoding is performed on the code block content in a decoding manner determined based on the type and the code block ID to obtain two of the code stream blocks. n The data blocks in this group are obtained by: n The control blocks contained in this group are of type, first ID, and are 2 of the code stream block. n the bits corresponding to the groups in the second ID and the bits corresponding to the second group in the code stream block nThe first decoding is based on bits corresponding to the groups, and the first decoding is of type, first ID, and is obtained based on bits corresponding to the groups, and the first decoding is based on bits corresponding to the groups, n the bits corresponding to the groups in the second ID and the bits corresponding to the second group in the code stream block n A decoding scheme determined based on the bits corresponding to the groups is performed on the code block contents to obtain two of the code stream blocks. n The data blocks in the group are obtained.
[0222] In other words, the control blocks included in the group i of code stream blocks are obtained based on the type, the bits in the first ID and corresponding to the group i of code stream blocks, and the bits in the second ID and corresponding to the group i of code stream blocks; and the data blocks included in the group i of code stream blocks are obtained by performing a first decoding on the code block contents in a decoding scheme determined based on the type, the bits in the first ID and corresponding to the group i of code stream blocks, and the bits in the second ID and corresponding to the group i of code stream blocks.
[0223] For example, the type of data blocks contained within group i of code stream blocks is determined based on the content of the control blocks contained within group i of code stream blocks and the content of the data blocks contained within group i of code stream blocks.
[0224] Multiple cases of the type of data block in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content are indicated by using unique code block IDs, and the type of data block in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content can be obtained based on the code block ID of the target code block, so that the decoding manner of the target code block can be determined based on the type and the code block ID. Thus, the two code stream blocks n The control blocks in this group can be obtained based on the type and the code block ID, and a first decoding is performed on the code blocks in a decoding scheme determined based on the type and the code block ID to obtain the code block contents.
[0225] In the decoding method 3, based on the type of the target code block and the data unit, the type of the target code block is determined as an error code block; n A control block included in each of the groups is set to a first value, and two of the code stream blocks are n A data block contained within each of the groups is set to a second value, with the first value and the second value indicating that the code stream block is an error code stream block.
[0226] For example, the data unit includes a code block ID, and the type and code block ID indicate that the target code block is an error code block; n The control block contained within each of the groups is a first value and is a second value of the code stream block. nThe data block included in each of the groups is a second value, and the first value and the second value indicate that the code stream block is an error code stream block. For example, the type of the target code block is 0, the code block ID is 1111, the target code block is an error code block, and the second code stream block obtained through the first decoding is n The control block contained within each of these groups is 0xFF, and two of the code stream blocks n The data block contained within each of these groups is 0xFEFEFEFE.
[0227] According to the decoding method provided in this embodiment of the present application, a first decoding is performed on different types of target code blocks to obtain two code stream blocks. n It is possible to obtain a group of individuals. Therefore, this method has wide application.
[0228] In a possible implementation, a first decoding is performed on the target code block based on the type of the target code block and the data unit to obtain two code stream blocks. n Obtaining the group includes: obtaining an error detection result based on a type and a data unit of the target code block; and performing a first decoding on the target code block based on the error detection result and the type and the data unit of the target code block to obtain two groups of the code stream block. n In other words, it involves obtaining two groups of code stream blocks. n The group is obtained by performing a first decoding on the target code block based on an error detection result and a type and data unit of the target code block, and the error detection result is obtained based on the type and data unit of the target code block.
[0229] For example, obtaining an error detection result based on the type and data unit of the target code block includes: obtaining a content and a content sequence of the target code block based on the type and data unit of the target code block, and obtaining an error detection result based on the content and the content sequence of the target code block. For example, an error occurs in the content sequence of the target code block if the content sequence of the target code block is at least one case in a third error case set; or the content sequence of the target code block is correct if the content sequence of the target code block is not any case in the third error case set. As another example, an error occurs in the content of the target code block if the content of the target code block is at least one case in a fourth error case set; or the content of the target code block is correct if the content of the target code block is not any case in the fourth error case set.
[0230] In a possible implementation, an example is used for explanation in which the target code block is a control code block and the target code block includes four bit groups. One bit group corresponds to one group of the code stream block obtained through the first decoding. For two adjacent bit groups, the third error case set includes, but is not limited to, the following four cases:
[0231] (1) If the former bit group contains a start control character ( / S / ), the latter bit group contains some other content that is not a data character ( / D / ).
[0232] (2) If the former bit group contains only data characters, the latter bit group contains other content that is not a data character or a terminating control character ( / T / ).
[0233] (3) If the former bit group contains a terminal control character, the latter bit group contains other content that is not an idle control character ( / I / ) or a sequence ordered set control character ( / O / ).
[0234] (4) If the former bit group contains an idle control character or a sequence ordered set control character, the latter bit group contains a data character or a termination control character.
[0235] In a possible implementation, one bit group is used as an example for explanation, and the fourth error case set includes, but is not limited to, the following four cases:
[0236] (1) For bit groups that contain a start control character, the start control character is followed by other content that is not a data character.
[0237] (2) For a bit group that contains a data character, the data character is followed by other content that is not a data character or a terminating control character.
[0238] (3) For a bit group that contains a terminating control character, the terminating control character is followed by other content that is not an idle control character or a sequence ordered set control character.
[0239] (4) For a bit group that contains an idle control character or a sequence ordered set control character, the idle control character or the sequence ordered set control character is followed by a data character or a terminating control character.
[0240] In a possible implementation, the error detection result includes a content sequence error or a content error of the target code block, and a first decoding is performed on the target code block based on the error detection result and the type and data unit of the target code block to decode the second code stream block. nObtaining the group includes: transforming the target code block to obtain a second code block; and performing a first decoding on the second code block based on a type and a data unit of the second code block to obtain two groups of the code stream block. n obtaining a group of the second code block, where the second code block is obtained by transforming the target code block and has the same number of bits as the target code block. n The group is obtained by performing a first decoding on the second code block based on the type and data unit of the second code block, the second code block being a code block obtained by transforming the target code block and having the same number of bits as the target code block.
[0241] For example, transforming the target code block to obtain the second code block includes: for a bit group in the target code block and having a content sequence error or content error, transforming the bit group having the content sequence error or content error into an error control character; and obtaining the second code block based on the error control character and the bit group in the target code block and having a correct content sequence and correct content. In a possible implementation, the second code block obtained through the transformation is a control code block, and the first decoding may be performed on the second code block in a decoding scheme 2.
[0242] In another possible implementation, the error detection result includes a content sequence error or a content error of the target code block, and a first decoding is performed on the target code block based on the error detection result and the type and data unit of the target code block to decode two of the code stream blocks. nObtaining the group includes: performing a first decoding on the target code block based on a type of the target code block and a data unit to obtain two of the first code stream blocks; n obtaining a group of the first code stream block; n Transform groups of 2 to create 2 groups of code stream blocks. n In other words, it involves obtaining two groups of code stream blocks. n These groups are the 2 n The first code stream block is obtained by transforming the first group of n The group is obtained by performing a first decoding on the target code block based on the type of the target code block and the data unit.
[0243] For example, the first code stream block 2 n Transform groups of 2 to create 2 groups of code stream blocks. n Obtaining the groups includes: converting a code stream block into an error code stream block, where the code stream block is a second code stream block of the first code stream block. n The target code block in error is obtained based on the bit group that is in this group and has a content sequence error or a content error. For example, in an error code stream block, the control block is 0xFF and the data block is 0xFEFEFEFE. The target code block in error is processed so that the receiving end can distinguish between the error data and the correct data to ensure the reliability of the data.
[0244] According to the decoding method provided in this embodiment of the present application, two code stream blocks including a control block and a data block are decoded. n This group transcodes the target code block to obtain n 2 66-bit code blocks are obtained, and nThe target code block is obtained by performing a first decoding on the target code block without needing to decode 66-bit code blocks, thereby improving the decoding efficiency and reducing the delay, power consumption, and chip area occupation caused by the decoding process.
[0245] The above description describes an encoding method provided in an embodiment of the present application. Corresponding to the above method, an embodiment of the present application further provides an encoding device. Figure 21 is a schematic diagram of the structure of an encoding device according to an embodiment of the present application. The device is used in a first network device, which is the first network device in the embodiment shown in Figure 1. Based on the following modules shown in Figure 21, the encoding device shown in Figure 21 can perform all or some of the operations performed by the first network device. It should be understood that the device may include further additional modules that are not the modules shown, or some of the modules shown are omitted. This is not limited in this embodiment of the present application. As shown in Figure 21, the device includes: Code stream block 2 n an acquisition module 2201 configured to acquire groups of code stream blocks, where any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; and Code stream block 2 n a first encoding module 2202 configured to perform a first encoding on the group to obtain a target code block, where the target code block is a data unit and a code stream block; n the data unit includes a type determined based on the control blocks in the group, the data unit being one of two of the code stream blocks. n In the coding scheme determined based on the control blocks and data blocks in the groups, nobtained by performing a first encoding on the data blocks in the group Equipped with.
[0246] In a possible implementation, the type indicates that the target code block is a data code block; the data unit is two of the code stream blocks. n 2 of the code stream block based on the sequence of groups n The first encoding is performed on the data blocks in this group.
[0247] In a possible implementation, the type indicates that the target code block is a control code block; the data unit includes a code block identifier ID and a code block content, where the code block content is a 2-byte code block of a code stream block. n Based on the sequence determined based on the control blocks and data blocks in the group, two of the code stream blocks are n The code block ID is obtained by performing a first encoding on the data blocks in the group, and the code block ID is obtained by performing a second encoding on the data blocks in the group. n The code block ID is obtained based on the control blocks and data blocks in each group of code stream blocks, and indicates the type of data block in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content.
[0248] In a possible implementation, the code block ID includes a first ID and a second ID, where the first ID indicates the type of data block in each group of code stream blocks and the second ID indicates the location of the first encoded content of each group of code stream blocks in the code block content.
[0249] In a possible implementation, the codeblock ID includes m bits, where m is an integer greater than or equal to four.
[0250] In a possible implementation, the code block ID has Hamming distance protection.
[0251] In a possible implementation, the target code block is an error code block, and the error code block includes error indication data.
[0252] In a possible implementation, the target code block is determined by dividing the two code stream blocks based on the error detection result. n The error detection result is obtained by processing groups of 2 n The control block and the data block in this group are obtained.
[0253] In a possible implementation, the error detection result is n The target code block includes a code stream block having a correct content sequence and a correct content, and two of the code stream blocks having a correct content sequence and a correct content. n The error block is obtained by performing a first encoding based on the error block in the group, and the error block is obtained by performing a second encoding based on the error block in the group. n The content sequence error or content error is obtained based on the code stream blocks having the content sequence error or content error in this group.
[0254] In a possible implementation, the control block contains t bits and the data block contains 8t bits, where t is a positive integer.
[0255] In a possible implementation, the value of n is 2, the value of t is 8, and the target code block is 257 bits.
[0256] A possible implementation is to use 2 of the code stream blocks. n All of this group is from the Media Independent Interface MII.
[0257] In a possible implementation, the apparatus further includes: a second encoding module 2203 configured to perform second encoding on the target code block based on a forward error correction FEC code type to obtain first data; and a transmitting module 2204 configured to transmit the first data.
[0258] According to the encoding device provided in this embodiment of the present application, the target code block is n 64B / 66B encoding is performed on each of the groups to obtain 2 n 2 66-bit code blocks are obtained, and n 2 of the code stream blocks including the control block and the data block can be encoded without the need to transcode the 66-bit code blocks. n The first encoding is performed on the group to obtain the first set of the first and second encodings. Thus, the encoding efficiency is improved, and the delay, power consumption, and chip area occupation caused by the encoding process are reduced.
[0259] The above description describes a decoding method provided in an embodiment of the present application. Corresponding to the above method, an embodiment of the present application further provides a decoding device. Figure 22 is a schematic diagram of the structure of a decoding device according to an embodiment of the present application. The device is used in a second network device, which is the second network device in the embodiment shown in Figure 1. Based on the following modules shown in Figure 22, the decoding device shown in Figure 22 can perform all or some of the operations performed by the second network device. It should be understood that the device may include further additional modules that are not the modules shown, or some of the modules shown are omitted. This is not limited in this embodiment of the present application. As shown in Figure 22, the device: an acquisition module 2301 configured to acquire a target code block, where the target code block includes a type and a data unit; and performing a first decoding on the target code block based on the type and data unit of the target code block to obtain two pieces of the code stream block; n a decoding module 2302 configured to obtain groups of n, where any group of code stream blocks includes a data block and a control block obtained based on a type and a data unit, the data block being obtained by performing a first decoding on the data unit in a decoding scheme determined based on the type and the data unit, and n being an integer greater than 1; Equipped with.
[0260] In a possible implementation, the type indicates that the target code block is a data code block; n A data block included in group i of the code stream blocks in the group is obtained by performing a first decoding on a content in the data unit corresponding to group i of the code stream blocks and having a length of 8t, where t is a positive integer, i is greater than or equal to 1, and 2. n or i is an integer less than or equal to 0 and 2 n An integer less than or equal to -1.
[0261] In a possible implementation, the type indicates that the target code block is a control code block, and the data unit includes a code block identifier ID and a code block content, where the code block ID indicates the type of data block in each group of code stream blocks and the location of the first encoded content of each group of code stream blocks in the code block content; n A control block included in group i of the code stream block in the group is obtained based on the type and the code block ID, and nA data block included in a group i of the code stream blocks in the group is obtained by performing a first decoding on the code block content in a decoding manner determined based on the type and the code block ID, where i is greater than or equal to 1 and is equal to or greater than 2. n or i is an integer less than or equal to 0 and 2 n An integer less than or equal to -1.
[0262] In a possible implementation, the code block ID includes a first ID and a second ID, where the first ID indicates a type of data blocks in each group of code stream blocks and the second ID indicates a location of the first encoded content of each group of code stream blocks in the code block content; the control blocks included in group i of code stream blocks are obtained based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks; and the data blocks included in group i of code stream blocks are obtained by performing a first decoding on the code block content in a decoding scheme determined based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks.
[0263] In a possible implementation, the type of data blocks contained in group i of code stream blocks is determined based on the content of the control blocks contained in group i of code stream blocks and the content of the data blocks contained in group i of code stream blocks.
[0264] In a possible implementation, the codeblock ID includes m bits, where m is an integer greater than or equal to four.
[0265] In a possible implementation, the code block ID has Hamming distance protection.
[0266] In a possible implementation, the data unit includes a code block identifier ID, and the type and code block ID indicate that the target code block is an error code block; n The control block contained within each of the groups is a first value and is a second value of the code stream block. n A data block contained within each of the groups is a second value, and the first value and the second value indicate that the code stream block is an error code stream block.
[0267] In a possible implementation, the acquisition module 2301 is configured to: receive second data, where the second data is acquired based on the first data encoded by using a forward error correction FEC code type; and perform second decoding on the second data to acquire a target code block, where the second decoding is an error correction process.
[0268] In a possible implementation, the target code block is an errored code block obtained when error correction is performed on the second data but the error correction fails.
[0269] In a possible implementation, the acquisition module 2301 is configured to: receive second data, where the second data is acquired based on the first data encoded by using a forward error correction FEC code type; and perform second decoding on the second data to acquire a target code block, where the second decoding is an error detection process in which error correction is avoided.
[0270] In a possible implementation, the target code block is an error code block obtained when an error is detected from the second data but error correction is avoided.
[0271] A possible implementation is to use 2 of the code stream blocks. n The group is obtained by performing a first decoding on the target code block based on an error detection result and a type and data unit of the target code block, and the error detection result is obtained based on the type and data unit of the target code block.
[0272] In a possible implementation, the error detection result includes a content sequence error or a content error in the target code block, and n The group is obtained by performing a first decoding on the second code block based on the type and data unit of the second code block, the second code block being a code block obtained by transforming the target code block and having the same number of bits as the target code block.
[0273] In a possible implementation, the error detection result includes a content sequence error or a content error in the target code block, and n These groups are the 2 n The first code stream block is obtained by transforming the first group of n The group is obtained by performing a first decoding on the target code block based on the type of the target code block and the data unit.
[0274] In a possible implementation, the control block contains t bits and the data block contains 8t bits, where t is a positive integer.
[0275] In a possible implementation, the value of n is 2, the value of t is 8, and the target code block is 257 bits.
[0276] A possible implementation is to use 2 of the code stream blocks. n All of this group is in the Media Independent Interface (MII) format.
[0277] According to the decoding device provided in this embodiment of the present application, two code stream blocks including a control block and a data block are decoded. n This group transcodes the target code block to obtain n 2 66-bit code blocks are obtained, and n The target code block is obtained by decoding the target code block without needing to decode 66-bit code blocks, thus improving the decoding efficiency and reducing the delay, power consumption, and chip area occupation caused by the decoding process.
[0278] It should be understood that when the device provided in FIG. 21 and FIG. 22 implements the functions of the device, the division into the above-mentioned functional modules is merely used as an example for explanation. In actual application, the above-mentioned functions may be assigned to different functional modules for implementation as necessary. In other words, the internal structure of the device is divided into different functional modules to implement all or some of the functions described above. In addition, the embodiments of the device and the method provided in the above-mentioned embodiments belong to the same concept. For the specific implementation process of the device, please refer to the embodiment of the method. The details will not be described again in this specification.
[0279] For the specific hardware structure of the device in the aforementioned embodiment, please refer to the network device 1500 shown in FIG. 23. The network device 1500 includes a transceiver 1501, a processor 1502, and a memory 1503. The transceiver 1501, the processor 1502, and the memory 1503 are connected to each other through a bus 1504. The transceiver 1501 is configured to receive packets and transmit packets. The memory 1503 is configured to store instructions or program codes. The processor 1502 is configured to call instructions or program codes in the memory 1503 to enable the device to execute the relevant processing steps of the first network device or the second network device in the aforementioned method embodiments. In a specific embodiment, the network device 1500 in this embodiment of the present application may correspond to the first network device or the second network device in each of the aforementioned method embodiments. The processor 1502 in the network device 1500 reads instructions or program code in the memory 1503 to enable the network device 1500 shown in FIG. 23 to perform all or some of the operations performed by the first network device or the second network device.
[0280] The network device 1500 may further correspond to the apparatus shown in Figures 21 and 22. For example, the acquisition module 2201 and the acquisition module 2301 in Figures 21 and 22 are equivalent to the transceiver 1501, and the first encoding module 2202 and the decoding module 2302 are equivalent to the processor 1502.
[0281] Figure 24 is a schematic diagram of the structure of a network device 2000 provided in an exemplary embodiment of the present application. The network device 2000 shown in Figure 24 is configured to perform operations related to the encoding method shown in Figure 2 and the decoding method shown in Figure 19. The network device 2000 is, for example, a switch or a router.
[0282] As shown in FIG. 24, the network device 2000 comprises at least one processor 2001, a memory 2003, and at least one communication interface 2004.
[0283] The processor 2001 may be, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits configured to implement the solutions of the present application. For example, the processor 2001 may include an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or another programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The PLD may be, for example, a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor may implement or execute various logical blocks, modules, and circuits described with reference to the contents disclosed in the embodiments of the present invention. The processor may alternatively be a combination of processors that implement computing functions, such as a combination of one or more microprocessors, or a combination of a DSP and a microprocessor.
[0284] Optionally, the network device 2000 further comprises a bus. The bus is configured to transmit information between the components of the network device 2000. The bus may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to represent a bus in FIG. 24, but this does not mean that there is only one bus or only one type of bus. In addition to being connected through a bus, the components of the network device 2000 in FIG. 24 may be connected in another manner. The manner in which the components are connected is not limited in this embodiment of the present invention.
[0285] The memory 2003 may be, for example, but not limited to, a read-only memory (ROM) or another type of static storage device capable of storing static information and instructions, or a random access memory (RAM) or another type of dynamic storage device capable of storing information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or another type of compact disc storage, an optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray® discs, and the like), a magnetic disc storage medium or another magnetic storage device, or any other medium that can be used to carry or store the expected program code in the form of instructions or data structures and that can be accessed by a computer. For example, the memory 2003 exists independently and is connected to the processor 2001 through a bus. Alternatively, the memory 2003 and the processor 2001 may be integrated together.
[0286] The communication interface 2004 is configured to communicate with another device or a communication network using any device, such as a transceiver. The communication network may be an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), or the like. The communication interface 2004 may include a wired communication interface and may further include a wireless communication interface. In particular, the communication interface 2004 may be an ethernet interface, a fast ethernet (FE) interface, a gigabit ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a wireless local area network (WLAN) interface, a cellular network communication interface, or a combination thereof. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. In this embodiment of the present application, the communication interface 2004 may be used by the network device 2000 to communicate with other devices.
[0287] During a particular implementation, in one embodiment, the processor 2001 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 24. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may be one or more devices, circuits, and / or processing cores configured to process data (e.g., computer program instructions).
[0288] Among other implementations, in one embodiment, the network device 2000 may include multiple processors, such as the processor 2001 and the processor 2005 in FIG. 24. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may be one or more devices, circuits, and / or processing cores configured to process data (e.g., computer program instructions).
[0289] During specific implementation, in one embodiment, the network device 2000 may further include an output device and an input device. The output device may communicate with the processor 2001 and display information in a number of ways. For example, the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device may communicate with the processor 2001 and receive input from a user in a number of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensing device.
[0290] In some embodiments, the memory 2003 may be configured to store a program code 2010 for executing the solution of the present application, and the processor 2001 may execute the program code 2010 stored in the memory 2003. In other words, the network device 2000 may implement the encoding method or the decoding method provided in the method embodiment by using the processor 2001 and the program code 2010 in the memory 2003. The program code 2010 may include one or more software modules. Optionally, the processor 2001 may alternatively store a program code or an instruction for executing the solution of the present application.
[0291] In a particular embodiment, the network device 2000 in this embodiment of the present application may correspond to the first network device or the second network device in each of the embodiments of the method described above. The processor 2001 in the network device 2000 reads the program code 2010 in the memory 2003 or the program code or instructions stored in the processor 2001 to enable the network device 2000 shown in FIG. 24 to perform all or some of the operations performed by the first network device or the second network device.
[0292] The network device 2000 may further correspond to the apparatus shown in Figures 21 and 22. Each functional module in the apparatus shown in Figures 21 and 22 is implemented by using the software of the network device 2000. In other words, the functional modules included in the apparatus shown in Figures 21 and 22 are generated after the processor 2001 in the network device 2000 reads the program code 2010 stored in the memory 2003. For example, the acquisition module 2201 and the acquisition module 2301 in Figures 21 and 22 are equivalent to the communication interface 2004, and the first encoding module 2202 and the decoding module 2302 are equivalent to the processor 2001 and / or the processor 2005.
[0293] The steps of the method shown in Fig. 2 and Fig. 19 are contemplated by using an instruction in the form of a hardware integrated logic circuit or software in the processor of the network device 2000. The steps of the method disclosed with reference to the embodiments of the present application may be directly executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor. The software modules may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory. The processor reads the information in the memory and contemplates the steps of the aforementioned method in combination with the hardware of the processor. To avoid repetition, the details will not be described again in this specification.
[0294] Figure 25 is a schematic diagram of a structure of a network device 2100 provided in another exemplary embodiment of the present application. The network device 2100 shown in Figure 25 is configured to perform all or some of the operations in the methods shown in Figures 2 and 19. The network device 2100 is, for example, a switch or a router. The network device 2100 may be implemented by a generic bus architecture.
[0295] As shown in FIG. 25, the network device 2100 includes a main control board 2110 and an interface board 2130 .
[0296] The main control board 2110 is also referred to as a main processing unit (MPU) or route processor card. The main control board 2110 is configured to control and manage components in the network device 2100, including route calculation, device management, device maintenance, and protocol processing functions. The main control board 2110 includes a central processing unit 2111 and a memory 2112.
[0297] The interface board 2130 is also referred to as a line interface unit (LPU), line card, or service board. The interface board 2130 is configured to provide various service interfaces and implement data packet forwarding. The service interfaces include, but are not limited to, an Ethernet interface, a packet over SONET / SDH (POS) interface, and the like. The Ethernet interface is, for example, a flexible Ethernet service interface (flexible ethernet clients, FlexE Clients). The interface board 2130 includes: a central processing unit 2131, a network processor 2132, a forwarding entry memory 2134, and a physical interface card (PIC) 2133.
[0298] The central processing unit 2131 on the interface board 2130 is configured to: control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110 .
[0299] The network processor 2132 is configured to implement packet transmission processing. One form of the network processor 2132 may be a forwarding chip. The forwarding chip may be a network processor (NP). In some embodiments, the forwarding chip may be implemented by using an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2132 is configured to forward the received packet based on a forwarding table stored in the forwarding entry memory 2134. If the destination address of the packet is the address of the network device 2100, the network processor 2132 sends the packet to a CPU (e.g., central processing unit 2131) for processing. If the destination address of the packet is not the address of the network device 2100, the network processor 2132 finds a next hop and an egress interface corresponding to the destination address from the forwarding table based on the destination address, and forwards the packet to the egress interface corresponding to the destination address. Processing an uplink packet may include: processing the inbound interface of the packet, and looking up a forwarding table. Processing a downlink packet may include: looking up a forwarding table, and the like. In some embodiments, the central processing unit may perform the functions of a forwarding chip, e.g., may implement software forwarding based on a general-purpose CPU, such that a forwarding chip is not needed on the interface board.
[0300] The physical interface card 2133 is configured to implement a physical layer interconnection function, such that original traffic enters the interface board 2130 and processed packets are sent out from the physical interface card 2133. The physical interface card 2133, also referred to as a sub card, may be mounted on the interface board 2130 and is responsible for converting optical / electrical signals into packets, performing validity checks on the packets, and forwarding the packets to the network processor 2132 for further processing. In some embodiments, the central processing unit 2131 may perform the functions of the network processor 2132, for example, implementing software forwarding based on a general-purpose CPU. Therefore, the network processor 2132 is not required in the physical interface card 2133.
[0301] Optionally, the network device 2100 includes multiple interface boards. For example, the network device 2100 further includes an interface board 2140. The interface board 2140 includes a central processing unit 2141, a network processor 2142, a forwarding entry memory 2144, and a physical interface card 2143. The functions and implementations of the components in the interface board 2140 are the same as or similar to those of the interface board 2130, and the details will not be described again in this specification.
[0302] Optionally, the network device 2100 further includes a switching board 2120. The switching board 2120 may also be referred to as a switch fabric unit (SFU). When the network device has multiple interface boards, the switching board 2120 is configured to perform data exchange between the interface boards. For example, the interface board 2130 and the interface board 2140 may communicate with each other by using the switching board 2120.
[0303] The main control board 2110 is coupled to the interface boards. For example, the main control board 2110, the interface boards 2130, the interface boards 2140, and the switching boards 2120 are connected to a system backplane by using a system bus for interaction. In a possible implementation, an inter-process communication (IPC) protocol channel is established between the main control board 2110, the interface boards 2130, and the interface boards 2140. The main control board 2110 communicates with the interface boards 2130 and the interface boards 2140 through the IPC channel.
[0304] Logically, the network device 2100 includes a control plane and a forwarding plane. The control plane includes a main control board 2110 and a central processing unit 2111. The forwarding plane includes components that perform forwarding, such as a forwarding entry memory 2134, a physical interface card 2133, and a network processor 2132. The control plane performs functions such as routers, generating forwarding tables, processing signaling and protocol packets, and configuring and maintaining the state of the network device. The control plane delivers the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 2132 looks up a table for forwarding packets received by the physical interface card 2133 based on the forwarding table delivered by the control plane. The forwarding table delivered by the control plane may be stored in the forwarding entry memory 2134. In some embodiments, the control plane and the forwarding plane may be completely separate and are not on the same network device.
[0305] It should be noted that there may be one or more main control boards, and when there are multiple main control boards, a primary main control board and a secondary main control board may be included. There may be one or more interface boards. A network device with a stronger data processing capability provides a larger number of interface boards. There may be one or more physical interface cards on the interface board. There may be no switching board, or there may be one or more switching boards. When there are multiple switching boards, both load balancing and redundancy backup may be implemented. In a centralized forwarding architecture, the network device may not require a switching board, and the interface board performs the function of processing the service data of the entire system. In a distributed forwarding architecture, the network device may have at least one switching board, and the switching board is used to implement data exchange between multiple interface boards to provide large-capacity data exchange and processing capability. Therefore, the data access and processing capability of the network device in the distributed architecture is higher than that of the network device in the centralized architecture. Optionally, the form of the network device may alternatively be a single board. That is, there is no switch fabric board, and the functions of the interface board and the main control board are integrated on the board. In this case, the central processing unit on the interface board and the central processing unit on the main control board may be combined into one central processing unit on the board. The one central processing unit on the board performs the functions of the two central processing units that exist after the two central processing units are combined. A network device in this form has low data exchange and processing capabilities (e.g., a network device such as a low-grade switch or router). The particular architecture used depends on the particular networking deployment scenario. This is not limited herein.
[0306] In a particular embodiment, the network device 2100 corresponds to the apparatus shown in Figures 21 and 22. In some embodiments, the acquisition module 2201 and the acquisition module 2301 in the apparatus shown in Figures 21 and 22 are equivalent to the physical interface card 2133 or the physical interface card 2143 in the network device 2100. The first encoding module 2202 and the decoding module 2302 in the apparatus shown in Figures 21 and 22 are equivalent to at least one of the central processing unit 2111, the network processor 2132, and the network processor 2142 in the network device 2100.
[0307] Based on the network devices shown in Figures 23, 24, and 25, an embodiment of the present application further provides a communication system. The system includes a first network device and a second network device. Optionally, the first network device is the network device 1500 shown in Figure 23, the network device 2000 shown in Figure 24, or the network device 2100 shown in Figure 25, and the second network device is the network device 1500 shown in Figure 23, the network device 2000 shown in Figure 24, or the network device 2100 shown in Figure 25.
[0308] For the methods performed by the first network device and the second network device, please refer to the relevant descriptions of the embodiments shown in Figures 1, 2, and 19. The details will not be described again in this specification.
[0309] It should be understood that the processor may be a central processing unit (CPU) or may be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. The general-purpose processor may be a microprocessor, any conventional processor, or the like. It is noted that the processor may be a processor supporting the advanced reduced instruction set computing machines (ARM) architecture.
[0310] Further, in an optional embodiment, the memory may include a read-only memory and a random access memory to provide instructions and data to the processor. The memory may further include a non-volatile random access memory. For example, the memory may further store device type information.
[0311] The memory may be volatile or nonvolatile memory, or may include both volatile and nonvolatile memory. Nonvolatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM) used as an external cache. By way of example and not limitation, many types of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchlink dynamic random access memory (synchlink DRAM, SLDRAM), and direct rambus random access memory (direct rambus RAM, DR RAM).
[0312] A computer-readable storage medium is further provided. The storage medium stores at least one program instruction or code. When the program instruction or code is loaded and executed by a processor, the computer is enabled to implement the encoding method in FIG. 2 or the decoding method in FIG. 19.
[0313] The present application provides a computer program product, which, when executed by a computer, enables the processor or computer to perform the corresponding steps and / or procedures in the aforementioned method embodiments.
[0314] A chip is provided, the chip comprising a processor, the chip being configured to retrieve from a memory and execute instructions stored in the memory to enable a communications device in which the chip is attached to perform a method in the aforementioned aspect.
[0315] Another chip is provided. The chip comprises an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is configured to execute code in the memory. When the code is executed, the processor is configured to execute the method in the above aspect.
[0316] There is further provided a device, comprising the above chip. Optionally, the device is a network device. For example, the device is a router, a switch, or a server.
[0317] All or some of the above-mentioned embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When software is used to implement the embodiments, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product comprises one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions according to the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or another programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired (e.g., coaxial cable, optical fiber, or digital subscriber line) or wireless (e.g., infrared, radio, or microwave) manner. The computer-readable storage medium may be any available medium accessible by a computer, or a data storage device such as a server or data center that integrates one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, hard disk, or magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), or the like.
[0318] In the above specific implementation, the objectives, technical solutions and beneficial effects of the present application are further described in detail. It should be understood that the above description is only a specific implementation of the present application, and is not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements or similar made based on the technical solutions of the present application shall fall within the protection scope of the present application.
[0319] Those skilled in the art may recognize that, with reference to the method steps and modules described in the embodiments disclosed herein, the method steps and modules can be implemented by using software, hardware, firmware, or any combination thereof. In order to clearly explain the interchangeability between hardware and software, the steps and configurations of the embodiments are generally described in terms of functions in the preceding description. Whether a function is performed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the functions described for each specific application, but the implementation should not be considered as going beyond the scope of the present application.
[0320] Those skilled in the art may understand that all or some of the steps of the embodiments may be implemented by hardware or a program that instructs related hardware. The program may be stored in a computer-readable storage medium. The storage medium may include a read-only memory, a magnetic disk, or an optical disk.
[0321] When software is used to implement the embodiments, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer program instructions. In one example, the method according to the embodiments of the present application may be described in the context of machine-executable instructions. For example, the machine-executable instructions are included in a program module that is a component for executing on a target real or virtual processor. Generally, a program module includes routines, programs, libraries, objects, classes, components, data structures, and the like, which perform particular tasks or implement particular abstract data structures. In various embodiments, the functionality of the program modules may be combined or divided among the described program modules. The machine-executable instructions for the program modules may be executed locally or in a distributed device. In a distributed device, the program modules may be located in both local and remote storage media.
[0322] Computer program code for implementing the methods in the embodiments of the present application may be written in one or more programming languages. The computer program code may be provided for a processor of a general purpose computer, a special purpose computer, or another programmable data processing apparatus, so that when the program code is executed by the computer or another programmable data processing apparatus, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on the computer, partially on the computer as a stand-alone software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.
[0323] In the context of the embodiments of the present application, computer program code or associated data may be carried in any suitable carrier wave that enables a device, apparatus, or processor to perform the various types of processes and operations described above. Examples of carrier waves include signals, computer readable media, and the like.
[0324] Examples of signals may include electrical, optical, radio, audio, or other types of propagated signals, such as carrier waves and infrared signals.
[0325] A machine-readable medium may be any tangible medium that contains or stores a program for or on an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of machine-readable storage media include an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0326] It can be clearly understood by those skilled in the art that for the purpose of simple and concise description, the detailed functional processes of the above-mentioned systems, devices and modules may be referred to corresponding processes in the above-mentioned method embodiments, and the details will not be described again in this specification.
[0327] In the embodiments provided in the present application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the embodiment of the device described is merely an example. For example, the division into multiple modules is merely a division into logical functions, and other division modes may exist in actual applications. For example, multiple modules or components may be combined or integrated into another system, or some characteristics may be ignored or not implemented. In addition, the shown or discussed mutual couplings or direct couplings or communication connections may be indirect couplings or communication connections implemented through some interfaces, devices, or modules, or may be electrical, mechanical, or other types of connections.
[0328] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, specifically located in one location or distributed over multiple network modules. Some or all of the modules may be selected based on actual requirements for implementing the objectives of the solutions of the embodiments of the present application.
[0329] In addition, the functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist physically alone, or two or more modules may be integrated into one module. The integrated module may be implemented in the form of hardware, or may be implemented in the form of a software functional module.
[0330] When the integrated module is implemented in the form of a software function module or sold or used as an independent product, the integrated module may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application in essence, or the part contributing to the prior art, or all or some of the technical solutions may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes some instructions for instructing a computer device (which may be a personal computer, a server, or a network device) to execute all or some of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0331] In this application, terms such as "first" and "second" are used to distinguish between the same or similar items having essentially the same functions. It should be understood that "first", "second", and "nth" have no logical or chronological sequential dependency and do not limit the number and execution sequence. It should be further understood that although the following description uses terms such as "first" and "second" to describe various elements, these elements should not be limited by these terms. These terms are merely used to distinguish one element from another. For example, a first network device may be referred to as a second network device, and similarly, a second network device may be referred to as a first network device, without departing from the scope of various examples. Both the first network device and the second network device may be any type of network device, and in some cases may be separate and distinct network devices.
[0332] It should be further understood that in the embodiment of the present application, the sequence numbers of the processes do not mean the execution sequence, and the execution sequence of the processes should be determined based on the functions and internal logic of the processes, and should not be construed as any restriction on the implementation process of the embodiment of the present application.
[0333] As used herein, the term "at least one" means one or more, and as used herein, the term "multiple" means two or more. For example, a plurality of second packets means two or more second packets. The terms "system" and "network" are often used interchangeably herein.
[0334] It should be understood that the terms used in the description of the various examples herein are intended to describe particular examples only and are not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a" or "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0335] It is to be further understood that the term "include" (also referred to as "includes", "including", "comprises" and / or "comprising") as used herein specifies the presence of stated features, integers, steps, operations, elements, and / or components and does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or components thereof.
[0336] It should be further understood that the term "if" may be interpreted as meaning "when" or "upon," "in response to determining," or "in response to detecting." Similarly, based on the context, the phrases "if it is determined that" or "if (a stated condition or event) is detected" may be interpreted as meaning "when it is determined that" or "in response to determining" or "when (a stated condition or event) is detected" or "in response to detecting (a stated condition or event)."
[0337] It should be understood that determining B based on A does not mean that B is determined based only on A, but that B may alternatively be determined based on A and / or other information.
[0338] It should be further understood that the terms "one embodiment," "one embodiment," and "possible implementations" referred to throughout this specification mean that the particular features, structures, or characteristics associated with an embodiment or implementation are included in at least one embodiment of the present application. Thus, the appearances of "in one embodiment" or "in one embodiment" or "possible implementations" throughout this specification do not necessarily refer to the same embodiment. In addition, the particular features, structures, or characteristics may be combined in one or more embodiments by using any suitable manner. (Other possible items) (Item 1) Code stream block 2 n obtaining n groups, where any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; and The first two code stream blocks n performing a first encoding on the group to obtain a target code block, where the target code block is a data unit and the two of the code stream blocks; n the data unit includes a type determined based on the control blocks in the two groups of code stream blocks; n In the coding scheme determined based on the control block and the data block in each group, n obtained by performing the first encoding on the data blocks in the group; An encoding method comprising: (Item 2) the type indicating that the target code block is a data code block; The data unit is a block of code stream data. n The two groups of code stream blocks are n 2. The method of claim 1, wherein the first encoding is performed on the data blocks in the group. (Item 3) the type indicating that the target code block is a control code block; The data unit includes a code block identifier ID and a code block content, where the code block content is the second part of a code stream block. n The two groups of the code stream block are selected based on a sequence determined based on the control block and the data block. n the code block ID is obtained by performing the first encoding on the data blocks in the group of two code stream blocks; n 2. The method of claim 1, wherein the code block ID is obtained based on the control block and the data block in each group of code stream blocks, and the code block ID indicates a type of data block in each group of code stream blocks and a location of a first encoded content of each group of code stream blocks in the code block content. (Item 4) Item 4. The method of item 3, wherein the code block IDs include a first ID and a second ID, the first ID indicating the type of the data block in each group of code stream blocks, and the second ID indicating the location of the first encoded content of each group of code stream blocks in the code block content. (Item 5) 5. The method according to claim 3 or 4, wherein the code block ID comprises m bits, where m is an integer greater than or equal to 4. (Item 6) 6. The method according to any one of items 3 to 5, wherein the code block ID has Hamming distance protection. (Item 7) 7. The method according to any one of items 3 to 6, wherein the target code block is an error code block, and the error code block includes error indication data. (Item 8) The target code block is selected based on the error detection result. n the error detection result is obtained by processing the two groups of the code stream block. n The method according to any one of items 1 to 7, wherein the control block and the data block in this group are obtained. (Item 9) The error detection result is n the target code block includes a code stream block having a correct content sequence and a correct content, and the two code stream blocks having the correct content sequence and the correct content. n the error blocks are obtained by performing the first encoding based on the error blocks in the groups, the error blocks being n 9. The method according to claim 8, wherein the content sequence error or content error is obtained based on the code stream blocks having the content sequence error or content error in the group. (Item 10) 10. The method according to any one of items 1 to 9, wherein the control block includes t bits and the data block includes 8t bits, where t is a positive integer. (Item 11) Item 11. The method according to item 10, wherein the value of n is 2, the value of t is 8, and the target code block is 257 bits. (Item 12) The first two code stream blocks n 12. The method according to any one of items 1 to 11, wherein all of the groups are from a media independent interface MII. (Item 13) After obtaining the target code block, the method: performing a second encoding on the target code block based on a forward error correction FEC code type to obtain first data; and Transmitting the first data 13. The method according to any one of items 1 to 12, further comprising: (Item 14) Here's how: obtaining a target code block, where the target code block includes a type and a data unit; and performing a first decoding on the target code block based on the type of the target code block and the data unit; n obtaining groups of n, where any group of code stream blocks includes a data block and a control block obtained based on the type and the data unit, the data block being obtained by performing the first decoding on the data unit in a decoding scheme determined based on the type and the data unit, and n being an integer greater than 1; A decoding method comprising: (Item 15) the type indicating that the target code block is a data code block; The first two code stream blocks n A data block included in group i of code stream blocks in the groups is obtained by performing the first decoding on a content in the data unit that corresponds to group i of code stream blocks and has a length of 8t, where t is a positive integer, i is greater than or equal to 1, and 2. n or i is an integer less than or equal to 0 and 2 n 15. The method according to claim 14, wherein the n is an integer less than or equal to -1. (Item 16) the type indicates that the target code block is a control code block, and the data unit includes a code block identifier ID and a code block content, the code block ID indicating a type of data block in each group of code stream blocks and a location of a first encoded content of each group of code stream blocks in the code block content; The first two code stream blocks n A control block included in group i of the code stream block in the group is obtained based on the type and the code block ID, and the second control block of the code stream block is n A data block included in a group i of the code stream blocks in the group is obtained by performing the first decoding on the code block content in a decoding manner determined based on the type and the code block ID, where i is greater than or equal to 1 and is equal to or less than 2. n or i is an integer less than or equal to 0 and 2 n 15. The method according to claim 14, wherein the n is an integer less than or equal to -1. (Item 17) the code block IDs include a first ID and a second ID, the first ID indicating the type of the data block in each group of code stream blocks and the second ID indicating the location of the first encoded content of each group of code stream blocks in the code block content; Item 17. The method of item 16, wherein the control blocks included in group i of code stream blocks are obtained based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks; and the data blocks included in group i of code stream blocks are obtained by performing the first decoding on the code block contents in a decoding scheme determined based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks. (Item 18) Item 18. The method according to item 16 or 17, wherein the type of the data blocks included in group i of code stream blocks is determined based on the content of the control blocks included in group i of code stream blocks and the content of the data blocks included in group i of code stream blocks. (Item 19) 19. The method according to any one of items 16 to 18, wherein the code block ID comprises m bits, where m is an integer greater than or equal to 4. (Item 20) 20. The method according to any one of items 16 to 19, wherein the code block ID has Hamming distance protection. (Item 21) the data unit includes a code block identifier ID, the type and the code block ID indicating that the target code block is an error code block; The first two code stream blocks n The control block included in each of the groups is a first value, and the second value of the code stream block is n Item 15. The method of item 14, wherein a data block included in each of the groups is a second value, and the first value and the second value indicate that the code stream block is an error code stream block. (Item 22) The step of obtaining the target code block comprises: receiving second data, where the second data is obtained based on the forward error correction (FEC) encoded first data; and performing a second decoding on the second data to obtain the target code block, where the second decoding is an error correction process; 22. The method according to any one of Items 14 to 21, comprising: (Item 23) 23. The method of claim 22, wherein the target code block is an error code block obtained when error correction is performed on the second data but the error correction fails. (Item 24) The steps of obtaining a target code block include: receiving second data, where the second data is obtained based on the forward error correction (FEC) encoded first data; and performing a second decoding on the second data to obtain the target code block, where the second decoding is an error detection process in which error correction is avoided. 22. The method according to any one of Items 14 to 21, comprising: (Item 25) 25. The method according to claim 24, wherein the target code block is an error code block obtained when an error is detected from the second data but error correction is avoided. (Item 26) The first two code stream blocks n 22. The method according to any one of items 14 to 21, wherein the groups are obtained by performing the first decoding on the target code block based on an error detection result and the type and data unit of the target code block, and the error detection result is obtained based on the type and data unit of the target code block. (Item 27) The error detection result includes a content sequence error or a content error of the target code block, and n 27. The method of claim 26, wherein the groups are obtained by performing the first decoding on a second code block based on a type of the second code block and a data unit, the second code block being a code block obtained by transforming the target code block and having the same number of bits as the target code block. (Item 28) The error detection result includes a content sequence error or a content error of the target code block, and n These groups are the 2 n The first code stream block is obtained by transforming the first group of n 27. The method of claim 26, wherein the group is obtained by performing the first decoding on the target code block based on the type of the target code block and the data unit. (Item 29) 29. The method according to any one of items 14 to 28, wherein the control block includes t bits and the data block includes 8t bits, where t is a positive integer. (Item 30) 30. The method of claim 29, wherein the value of n is 2, the value of t is 8, and the target code block is 257 bits. (Item 31) The first two code stream blocks n The method according to any one of items 14 to 30, wherein all of the groups are in the Media Independent Interface (MII) format. (Item 32) Code stream block 2 n a capture module configured to capture n groups, where any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; and The first two code stream blocks n a first encoding module configured to perform a first encoding on the group to obtain a target code block, where the target code block includes a data unit and the two of the code stream blocks; n the data unit includes a type determined based on the control blocks in the two groups of code stream blocks; n In the coding scheme determined based on the control block and the data block in each group, n obtained by performing the first encoding on the data blocks in the group; An encoding device comprising: (Item 33) the type indicating that the target code block is a data code block; The data unit is a block of code stream data. n The two groups of code stream blocks aren Item 33. The apparatus of item 32, wherein the first encoding is performed on the data blocks in the group. (Item 34) The type indicates that the target code block is a control code block; the data unit includes a code block identifier ID and code block contents, where the code block contents are the second bit of a code stream block. n The two groups of the code stream block are selected based on a sequence determined based on the control block and the data block. n the code block ID is obtained by performing the first encoding on the data blocks in the group of two code stream blocks; n 33. The apparatus of claim 32, wherein the code block ID is obtained based on the control block and the data block in each group of code stream blocks, and the code block ID indicates a type of data block in each group of code stream blocks and a location of a first encoded content of each group of code stream blocks in the code block content. (Item 35) 35. The apparatus of claim 34, wherein the code block ID includes a first ID and a second ID, the first ID indicating the type of the data block in each group of code stream blocks, and the second ID indicating the location of the first encoded content of each group of code stream blocks in the code block content. (Item 36) Item 36. The apparatus of item 34 or 35, wherein the code block ID comprises m bits, where m is an integer greater than or equal to 4. (Item 37) 37. The apparatus according to any one of claims 34 to 36, wherein the code block ID has Hamming distance protection. (Item 38) 38. The apparatus according to any one of items 34 to 37, wherein the target code block is an error code block, and the error code block includes error indication data. (Item 39) The target code block is selected based on the error detection result. n the error detection result is obtained by processing the two groups of the code stream block. n The apparatus according to any one of items 32 to 38, wherein the control blocks and the data blocks in the group are obtained. (Item 40) The error detection result is n the target code block includes a code stream block having a correct content sequence and a correct content, and the two code stream blocks having the correct content sequence and the correct content. n the error blocks are obtained by performing the first encoding based on the error blocks in the groups, the error blocks being n 40. The apparatus of claim 39, wherein the content sequence error or content error is obtained based on a code stream block having a content sequence error or a content error in the group. (Item 41) 41. The apparatus according to any one of items 32 to 40, wherein the control block includes t bits and the data block includes 8t bits, where t is a positive integer. (Item 42) Item 42. The apparatus of item 41, wherein the value of n is 2, the value of t is 8, and the target code block is 257 bits. (Item 43) The first two code stream blocks n 43. The apparatus of any one of items 32 to 42, wherein all of the groups are from a media independent interface MII. (Item 44) The device comprises: a second encoding module configured to perform a second encoding on the target code block based on a forward error correction FEC code type to obtain first data; and a transmission module configured to transmit the first data; 44. The device according to any one of items 32 to 43, further comprising: (Item 45) an acquisition module configured to acquire a target code block, where the target code block includes a type and a data unit; and performing a first decoding on the target code block based on the type of the target code block and the data unit; n a decoding module configured to obtain groups of code stream blocks, where any group of code stream blocks includes a data block and a control block obtained based on the type and the data unit, the data block being obtained by performing the first decoding on the data unit in a decoding scheme determined based on the type and the data unit, and n being an integer greater than 1; A decoding device comprising: (Item 46) the type indicating that the target code block is a data code block; The first two code stream blocks n A data block included in group i of code stream blocks in the groups is obtained by performing the first decoding on a content in the data unit that corresponds to group i of code stream blocks and has a length of 8t, where t is a positive integer, i is greater than or equal to 1, and 2. n or i is an integer less than or equal to 0 and 2 n Item 46. The apparatus of item 45, wherein −1 is an integer less than or equal to −1. (Item 47) the type indicates that the target code block is a control code block, and the data unit includes a code block identifier ID and a code block content, the code block ID indicating a type of data block in each group of code stream blocks and a location of a first encoded content of each group of code stream blocks in the code block content; The first two code stream blocks n A control block included in group i of the code stream block in the group is obtained based on the type and the code block ID, and the second control block of the code stream block is n A data block included in a group i of the code stream blocks in the group is obtained by performing the first decoding on the code block content in a decoding manner determined based on the type and the code block ID, where i is greater than or equal to 1 and is equal to or less than 2. n or i is an integer less than or equal to 0 and 2 n Item 46. The apparatus of item 45, wherein −1 is an integer less than or equal to −1. (Item 48) 48. The apparatus of claim 47, wherein the code block IDs include a first ID and a second ID, the first ID indicating the type of the data block in each group of code stream blocks and the second ID indicating the location of the first encoded content of each group of code stream blocks in the code block content; the control blocks included in group i of code stream blocks are obtained based on the type, bits in the first ID and corresponding to group i of code stream blocks, and bits in the second ID and corresponding to group i of code stream blocks; and the data blocks included in group i of code stream blocks are obtained by performing the first decoding on the code block content in a decoding scheme determined based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks. (Item 49) Item 49. The apparatus according to item 47 or 48, wherein the type of the data block included in group i of code stream blocks is determined based on the content of the control block included in group i of code stream blocks and the content of the data block included in group i of code stream blocks. (Item 50) 50. The apparatus according to any one of items 47 to 49, wherein the code block ID comprises m bits, where m is an integer greater than or equal to 4. (Item 51) 51. The apparatus according to any one of items 47 to 50, wherein the code block ID has Hamming distance protection. (Item 52) The data unit includes a code block identifier ID, and the type and the code block ID indicate that the target code block is an error code block; n The control block included in each of the groups is a first value, and the second value of the code stream block is n 46. The apparatus of claim 45, wherein a data block included in each of the groups is a second value, and the first value and the second value indicate that the code stream block is an error code stream block. (Item 53) 53. The apparatus of any one of items 45 to 52, wherein the acquisition module is configured to: receive second data, where the second data is acquired based on the first data encoded by using a forward error correction FEC code type; and perform second decoding on the second data to acquire the target code block, where the second decoding is an error correction process. (Item 54) Item 54. The apparatus of item 53, wherein the target code block is an error code block obtained when error correction is performed on the second data but the error correction fails. (Item 55) 53. The apparatus of any one of items 45 to 52, wherein the acquisition module is configured to: receive second data, where the second data is acquired based on the first data encoded by using a forward error correction FEC code type; and perform second decoding on the second data to acquire the target code block, where the second decoding is an error detection process in which error correction is avoided. (Item 56) Item 56. The apparatus of item 55, wherein the target code block is an error code block obtained when an error is detected from the second data but error correction is avoided. (Item 57) The first two code stream blocks n 53. The apparatus of any one of claims 45 to 52, wherein the groups are obtained by performing the first decoding on the target code block based on an error detection result and the type and data unit of the target code block, and the error detection result is obtained based on the type and data unit of the target code block. (Item 58) The error detection result includes a content sequence error or a content error of the target code block, and n Item 58. The apparatus of item 57, wherein the groups are obtained by performing the first decoding on a second code block based on a type of the second code block and a data unit, the second code block being a code block obtained by transforming the target code block and having the same number of bits as the target code block. (Item 59) The error detection result includes a content sequence error or a content error of the target code block, and n These groups are the 2 n The first code stream block is obtained by transforming the first group of n 58. The apparatus of claim 57, wherein the group is obtained by performing the first decoding on the target code block based on the type of the target code block and the data unit. (Item 60) 60. The apparatus according to any one of items 45 to 59, wherein the control block includes t bits and the data block includes 8t bits, where t is a positive integer. (Item 61) Item 61. The apparatus of item 60, wherein the value of n is 2, the value of t is 8, and the target code block is 257 bits. (Item 62) The first two code stream blocks n 62. The apparatus of any one of items 45 to 61, wherein all of the groups are in the Media Independent Interface MII format. (Item 63) A network device, the network device comprising a processor, the processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the network device to implement a method according to any one of items 1 to 31. (Item 64) A communication system comprising a first network device and a second network device, the first network device configured to execute a method according to any one of items 1 to 13, and the second network device configured to execute a method according to any one of items 14 to 31. (Item 65) A computer-readable storage medium, the computer-readable storage medium storing at least one program instruction or code; the program instruction or code being loaded and executed by a processor, the computer being enabled to implement the method according to any one of items 1 to 31. (Item 66) A computer program product comprising computer program code; the computer program code being enabled to execute the method according to any one of items 1 to 31 when executed on a computer. (Item 67) A chip comprising a processor configured to: retrieve instructions from a memory; and execute the instructions stored in the memory to enable a communications device to which the chip is attached to perform a method according to any one of items 1 to 31. (Item 68) A chip comprising an input interface, an output interface, a processor, and a memory; the input interface, the output interface, the processor, and the memory are connected via an internal connection path; the processor is configured to execute code in the memory; and when the code is executed, the processor is configured to perform the method according to any one of items 1 to 31.
Claims
1. Code stream block 2 n obtaining groups of n, where any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; and The second code stream block n performing a first encoding on the group to obtain a target code block, where the target code block comprises a data unit and the two code stream blocks; n the data unit includes a type determined based on the control blocks in the two groups of code stream blocks; n In the coding scheme determined based on the control block and the data block in each group, n obtained by performing the first encoding on the data blocks in the group; An encoding method comprising:
2. the type indicating that the target code block is a data code block; The data unit is the second part of the code stream block. n The two groups of the code stream block are then n The method of claim 1 , wherein the first encoding is performed on the data blocks in the group.
3. the type indicating that the target code block is a control code block; The data unit includes a code block identifier ID and a code block content, where the code block content is the second part of a code stream block. n The two groups of the code stream block are determined based on the control block and the data block. n the code block ID is obtained by performing the first encoding on the data blocks in the group, n 2. The method of claim 1 , wherein the code block ID is obtained based on the control block and the data block in each group of code stream blocks, and the code block ID indicates a type of data block in each group of code stream blocks and a location of a first encoded content of each group of code stream blocks in the code block content.
4. 4. The method of claim 3, wherein the code block IDs include a first ID and a second ID, the first ID indicating the type of the data block in each group of code stream blocks and the second ID indicating the location of the first encoded content of each group of code stream blocks in the code block content.
5. The method of claim 3 or 4, wherein the code block ID comprises m bits, where m is an integer greater than or equal to 4.
6. The method according to any one of claims 3 to 5, wherein the code block ID has Hamming distance protection.
7. The method according to any one of claims 3 to 6, wherein the target code block is an error code block, the error code block including error indication data.
8. The target code block is determined based on the error detection result. n the error detection result is obtained by processing the two groups of the code stream block. n The method according to any one of claims 1 to 7, wherein the control blocks and the data blocks in a group are obtained.
9. The error detection result is n the target code block includes a code stream block having a correct content sequence and a correct content, and the two code stream blocks having a correct content sequence and a correct content. n the error blocks are obtained by performing the first encoding based on the error blocks in the groups, the error blocks being n The method of claim 8 , wherein the content sequence error or content error is obtained based on code stream blocks having a content sequence error or a content error in the group.
10. The method of any one of claims 1 to 9, wherein the control block comprises t bits and the data block comprises 8t bits, where t is a positive integer.
11. 11. The method of claim 10, wherein the value of n is 2, the value of t is 8, and the target code block is 257 bits.
12. The second code stream block n The method according to any one of claims 1 to 11, wherein all of said groups are from a media independent interface MII.
13. After obtaining the target code block, the method: performing a second encoding on the target code block based on a forward error correction (FEC) code type to obtain first data; and Transmitting the first data The method of any one of claims 1 to 12, further comprising:
14. Here's how: obtaining a target code block, where the target code block includes a type and a data unit; and performing a first decoding on the target code block based on the type of the target code block and the data unit; n obtaining groups of n, where any group of code stream blocks includes a data block and a control block obtained based on the type and the data unit, the data block being obtained by performing the first decoding on the data unit in a decoding scheme determined based on the type and the data unit, and n being an integer greater than 1. A decoding method comprising:
15. the type indicating that the target code block is a data code block; The second code stream block n A data block included in group i of code stream blocks in the group is obtained by performing the first decoding on a content in the data unit corresponding to group i of code stream blocks and having a length of 8t, where t is a positive integer, i is greater than or equal to 1, and 2. n or i is an integer less than or equal to 0 and 2 n 15. The method of claim 14, wherein the n is an integer less than or equal to -1.
16. the type indicates that the target code block is a control code block, and the data unit includes a code block identifier ID and a code block content, the code block ID indicating a type of data block in each group of code stream blocks and a location of a first encoded content of each group of code stream blocks in the code block content; The second code stream block n A control block included in group i of the code stream block in the group is obtained based on the type and the code block ID, and the control block of the code stream block is n A data block included in a group i of code stream blocks in the group is obtained by performing the first decoding on the code block content in a decoding manner determined based on the type and the code block ID, where i is greater than or equal to 1 and is equal to or less than 2. n or i is an integer less than or equal to 0 and 2 n 15. The method of claim 14, wherein the n is an integer less than or equal to -1.
17. the code block IDs include a first ID and a second ID, the first ID indicating the type of the data block in each group of code stream blocks and the second ID indicating the location of the first encoded content of each group of code stream blocks in the code block content; 17. The method of claim 16, wherein the control blocks included in group i of code stream blocks are obtained based on the type, bits in the first ID and corresponding to group i of code stream blocks, and bits in the second ID and corresponding to group i of code stream blocks; and the data blocks included in group i of code stream blocks are obtained by performing the first decoding on the code block contents in a decoding scheme determined based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks.
18. 18. The method of claim 16 or 17, wherein the type of the data blocks included in a group i of code stream blocks is determined based on the content of the control blocks included in the group i of code stream blocks and the content of the data blocks included in the group i of code stream blocks.
19. The method according to any one of claims 16 to 18, wherein the code block ID comprises m bits, where m is an integer greater than or equal to 4.
20. The method according to any one of claims 16 to 19, wherein the code block ID has Hamming distance protection.
21. the data unit includes a code block identifier ID, the type and the code block ID indicating that the target code block is an error code block; The second code stream block n The control block included in each of the groups is a first value, and the second value of the code stream block is n 15. The method of claim 14, wherein a data block included in each of the groups is a second value, the first value and the second value indicating that the code stream block is an error code stream block.
22. The step of obtaining the target code block comprises: receiving second data, where the second data is obtained based on the forward error correction (FEC) encoded first data; and performing a second decoding on the second data to obtain the target code block, where the second decoding is an error correction process; The method according to any one of claims 14 to 21, comprising:
23. 23. The method of claim 22, wherein the target code block is an errored code block obtained when error correction is performed on the second data but the error correction is unsuccessful.
24. The step of obtaining a target code block comprises: receiving second data, where the second data is obtained based on the forward error correction (FEC) encoded first data; and performing a second decoding on the second data to obtain the target code block, where the second decoding is an error detection process in which error correction is avoided. The method according to any one of claims 14 to 21, comprising:
25. 25. The method of claim 24, wherein the target code block is an error code block obtained when an error is detected from the second data but error correction is avoided.
26. The second code stream block n The method according to any one of claims 14 to 21, wherein the groups are obtained by performing the first decoding on the target code block based on an error detection result and the type and data unit of the target code block, and the error detection result is obtained based on the type and data unit of the target code block.
27. The error detection result includes a content sequence error or a content error of the target code block, and n 27. The method of claim 26, wherein the groups are obtained by performing the first decoding on a second code block based on a type and a data unit of the second code block, the second code block being a code block obtained by transforming the target code block and having the same number of bits as the target code block.
28. The error detection result includes a content sequence error or a content error of the target code block, and n These groups are the first two code stream blocks. n the first code stream block is obtained by transforming the first group of n 27. The method of claim 26, wherein the groups are obtained by performing the first decoding on the target code block based on the type of the target code block and the data unit.
29. The method of any one of claims 14 to 28, wherein the control block comprises t bits and the data block comprises 8t bits, where t is a positive integer.
30. 30. The method of claim 29, wherein the value of n is 2, the value of t is 8, and the target code block is 257 bits.
31. The second code stream block n The method according to any one of claims 14 to 30, wherein all of said groups are in the Media Independent Interface MII format.
32. Code stream block 2 n a capture module configured to capture n groups, where any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; and The second code stream block n a first encoding module configured to perform a first encoding on the group to obtain a target code block, where the target code block includes a data unit and the two code stream blocks; n the data unit includes a type determined based on the control blocks in the two groups of code stream blocks; n In the coding scheme determined based on the control block and the data block in each group, n obtained by performing the first encoding on the data blocks in the group; An encoding device comprising:
33. the type indicating that the target code block is a data code block; The data unit is the second part of the code stream block. n The two groups of the code stream block are then n 33. The apparatus of claim 32, wherein the first encoding is performed on the data blocks in the group.
34. The type indicates that the target code block is a control code block; the data unit includes a code block identifier ID and code block contents, where the code block contents are the second part of a code stream block. n The two groups of the code stream block are determined based on the control block and the data block. n the code block ID is obtained by performing the first encoding on the data blocks in the group, n 33. The apparatus of claim 32, wherein the code block ID is obtained based on the control block and the data block in each group of code stream blocks, and the code block ID indicates a type of data block in each group of code stream blocks and a location of a first encoded content of each group of code stream blocks in the code block content.
35. 35. The apparatus of claim 34, wherein the code block IDs include a first ID and a second ID, the first ID indicating the type of the data block in each group of code stream blocks and the second ID indicating the location of the first encoded content of each group of code stream blocks in the code block content.
36. 36. The apparatus of claim 34 or 35, wherein the code block ID comprises m bits, where m is an integer greater than or equal to four.
37. The apparatus of any one of claims 34 to 36, wherein the code block ID has Hamming distance protection.
38. The apparatus of any one of claims 34 to 37, wherein the target code block is an error code block, the error code block including error indication data.
39. The target code block is determined based on the error detection result. n the error detection result is obtained by processing the two groups of the code stream block. n The apparatus according to any one of claims 32 to 38, wherein the control blocks and the data blocks in the group are obtained.
40. The error detection result is n the target code block includes a code stream block having a correct content sequence and a correct content, and the two code stream blocks having a correct content sequence and a correct content. n the error blocks are obtained by performing the first encoding based on the error blocks in the groups, the error blocks being n The apparatus of claim 39, wherein the content sequence error or content error is obtained based on code stream blocks having a content sequence error or a content error in the group.
41. Apparatus according to any one of claims 32 to 40, wherein the control block comprises t bits and the data block comprises 8t bits, where t is a positive integer.
42. 42. The apparatus of claim 41, wherein the value of n is 2, the value of t is 8, and the target code block is 257 bits.
43. The second code stream block n Apparatus according to any one of claims 32 to 42, wherein all of said groups are from a media independent interface MII.
44. The apparatus comprises: a second encoding module configured to perform a second encoding on the target code block based on a forward error correction (FEC) code type to obtain first data; and a transmission module configured to transmit the first data; The apparatus of any one of claims 32 to 43, further comprising:
45. an acquisition module configured to acquire a target code block, where the target code block includes a type and a data unit; and performing a first decoding on the target code block based on the type of the target code block and the data unit; n a decoding module configured to obtain groups of code stream blocks, where any group of code stream blocks includes a data block and a control block obtained based on the type and the data unit, the data block being obtained by performing the first decoding on the data unit in a decoding scheme determined based on the type and the data unit, and n being an integer greater than 1; A decoding device comprising:
46. the type indicating that the target code block is a data code block; The second code stream block n A data block included in group i of code stream blocks in the group is obtained by performing the first decoding on a content in the data unit corresponding to group i of code stream blocks and having a length of 8t, where t is a positive integer, i is greater than or equal to 1, and 2. n or i is an integer less than or equal to 0 and 2 n 46. The apparatus of claim 45, wherein the n is an integer less than or equal to -1.
47. the type indicates that the target code block is a control code block, and the data unit includes a code block identifier ID and a code block content, the code block ID indicating a type of data block in each group of code stream blocks and a location of a first encoded content of each group of code stream blocks in the code block content; The second code stream block n A control block included in group i of the code stream block in the group is obtained based on the type and the code block ID, and the control block of the code stream block is n A data block included in a group i of code stream blocks in the group is obtained by performing the first decoding on the code block content in a decoding manner determined based on the type and the code block ID, where i is greater than or equal to 1 and is equal to or less than 2. n or i is an integer less than or equal to 0 and 2 n 46. The apparatus of claim 45, wherein the n is an integer less than or equal to -1.
48. 48. The apparatus of claim 47, wherein the code block IDs include a first ID and a second ID, the first ID indicating the type of the data block in each group of code stream blocks and the second ID indicating the location of the first encoded content of each group of code stream blocks in the code block contents; the control blocks included in group i of code stream blocks are obtained based on the type, bits in the first ID and corresponding to group i of code stream blocks, and bits in the second ID and corresponding to group i of code stream blocks; and the data blocks included in group i of code stream blocks are obtained by performing the first decoding on the code block contents in a decoding scheme determined based on the type, the bits in the first ID and corresponding to group i of code stream blocks, and the bits in the second ID and corresponding to group i of code stream blocks.
49. 49. The apparatus of claim 47 or 48, wherein the type of the data blocks included in a group i of code stream blocks is determined based on the content of the control blocks included in the group i of code stream blocks and the content of the data blocks included in the group i of code stream blocks.
50. The apparatus of any one of claims 47 to 49, wherein the code block ID comprises m bits, where m is an integer greater than or equal to 4.
51. The apparatus of any one of claims 47 to 50, wherein the code block ID has Hamming distance protection.
52. The data unit includes a code block identifier ID, the type and the code block ID indicating that the target code block is an error code block; n The control block included in each of the groups is a first value, and the second value of the code stream block is n 46. The apparatus of claim 45, wherein a data block included in each of the groups is a second value, the first value and the second value indicating that the code stream block is an error code stream block.
53. 53. The apparatus of claim 45, wherein the obtaining module is configured to: receive second data, where the second data is obtained based on the first data encoded by using a forward error correction FEC code type; and perform second decoding on the second data to obtain the target code block, where the second decoding is an error correction process.
54. 54. The apparatus of claim 53, wherein the target code block is an errored code block obtained when error correction is performed on the second data but the error correction is unsuccessful.
55. 53. The apparatus of claim 45, wherein the acquisition module is configured to: receive second data, where the second data is acquired based on first data encoded by using a forward error correction FEC code type; and perform second decoding on the second data to acquire the target code block, where the second decoding is an error detection process in which error correction is avoided.
56. 56. The apparatus of claim 55, wherein the target code block is an errored code block obtained when an error is detected from the second data but error correction is avoided.
57. The second code stream block n The apparatus of any one of claims 45 to 52, wherein the groups are obtained by performing the first decoding on the target code block based on an error detection result and the type and data unit of the target code block, and the error detection result is obtained based on the type and data unit of the target code block.
58. The error detection result includes a content sequence error or a content error of the target code block, and n 58. The apparatus of claim 57, wherein the groups are obtained by performing the first decoding on a second code block based on a type and a data unit of the second code block, the second code block being a code block obtained by transforming the target code block and having the same number of bits as the target code block.
59. The error detection result includes a content sequence error or a content error of the target code block, and n These groups are the first two code stream blocks. n the first code stream block is obtained by transforming the first group of n 58. The apparatus of claim 57, wherein the groups are obtained by performing the first decoding on the target code block based on the type of the target code block and the data unit.
60. Apparatus according to any one of claims 45 to 59, wherein the control block comprises t bits and the data block comprises 8t bits, where t is a positive integer.
61. 61. The apparatus of claim 60, wherein the value of n is 2, the value of t is 8, and the target code block is 257 bits.
62. The second code stream block n Apparatus according to any one of claims 45 to 61, wherein all of said groups are in Media Independent Interface MII format.
63. A network device comprising a processor, the processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the network device to implement a method according to any one of claims 1 to 31.
64. A communication system, the system comprising a first network device and a second network device, the first network device configured to perform the method according to any one of claims 1 to 13, and the second network device configured to perform the method according to any one of claims 14 to 31.
65. A computer readable storage medium, the computer readable storage medium storing at least one program instruction or code; the program instruction or code being loaded and executed by a processor, the computer being enabled to implement the method according to any one of claims 1 to 31.
66. A computer program product comprising computer program code; said computer program code, when executed on a computer, enabling said computer to carry out the method according to any one of claims 1 to 31.
67. A chip comprising a processor configured to: retrieve instructions from a memory; and execute the instructions stored in the memory to enable a communications device in which the chip is attached to perform a method according to any one of claims 1 to 31.
68. A chip comprising an input interface, an output interface, a processor, and a memory; the input interface, the output interface, the processor, and the memory are connected via internal connection paths; the processor is configured to execute code in the memory; and when the code is executed, the processor is configured to perform the method of any one of claims 1 to 31.
Citation Information
Patent Citations
Physical layer encoding and decoding method and apparatuses thereof
US20160182084A1