A data transmission method and apparatus

By inserting CRC codes and performing early CRC checks in the communication system, the problem of large data transmission delays is solved, and more efficient data transmission is achieved.

CN116685952BActive Publication Date: 2026-07-03HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2021-12-31
Publication Date
2026-07-03

Smart Images

  • Figure CN116685952B_ABST
    Figure CN116685952B_ABST
Patent Text Reader

Abstract

This application provides a data transmission method and apparatus that can reduce data transmission latency. The method may include: generating a first data stream, the first data stream including a plurality of first messages and a plurality of first cyclic redundancy check (CRC) codes, at least one of the plurality of first messages including a second CRC code; and sending the first data stream to a receiving end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and more specifically, to a data transmission method and apparatus. Background Technology

[0002] Existing communication systems typically employ cyclic redundancy check (CRC) technology combined with forward error correction (FEC) coding technology for data transmission.

[0003] Taking a communication system that follows the unified bus (UB) protocol as an example, the sending end generates multiple messages at the data link layer, at least one of which includes a CRC code; the data link layer sends the multiple messages to the physical coding sublayer of the physical layer; the physical coding sublayer generates a data stream based on the multiple messages, the data stream including the multiple messages and an FEC code, the FEC code being used for FEC detection of the multiple messages; the physical coding sublayer sends the data stream to the receiving end.

[0004] Accordingly, the receiving end performs FEC detection on the multiple packets based on the FEC code at the physical coding sublayer; if the FEC detection results of the multiple packets are correct, the physical coding sublayer sends the multiple packets to the data link layer for CRC verification; if the FEC detection results of the multiple packets are incorrect, the physical coding sublayer performs FEC error correction on the multiple packets to obtain corrected multiple packets, and sends the corrected multiple packets to the data link layer for CRC verification.

[0005] However, since the receiving end can only perform FEC detection on the multiple messages and the FEC code after receiving them, and the process of receiving the multiple messages and the FEC code takes a long time, the data transmission delay is relatively large. Summary of the Invention

[0006] This application provides a data transmission method and apparatus that can reduce data transmission latency.

[0007] In a first aspect, this application provides a data transmission method, which may include: generating a first data stream, the first data stream including a plurality of first messages and a plurality of first cyclic redundancy check (CRC) codes, at least one of the plurality of first messages including a second CRC code; and sending the first data stream to a receiving end.

[0008] It should be noted that each of the plurality of first CRC codes is used (at the physical coding sublayer) to perform CRC verification on the first message corresponding to the first message with the first CRC code. The second CRC code included in the first message is used (at the data link layer) to perform CRC verification on the message header and the valid data in the first message, or the second CRC code included in the first message is used to perform CRC verification on the message header, the valid data in the first message, and at least one first message preceding the first message that does not contain a second CRC code.

[0009] In existing technology, the sending end generates multiple FEC codes for first messages and sends these multiple first messages and the FEC codes to the receiving end. The receiving end can only perform FEC decoding (including FEC detection and / or FEC error correction) on the multiple first messages based on the FEC codes after receiving them. When the FEC detection result of the multiple first messages is correct, the receiving end sends the multiple first messages to the data link layer of the receiving end; when the FEC detection result of the multiple first messages is incorrect, FEC error correction is performed on the multiple first messages, and then the corrected multiple first messages are sent to the data link layer of the receiving end. However, since the process of receiving the multiple first messages and the FEC codes takes a long time, the data transmission delay is relatively large.

[0010] Using the data transmission method provided in this application embodiment, the first data stream generated by the sending end includes a plurality of first messages and a plurality of first CRC codes. Each at least one CRC code among the plurality of first CRC codes is used for CRC verification of the first message corresponding to that at least one CRC code. Thus, after the receiving end receives at least one first CRC code and the first message corresponding to that at least one first CRC code, it can perform CRC verification on the first message corresponding to that at least one first CRC code based on that at least one first CRC code, without waiting for all the plurality of first messages and the plurality of first CRC codes to be received before performing error detection (such as CRC verification), thereby reducing data transmission latency.

[0011] Furthermore, when the CRC check result of the first message corresponding to the at least one first CRC code is correct, the first message corresponding to the at least one first CRC code can be directly sent to the data link layer of the receiving end without FEC decoding, which can reduce the latency required for FEC decoding and thus reduce the latency of data transmission.

[0012] In one possible implementation, M first CRC codes can be inserted after every N first messages, where M and N are both integers greater than 0.

[0013] In one possible implementation, the sum of the lengths of the N first messages and the lengths of the M first CRC codes inserted after the N first messages can be less than the length of one codeword.

[0014] The codewords mentioned in this application refer to the units of FEC encoding and decoding performed by the physical coding sublayer. Since different algorithms are used for FEC encoding and decoding, the specific length of the codewords is different, and this application does not make a specific limitation on this.

[0015] Using the data transmission method provided in this application, since M first CRC codes can be inserted after every N first messages, and the sum of the length of the N first messages and the length of the M first CRC codes inserted after the N first messages can be less than the length of one codeword, the receiving end can perform CRC verification on the N first messages based on the M first CRC codes after receiving the N first messages and the M first CRC codes, without having to wait until all the multiple first messages and the multiple first CRC codes are received before performing error detection (such as CRC verification), which can reduce the latency of data transmission.

[0016] Furthermore, when the CRC check result of the first message corresponding to the N second CRC codes is correct, the first message corresponding to the N CRC codes can be sent directly to the data link layer of the receiving end without FEC decoding, which can reduce the latency required for FEC decoding and thus reduce the latency of data transmission.

[0017] Optionally, the starting position of the M first CRC codes inserted after every N first messages can be aligned with the starting position of each of the N first messages. That is, when the total length of the M first CRC codes is less than the length of one first message, data padding, such as padding with "0", can be used to make the sum of the length of the M first CRC codes and the length of the padding bits equal to an integer multiple of the length of the first message.

[0018] Optionally, this application does not limit the values ​​of M and N.

[0019] In one possible implementation, M can be equal to N. For example, two first CRC codes can be inserted after every two first messages. The two first messages correspond one-to-one with the two first CRC codes. That is, each of the two first CRC codes is generated based on the first message corresponding to each first CRC code and is used to perform CRC verification on each first message.

[0020] In another possible implementation, N can be greater than M. For example, a first CRC code can be inserted after every two first messages. That is, the first CRC code is generated based on the two first messages and is used to perform CRC verification on the two first messages.

[0021] When the data transmission method provided in the embodiments of this application is used, and N is greater than M, the number of CRC calculations can be reduced, thereby saving CRC calculation resources and calculation time.

[0022] In another possible implementation, N can be less than M. For example, two CRC codes can be inserted after each first message. These two first CRC codes are generated based on the first message and are used to perform CRC verification on the first message.

[0023] When the data transmission method provided in the embodiments of this application is less than M, the CRC verification capability can be improved.

[0024] Optionally, this application does not limit the number of first messages including the second CRC code among the plurality of first messages.

[0025] In one possible implementation, some of the first messages in the plurality of first messages may include a second CRC code. For example, the first message at the beginning and the first message at the end of the plurality of first messages may include a second CRC code.

[0026] Using the data transmission method provided in the embodiments of this application, only the header and trailer of the first messages include the second CRC code, and the payload field in the remaining positions of the first messages can be used to carry valid data, which can improve the transmission efficiency of valid data.

[0027] In another possible implementation, each of the plurality of first messages may include a second CRC code, which is generated based on the message header and valid data of each first message and is used to perform CRC verification on the message header and valid data of each first message.

[0028] The data transmission method provided in this application includes a second CRC code in each of the plurality of first messages, which can improve the CRC verification capability.

[0029] In one possible implementation, the sending end can acquire multiple target packets at the data link layer; add a second CRC code to at least one of the multiple target packets to obtain multiple first packets that correspond one-to-one with the multiple target packets.

[0030] Optionally, the sender may indicate the transmission mode of the message sent by the sender to the receiver in various ways, and this application does not limit this.

[0031] In one possible implementation, the first data stream further includes a first alignment word, which indicates that the transmission mode of the plurality of first messages is a first transmission mode. That is, the sender can indicate to the receiver the transmission mode of the messages sent in the current transmission cycle.

[0032] In another possible implementation, the first data stream is sent within a first transmission cycle. The first data stream also includes a first alignment word, which indicates that the transmission mode of the message sent in the second transmission cycle is the first transmission mode. The second transmission cycle is the next transmission cycle after the first transmission cycle. That is, the sending end can indicate to the receiving end, in the current transmission cycle, the transmission mode of the message sent in the next transmission cycle.

[0033] In one possible implementation, the first data stream also includes a first forward error correction (FEC) code, which is used to perform FEC detection on the plurality of first messages and the plurality of first CRC codes.

[0034] Using the data transmission method provided in this application embodiment, when the CRC check result is incorrect, there is no need to retransmit. The error location can be located and the error can be corrected by FEC decoding of the multiple first messages and the first FEC code, which can reduce the latency caused by retransmission.

[0035] Optionally, the sending end can perform FEC encoding on the plurality of first messages and the plurality of first CRCs to obtain the first FEC code, which is used for FEC decoding of the plurality of first messages and the plurality of first CRCs.

[0036] In one possible implementation, before generating the first data stream, the method further includes: determining the transmission mode of the plurality of first messages as the first transmission mode if the data volume of the plurality of first messages is less than or equal to a preset first threshold. That is, the sending end can monitor the data volume of the plurality of first messages; when the data volume of the plurality of first messages is less than or equal to the first threshold, the transmission mode of the plurality of first messages is determined to be the first transmission mode.

[0037] Optionally, the transmission mode described in this application may include the first transmission mode or the second transmission mode. The first transmission mode can be understood as a low-volume mode, also known as a short mode, and the second transmission mode can be understood as a high-volume mode, also known as a long mode.

[0038] Using the data transmission method provided in this application, in low-volume mode, the first data stream includes multiple first messages and multiple first CRC codes. That is, by increasing the transmission of multiple first CRC codes, the receiving end can perform CRC verification on the first message corresponding to the at least one first CRC code based on the at least one first CRC code after receiving at least one first CRC code and the first message corresponding to the at least one first CRC code, without having to wait until all the multiple first messages and the multiple first CRC codes are received before performing error detection (such as CRC verification), which can reduce the latency of data transmission.

[0039] Furthermore, when the CRC check result of the first message corresponding to the at least one first CRC code is correct, the first message corresponding to the at least one first CRC code can be directly sent to the data link layer of the receiving end without FEC decoding, which can reduce the latency required for FEC decoding and thus reduce the latency of data transmission.

[0040] Optionally, the method further includes: generating a second data stream, the second data stream including a plurality of second messages, at least one of the plurality of second messages including a third CRC code; and sending the second data stream to the receiving end.

[0041] It should be noted that the second data path includes multiple second messages, but does not include the fourth CRC code corresponding to one or more of the multiple second messages. That is, there is no inserted fourth CRC code Q after P second messages, where P and Q are both integers greater than 0.

[0042] Using the data transmission method provided in this application, in high-volume mode, the second data stream only includes the multiple second messages. Compared with low-volume mode, the generation complexity of the second data stream is lower and the generation speed is faster.

[0043] Optionally, before the sending end generates the second data stream, the method 100 may further include: if the sending end determines that the transmission mode of the plurality of second messages is the second transmission mode when it determines that the data volume of the plurality of second messages is greater than the first threshold. That is, the sending end can monitor the data volume of the plurality of second messages; when the data volume of the plurality of second messages is greater than the first threshold, it determines that the transmission mode of the plurality of second messages is the second transmission mode.

[0044] Optionally, the second data stream may further include a second alignment word, which is used to indicate that the transmission mode of the plurality of second messages is the second transmission mode.

[0045] Optionally, the second data stream is sent within the first transmission cycle, and the second data stream may further include a second alignment word, which is used to indicate that the transmission mode of the message sent within the second transmission cycle is the second transmission mode, and the second transmission cycle is the next transmission cycle of the first transmission cycle.

[0046] Optionally, the second data stream may also include a second FEC code, which is used for FEC decoding of the plurality of second messages.

[0047] Optionally, the aforementioned plurality of first messages and the aforementioned plurality of second messages may be the same or different, and this application does not impose any limitation on this.

[0048] In one possible implementation, when the plurality of first messages and the plurality of second messages are the same, the sending end can determine the transmission mode of the plurality of first messages based on the data volume of the plurality of first messages; when the transmission mode of the plurality of messages is the first transmission mode, the aforementioned first data stream is generated; when the transmission mode of the plurality of first messages is the second transmission mode, the aforementioned second data stream is generated.

