Encoding method, decoding method, device, apparatus, system, and readable storage medium
Patent Information
- Application Number
- JP2024540679
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-01-30
- Filing Date
- 2022-12-27
- Publication Date
- 2024-12-18
- Estimated Expiration
- 2042-12-27
AI Technical Summary
In high-speed physical links, the 64B/66B encoding process in the existing technology leads to an increase in delay, power consumption and chip area occupation, and the field of Hamming distance protection cannot be effectively used in error identification, resulting in difficulty in FEC codeword identification. .
An encoding method is proposed. By obtaining 2n groups of code stream blocks, the first encoding is performed to generate the target code block. This method avoids 64B/66B encoding of each group of code stream blocks and directly performs FEC encoding to improve the coding efficiency and pass the decoding method. Decode target code blocks directly to reduce latency and power consumption.
It reduces the delay, power consumption and chip area occupation during the encoding and decoding process, improves the accuracy and reliability of data transmission, and is suitable for scenarios such as high-speed Ethernet.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Coding method, decoding method, device, equipment, system and readable storage medium
[0001] This application claims priority to Chinese patent application No. 202210005434.5, filed on January 5, 2022, with invention name “A coding method, device and chip”, the entire contents of which are incorporated by reference into this application; this application also claims priority to Chinese patent application No. 202210114840.5, filed on January 30, 2022, with invention name “Coding method, decoding method, device, equipment, system and readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to an encoding method, a decoding method, an apparatus, a device, a system, and a readable storage medium. Background Art
[0003] With the advancement of communication technology, the methods for transmitting messages via Ethernet are becoming increasingly sophisticated. During message transmission, messages from the media access control (MAC) layer are divided into blocks of fixed length and enter the media independent interface (MII) in parallel. For example, after being divided into blocks, the message enters the 800 gigabit (G) MII in parallel. 800GMII represents an MII with a transmission MAC rate of 800 gigabits per second (Gb / s). It is then transmitted to the physical coding sublayer (PCS) via the MII. The code stream blocks received by the PCS from the MII include data blocks (transmit data, TXD) and control blocks (transmit control, TXC). TXC and TXD are derived from the message stream content from the MAC layer after being processed by the reconciliation sublayer (RS). TXC is a control word used to identify whether the corresponding byte in TXD contains a control signal or a data signal. Control signals include information such as the start, end, error, and idle state of the message. PCS encodes according to the TXC / TXD content to reduce overhead while providing necessary synchronization and protection functions.
[0004] In related technologies, the PCS performs 64-bit (B) / 66B encoding on each group of code stream blocks from the MII, resulting in a 66-bit code block. This 66-bit code block is either a data code block or a control code block. If it is a control code block, the 66-bit code block includes a field with 4-bit Hamming distance protection. When using a high-speed physical link for data transmission, each four 66-bit code blocks are transcoded into a 257-bit 256B / 257B encoded code block. Forward error correction (FEC) is performed on the 257-bit code block, and the resulting FEC codeword is transmitted.
[0005] When uncorrectable FEC codewords are present, the number of errors in the FEC codeword and their position are not fixed, so the fields with Hamming distance protection in the 66-bit code block cannot guarantee reliable error identification. However, since FEC error marking can ensure reliable error identification, error identification does not require the fields with Hamming distance protection in the 66-bit code block. Furthermore, since the majority of PCS processing is based on 257-bit code blocks, the 64B / 66B encoding process is no longer necessary. If the 64B / 66B encoding process is retained, the subsequent transcoding process will introduce unnecessary latency, power consumption, and chip area.
[0006] Summary of the Invention
[0007] The present application proposes an encoding method, a decoding method, an apparatus, a device, a system and a readable storage medium for improving encoding and decoding efficiency.
[0008] In a first aspect, a coding method is provided, the method comprising: obtaining 2 n A group of code stream blocks, any group of code stream blocks includes a control block and a data block, said n is an integer greater than 1; n The first encoding is performed on the group code stream block to obtain a target code block, the target code block includes n The control block of the group codestream block determines the type and based on the 2 n The control block and data block of the group codestream block determine the data unit.
[0009] Due to the 2 including control block and data block n The target code block can be obtained by first encoding the group code stream block without n Each group of code stream blocks in the group code stream block is 64B / 66B encoded to obtain 2 n 66-bit code blocks, and then 2 n The target code block is obtained by transcoding 66-bit code blocks, the coding efficiency is improved, and the delay, power consumption and chip area occupied by the coding process are reduced.
[0010] In a possible implementation, the type is used to indicate that the target code block is a data code block; the data unit is based on the 2 n The order of the group codestream blocks is n The data blocks of the group code stream blocks are obtained by performing the first encoding.
[0011] In a possible implementation, the type is used to indicate that the target code block is a control code block; the data unit includes a type indication and code block content, and the code block content is based on the 2 n The control block and data block of the group code stream block determine the order of the 2 n The data block of the group code stream block is obtained by performing the first encoding, and the type indication is based on the 2 n The control block of the group code stream block is obtained, and the type indication is used to indicate the type of each group code stream block.
[0012] In one possible implementation, the target code block is an error code block, and the error code block includes data for identifying an error. Since the encoding method of the present application can perform first encoding on different types of code stream blocks to obtain target code blocks, the method has wide applicability.
[0013] In a possible implementation, the target code block is based on the error detection result of the 2 n The error detection result is obtained by processing the group code stream block based on the 2 n The control block and data block of the group code stream block are obtained. By processing the code stream block with errors, the target code block is obtained, so that the erroneous data can be distinguished from the correct data during subsequent data transmission, thereby ensuring data reliability.
[0014] In a possible implementation, the error detection result includes the 2 n The content sequence or content of the group code stream block is wrong, and the target code block is based on the 2 n The first coding is performed on the code stream blocks with correct content order and correct content and the error blocks in the group code stream blocks, and the error blocks are obtained based on the 2 n The codestream blocks in the group codestream block have wrong content order or wrong content.
[0015] In a possible implementation, the control block includes m bits, the data block includes 8m bits, and m is a positive integer.
[0016] In a possible implementation, the value of n is 2, the value of m is 8, and the target code block is 257 bits.
[0017] In a possible implementation, the 2 nThe group code stream blocks all come from the medium independent interface MII.
[0018] In one possible implementation, after obtaining the target code block, the method further includes: performing a second encoding on the target code block according to an FEC code type to obtain first data; and transmitting the first data. By performing the second encoding on the target code block according to the FEC code type to obtain the first data, a receiving end can perform error correction on the received first data to ensure the accuracy of data transmission.
[0019] In a second aspect, a decoding method is provided, the method comprising: obtaining a target code block, the target code block comprising a type and a data unit; performing a first decoding on the target code block according to the type and the data unit of the target code block, and obtaining 2 n A group of codestream blocks, any group of codestream blocks includes a control block and a data block obtained based on the type and the data unit, and the n is an integer greater than 1.
[0020] Since the first decoding of the target code block can obtain 2 blocks including the control block and the data block, n The group code stream block does not need to be transcoded to obtain 2 n 66-bit code blocks, and then 2 n The 66-bit code blocks are decoded to obtain 2 n By grouping code stream blocks, decoding efficiency is improved, and the latency, power consumption and chip area occupied by the decoding process are reduced.
[0021] In a possible implementation, the type is used to indicate that the target code block is a data code block; n The data blocks included in the i-th group of codestream blocks are obtained by performing the first decoding on the 8m-length content corresponding to the i-th group of codestream blocks in the data unit, where m is a positive integer and i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n An integer of -1.
[0022] In a possible implementation, the type is used to indicate that the target code block is a control code block, and the data unit includes a type indication and code block content. The type indication includes 2 n bits, the 2 n One of the bits is used to indicate the n The type of a group of code stream blocks corresponding to the bit in the group code stream block, the code block content includes 2 n Bit groups;
[0023] Said 2 nThe control block included in the i-th group of codestream blocks in the group of codestream blocks is obtained based on the type, the bit corresponding to the i-th group of codestream blocks in the type indication, and the bit group corresponding to the i-th group of codestream blocks in the codeblock content, where i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n An integer of -1;
[0024] Said 2 n The data blocks included in the i-th group of codestream blocks in the group of codestream blocks are obtained by performing the first decoding on the bit group corresponding to the i-th group of codestream blocks in the code block content based on the bit corresponding to the i-th group of codestream blocks in the type indication.
[0025] In a possible implementation, the 2 n The bit group includes the first bit group and 2 n - 1 second bit group, the number of bits included in the first bit group is different from the number of bits included in the second bit group.
[0026] In a possible implementation, the data unit includes a type indication, and the type and the type indication are used to indicate that the target code block is an error code block; n The control block included in each group of code stream blocks in the group code stream block is the first value, and the 2 n The data block included in each group of codestream blocks in the group codestream blocks is a second value, and the first value and the second value are used to indicate that the codestream block is an erroneous codestream block.
[0027] Since the decoding method of the present application can first decode different types of target code blocks to obtain 2 n This method has wide applicability.
[0028] In one possible implementation, obtaining the target code block includes: receiving second data, where the second data is obtained based on first data encoded using a forward error correction (FEC) code type; performing a second decoding on the second data to obtain the target code block, where the second decoding is error correction processing.
[0029] In one possible implementation, the target code block is an error code block obtained by unsuccessfully performing error correction on the second data. Because the target code block is a code block obtained by unsuccessfully performing error correction on the second data and then marking errors in code blocks within the FEC codeword, the receiving end can determine that data obtained based on the target code block is error data, thereby ensuring data accuracy.
[0030] In one possible implementation, obtaining the target code block includes: receiving second data, where the second data is obtained based on first data encoded using a forward error correction (FEC) code type; performing a second decoding on the second data to obtain the target code block, where the second decoding is error detection but not error correction processing.
[0031] In a possible implementation, the target code block is an error code block obtained by detecting errors from the second data but not correcting them.
[0032] For the decoding method provided in this application, the second decoding operation may be to correct errors on the codeword, or to perform error detection without error correction. In the case where error correction is performed on the codeword during the second decoding process, when it is determined that error correction cannot be performed on the current codeword (for example, the number of errors exceeds the error correction capability), it is necessary to mark all code blocks in the codeword for errors; or when only error detection without error correction is performed on the codeword during the second decoding process, for the codeword in which errors are detected, it is necessary to mark all code blocks in the codeword for errors.
[0033] In a possible implementation, the 2 n The group code stream block is obtained by first decoding the target code block based on an error detection result and the type and data unit of the target code block, wherein the error detection result is obtained based on the type and data unit of the target code block. By processing the target code block containing errors, a receiving end can distinguish between erroneous data and correct data, thereby ensuring data reliability.
[0034] In a possible implementation, the error detection result includes a content sequence error or content error of the target code block, the 2 n The group code stream block is obtained by first decoding the second code block according to the type and data unit of the second code block, and the second code block is obtained by converting the target code block and has the same number of bits as the target code block.
[0035] In a possible implementation, the error detection result includes a content sequence error or content error of the target code block, the 2 n The group code stream block is based on 2 n The first bitstream block of the group is converted to obtain the 2 n The first code stream block is obtained by first decoding the target code block based on the type and data unit of the target code block.
[0036] In a possible implementation, the control block includes m bits, the data block includes 8m bits, and m is a positive integer.
[0037] In a possible implementation, the value of n is 2, the value of m is 8, and the target code block is 257 bits.
[0038] In a possible implementation, the 2 n The group code stream blocks are all in the medium independent interface MII format.
[0039] According to a third aspect, an encoding device is provided, the device comprising:
[0040] Get module, used to get 2 n A group of code stream blocks, any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1;
[0041] The first encoding module is used to encode the n The first encoding is performed on the group code stream block to obtain a target code block, the target code block includes n The control block of the group codestream block determines the type and based on the 2 n The control block and data block of the group codestream block determine the data unit.
[0042] In a possible implementation, the type is used to indicate that the target code block is a data code block; the data unit is based on the 2 n The control block and data block of the group code stream block determine the order of the 2 n The data blocks of the group code stream blocks are obtained by performing the first encoding.
[0043] In a possible implementation, the type is used to indicate that the target code block is a control code block; the data unit includes a type indication and code block content, and the code block content is based on the 2 n The control block and data block of the group code stream block determine the order of the 2 n The data block of the group code stream block is obtained by performing the first encoding, and the type indication is based on the 2 n The control block of the group code stream block is obtained, and the type indication is used to indicate the type of each group code stream block.
[0044] In a possible implementation, the target code block is an error code block, and the error code block includes data for identifying an error.
[0045] In a possible implementation, the target code block is based on the error detection result of the 2 n The error detection result is obtained by processing the group code stream block based on the 2 n The control block and data block of the group codestream block are obtained.
[0046] In a possible implementation, the error detection result includes the 2 n The content sequence or content of the group code stream block is wrong, and the target code block is based on the 2 nThe first coding is performed on the code stream blocks with correct content order and correct content and the error blocks in the group code stream blocks, and the error blocks are obtained based on the 2 n The codestream blocks in the group codestream block have wrong content order or wrong content.
[0047] In a possible implementation, the control block includes m bits, the data block includes 8m bits, and m is a positive integer.
[0048] In a possible implementation, the value of n is 2, the value of m is 8, and the target code block is 257 bits.
[0049] In a possible implementation, the 2 n The group code stream blocks all come from the medium independent interface MII.
[0050] In a possible implementation, the device further includes:
[0051] The second encoding module is used to perform a second encoding on the target code block according to the forward error correction FEC code type to obtain first data; the sending module is used to send the first data.
[0052] In a fourth aspect, a decoding device is provided, the device comprising:
[0053] An acquisition module, configured to acquire a target code block, wherein the target code block includes a type and a data unit;
[0054] A decoding module is configured to perform a first decoding on the target code block according to the type and data unit of the target code block to obtain 2 n A group of codestream blocks, any group of codestream blocks includes a control block and a data block obtained based on the type and the data unit, and the n is an integer greater than 1.
[0055] In a possible implementation, the type is used to indicate that the target code block is a data code block; n The data blocks included in the i-th group of codestream blocks are obtained by performing the first decoding on the 8m-length content corresponding to the i-th group of codestream blocks in the data unit, where m is a positive integer and i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n An integer of -1.
[0056] In a possible implementation, the type is used to indicate that the target code block is a control code block; the data unit includes a type indication and code block content, and the type indication includes 2 n bits, the 2 n One of the bits is used to indicate then The type of a group of code stream blocks corresponding to the bit in the group code stream block, the code block content includes 2 n bit groups; n The control block included in the i-th group of codestream blocks in the group of codestream blocks is obtained based on the type, the bit corresponding to the i-th group of codestream blocks in the type indication, and the bit group corresponding to the i-th group of codestream blocks in the codeblock content, where i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n -1 integer; 2 n The data blocks included in the i-th group of codestream blocks in the group of codestream blocks are obtained by performing the first decoding on the bit group corresponding to the i-th group of codestream blocks in the code block content based on the bit corresponding to the i-th group of codestream blocks in the type indication.
[0057] In a possible implementation, the 2 n The bit group includes the first bit group and 2 n - 1 second bit group, the number of bits included in the first bit group is different from the number of bits included in the second bit group.
[0058] In a possible implementation, the data unit includes a type indication, and the type and the type indication are used to indicate that the target code block is an error code block; n The control block included in each group of code stream blocks in the group code stream block is the first value, and the 2 n The data block included in each group of codestream blocks in the group codestream blocks is a second value, and the first value and the second value are used to indicate that the codestream block is an erroneous codestream block.
[0059] In one possible implementation, the acquisition module is used to receive second data, where the second data is obtained based on first data encoded using a forward error correction (FEC) code type; and perform a second decoding on the second data to obtain the target code block, where the second decoding is error correction processing.
[0060] In a possible implementation, the target code block is a code block obtained by performing error correction on the second data but failing to perform error correction.
[0061] In one possible implementation, the acquisition module is used to receive second data, where the second data is obtained based on first data encoded using a forward error correction (FEC) code type; and perform a second decoding on the second data to obtain the target code block, where the second decoding is error detection but not error correction processing.
[0062] In a possible implementation, the target code block is an error code block obtained by detecting errors from the second data but not correcting them.
[0063] In a possible implementation, the 2 n The group code stream block is obtained by performing the first decoding on the target code block according to an error detection result and a type and a data unit of the target code block, wherein the error detection result is obtained based on the type and the data unit of the target code block.
[0064] In a possible implementation, the error detection result includes a content sequence error or content error of the target code block, the 2 n The group code stream block is obtained by performing the first decoding on the second code block according to the type and data unit of the second code block, and the second code block is obtained by converting the target code block and has the same number of bits as the target code block.
[0065] In a possible implementation, the error detection result includes a content sequence error or content error of the target code block, the 2 n The group code stream block is based on 2 n The first bitstream block of the group is converted to obtain the 2 n The first code stream block is obtained by performing the first decoding on the target code block based on the type and data unit of the target code block.
[0066] In a possible implementation, the control block includes m bits, the data block includes 8m bits, and m is a positive integer.
[0067] In a possible implementation, the value of n is 2, the value of m is 8, and the target code block is 257 bits.
[0068] In a possible implementation, the 2 n The group code stream blocks are all in the medium independent interface MII format.
[0069] In a fifth aspect, a network device is provided, comprising a processor coupled to a memory, wherein the memory stores at least one program instruction or code, and the at least one program instruction or code is loaded and executed by the processor so that the network device implements any encoding method in the first aspect, or implements any decoding method in the second aspect.
[0070] In the sixth aspect, a computer-readable storage medium is provided, in which at least one program instruction or code is stored. When the program instruction or code is loaded and executed by a processor, the computer implements any encoding method in the first aspect, or implements any decoding method in the second aspect.
[0071] In a seventh aspect, a communication system is provided, comprising a first network device and a second network device, wherein the first network device is used to execute any encoding method in the first aspect, and the second network device is used to execute any decoding method in the second aspect.
[0072] In an eighth aspect, another communication device is provided, comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other via an internal connection path; the memory is configured to store instructions; and the processor is configured to execute the instructions stored in the memory to control the transceiver to receive signals and to control the transceiver to transmit signals. When the processor executes the instructions stored in the memory, the processor executes any encoding method according to the first aspect or any decoding method according to the second aspect.
[0073] Exemplarily, there are one or more processors and one or more memories.
[0074] Exemplarily, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0075] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated on the same chip as the processor or be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.
[0076] In the ninth aspect, a computer program product is provided, comprising: a computer program code, which, when executed by a computer, enables the computer to execute any encoding method in the first aspect, or to execute any decoding method in the second aspect.
[0077] In the tenth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes any encoding method in the first aspect, or executes any decoding method in the second aspect.
[0078] In the eleventh aspect, another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute any encoding method in the first aspect, or execute any decoding method in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] FIG1 is a schematic diagram of an implementation environment of an encoding method and a decoding method provided in an embodiment of the present application;
[0080] FIG2 is a flow chart of an encoding method provided in an embodiment of the present application;
[0081] FIG3 is a schematic diagram of a process for obtaining a target code block according to an embodiment of the present application;
[0082] FIG4 is a schematic diagram of the structure of a target code block provided in an embodiment of the present application;
[0083] FIG5 is a schematic diagram of the structure of another target code block provided in an embodiment of the present application;
[0084] FIG6 is a schematic diagram of the structure of another target code block provided in an embodiment of the present application;
[0085] FIG7 is a flowchart of a decoding method provided in an embodiment of the present application;
[0086] FIG8 is a schematic structural diagram of an encoding device provided in an embodiment of the present application;
[0087] FIG9 is a schematic structural diagram of a decoding device provided in an embodiment of the present application;
[0088] FIG10 is a schematic structural diagram of a network device provided in an embodiment of the present application;
[0089] FIG11 is a schematic diagram of the structure of another network device provided in an embodiment of the present application;
[0090] FIG12 is a schematic diagram of the structure of another network device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0091] The terms used in the embodiments of the present application are only used to explain the embodiments of the present application and are not intended to limit the present application. The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0092] As a local area network technology, Ethernet has an increasingly wide range of applications. Since the introduction of 100 Gigabit Ethernet (GE), a single-channel transmission rate of 25Gb / s has been used for data transmission. In order to correct errors in the received data, the physical layer introduces FEC coding, and then transmits the encoded FEC codeword. For example, when using a 100G channel for data transmission, the transmitter can use Reed-Solomon (RS) (528, 514) to perform FEC encoding on the original data. The encoded RS codeword block includes a 5140-bit payload and a 140-bit check code. Due to the existence of the check code, the transmission rate required to transmit the FEC codeword is higher than the transmission rate required to transmit the original data, compared to the transmission rate required to transmit the same payload in the same time.
[0093] In order to reduce the transmission rate required to transmit FEC codewords, the Ethernet standard uses transcoding to reduce the overhead of the code blocks before FEC encoding. For example, every four 64B / 66B encoded code blocks are transcoded into one 256B / 257B encoded code block. Since the overhead of a 257-bit code block is lower than the overhead of four 66-bit code blocks, the transmission rate required to transmit the FEC codewords based on the 257-bit code blocks is relatively low. When using a 100G channel for data transmission, the transmission rate required to transmit the FEC codewords based on the transcoded code blocks is 103.125Gb / s, which is the same transmission rate as the transmission rate required to transmit the 66-bit code blocks without FEC encoding.
[0094] After receiving the FEC codeword, the receiver can perform error correction on it. Since error detection can be achieved through FEC error marking, and most processing in the PCS is based on 257-bit code blocks, the 64B / 66B encoding process and the corresponding transcoding process will generate unnecessary delay, power consumption, and chip area.
[0095] In this regard, the embodiment of the present application provides a data transmission method to solve the above problem. In the embodiment of the present application, a data transmission method comprising a control block and a data block is provided. n (n is an integer greater than 1) The first encoding is performed on the group code stream block to obtain the target code block, without having to encode the 2 n Each group of code stream blocks in the group code stream block is 64B / 66B encoded, and then 2 n The target code block is obtained by transcoding 66-bit code blocks. As a result, the coding efficiency is improved and the latency, power consumption and chip area occupied by the coding process are reduced.
[0096] When the method provided in the embodiment of the present application performs the first decoding on the target code block, the target code block can be directly first decoded to obtain 2 blocks including the control block and the data block. n The group code stream block does not need to be transcoded to obtain 2 n 66-bit code blocks, and then 2 n The 66-bit code blocks are decoded to obtain 2 n As a result, decoding efficiency is improved, and the latency, power consumption, and chip area occupied by the decoding process are reduced.
[0097] The encoding method and decoding method provided in the embodiments of the present application can be applied to the current Ethernet interface or other scenarios where data needs to be transmitted. Taking the implementation scenario shown in Figure 1 as an example, the implementation scenario includes multiple chips, and each chip can exchange information to realize data transmission. For example, the first network device 101 is provided with a chip 102, and the second network device 103 is provided with a chip 104. Both chips 102 and 104 support FEC encoding and FEC decoding, and the channel 105 between the first network device 101 and the second network device 103 can transmit FEC-encoded data. Then chip 102 can perform FEC encoding and decoding on the first network device 101 and the second network device 103. n The first encoding is performed on the group code stream block to obtain a target code block, the second encoding is performed on the target code block according to the first FEC code type to obtain the first data, and the first data is sent to the chip 104 through the channel 105. For example, the first data may have errors when being transmitted in the channel 105. The received data is referred to as the second data. After receiving the second data, the chip 104 can use the first FEC code type to perform a second decoding on the second data to obtain the target code block, and perform the first decoding on the target code block to obtain the second data. n wherein n is an integer greater than 1, and the first FEC code type includes, but is not limited to, any one or a concatenated combination of multiple types of codes, including RS code, Bose-Chaudhuri-Hocquenghem (BCH) code, Hamming code, extended-BCH code, extended-Hamming code, Fire code, turbo code, turbo product code (TPC), staircase code, and low-density parity-check (LDPC) code.
[0098] It is understandable that the implementation scenario shown in FIG1 may include multiple network devices, each of which may include at least one chip. FIG1 only uses two network devices, each of which includes one chip, as an example for illustration.
[0099] In conjunction with the implementation scenario shown in Figure 1, the encoding method provided in the embodiment of the present application is shown in Figure 2. Exemplarily, the encoding method provided in the embodiment of the present application is executed by the chip 102 in Figure 1, and the method includes but is not limited to steps 201 and 202.
[0100] Step 201, get 2 n A group of codestream blocks, where any group of codestream blocks includes a control block and a data block, and n is an integer greater than 1.
[0101] In one possible implementation, 2 n The group code stream blocks are all from MII. n For example, MII can adopt the Institute of Electrical and Electronics Engineers (IEEE) 802.3 standard, such as IEEE802.3-2018 and other versions of IEEE802.3 standard defined MII, to obtain 2 n For example, the value of n is 2, which means four groups of code stream blocks are obtained.
[0102] For example, for 2 n For any group of codestream blocks in a group of codestream blocks, the control block of the group of codestream blocks comprises m bits, and the data block of the group of codestream blocks comprises 8m bits, where m is a positive integer. Here, 8m represents 8 times m, and can also be expressed as 8*m. Exemplarily, the value of m is 8, meaning that for any group of codestream blocks, the control block of the group of codestream blocks comprises 8 bits, and the data block of the group of codestream blocks comprises 64 bits. In one possible implementation, the m bits of the control block are all control bits, meaning that the control block comprises m control bits; and the 8m bits of the data block are all data, meaning that the data block comprises 8m bits of data.
[0103] For example, a control block including 8 control bits is represented as TXC<7:0>, and a data block including 64 bits of data is represented as TXD<63:0>. The order of the bits in the control block and the data block is from the most significant bit (MSB) to the least significant bit (LSB).
[0104] Step 202, for 2 n The first encoding is performed on the group code stream block to obtain the target code block, which includes the target code block based on 2 n The control block of the group codestream block determines the type and is based on 2 nThe control block and data block of the group codestream block determine the data unit.
[0105] For example, each group of codestream blocks has an 8-bit control block and a 64-bit data block. A first encoding is performed on four groups of codestream blocks to obtain a 257-bit target codeblock. This embodiment of the present application uses n=2 as an example. When n is other values, the first encoding process can be performed on each of four groups of codestream blocks to obtain multiple target codeblocks. For example, if n=3, meaning eight groups of codestream blocks are obtained, the first four groups of codestream blocks can be first encoded to obtain a target codeblock, and the second four groups of codestream blocks can be first encoded to obtain a target codeblock.
[0106] In one possible implementation, n The group code stream block is first encoded to obtain a target code block including but not limited to the following encoding method 1 and encoding method 2.
[0107] Encoding method 1, based on 2 n The control block of the group code stream block determines the type of the target code block as a data code block; based on 2 n The order of the group codestream blocks is 2 n The data blocks of the group code stream block are first encoded to obtain data units; and a target code block is obtained based on the type and the data unit.
[0108] For example, for a target code block obtained by using encoding mode 1, the type is used to indicate that the target code block is a data code block; the data unit is based on 2 n The order of the group codestream blocks is 2 n The data blocks of the group code stream blocks are obtained by performing first encoding.
[0109] In one possible implementation, n When the control blocks of each group of codestream blocks are all represented by the first specified value, the type of the target codestream block is determined to be a data codestream block. The first specified value is used to indicate that the type of the codestream block is a data codestream block. For example, taking the control blocks of each group of codestream blocks as represented by TXC<7:0> and the first specified value as 0x00 as an example, when TXC<7:0> of each group of codestream blocks is all 0x00, the type of each group of codestream blocks is a data codestream block.
[0110] In one possible implementation, based on 2 n The order of the group codestream blocks is 2 n The data block of the group code stream block is first encoded to obtain a data unit, including: based on 2 n The order of the group code stream blocks is 2 n The bits included in the data block of the group codestream block are used as bits of the data unit to obtain the data unit.
[0111] For example, j represents the sequence number of the four groups of code stream blocks, j = 0, 1, 2 or 3. TXD_j<63:0> represents the data block of the jth group of code stream blocks, tx_coded<256:0> represents the target code block, wherein tx_coded <0> Indicates the type of the target code block, tx_coded<(64j+64):(64j+1)> represents the (64j+64)th bit to the (64j+1)th bit of the target code block, and the respective bits of tx_coded<256:0> are as shown in Expressions 1 and 2 below:
[0112] tx_coded <0> =1 (Expression 1)
[0113] tx_coded<(64j+64):(64j+1)>=TXD_j<63:0>, j=0, 1, 2, or 3 (Expression 2)
[0114] In Expression 1, tx_coded <0> =1 indicates that the type is a data code block. In Expression 2, tx_coded<(64j+64):(64j+1)>=TXD_j<63:0> indicates that multiple bits of the data block of each group of code stream blocks are used as multiple bits of the data unit.
[0115] For example, when j = 0, tx_coded<64:1> = TXD_0<63:0>, indicating that bits 63 to 0 of the data block of the 0th group of codestream blocks are used as bits 64 to 1 of the target codeblock, respectively. When j = 1, tx_coded<128:65> = TXD_1<63:0>, indicating that bits 63 to 0 of the data block of the 1st group of codestream blocks are used as bits 128 to 65 of the target codeblock, respectively. When j = 2, tx_coded<192:129> = TXD_2<63:0>, indicating that bits 63 to 0 of the data block of the 2nd group of codestream blocks are used as bits 192 to 129 of the target codeblock, respectively. When j=3, tx_coded<256:193>=TXD_3<63:0>, indicating that the 63rd bit to the 0th bit of the data block of the third group of code stream blocks are used as the 256th bit to the 193rd bit of the target code block respectively.
[0116] Exemplarily, FIG3 shows a schematic diagram of a process for obtaining a target code block. As shown in FIG3 , for the four groups of code stream blocks obtained, the control blocks of each group of code stream blocks are represented as TXC<7:0>, and the data blocks are represented as TXD<63:0>. The TXC<7:0> of the four groups of code stream blocks are all 0x00, and the type of the target code block is a data code block. Exemplarily, the type of the target code block corresponds to the 0th bit of the target code block, and the 0th bit is assigned a value of 1 to indicate that the type is a data code block. The embodiment of the present application does not limit the manner in which the 0th bit is assigned to indicate that the type is a data code block. Based on the order of the four groups of code stream blocks, multiple bits of the data blocks of the four groups of code stream blocks are respectively used as multiple bits of the data unit to obtain the data unit. Thus, the target bit can be obtained based on the type and the data unit.
[0117] For example, the structure of the target code block obtained is shown in FIG4 . Bit 0 of the target code block is used to indicate the type of the target code block. A value of 1 in bit 0 indicates that the target code block is a data code block. Bits 1 to 256 of the target code block are used to indicate the data unit of the target code block, where D0 represents 64 bits of the data block of the 0th group of codestream blocks, D1 represents 64 bits of the data block of the 1st group of codestream blocks, D2 represents 64 bits of the data block of the 2nd group of codestream blocks, and D3 represents 64 bits of the data block of the 3rd group of codestream blocks.
[0118] Encoding method 2, based on 2 n The control block of the group code stream block determines the type of the target code block as a control code block; based on 2 n The control block of the group code stream block, get 2 n The identification value of the group code stream block is used to indicate the type of code stream block; n The identification value of the group code stream block is used as a type indicator; based on 2 n The control block and data block of the group code stream block determine the order of 2 n A first encoding is performed on a data block of the group code stream block to obtain code block content; and a target code block is obtained based on a type and a data unit, wherein the data unit includes a type indicator and code block content.
[0119] For example, the target code block obtained by using the second encoding method includes a type and a data unit. The type is used to indicate that the target code block is a control code block; the data unit includes a type indication and code block content. The code block content is based on 2 n The control block and data block of the group code stream block determine the order of 2 n The data block of the group code stream block is first encoded, and the type indication is based on 2 n The control block of the group code stream block is obtained, and the type indication is used to indicate the type of each group code stream block. For example, 2 n The order of the control block and data block of the group code stream block is 2 nThe order in which the codestream blocks are received.
[0120] In one possible implementation, 2 n The control block of at least one of the code stream blocks in the group of code stream blocks is a second specified value, and the type of the target code block can be determined to be a control code block by the second specified value. The second specified value is used to indicate that the type of the code stream block is a control code stream block, and the second specified value is different from the first specified value. That is, in 2 n If at least one of the groups of codestream blocks is a control codestream block, the target codeblock is a control codeblock. For example, if the control blocks of all groups of codestream blocks are represented by TXC<7:0> and the first specified value is 0x00, then if TXC<7:0> of one of the groups of codestream blocks is not 0x00, the target codeblock is a control codeblock.
[0121] For example, for 2 n For a group of code stream blocks in a group of code stream blocks, if the type of the code stream blocks is a data code stream block, the identification value of the group of code stream blocks is a third specified value; if the type of the code stream blocks is a control code stream block, the identification value of the group of code stream blocks is a fourth specified value. For example, the third specified value is 1 and the fourth specified value is 0. For example, 2 n The identification value of the group code stream block is used as a type indicator, including: n The control block and data block of the group code stream block determine the order, and 2 n The identification values of the group code stream blocks are respectively used as bits of the type indication to obtain the type indication.
[0122] For example, based on 2 n The control block and data block of the group code stream block determine the order of 2 n The data block of the group code stream block is first encoded to obtain the code block content, including: based on 2 n The control block and data block of the group code stream block determine the order of 2 n The data blocks of the group code stream blocks are first encoded to obtain the first-encoded content of each group code stream block, and the first-encoded content of each group code stream block is used as the code block content.
[0123] In one possible implementation, for 2 n A group of code stream blocks of the type data code stream block (TXC<7:0>=0x00) in the group code stream block, the content of which after the first encoding is the content of the data block of the group code stream block. n A group of codestream blocks of the control codestream block type in the group of codestream blocks, according to the control blocks and data blocks of the group of codestream blocks, the contents of the group of codestream blocks after the first encoding include but are not limited to the following cases A1 to A11.
[0124] In case A1, the control block is 0x01, and the 7th to 0th bits of the data block are 0xFB, where the LSB is the bit sent first.
[0125] Exemplarily, for case A1, the data block includes one control byte and seven data bytes, where a data byte is also referred to as an octet. If the codestream block is the first control codestream block, the first encoded content of the codestream block is 60 bits, the first four bits of which are the block type field (BTF), and the BTF is 0x8. If the codestream block is not the first control codestream block, the first encoded content of the codestream block is 64 bits, the first eight bits of which are the BTF, and the BTF is 0x78. In either case, the remaining 56 bits are the bits of the seven data bytes included in the data block.
[0126] Case A2, the control block is 0xFF, and the (k+7)th bit to the kth bit of the data block are at least one of 0x06, 0x07 or 0xFE, k = 0, 1, 2, 3, 4, 5, 6 or 7, where the LSB is the bit sent first.
[0127] For example, in case A2, the data block includes 8 control bytes. If the codestream block is the first control codestream block, the first coded content of the codestream block is 60 bits, with the first 4 bits being the BTF portion, which is 0xE. If the codestream block is not the first control codestream block, the first coded content of the codestream block is 64 bits, with the first 8 bits being the BTF portion, which is 0x1E. In either case, the remaining 56 bits are bits 0 to 6 of the 8 control bytes included in the data block.
[0128] In case A3, the control block is 0x01, and the 7th to 0th bits of the data block are 0x9C, where the LSB is the bit sent first.
[0129] Exemplarily, for case A3, the data block includes 1 control byte and 7 data bytes. When the group of code stream blocks is the first group of control code stream blocks, the content of the group of code stream blocks after the first encoding is 60 bits, the first 4 bits of which are the BTF part, and the BTF part is 0xB. When the group of code stream blocks is not the first group of control code stream blocks, the content of the group of code stream blocks after the first encoding is 64 bits, the first 8 bits of which are the BTF part, and the BTF part is 0x4B. In either of the above cases, the 24 bits after the BTF part are the 31st to 8th bits of the data block. The 4 bits after the data byte are the O code (O code), which can be obtained according to the IEEE802.3 standard. Exemplarily, the remaining 28 bits are multiple first padding bits, wherein the multiple first padding bits can be obtained based on the data bytes of the data block, or the multiple first padding bits are all 0.
[0130] In case A4, the control block is 0xFF, and the 7th to 0th bits of the data block are 0xFD, where the LSB is the bit sent first.
[0131] For example, in case A4, the data block includes 8 control bytes. If the codestream block is the first control codestream block, the first coded content of the codestream block is 60 bits, with the first 4 bits being the BTF portion, which is 0x7. If the codestream block is not the first control codestream block, the first coded content of the codestream block is 64 bits, with the first 8 bits being the BTF portion, which is 0x87. In either case, the 7 bits following the BTF portion are all 0, and the remaining 49 bits are bits 6 to 0 of the last 7 control bytes included in the data block.
[0132] In case A5, the control block is 0xFE, and the 15th to 8th bits of the data block are 0xFD, where the LSB is the bit sent first.
[0133] For example, in case A5, the data block includes one data byte and seven control bytes. If the codestream block is the first control codestream block, the first coded content of the codestream block is 60 bits, with the first four bits being the BTF portion, which is 0x9. If the codestream block is not the first control codestream block, the first coded content of the codestream block is 64 bits, with the first eight bits being the BTF portion, which is 0x99. In either case, the eight bits following the BTF portion are the bits of the data bytes included in the data block, the six bits following the data bytes are all 0, and the remaining 42 bits are bits 6 to 0 of the last six control bytes included in the data block.
[0134] In case A6, the control block is 0xFC, and the 23rd to 16th bits of the data block are 0xFD, where the LSB is the bit sent first.
[0135] For example, in case A6, the data block includes 2 data bytes and 6 control bytes. If the codestream block is the first control codestream block, the content of the codestream block after the first encoding is 60 bits, the first 4 bits of which are the BTF portion, and the BTF portion is 0xA. If the codestream block is not the first control codestream block, the content of the codestream block after the first encoding is 64 bits, the first 8 bits of which are the BTF portion, and the BTF portion is 0xAA. In either case, the 16 bits after the BTF portion are the bits of the 2 data bytes included in the data block, the 5 bits after the data bytes are all 0, and the remaining 35 bits are bits 6 to 0 of the last 5 control bytes included in the data block.
[0136] In case A7, the control block is 0xF8, and the 31st to 24th bits of the data block are 0xFD, where the LSB is the bit sent first.
[0137] For example, for case A7, the data block includes 3 data bytes and 5 control bytes. If the codestream block is the first control codestream block, the content of the codestream block after the first encoding is 60 bits, the first 4 bits of which are the BTF portion, and the BTF portion is 0x4. If the codestream block is not the first control codestream block, the content of the codestream block after the first encoding is 64 bits, the first 8 bits of which are the BTF portion, and the BTF portion is 0xB4. In either case, the 28 bits after the BTF portion are the bits of the 3 data bytes included in the data block, the 4 bits after the data bytes are all 0, and the remaining 28 bits are bits 6 to 0 of the last 4 control bytes included in the data block.
[0138] In case A8, the control block is 0xF0, and the 39th to 32nd bits of the data block are 0xFD, where the LSB is the bit sent first.
[0139] For example, in case A8, the data block includes 4 data bytes and 4 control bytes. If the codestream block is the first control codestream block, the content of the codestream block after the first encoding is 60 bits, the first 4 bits of which are the BTF portion, and the BTF portion is 0xC. If the codestream block is not the first control codestream block, the content of the codestream block after the first encoding is 64 bits, the first 8 bits of which are the BTF portion, and the BTF portion is 0xCC. In either case, the 32 bits after the BTF portion are the bits of the 4 data bytes included in the data block, the 3 bits after the data bytes are all 0, and the remaining 21 bits are bits 6 to 0 of the last 3 control bytes included in the data block.
[0140] In case A9, the control block is 0xE0, and the 47th to 40th bits of the data block are 0xFD, where the LSB is the bit sent first.
[0141] For example, for case A9, the data block includes 5 data bytes and 3 control bytes. If the codestream block is the first control codestream block, the content of the codestream block after the first encoding is 60 bits, the first 4 bits of which are the BTF portion, and the BTF portion is 0x2. If the codestream block is not the first control codestream block, the content of the codestream block after the first encoding is 64 bits, the first 8 bits of which are the BTF portion, and the BTF portion is 0xD2. In either case, the 32 bits after the BTF portion are the bits of the 5 data bytes included in the data block, the 2 bits after the data bytes are both 0, and the remaining 12 bits are bits 6 to 0 of the last 2 control bytes included in the data block.
[0142] In case A10, the control block is 0xC0, and the 55th to 48th bits of the data block are 0xFD, where the LSB is the bit sent first.
[0143] Exemplarily, for case A10, the data block includes 6 data bytes and 2 control bytes. If the codestream block is the first control codestream block, the content of the codestream block after the first encoding is 60 bits, the first 4 bits of which are the BTF portion, and the BTF portion is 0x1. If the codestream block is not the first control codestream block, the content of the codestream block after the first encoding is 64 bits, the first 8 bits of which are the BTF portion, and the BTF portion is 0xE1. In either case, the 48 bits after the BTF portion are the bits of the 6 data bytes included in the data block, the bit after the data byte is 0, and the remaining 7 bits are bits 6 to 0 of the last control byte included in the data block.
[0144] In case A11, the control block is 0x80, and the 63rd to 56th bits of the data block are 0xFD, where the LSB is the bit sent first.
[0145] For example, in case A11, the data block includes 7 data bytes and 1 control byte. If the codestream block is the first control codestream block, the content of the codestream block after the first encoding is 60 bits, the first 4 bits of which are the BTF portion, and the BTF portion is 0xF. If the codestream block is not the first control codestream block, the content of the codestream block after the first encoding is 64 bits, the first 8 bits of which are the BTF portion, and the BTF portion is 0xFF. In either case, the remaining 56 bits are the bits of the 7 data bytes included in the data block.
[0146] Therefore, based on 2 n The control block and data block of the group code stream block determine the order, and 2 n The content of the group code stream block after the first encoding is used as the code block content. Thus, the target code block can be obtained based on the type, type indicator and code block content.
[0147] For example, j represents the sequence number of the four groups of code stream blocks, j = 0, 1, 2 or 3. TXC_j<7:0> represents the control block of the jth group of code stream blocks, tx_payload<251:0> represents the content of the four groups of code stream blocks after the first encoding, and tx_coded<256:0> represents the target code block, where tx_coded <0> Indicates the type of target code block, tx_coded<j+1> Indicates the type of the target code block, tx_coded<256:5> indicates the code block content of the target code block, and the bits of tx_coded<256:0> are as shown in Expressions 3 to 5 below:
[0148] tx_coded <0> =0 (Expression 3)
[0149]
[0150] tx_coded<256:5>=tx_payload<251:0> (Expression 5)
[0151] In Expression 3, tx_coded <0> = 0 indicates that the type is a control code block. In Expression 4, when TXC_j<7:0> is not 0x00, the bit of the target code block corresponding to the j value is 0. When TXC_j<7:0> is 0x00, the bit of the target code block corresponding to the j value is 1. In Expression 5, tx_coded<256:5> = tx_payload<251:0> indicates that multiple bits of the content of the four groups of code stream blocks after the first encoding are used as multiple bits of the code block content.
[0152] Exemplarily, the structure of the target code block is shown in FIG5 , where 0 to 3 in FIG5 represent the serial numbers of the four groups of code stream blocks, respectively. The left side of FIG5 shows the types of the four groups of code stream blocks obtained, C represents the control code stream block, and D represents the data code stream block. The right side of FIG5 shows the structure of the target code block obtained in different situations, where b represents a bit, for example, 1b represents 1 bit, and 4b represents 4 bits. Exemplarily, situation 1 in FIG5 corresponds to that the types of the four groups of code stream blocks are all control code stream blocks, and the 0th bit of the target code block obtained by the first encoding is 0, and the 4th bit to the 1st bit are all 0; the 8th bit to the 5th bit are represented as f_0, corresponding to the BTF part of the content of the 0th group of code stream blocks after the first encoding, and the 64th bit to the 9th bit correspond to the rest of the content of the 0th group of code stream blocks after the first encoding, that is, C0; the 72nd bit to the 65th bit are represented as BTF1, corresponding to the BTF part of the content of the 1st group of code stream blocks after the first encoding, and the 128th bit to the 73rd bit correspond to the The remaining content of the first group of codestream blocks after the first encoding is C1; bits 136 to 129 are represented as BTF2, corresponding to the BTF part of the second group of codestream blocks after the first encoding; bits 192 to 137 correspond to the remaining content of the second group of codestream blocks after the first encoding, that is, C2; bits 200 to 193 are represented as BTF3, corresponding to the BTF part of the third group of codestream blocks after the first encoding; bits 256 to 201 correspond to the remaining content of the fourth group of codestream blocks after the first encoding, that is, C3. The remaining cases in FIG5 are similar in principle to those in Case 1 above. For example, in Case 2, bits 68 to 5 of the target code block are represented as D0, corresponding to the first-coded content of the 0th group of codestream blocks; bits 72 to 69 are represented as f_1, corresponding to the BTF portion of the first-coded content of the 1st group of codestream blocks; bits 128 to 73 correspond to the remaining content of the first-coded content of the 1st group of codestream blocks, namely, C1. The other cases in FIG5 are not further described here.
[0153] In a possible implementation, the target code block is an error code block, and the error code block includes data for identifying an error. n When a group of code stream blocks in the group code stream block does not belong to the data code stream block, nor does it belong to any of the above cases A1 to A11, the target code block is determined to be an error code block; based on 2 n The control block of the group code stream block, get 2 n The type of group codestream block, based on 2 nThe type of the group codestream block is used to obtain the type indicator of the target codestream block. The type and type indicator serve as error identification data in the error codeblock. For example, if bit 0 of the target codeblock corresponds to the type, and bits 1 to 4 correspond to the type indicator, bit 0 is assigned a value of 0, and bits 1 to 4 are all assigned a value of 1.
[0154] Exemplarily, when the target code block is an error code block, the structure of the target code block is shown in Figure 6. The left side of Figure 6 shows the types of the four groups of codestream blocks obtained, with E representing an error codestream block. The right side of Figure 6 shows the structure of the target code block. Bit 0 of the target code block is 0, bits 1 through 4 are all 1, bits 5 through 64 correspond to padding content obtained based on the first group of codestream blocks, bits 65 through 128 correspond to padding content obtained based on the second group of codestream blocks, bits 129 through 192 correspond to padding content obtained based on the third group of codestream blocks, and bits 193 through 256 correspond to padding content obtained based on the fourth group of codestream blocks. Exemplarily, all bits of the padding content are 0. Exemplarily, the padding content obtained based on the first group of codestream blocks is denoted as E0, the padding content obtained based on the second group of codestream blocks is denoted as E1, the padding content obtained based on the third group of codestream blocks is denoted as E2, and the padding content obtained based on the fourth group of codestream blocks is denoted as E3.
[0155] Since the encoding method provided in the embodiment of the present application can perform first encoding on different types of code stream blocks to obtain target code blocks, the method has wide applicability.
[0156] In one possible implementation, n The first encoding of the group code stream block is performed to obtain the target code block, including: n The control block and data block of the group code stream block obtain the error detection result; based on the error detection result, n The group code stream block is processed and the processed 2 n The first coding is performed on the group code stream block to obtain the target code block. That is, the target code block is based on the error detection result of 2 n The error detection result is based on 2 n The control block and data block of the group codestream block are obtained.
[0157] For example, based on 2 n The control block and data block of the group code stream block obtain error detection results, including: based on 2 n The control block and data block of the group code stream block are obtained by 2 n The content and order of the codestream blocks are based on 2 n The error detection result is obtained by combining the content and content order of the code stream block. For example, when 2 nWhen the content sequence of the group code stream block is at least one of the first error condition set, the 2 n The content order of the group code stream block is wrong. n When the content sequence of the group code stream block is not any of the cases in the first error case set, the 2 n The content order of the group code stream block is correct. For example, when 2 n When the content of the group code stream block is at least one of the second error condition set, the 2 n The content of the group code stream block is wrong. n When the content of the group code stream block is not any of the cases in the second error case set, the 2 n The content of the group codestream block is correct.
[0158] In a possible implementation, taking two adjacent groups of code stream blocks as an example, the first error condition set includes but is not limited to the following four conditions:
[0159] (1) When the first group of code stream blocks includes the start control word ( / S / ), the second group of code stream blocks includes other contents except data bytes.
[0160] (2) In the case where the first group of code stream blocks includes only data bytes, the second group of code stream blocks includes other contents except data bytes or termination control word ( / T / ).
[0161] (3) In the case where the previous group of codestream blocks includes the termination control word, the next group of codestream blocks includes other contents except the idle control word ( / I / ) or the sequence ordered set control word ( / O / ).
[0162] (4) In the case where the first group of code stream blocks includes idle control words or sequence ordered set control words, the second group of code stream blocks includes data bytes or termination control words.
[0163] In a possible implementation, taking a group of code stream blocks as an example, the second error condition set includes but is not limited to the following four conditions:
[0164] (1) For a code stream block including a start control word, the start control word is followed by other content except data bytes.
[0165] (2) For a code stream block that includes data bytes, the data bytes are followed by other content except the data bytes or the termination control word.
[0166] (3) For a code stream block including a termination control word, the termination control word is followed by other content except the idle control word or the sequence ordered set control word.
[0167] (4) For a code stream block including an idle control word or a sequence ordered set control word, the idle control word or the sequence ordered set control word is followed by a data byte or a termination control word.
[0168] Exemplarily, the error detection result includes 2 n The content order or content of the group code stream block is wrong, based on 2 n The content sequence of the group code stream block is wrong or the content of the code stream block is wrong, and the error block is obtained. n The code stream blocks with correct content and correct content in the group code stream blocks and the error blocks are first encoded to obtain the target code blocks. That is, when the error detection result includes 2 n If the content sequence or content of the group code stream block is wrong, the target code block is based on 2 n The content sequence of the group code stream block is correct and the content of the code stream block and the error block are first encoded. The error block is based on 2 n The code stream blocks with wrong content sequence or wrong content in the group code stream blocks are obtained. Exemplarily, the error block includes an error control character.
[0169] In one possible implementation, for a codestream block with incorrect content sequence or content errors, the content of the codestream block is converted into an error control word to obtain an error block. For example, if the codestream block with incorrect content sequence or content errors is a first group of codestream blocks, the content of the codestream block is converted into a first error control word. The first error control word is 60 bits, with the first 4 bits being 0xE and every subsequent 7 bits being 0x1E. For another example, if the codestream block with incorrect content sequence or content errors is at least one of a second group of codestream blocks, a third group of codestream blocks, or a fourth group of codestream blocks, the content of the codestream block is converted into a second error control word. The second error control word is 64 bits, with the first 8 bits being 0x1E and every subsequent 7 bits being 0x1E.
[0170] For example, for 2 n The code stream blocks with correct content order and error blocks in the group code stream blocks are first encoded to obtain the target code block, including: determining the type of the target code block as a control code block; obtaining 2 n The identification value of the group code stream block is used to indicate the type of code stream block. n The identification value of the group code stream block is used as a type indicator; based on 2 n The control block and data block of the group code stream block determine the order of error blocks and 2 n The data blocks of the code stream blocks with correct content and correct content in the group code stream blocks are first encoded to obtain code block content.
[0171] For example, based on 2 n The control block and data block of the group code stream block determine the order of 2 nThe data blocks of the codestream blocks with correct content and correct content in the group codestream blocks are first encoded to obtain the first-encoded content of the codestream blocks with correct content and correct content. The target codeblock is obtained based on the first-encoded content of the codestream blocks with correct content and correct content and the error blocks. Regarding the method for first encoding the data blocks of the codestream blocks with correct content and correct content, please refer to the previous section regarding first encoding of codestream blocks of the data codestream block type and codestream blocks of the control codestream block type, and will not be repeated here.
[0172] For example, in 2 n When all the groups of code stream blocks in the group code stream block are code stream blocks with wrong content sequence or wrong content, based on 2 n The group code stream block gets 2 n Error blocks, for which n The first encoding is performed on the error blocks to obtain a target code block, and the target code block is an error code block.
[0173] By processing the erroneous code stream blocks, the erroneous data can be distinguished from the correct data during subsequent data transmission, thereby ensuring the reliability of the data.
[0174] Illustratively, after obtaining the target code block, the method further includes: performing a second encoding on the target code block according to an FEC code pattern to obtain first data; and transmitting the first data. The embodiment of the present application does not limit the manner in which the target code block is secondarily encoded according to the FEC code pattern. By performing a second encoding on the target code block according to the FEC code pattern to obtain the first data, the receiving end can perform error correction on the received first data, thereby ensuring the accuracy of data transmission.
[0175] The encoding method provided in the embodiment of the present application includes a control block and a data block. n The first encoding of the group code stream block is performed to obtain the target code block, without having to n Each group of code stream blocks in the group code stream block is 64B / 66B encoded to obtain 2 n 66-bit code blocks, and then 2 n The target code block is obtained by transcoding 66-bit code blocks. As a result, the coding efficiency is improved and the latency, power consumption and chip area occupied by the coding process are reduced.
[0176] The above describes the encoding method provided by the embodiment of the present application. The following describes the decoding method provided by the embodiment of the present application. In conjunction with the implementation scenario shown in Figure 1, the decoding method provided by the embodiment of the present application is shown in Figure 7. For example, the decoding method provided by the embodiment of the present application is performed by chip 104 in Figure 1, and the method includes but is not limited to steps 701 and 702.
[0177] Step 701: Obtain a target code block, where the target code block includes a type and a data unit.
[0178] For example, in combination with the implementation scenario of Figure 1, chip 102 sends first data encoded using FEC code type to chip 104 through channel 105. During the data transmission process, errors may occur in the first data. The data with errors is called second data, and chip 104 receives the second data through channel 105.
[0179] In a possible implementation, obtaining the target code block includes but is not limited to the following method A and method B.
[0180] Mode A: receiving second data, where the second data is obtained based on first data encoded using an FEC code type; performing a second decoding on the second data to obtain a target code block, where the second decoding is error correction processing.
[0181] Exemplarily, the target code block is an error code block obtained by performing error correction on the second data but failing to perform error correction. For example, performing a second decoding on the second data to obtain the target code block includes: processing the second data according to the FEC code pattern to obtain a first codeword, performing error correction on the first codeword, and obtaining the target code block based on the error correction result.
[0182] Exemplarily, chip 104 has an FEC decoder function. When the FEC decoder determines that the number of bit errors exceeds the FEC decoder's error correction capability, that is, when the FEC decoder determines that it cannot correct errors in the first codeword, all code blocks in the first codeword are marked as error blocks. Therefore, if the error correction process results in all code blocks in the first codeword being marked as error blocks, the obtained target code block is an error block.
[0183] Exemplarily, when the result of the error correction processing is that the first codeword is successfully corrected, the code block obtained based on the first codeword after error correction is used as the acquired target code block, and the code block obtained based on the first codeword after error correction is the code block with successful error correction.
[0184] Mode B, receiving second data, the second data is obtained based on the first data encoded using the forward error correction FEC code type; performing a second decoding on the second data to obtain a target code block, the second decoding is error detection but not error correction processing.
[0185] Exemplarily, the target code block is an error code block obtained by detecting errors in the second data without correcting them. For example, performing a second decoding on the second data to obtain the target code block includes: processing the second data according to the FEC code pattern to obtain a first codeword, performing error detection without error correction (bypass correction) on the first codeword; and obtaining the target code block based on the result of the error detection without error correction.
[0186] Exemplarily, chip 104 has an FEC decoder function. When the FEC decoder detects an error in the first codeword, it marks all code blocks in the first codeword as error blocks. Thus, if the result of error detection but not error correction is to mark all code blocks in the first codeword as error blocks, the obtained target code block is an error block.
[0187] Exemplarily, when the result of error detection but not error correction processing is that the first codeword is error-free, the code block obtained based on the first codeword is used as the acquired target code block, and the code block obtained based on the first codeword is an error-free code block.
[0188] Exemplarily, a frame check sequence (FCS) based on a target code block fails. For example, the target code block is 257 bits, the first 5 bits are 01111, and the remaining 252 bits include, but are not limited to, the following three situations: (1) the first 4 bits are 0x1, and every 8 bits of the remaining bits are 0x1E; (2) every 8 bits of the first 248 bits are 0x1E, and the last 4 bits are 0x1; (3) all bits are 0.
[0189] Step 702: Perform a first decoding on the target code block according to the type and data unit of the target code block to obtain 2 n A group of codestream blocks, where any group of codestream blocks includes a control block and a data block obtained based on the type and the data unit, and n is an integer greater than 1.
[0190] For example, the target code block is 257 bits, the control block of each group of code stream blocks is 8 bits, and the data block is 64 bits. Take the example of performing the first decoding on one target code block to obtain four groups of code stream blocks (n=2). When multiple target code blocks are obtained, the first decoding process can be performed on each target code block to obtain 2 n For example, when two target code blocks are obtained, the two code blocks can be first decoded to obtain four groups of code stream blocks, that is, eight groups of code stream blocks can be obtained by first decoding the two target code blocks.
[0191] In a possible implementation, according to the type and data unit of the target code block, the target code block is first decoded to obtain 2 n The group code stream block includes but is not limited to the following decoding methods 1 to 3.
[0192] Decoding method 1: Based on the type of the target code block, the type of the target code block is determined to be a data code block. The data unit of the target code block includes 2 n 8m length content, m is a positive integer; based on the type of the target code block, 2 n The control block of the group code stream block includes 2n The 8m-long contents are first decoded and 2 n The data block of the group codestream block.
[0193] Exemplarily, when the type is used to indicate that the target code block is a data code block, the target code block is first decoded using a decoding method to obtain 2 n The 2 n The data blocks included in the i-th group of code stream blocks are obtained by first decoding the 8m-length content corresponding to the i-th group of code stream blocks in the data unit, where i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n An integer of -1.
[0194] In one possible implementation, the target code block type is 1, indicating that the target code block is a data code block. The data unit of the target code block includes four 8m-long contents, where each 8m-long content corresponds to a group of codestream blocks. For example, the 8m length is 64 bits. The control blocks of the four groups of codestream blocks are all set to 0x00, and the four 64-bit contents are used as the contents of the data blocks of the four groups of codestream blocks.
[0195] For example, j represents the sequence number of the four groups of code stream blocks, j = 0, 1, 2 or 3. RXC_j<7:0> represents the control block of the jth group of code stream blocks, RXD_j<63:0> represents the data block of the jth group of code stream blocks, and rx_coded<256:0> represents the target code block, wherein rx_coded <0> Indicates the type of the target code block, rx_coded<(64j+64):(64j+1)> indicates the (64j+64)th bit to the (64j+1)th bit of the target code block, and the contents of RXC_j<7:0> and RXD_j<63:0> are as shown in Expression 6 and Expression 7 below:
[0196] RXC_j<7:0>=0x00, j=0, 1, 2, or 3 (Expression 6)
[0197] RXD_j<63:0>=rx_coded<(64j+64):(64j+1)>, j=0, 1, 2, or 3 (Expression 7)
[0198] In Expression 6, RXC_j<7:0>=0x00 indicates that the control blocks of each group of code stream blocks are all 0x00, and in Expression 7, RXD_j<63:0>=rx_coded<(64j+64):(64j+1)> indicates that every 64 bits of the data unit are regarded as 64 bits of the data block of a group of code stream blocks.
[0199] For example, when j=0, RXD_0<63:0>=rx_coded<64:1>, indicating that bits 64 to 1 of the target code block are used as bits 63 to 0 of the data block of codestream group 0, respectively. When j=1, RXD_1<63:0>=rx_coded<128:65>, indicating that bits 128 to 65 of the target code block are used as bits 63 to 0 of the data block of codestream group 1, respectively. When j=2, RXD_2<63:0>=rx_coded<192:129>, indicating that bits 192 to 129 of the target code block are used as bits 63 to 0 of the data block of codestream group 2, respectively. When j=3, RXD_3<63:0>=rx_coded<256:193>, indicating that the 256th to 193rd bits of the target code block are used as the 63rd to 0th bits of the data block of the third group of code stream blocks.
[0200] Decoding method 2: Based on the type of the target code block, the type of the target code block is determined to be a control code block. The data unit of the target code block includes a type indication and code block content. The type indication includes 2 n bits, the 2 n One of the bits is used to indicate 2 n The type of a group of code stream blocks corresponding to this bit in the group code stream block. The code block content includes 2 n bit group; based on type, type indication and 2 n The bits corresponding to the group code stream block and the code block content are the same as 2 n The bit group corresponding to the group code stream block is 2 n The control block of the group code stream block is based on the type indication and 2 n The bit pair code block content corresponding to the group code stream block is the same as 2 n The bit group corresponding to the group code stream block is first decoded to obtain 2 n The data block of the group codestream block.
[0201] For example, when the type is used to indicate that the target code block is a control code block, the target code block is first decoded using the second decoding method to obtain 2 n The 2 n The control block included in the i-th group of codestream blocks in the group codestream blocks is obtained based on the type, the bit corresponding to the i-th group of codestream blocks in the type indication, and the bit group corresponding to the i-th group of codestream blocks in the codeblock content, where i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n -1 integer; the 2 nThe data block included in the i-th group of codestream blocks is obtained by first decoding the bit group corresponding to the i-th group of codestream blocks in the codeblock content based on the bit corresponding to the i-th group of codestream blocks in the type indication. Exemplarily, the bit group is a set of multiple bits.
[0202] Exemplarily, when one bit in the type indication is 1, the type of the code stream block obtained based on the bit is a data code stream block; when one bit in the type indication is 0, the type of the code stream block obtained based on the bit is a control code stream block.
[0203] In one possible implementation, 2 n The bit group includes the first bit group and 2 n -1 second bit group, the number of bits included in the first bit group and the number of bits included in the second bit group are different. Exemplarily, one bit of the type indication corresponds to one bit group of the code block content. For example, the structure of the target code block shown in Figure 5 is used for illustration. For case 1, the type indication includes four bits, and the code block content includes four bit groups. Among them, the first bit of the type indication corresponds to the first bit group, and the first bit group is the 5th to 64th bits of the target code block; the second bit of the type indication corresponds to a second bit group, and the second bit group corresponding to the second bit is the 65th to 128th bits of the target code block; the third bit of the type indication corresponds to a second bit group, and the second bit group corresponding to the third bit is the 129th to 192nd bits of the target code block; the fourth bit of the type indication corresponds to a second bit group, and the second bit group corresponding to the fourth bit is the 193rd to 256th bits of the target code block. For case 2, the type indication includes four bits, and the code block content includes four bit groups. The first bit of the type indicator corresponds to a second bit group, and the second bit group corresponding to the first bit is bits 5 to 67 of the target code block; the second bit of the type indicator corresponds to the first bit group, and the first bit group is bits 68 to 128 of the target code block; the third bit of the type indicator corresponds to a second bit group, and the second bit group corresponding to the third bit is bits 129 to 192 of the target code block; the fourth bit of the type indicator corresponds to a second bit group, and the second bit group corresponding to the fourth bit is bits 193 to 256 of the target code block. The principles of the remaining cases are the same as those of Cases 1 and 2 above, and are not repeated here.
[0204] In one possible implementation, for a bit indicating the type, if the bit is 1, the control block of the codestream block obtained based on the type, the bit, and the bit group corresponding to the bit is 0x00, and the content of the data block of the codestream block obtained by first decoding the bit group corresponding to the bit is the content of the bit group. If the bit is 0, based on the position of the bit and the bit group corresponding to the bit, the control block and data block of the codestream block obtained include but are not limited to the following cases B1 to B11.
[0205] In case B1, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x8; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x78.
[0206] For example, for case B1, the bit group corresponding to this bit includes seven data bytes after the BTF portion. The control block of the codestream block is 0x01, and the data block of the codestream block is 64 bits. Bits 7 through 0 of the data block are 0xFB, and the remaining 56 bits represent the seven data bytes of the bit group corresponding to this bit. The LSB is the bit sent first.
[0207] In case B2, the bit is the first 0 bit, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xE; or the bit is not the first 0 bit, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x1E.
[0208] Exemplarily, for case B2, the BTF part of the bit group corresponding to the bit includes 8 control bit groups, and each control bit group includes 7 bits. The control block of the code stream block is 0xFF, and the data block of the code stream block is 64 bits. The 64 bits of the data block are obtained based on 8 control bit groups, wherein each 8 bits of the data block are based on one control bit group. Regarding the method of obtaining each bit of the data block based on each control bit group, the embodiment of the present application does not limit this, for example, it is obtained according to the IEEE802.3 standard. Exemplarily, the (k+7)th bit to the kth bit of the data block are at least one of 0x06, 0x07 or 0xFE, k=0, 1, 2, 3, 4, 5, 6 or 7. Among them, the LSB is the bit sent first.
[0209] In case B3, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xB; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x4B.
[0210] For example, for case B3, the BTF portion of the bit group corresponding to this bit includes three data bytes, a 4-bit O code, and multiple first padding bits. The control block of the code stream block is 0x01, and the data block of the code stream block is 64 bits. Bits 7 to 0 of the data block are 0x9C, bits 31 to 8 of the data block are the bits of the three data bytes, and the remaining 32 bits are obtained based on the multiple first padding bits. The LSB is the bit sent first. The embodiment of the present application does not limit the method of obtaining the remaining 32 bits based on the multiple first padding bits.
[0211] In case B4, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x7; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x87.
[0212] For example, for case B4, the BTF portion of the bit group corresponding to this bit includes a 7-bit termination control word and seven control bit groups, each containing 7 bits. The control block of the codestream block is 0xFF, and the data block of the codestream block is 64 bits. Bits 7 through 0 of the data block are 0xFD, and the remaining 56 bits are derived from the seven control bit groups, where each 8 bits of the remaining 56 bits are derived from one control bit group. The LSB is the bit sent first.
[0213] In case B5, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x9; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x99.
[0214] For example, for case B5, the bit group corresponding to this bit is followed by the BTF portion, which includes one data byte, a 6-bit termination control word, and six control bit groups, each containing 7 bits. The control block of the codestream block is 0xFE, and the data block of the codestream block is 64 bits. Bits 7 to 0 of the data block are the bits of the data byte, bits 15 to 8 of the data block are 0xFD, and the remaining 48 bits are derived from the six control bit groups, where each 8 bits of the remaining 48 bits are derived from one control bit group. The LSB is the bit sent first.
[0215] In case B6, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xA; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xAA.
[0216] For example, for case B6, the bit corresponding to the bit group BTF includes two data bytes, a 5-bit termination control word, and five control bit groups, each containing 7 bits. The control block of the codestream block is 0xFC, and the data block of the codestream block is 64 bits. Bits 15 to 0 of the data block are derived from the bits of the two data bytes, bits 23 to 16 of the data block are 0xFD, and the remaining 40 bits are derived from the five control bit groups, where each 8 bits of the remaining 40 bits are derived from one control bit group. The LSB is the bit sent first.
[0217] Case B7: the bit is the first 0 bit, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x4; or the bit is not the first 0 bit, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xB4.
[0218] For example, for case B7, the BTF portion of the bit group corresponding to this bit includes three data bytes, a 4-bit termination control word, and four control bit groups, each containing 7 bits. The control block of the codestream block is 0xF8, and the data block of the codestream block is 64 bits. Bits 23 to 0 of the data block are derived from the bits of the three data bytes, bits 31 to 24 of the data block are 0xFD, and the remaining 32 bits are derived from the four control bit groups, where each 8 bits of the remaining 32 bits are derived from one control bit group. The LSB is the bit sent first.
[0219] In case B8, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xC; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xCC.
[0220] For example, for case B8, the BTF portion of the bit group corresponding to this bit includes four data bytes, a 3-bit termination control word, and three control bit groups, each containing 7 bits. The control block of the codestream block is 0xF0, and the data block of the codestream block is 64 bits. Bits 31 to 0 of the data block are derived from the bits of the four data bytes, bits 39 to 32 of the data block are 0xFD, and the remaining 24 bits are derived from the three control bit groups, where each 8 bits of the remaining 24 bits are derived from one control bit group. The LSB is the bit sent first.
[0221] In case B9, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x2; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xD2.
[0222] For example, for case B9, the bit corresponding to the bit group BTF portion includes five data bytes, a two-bit termination control word, and two control bit groups, each containing seven bits. The control block of the codestream block is 0xE0, and the data block of the codestream block is 64 bits. Bits 39 to 0 of the data block are derived from the bits of the five data bytes, bits 47 to 40 of the data block are 0xFD, and the remaining 16 bits are derived from the two control bit groups, where each eight bits of the remaining 16 bits are based on one control bit group. The LSB is the bit sent first.
[0223] In case B10, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0x1; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xE1.
[0224] For example, for case B10, the bit corresponding to this bit is followed by the BTF portion of six data bytes, a one-bit termination control word, and a seven-bit control bit group. The control bit of the codestream block is 0xC0, and the data block of the codestream block is 64 bits. Bits 47 to 0 of the data block are derived from the bits of the six data bytes, bits 55 to 48 of the data block are 0xFD, and the remaining eight bits are derived from the control bit group. The LSB is the bit sent first.
[0225] In case B11, the bit is the first bit that is 0, the first 4 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xF; or the bit is not the first bit that is 0, the first 8 bits of the bit group corresponding to the bit are the BTF part, and the BTF part is 0xFF.
[0226] For example, for case B11, the bit corresponding to this bit is followed by the BTF portion of seven data bytes. The control block of the codestream block is 0x80, and the data block of the codestream block is 64 bits. Bits 55 to 0 of the data block are derived from the bits of the seven data bytes, and bits 63 to 56 of the data block are 0xFD. The LSB is the bit that is transmitted first.
[0227] In some embodiments, based on the type, type indication and 2 n The bits corresponding to the group code stream block and the code block content are the same as 2 n The bit group corresponding to the group code stream block is 2 n The control block of the group code stream block is based on the type indication and 2 n The bit pair code block content corresponding to the group code stream block is the same as 2 n The bit group corresponding to the group code stream block is first decoded to obtain 2 n The data blocks of the group code stream block include: n Bit groups get 2 n The third bit group of 64 bits is based on the type, type indication and 2 n The bit sum corresponding to the group code stream block is 2 n The third bit group gets 2 n The control block of the group code stream block is based on the type indication and 2 n Bit pair 2 corresponding to the group code stream block n The third bit group is decoded first to obtain 2 n The data block of the group codestream block.
[0228] Exemplarily, for the first bit that is 0, the bit group corresponding to the bit includes a 4-bit BTF portion, and an 8-bit BTF portion is obtained based on the 4-bit BTF portion to obtain a third bit group. For example, the IEEE 802.3 standard is queried based on the 4-bit BTF portion to obtain the 8-bit BTF portion, or a correspondence table of 4-bit BTF portions and 8-bit BTF portions is queried based on the 4-bit BTF portion to obtain the 8-bit BTF portion.
[0229] In the case of a successful query, that is, the IEEE802.3 standard includes the 8-bit BTF part corresponding to the 4-bit BTF part, or the corresponding table includes the 8-bit BTF part corresponding to the 4-bit BTF part, the 8-bit BTF part is used as the obtained 8-bit BTF part. In the case of a failed query, that is, the IEEE802.3 standard does not include the 8-bit BTF part corresponding to the 4-bit BTF part, or the corresponding table does not include the 8-bit BTF part corresponding to the 4-bit BTF part, the 4-bit BTF part is marked to obtain the 8-bit BTF part. The embodiment of the present application does not limit the method of marking the 4-bit BTF part. For example, the 4-bit BTF part is taken as the 3rd bit to the 0th bit, and the 7th bit to the 4th bit are all set to 0. Exemplarily, in the case of a failed query, the control block of the code stream block obtained based on the third bit group is 0xFF, and the data block is 0xFEFEFEFE.
[0230] In other embodiments, for the first bit that is 0, a control block of the codestream block is obtained based on the type, the bit, and the bit group corresponding to the bit, and a first decoding is performed on the bit group corresponding to the bit based on the bit to obtain the data block of the codestream block, including: querying the 8-bit BTF portion based on the 4-bit BTF portion included in the bit group corresponding to the bit, and if the query fails, setting the control block of the codestream block to 0xFF and the data block of the codestream block to 0xFEFEFEFE. The method of querying the 8-bit BTF portion based on the 4-bit BTF portion is the same as the query method described in the related content above and is not further described here.
[0231] Decoding method three: based on the type and data unit of the target code block, determine the type of the target code block as an error code block; get 2 n The control block and data block of the group code stream block, 2 n The group code stream blocks are all error code stream blocks.
[0232] Exemplarily, the data unit includes a type indication, and the type and the type indication are used to indicate that the target code block is an error code block; n The control block included in each group of code stream blocks in the group code stream block is the first value, 2 n The data block included in each group of code stream blocks in the group code stream block is the second value, and the first value and the second value are used to indicate that the code stream block is an error code stream block. For example, the type of the target code block is 0, the type indication is 1111, and the target code block is an error code block. Then the 2 obtained by the first decoding n The control block of each group code stream block in the group code stream block is 0xFF, 2 n The data blocks included in each group code stream block in the group code stream block are all 0xFEFEFEFE.
[0233] Since the decoding method provided in the embodiment of the present application can first decode different types of target code blocks to obtain 2 n This method has wide applicability.
[0234] In a possible implementation, according to the type and data unit of the target code block, the target code block is first decoded to obtain 2 n The method comprises: obtaining an error detection result based on the type and data unit of the target code block; performing a first decoding on the target code block according to the error detection result and the type and data unit of the target code block, and obtaining 2 n Group code stream block. That is, 2 n The group code stream block is obtained by first decoding the target code block according to the error detection result and the type and data unit of the target code block, wherein the error detection result is obtained based on the type and data unit of the target code block.
[0235] Exemplarily, obtaining an error detection result based on the type and data unit of the target code block includes: obtaining the content and content order of the target code block based on the type and data unit of the target code block, and obtaining the error detection result based on the content and content order of the target code block. For example, when the content order of the target code block is at least one of the cases in the third error condition set, the content order of the target code block is wrong, and when the content order of the target code block is not any of the cases in the third error condition set, the content order of the target code block is correct. For another example, when the content of the target code block is at least one of the cases in the fourth error condition set, the content of the target code block is wrong, and when the content of the target code block is not any of the cases in the fourth error condition set, the content of the target code block is correct.
[0236] In a possible implementation, taking the target code block as a control code block, where the target code block includes four bit groups, for two adjacent bit groups, the third error condition set includes but is not limited to the following four conditions:
[0237] (1) In the case where the first bit group includes the start control word ( / S / ), the second bit group includes other contents besides the data bytes.
[0238] (2) In the case where the previous bit group includes only data bytes, the next bit group includes other contents except data bytes or the termination control word ( / T / ).
[0239] (3) In the case where the previous bit group includes the termination control word, the next bit group includes other content except the idle control word ( / I / ) or the sequence ordered set control word ( / O / ).
[0240] (4) In the case where the previous bit group includes an idle control word or a sequence ordered set control word, the next bit group includes a data byte or a termination control word.
[0241] The specific meaning and value of the control word in the embodiment of this application can be referred to in detail in IEEE802.3-2018, and will not be repeated in the embodiment of this application.
[0242] In a possible implementation, taking a bit group as an example, the fourth error condition set includes but is not limited to the following four conditions:
[0243] (1) For a bit group including a start control word, the start control word is followed by other content except data bytes.
[0244] (2) For a bit group including a data byte, the data byte is followed by other content except the data byte or the termination control word.
[0245] (3) For a bit group including a termination control word, the termination control word is followed by other content except the idle control word or the sequence ordered set control word.
[0246] (4) For a bit group including an idle control word or a sequence ordered set control word, the idle control word or the sequence ordered set control word is followed by a data byte or a termination control word.
[0247] In a possible implementation, the error detection result includes a content sequence error or a content error of the target code block. The target code block is first decoded according to the error detection result and the type and data unit of the target code block to obtain 2 n The method comprises: converting the target code block to obtain a second code block, performing a first decoding on the second code block according to the type and data unit of the second code block to obtain 2 n Group code stream block. That is, 2 n The group code stream block is obtained by first decoding the second code block according to the type and data unit of the second code block. The second code block is obtained by converting the target code block and has the same number of bits as the target code block.
[0248] Exemplarily, converting the target code block to obtain the second code block includes: for a bit group with incorrect content sequence or incorrect content in the target code block, converting the bit group with incorrect content sequence or incorrect content into an error control word; and obtaining the second code block based on the error control word and the bit group with correct content sequence and correct content in the target code block. For example, converting the first bit group into a first error control word, where the first bit group is a bit group with incorrect content sequence or incorrect content. For another example, converting the second bit group into a second error control word, where the second bit group is a bit group with incorrect content sequence or incorrect content. In one possible implementation, the second code block obtained by conversion is a control code block, and the second code block can be first decoded using decoding method two.
[0249] In another possible implementation, the error detection result includes a content sequence error or content error of the target code block. The target code block is first decoded according to the error detection result and the type and data unit of the target code block to obtain 2 n The method comprises: first decoding the target code block based on the type and data unit of the target code block to obtain 2 n Group 1 stream block, pair 2 n The first bitstream block of the group is converted to 2 n Group code stream block. That is, 2 n The group code stream block is based on 2 n The first bitstream block of the group is converted to obtain, 2 n The first code stream block of the group is obtained by performing a first decoding on the target code block based on the type and data unit of the target code block.
[0250] For example, for 2 n The first bitstream block of the group is converted to 2 n Group code stream block, including: for 2 n The codestream block obtained based on the bit group containing incorrect content sequence or content in the first codestream block is converted into an error codestream block. For example, the control block of the error codestream block is 0xFF and the data block is 0xFEFEFEFE. By processing the target codestream block with errors, the receiving end can distinguish between erroneous data and correct data, ensuring data reliability.
[0251] The decoding method provided in the embodiment of the present application performs a first decoding on the target code block to obtain 2 blocks including a control block and a data block. n The group code stream block does not need to be transcoded to obtain 2 n 66-bit code blocks, and then 2 n The 66-bit code blocks are decoded to obtain 2 n As a result, decoding efficiency is improved, and the latency, power consumption, and chip area occupied by the decoding process are reduced.
[0252] The above describes the encoding method provided by the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides an encoding device. Figure 8 is a structural diagram of an encoding device provided by an embodiment of the present application, and the device is applied to a first network device, which is the first network device in the embodiment shown in Figure 1 above. Based on the following multiple modules shown in Figure 8, the encoding device shown in Figure 8 is capable of performing all or part of the operations performed by the first network device. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiment of the present application does not limit this. As shown in Figure 8, the device includes:
[0253] Acquisition module 801, used to obtain 2 n Group code stream block, any group of code stream blocks includes control blocks and data blocks, n is an integer greater than 1;
[0254] The first encoding module 802 is used to n The first encoding is performed on the group code stream block to obtain the target code block, which includes the target code block based on 2 n The control block of the group codestream block determines the type and is based on 2 n The control block and data block of the group codestream block determine the data unit.
[0255] In a possible implementation, the type is used to indicate that the target code block is a data code block; the data unit is based on 2 n The order of the group codestream blocks is 2 n The data blocks of the group code stream blocks are obtained by performing first encoding.
[0256] In a possible implementation, the type is used to indicate that the target code block is a control code block; the data unit includes the type indication and the code block content, and the code block content is based on 2 n The control block and data block of the group code stream block determine the order of 2 n The data block of the group code stream block is first encoded, and the type indication is based on 2 n The control block of the group code stream block is obtained, and the type indication is used to indicate the type of each group code stream block.
[0257] In a possible implementation, the target code block is an error code block, and the error code block includes data for identifying an error.
[0258] In a possible implementation, the target code block is based on the error detection result. n The error detection result is based on 2 n The control block and data block of the group codestream block are obtained.
[0259] In one possible implementation, the error detection result includes 2 nThe content sequence or content of the group code stream block is wrong, and the target code block is based on 2 n The content sequence of the group code stream block is correct and the content of the code stream block and the error block are first encoded. The error block is based on 2 n The codestream blocks in the group codestream block have wrong content order or wrong content.
[0260] In a possible implementation, the control block includes m bits, the data block includes 8m bits, and m is a positive integer.
[0261] In a possible implementation, the value of n is 2, the value of m is 8, and the target code block is 257 bits.
[0262] In one possible implementation, 2 n The group code stream blocks all come from the medium independent interface MII.
[0263] In a possible implementation, the apparatus further includes: a second encoding module 803, configured to perform a second encoding on the target code block according to a forward error correction (FEC) code type to obtain first data; and a sending module 804, configured to send the first data.
[0264] The encoding device provided in the embodiment of the present application is configured to encode 2 blocks including a control block and a data block. n The target code block is obtained by first encoding the group code stream block, without having to n Each group of code stream blocks in the group code stream block is 64B / 66B encoded to obtain 2 n 66-bit code blocks, and then 2 n The target code block is obtained by transcoding 66-bit code blocks. As a result, the coding efficiency is improved and the latency, power consumption and chip area occupied by the coding process are reduced.
[0265] The above describes the decoding method provided by the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides a decoding device. Figure 9 is a structural diagram of a decoding device provided by an embodiment of the present application. The device can be applied to a second network device, which is the second network device in the embodiment shown in Figure 1 above. Based on the following multiple modules shown in Figure 9, the decoding device shown in Figure 9 can perform all or part of the operations performed by the second network device. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown therein, and the embodiment of the present application does not limit this. As shown in Figure 9, the device includes:
[0266] An acquisition module 901 is configured to acquire a target code block, where the target code block includes a type and a data unit;
[0267] The decoding module 902 is configured to perform a first decoding on the target code block according to the type and data unit of the target code block to obtain 2n A group of codestream blocks, where any group of codestream blocks includes a control block and a data block obtained based on the type and the data unit, and n is an integer greater than 1.
[0268] In one possible implementation, the type is used to indicate that the target code block is a data code block; 2 n The data blocks included in the i-th group of codestream blocks are obtained by first decoding the 8m-length content corresponding to the i-th group of codestream blocks in the data unit, where m is a positive integer and i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n An integer of -1.
[0269] In a possible implementation, the type is used to indicate that the target code block is a control code block. The data unit includes a type indication and code block content. The type indication includes 2 n bits, 2 n One of the bits is used to indicate 2 n The type of a group of code stream blocks corresponding to bits in the group code stream block. The code block content includes 2 n Bit groups; 2 n The control block included in the i-th group of codestream blocks in the group codestream blocks is obtained based on the type, the bit corresponding to the i-th group of codestream blocks in the type indication, and the bit group corresponding to the i-th group of codestream blocks in the codeblock content, where i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n Integer of -1; 2 n The data blocks included in the i-th group of codestream blocks in the group codestream blocks are obtained by first decoding the bit group corresponding to the i-th group of codestream blocks in the codeblock content based on the bit corresponding to the i-th group of codestream blocks in the type indication.
[0270] In one possible implementation, 2 n The bit group includes the first bit group and 2 n - 1 second bit group, the number of bits included in the first bit group is different from the number of bits included in the second bit group.
[0271] In a possible implementation, the data unit includes a type indication, and the type and the type indication are used to indicate that the target code block is an error code block; n The control block included in each group of code stream blocks in the group code stream block is the first value, 2 n The data block included in each group of codestream blocks in the group codestream blocks is the second value, and the first value and the second value are used to indicate that the codestream block is an erroneous codestream block.
[0272] In one possible implementation, the acquisition module is configured to receive second data, where the second data is obtained based on first data encoded using a forward error correction (FEC) code type; perform a second decoding on the second data to obtain a target code block, where the second decoding is error correction processing.
[0273] In a possible implementation, the target code block is a code block obtained by performing error correction on the second data but failing to perform error correction.
[0274] In one possible implementation, the acquisition module 901 is used to receive second data, where the second data is obtained based on first data encoded using a forward error correction (FEC) code type; perform a second decoding on the second data to obtain a target code block, where the second decoding is error detection but not error correction processing.
[0275] In a possible implementation, the target code block is a code block obtained by detecting errors from the second data but not correcting them.
[0276] In one possible implementation, 2 n The group code stream block is obtained by first decoding the target code block according to the error detection result and the type and data unit of the target code block, wherein the error detection result is obtained based on the type and data unit of the target code block.
[0277] In a possible implementation, the error detection result includes a sequence error or a content error in the target code block. n The group code stream block is obtained by first decoding the second code block according to the type and data unit of the second code block. The second code block is obtained by converting the target code block and has the same number of bits as the target code block.
[0278] In a possible implementation, the error detection result includes a sequence error or a content error in the target code block. n The group code stream block is based on 2 n The first bitstream block of the group is converted to obtain, 2 n The first code stream block of the group is obtained by performing a first decoding on the target code block based on the type and data unit of the target code block.
[0279] In a possible implementation, the control block includes m bits, the data block includes 8m bits, and m is a positive integer.
[0280] In a possible implementation, the value of n is 2, the value of m is 8, and the target code block is 257 bits.
[0281] In one possible implementation, 2 n The group code stream blocks are all in the medium independent interface MII format.
[0282] The decoding device provided in the embodiment of the present application performs a first decoding on the target code block to obtain 2 blocks including a control block and a data block. n The group code stream block does not need to be transcoded to obtain 2 n 66-bit code blocks, and then 2 n The 66-bit code blocks are decoded to obtain 2 n As a result, decoding efficiency is improved, and the latency, power consumption, and chip area occupied by the decoding process are reduced.
[0283] It should be understood that the devices provided in Figures 8 and 9 above are merely examples of the division of the functional modules described above when implementing their functions. In actual applications, the functions described above can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the devices and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0284] The specific hardware structure of the device in the above embodiment is a network device 1500 shown in Figure 10, which includes a transceiver 1501, a processor 1502 and a memory 1503. The transceiver 1501, the processor 1502 and the memory 1503 are connected via a bus 1504. Among them, the transceiver 1501 is used to receive and send messages, the memory 1503 is used to store instructions or program codes, and the processor 1502 is used to call the instructions or program codes in the memory 1503 so that the device executes the relevant processing steps of the first network device or the second network device in the above method embodiment. In a specific embodiment, the network device 1500 of the embodiment of the present application may correspond to the first network device or the second network device in each of the above method embodiments. The processor 1502 in the network device 1500 reads the instructions or program codes in the memory 1503, so that the network device 1500 shown in Figure 10 can execute all or part of the operations performed by the first network device or the second network device.
[0285] The network device 1500 may also correspond to the apparatus shown in FIG. 8 and FIG. 9 above. For example, the acquisition module 801 and the acquisition module 901 involved in FIG. 8 and FIG. 9 are equivalent to the transceiver 1501, the first encoding module 802 and the decoding module 902 processor 1502.
[0286] Referring to Figure 11 , Figure 11 shows 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 11 is used to perform the operations involved in the encoding method shown in Figure 2 and the operations involved in the decoding method shown in Figure 7 . The network device 2000 is, for example, a switch, a router, or the like.
[0287] As shown in FIG. 11 , the network device 2000 includes at least one processor 2001 , a memory 2003 , and at least one communication interface 2004 .
[0288] The processor 2001 is, 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 for implementing the solution of the present application. For example, the processor 2001 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in conjunction with the disclosure of the embodiments of the present invention. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0289] Optionally, the network device 2000 further includes a bus. The bus is used to transmit information between the components of the network device 2000. The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in FIG11 , but this does not mean that there is only one bus or one type of bus. In addition to being connected by a bus, the components of the network device 2000 in FIG11 may also be connected in other ways. The embodiment of the present invention does not limit the connection method of the components.
[0290] The memory 2003 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2003 is, for example, independent and connected to the processor 2001 via a bus. The memory 2003 can also be integrated with the processor 2001.
[0291] The communication interface 2004 uses any transceiver-like device for communicating with other devices or communication networks. The communication network can be Ethernet, a radio access network (RAN), or a wireless local area network (WLAN). The communication interface 2004 can include a wired communication interface or a wireless communication interface. Specifically, the communication interface 2004 can 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 can be an optical interface, an electrical interface, or a combination thereof. In an embodiment of the present application, the communication interface 2004 can be used for the network device 2000 to communicate with other devices.
[0292] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG11 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0293] In a specific implementation, as an embodiment, the network device 2000 may include multiple processors, such as the processor 2001 and the processor 2005 shown in FIG11 . Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0294] In a specific implementation, as an embodiment, the network device 2000 may further include an output device and an input device. The output device communicates with the processor 2001 and can display information in a variety of ways. For example, the output device can 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 communicates with the processor 2001 and can receive user input in a variety of ways. For example, the input device can be a mouse, a keyboard, a touch screen device, or a sensor device.
[0295] In some embodiments, the memory 2003 is used to store program code 2010 for executing the solution of the present application, and the processor 2001 can execute the program code 2010 stored in the memory 2003. That is, the network device 2000 can implement the encoding method or decoding method provided by the method embodiment through 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 itself may also store program code or instructions for executing the solution of the present application.
[0296] In a specific embodiment, the network device 2000 of the embodiment of the present application may correspond to the first network device or the second network device in the above-mentioned method embodiments. 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 itself, so that the network device 2000 shown in Figure 11 can perform all or part of the operations performed by the first network device or the second network device.
[0297] Network device 2000 may also correspond to the apparatus shown in Figures 8 and 9 above, with each functional module in the apparatus shown in Figures 8 and 9 being implemented using software in network device 2000. In other words, the functional modules included in the apparatus shown in Figures 8 and 9 are generated by processor 2001 of network device 2000 after reading program code 2010 stored in memory 2003. For example, acquisition module 801 and acquisition module 901 in Figures 8 and 9 correspond to communication interface 2004, and first encoding module 802 and decoding module 902 correspond to processor 2001 and / or processor 2005.
[0298] Among them, each step of the method shown in Figures 2 and 7 is completed by the hardware integrated logic circuit or software instructions in the processor of the network device 2000. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by the hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0299] Referring to FIG. 12 , FIG. 12 shows a schematic diagram of the structure of a network device 2100 provided in another exemplary embodiment of the present application. The network device 2100 shown in FIG. 12 is configured to perform all or part of the operations involved in the methods shown in FIG. 2 and FIG. 7 . The network device 2100 is, for example, a switch, a router, etc., and can be implemented using a general bus architecture.
[0300] As shown in FIG. 12 , the network device 2100 includes a main control board 2110 and an interface board 2130 .
[0301] The main control board (MCB), also known as the main processing unit (MPU) or route processor card, is used to control and manage various components in network device 2100, including routing calculations, device management, device maintenance, and protocol processing. MCB 2110 includes a central processing unit (CPU) 2111 and memory 2112.
[0302] Interface board 2130 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are interfaces for flexible Ethernet clients (FlexE Clients). Interface board 2130 includes a central processing unit (CPU) 2131, a network processor (NPU) 2132, a forwarding table memory (FMM) 2134, and a physical interface card (PIC) 2133.
[0303] The central processing unit 2131 on the interface board 2130 is used to control and manage the interface board 2130 and communicate with the central processing unit 2111 on the main control board 2110 .
[0304] The network processor 2132 is used to implement message transmission processing. The network processor 2132 can be in the form of a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented using an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 2132 is used to forward received messages based on the forwarding table stored in the forwarding entry memory 2134. If the destination address of the message is the address of the network device 2100, the message is sent to the CPU (such as the central processing unit 2131) for processing. If the destination address of the message is not the address of the network device 2100, the next hop and outgoing interface corresponding to the destination address are searched in the forwarding table based on the destination address, and the message is forwarded to the outgoing interface corresponding to the destination address. The processing of uplink messages may include processing the message inbound interface and forwarding table lookup; the processing of downlink messages may include forwarding table lookup, etc. In some embodiments, the central processing unit may also perform the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, thereby eliminating the need for a forwarding chip in the interface board.
[0305] Physical interface card 2133 implements physical layer interconnection. Raw traffic enters interface board 2130 through this card, and processed packets are sent out from this physical interface card 2133. Physical interface card 2133, also known as a daughter card, can be installed on interface board 2130. It converts optical and electrical signals into packets, performs a validity check on these packets, and then forwards them to network processor 2132 for processing. In some embodiments, central processing unit 2131 can also perform the functions of network processor 2132, such as implementing software forwarding based on a general-purpose CPU, thus eliminating the need for network processor 2132 in physical interface card 2133.
[0306] 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 table entry memory 2144, and a physical interface card 2143. The functions and implementation of each component in the interface board 2140 are the same as or similar to those of the interface board 2130 and are not described in detail here.
[0307] Optionally, network device 2100 also includes a switching fabric board 2120. Switching fabric board 2120 may also be referred to as a switch fabric unit (SFU). If the network device has multiple interface boards, switching fabric board 2120 is used to exchange data between the interface boards. For example, interface board 2130 and interface board 2140 can communicate via switching fabric board 2120.
[0308] The main control board 2110 is coupled to the interface board. For example, the main control board 2110, the interface board 2130, the interface board 2140, and the switching network board 2120 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 2110 and the interface boards 2130 and 2140, and communication is performed between the main control board 2110 and the interface boards 2130 and 2140 via the IPC channel.
[0309] Logically, 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 (CPU) 2111. The forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 2134, physical interface cards 2133, and a network processor 2132. The control plane performs routing functions, generates forwarding tables, processes signaling and protocol messages, and configures and maintains the network device's status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 2132 forwards messages received by the physical interface card 2133 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 2134. In some embodiments, the control plane and forwarding plane can be completely separate and not located on the same network device.
[0310] It's worth noting that there may be one or more main control boards (SPUs), which can include both active and standby SPUs. There may also be one or more interface boards. The higher the network device's data processing capabilities, the more interface boards it provides. Interface boards can also have one or more physical interface cards. There may be no SPUs, one or more SPUs, and multiple SPUs can provide load balancing and redundancy. In a centralized forwarding architecture, network devices may not require SPUs; the interface boards handle service data processing for the entire system. In a distributed forwarding architecture, network devices may have at least one SPU, which enables data exchange between multiple interface boards, providing high-capacity data exchange and processing capabilities. Therefore, network devices with distributed architectures have greater data access and processing capabilities than those with centralized architectures. Alternatively, a network device can consist of a single card, without a switching fabric board (SFB), integrating the functions of the interface board and the main control board. In this case, the central processing unit (CPU) on the interface board and the CPU on the main control board can be combined into a single CPU on this card, performing the combined functions of the two. This type of network device has lower data exchange and processing capabilities (for example, low-end network devices such as switches or routers). The specific architecture used depends on the specific network deployment scenario and is not specified here.
[0311] In a specific embodiment, network device 2100 corresponds to the apparatus shown in Figures 8 and 9 . In some embodiments, acquisition module 801 and acquisition module 901 in the apparatus shown in Figures 8 and 9 correspond to physical interface card 2133 or physical interface card 2143 in network device 2100. First encoding module 802 and decoding module 902 in the apparatus shown in Figures 8 and 9 correspond to at least one of central processing unit 2111, network processor 2132, and network processor 2142 in network device 2100.
[0312] Based on the network devices shown in Figures 10, 11, and 12 above, an embodiment of the present application further provides a communication system, comprising: a first network device and a second network device. Optionally, the first network device is network device 1500 shown in Figure 10, network device 2000 shown in Figure 11, or network device 2100 shown in Figure 12, and the second network device is network device 1500 shown in Figure 10, network device 2000 shown in Figure 11, or network device 2100 shown in Figure 12.
[0313] The methods executed by the first network device and the second network device can be found in the relevant descriptions of the embodiments shown in Figures 1, 2 and 7 above, and will not be repeated here.
[0314] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced RISC Machine (ARM) architecture.
[0315] Furthermore, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store device type information.
[0316] The memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile 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), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronized dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0317] A computer-readable storage medium is also provided, in which at least one program instruction or code is stored. When the program instruction or code is loaded and executed by a processor, the computer implements the encoding method in FIG. 2 or the decoding method in FIG. 7 .
[0318] The present application provides a computer program (product), which, when executed by a computer, can enable a processor or computer to execute the corresponding steps and / or processes in the above method embodiments.
[0319] A chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the methods in the above aspects.
[0320] Another chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, the processor is used to execute the code in the memory, and when the code is executed, the processor is used to execute the methods in the above aspects.
[0321] A device is also provided, comprising the aforementioned chip. Optionally, the device is a network device. Exemplarily, the device is a router, a switch, or a server.
[0322] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, 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 instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described herein are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0323] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this application. It should be understood that the above description is only the specific implementation methods of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.
[0324] Those skilled in the art will appreciate that the various method steps and modules described in conjunction with the embodiments disclosed herein can be implemented in software, hardware, firmware, or any combination thereof. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of function in the above description. Whether these functions are performed in 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 described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0325] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0326] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiment of the present application can be described in the context of a machine executable instruction, and the machine executable instruction is such as included in the program module executed in the device on the real or virtual processor of the target. Generally speaking, a program module includes a routine, a program, a library, an object, a class, a component, a data structure, etc., which performs a specific task or realizes a specific abstract data structure. In various embodiments, the function of the program module can be merged or split between the described program modules. The machine executable instruction for the program module can be executed in a local or distributed device. In a distributed device, the program module can be located in both a local and a remote storage medium.
[0327] The computer program code for realizing the method for the embodiment of the application can be written in one or more programming languages.These computer program codes can be provided to the processor of general-purpose computer, special-purpose computer or other programmable data processing device, so that program code, when being executed by computer or other programmable data processing device, causes the function / operation specified in flow chart and / or block diagram to be implemented.Program code can be executed completely on computer, partly on computer, as independent software package, partly on computer and partly on remote computer or completely on remote computer or server.
[0328] In the context of the embodiments of the present application, computer program code or related data may be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, and the like.
[0329] Examples of signals may include electrical, optical, radio, acoustic or other forms of propagated signals, such as carrier waves, infrared signals, etc.
[0330] A machine-readable medium may be any tangible medium that contains or stores a program for or in connection with 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.
[0331] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the above-described systems, devices, and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0332] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or can be electrical, mechanical or other forms of connection.
[0333] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0334] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0335] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0336] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limit on quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various described examples, 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. The first network device and the second network device may both be any type of network device, and in some cases, may be separate and different network devices.
[0337] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0338] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, "plurality of second messages" means two or more second messages. The terms "system" and "network" are often used interchangeably herein.
[0339] It should be understood that the terminology used in the description of the various examples herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0340] It will also be understood that the term “comprise” (also known as “includes,” “including,” “comprises,” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0341] It should also be understood that the terms “if” and “if” may be interpreted to mean “when” or “upon” or “in response to determining” or “in response to detecting.” Similarly, the phrases “if it is determined that ” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining ” or “in response to determining ” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event],” depending on the context.
[0342] It should be understood that determining B based on A does not mean determining B based solely on A. B can also be determined based on A and / or other information.
[0343] It should also be understood that references throughout this specification to "one embodiment," "an embodiment," or "one possible implementation" mean that specific features, structures, or characteristics associated with that embodiment or implementation are included in at least one embodiment of the present application. Therefore, the appearance of "in one embodiment," "in an embodiment," or "one possible implementation" throughout this specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Claims
1. A coding method, characterized in that: The method comprises: Get 2 n A group of code stream blocks, any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; Regarding the 2 n The first encoding is performed on the group code stream block to obtain a target code block, the target code block includes n The control block of the group codestream block determines the type and based on the 2 n The control block and data block of the group codestream block determine the data unit.
2. The method according to claim 1, characterized in that The type is used to indicate that the target code block is a data code block; The data unit is based on the 2 n The order of the group codestream blocks is n The data blocks of the group code stream blocks are obtained by performing the first encoding.
3. The method according to claim 1, characterized in that The type is used to indicate that the target code block is a control code block; The data unit includes a type indication and code block content, and the code block content is based on the 2 n The control block and data block of the group code stream block determine the order of the 2 n The data block of the group code stream block is obtained by performing the first encoding, and the type indication is based on the 2 n The control block of the group code stream block is obtained, and the type indication is used to indicate the type of each group code stream block.
4. The method according to claim 3, characterized in that The target code block is an error code block, and the error code block includes data for identifying an error.
5. The method according to any one of claims 1 to 4, characterized in that: The target code block is based on the error detection result of the 2 n The error detection result is obtained by processing the group code stream block based on the 2 n The control block and data block of the group codestream block are obtained.
6. The method according to claim 5, characterized in that The error detection result includes the 2 n The content sequence or content of the group code stream block is wrong, and the target code block is based on the 2 n The first coding is performed on the code stream blocks with correct content order and correct content and the error blocks in the group code stream blocks, and the error blocks are obtained based on the 2 n The codestream blocks in the group codestream block have wrong content order or wrong content.
7. The method according to any one of claims 1 to 6, characterized in that: The control block includes m bits, the data block includes 8m bits, and m is a positive integer.
8. The method according to claim 7, characterized in that The value of n is 2, the value of m is 8, and the target code block is 257 bits.
9. The method according to any one of claims 1 to 8, characterized in that: Said 2 n The group code stream blocks all come from the medium independent interface MII.
10. The method according to any one of claims 1 to 9, characterized in that: After obtaining the target code block, the method further includes: Performing a second encoding on the target code block according to a forward error correction (FEC) code type to obtain first data; The first data is sent.
11. A decoding method, characterized in that: The method comprises: Acquire a target code block, wherein the target code block includes a type and a data unit; According to the type and data unit of the target code block, the target code block is first decoded to obtain 2 n A group of codestream blocks, any group of codestream blocks includes a control block and a data block obtained based on the type and the data unit, and the n is an integer greater than 1.
12. The method according to claim 11, characterized in that The type is used to indicate that the target code block is a data code block; Said 2 n The data blocks included in the i-th group of codestream blocks are obtained by performing the first decoding on the 8m-length content corresponding to the i-th group of codestream blocks in the data unit, where m is a positive integer and i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n An integer of -1.
13. The method according to claim 11, characterized in that The type is used to indicate that the target code block is a control code block, and the data unit includes a type indication and code block content. The type indication includes 2 n bits, the 2 n One of the bits is used to indicate the n The type of a group of code stream blocks corresponding to the bit in the group code stream block, the code block content includes 2 n Bit groups; Said 2 n The control block included in the i-th group of codestream blocks in the group of codestream blocks is obtained based on the type, the bit corresponding to the i-th group of codestream blocks in the type indication, and the bit group corresponding to the i-th group of codestream blocks in the codeblock content, where i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n An integer of -1; Said 2 n The data blocks included in the i-th group of codestream blocks in the group of codestream blocks are obtained by performing the first decoding on the bit group corresponding to the i-th group of codestream blocks in the code block content based on the bit corresponding to the i-th group of codestream blocks in the type indication.
14. The method according to claim 13, characterized in that Said 2 n The bit group includes the first bit group and 2 n - 1 second bit group, the number of bits included in the first bit group is different from the number of bits included in the second bit group.
15. The method according to claim 11, characterized in that The data unit includes a type indication, wherein the type and the type indication are used to indicate that the target code block is an error code block; Said 2 n The control block included in each group of code stream blocks in the group code stream block is the first value, and the 2 n The data block included in each group of codestream blocks in the group codestream blocks is a second value, and the first value and the second value are used to indicate that the codestream block is an erroneous codestream block.
16. The method according to any one of claims 11 to 15, characterized in that: The obtaining of the target code block includes: receiving second data, the second data being obtained based on the first data encoded using a forward error correction (FEC) code pattern; A second decoding is performed on the second data to obtain the target code block, where the second decoding is error correction processing.
17. The method according to claim 16, characterized in that The target code block is an error code block obtained by performing error correction on the second data but failing to perform error correction.
18. The method according to any one of claims 11 to 15, characterized in that: The obtaining of the target code block includes: receiving second data, the second data being obtained based on the first data encoded using a forward error correction (FEC) code pattern; A second decoding is performed on the second data to obtain the target code block, where the second decoding is error detection but not error correction processing.
19. The method according to claim 18, characterized in that The target code block is an error code block obtained by detecting errors from the second data but not correcting them.
20. The method according to any one of claims 11 to 15, characterized in that: Said 2 n The group code stream block is obtained by performing the first decoding on the target code block according to an error detection result and a type and a data unit of the target code block, wherein the error detection result is obtained based on the type and the data unit of the target code block.
21. The method according to claim 20, characterized in that The error detection result includes a content sequence error or content error of the target code block, n The group code stream block is obtained by performing the first decoding on the second code block according to the type and data unit of the second code block, and the second code block is obtained by converting the target code block and has the same number of bits as the target code block.
22. The method according to claim 20, characterized in that The error detection result includes a content sequence error or content error of the target code block, n The group code stream block is based on 2 n The first bitstream block of the group is converted to obtain the 2 n The first code stream block is obtained by performing the first decoding on the target code block based on the type and data unit of the target code block.
23. The method according to any one of claims 11 to 22, characterized in that: The control block includes m bits, the data block includes 8m bits, and m is a positive integer.
24. The method according to claim 23, wherein The value of n is 2, the value of m is 8, and the target code block is 257 bits.
25. The method according to any one of claims 11 to 24, characterized in that: Said 2 n The group code stream blocks are all in the medium independent interface MII format.
26. An encoding device, characterized in that The device comprises: Get module, used to get 2 n A group of code stream blocks, any group of code stream blocks includes a control block and a data block, and n is an integer greater than 1; The first encoding module is used to encode the n The first encoding is performed on the group code stream block to obtain a target code block, the target code block includes n The control block of the group codestream block determines the type and based on the 2 n The control block and data block of the group codestream block determine the data unit.
27. The device according to claim 26, characterized in that The type is used to indicate that the target code block is a data code block; the data unit is based on the 2 n The order of the group codestream blocks is n The data blocks of the group code stream blocks are obtained by performing the first encoding.
28. The device according to claim 26, characterized in that The type is used to indicate that the target code block is a control code block; the data unit includes a type indication and code block content, and the code block content is based on the 2 n The control block and data block of the group code stream block determine the order of the 2 n The data block of the group code stream block is obtained by performing the first encoding, and the type indication is based on the 2 n The control block of the group code stream block is obtained, and the type indication is used to indicate the type of each group code stream block.
29. The device according to claim 28, characterized in that The target code block is an error code block, and the error code block includes data for identifying an error.
30. The device according to any one of claims 26 to 29, characterized in that: The target code block is based on the error detection result of the 2 n The error detection result is obtained by processing the group code stream block based on the 2 n The control block and data block of the group codestream block are obtained.
31. The device according to claim 30, characterized in that The error detection result includes the 2 n The content sequence or content of the group code stream block is wrong, and the target code block is based on the 2 n The first coding is performed on the code stream blocks with correct content order and correct content and the error blocks in the group code stream blocks, and the error blocks are obtained based on the 2 n The codestream blocks in the group codestream block have wrong content order or wrong content.
32. The device according to any one of claims 26 to 31, characterized in that The control block includes m bits, the data block includes 8m bits, and m is a positive integer.
33. The device according to claim 31, characterized in that The value of n is 2, the value of m is 8, and the target code block is 257 bits.
34. The device according to any one of claims 26 to 33, characterized in that Said 2 n The group code stream blocks all come from the medium independent interface MII.
35. The device according to any one of claims 26 to 34, characterized in that The device further comprises: A second encoding module is configured to perform a second encoding on the target code block according to a forward error correction (FEC) code type to obtain first data; A sending module is used to send the first data.
36. A decoding device, characterized in that The device comprises: An acquisition module, configured to acquire a target code block, wherein the target code block includes a type and a data unit; A decoding module is configured to perform a first decoding on the target code block according to the type and data unit of the target code block to obtain 2 n A group of codestream blocks, any group of codestream blocks includes a control block and a data block obtained based on the type and the data unit, and the n is an integer greater than 1.
37. The device according to claim 36, characterized in that The type is used to indicate that the target code block is a data code block; n The data blocks included in the i-th group of codestream blocks are obtained by performing the first decoding on the 8m-length content corresponding to the i-th group of codestream blocks in the data unit, where m is a positive integer and i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n An integer of -1.
38. The device according to claim 36, characterized in that The type is used to indicate that the target code block is a control code block, and the data unit includes a type indication and code block content. The type indication includes 2 n bits, the 2 n One of the bits is used to indicate the n The type of a group of code stream blocks corresponding to the bit in the group code stream block, the code block content includes 2 n bit groups; n The control block included in the i-th group of codestream blocks in the group of codestream blocks is obtained based on the type, the bit corresponding to the i-th group of codestream blocks in the type indication, and the bit group corresponding to the i-th group of codestream blocks in the codeblock content, where i is greater than or equal to 1 and less than or equal to 2. n An integer or i is greater than or equal to 0 and less than or equal to 2 n -1 integer; 2 n The data blocks included in the i-th group of codestream blocks in the group of codestream blocks are obtained by performing the first decoding on the bit group corresponding to the i-th group of codestream blocks in the code block content based on the bit corresponding to the i-th group of codestream blocks in the type indication.
39. The device according to claim 38, characterized in that Said 2 n The bit group includes the first bit group and 2 n - 1 second bit group, the number of bits included in the first bit group is different from the number of bits included in the second bit group.
40. The device according to claim 36, wherein The data unit includes a type indication, and the type and the type indication are used to indicate that the target code block is an error code block; n The control block included in each group of code stream blocks in the group code stream block is the first value, and the 2 n The data block included in each group of codestream blocks in the group codestream blocks is a second value, and the first value and the second value are used to indicate that the codestream block is an erroneous codestream block.
41. The device according to any one of claims 36 to 40, characterized in that The acquisition module is used to receive second data, where the second data is obtained based on first data encoded using a forward error correction (FEC) code type; and perform a second decoding on the second data to obtain the target code block, where the second decoding is error correction processing.
42. The device according to claim 41, characterized in that The target code block is an error code block obtained by performing error correction on the second data but failing to perform error correction.
43. The device according to any one of claims 36 to 40, characterized in that The acquisition module is configured to receive second data, where the second data is obtained based on first data encoded using a forward error correction (FEC) code type; and perform a second decoding on the second data to obtain the target code block, where the second decoding is error detection but not error correction processing.
44. The device according to claim 43, characterized in that The target code block is an error code block obtained by detecting errors from the second data but not correcting them.
45. The device according to any one of claims 36 to 40, characterized in that Said 2 n The group code stream block is obtained by performing the first decoding on the target code block according to an error detection result and a type and a data unit of the target code block, wherein the error detection result is obtained based on the type and the data unit of the target code block.
46. The device according to claim 45, characterized in that The error detection result includes a content sequence error or content error of the target code block, n The group code stream block is obtained by performing the first decoding on the second code block according to the type and data unit of the second code block, and the second code block is obtained by converting the target code block and has the same number of bits as the target code block.
47. The device according to claim 45, characterized in that The error detection result includes a content sequence error or content error of the target code block, n The group code stream block is based on 2 n The first bitstream block of the group is converted to obtain the 2 n The first code stream block is obtained by performing the first decoding on the target code block based on the type and data unit of the target code block.
48. The device according to any one of claims 36-47, characterized in that The control block includes m bits, the data block includes 8m bits, and m is a positive integer.
49. The device according to claim 48, characterized in that The value of n is 2, the value of m is 8, and the target code block is 257 bits.
50. The device according to any one of claims 36 to 49, characterized in that Said 2 n The group code stream blocks are all in the medium independent interface MII format.
51. A network device, characterized in that: The network device includes: a processor, the processor is coupled to a memory, the memory stores at least one program instruction or code, and the at least one program instruction or code is loaded and executed by the processor to enable the network device to implement the method according to any one of claims 1-25.
52. A communication system, characterized in that The system includes a first network device and a second network device, wherein the first network device is configured to execute the method according to any one of claims 1 to 10, and the second network device is configured to execute the method according to any one of claims 11 to 25.
53. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one program instruction or code, and when the program instruction or code is loaded and executed by the processor, the computer is enabled to implement the method according to any one of claims 1 to 25.
54. A computer program product, characterized in that The computer program product comprises computer program code, and when the computer program code is executed by a computer, the computer is caused to implement the method according to any one of claims 1 to 25.
55. A chip, characterized in that: The chip includes a processor, and the processor is used to call and execute instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method according to any one of claims 1 to 25.
56. A chip, characterized in that The chip includes: 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 used to execute the code in the memory. When the code is executed, the processor is used to execute the method described in any one of claims 1-25.
Citation Information
Patent Citations
Data transmission method, communication device, and storage medium
JP2021508214A
Physical layer encoding and decoding method and apparatuses thereof
US20160182084A1
Encoding of data for transmission
US8898550B2