[0049] Using the data transmission method provided in this application embodiment, the sending end can flexibly determine the transmission mode of the multiple first messages based on the data volume of the multiple first messages. When the data volume is large, the second transmission mode is used, which will not increase the amount of external data transmitted and can prioritize the transmission efficiency of the multiple first messages. When the data volume is small, the first transmission mode is used, and by increasing the transmission of multiple first CRCs, the data transmission delay can be reduced.

[0050] Secondly, this application also provides a data transmission method, which may include: receiving a first data stream from a sending end, the first data stream including a plurality of first messages, a plurality of first cyclic redundancy check (CRC) codes, and a first forward error correction (FEC) code, the first FEC code being used to perform FEC detection on the plurality of first messages and the plurality of first CRC codes; when the CRC check result of the first message corresponding to at least one of the plurality of first CRC codes is correct, sending the first message corresponding to the at least one first CRC code to the data link layer of the receiving end; when the CRC check result of the first message corresponding to any one of the plurality of first CRC codes is incorrect, performing FEC detection on the plurality of first messages and the plurality of first CRC codes.

[0051] Optionally, at least one of the plurality of first messages may include a second CRC code.

[0052] It should be noted that each of the plurality of first CRC codes is used (at the physical coding sublayer) to perform CRC verification on the first message corresponding to the first message with the first CRC code. The second CRC code included in the first message is used (at the data link layer) to perform CRC verification on the message header and the valid data in the first message, or the second CRC code included in the first message is used to perform CRC verification on the message header, the valid data in the first message, and at least one first message preceding the first message that does not contain a second CRC code.

[0053] In existing technology, the sending end generates multiple FEC codes for first messages and sends these multiple first messages and the FEC codes to the receiving end. The receiving end can only perform FEC decoding (including FEC detection and / or FEC error correction) on the multiple first messages based on the FEC codes after receiving them. When the FEC detection result of the multiple first messages is correct, the receiving end sends the multiple first messages to the data link layer of the receiving end; when the FEC detection result of the multiple first messages is incorrect, FEC error correction is performed on the multiple first messages, and then the corrected multiple first messages are sent to the data link layer of the receiving end. However, since the process of receiving the multiple first messages and the FEC codes takes a long time, the data transmission delay is relatively large.

[0054] Using the data transmission method provided in this application embodiment, the first data stream generated by the sending end includes a plurality of first messages and a plurality of first CRC codes. Each at least one CRC code among the plurality of first CRC codes is used for CRC verification of the first message corresponding to that at least one CRC code. Thus, after the receiving end receives at least one first CRC code and the first message corresponding to that at least one first CRC code, it can perform CRC verification on the first message corresponding to that at least one first CRC code based on that at least one first CRC code, without waiting for all the plurality of first messages and the plurality of first CRC codes to be received before performing error detection (such as CRC verification), thereby reducing data transmission latency.

[0055] Furthermore, when the CRC check result of the first message corresponding to the at least one first CRC code is correct, the first message corresponding to the at least one first CRC code can be directly sent to the data link layer of the receiving end without FEC decoding, which can reduce the latency required for FEC decoding and thus reduce the latency of data transmission.

[0056] In one possible implementation, after performing FEC detection on the plurality of first messages and the plurality of first CRC codes, the method further includes: when the FEC detection results of the plurality of first messages and the plurality of first CRC codes are correct, sending the plurality of first messages to the data link layer; when the FEC verification results of the plurality of first messages and the plurality of first CRC codes are incorrect, performing FEC error correction on the plurality of first messages and the plurality of first CRC codes to obtain corrected plurality of first messages.

[0057] By using the data transmission method provided in the embodiments of this application, when the FEC detection results of the plurality of first messages and the plurality of first CRC codes are correct, the plurality of first messages are sent to the data link layer, which can reduce the latency required for FEC error correction and thus improve the latency of data transmission.

[0058] In one possible implementation, M first CRC codes are inserted after every N first messages. These M first CRC codes are used to perform CRC checks on the N first messages, where M and N are both integers greater than 0.

[0059] Using the data transmission method provided in the embodiments of this application, the receiving end can perform CRC verification on the N first messages and the M first CRC codes inserted after the N first messages after receiving them, without having to wait until all the multiple first messages and the multiple first CRC codes are received before performing error detection (such as CRC verification), which can reduce the latency of data transmission.

[0060] Furthermore, when the CRC check result of the first message corresponding to the N second CRC codes is correct, the first message corresponding to the N CRC codes can be sent directly to the data link layer of the receiving end without FEC decoding, which can reduce the latency required for FEC decoding and thus reduce the latency of data transmission.

[0061] In one possible implementation, before sending the first message corresponding to at least one first CRC code to the data link layer when the CRC check result of the first message corresponding to at least one first CRC code among the plurality of first CRC codes is correct, the method further includes: determining the transmission mode of the plurality of first messages as a first transmission mode based on a first alignment word, the first alignment word being used to indicate that the transmission mode of the plurality of first messages is the first transmission mode; and performing CRC check on the first message corresponding to at least one first CRC code among the plurality of first CRC codes when the transmission mode of the plurality of first messages is determined to be the first transmission mode.

[0062] In one possible implementation, the first data stream also includes the first alignment word.

[0063] In one possible implementation, the first data stream is sent within a first transmission cycle, and the first alignment word is sent within a third transmission cycle, the third transmission cycle being the previous transmission cycle of the first transmission cycle.

[0064] In one possible implementation, the method further includes: receiving a second data stream from the sending end, the second data stream including a plurality of second messages and a second FEC code, the second FEC code being used to perform FEC detection on the plurality of second messages; and when the FEC detection result of the plurality of second messages is correct, sending the plurality of second messages to the data link layer.

[0065] In one possible implementation, before sending the plurality of second messages to the data link layer when the FEC detection result of the plurality of second messages is correct, the method further includes: determining the transmission mode of the plurality of second messages as a second transmission mode based on a second alignment word; and performing FEC detection on the plurality of second messages when the transmission mode of the plurality of second messages is determined to be the second transmission mode.

[0066] Thirdly, this application also provides a data transmission method, which may include: a sending end determining, based on the data volume of multiple message 1s, that the transmission mode of the multiple message 1s is a first transmission mode, wherein at least one of the multiple message 1s includes a second CRC code; when the transmission mode of the multiple message 1s is the first transmission mode, the sending end inserts M first CRC codes after every N message 1s to obtain data stream 1; the sending end adds a first FEC code after the data stream 1 to obtain data stream 2, wherein the first FEC code is used for FEC decoding of the data stream 1; the sending end sends a target data stream 1 to a receiving end, wherein the target data stream 1 includes the data stream 2.

[0067] Optionally, the transmission mode described in the embodiments of this application may include the first transmission mode or the second transmission mode.

[0068] It should be noted that the first transmission mode described in this application can be understood as a low-volume mode, also known as short mode, and the second transmission mode described in this application can be understood as a high-volume mode, also known as long mode.

[0069] In one possible implementation, the sending end can determine the transmission mode of the multiple messages 1 as the first transmission mode based on the data volume of the multiple messages 1 and a preset first threshold.

[0070] For example, if the data volume of the multiple messages 1 is less than or equal to the first threshold, the sender can determine that the transmission mode of the multiple messages 1 is the first transmission mode.

[0071] Optionally, at least one of the plurality of messages 1 includes a second CRC code.

[0072] In one possible implementation, before the sending end determines the transmission mode of the multiple messages 1 as the first transmission mode based on the data volume of the multiple messages 1, the method further includes: the sending end acquiring multiple target messages; adding a second CRC code to at least one of the multiple target messages to obtain the multiple messages 1 that correspond one-to-one with the multiple target messages.

[0073] In one possible implementation, the sender can add a CRC code to each of the multiple target packets to obtain multiple packets 1 that correspond one-to-one with the multiple target packets.

[0074] In another possible implementation, the sender can add a second CRC code to some of the target messages (such as the target message at the beginning of the target messages and the target message at the end of the target messages) to obtain message 1 corresponding to the part of the target messages. The remaining target messages in the multiple target messages other than the part of the target messages are directly used as message 1.

[0075] It should be noted that the message described in this application may also be a flit, or referred to as a flit, which is the basic unit for transmitting data between the data link layer and the physical layer.

[0076] It should be noted that the sending end can generate this second CRC code at the data link layer.

[0077] In one possible implementation, the target data stream 1 further includes a first alignment word, which is used to indicate that the transmission mode of the plurality of messages 1 is the first transmission mode.

[0078] In another possible implementation, the target data stream 1 is sent within a transmission period T1. The target data stream may also include a first alignment word, which is used to indicate that the transmission mode of the message sent within a transmission period T2 is the first transmission mode, where T2 is the next transmission period after T1.

[0079] It should be noted that the length of data stream 2 described in this application is less than the length of one codeword. The codeword mentioned in this application refers to a unit of FEC encoding / decoding performed by the physical coding sublayer. Since different algorithms are used for FEC encoding / decoding, the specific length of the codeword varies, and this application does not impose a specific limitation on it.

[0080] Optionally, the method may further include: the sending end determining, based on the data volume of the multiple messages 2, that the transmission mode of the multiple messages 2 is a second transmission mode; when the transmission mode of the multiple messages 2 is the second transmission mode, the sending end adds a second FEC code after the multiple messages 2 to obtain a data stream 3, wherein at least one of the multiple messages 2 includes a third CRC code; the sending end sends a target data stream 2 to the receiving end, wherein the target data stream 2 includes the data stream 3.

[0081] Optionally, the target data stream 2 may also include a second alignment word, which is used to indicate that the transmission mode of the plurality of messages 2 is the second transmission mode.

[0082] Optionally, the aforementioned multiple messages 1 and multiple messages 2 may be the same or different, and this application does not limit this.

[0083] Fourthly, this application also provides a data transmission method, which may include: a receiving end receiving a target data stream 1 from a sending end, the target data stream 1 including a plurality of packets 1, a plurality of first CRC codes and a first FEC code, at least one of the plurality of packets 1 including a second CRC code; the receiving end determining the transmission mode of the plurality of packets 1 as a first transmission mode based on a first alignment word, the first alignment word being used to indicate that the transmission mode of the plurality of packets 1 is the first transmission mode; when the transmission mode of the plurality of packets 1 is the first transmission mode, the receiving end performing CRC verification on the packet 1 corresponding to the at least one first CRC code based on each of the plurality of first CRC codes; whenever the CRC verification result of the packet 1 corresponding to the at least one first CRC code is correct, the receiving end may send the packet 1 corresponding to the at least one first CRC code to the data link layer.

[0084] It should be noted that the sum of the lengths of the multiple message 1s, the lengths of the multiple first CRC codes, and the length of the first FEC code is less than the length of one codeword. The codeword mentioned in this application refers to the unit of FEC encoding and decoding performed by the physical coding sublayer. Since different algorithms are used for FEC encoding and decoding, the specific length of the codeword varies, and this application does not impose a specific limitation on it.

[0085] Optionally, the receiving end may obtain the first alignment word in a variety of ways, and this application does not limit this.

[0086] In one possible implementation, the target data stream 1 also includes the first alignment word.

[0087] In one possible implementation, the first target data stream 1 is sent within a first transmission cycle, and the first alignment word is sent within a third transmission cycle, which is the transmission cycle preceding the first transmission cycle.

[0088] In another possible implementation, if the transmission mode of the plurality of messages 1 is the first transmission mode, the second data stream includes the plurality of messages 1.

[0089] Optionally, when the CRC check result of message 1 corresponding to any of the plurality of first CRC codes is incorrect, the receiving end performs FEC detection on the plurality of messages 1 and the plurality of first CRC codes.

[0090] Furthermore, when the FEC detection results of the multiple messages 1 and the multiple first CRC codes are correct, the receiving end sends the multiple messages 1 to the data link layer; when the FEC detection results of the multiple messages 1 and the multiple first CRC codes are incorrect, the receiving end performs FEC error correction on the multiple messages 1 and the multiple first CRC codes to obtain the corrected multiple messages 1, and sends the corrected multiple messages 1 to the data link layer.

[0091] Optionally, after the data link layer of the receiving end receives multiple packets 1, it can perform CRC verification on the packet header and the valid data in each packet 1 based on the second CRC code included in each of the at least one packets 1, or perform CRC verification on the packet header, the valid data in each packet 1, and at least one packet 1 preceding each packet 1 that does not contain the second CRC code.

[0092] Optionally, the method may further include: a receiving end receiving a target data stream 2 from a sending end, the target data stream 2 including a plurality of packets 2 and a second FEC code, at least one of the plurality of packets 2 including a third CRC code; the receiving end determining the transmission mode of the plurality of packets 2 as a second transmission mode based on a second alignment word, the second alignment word being used to indicate that the transmission mode of the plurality of packets 2 is the second transmission mode; when the transmission mode of the plurality of packets 2 is the second transmission mode, the receiving end performing FEC detection on the plurality of packets 2; when the FEC detection result of the plurality of packets 2 is correct, the receiving end sending the plurality of packets 2 to the data link layer; when the FEC detection result of the plurality of packets 2 is incorrect, the receiving end performing FEC error correction on the plurality of packets 2 and sending the corrected plurality of packets 2 to the data link layer.

[0093] Optionally, after the data link layer of the receiving end receives multiple packets 2, it can perform CRC verification on the packet header and the valid data in each packet 2 based on the third CRC code included in each of the at least one packets 2, or perform CRC verification on the packet header, the valid data in each packet 2, and at least one packet 2 preceding each packet 2 that does not contain the third CRC code.

[0094] Optionally, the aforementioned multiple messages 1 and multiple messages 2 may be the same or different, and this application does not limit this.

[0095] Fifthly, this application also provides a data transmission apparatus, which may include: a processor and a communication interface, the processor and the communication interface being coupled together, the processor being configured to: generate a first data stream, the first data stream including a plurality of first messages and a plurality of first cyclic redundancy check (CRC) codes, at least one of the plurality of first messages including a second CRC code; and send the first data stream to a receiving end through the communication interface.

[0096] In one possible implementation, M first CRC codes are inserted after every N first messages, where M and N are both integers greater than 0.

[0097] In one possible implementation, the first data stream is sent within a first transmission cycle, and the first data stream also includes a first alignment word, which is used to indicate that the transmission mode of the plurality of first messages is a first transmission mode.

[0098] In one possible implementation, the first data stream is sent within a first transmission cycle, and the first data stream also includes a first alignment word, which is used to indicate the transmission mode of a message sent within a second transmission cycle, the second transmission cycle being the next transmission cycle after the first transmission cycle.

[0099] In one possible implementation, the first data stream also includes a first forward error correction (FEC) code, which is used to perform FEC detection on the plurality of first messages and the plurality of first CRC codes.

[0100] In one possible implementation, the data volume of the plurality of first messages is less than or equal to a preset first threshold.

[0101] In one possible implementation, the processor is further configured to: generate a second data stream, the second data stream including a plurality of second messages, at least one of the plurality of second messages including a third CRC code; and send the second data stream to the receiving end through the communication interface.

[0102] Sixthly, this application also provides a data transmission apparatus, which may include: a processor and a communication interface, the processor and the communication interface being coupled together, the processor being configured to: receive a first data stream from a sending end through the communication interface, the first data stream including a plurality of first messages, a plurality of first cyclic redundancy check (CRC) codes and a first forward error correction (FEC) code, the first FEC code being used to perform FEC detection on the plurality of first messages and the plurality of first CRC codes; when the CRC check result of the first message corresponding to at least one of the plurality of first CRC codes is correct, send the first message corresponding to the at least one first CRC code to the data link layer; when the CRC check result of the first message corresponding to any one of the plurality of first CRC codes is incorrect, perform FEC detection on the plurality of first messages and the plurality of first CRC codes.

[0103] In one possible implementation, after performing FEC detection on the plurality of first messages and the plurality of first CRC codes, the processor is further configured to: send the plurality of first messages to the data link layer when the FEC detection results of the plurality of first messages and the plurality of first CRC codes are correct; and perform FEC error correction on the plurality of first messages and the plurality of first CRC codes when the FEC verification results of the plurality of first messages and the plurality of first CRC codes are incorrect, thereby obtaining corrected plurality of first messages.

[0104] In one possible implementation, M first CRC codes are inserted after every N first messages. These M first CRC codes are used to perform CRC checks on the N first messages, where M and N are both integers greater than 0.

[0105] In one possible implementation, before sending the first message corresponding to at least one of the first CRC codes to the data link layer when the CRC check result of the first message corresponding to at least one of the plurality of first CRC codes is correct, the processor is further configured to: determine the transmission mode of the plurality of first messages as a first transmission mode based on a first alignment word, the first alignment word being used to indicate that the transmission mode of the plurality of first messages is the first transmission mode; and when the transmission mode of the plurality of first messages is determined to be the first transmission mode, perform CRC check on the first message corresponding to at least one of the plurality of first CRC codes.

[0106] In one possible implementation, the first data stream is sent within a first transmission cycle, and the first data stream also includes the first alignment word.

[0107] In one possible implementation, the first data stream is sent within a first transmission cycle, and the first alignment word is sent within a third transmission cycle, the third transmission cycle being the previous transmission cycle of the first transmission cycle.

[0108] In one possible implementation, the processor is further configured to: receive a second data stream from the sender via the communication interface, the second data stream including a plurality of second messages and a second FEC code, the second FEC code being used to perform FEC detection on the plurality of second messages; and when the FEC detection result of the plurality of second messages is correct, send the plurality of second messages to the data link layer.

[0109] In one possible implementation, before sending the plurality of second messages to the data link layer when the FEC detection result of the plurality of second messages is correct, the processor is further configured to: determine the transmission mode of the plurality of second messages as a second transmission mode based on the second alignment word; and perform FEC detection on the plurality of second messages when the transmission mode of the plurality of second messages is determined to be the second transmission mode.

[0110] In a seventh aspect, this application also provides a data transmission apparatus, which may include units for implementing the methods described in the above aspects and their various possible implementations.

[0111] Eighthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by at least one processor, is used to implement the methods described in the foregoing aspects and any possible implementation thereof.

[0112] Ninthly, this application also provides a computer program product, which, when executed by at least one processor, is used to implement the methods described in the foregoing aspects and any possible implementation thereof.

[0113] The data transmission device, computer storage medium, and computer program product provided in this application are all used to execute the data transmission method provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the data transmission method provided above, and will not be repeated here. Attached Figure Description

[0114] Figure 1 This is a schematic diagram illustrating the working principle of serializer / deserializer technology;

[0115] Figure 2 This is a schematic flowchart of existing data transmission methods;

[0116] Figure 3 This is a flowchart illustrating the data transmission method 100 provided in an embodiment of this application;

[0117] Figure 4 This is a schematic diagram of the first data stream provided in an embodiment of this application;

[0118] Figure 5 This is another schematic diagram of the first data stream provided in the embodiments of this application;

[0119] Figure 6 This is a schematic diagram of the first message provided in an embodiment of this application;

[0120] Figure 7 This is a schematic diagram of the target message provided in an embodiment of this application;

[0121] Figure 8 This is yet another schematic diagram of the first data stream provided in the embodiments of this application;

[0122] Figure 9 This is yet another schematic diagram of the first data stream provided in the embodiments of this application;

[0123] Figure 10 This is a schematic diagram of the second data stream provided in an embodiment of this application;

[0124] Figure 11 This is a flowchart illustrating the data transmission method 200 provided in an embodiment of this application;

[0125] Figure 12 This is a flowchart illustrating the data transmission method 300 provided in an embodiment of this application;

[0126] Figure 13 This is a flowchart illustrating the data transmission method 400 provided in an embodiment of this application;

[0127] Figure 14 This is a flowchart illustrating the data transmission method provided in an embodiment of this application;

[0128] Figure 15 This is a schematic block diagram of the data transmission device 500 provided in the embodiments of this application;

[0129] Figure 16 This is a schematic block diagram of the data transmission device 600 provided in an embodiment of this application;

[0130] Figure 17 This is a schematic block diagram of the data transmission device 700 provided in an embodiment of this application;

[0131] Figure 18 This is a schematic block diagram of the data transmission device 800 provided in the embodiments of this application. Detailed Implementation

[0132] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0133] In this application, the terms "first," "second," and similar words do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms "a" or "one," and similar words, do not indicate a quantity limitation, but rather indicate the presence of at least one.

[0134] In this application, terms such as “connection” are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect, equivalent to connectivity in a broad sense.

[0135] In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0136] In this application, unless otherwise stated, "multiple" means two or more. For example, multiple messages means two or more types of messages.

[0137] First, let me introduce some of the terms mentioned in the embodiments of this application.

[0138] 1. Serializer (SER) / deserializer (DES) technology, abbreviated as SERDES technology

[0139] SERDES technology refers to the process where multiple low-speed parallel signals are converted into a single high-speed serial signal by a serializer at the transmitting end, and then transmitted to the receiving end through a single transmission line (such as a cable).

[0140] Correspondingly, at the receiving end, the high-speed serial signal is converted back into multiple low-speed parallel signals by the deserializer.

[0141] Example, Figure 1 A schematic diagram illustrating the working principle of SERDES transmission is shown. Figure 1 The diagram illustrates the data transmission process in transmission direction 1 and transmission direction 2, which are inverses of each other.

[0142] (1) Data transmission process in transmission direction 1: At the transmitting end 1, parallel signals 1 and 2 are converted into serial signal 1 by serializer 1 and transmitted to the receiving end 1 through transmission line 1; correspondingly, at the receiving end 1, the serial signal 1 is converted into parallel signals 1 and 2 by deserializer 1.

[0143] (2) Data transmission process in transmission direction 2: At the transmitting end 2, parallel signals 3 and 4 are converted into serial signal 2 by serializer 2 and transmitted to the receiving end 2 through transmission line 2; correspondingly, at the receiving end 2, the serial signal 2 is converted into parallel signals 3 and 4 by deserializer 2.

[0144] In one possible implementation, sender 1 can be applied to data transmission device 1, and receiver 1 can be applied to data transmission device 2. That is, data transmission device 1 and data transmission device 2 can transmit data in transmission direction 1 via SERDES. Similarly, sender 2 can be applied to data transmission device 3, and receiver 2 can be applied to data transmission device 4. That is, data transmission device 3 and data transmission device 4 can transmit data in transmission direction 2 via SERDES.

[0145] In another possible implementation, sender 1 and receiver 2 can be applied to data transmission device 1, and receiver 1 and sender 2 can be applied to data transmission device 2. That is, data transmission device 1 and data transmission device 2 can perform bidirectional data transmission through SERDES.

[0146] It should be noted that clock timing is also extremely important for applications using serial deserializers. SERDES embeds a clock in the signal, allowing all components, including the transmitter and receiver, to synchronize based on the embedded clock.

[0147] 2. UB Protocol

[0148] The Unified Bus protocol is a chip SERDES interface protocol that supports SERDES connection scenarios for general-purpose chips in data centers, such as peripheral expansion, direct processor connection, heterogeneous direct connection, network connection, and memory expansion. Through the UB protocol, data centers can build a network with a unified protocol.

[0149] The UB protocol stack consists of the following 6 layers. The layers of this protocol stack can be flexibly configured, and different scenarios and applications can select the required protocol layer according to their actual situation.

[0150] (1) Physical layer: Defines the rules for physical connections in each scenario. The physical layer includes the Physical Codec Sub-layer (PCS) for FEC encoding or FEC decoding of data.

[0151] (2) Data link layer: Defines the point-to-point transmission mode of the protocol;

[0152] (3) Network layer: describes the network composition;

[0153] (4) Transport layer: Defines the network transmission method;

[0154] (5) Transaction layer: Defines the transmission commands and consistency protocols;

[0155] (6) Function layer: Provides data processing capabilities.

[0156] 3. Forward error correction (FEC)

[0157] FEC (Fixed Error Correction) is a widely used coding technique in communication systems. FEC can effectively reduce the bit error rate (BER) of a system with minimal redundancy overhead, extending transmission distance and thus reducing system costs. However, the stronger the error correction capability of FEC, the greater the latency introduced during encoding and decoding.

[0158] Taking Reed-Solomon (RS) coding as an example, RS coding is a forward error correction channel coding with strong error correction capabilities. RS coding can correct both random errors and burst errors. RS coding refers to the technique of pre-coding the signal according to a certain algorithm before it is sent into the transmission channel, adding redundant codes with the characteristics of the signal itself. At the receiving end, the received signal is detected according to the corresponding algorithm to find and correct the bit errors generated during transmission through the channel.

[0159] For example, the sending end performs FEC encoding on 10 original data packets and adds 2 check packets, resulting in 12 packets. These 12 packets are then transmitted to the receiving end through the channel. The receiving end can detect the 12 received data packets according to a corresponding algorithm, locate the errors occurring during transmission, and further correct these errors using an error correction algorithm.

[0160] 4. Cyclic Redundancy Check (CRC)

[0161] CRC is one of the most commonly used error-checking codes in data communication. Its characteristic is that the lengths of the information field and the check field can be arbitrarily selected. CRC is a data transmission error detection function that performs polynomial calculations on the data and appends the result to the end of the frame. The receiving device also executes a similar algorithm to ensure the correctness and integrity of data transmission.

[0162] For example, with the information sequence 110011, the generator polynomial is G(x) = x. 4 +x 3 Taking the polynomial sequence 11001 as an example, the information sequence to be sent is shifted left by 4 bits to generate a new sequence 1100110000. Using the modulo-2 algorithm, the new sequence is divided by the polynomial sequence 11001, resulting in a remainder of 1001, which is the check sequence. This check sequence 1001 is then added to the information sequence 110011, resulting in the transmitting sequence 1100111001. Similarly, the receiving end performs a similar modulo-2 algorithm on the information sequence 11001 in the transmitting sequence 1100111001. If the resulting check sequence is also 1001, then the received information sequence is confirmed to be correctly received.

[0163] Please refer to the following first. Figure 2 , Figure 2 A flowchart illustrating an existing data transmission method is shown. This method can be applied to a communication system, which includes a transmitter and a receiver, and data transmission can occur between the transmitter and the receiver. Figure 2 As shown, the data transmission method may include the following steps. It should be noted that the steps listed below may be performed in various orders and / or occur simultaneously, and are not limited to... Figure 2 The execution order is shown.

[0164] At the sending end:

[0165] (1) The CRC generation module generates multiple messages, at least one of which includes a CRC code.

[0166] (2) The CRC generation module sends the multiple messages to the FEC encoding module.

[0167] (3) The FEC encoding module performs FEC encoding on the multiple messages to obtain FEC codes.

[0168] (4) The FEC encoding module sends the multiple messages and the FEC code to the parallel-to-serial conversion module.

[0169] (5) The parallel-to-serial conversion module performs parallel-to-serial conversion on multiple messages and the FEC code to obtain a data stream, which includes the multiple messages and the FEC code.

[0170] (6) The parallel-to-serial conversion module sends the data stream to the receiving end.

[0171] At the receiving end:

[0172] (7) The serial-to-parallel conversion module performs serial-to-parallel conversion on the data stream to obtain the multiple messages and the FEC code.

[0173] (8) The serial-to-parallel conversion module sends the multiple messages and the FEC code to the FEC detection module.

[0174] (9) The FEC detection module performs FEC detection on the multiple messages based on the FEC code. If the FEC detection result of the multiple messages is correct, then proceed to step (10); if the FEC detection result of the multiple messages is incorrect, then proceed to steps (11) to (13).

[0175] (10) The FEC detection module sends the multiple messages to the CRC verification module.

[0176] (11) The FEC detection module sends the data stream to the FEC error correction module.

[0177] (12) The FEC error correction module performs FEC error correction on the multiple messages to obtain the corrected messages.

[0178] (13) The FEC error correction module sends the corrected multiple messages to the CRC verification module.

[0179] (14) The CRC check module performs CRC check on the multiple messages.

[0180] For example, taking the communication system using the above data transmission method as an example that follows the UB protocol, the above CRC generation module and CRC verification module are located in the data link layer of the UB protocol, and the above FEC encoding module, parallel-to-serial conversion module, serial-to-parallel conversion module, FEC detection module and FEC error correction module are located in the physical layer of the UB protocol. Among them, the FEC encoding module, FEC detection module and FEC error correction module are located in the physical coding sublayer of the physical layer.

[0181] However, in step (9) above, the receiving end can only perform FEC detection on the multiple messages after receiving the multiple messages and the FEC code, and the process of receiving the multiple messages and the FEC code will take a long time. Therefore, the data transmission delay is large.

[0182] To address the problems existing in current data transmission methods, this application provides a data transmission method and apparatus that can reduce data transmission latency.

[0183] Please refer to the following. Figure 3 , Figure 3 A schematic flowchart of a data transmission method 100 provided in an embodiment of this application is shown. Figure 3 As shown, the method 100 may include the following steps. It should be noted that the steps listed below may be performed in various orders and / or occur simultaneously, and are not limited to... Figure 3 The execution order is shown.

[0184] Optionally, the method 100 can be applied to a transmitting end in a communication system, which also includes a receiving end, and data transmission can occur between the transmitting end and the receiving end. Optionally, the communication system can follow various data transmission protocols, and this application does not limit this. For example, the data transmission protocol can be the UB protocol.

[0185] S101. The sending end generates a first data stream, which includes multiple first messages and multiple first cyclic redundancy check (CRC) codes, and at least one of the multiple first messages includes a second CRC code.

[0186] It should be noted that the message described in this application may also be a flit, or referred to as a flit, which is the basic unit for transmitting data between the data link layer and the physical layer.

[0187] In one possible implementation, M first CRC codes can be inserted after every N first messages, where M and N are both integers greater than 0.

[0188] In one possible implementation, the sum of the lengths of the N first messages and the lengths of the M first CRC codes inserted after the N first messages can be less than the length of one codeword.

[0189] The codewords mentioned in this application refer to the units of FEC encoding and decoding performed by the physical coding sublayer. Since different algorithms are used for FEC encoding and decoding, the specific length of the codewords is different, and this application does not make a specific limitation on this.

[0190] Optionally, the starting position of the M first CRC codes inserted after every N first messages can be aligned with the starting position of each of the N first messages. That is, when the total length of the M first CRC codes is less than the length of one first message, data padding, such as padding with "0", can be used to make the sum of the length of the M first CRC codes and the length of the padding bits equal to an integer multiple of the length of the first message.

[0191] For example, if a first CRC code is inserted after a first message, and the length of the first message is 160 bits and the length of the first CRC code is 32 bits, then by padding the 32-bit first CRC code with 128 bits of "0", the sum of the length of the first CRC code and the length of the padding data can be made to be an integer multiple of the length of the first message.

[0192] Optionally, this application does not limit the values ​​of M and N.

[0193] In one possible implementation, M can be equal to N. For example, two first CRC codes can be inserted after every two first messages. The two first messages correspond one-to-one with the two first CRC codes. That is, each of the two first CRC codes is generated based on the first message corresponding to each first CRC code and is used to perform CRC verification on each first message.

[0194] Example, Figure 4 A schematic diagram of a first data stream provided in an embodiment of this application is shown. For example... Figure 4 As shown, the first data stream includes multiple first messages (such as...). Figure 4 The first message 1 and the first message 2 shown in the figure) and multiple first CRC codes (such as Figure 4 The first CRC code 1 and the first CRC code 2 are shown in the diagram. The first CRC code 1 and the first CRC code 2 are inserted after the first message 1 and the first message 2. The first CRC code 1 is generated based on the first message 1 and is used to perform CRC verification on the first message 1. The first CRC code 2 is generated based on the first message 2 and is used to perform CRC verification on the first message 2.

[0195] It should be noted that, Figure 4 This paper only takes the insertion of the first CRC code 1 and the first CRC code 2 after the first message 1 and the first message 2 to form a data group 1 as an example. The first data stream may include multiple similar data groups 1, which will not be listed one by one in this application.

[0196] In another possible implementation, N can be greater than M. For example, a first CRC code can be inserted after every two first messages. That is, the first CRC code is generated based on the two first messages and is used to perform CRC verification on the two first messages.

[0197] When the data transmission method provided in the embodiments of this application is used, and N is greater than M, the number of CRC calculations can be reduced, thereby saving CRC calculation resources and calculation time.

[0198] Example, Figure 5 Another schematic diagram of the first data stream provided in an embodiment of this application is shown. For example... Figure 5 As shown, the first data stream includes multiple first messages (such as...). Figure 5 The first message 1 and the first message 2 shown in the figure) and multiple first CRC codes (such as Figure 5 The first CRC code 1 is shown in the figure. The first CRC code 1 is inserted after the first message 1 and the first message 2. The first CRC code 1 is generated based on the first message 1 and the first message 2 and is used to perform CRC verification on the first message 1 and the first message 2.

[0199] It should be noted that, Figure 5 This paper only describes the case of inserting the first CRC code 1 after the first message 1 and the first message 2 to form a data group 2. The first data stream may include multiple similar data groups 2, which will not be listed one by one in this application.

[0200] In another possible implementation, N can be less than M. For example, two CRC codes can be inserted after each first message. These two first CRC codes are generated based on the first message and are used to perform CRC verification on the first message.

[0201] When the data transmission method provided in the embodiments of this application is less than M, the CRC verification capability can be improved.

[0202] Optionally, this application does not limit the number of first messages including the second CRC code among the plurality of first messages.

[0203] In one possible implementation, some of the first messages in the plurality of first messages may include a second CRC code. For example, the first message at the beginning and the first message at the end of the plurality of first messages may include a second CRC code.

[0204] For example, taking a first data stream that includes three first messages as an example, Figure 6 A schematic diagram of a first message provided in an embodiment of this application is shown. Figure 6 As shown, the three first messages are first message 1, first message 2, and first message 3. First message 1 includes a message header 1, valid data 1, and a second CRC code 1. First message 2 includes a message header 2 and valid data 2. First message 3 includes a message header 3, valid data 3, and a second CRC code 2. The second CRC code 1 is generated based on message header 1 and valid data 1 and is used to perform CRC verification on message header 1 and valid data 1. The second CRC code 2 is generated based on first message 2, message header 3, and valid data 3 and is used to perform CRC verification on first message 2, message header 3, and valid data 3.

[0205] Using the data transmission method provided in the embodiments of this application, only the header and trailer of the first messages include the second CRC code, and the payload field in the remaining positions of the first messages can be used to carry valid data, which can improve the transmission efficiency of valid data.

[0206] In another possible implementation, each of the plurality of first messages may include a second CRC code, which is generated based on the message header and valid data of each first message and is used to perform CRC verification on the message header and valid data of each first message.

[0207] The data transmission method provided in this application includes a second CRC code in each of the plurality of first messages, which can improve the CRC verification capability.

[0208] Optionally, S101 may include: the sending end acquires the plurality of first messages, inserts M first CRC codes after every N first messages, and obtains the first data stream, wherein M and N are both integers greater than 0.

[0209] In one possible implementation, taking the communication system following the UB protocol as an example, the sending end can obtain the multiple first messages at the physical layer, such as the physical coding sublayer of the physical layer, and insert M first CRC codes after every N first messages to obtain the first data stream.

[0210] Optionally, the sending end may generate the plurality of first messages at the data link layer and send the plurality of first messages to the physical coding sublayer. Accordingly, the physical coding sublayer receives the plurality of first messages from the data link layer.

[0211] In one possible implementation, the sending end can acquire multiple target packets at the data link layer; add a second CRC code to at least one of the multiple target packets to obtain multiple first packets that correspond one-to-one with the multiple target packets.

[0212] Example, Figure 7 A schematic diagram of the target message provided in an embodiment of this application is shown. Wherein, Figure 7 (a) shows a target message that does not reserve a field for adding a second CRC code (such as a target message located outside the header and trailer among multiple target messages). Figure 7 (b) shows the target message for which a field is reserved for adding a second CRC code (such as the target message located at the beginning or end of the multiple target messages).

[0213] like Figure 7 As shown in (a), the target message may include a header and a payload field, which carries valid data. Figure 7 As shown in (b), the target message may include a message header and a payload. The payload field is used to carry valid data and padding data (such as "0"). The field used to carry padding data may also be a reserved field.

[0214] For example, the sender in such Figure 7 After adding the second CRC code to the reserved field of the target message shown in (b), the first message corresponding to the target message can be obtained (e.g., Figure 6 The first message 1 or the first message 3 shown in the figure means that the second CRC code can partially or completely cover the filling data in the reserved field.

[0215] It should be noted that each of the plurality of first CRC codes is used (at the physical coding sublayer) to perform CRC verification on the first message corresponding to the first message with the first CRC code. The second CRC code included in the first message is used (at the data link layer) to perform CRC verification on the message header and the valid data in the first message, or the second CRC code included in the first message is used to perform CRC verification on the message header, the valid data in the first message, and at least one first message preceding the first message that does not contain a second CRC code.

[0216] Optionally, prior to S101, the method 100 may further include: when the sending end determines that the transmission mode of the plurality of first messages is the first transmission mode if the data amount of the plurality of first messages is less than or equal to a preset first threshold, the sending end may also determine that the transmission mode of the plurality of first messages is the first transmission mode. That is, the sending end may monitor the data amount of the plurality of first messages; when the data amount of the plurality of first messages is less than or equal to the first threshold, the sending end may determine that the transmission mode of the plurality of first messages is the first transmission mode.

[0217] Optionally, the transmission mode described in this application may include the first transmission mode or the second transmission mode. The first transmission mode can be understood as a low-volume mode, also known as a short mode, and the second transmission mode can be understood as a high-volume mode, also known as a long mode.

[0218] Optionally, the sender may indicate the transmission mode of the message sent by the sender to the receiver in various ways, and this application does not limit this.

[0219] In one possible implementation, the first data stream may further include a first alignment word, which indicates that the transmission mode of the plurality of first messages is a first transmission mode. That is, the sender can indicate to the receiver the transmission mode of the messages sent in the current transmission cycle.

[0220] In another possible implementation, the first data stream is transmitted within a first transmission cycle. The first data stream may also include a first alignment word, which indicates that the transmission mode of the message transmitted in the second transmission cycle is the first transmission mode. The second transmission cycle is the next transmission cycle after the first transmission cycle. That is, the sending end can indicate to the receiving end in the current transmission cycle the transmission mode of the message to be transmitted in the next transmission cycle.

[0221] Example, Figure 8 Another schematic diagram of the first data stream provided in an embodiment of this application is shown. For example... Figure 8 As shown, the first data stream transmitted within transmission period T1 may include a first alignment word and multiple first messages (such as...). Figure 8 The first message 1 and the first message 2 shown in the figure) and multiple first CRC codes (such as Figure 8 The first CRC code 1 and the first CRC code 2 are shown in the figure. The first alignment word is used to indicate the transmission mode of the message sent in the transmission period T2, which is the next transmission period after T1.

[0222] It should be noted that, Figure 8 This paper only takes the insertion of the first CRC code 1 and the first CRC code 2 after the first message 1 and the first message 2 to form a data group 3 as an example. The first data stream may include multiple similar data groups 3, which will not be listed one by one in this application.

[0223] It should be noted that the transmission period mentioned in this application refers to the period during which the sending end transmits data of a fixed length. For example, the transmission period may refer to the period during which the length of the first data stream is transmitted.

[0224] Optionally, the first data stream may further include a first forward error correction (FEC) code, which is used to perform FEC detection on the plurality of first messages and the plurality of first CRC codes.

[0225] Using the data transmission method provided in this application embodiment, when the CRC check result is incorrect, there is no need to retransmit. The error location can be located and the error can be corrected by FEC decoding of the multiple first messages and the first FEC code, which can reduce the latency caused by retransmission.

[0226] Optionally, the sending end can perform FEC encoding on the plurality of first messages and the plurality of first CRCs to obtain the first FEC code, which is used for FEC decoding of the plurality of first messages and the plurality of first CRCs.

[0227] Optionally, the FEC decoding described in this application may include FEC detection and / or FEC error correction. FEC detection mainly determines whether there are errors or positioning errors in the portion of the received first data stream other than the first alignment word. FEC error correction mainly corrects the errors.

[0228] Example, Figure 9 Another schematic diagram of the first data stream provided in an embodiment of this application is shown. For example... Figure 9 As shown, the first data stream transmitted within transmission period T1 may include a first alignment word and multiple first messages (such as...). Figure 9 The first message 1 and the first message 2 shown in the figure), and multiple first CRC codes (such as Figure 9 The diagram shows the first CRC code 1 and the first CRC code 2) and the first FEC code. The first FEC code is used for FEC decoding of multiple first messages and the multiple first CRC codes.

[0229] It should be noted that, Figure 9 This paper only takes the insertion of the first CRC code 1 and the first CRC code 2 after the first message 1 and the first message 2 to form a data group 4 as an example. The first data stream may include multiple similar data groups 4, which will not be listed one by one in this application.

[0230] S102. The sending end sends the first data stream to the receiving end.

[0231] Using the data transmission method provided in this application embodiment, the first data stream generated by the sending end includes a plurality of first messages and a plurality of first CRC codes. Each at least one CRC code among the plurality of first CRC codes is used for CRC verification of the first message corresponding to that at least one CRC code. Thus, after the receiving end receives at least one first CRC code and the first message corresponding to that at least one first CRC code, it can perform CRC verification on the first message corresponding to that at least one first CRC code based on that at least one first CRC code, without waiting for all the plurality of first messages and the plurality of first CRC codes to be received before performing error detection (such as CRC verification), thereby reducing data transmission latency.

[0232] Furthermore, when the CRC check result of the first message corresponding to the at least one first CRC code is correct, the first message corresponding to the at least one first CRC code can be directly sent to the data link layer of the receiving end without FEC decoding, which can reduce the latency required for FEC decoding and thus reduce the latency of data transmission.

[0233] Optionally, the transmitter can send a high-speed, serial first data stream to the receiver using SERDES technology.

[0234] Optionally, the method 100 may further include: the sending end generating a second data stream, the second data stream including a plurality of second messages, at least one of the plurality of second messages including a third CRC code; and sending the second data stream to the receiving end.

[0235] It should be noted that the second data path includes multiple second messages, but does not include the fourth CRC code corresponding to one or more of the multiple second messages. That is, there is no inserted fourth CRC code Q after P second messages, where P and Q are both integers greater than 0.

[0236] Optionally, before the sending end generates the second data stream, the method 100 may further include: if the sending end determines that the transmission mode of the plurality of second messages is the second transmission mode when it determines that the data volume of the plurality of second messages is greater than the first threshold. That is, the sending end can monitor the data volume of the plurality of second messages; when the data volume of the plurality of second messages is greater than the first threshold, it determines that the transmission mode of the plurality of second messages is the second transmission mode.

[0237] Optionally, the second data stream may further include a second alignment word, which is used to indicate that the transmission mode of the plurality of second messages is the second transmission mode.

[0238] Optionally, the second data stream is sent within the first transmission cycle, and the second data stream may further include a second alignment word, which is used to indicate that the transmission mode of the message sent within the second transmission cycle is the second transmission mode, and the second transmission cycle is the next transmission cycle of the first transmission cycle.

[0239] Optionally, the second data stream may also include a second FEC code, which is used for FEC decoding of the plurality of second messages.

[0240] Example, Figure 10 A schematic diagram of the second data stream provided in an embodiment of this application is shown. For example... Figure 10 As shown, the second data stream transmitted within the transmission period T1 may include a second alignment word and multiple second messages (such as...). Figure 10 The second message 1 and the second message 2 shown in the figure are a second FEC code, wherein the second FEC code is used for FEC decoding of the plurality of second messages.

[0241] Optionally, the aforementioned plurality of first messages and the aforementioned plurality of second messages may be the same or different, and this application does not impose any limitation on this.

[0242] In one possible implementation, when the plurality of first messages and the plurality of second messages are the same, the sending end can determine the transmission mode of the plurality of first messages based on the data volume of the plurality of first messages; when the transmission mode of the plurality of messages is the first transmission mode, the aforementioned first data stream is generated; when the transmission mode of the plurality of first messages is the second transmission mode, the aforementioned second data stream is generated.

[0243] Using the data transmission method provided in this application embodiment, the sending end can flexibly determine the transmission mode of the multiple first messages based on the data volume of the multiple first messages. When the data volume is large, the second transmission mode is used, which will not increase the amount of external data transmitted and can prioritize the transmission efficiency of the multiple first messages. When the data volume is small, the first transmission mode is used, and by increasing the transmission of multiple first CRCs, the data transmission delay can be reduced.

[0244] Please refer to the following. Figure 11 , Figure 11 A schematic flowchart of a data transmission method 200 provided in an embodiment of this application is shown. Figure 11 As shown, the method 200 may include the following steps. It should be noted that the steps listed below may be performed in various orders and / or occur simultaneously, and are not limited to... Figure 11 The execution order is shown.

[0245] Optionally, the method 200 can be applied to a receiving end in a communication system, which also includes a transmitting end, and data transmission can occur between the transmitting end and the receiving end. Optionally, the communication system can follow various data transmission protocols, and this application is not limited thereto. For example, the data transmission protocol can be the UB protocol.

[0246] S201. The receiving end receives a first data stream from the sending end. The first data stream includes multiple first messages, multiple first cyclic redundancy check (CRC) codes, and a first forward error correction (FEC) code. The first FEC code is used to perform FEC detection on the multiple first messages and the multiple first CRC codes.

[0247] In one possible implementation, M first CRC codes are inserted after every N first messages. These M first CRC codes are used to perform CRC checks on the N first messages, where M and N are both integers greater than 0.

[0248] It should be noted that the description of the first data stream can be found in the description of method 100 above, and will not be repeated here to avoid repetition.

[0249] In one possible implementation, the sum of the lengths of the N first messages and the lengths of the M first CRC codes inserted after the N first messages can be less than the length of one codeword.

[0250] The codewords mentioned in this application refer to the units of FEC encoding and decoding performed by the physical coding sublayer. Since different algorithms are used for FEC encoding and decoding, the specific length of the codewords is different, and this application does not make a specific limitation on this.

[0251] Optionally, at least one of the plurality of first messages may include a second CRC code.

[0252] It should be noted that each of the plurality of first CRC codes is used (at the physical coding sublayer) to perform CRC verification on the first message corresponding to the first message with the first CRC code. The second CRC code included in the first message is used (at the data link layer) to perform CRC verification on the message header and the valid data in the first message, or the second CRC code included in the first message is used to perform CRC verification on the message header, the valid data in the first message, and at least one first message preceding the first message that does not contain a second CRC code.

[0253] S202. When the CRC check result of the first message corresponding to at least one of the plurality of first CRC codes is correct, the receiving end sends the first message corresponding to the at least one first CRC code to the data link layer.

[0254] Optionally, prior to S202, the method 200 may further include: the receiving end determining, based on a first alignment word, that the transmission mode of the plurality of first messages is a first transmission mode, the first alignment word being used to indicate that the transmission mode of the plurality of first messages is the first transmission mode; and, when the transmission mode of the plurality of first messages is determined to be the first transmission mode, the receiving end performing CRC verification on the first message corresponding to at least one of the plurality of first CRC codes.

[0255] Optionally, the receiving end may obtain the first alignment word in a variety of ways, and this application does not limit this.

[0256] In one possible implementation, the first data stream also includes the first alignment word.

[0257] In one possible implementation, the first data stream is sent within a first transmission cycle, and the first alignment word is sent within a third transmission cycle, the third transmission cycle being the previous transmission cycle of the first transmission cycle.

[0258] S203. When the CRC check result of the first message corresponding to any of the plurality of first CRC codes is incorrect, the receiving end performs FEC detection on the plurality of first messages and the plurality of first CRC codes.

[0259] Optionally, after S203, the method 200 may further include: when the FEC detection results of the plurality of first messages and the plurality of first CRC codes are correct, the receiving end sends the plurality of first messages to the data link layer; when the FEC verification results of the plurality of first messages and the plurality of first CRC codes are incorrect, the receiving end performs FEC error correction on the plurality of first messages and the plurality of first CRC codes to obtain corrected plurality of first messages.

[0260] It should be noted that a correct FEC detection result can be understood as all the multiple first messages and multiple first CRC codes being correct, or the number of erroneous bits in the multiple first messages and multiple first CRC codes being less than or equal to a preset second threshold; an incorrect FEC detection result can be understood as the number of erroneous bits in the multiple first messages and multiple first CRC codes being greater than a preset second threshold.

[0261] Optionally, the method 200 may further include: the receiving end receiving a second data stream from the sending end, the second data stream including a plurality of second messages and a second FEC code, the second FEC code being used to perform FEC detection on the plurality of second messages; when the FEC detection result of the plurality of second messages is correct, the receiving end sending the plurality of second messages to the data link layer.

[0262] Optionally, before the receiving end sends the multiple second messages to the data link layer when the FEC detection result of the multiple second messages is correct, the method 200 may further include: determining the transmission mode of the multiple second messages as a second transmission mode based on the second alignment word; and when the transmission mode of the multiple second messages is determined to be the second transmission mode, the receiving end performs FEC detection on the multiple second messages.

[0263] Using the data transmission method provided in this application embodiment, the first data stream generated by the sending end includes a plurality of first messages and a plurality of first CRC codes. Each at least one CRC code among the plurality of first CRC codes is used for CRC verification of the first message corresponding to that at least one CRC code. Thus, after the receiving end receives at least one first CRC code and the first message corresponding to that at least one first CRC code, it can perform CRC verification on the first message corresponding to that at least one first CRC code based on that at least one first CRC code, without waiting for all the plurality of first messages and the plurality of first CRC codes to be received before performing error detection (such as CRC verification), thereby reducing data transmission latency.

[0264] Furthermore, when the CRC check result of the first message corresponding to the at least one first CRC code is correct, the first message corresponding to the at least one first CRC code can be directly sent to the data link layer of the receiving end without FEC decoding, which can reduce the latency required for FEC decoding and thus reduce the latency of data transmission.

[0265] Please refer to the following. Figure 12 , Figure 12 A schematic flowchart of a data transmission method 300 provided in an embodiment of this application is shown. Figure 12 As shown, the method 300 may include the following steps. It should be noted that the steps listed below may be performed in various orders and / or occur simultaneously, and are not limited to... Figure 12 The execution order is shown.

[0266] Optionally, the method 300 can be applied to a transmitting end in a communication system, which also includes a receiving end, and data transmission can occur between the transmitting end and the receiving end. Optionally, the communication system can follow various data transmission protocols, and this application is not limited thereto. For example, the data transmission protocol can be the UB protocol.

[0267] S301. The sending end determines the transmission mode of the multiple messages 1 as a first transmission mode based on the data volume of the multiple messages 1, and at least one of the multiple messages 1 includes a second CRC code.

[0268] In one possible implementation, taking the communication system as an example that follows the UB protocol, the sending end can execute the above S301 at the physical layer, such as the physical coding sublayer of the physical layer.

[0269] Optionally, the transmission mode described in the embodiments of this application may include the first transmission mode or the second transmission mode.

[0270] It should be noted that the first transmission mode described in this application can be understood as a low-volume mode, also known as short mode, and the second transmission mode described in this application can be understood as a high-volume mode, also known as long mode.

[0271] In one possible implementation, the sending end can determine the transmission mode of the multiple messages 1 as the first transmission mode based on the data volume of the multiple messages 1 and a preset first threshold.

[0272] For example, if the data volume of the multiple messages 1 is less than or equal to the first threshold, the sender can determine that the transmission mode of the multiple messages 1 is the first transmission mode.

[0273] It should be noted that the message described in this application may also be a flit, or referred to as a flit, which is the basic unit for transmitting data between the data link layer and the physical layer.

[0274] In one possible implementation, prior to S301, the method further includes: the sending end acquiring multiple target messages; adding a second CRC code to at least one of the multiple target messages to obtain multiple messages 1 that correspond one-to-one with the multiple target messages.

[0275] In one possible implementation, the sender can add a CRC code to each of the multiple target packets to obtain multiple packets 1 that correspond one-to-one with the multiple target packets.

[0276] In another possible implementation, the sender can add a second CRC code to some of the target messages (such as the target message at the beginning of the target messages and the target message at the end of the target messages) to obtain message 1 corresponding to the part of the target messages. The remaining target messages in the multiple target messages other than the part of the target messages are directly used as message 1.

[0277] For example, a target message located outside the header and trailer may include a header and a payload field, which is used to carry valid data.

[0278] For example, a target message located at the beginning or end includes a header and a payload. The payload field is used to carry valid data and padding data (such as "0"). The field used to carry padding data can also be a reserved field. After the sender adds a second CRC code to the reserved field, it can obtain the first message corresponding to the target message. That is, the second CRC code can partially or completely cover the padding data in the reserved field.

[0279] It should be noted that the sending end can generate this second CRC code at the data link layer.

[0280] For example, taking the communication system following the UB protocol as an example, the data link layer of the sending end can obtain the multiple target packets; the sending end adds a CRC code to each of the multiple target packets in the data link layer to obtain the multiple packets 1 corresponding to the multiple target packets, and sends the multiple packets 1 to the physical layer of the sending end, such as the PCS of the physical layer.

[0281] S302. When the transmission mode of the multiple messages 1 is the first transmission mode, the sending end inserts M first CRC codes after every N messages 1 to obtain data stream 1.

[0282] In one possible implementation, taking the communication system as an example that follows the UB protocol, the sending end can perform the above S302 at the physical layer, such as the physical coding sublayer of the physical layer.

[0283] S303. The sending end adds a first FEC code after the data stream 1 to obtain data stream 2. The first FEC code is used to perform FEC decoding on the data stream 1.

[0284] In one possible implementation, taking the communication system as an example that follows the UB protocol, the sending end can execute the above S303 at the physical layer, such as the physical coding sublayer of the physical layer.

[0285] S304. The sending end sends target data stream 1 to the receiving end, and the target data stream 1 includes the data stream 2.

[0286] In one possible implementation, taking the communication system as an example that follows the UB protocol, the sending end can execute the above S304 at the physical layer.

[0287] In one possible implementation, the target data stream 1 further includes a first alignment word, which is used to indicate that the transmission mode of the plurality of messages 1 is the first transmission mode.

[0288] In another possible implementation, the target data stream 1 is sent within a transmission period T1. The target data stream may also include a first alignment word, which is used to indicate that the transmission mode of the message sent within a transmission period T2 is the first transmission mode, where T2 is the next transmission period after T1.

[0289] It should be noted that the length of data stream 2 described in this application is less than the length of one codeword. The codeword mentioned in this application refers to a unit of FEC encoding / decoding performed by the physical coding sublayer. Since different algorithms are used for FEC encoding / decoding, the specific length of the codeword varies, and this application does not impose a specific limitation on it.

[0290] Optionally, the method 300 may further include: the sending end determining, based on the data volume of the plurality of messages 2, that the transmission mode of the plurality of messages 2 is a second transmission mode, and at least one of the plurality of messages 2 includes a third CRC code; when the transmission mode of the plurality of messages 2 is the second transmission mode, the sending end adds a second FEC code after the plurality of messages 2 to obtain a data stream 3; the sending end sends a target data stream 2 to the receiving end, the target data stream 2 including the data stream 3.

[0291] For example, if the data volume of the multiple messages 2 is greater than the first threshold, the sending end can determine that the transmission mode of the multiple messages 2 is the second transmission mode.

[0292] Optionally, the target data stream 2 may also include a second alignment word, which is used to indicate that the transmission mode of the plurality of messages 2 is the second transmission mode.

[0293] Optionally, the aforementioned multiple messages 1 and multiple messages 2 may be the same or different, and this application does not limit this.

[0294] It should be noted that the parts not described in detail in method 300 can be referred to the corresponding parts in method 100 above. To avoid repetition, they will not be repeated here.

[0295] Figure 13 A schematic flowchart of a data transmission method 400 provided in an embodiment of this application is shown. Figure 13 As shown, the method 400 may include the following steps. It should be noted that the steps listed below may be performed in various orders and / or occur simultaneously, and are not limited to... Figure 13 The execution order is shown.

[0296] Optionally, the method 400 can be applied to a receiving end in a communication system, which also includes a transmitting end, and data transmission can occur between the transmitting end and the receiving end. Optionally, the communication system can follow various data transmission protocols, and this application does not limit this. For example, the data transmission protocol can be the UB protocol.

[0297] S401. The receiving end receives a target data stream 1 from the sending end. The target data stream 1 includes multiple messages 1, multiple first CRC codes and first FEC codes, and at least one of the multiple messages 1 includes a second CRC code.

[0298] In one possible implementation, taking the communication system as an example that follows the UB protocol, the receiving end can perform the above S401 at the physical layer.

[0299] It should be noted that the sum of the lengths of the multiple message 1s, the lengths of the multiple first CRC codes, and the length of the first FEC code is less than the length of one codeword. The codeword mentioned in this application refers to the unit of FEC encoding and decoding performed by the physical coding sublayer. Since different algorithms are used for FEC encoding and decoding, the specific length of the codeword varies, and this application does not impose a specific limitation on it.

[0300] S402. The receiving end determines the transmission mode of the plurality of messages 1 as a first transmission mode based on the first alignment word, wherein the first alignment word is used to indicate that the transmission mode of the plurality of messages 1 is the first transmission mode.

[0301] In one possible implementation, taking the communication system as an example that follows the UB protocol, the receiving end can perform the above S402 at the physical layer, such as the physical coding sublayer of the physical layer.

[0302] Optionally, the receiving end may obtain the first alignment word in a variety of ways, and this application does not limit this.

[0303] In one possible implementation, the target data stream 1 also includes the first alignment word.

[0304] In one possible implementation, the first target data stream 1 is sent within a first transmission cycle, and the first alignment word is sent within a third transmission cycle, which is the transmission cycle preceding the first transmission cycle.

[0305] In another possible implementation, if the transmission mode of the plurality of messages 1 is the first transmission mode, the second data stream includes the plurality of messages 1.

[0306] S403. When the transmission mode of the plurality of messages 1 is the first transmission mode, the receiving end performs CRC verification on the message 1 corresponding to the at least one first CRC code based on each of the plurality of first CRC codes.

[0307] In one possible implementation, taking the communication system as an example that follows the UB protocol, the receiving end can perform the above S403 at the physical layer, such as the physical coding sublayer of the physical layer.

[0308] S404. Whenever the CRC check result of message 1 corresponding to the at least one first CRC code is correct, the receiving end may send message 1 corresponding to the at least one first CRC code to the data link layer.

[0309] In one possible implementation, taking the communication system as an example that follows the UB protocol, the receiving end can execute the above S404 at the physical layer, such as the physical coding sublayer of the physical layer.

[0310] Optionally, when the CRC check result of message 1 corresponding to any of the plurality of first CRC codes is incorrect, the receiving end performs FEC detection on the plurality of messages 1 and the plurality of first CRC codes.

[0311] Furthermore, when the FEC detection results of the multiple messages 1 and the multiple first CRC codes are correct, the receiving end sends the multiple messages 1 to the data link layer; when the FEC detection results of the multiple messages 1 and the multiple first CRC codes are incorrect, the receiving end performs FEC error correction on the multiple messages 1 and the multiple first CRC codes to obtain the corrected multiple messages 1, and sends the corrected multiple messages 1 to the data link layer.

[0312] Optionally, after the data link layer of the receiving end receives multiple packets 1, it can perform CRC verification on the packet header and the valid data in each packet 1 based on the second CRC code included in each of the at least one packets 1, or perform CRC verification on the packet header, the valid data in each packet 1, and at least one packet 1 preceding each packet 1 that does not contain the second CRC code.

[0313] Optionally, the method 400 may further include: a receiving end receiving a target data stream 2 from a sending end, the target data stream 2 including a plurality of packets 2 and a second FEC code, at least one of the plurality of packets 2 including a third CRC code; the receiving end determining the transmission mode of the plurality of packets 2 as a second transmission mode based on a second alignment word, the second alignment word being used to indicate that the transmission mode of the plurality of packets 2 is the second transmission mode; when the transmission mode of the plurality of packets 2 is the second transmission mode, the receiving end performs FEC detection on the plurality of packets 2; when the FEC detection result of the plurality of packets 2 is correct, the receiving end sends the plurality of packets 2 to the data link layer; when the FEC detection result of the plurality of packets 2 is incorrect, the receiving end performs FEC error correction on the plurality of packets 2 and sends the corrected plurality of packets 2 to the data link layer.

[0314] Optionally, after the data link layer of the receiving end receives multiple packets 2, it can perform CRC verification on the packet header and the valid data in each packet 2 based on the third CRC code included in each of the at least one packets 2, or perform CRC verification on the packet header, the valid data in each packet 2, and at least one packet 2 preceding each packet 2 that does not contain the third CRC code.

[0315] For example, such as Figure 6 As shown, the receiving end can perform CRC verification on the message header 1 and valid data 1 based on the second CRC code 1 to obtain valid data 1; and perform CRC verification on the first message 2, message header 3 and valid data 3 based on the second CRC code 2 to obtain valid data 2 and valid data 3.

[0316] Optionally, the aforementioned multiple messages 1 and multiple messages 2 may be the same or different, and this application does not limit this.

[0317] It should be noted that the parts not described in detail in method 400 can be referred to the corresponding parts in method 200 above. To avoid repetition, they will not be repeated here.

[0318] Figure 14A flowchart illustrating a data transmission method provided in an embodiment of this application is shown. This process may include the following steps. It should be noted that the steps listed below may be executed in various orders and / or occur simultaneously, and are not limited to... Figure 14 The execution order is shown.

[0319] On the sending end side:

[0320] (1) The sending end generates multiple first messages at the data link layer, and at least one of the multiple first messages includes a second CRC code.

[0321] (2) The data link layer of the sending end sends the multiple first messages to the physical coding sublayer of the physical layer.

[0322] (3) The sending end monitors the data volume of the multiple first messages at the physical coding sublayer.

[0323] (4) The sending end determines the transmission mode of the multiple first messages based on the data volume of the multiple first messages at the physical coding sublayer.

[0324] When the data volume of the multiple first messages is less than or equal to the preset first threshold, the physical coding sublayer determines that the transmission mode of the multiple first messages is short mode and continues to execute step (5); when the data volume of the multiple first messages is greater than the first threshold, the physical coding sublayer determines that the transmission mode of the multiple first messages is long mode and continues to execute step (10).

[0325] (5) When the transmission mode of the multiple first messages is short mode, the sending end generates a first alignment word in the physical coding sublayer. The first alignment word is used to indicate that the transmission mode of the message sent in the target transmission period is short mode.

[0326] (6) The sending end generates multiple first CRC codes based on the multiple first messages at the physical coding sublayer.

[0327] For example, this physical coding sublayer inserts M first CRC codes after every N first messages, where M and N are both integers greater than 0.

[0328] (7) The sending end performs FEC encoding on the multiple first messages and the multiple first CRC codes in the physical coding sublayer to generate the first FEC code.

[0329] (8) The sending end performs parallel-to-serial conversion on the first alignment word, the plurality of first messages, the plurality of first CRC codes and the first FEC code at the physical layer to obtain a first data stream, the first data stream including the first alignment word, the plurality of first messages, the plurality of first CRC codes and the first FEC code.

[0330] (9) The physical layer of the sending end sends the first data stream to the receiving end.

[0331] Optionally, the target transmission period mentioned in step (5) above can be the transmission period for sending the first data stream, or it can be the next transmission period after the transmission period for sending the first data stream.

[0332] (10) When the transmission mode of the plurality of first messages is long mode, the sending end generates a second alignment word in the physical coding sublayer. The second alignment word is used to indicate that the transmission mode of the message sent in the target transmission period is long mode.

[0333] (11) The sending end performs FEC encoding on the multiple first messages at the physical coding sublayer to generate a second FEC code.

[0334] (12) The sending end performs parallel-to-serial conversion on the second alignment word, the plurality of first messages and the second FEC code at the physical layer to obtain a second data stream, the second data stream including the second alignment word, the plurality of first messages and the second FEC code.

[0335] (13) The sending end sends the second data stream to the receiving end at the physical layer.

[0336] Optionally, the target transmission period mentioned in step (10) above can be the transmission period for sending the second data stream, or it can be the next transmission period after the transmission period for sending the second data stream.

[0337] On the receiving end side:

[0338] (14) The receiving end performs serial-to-parallel conversion on the first data stream at the physical layer to obtain the first alignment word, the plurality of first messages, the plurality of first CRC codes and the first FEC code.

[0339] (15) The receiving end parses the third alignment word in the physical coding sublayer of the physical layer to obtain the first mode information in the third alignment word. The first mode information is used to indicate that the transmission mode of the plurality of first messages is short mode.

[0340] Optionally, the third alignment word can be the first alignment word; or the third alignment word can be the one received by the receiving end during the third transmission period, where the third transmission period is the previous transmission period of the transmission period for receiving the first data stream.

[0341] (16) The receiving end determines the transmission mode of the plurality of first messages as short mode based on the first mode information at the physical coding sublayer.

[0342] (17) When the transmission mode of the multiple first messages is short, the receiving end performs CRC verification on the first message corresponding to at least one of the multiple first CRC codes in the physical coding sub-layer.

[0343] (18) When the CRC check result of the first message corresponding to each of the at least one first CRC code is correct, the physical coding sublayer of the receiving end sends the first message corresponding to the at least one first CRC code to the data link layer.

[0344] (19) When the CRC check result of the first message corresponding to any of the multiple first CRC codes is incorrect, the receiving end performs FEC detection on the multiple first messages and the multiple first CRC codes at the physical coding sub-layer.

[0345] When the FEC detection results of the multiple first messages and the multiple first CRC codes are correct, the receiving end continues to execute step (20); when the FEC detection results of the multiple first messages and the multiple first CRC codes are incorrect, the receiving end continues to execute steps (21) to (22).

[0346] (20) The physical coding sublayer of the receiving end sends the multiple first messages to the data link layer.

[0347] (21) The receiving end performs FEC error correction on the multiple first messages and the multiple first CRC codes at the physical coding sub-layer to obtain the corrected multiple first messages.

[0348] (22) The physical coding sublayer of the receiving end sends multiple corrected first messages to the data link layer.

[0349] (23) The receiving end performs serial-to-parallel conversion on the second data stream at the physical layer to obtain the second alignment word, the multiple first messages and the second FEC code.

[0350] (24) The receiving end parses the fourth alignment word in the physical coding sublayer of the physical layer to obtain the second mode information in the fourth alignment word. The second mode information is used to indicate that the transmission mode of the plurality of first messages is long mode.

[0351] Optionally, the fourth alignment word can be the second alignment word; or the fourth alignment word can be the one received by the receiving end during the third transmission period, the third transmission period being the transmission period preceding the transmission period of receiving the second data stream.

[0352] (25) The receiving end determines the transmission mode of the plurality of first messages as long mode based on the second mode information at the physical coding sublayer.

[0353] (26) When the transmission mode of the multiple first messages is long, the receiving end performs FEC detection on the multiple first messages at the physical coding sublayer.

[0354] When the FEC detection result of the multiple first messages is correct, the receiver continues to execute step (27); when the FEC detection result of the multiple first messages is incorrect, the receiver continues to execute steps (28) to (29).

[0355] (27) The physical coding sublayer of the receiving end sends the multiple first messages to the data link layer.

[0356] (28) The receiving end performs FEC error correction on the multiple first messages at the physical coding sublayer to obtain the corrected multiple first messages.

[0357] (29) The physical coding sublayer of the receiving end sends multiple corrected first messages to the data link layer.

[0358] (30) The receiving end performs CRC verification on the header of each first message and the valid data in each first message at the data link layer based on the second CRC code included in each first message in the at least one first message, or performs CRC verification on the header of each first message, the valid data in each first message and at least one first message preceding each first message that does not contain the second CRC code.

[0359] The above combination Figures 3 to 14 The data transmission method provided in the embodiments of this application has been introduced. The data transmission device provided in this application will be introduced below.

[0360] Please refer to Figure 15 , Figure 15 A schematic block diagram of a data transmission apparatus 500 provided in an embodiment of this application is shown. This apparatus 500 can be (or be used for) the transmitting end described in the embodiments of method 100 or method 300 above.

[0361] like Figure 15 As shown, the device 500 may include a generation unit 501 and a transmission unit 502. The generation unit 501 is used to generate a first data stream, which includes a plurality of first messages and a plurality of first cyclic redundancy check (CRC) codes, and at least one of the plurality of first messages includes a second CRC code. The transmission unit 502 is used to transmit the first data stream to a receiving end.

[0362] In one possible implementation, M first CRC codes are inserted after every N first messages, where M and N are both integers greater than 0.

[0363] In one possible implementation, the first data stream further includes a first alignment word, which is used to indicate that the transmission mode of the plurality of first messages is a first transmission mode.

[0364] In one possible implementation, the first data stream is sent within a first transmission cycle, and the first data stream also includes a first alignment word, which is used to indicate that the transmission mode of the message sent within a second transmission cycle is the first transmission mode, and the second transmission cycle is the next transmission cycle of the first transmission cycle.

[0365] In one possible implementation, the first data stream also includes a first forward error correction (FEC) code, which is used to perform FEC detection on the plurality of first messages and the plurality of first CRC codes.

[0366] In one possible implementation, the device may further include a determining unit 503, which is used to determine the transmission mode of the plurality of first messages as the first transmission mode before the generating unit 501 generates the first data stream, provided that the data amount of the plurality of first messages is less than or equal to a preset first threshold.

[0367] In one possible implementation, the generating unit 501 is further configured to generate a second data stream, which includes a plurality of second messages, at least one of which includes a third CRC code; the sending unit is further configured to send the second data stream to the receiving end.

[0368] Figure 15 One or more of the units in the illustrated embodiments can be implemented by software, hardware, firmware, or a combination thereof. The software or firmware includes, but is not limited to, computer program instructions or code, and can be executed by a hardware processor. The hardware includes, but is not limited to, various integrated circuits, such as a central processing unit (CPU), a digital signal processor (DSP), a field-programmable gate array (FPGA), or an application-specific integrated circuit (ASIC).

[0369] Please see Figure 16 , Figure 16 A schematic block diagram of a data transmission device 600 provided in an embodiment of this application is shown. The device 600 may include a processor 601 and a communication interface 602, wherein the processor 601 is coupled to the communication interface 602.

[0370] The processor 601 in this embodiment may include one or more processing units. Optionally, the processing unit may include, but is not limited to, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor, a microcontroller, or any conventional processor.

[0371] For example, processor 601 is used to generate a first data stream, which includes a plurality of first messages and a plurality of first cyclic redundancy check (CRC) codes, at least one of the plurality of first messages including a second CRC code; and to send the first data stream to the receiving end through the communication interface 602.

[0372] In an alternative example, those skilled in the art will understand that the device 600 may specifically be (or used for) the sending end described in the above-described method 100 embodiment or method 300 embodiment. The device 600 may be used to execute the various processes and / or steps corresponding to the sending end in the method 100 embodiment or method 300 embodiment. To avoid repetition, these will not be described again here.

[0373] Optionally, the device 600 may also include a memory 603.

[0374] The memory 603 can be volatile memory or non-volatile memory, or it can include both. The non-volatile memory can 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. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).

[0375] Specifically, memory 603 is used to store program code and instructions of the target tracking device. Optionally, memory 603 is also used to store data obtained by processor 601 during the execution of the above-described method 200 embodiments, such as the first CRC code, the first message, the first FEC code, etc.

[0376] Alternatively, the memory 603 may be a separate device or integrated into the processor 601.

[0377] It should be noted that, Figure 16 Only a simplified design of the device 600 is shown. In practical applications, the device 600 may also include other necessary components, including but not limited to any number of communication interfaces, processors, selectors, memories, etc., and all devices 600 that can implement this application are within the protection scope of this application.

[0378] In one possible design, the device 600 can be a chip. Optionally, the chip may further include one or more memories for storing computer-executable instructions, which, when the chip device is running, can be executed by a processor to cause the chip to perform the steps described in method 100 or method 300 above.

[0379] Optionally, the chip device can be a field-programmable gate array, a dedicated integrated circuit, a system-on-a-chip, a central processing unit, a network processor, a digital signal processing circuit, a microcontroller, or a programmable controller or other integrated chip to implement the relevant functions.

[0380] Please refer to Figure 17 , Figure 17 A schematic block diagram of a data transmission apparatus 700 provided in an embodiment of this application is shown. This apparatus 700 can be (or be used for) the receiving end described in the embodiments of method 200 or method 400 above.

[0381] like Figure 17 As shown, the device 700 may include a receiving unit 701, a transmitting unit 702, and an FEC detection unit 703. The receiving unit 701 receives a first data stream from a transmitting end. The first data stream includes multiple first packets, multiple first cyclic redundancy check (CRC) codes, and a first forward error correction (FEC) code. The first FEC code is used to perform FEC detection on the multiple first packets and the multiple first CRC codes. The transmitting unit 702 transmits the first packet corresponding to at least one of the multiple first CRC codes to the data link layer when the CRC check result of the first packet corresponding to at least one of the multiple first CRC codes is correct. The FEC detection unit 703 performs FEC detection on the multiple first packets and the multiple first CRC codes when the CRC check result of the first packet corresponding to any one of the multiple first CRC codes is incorrect.

[0382] In one possible implementation, the device 700 may further include an FEC error correction unit 704. After performing FEC detection on the plurality of first messages and the plurality of first CRC codes, the sending unit 702 is further configured to send the plurality of first messages to the data link layer when the FEC detection results of the plurality of first messages and the plurality of first CRC codes are correct; the FEC error correction unit 704 is configured to perform FEC error correction on the plurality of first messages and the plurality of first CRC codes when the FEC verification results of the plurality of first messages and the plurality of first CRC codes are incorrect, thereby obtaining the corrected plurality of first messages.

[0383] In one possible implementation, M first CRC codes are inserted after every N first messages. These M first CRC codes are used to perform CRC checks on the N first messages, where M and N are both integers greater than 0.

[0384] In one possible implementation, the device 700 may further include a determining unit 705 and a CRC verification unit 706. The determining unit 705 is used to determine the transmission mode of the plurality of first messages as a first transmission mode based on a first alignment word before sending the first message corresponding to the at least one first CRC code to the data link layer when the CRC verification result of the first message corresponding to each of the plurality of first CRC codes is correct. The first alignment word is used to indicate that the transmission mode of the plurality of first messages is the first transmission mode. The CRC verification unit 706 is used to perform CRC verification on the first message corresponding to each of the plurality of first CRC codes when the transmission mode of the plurality of first messages is determined to be the first transmission mode.

[0385] In one possible implementation, the first data stream also includes the first alignment word.

[0386] In one possible implementation, the first data stream is sent within a first transmission cycle, and the first alignment word is sent within a third transmission cycle, the third transmission cycle being the previous transmission cycle of the first transmission cycle.

[0387] In one possible implementation, the receiving unit 701 is further configured to receive a second data stream from the sending end, the second data stream including a plurality of second messages and a second FEC code, the second FEC code being used to perform FEC detection on the plurality of second messages; the sending unit 702 is further configured to send the plurality of second messages to the data link layer when the FEC detection result of the plurality of second messages is correct.

[0388] In one possible implementation, the determining unit 705 is further configured to determine the transmission mode of the plurality of second messages as a second transmission mode based on the second alignment word before sending the plurality of second messages to the data link layer when the FEC detection result of the plurality of second messages is correct; the FEC detection unit 703 is further configured to perform FEC detection on the plurality of second messages when the transmission mode of the plurality of second messages is determined to be the second transmission mode.

[0389] Figure 17One or more of the units in the illustrated embodiments can be implemented by software, hardware, firmware, or a combination thereof. The software or firmware includes, but is not limited to, computer program instructions or code, and can be executed by a hardware processor. The hardware includes, but is not limited to, various integrated circuits, such as a central processing unit (CPU), a digital signal processor (DSP), a field-programmable gate array (FPGA), or an application-specific integrated circuit (ASIC).

[0390] Please see Figure 18 , Figure 18 A schematic block diagram of a data transmission device 800 provided in an embodiment of this application is shown. The device 800 may include a processor 801 and a communication interface 802, wherein the processor 801 is coupled to the communication interface 802.

[0391] The processor 801 in this embodiment may include one or more processing units. Optionally, the processing unit may include, but is not limited to, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor, a microcontroller, or any conventional processor.

[0392] For example, processor 801 is used to receive a first data stream from a sender through the communication interface 802. The first data stream includes a plurality of first messages, a plurality of first cyclic redundancy check (CRC) codes, and a first forward error correction (FEC) code. The first FEC code is used to perform FEC detection on the plurality of first messages and the plurality of first CRC codes. When the CRC check result of the first message corresponding to at least one of the plurality of first CRC codes is correct, the processor sends the first message corresponding to the at least one first CRC code to the data link layer. When the CRC check result of the first message corresponding to any one of the plurality of first CRC codes is incorrect, the processor performs FEC detection on the plurality of first messages and the plurality of first CRC codes.

[0393] In an alternative example, those skilled in the art will understand that the device 800 may be specifically (or used for) the receiving end described in the above-described method 200 embodiment or method 400 embodiment. The device 800 may be used to execute the various processes and / or steps corresponding to the receiving end in the method 200 embodiment or method 400 embodiment. To avoid repetition, these will not be described again here.

[0394] Optionally, the device 800 may also include a memory 803.

[0395] The memory 803 can be volatile memory or non-volatile memory, or it can include both. The non-volatile memory can 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. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM).

[0396] Specifically, memory 803 is used to store program code and instructions for the target tracking device. Optionally, memory 803 is also used to store data obtained by processor 801 during the execution of the above-described method 200 embodiments, such as the first message.

[0397] Alternatively, the memory 803 may be a separate device or integrated into the processor 801.

[0398] It should be noted that, Figure 18Only a simplified design of the device 800 is shown. In practical applications, the device 800 may also include other necessary components, including but not limited to any number of communication interfaces, processors, selectors, memories, etc., and all devices 800 that can implement this application are within the protection scope of this application.

[0399] In one possible design, the device 800 can be a chip. Optionally, the chip may further include one or more memories for storing computer-executable instructions, which, when the chip device is running, can be executed by a processor to cause the chip to perform the steps described in method 200 or method 400 above.

[0400] Optionally, the chip device can be a field-programmable gate array, a dedicated integrated circuit, a system-on-a-chip, a central processing unit, a network processor, a digital signal processing circuit, a microcontroller, or a programmable controller or other integrated chip to implement the relevant functions.

[0401] This application embodiment also provides a communication system, which may include, for example, Figure 15 The data transmission device and such Figure 16 The data transmission device; or may include, for example, Figure 17 The data transmission device and such Figure 18 The data transmission device shown.

[0402] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, implement the data transmission method described in the above method embodiments.

[0403] This application also provides a computer program product that, when run on a processor, implements the data transmission method described in the above method embodiments.

[0404] The data transmission device, computer-readable storage medium, computer program product, or chip provided in this application embodiment are all used to execute the corresponding data transmission method provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects described in the corresponding data transmission method provided above, and will not be repeated here.

[0405] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply 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 this application.

[0406] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

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

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

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

[0410] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0411] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0412] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data transmission method, characterized by, include: If the data volume of multiple first messages is less than or equal to a preset first threshold, the transmission mode of the multiple first messages is determined as the first transmission mode. In the first transmission mode, a first data stream is generated, which includes the plurality of first packets, a plurality of first cyclic redundancy check (CRC) codes, and a first forward error correction (FEC) code. M first CRC codes are inserted after every N first packets, where M and N are both integers greater than 0. The M first CRC codes inserted after the N first packets are used to perform CRC checks on the N first packets. At least one of the plurality of first packets includes a second CRC code. The first FEC code is used to perform FEC detection on the plurality of first packets and the plurality of first CRC codes. The first data stream is sent to the receiving end.

2. The method of claim 1, wherein, The first data stream also includes a first alignment word, which is used to indicate that the transmission mode of the plurality of first messages is a first transmission mode.

3. The method according to claim 1, characterized in that, The first data stream is sent within a first transmission cycle. The first data stream also includes a first alignment word, which is used to indicate that the transmission mode of the message sent within a second transmission cycle is the first transmission mode. The second transmission cycle is the next transmission cycle after the first transmission cycle.

4. The method according to claim 1, characterized in that, The method further includes: A second data stream is generated, the second data stream including a plurality of second messages, at least one of the plurality of second messages including a third CRC code; The second data stream is sent to the receiving end.

5. A data transmission method, characterized in that, include: A first data stream is received from the sending end. The first data stream is generated in a first transmission mode. The first transmission mode is a transmission mode for multiple first messages when the data volume of multiple first messages is less than or equal to a preset first threshold. The first data stream includes multiple first messages, multiple first cyclic redundancy check (CRC) codes, and a first forward error correction (FEC) code. M first CRC codes are inserted after every N first messages, where M and N are both integers greater than 0. At least one of the multiple first messages includes a second CRC code. The first FEC code is used to perform FEC detection on the multiple first messages and the multiple first CRC codes. When the CRC check result of the first message corresponding to at least one of the plurality of first CRC codes is correct, the first message corresponding to the at least one first CRC code is sent to the data link layer. When the CRC check result of the first message corresponding to any of the plurality of first CRC codes is incorrect, FEC detection is performed on the plurality of first messages and the plurality of first CRC codes; Before sending the first message corresponding to the at least one first CRC code to the data link layer when the CRC check result of the first message corresponding to at least one first CRC code among the plurality of first CRC codes is correct, the method further includes: Based on the first alignment word, the transmission mode of the plurality of first messages is determined to be the first transmission mode, and the first alignment word is used to indicate that the transmission mode of the plurality of first messages is the first transmission mode. When the transmission mode of the plurality of first messages is determined to be the first transmission mode, M first CRC codes inserted after the N first messages are used to perform CRC verification on the N first messages.

6. The method according to claim 5, characterized in that, After performing FEC detection on the plurality of first messages and the plurality of first CRC codes, the method further includes: When the FEC detection results of the plurality of first messages and the plurality of first CRC codes are correct, the plurality of first messages are sent to the data link layer; When the FEC check results of the plurality of first messages and the plurality of first CRC codes are incorrect, FEC error correction is performed on the plurality of first messages and the plurality of first CRC codes to obtain the corrected plurality of first messages.

7. The method according to claim 5, characterized in that, The first data stream also includes the first alignment word.

8. The method according to claim 5, characterized in that, The first data stream is sent within a first transmission cycle, and the first alignment word is sent within a third transmission cycle, wherein the third transmission cycle is the previous transmission cycle of the first transmission cycle.

9. The method according to any one of claims 5-8, characterized in that, The method further includes: A second data stream is received from the sending end. The second data stream includes a plurality of second messages and a second FEC code. The second FEC code is used to perform FEC detection on the plurality of second messages. When the FEC detection result of the plurality of second messages is correct, the plurality of second messages are sent to the data link layer.

10. The method according to claim 9, characterized in that, Before sending the plurality of second messages to the data link layer when the FEC detection results of the plurality of second messages are correct, the method further includes: Based on the second alignment word, the transmission mode of the plurality of second messages is determined to be the second transmission mode; If the transmission mode of the plurality of second messages is determined to be the second transmission mode, FEC detection is performed on the plurality of second messages.

11. A data transmission device, characterized in that, include: A processor and a communication interface are coupled together. The processor is configured to: generate a first data stream, which is generated in a first transmission mode. The first transmission mode is a transmission mode for multiple first messages when the data amount of multiple first messages is less than or equal to a preset first threshold. The first data stream includes the multiple first messages, multiple first cyclic redundancy check (CRC) codes, and a first forward error correction (FEC) code. M first CRC codes are inserted after every N first messages, where M and N are both integers greater than 0. The M first CRC codes inserted after the N first messages are used to perform CRC checks on the N first messages. At least one of the multiple first messages includes a second CRC code. The first FEC code is used to perform FEC detection on the multiple first messages and the multiple first CRC codes. The data amount of the multiple first messages is less than or equal to the preset first threshold. The first data stream is sent to the receiving end through the communication interface.

12. The apparatus according to claim 11, characterized in that, The first data stream is sent within a first transmission period. The first data stream also includes a first alignment word, which is used to indicate that the transmission mode of the plurality of first messages is a first transmission mode.

13. The apparatus according to claim 11, characterized in that, The first data stream is sent within a first transmission cycle. The first data stream also includes a first alignment word, which is used to indicate the transmission mode of the message sent within a second transmission cycle. The second transmission cycle is the next transmission cycle after the first transmission cycle.

14. The apparatus according to claim 11, characterized in that, The processor is also used for: A second data stream is generated, the second data stream including a plurality of second messages, at least one of the plurality of second messages including a third CRC code; The second data stream is sent to the receiving end through the communication interface.

15. A data transmission device, characterized in that, include: A processor and a communication interface, wherein the processor and the communication interface are coupled, and the processor is used for: The first data stream is received from the sending end through the communication interface. The first data stream is generated in a first transmission mode. The first transmission mode is the transmission mode of multiple first messages when the data volume of multiple first messages is less than or equal to a preset first threshold. The first data stream includes multiple first messages, multiple first cyclic redundancy check (CRC) codes, and a first forward error correction (FEC) code. M first CRC codes are inserted after every N first messages, where M and N are both integers greater than 0. At least one of the multiple first messages includes a second CRC code. The first FEC code is used to perform FEC detection on the multiple first messages and the multiple first CRC codes. When the CRC check result of the first message corresponding to at least one of the plurality of first CRC codes is correct, the first message corresponding to the at least one first CRC code is sent to the data link layer. When the CRC check result of the first message corresponding to any of the plurality of first CRC codes is incorrect, FEC detection is performed on the plurality of first messages and the plurality of first CRC codes; Before sending the first message corresponding to at least one of the plurality of first CRC codes to the data link layer when the CRC check result of the first message corresponding to at least one of the first CRC codes is correct, the processor is further configured to: Based on the first alignment word, the transmission mode of the plurality of first messages is determined to be the first transmission mode, and the first alignment word is used to indicate that the transmission mode of the plurality of first messages is the first transmission mode. When the transmission mode of the plurality of first messages is determined to be the first transmission mode, M first CRC codes inserted after the N first messages are used to perform CRC verification on the N first messages.

16. The apparatus according to claim 15, characterized in that, After performing FEC detection on the plurality of first messages and the plurality of first CRC codes, the processor is further configured to: When the FEC detection results of the plurality of first messages and the plurality of first CRC codes are correct, the plurality of first messages are sent to the data link layer; When the FEC check results of the plurality of first messages and the plurality of first CRC codes are incorrect, FEC error correction is performed on the plurality of first messages and the plurality of first CRC codes to obtain the corrected plurality of first messages.

17. The apparatus according to claim 15, characterized in that, The first data stream is sent within a first transmission period, and the first data stream also includes the first alignment word.

18. The apparatus according to claim 15, characterized in that, The first data stream is sent within a first transmission cycle, and the first alignment word is sent within a third transmission cycle, wherein the third transmission cycle is the previous transmission cycle of the first transmission cycle.

19. The apparatus according to any one of claims 15-18, characterized in that, The processor is also used for: The second data stream is received from the sending end through the communication interface. The second data stream includes multiple second messages and a second FEC code. The second FEC code is used to perform FEC detection on the multiple second messages. When the FEC detection result of the plurality of second messages is correct, the plurality of second messages are sent to the data link layer.

20. The apparatus according to claim 19, characterized in that, Before sending the plurality of second messages to the data link layer when the FEC detection results of the plurality of second messages are correct, the processor is further configured to: Based on the second alignment word, the transmission mode of the plurality of second messages is determined to be the second transmission mode; If the transmission mode of the plurality of second messages is determined to be the second transmission mode, FEC detection is performed on the plurality of second messages.

21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by at least one processor, is used to implement the method as described in any one of claims 1-10.

22. A computer program product, characterized in that, The computer program product includes instructions that, when executed by at least one processor, are used to implement the method as described in any one of claims 1-10.