A communication method, a communication device, and a communication system

CN122845019APending Publication Date: 2026-09-29HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510373963.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

[0004]可以看出,上述方法为了完成通知,减少了校验信息占用的比特位数,可能会降低校验的准确性

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122845019A_ABST
    Figure CN122845019A_ABST
Patent Text Reader

Abstract

The application relates to the communication technical field, and discloses a communication method, a communication device and a communication system. In the method, N1 first segments are received and sent to a second communication device; M1 second segments are received, the M1 second segments include a first cyclic redundancy check code corresponding to first data; in the case that the first data is checked for errors based on the first cyclic redundancy check code, M1 third segments are obtained by modifying the first cyclic redundancy check code in the M1 second segments into a second cyclic redundancy check code; the M1 third segments are sent to the second communication device; wherein the second cyclic redundancy check code is obtained by inverting at least one bit value of a third cyclic redundancy check code, and the third cyclic redundancy check code is determined according to the first data. The method can guarantee the accuracy of the check without reducing the number of bit positions occupied by the check information (i.e. the cyclic redundancy check code).
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 in particular to a communication method, communication device and communication system. Background Technology

[0002] To verify the correctness of data, network host A can generate corresponding verification information for the data. This verification information can be, for example, a cyclic redundancy check (CRC) code or an error checking and correcting (ECC) code. Network host B can use the verification information to verify the data, or to perform verification and error correction on the data.

[0003] In addition, network host A or the network switch may need to send an extra notification to network host B, such as informing network host B that a data transmission error has occurred or that the data can be consumed. Currently, network host A or the network switch typically borrows 1 bit from the bits occupied by the checksum information and uses that 1 bit to complete the notification. For example, if the checksum information originally occupies 5 bits, to complete the notification, those 5 bits can be divided into two parts: 4 bits are used to carry the checksum information, and the other 1 bit is used to carry the flag information, which is used to indicate that a data transmission error has occurred, or to indicate that the data can be consumed, and so on.

[0004] As can be seen, the above method reduces the number of bits occupied by the verification information in order to complete the notification, which may reduce the accuracy of the verification. Summary of the Invention

[0005] This application provides a communication method, communication device, and communication system for ensuring the accuracy of verification.

[0006] In a first aspect, embodiments of this application provide a communication method, which can be executed by a first communication device. Unless otherwise specified, the "first communication device" in this application can refer to a network switch, a component in the network switch (e.g., a processor, chip, or chip system), or a logic module or software that can implement all or part of the functions of the network switch. The method includes: receiving N1 first segments and sending the N1 first segments to a second communication device, wherein the N1 first segments include part or all of the data of first data, and N1 is an integer greater than or equal to 1; receiving M1 second segments, wherein the M1 second segments include a first cyclic redundancy check (CRUD) code corresponding to the first data, and M1 is an integer greater than or equal to 1; if the first data is found to be incorrect based on the first CRUD code, modifying the first CRUD code in the M1 second segments to a second CRUD code to obtain M1 third segments, wherein the second CRUD code is used to verify the first data; and sending the M1 third segments to the second communication device; wherein the second CRUD code is obtained by flipping at least one bit value of a third CRUD code, and the third CRUD code is determined based on the first data.

[0007] Based on the above scheme, by flipping at least one bit value of the Cyclic Redundancy Check (CRC) code, a transmission error is implicitly indicated in the data packet, enabling the second communication device to identify the data transmission error. This method does not require reducing the number of bits occupied by the check information (i.e., the CRC code), thus ensuring the accuracy of the check.

[0008] One possible implementation method further includes: flipping the bit value at at least one odd or even position of the third cyclic redundancy check code to obtain the second cyclic redundancy check code.

[0009] One possible implementation further includes: after sending the M1 third fragments to the second communication device, discarding the N1 first fragments and the M1 third fragments.

[0010] Based on the above scheme, the storage space occupied can be reduced by discarding segments that have transmission errors.

[0011] One possible implementation method further includes: after discarding the N1 first fragments and the M1 third fragments, sending a first retransmission request corresponding to the first data to a third communication device.

[0012] Based on the above solution, the accuracy of data packet transmission can be improved.

[0013] One possible implementation method further includes: after sending the M1 third segments to the second communication device, receiving a second retransmission request from the second communication device corresponding to the first data.

[0014] Based on the above solution, the accuracy of data packet transmission can be improved.

[0015] Secondly, embodiments of this application provide a communication method, which can be executed by a second communication device. Unless otherwise specified, the "second communication device" in this application can refer to a network host, a component within that network host (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the network host's functions. The method includes: receiving N2 fourth segments and M2 fifth segments, wherein the N2 fourth segments include part or all of the second data, and the M2 fifth segments include a fourth cyclic redundancy check (CRC) code corresponding to the second data, where N2 is an integer greater than or equal to 1, and M2 is an integer greater than or equal to 1; if the second data fails verification based on the fourth CRC code, determining whether to send a retransmission request corresponding to the second data to a first communication device based on the fourth CRC code and the fifth CRC code; wherein the fifth CRC code is obtained by flipping at least one bit value of a sixth CRC code, and the sixth CRC code is determined based on the second data.

[0016] Based on the above scheme, by flipping at least one bit value of the Cyclic Redundancy Check (CRC) code, a transmission error is implicitly indicated in the data packet, enabling the second communication device to identify the data transmission error. This method does not require reducing the number of bits occupied by the check information (i.e., the CRC code), thus ensuring the accuracy of the check.

[0017] One possible implementation method, wherein determining whether to send a retransmission request corresponding to the second data to the first communication device based on the fourth cyclic redundancy check code and the fifth cyclic redundancy check code, includes: sending the retransmission request to the first communication device if the fourth cyclic redundancy check code and the fifth cyclic redundancy check code are different.

[0018] Based on the above solution, the accuracy of data packet transmission can be improved.

[0019] One possible implementation method further includes: discarding the N2 fourth segments and the M2 fifth segments if the second data is found to be incorrect based on the fourth cyclic redundancy check code.

[0020] Based on the above scheme, the storage space occupied can be reduced by discarding segments that have transmission errors.

[0021] One possible implementation method further includes: flipping the bit value at at least one odd or even position of the sixth cyclic redundancy check code to obtain the fifth cyclic redundancy check code.

[0022] Thirdly, embodiments of this application provide a communication method, which can be executed by a first communication device. Unless otherwise specified, the "first communication device" in this application can refer to a network host, a component within the network host (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the network host's functions. The method includes: when first data in a storage area is allowed to be consumed, flipping at least one bit value of a first error check and correction code in the storage area to obtain a second error check and correction code; wherein both the first and second error check and correction codes correspond to the first data, and the second error check and correction code is used to indicate that the first data is allowed to be consumed.

[0023] Based on the above scheme, by flipping at least one bit value of the error check and correction code, the data can be implicitly indicated as edible, enabling the second communication device to recognize that the data can be consumed. This method does not require reducing the number of bits occupied by the verification information (i.e., the error check and correction code), thus ensuring the accuracy of the verification.

[0024] One possible implementation method, wherein flipping at least one bit value of a first error check and correction code in the storage area to obtain a second error check and correction code, includes: flipping at least one bit value at an odd or even position of the first error check and correction code to obtain the second error check and correction code.

[0025] One possible implementation method further includes: when the second error check and correction code is flipped to the first error check and correction code, updating the first data and the first error check and correction code in the storage area to the second data and the third error check and correction code corresponding to the second data.

[0026] Based on the above scheme, by flipping at least one bit value of the error checking and correction code to implicitly indicate that the data has been consumed, the first communication device can write new data to the storage area, thereby improving the utilization of the storage area.

[0027] Fourthly, embodiments of this application provide a communication method, which can be executed by a second communication device. Unless otherwise specified, the "second communication device" in this application can refer to a network host, a component within the network host (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the network host's functions. The method includes: obtaining a first error check and correction code based on a second error check and correction code within a storage area; wherein the first error check and correction code is obtained by flipping at least one bit value of the second error check and correction code; and consuming the first data if a check on first data in the storage area based on the first error check and correction code is successful.

[0028] Based on the above scheme, by flipping at least one bit value of the error check and correction code, the data can be implicitly indicated as edible, enabling the second communication device to recognize that the data can be consumed. This method does not require reducing the number of bits occupied by the verification information (i.e., the error check and correction code), thus ensuring the accuracy of the verification.

[0029] One possible implementation method further includes: flipping the bit value at at least one odd or even position of the second error check and correction code to obtain the first error check and correction code.

[0030] Based on the above scheme, by flipping at least one bit value of the error checking and correction code to implicitly indicate that the data has been consumed, the first communication device can write new data to the storage area, thereby improving the utilization of the storage area.

[0031] One possible implementation method further includes: after consuming the first data, flipping the second error check and correction code in the storage area to the first error check and correction code.

[0032] Fifthly, this application provides a communication device that has the functions involved in implementing the first aspect or any possible implementation method of the first aspect. For example, the communication device includes modules, units, or means corresponding to the operations involved in performing the first aspect or any possible implementation method of the first aspect. The functions, units, or means can be implemented by software, or by hardware, or by hardware executing corresponding software.

[0033] In one possible design, the communication device includes a processing unit and a communication unit, wherein the communication unit can be used to transmit and receive signals to enable communication between the communication device and other devices; the processing unit can be used to perform some internal operations of the communication device. The functions performed by the processing unit and the communication unit may correspond to the operations involved in the first aspect or any possible implementation method of the first aspect described above.

[0034] In one possible design, the communication device includes a processor that may be coupled to a memory. The memory may store necessary computer programs or instructions for implementing the functions involved in the first aspect or any possible implementation of the first aspect described above. The processor can execute the computer programs or instructions stored in the memory, such that, when executed, the communication device implements the first aspect or any possible implementation of the first aspect described above.

[0035] In one possible design, the communication device includes a processor and a memory, the memory of which can store necessary computer programs or instructions for implementing the functions involved in the first aspect or any possible implementation of the first aspect described above. The processor can execute the computer programs or instructions stored in the memory, and when the computer programs or instructions are executed, cause the communication device to implement the first aspect or any possible implementation of the first aspect described above.

[0036] In one possible design, the communication device includes a processor and an interface circuit, wherein the processor is configured to communicate with other devices via the interface circuit and execute the first aspect or any possible implementation of the first aspect described above.

[0037] Understandably, the processor in the fifth aspect can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. Furthermore, there can be one or more processors, and one or more memories. The memory can be integrated with the processor or separated from it. In specific implementations, the memory can be integrated with the processor on the same chip or disposed on different chips. This application does not limit the type of memory or the arrangement of the memory and processor.

[0038] Sixthly, this application provides a communication device that has the functions involved in implementing the second aspect or any possible implementation method of the second aspect. For example, the communication device includes modules, units, or means corresponding to the operations involved in performing the second aspect or any possible implementation method of the second aspect. The functions, units, or means can be implemented by software, or by hardware, or by hardware executing corresponding software.

[0039] In one possible design, the communication device includes a processing unit and a communication unit, wherein the communication unit can be used to transmit and receive signals to enable communication between the communication device and other devices; the processing unit can be used to perform some internal operations of the communication device. The functions performed by the processing unit and the communication unit may correspond to the operations involved in the second aspect or any possible implementation of the second aspect described above.

[0040] In one possible design, the communication device includes a processor that may be coupled to a memory. The memory may store necessary computer programs or instructions for implementing the functions involved in the second aspect or any possible implementation of the second aspect described above. The processor can execute the computer programs or instructions stored in the memory, which, when executed, cause the communication device to implement the second aspect or any possible implementation of the second aspect described above.

[0041] In one possible design, the communication device includes a processor and a memory, the memory of which may store necessary computer programs or instructions for implementing the functions involved in the second aspect or any possible implementation of the second aspect described above. The processor may execute the computer programs or instructions stored in the memory, and when the computer programs or instructions are executed, cause the communication device to implement the second aspect or any possible implementation of the second aspect described above.

[0042] In one possible design, the communication device includes a processor and an interface circuit, wherein the processor is configured to communicate with other devices via the interface circuit and execute the second aspect or any possible implementation of the second aspect described above.

[0043] Understandably, the processor in the sixth aspect can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. Furthermore, there can be one or more processors, and one or more memories. The memory can be integrated with the processor or separated from it. In specific implementations, the memory can be integrated with the processor on the same chip or disposed on different chips. This application does not limit the type of memory or the arrangement of the memory and processor.

[0044] Seventhly, this application provides a communication device that has the functions involved in implementing the third aspect or any possible implementation method of the third aspect. For example, the communication device includes modules, units, or means corresponding to the operations involved in performing the third aspect or any possible implementation method of the third aspect. The functions, units, or means can be implemented by software, or by hardware, or by hardware executing corresponding software.

[0045] In one possible design, the communication device includes a processing unit and a communication unit, wherein the communication unit can be used to transmit and receive signals to enable communication between the communication device and other devices; the processing unit can be used to perform some internal operations of the communication device. The functions performed by the processing unit and the communication unit may correspond to the operations involved in the third aspect or any possible implementation method of the third aspect described above.

[0046] In one possible design, the communication device includes a processor that may be coupled to a memory. The memory may store necessary computer programs or instructions for implementing the functions involved in the third aspect or any possible implementation of the third aspect described above. The processor can execute the computer programs or instructions stored in the memory, which, when executed, cause the communication device to implement the third aspect or any possible implementation of the third aspect described above.

[0047] In one possible design, the communication device includes a processor and a memory, the memory of which can store necessary computer programs or instructions for implementing the functions involved in the third aspect or any possible implementation of the third aspect described above. The processor can execute the computer programs or instructions stored in the memory, and when the computer programs or instructions are executed, cause the communication device to implement the third aspect or any possible implementation of the third aspect described above.

[0048] In one possible design, the communication device includes a processor and an interface circuit, wherein the processor is configured to communicate with other devices via the interface circuit and execute the third aspect or any possible implementation thereof described above.

[0049] Understandably, the processor in the seventh aspect can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. Furthermore, there can be one or more processors, and one or more memories. The memory can be integrated with the processor, or the memory and processor can be separate. In specific implementations, the memory can be integrated with the processor on the same chip, or they can be set on different chips. This application does not limit the type of memory or the arrangement of the memory and processor.

[0050] Eighthly, this application provides a communication device that has the functions involved in implementing the fourth aspect or any possible implementation method of the fourth aspect. For example, the communication device includes modules, units, or means corresponding to the operations involved in performing the fourth aspect or any possible implementation method of the fourth aspect. The functions, units, or means can be implemented by software, or by hardware, or by hardware executing corresponding software.

[0051] In one possible design, the communication device includes a processing unit and a communication unit, wherein the communication unit can be used to transmit and receive signals to enable communication between the communication device and other devices; the processing unit can be used to perform some internal operations of the communication device. The functions performed by the processing unit and the communication unit may correspond to the operations involved in the fourth aspect or any possible implementation of the fourth aspect described above.

[0052] In one possible design, the communication device includes a processor that may be coupled to a memory. The memory may store necessary computer programs or instructions for implementing the functions involved in the fourth aspect or any possible implementation of the fourth aspect described above. The processor can execute the computer programs or instructions stored in the memory, which, when executed, cause the communication device to implement the fourth aspect or any possible implementation of the fourth aspect described above.

[0053] In one possible design, the communication device includes a processor and a memory, the memory of which may store necessary computer programs or instructions for implementing the functions involved in the fourth aspect or any possible implementation of the fourth aspect described above. The processor may execute the computer programs or instructions stored in the memory, and when the computer programs or instructions are executed, cause the communication device to implement the fourth aspect or any possible implementation of the fourth aspect described above.

[0054] In one possible design, the communication device includes a processor and an interface circuit, wherein the processor is configured to communicate with other devices via the interface circuit and execute the fourth aspect or any possible implementation thereof described above.

[0055] Understandably, the processor in the eighth aspect can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. Furthermore, there can be one or more processors, and one or more memories. The memory can be integrated with the processor, or the memory and processor can be separate. In specific implementations, the memory can be integrated with the processor on the same chip, or it can be set on different chips. This application does not limit the type of memory or the arrangement of the memory and processor.

[0056] Ninthly, this application provides a communication system, which may include a first communication device and a second communication device; wherein the first communication device is used to execute the first aspect or any possible implementation method of the first aspect, and the second communication device is used to execute the second aspect or any possible implementation method of the second aspect.

[0057] In a tenth aspect, this application provides a communication system, which may include a first communication device and a second communication device; wherein the first communication device is used to execute the third aspect or any possible implementation of the third aspect, and the second communication device is used to execute the fourth aspect or any possible implementation of the fourth aspect.

[0058] In one aspect, this application provides a computer-readable storage medium storing a computer program (or computer-readable instructions) that, when a computer reads and executes some or all of the computer-readable instructions, implements the first to fourth aspects, or any possible implementation method of the first to fourth aspects.

[0059] For example, a computer-readable storage medium can be any available medium that a computer can access. This includes, but is not limited to, non-transient computer-readable media, random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM) or other optical disk storage, magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer.

[0060] In a twelfth aspect, this application provides a computer program product that, when read and executed by a computer, implements the first to fourth aspects above, or any possible implementation method of the first to fourth aspects.

[0061] In a thirteenth aspect, this application provides a chip (or chip system) including a processor coupled to a memory storing a computer program; the processor is configured to invoke part or all of the computer program in the memory, such that the first to fourth aspects, or any possible implementation of the first to fourth aspects, are executed. Attached Figure Description

[0062] Figure 1 This is a schematic diagram of the architecture of a communication system applicable to the embodiments of this application;

[0063] Figure 2 This is a diagram illustrating data packet forwarding in pass-through technology.

[0064] Figure 3 Example diagram for notification consumer technology;

[0065] Figure 4 A flowchart illustrating the communication method provided in an embodiment of this application;

[0066] Figure 5 An example diagram illustrating a communication scenario provided in an embodiment of this application;

[0067] Figure 6(a) is an example diagram of a communication scenario provided by an embodiment of this application;

[0068] Figure 6(b) is an example diagram of a communication scenario provided by an embodiment of this application;

[0069] Figure 6(c) is an example diagram of a communication scenario provided by an embodiment of this application;

[0070] Figure 7(a) is an example diagram of a communication scenario provided by an embodiment of this application;

[0071] Figure 7(b) is an example diagram of a communication scenario provided by an embodiment of this application;

[0072] Figure 7(c) is an example diagram of a communication scenario provided by an embodiment of this application;

[0073] Figure 8(a) is an example diagram of a communication scenario provided by an embodiment of this application;

[0074] Figure 8(b) is an example diagram of a communication scenario provided by an embodiment of this application;

[0075] Figure 8(c) is an example diagram of a communication scenario provided by an embodiment of this application;

[0076] Figure 8(d) is an example diagram of a communication scenario provided by an embodiment of this application;

[0077] Figure 8(e) is an example diagram of a communication scenario provided by an embodiment of this application;

[0078] Figure 8(f) is an example diagram of a communication scenario provided by an embodiment of this application;

[0079] Figure 8(g) is an example diagram of a communication scenario provided by an embodiment of this application;

[0080] Figure 8(h) is an example diagram of a communication scenario provided by an embodiment of this application;

[0081] Figure 8(i) is an example diagram of a communication scenario provided by an embodiment of this application;

[0082] Figure 9 A flowchart illustrating the communication method provided in an embodiment of this application;

[0083] Figure 10 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application;

[0084] Figure 11 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application. Detailed Implementation

[0085] In the embodiments of this application, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as an "example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the term "example" is intended to present concepts in a concrete manner. In the embodiments of this application, "of," "corresponding, relevant," and "corresponding" may sometimes be used interchangeably, and it should be noted that their intended meanings are consistent unless their distinction is emphasized.

[0086] Figure 1 This is a schematic diagram of the architecture of a communication system applicable to the embodiments of this application. Network host 100 and network host 600 can communicate via one or more network switches, or they can communicate directly. Figure 1 As shown, network host 100 and network host 600 can be connected via network switch 200, network switch 300, network switch 400, and network switch 500, or network host 100 and network host 600 can communicate directly. In other embodiments, network host 100 and network host 600 can be connected via more or fewer network switches.

[0087] A network host can act as a server providing information resources to users or other network hosts on the network. A network host includes one or more network ports, and different network hosts can be equipped with different numbers or the same number of network ports. A network host can be, for example, a physical machine, computer, server, or other electronic device. A network host can include virtual resource objects such as virtual machines and applications, and multiple network ports can work together to serve the same resource object.

[0088] A network switch is a type of network hardware that uses packet switching to connect devices on a computer network. Network switches can also be called switchers, switching devices, exchangers, distributors, or relay devices. A network switch includes one or more network ports; different network switches may have different or the same number of network ports. Network switches can be, for example, box switches, modular switches, desktop / mini switches, industrial switches, or blade switches. Network switches can include virtual resource objects such as virtual machines and applications, and multiple network ports can share the same resource object. Network switches can maintain a routing table, which is used to route and forward data packets.

[0089] The following explanations cover the relevant terms used in the embodiments of this application. Unless otherwise specified, these explanations are provided to support the meaning of the relevant terms and to make the embodiments of this application easier to understand, and should not be construed as strict limitations on the relevant terms within the scope of protection claimed in this application.

[0090] I. Cut-through switching technology

[0091] Cut-through forwarding is a data packet forwarding technique commonly used in network switches, particularly in scenarios with high latency requirements. Its purpose is to reduce the transmission delay of data packets from source to destination. Specifically, in cut-through forwarding, after receiving one or more fragments of a data packet, the network switch can identify the destination MAC address in the packet header. Based on this destination MAC address, the switch determines the target port and forwards the data packet through that port, significantly reducing latency and increasing network throughput. The MAC address is a unique hardware address used to uniquely identify devices within a local area network (LAN). MAC addresses are typically used at the data link layer.

[0092] Figure 2 This is a schematic diagram of data packet forwarding in cut-through technology. In this example, the data packet includes a header, payload data, and a CRC checksum. The header contains the source MAC address, destination MAC address, and protocol type; optionally, it also includes the source port and destination port. The payload data contains the information to be transmitted. The CRC checksum is used to verify whether transmission errors have occurred in the header and payload data. Generally, because a data packet has a large number of bits, it is often divided into multiple segments for transmission. Figure 2 In the example, a data packet is divided into 20 segments: segment 1, segment 2, ..., segment 20. The packet header is carried in one or more of the first segments, the CRC is carried in one or more of the last segments, and the payload data is carried in the other segments. As a specific example, segment 1 contains the header and a portion of the payload data; segments 2 through 19 each carry a portion of the payload data; and segment 20 carries a portion of the payload data and the CRC. That is, the header is only carried in segment 1, the CRC is only carried in segment 20, and the payload data is distributed across segments 1 through 20. It should be noted that this application does not limit the specific implementation of the header, payload data, and CRC occupying segments; it only needs to follow the order of sending the header first, then the payload data, and finally the CRC.

[0093] In cut-through forwarding technology, after a network switch receives the initial one or more fragments of a data packet from network host A, it can obtain the packet header and the destination MAC address from the header. Based on the destination MAC address, it can then determine whether the data packet needs to be forwarded to network host B. Figure 2 For example, assuming the packet header is in segment 1, the CRC is in segment 20, and the payload data is in segments 1 through 20, the network switch, upon receiving segment 1, can determine that a data packet needs to be sent to network host B. Therefore, it sends segment 1 to network host B. Subsequently, upon receiving segment 2, it also sends segment 2 to network host B. This process continues for segments 3 through 20; that is, each segment is forwarded immediately upon receipt. Furthermore, the network switch stores segments 1 through 20 and uses the CRC in segment 20 to verify the payload data and packet header. If the verification fails (i.e., the payload data and / or packet header have transmission errors), the network switch discards segments 1 through 20 and sends a retransmission request to network host A to request the retransmission of the data packet (or segments 1 through 20). If the verification is successful, the network switch can store segments 1 through 20 so that if a transmission error occurs in channel #2 and the network switch receives a retransmission request from network host B, it can retrieve segments 1 through 20 locally and retransmit them to network host B.

[0094] Regarding the aforementioned pass-through forwarding technology, a current consideration is to add additional information during data packet transmission. For example, if the network switch detects an error in data packet transmission on channel #1, it notifies network host B of this channel #1 transmission error event. To achieve this, one possible implementation method is to reduce the number of bits used to carry the CRC by one, freeing up that bit to carry one bit of information. This one bit is used to indicate either an error in data packet transmission on channel #1 or an error that occurred correctly. For instance, assuming the original CRC bit set to 5 bits, it is now modified to 4 bits, with the remaining bit used to carry indication information, indicating either an error or a correct transmission on channel #1.

[0095] It can be seen that the problem with the above method is that shortening the CRC bits may reduce the accuracy of the verification.

[0096] To address the aforementioned problems, this application provides corresponding solutions. See below for details. Figure 4 Examples of implementations.

[0097] II. Notification of Consumer Technology

[0098] Notification-based consumption technology refers to a process where, after producing data, network host A writes (or stores) the data in a storage area, and if it is determined that the data is permissible to be consumed, it notifies the corresponding network host (e.g., network host B) to consume it.

[0099] In this context, network host A is also called the producer, meaning it produces data for the consumer to consume (or use). Network host B is also called the consumer, meaning it consumes (or uses) the data generated by the producer.

[0100] The storage area can be a shared storage area between network host A and network host B, or it can be a storage area exclusively for network host B. This storage area can be, for example, a cache. For instance, the smallest unit of data storage in the cache can be a cache line, meaning one piece of data can be written to one cache line.

[0101] In addition, to verify and correct the stored data, error checking and correcting codes (ECCs) can be stored along with the data. These ECCs can be used to verify whether errors have occurred in the data, and if errors do occur, they can be corrected using the ECCs.

[0102] Figure 3 This is an example diagram illustrating a notification consumption technique. In this example, network host A is the data producer, and network host B is the data consumer. Currently, to implement notification messages, one bit is typically removed from the ECC (Electronic Control Class) bits to store indication information. This indication information indicates whether the data can be consumed or not. For example, suppose the original ECC bits were 5 bits; now, these bits are changed to 4 bits, with the additional bit used to carry indication information indicating whether the data can be consumed or not.

[0103] It can be seen that the problem with the above method is that shortening the ECC bits may reduce the accuracy of verification and error correction.

[0104] To address the aforementioned problems, this application provides corresponding solutions. See below for details. Figure 4 Examples of implementations.

[0105] The solutions to the two types of problems mentioned above are explained below.

[0106] To address the issue that shortening the CRC bits in pass-through technology may reduce the accuracy of verification, this application provides a corresponding solution (see reference). Figure 4The methods provided in the embodiments of this application are described in detail below. The methods provided in the embodiments of this application involve a first communication device and / or a second communication device. Unless otherwise specified, the "first communication device" in this application can refer to a network switch, a component within the network switch (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the functions of the network switch. The "second communication device" in this application can refer to a network host, a component within the network host (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the functions of the network host.

[0107] Figure 4 This is a flowchart illustrating a communication method provided in an embodiment of this application. This method addresses the problem in pass-through forwarding technology where shortening the CRC bits may reduce the accuracy of the verification. The method includes the following steps:

[0108] Step 401: The first communication device receives N1 first segments.

[0109] The third communication device sends a data packet to the first communication device. The data packet includes a header, a valid data payload, and a cyclic redundancy check code. The data packet is divided into multiple segments for transmission.

[0110] The data packet actually received by the first communication device consists of N1 first fragments and M1 second fragments. The N1 first fragments include part or all of the first data, where N1 is an integer greater than or equal to 1. The M1 second fragments include a first cyclic redundancy check code corresponding to the first data, where M1 is an integer greater than or equal to 1. The first data consists of the packet header and payload data of the data packet.

[0111] Wherein, if the N1 first segments include all the data of the first data, then the M1 second segments include the first cyclic redundancy check code, but do not include the first data. If the N1 first segments include part of the data of the first data, then the M1 second segments include the first cyclic redundancy check code, and also include another part of the data of the first data.

[0112] When the data packets are transmitted correctly between the third communication device and the first communication device, the N1 first fragments and M1 second fragments received by the first communication device are the N1 first fragments and M1 second fragments sent by the third communication device.

[0113] In step 402, the first communication device sends N1 first segments to the second communication device. Correspondingly, the second communication device receives N2 fourth segments.

[0114] In the direct forwarding technology, after receiving each of the N1 first segments, the first communication device can immediately forward the first segment to the second communication device without waiting to receive all the segments corresponding to the data packet before forwarding the segment to the second communication device, thus reducing transmission latency.

[0115] After the first communication device sends N1 first segments, the second communication device actually receives N2 fourth segments, which include part or all of the second data, where N2 is an integer greater than or equal to 1.

[0116] In this case, if the N1 first fragments sent by the first communication device are correctly transmitted in the transmission channel, the N2 fourth fragments received by the second communication device are exactly the same as the N1 first fragments. Taking N1 = N2 = 5 as an example, assuming that the N1 first fragments sent by the first communication device are fragment a, fragment b, fragment c, fragment d, and fragment e, then the N2 fourth fragments received by the second communication device are also fragment a, fragment b, fragment c, fragment d, and fragment e.

[0117] In the event that N1 first segments sent by the first communication device are erroneously transmitted in the transmission channel, the N2 fourth segments received by the second communication device are not entirely identical to the N1 first segments. For example, N1 may not be equal to N2, or N1 may be equal to N2 but one or more of the first segments are erroneous.

[0118] Step 403: The first communication device receives M1 second segments.

[0119] The M1 second segments include a first cyclic redundancy check code corresponding to the first data, where M1 is an integer greater than or equal to 1. Optionally, the M1 second segments may also include a portion of the first data.

[0120] When the data packets are transmitted correctly between the third communication device and the first communication device, the N1 first fragments and M1 second fragments received by the first communication device are the N1 first fragments and M1 second fragments sent by the third communication device.

[0121] In step 404, the first communication device sends M1 third segments to the second communication device. Correspondingly, the second communication device receives M2 fifth segments.

[0122] Specifically, after receiving M1 second segments, the first communication device obtains a first cyclic redundancy check code from them, and can also obtain first data from N1 first segments, or obtain first data from N1 first segments and M1 second segments, and then uses the first cyclic redundancy check code to verify the first data.

[0123] If the first data is verified to be correct based on the first cyclic redundancy check code, the first communication device sends M1 second segments to the second communication device.

[0124] If the first data fails to pass the verification based on the first cyclic redundancy check (CRCD), the first CRCD in the M1 second segments is modified to a second CRCD to obtain M1 third segments. The second CRCD is used to verify the first data. Then, the first communication device sends the M1 third segments to the second communication device. The first communication device can obtain the second CRCD using the following method: the first communication device determines a third CRCD based on the first data and flips at least one bit value of the third CRCD to obtain the second CRCD. For example, the first communication device can flip at least one odd-numbered bit value of the third CRCD to obtain the second CRCD. For example, the first communication device can also flip at least one even-numbered bit value of the third CRCD to obtain the second CRCD.

[0125] In this embodiment, "flipping" refers to flipping a bit value "0" to a bit value "1", or flipping a bit value "1" to a bit value "0". This is explained here for simplicity and will not be repeated later.

[0126] The method by which the first communication device verifies the first data based on the first cyclic redundancy check code can be any of the following:

[0127] In the first verification method, the first communication device determines the third cyclic redundancy check code based on the first data. If the third cyclic redundancy check code is the same as the first cyclic redundancy check code, the verification is correct; otherwise, the verification is incorrect.

[0128] Verification Method Two: The first communication device divides the first bit sequence by the generator polynomial. If the remainder is 0, the verification is correct; otherwise, the verification is incorrect. The first bit sequence refers to the bit sequence formed by concatenating the first data with the first cyclic redundancy check (CRC) code. This generator polynomial is the same one used by the third communication device to determine the first CRC code.

[0129] For example, after sending M1 third segments to the second communication device, the first communication device can discard N1 first segments and M1 third segments. That is, it discards data packets that have transmission errors. Based on this method, the storage space occupied can be reduced.

[0130] For example, after discarding N1 first segments and M1 third segments, the first communication device can send a first retransmission request corresponding to the first data to the third communication device. Based on this method, the correctness of data packet transmission can be improved.

[0131] For example, after sending M1 third segments to the second communication device, the first communication device may receive a second retransmission request from the second communication device corresponding to the first data. For instance, if a transmission error occurs between the first and second communication devices, causing one or more of the N1 first segments sent by the first communication device to be corrupted, and / or one or more of the M1 third segments sent by the first communication device to be corrupted, the second communication device can send a second retransmission request to the first communication device to request retransmission of the data. Based on this method, the correctness of data packet transmission can be improved.

[0132] After the first communication device sends M1 third segments, the second communication device actually receives M2 fifth segments, which include a fourth cyclic redundancy check code corresponding to the second data, where M2 is an integer greater than or equal to 1.

[0133] In this case, if the M1 third fragments sent by the first communication device are correctly transmitted in the transmission channel, the M2 fifth fragments received by the second communication device are exactly the same as the M1 third fragments. Taking M1=M2=1 as an example, assuming that the M1 third fragments sent by the first communication device are fragments x, then the M2 fifth fragments received by the second communication device are also fragments x.

[0134] If the M1 third segments sent by the first communication device are erroneously transmitted in the transmission channel, the M2 fifth segments received by the second communication device will not be completely identical to the M1 third segments. For example, M1 may not be equal to M2, or M1 may be equal to M2 but one or more of the third segments have been transmitted incorrectly.

[0135] After receiving N2 fourth segments and M2 fifth segments, the second communication device obtains the second data and the corresponding fourth cyclic redundancy check (CRC) code. Then, the second communication device uses the CRC code to verify the second data.

[0136] The method by which the second communication device verifies the second data based on the fourth cyclic redundancy check code can be any of the following:

[0137] Verification Method 1: The first communication device determines the sixth cyclic redundancy check code based on the second data. If the sixth cyclic redundancy check code is the same as the fourth cyclic redundancy check code, the verification is correct; otherwise, the verification is incorrect.

[0138] In the second verification method, the second communication device divides the second bit sequence by the generator polynomial. If the remainder is 0, the verification is correct; otherwise, it is incorrect. The second bit sequence refers to the bit sequence formed by concatenating the second data with the fourth cyclic redundancy check (CRC) code. This generator polynomial is the same one used by the third communication device to determine the first CRC code.

[0139] If the second data is verified correctly based on the fourth cyclic redundancy check code, it indicates that no transmission errors occurred during the transmission of data packets in the transmission channels between the third and first communication devices, and between the first and second communication devices. Therefore, the second communication device can consume (or use) the second data.

[0140] If the second data verification fails based on the fourth cyclic redundancy check code, it indicates that a transmission error has occurred in the transmission channel between the third communication device and the first communication device (hereinafter referred to as transmission channel #1) when transmitting data packets, and / or a transmission error has occurred in the transmission channel between the first communication device and the second communication device (hereinafter referred to as transmission channel #2) when transmitting data packets.

[0141] To accurately determine whether a transmission error occurred during data transmission on transmission channel #2, the second communication device, after verifying for errors in the second data based on the fourth cyclic redundancy check (CRCD), can determine a sixth CRCD based on the second data. It then flips at least one bit value of the sixth CRCD to obtain a fifth CRCD; for example, it flips at least one odd or even bit value of the sixth CRCD. It should be noted that the flipping position of the sixth CRCD by the second communication device is the same as the flipping position of the third CRCD by the first communication device.

[0142] If the fourth cyclic redundancy check code is the same as the fifth cyclic redundancy check code, it indicates that transmission channel #2 is correct in transmitting the data packet, and transmission channel #1 has a transmission error in transmitting the data packet. In this case, since transmission channel #2 is correct in transmitting the data packet, the second communication device does not send a retransmission request corresponding to the second data to the first communication device.

[0143] If the fourth cyclic redundancy check code is different from the fifth cyclic redundancy check code, it indicates that an error occurred in transmission channel #2 when transmitting the data packet. However, the second communication device cannot determine whether a transmission error occurred in transmission channel #1 when transmitting the data packet. In this case, since an error occurred in transmission channel #2 when transmitting the data packet, the second communication device can send a retransmission request (also known as a second retransmission request) corresponding to the second data to the first communication device.

[0144] For example, if the second communication device detects an error in the second data based on the fourth cyclic redundancy check code, it can discard N2 fourth segments and M2 fifth segments. Based on this method, storage space can be reduced.

[0145] Based on the above Figure 4 In one embodiment, at least one bit value of the Cyclic Redundancy Check (CRC) code is flipped to implicitly indicate a transmission error in the data packet, enabling the second communication device to identify the data transmission error. This method does not require reducing the number of bits occupied by the check information (i.e., the CRC code), thus ensuring the accuracy of the check.

[0146] The following is combined Figure 5 , Figures 6(a) to 6(c) , Figures 7(a) to 7(c) , Figures 8(a) to 8(i) This document describes different scenarios during data packet transmission. In the following examples, the third communication device, the first communication device, and the second communication device are respectively network host A, network switch, and network host B. The transmission channel between network host A and the network switch is called channel #1, and the transmission channel between the network switch and network host B is called channel #2. Network host A is the data sender, network host B is the data receiver, and the network switch is the relay device. This application does not limit the number of network switches; the following examples use one network switch. The data in the data packet is represented by the letter 'd', and this data includes the header and payload data, such as d1, d2, d3, c4', and c5' in the following examples.

[0147] The following examples all demonstrate data packet transmission using pass-through forwarding technology. The following sections will explain the different scenarios.

[0148] Scenario 1: Both channel #1 and channel #2 correctly transmit data packets.

[0149] Figure 5This is an example diagram illustrating a communication scenario provided in an embodiment of this application. In this example, network host A sends a data packet to a network switch via channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. The data packet is correctly transmitted to the network switch. The network switch, using pass-through forwarding technology, upon receiving a fragment of d1, immediately begins sending that fragment to network host B via channel #2. Subsequently, upon receiving c1, the network switch verifies d1 based on c1, and the verification is successful. Therefore, the network switch does not modify c1 and sends c1 to network host B via channel #2. Since the network switch verifies d1 based on c1, it can also store d1 and c1. The d1 and c1 sent by the network switch are correctly transmitted to network host B. After receiving d1 and c1, network host B verifies d1 based on c1, and the verification is successful. Therefore, network host B can consume d1, or consume both d1 and c1. Since network host B verifies d1 correctly based on c1, it does not send a retransmission request to the network switch. If the network switch does not receive a retransmission request within a preset time, it can discard the stored d1 and c1. Alternatively, network host B can send an acknowledgment to the network switch, in which case the network switch will discard the stored d1 and c1 upon receiving the acknowledgment.

[0150] Scenario 2: Channel #1 transmits data packets incorrectly, while channel #2 transmits data packets correctly.

[0151] Figure 6(a) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is incorrectly transmitted to the network switch, while c1 is correctly transmitted. The network switch actually receives data d2, and using pass-through forwarding technology, after receiving a fragment of d2, it begins sending that fragment to network host B through channel #2. Subsequently, after receiving c1, the network switch checks d2 based on c1 and finds the check to be incorrect. Therefore, the network switch generates c2 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c2 to obtain c2', and sends c2' to network host B through channel #2. Since the network switch checks d2 based on c1 and finds the check to be incorrect, the network switch can also discard d2 and c1 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch correctly transmits d2 and c2' to network host B. Upon receiving d2 and c2', network host B checks d2 based on c2' and finds the check to be incorrect. Then, network host B generates c2 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c2 to obtain c2'. Since the cyclic redundancy check (CRC) code generated by network host B (i.e., c2') is the same as the received CRC code (i.e., c2'), network host B determines that the data packet transmitted through channel #2 is correct and the data packet transmitted through channel #1 is incorrect. Because the data packet transmitted through channel #2 is correct, network host B does not send a retransmission request to the network switch. Subsequently, the network switch receives the correct d1 and c1 from network host A and then sends d1 and c1 back to network host B. Optionally, after correctly receiving d1 and c1, network host B can send an acknowledgment to the network switch. Upon receiving the acknowledgment, the network switch discards the stored d1 and c1.

[0152] Figure 6(b) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is correctly transmitted to the network switch, and the network switch, using pass-through forwarding technology, immediately starts sending fragments of d1 to network host B through channel #2 after receiving the d1 fragment. c1 is incorrectly transmitted to the network switch; the actual CRC code received by the network switch is c2. After receiving c2, the network switch checks d1 based on c2 and finds the check to be incorrect. Therefore, the network switch generates c1 based on the received d1 and flips at least one bit position (e.g., an odd or even bit position) of c1 to obtain c1', and sends c1' to network host B through channel #2. Since the network switch checks d1 incorrectly based on c2, the network switch can also discard d1 and c2 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch correctly transmits d1 and c1' to network host B. Upon receiving d1 and c1', network host B checks d1 against c1' and finds the check to be incorrect. Then, network host B generates c1 based on the received d1 and flips at least one bit position (e.g., an odd or even bit position) of c1 to obtain c1'. Since the cyclic redundancy check (CRC) code generated by network host B (i.e., c1') is the same as the received CRC code (i.e., c1'), network host B determines that the data packet transmitted through channel #2 is correct and the data packet transmitted through channel #1 is incorrect. Because the data packet transmitted through channel #2 is correct, network host B does not send a retransmission request to the network switch. Subsequently, the network switch receives the correct d1 and c1 from network host A and then sends d1 and c1 back to network host B. Optionally, after correctly receiving d1 and c1, network host B can send an acknowledgment to the network switch. Upon receiving the acknowledgment, the network switch discards the stored d1 and c1.

[0153] Figure 6(c) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is mistakenly transmitted to the network switch; the network switch actually receives data d2. Using pass-through forwarding technology, after receiving a fragment of d2, the network switch immediately begins sending a fragment of d2 to network host B through channel #2. c1 is also mistakenly transmitted to the network switch; the network switch actually receives the CRC code c2. After receiving c2, the network switch checks d2 based on c2 and finds the check to be incorrect. Therefore, the network switch generates c3 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c3 to obtain c3', and sends c3' to network host B through channel #2. Since the network switch checks d2 based on c2 and finds the check to be incorrect, the network switch can also discard d2 and c2 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch correctly transmits d2 and c3' to network host B. Upon receiving d2 and c3', network host B checks d2 based on c3' and finds the check to be incorrect. Then, network host B generates c3 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c3 to obtain c3'. Since the cyclic redundancy check (CDR) code generated by network host B (i.e., c3') is the same as the received CDR code (i.e., c3'), network host B determines that the data packet transmitted through channel #2 is correct and the data packet transmitted through channel #1 is incorrect. Because the data packet transmitted through channel #2 is correct, network host B does not send a retransmission request to the network switch. Subsequently, the network switch receives the correct d1 and c1 from network host A and then sends d1 and c1 back to network host B. Optionally, after correctly receiving d1 and c1, network host B can send an acknowledgment to the network switch. Upon receiving the acknowledgment, the network switch discards the stored d1 and c1.

[0154] Scenario 3: Channel #1 transmits data packets correctly, while channel #2 transmits data packets incorrectly.

[0155] Figure 7(a) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is correctly transmitted to the network switch. The network switch, using pass-through forwarding technology, upon receiving a fragment of d1, immediately begins sending that fragment to network host B through channel #2. c1 is also correctly transmitted to the network switch. After receiving c1, the network switch verifies d1 based on c1, and the verification is successful. Therefore, the network switch sends c1 to network host B through channel #2. Since the network switch verifies d1 correctly based on c1, it can also store d1 and c1. The network switch sends data d1, which is incorrectly transmitted to network host B. Network host B actually receives data d2. The network switch sends data c1, which is correctly transmitted to network host B. After receiving d2 and c1, network host B performs a checksum verification on d2 based on c1, and the verification fails. Therefore, network host B generates c2 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c2 to obtain c2'. Since the cyclic redundancy check (CDR) code generated by network host B (i.e., c2') is different from the received CDR code (i.e., c1), network host B determines that the data packet transmitted through channel #2 is faulty, and cannot determine whether the data packet transmitted through channel #1 is faulty. Due to the faulty data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request a retransmission of the data packets (i.e., d1 and c1). The network switch can then send d1 and c1 back to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0156] Figure 7(b) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is correctly transmitted to the network switch. The network switch, using pass-through forwarding technology, after receiving a fragment of d1, begins sending that fragment to network host B through channel #2. c1 is also correctly transmitted to the network switch. After receiving c1, the network switch verifies d1 based on c1, and the verification is successful. Therefore, the network switch sends c1 to network host B through channel #2. Since the network switch verifies d1 correctly based on c1, it can also store d1 and c1. The d1 sent by the network switch is correctly transmitted to network host B, but the c1 sent by the network switch is incorrectly transmitted to network host B. The CRC code actually received by network host B is c2. After receiving d1 and c2, network host B checks d1 based on c2 and finds the check to be incorrect. Then, network host B generates c1 based on the received d1 and flips at least one bit position (e.g., an odd or even position) of c1 to obtain c1'. Since the cyclic redundancy check (CRCD) generated by network host B (i.e., c1') is different from the received CRCD (i.e., c2), network host B determines that the data packet transmitted through channel #2 is faulty, and cannot determine whether the data packet transmitted through channel #1 is faulty. Because the data packet transmitted through channel #2 is faulty, network host B sends a retransmission request to the network switch to request the retransmission of the data packets (i.e., d1 and c1). The network switch can send d1 and c1 back to network host B based on the retransmission request. Optionally, after correctly receiving d1 and c1, network host B can send an acknowledgment to the network switch. Upon receiving the acknowledgment, the network switch discards the stored d1 and c1.

[0157] Figure 7(c) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is correctly transmitted to the network switch. The network switch, using pass-through forwarding technology, after receiving a fragment of d1, begins sending that fragment to network host B through channel #2. c1 is also correctly transmitted to the network switch. After receiving c1, the network switch verifies d1 based on c1, and the verification is successful. Therefore, the network switch sends c1 to network host B through channel #2. Since the network switch verifies d1 correctly based on c1, it can also store d1 and c1. However, d1 sent by the network switch is incorrectly transmitted to network host B. Network host B actually receives data d2. Similarly, c1 sent by the network switch is incorrectly transmitted to network host B, and network host B actually receives the CRC code c2. After receiving d2 and c2, network host B performs a checksum verification on d2 based on c2. If the verification fails, network host B generates c3 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c3 to obtain c3'. Since the cyclic redundancy check (CRCD) generated by network host B (i.e., c3') is different from the received CRCD (i.e., c2), network host B determines that the data packet transmitted through channel #2 is faulty, and cannot determine whether the data packet transmitted through channel #1 is faulty. Due to the faulty data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request the retransmission of the data packets (i.e., d1 and c1). The network switch can send d1 and c1 back to network host B based on the retransmission request. Optionally, after correctly receiving d1 and c1, network host B can send an acknowledgment to the network switch. Upon receiving the acknowledgment, the network switch discards the stored d1 and c1.

[0158] Scenario 4: Channel #1 transmits data packets incorrectly, and channel #2 transmits data packets incorrectly.

[0159] Figure 8(a) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is incorrectly transmitted to the network switch, while c1 is correctly transmitted. The network switch actually receives data d2, and using pass-through forwarding technology, after receiving a fragment of d2, it begins sending that fragment to network host B through channel #2. Subsequently, after receiving c1, the network switch checks d2 based on c1 and finds the check to be incorrect. Therefore, the network switch generates c2 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c2 to obtain c2', and sends c2' to network host B through channel #2. Since the network switch checks d2 based on c1 and finds the check to be incorrect, the network switch can also discard d2 and c1 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch's packet d2 was incorrectly transmitted; network host B actually received d3. The network switch's packet c2' was correctly transmitted to network host B. Upon receiving d3 and c2', network host B performs a checksum verification on d3 based on c2', and the verification fails. Therefore, network host B generates c3 based on the received d3 and flips at least one bit position (e.g., an odd or even bit position) to obtain c3'. Since the cyclic redundancy check (CDR) code generated by network host B (i.e., c3') is different from the received CDR code (i.e., c2'), network host B determines that the data packet transmitted through channel #2 is incorrect, and cannot determine whether the data packet transmitted through channel #1 is also incorrect. Because the data packet transmitted through channel #2 is incorrect, network host B sends a retransmission request to the network switch to request a retransmission of the data packets (i.e., d1 and c1). The network switch can then send d1 and c1 to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0160] Figure 8(b) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is incorrectly transmitted to the network switch, while c1 is correctly transmitted. The network switch actually receives data d2, and using pass-through forwarding technology, after receiving a fragment of d2, it begins sending that fragment to network host B through channel #2. Subsequently, after receiving c1, the network switch checks d2 based on c1 and finds the check to be incorrect. Therefore, the network switch generates c2 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c2 to obtain c2', and sends c2' to network host B through channel #2. Since the network switch checks d2 based on c1 and finds the check to be incorrect, the network switch can also discard d2 and c1 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch correctly transmitted d2 to network host B, but incorrectly transmitted c2'. Network host B actually received cyclic redundancy check (CRC) code c3. After receiving d2 and c3, network host B checks d2 based on c3 and finds the check to be incorrect. Therefore, network host B generates c2 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) to obtain c2'. Since the CRC code generated by network host B (i.e., c2') is different from the received CRC code (i.e., c3), network host B determines that the data packet transmitted through channel #2 is faulty, and cannot determine whether the data packet transmitted through channel #1 is faulty. Due to the faulty data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request the retransmission of data packets (i.e., d1 and c1). The network switch can then send d1 and c1 to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0161] Figure 8(c) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is incorrectly transmitted to the network switch, while c1 is correctly transmitted. The network switch actually receives data d2, and using pass-through forwarding technology, after receiving a fragment of d2, it begins sending that fragment to network host B through channel #2. Subsequently, after receiving c1, the network switch checks d2 based on c1 and finds the check to be incorrect. Therefore, the network switch generates c2 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c2 to obtain c2', and sends c2' to network host B through channel #2. Since the network switch checks d2 based on c1 and finds the check to be incorrect, the network switch can also discard d2 and c1 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch's transmitted data d2 was incorrectly transmitted, and network host B actually received data d3. The network switch's transmitted data c2' was also incorrectly transmitted, and network host B actually received cyclic redundancy check (CRC) code c3. After receiving d3 and c3, network host B performs a CRC check on d3 based on c3, and the check fails. Therefore, network host B generates c4 based on the received d3 and flips at least one bit position (e.g., an odd or even position) of c4 to obtain c4'. Since the CRC code generated by network host B (i.e., c4') is different from the received CRC code (i.e., c3), network host B determines that the data packet transmitted through channel #2 is incorrect, and network host B cannot determine whether the data packet transmitted through channel #1 is incorrect. Due to the error in the data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request the retransmission of data packets (i.e., d1 and c1). The network switch can then send d1 and c1 back to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0162] Figure 8(d) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to a network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is correctly transmitted to the network switch, and the network switch, using pass-through forwarding technology, immediately starts sending fragments of d1 to network host B through channel #2 after receiving the d1 fragment. c1 is incorrectly transmitted to the network switch; the actual CRC code received by the network switch is c2. After receiving c2, the network switch checks d1 based on c2 and finds the check to be incorrect. Therefore, the network switch generates c1 based on the received d1 and flips at least one bit position (e.g., an odd or even bit position) of c1 to obtain c1', and sends c1' to network host B through channel #2. Since the network switch checks d1 incorrectly based on c2, the network switch can also discard d1 and c2 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch's data packet d1 was incorrectly transmitted; network host B actually received data d2. The network switch's data packet c1' was correctly transmitted to network host B. Upon receiving d2 and c1', network host B performs a checksum verification on d2 based on c1', and the verification fails. Then, network host B generates c3 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c3 to obtain c3'. Since the cyclic redundancy check (CDR) code generated by network host B (i.e., c3') is different from the received CDR code (i.e., c1'), network host B determines that the data packet transmitted through channel #2 is incorrect, and network host B cannot determine whether the data packet transmitted through channel #1 is incorrect. Due to the error in the data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request a retransmission of the data packets (i.e., d1 and c1). The network switch can then send d1 and c1 back to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0163] Figure 8(e) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to a network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is correctly transmitted to the network switch, and the network switch, using pass-through forwarding technology, immediately starts sending fragments of d1 to network host B through channel #2 after receiving the d1 fragment. c1 is incorrectly transmitted to the network switch; the actual CRC code received by the network switch is c2. After receiving c2, the network switch checks d1 based on c2 and finds the check to be incorrect. Therefore, the network switch generates c1 based on the received d1 and flips at least one bit position (e.g., an odd or even bit position) of c1 to obtain c1', and sends c1' to network host B through channel #2. Since the network switch checks d1 incorrectly based on c2, the network switch can also discard d1 and c2 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch correctly transmitted d1 to network host B, but incorrectly transmitted c1'. Network host B actually received cyclic redundancy check (CRC) code c3. After receiving d1 and c3, network host B checks d1 based on c3 and finds the check to be incorrect. Then, network host B generates c1 based on the received d1 and flips at least one bit position (e.g., an odd or even bit position) to obtain c1'. Since the CRC code generated by network host B (i.e., c1') is different from the received CRC code (i.e., c3), network host B determines that the data packet transmitted through channel #2 is faulty, and cannot determine whether the data packet transmitted through channel #1 is faulty. Due to the faulty data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request a retransmission of the data packets (i.e., d1 and c1). The network switch can then send d1 and c1 back to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0164] Figure 8(f) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to a network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is correctly transmitted to the network switch, and the network switch, using pass-through forwarding technology, immediately starts sending fragments of d1 to network host B through channel #2 after receiving the d1 fragment. c1 is incorrectly transmitted to the network switch; the actual CRC code received by the network switch is c2. After receiving c2, the network switch checks d1 based on c2 and finds the check to be incorrect. Therefore, the network switch generates c1 based on the received d1 and flips at least one bit position (e.g., an odd or even bit position) of c1 to obtain c1', and sends c1' to network host B through channel #2. Since the network switch checks d1 incorrectly based on c2, the network switch can also discard d1 and c2 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch's transmitted data packet d1 was incorrectly transmitted, and network host B actually received data d2. The network switch's transmitted data packet c1' was also incorrectly transmitted, and network host B actually received cyclic redundancy check (CRC) code c3. After receiving d2 and c3, network host B performs a CRC check on d2 based on c3, and the check fails. Therefore, network host B generates c4 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c4 to obtain c4'. Since the CRC code generated by network host B (i.e., c4') is different from the received CRC code (i.e., c3), network host B determines that the data packet transmitted through channel #2 is incorrect, and network host B cannot determine whether the data packet transmitted through channel #1 is incorrect. Due to the error in the data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request a retransmission of the data packets (i.e., d1 and c1). The network switch can then send d1 and c1 back to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0165] Figure 8(g) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is mistakenly transmitted to the network switch; the network switch actually receives data d2. Using pass-through forwarding technology, after receiving a fragment of d2, the network switch immediately begins sending a fragment of d2 to network host B through channel #2. c1 is also mistakenly transmitted to the network switch; the network switch actually receives the CRC code c2. After receiving c2, the network switch checks d2 based on c2 and finds the check to be incorrect. Therefore, the network switch generates c3 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c3 to obtain c3', and sends c3' to network host B through channel #2. Since the network switch checks d2 based on c2 and finds the check to be incorrect, the network switch can also discard d2 and c2 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch's packet d2 was incorrectly transmitted; network host B actually received d3, while the network switch's packet c3' was correctly transmitted to network host B. Upon receiving d3 and c3', network host B performs a checksum verification on d3 based on c3', and the verification fails. Therefore, network host B generates c4 based on the received d3 and flips at least one bit position (e.g., an odd or even bit position) of c4 to obtain c4'. Since the cyclic redundancy check (CDR) code generated by network host B (i.e., c4') is different from the received CDR code (i.e., c3'), network host B determines that the data packet transmitted through channel #2 is incorrect, and cannot determine whether the data packet transmitted through channel #1 is also incorrect. Due to the error in the data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request the retransmission of data packets (i.e., d1 and c1). The network switch can then send d1 and c1 to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0166] Figure 8(h) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to the network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is mistakenly transmitted to the network switch; the network switch actually receives data d2. Using pass-through forwarding technology, after receiving a fragment of d2, the network switch immediately begins sending a fragment of d2 to network host B through channel #2. c1 is also mistakenly transmitted to the network switch; the network switch actually receives the CRC code c2. After receiving c2, the network switch checks d2 based on c2 and finds the check to be incorrect. Therefore, the network switch generates c3 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c3 to obtain c3', and sends c3' to network host B through channel #2. Since the network switch checks d2 based on c2 and finds the check to be incorrect, the network switch can also discard d2 and c2 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch correctly transmitted d2 to network host B, but incorrectly transmitted c3'. Network host B actually received cyclic redundancy check (CRC) code c4. After receiving d2 and c4, network host B checks d2 based on c4 and finds the check to be incorrect. Therefore, network host B generates c3 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c3 to obtain c3'. Since the CRC code generated by network host B (i.e., c3') is different from the received CRC code (i.e., c4), network host B determines that the data packet transmitted through channel #2 is faulty, and cannot determine whether the data packet transmitted through channel #1 is faulty. Due to the faulty data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request the retransmission of data packets (i.e., d1 and c1). The network switch can then send d1 and c1 to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0167] Figure 8(i) is an example diagram of a communication scenario provided by an embodiment of this application. In this example, network host A sends a data packet to a network switch through channel #1. The data packet includes data d1 and a cyclic redundancy check (CRC) code c1. d1 is mistakenly transmitted to the network switch, and the network switch actually receives data d2. Using pass-through forwarding technology, after receiving a fragment of d2, the network switch immediately begins sending a fragment of d2 to network host B through channel #2. c1 is also mistakenly transmitted to the network switch, and the network switch actually receives a CRC code c2. After receiving c2, the network switch checks d2 based on c2 and finds the check to be incorrect. Therefore, the network switch generates c3 based on the received d2 and flips at least one bit position (e.g., an odd or even bit position) of c3 to obtain c3', and sends c3' to network host B through channel #2. Since the network switch checks d2 based on c2 and finds the check to be incorrect, the network switch can also discard d2 and c2 and send a retransmission request to network host A to request the retransmission of the data packet (i.e., d1 and c1). The network switch's transmitted data d2 was incorrectly transmitted, and network host B actually received data d3. The network switch's transmitted data c3' was also incorrectly transmitted, and network host B actually received cyclic redundancy check (CRC) code c4. After receiving d3 and c4, network host B performs a CRC check on d3 based on c4, and the check fails. Therefore, network host B generates c5 based on the received d3 and flips at least one bit position (e.g., an odd or even bit position) of c5 to obtain c5'. Since the CRC code generated by network host B (i.e., c5') is different from the received CRC code (i.e., c4), network host B determines that the data packet transmitted through channel #2 is incorrect, and network host B cannot determine whether the data packet transmitted through channel #1 is incorrect. Due to the error in the data packet transmitted through channel #2, network host B sends a retransmission request to the network switch to request the retransmission of data packets (i.e., d1 and c1). The network switch can then send d1 and c1 to network host B based on the retransmission request. Optionally, after network host B correctly receives d1 and c1, it can send an acknowledgment response to the network switch. The network switch will then discard the stored d1 and c1 upon receiving the acknowledgment response.

[0168] To address the issue that shortening the ECC bits in notification consumption technology may reduce the accuracy of verification and error correction, this application provides a corresponding solution (see reference). Figure 9The methods provided in the embodiments of this application are described in detail below. The methods provided in the embodiments of this application involve a first communication device and / or a second communication device. Unless otherwise specified, the "first communication device" in this application can refer to a network host, a component within the network host (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the functions of the network host. The "second communication device" in this application can refer to a network host, a component within the network host (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the functions of the network host.

[0169] Figure 9 This is a flowchart illustrating a communication method provided in an embodiment of this application. The method addresses the problem in notification consumption technology where shortening the ECC bits may reduce the accuracy of error checking and correction. The method includes the following steps:

[0170] Step 901: If the first data in the storage area is allowed to be consumed, the first communication device flips at least one bit value of the first error check and correction code in the storage area to obtain a second error check and correction code.

[0171] The first error correction code is generated based on the first data and is used to check and correct the first data when an error occurs. The first communication device writes the first data to the storage area while simultaneously writing the first error check and correction code. Therefore, the first error check and correction code corresponds to the first data.

[0172] The storage area can be a shared storage area between the first communication device and the second communication device, or it can be a dedicated storage area for the second communication device, where the first communication device can write data.

[0173] When the first communication device determines that the first data can be consumed, it modifies the first error check and correction code in the storage area to a second error check and correction code. Specifically, at least one bit value of the first error check and correction code (e.g., at least one bit value in an odd position or at least one bit value in an even position) is flipped to obtain the second error check and correction code. At this time, the storage area stores the first data and the second error check and correction code. Therefore, the second error check and correction code corresponds to the first data. The second error check and correction code is used to indicate that the first data can be consumed.

[0174] Step 902: The second communication device obtains the first error check and correction code based on the second error check and correction code in the storage area.

[0175] Step 903: If the first data in the storage area is checked to be correct based on the first error check and correction code, the second communication device consumes the first data.

[0176] The second communication device can periodically check the data in the storage area to identify which data can be consumed. For example, when the period arrives, the second communication device obtains the second error check and correction code corresponding to the first data, and then flips at least one bit value of the second error check and correction code to obtain a first error check and correction code. For example, the second communication device flips at least one bit value at an odd or even position of the second error check and correction code to obtain the first error check and correction code.

[0177] Then, the first data in the storage area is checked based on the first error check and correction code. If the check is correct, it is determined that the consumption of the first data is allowed, and thus the first data is consumed. If an error occurs, it is determined that the consumption of the first data is not allowed.

[0178] In one possible implementation, after consuming the first data, the second communication device flips the second error check and correction code in the storage area back to the first error check and correction code. Therefore, when the first communication device detects that the second error check and correction code in the storage area has been flipped back to the first error check and correction code, it determines that the first data has already been consumed by the second communication device, and thus determines that the storage area can be updated. For example, the first communication device can update the first data and the first error check and correction code in the storage area to the second data and the corresponding third error check and correction code. Based on this method, efficient use of the storage area can be achieved.

[0179] Based on the above Figure 9 In one embodiment, by flipping at least one bit value of the error check and correction code, the data is implicitly indicated to be consumable, enabling the second communication device to recognize that the data can be consumed. This method does not require reducing the number of bits occupied by the verification information (i.e., the error check and correction code), thus ensuring the accuracy of the verification.

[0180] The above mainly describes the solution provided by the embodiments of this application from the perspective of the interaction between the first communication device and the second communication device. It is understood that, in order to achieve the above functions, the first communication device and the second communication device may include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware 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.

[0181] In this application embodiment, the first communication device and the second communication device can be divided into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0182] When using integrated units, Figure 10 A possible exemplary block diagram of the apparatus involved in an embodiment of this application is shown. For example... Figure 10 As shown, the device 1000 may include a processing unit 1002 and a communication unit 1003. The processing unit 1002 is used to control and manage the operation of the device 1000. The communication unit 1003 is used to support communication between the device 1000 and other devices. Optionally, the communication unit 1003 is also called a transceiver unit, and may include a receiving unit and / or a sending unit, respectively used to perform receiving and sending operations. The device 1000 may also include a storage unit 1001 for storing the program code and / or data of the device 1000.

[0183] The device 1000 can be the first communication device in the above embodiments. The processing unit 1002 can support the device 1000 in performing the operations of the first communication device in the above method embodiments. Alternatively, the processing unit 1002 mainly performs the internal operations of the first communication device in the method embodiments, and the communication unit 1003 can support communication between the device 1000 and other devices.

[0184] For example, in one embodiment, a communication unit 1003 is configured to receive N1 first segments and send the N1 first segments to a second communication device, wherein the N1 first segments include part or all of the data of a first data, and N1 is an integer greater than or equal to 1; and to receive M1 second segments, wherein the M1 second segments include a first cyclic redundancy check (CR) code corresponding to the first data, and M1 is an integer greater than or equal to 1; a processing unit 1002 is configured to, in the case of an error in the verification of the first data based on the first CR, modify the first CR in the M1 second segments to a second CR, thereby obtaining M1 third segments, wherein the second CR is used to verify the first data; the communication unit 1003 is further configured to send the M1 third segments to the second communication device; wherein the second CR is obtained by flipping at least one bit value of a third CR, and the third CR is determined based on the first data.

[0185] One possible implementation method is that the processing unit 1002 is further configured to flip the bit value at at least one odd or even position of the third cyclic redundancy check code to obtain the second cyclic redundancy check code.

[0186] In one possible implementation, the processing unit 1002 is further configured to discard the N1 first fragments and the M1 third fragments after the communication unit 1003 sends the M1 third fragments to the second communication device.

[0187] In one possible implementation, the communication unit 1003 is further configured to send a first retransmission request corresponding to the first data to a third communication device after the processing unit 1002 discards the N1 first fragments and the M1 third fragments.

[0188] In one possible implementation, the communication unit 1003 is further configured to receive a second retransmission request corresponding to the first data from the second communication device after sending the M1 third segments to the second communication device.

[0189] For example, in another embodiment, the communication unit 1003 is configured to receive N2 fourth segments and M2 fifth segments, wherein the N2 fourth segments include part or all of the second data, and the M2 fifth segments include a fourth cyclic redundancy check (CR) code corresponding to the second data, where N2 is an integer greater than or equal to 1, and M2 is an integer greater than or equal to 1; the processing unit 1002 is configured to, in the event that the second data is found to have an error based on the fourth CR and the fifth CR, determine whether to send a retransmission request corresponding to the second data to the first communication device, based on the fourth and fifth CRs; wherein the fifth CR is obtained by flipping at least one bit value of a sixth CR, and the sixth CR is determined based on the second data.

[0190] One possible implementation method is that the processing unit 1002 is used to determine whether to send a retransmission request corresponding to the second data to the first communication device based on the fourth cyclic redundancy check code and the fifth cyclic redundancy check code, including: when the fourth cyclic redundancy check code and the fifth cyclic redundancy check code are different, sending the retransmission request to the first communication device through the communication unit 1003.

[0191] In one possible implementation, the processing unit 1002 is further configured to discard the N2 fourth segments and the M2 fifth segments if the second data is found to be incorrect based on the fourth cyclic redundancy check code.

[0192] One possible implementation method is that the processing unit 1002 is further configured to flip the bit value at at least one odd or even position of the sixth cyclic redundancy check code to obtain the fifth cyclic redundancy check code.

[0193] The device 1000 can be the second communication device in the above embodiments. The processing unit 1002 can support the device 1000 in performing the operations of the second communication device in the above method embodiments. Alternatively, the processing unit 1002 mainly performs the internal operations of the second communication device in the method embodiments, and the communication unit 1003 can support communication between the device 1000 and other devices.

[0194] For example, in one embodiment, the processing unit 1002 is configured to, when the first data in the storage area is allowed to be consumed, flip at least one bit value of the first error check and correction code in the storage area to obtain a second error check and correction code; wherein the first error check and correction code and the second error check and correction code both correspond to the first data, and the second error check and correction code is used to indicate that the first data is allowed to be consumed.

[0195] One possible implementation method is a processing unit 1002, which is used to flip at least one bit value of a first error check and correction code in the storage area to obtain a second error check and correction code, including: flipping at least one bit value at an odd position or an even position of the first error check and correction code to obtain the second error check and correction code.

[0196] In one possible implementation, the processing unit 1002 is further configured to update the first data and the first error check and correction code in the storage area to the second data and the third error check and correction code corresponding to the second data when the second error check and correction code is flipped to the first error check and correction code.

[0197] For example, in another embodiment, the processing unit 1002 is configured to obtain a first error check and correction code based on a second error check and correction code in the storage area; wherein the first error check and correction code is obtained by flipping at least one bit value of the second error check and correction code; and consume the first data if the first data in the storage area is successfully checked based on the first error check and correction code.

[0198] In one possible implementation, the processing unit 1002 is further configured to flip the bit value at at least one odd or even position of the second error check and correction code to obtain the first error check and correction code.

[0199] In one possible implementation, the processing unit 1002 is further configured to, after consuming the first data, flip the second error check and correction code in the storage area back to the first error check and correction code.

[0200] It should be understood that the division of units in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, all units in the device can be implemented entirely through software calls from processing elements; all units can be implemented entirely in hardware; or some units can be implemented through software calls from processing elements, and some units can be implemented in hardware. For example, each unit can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as a program in memory, called and executed by a processing element of the device. Moreover, these units can be fully or partially integrated together, or implemented independently. The processing element mentioned here can also be called a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, the operations of the above methods or the various units mentioned above can be implemented through integrated logic circuits in the processor element or through software calls from processing elements.

[0201] In one example, a unit in any of the above devices can be one or more integrated circuits configured to implement the methods described above, such as: one or more application-specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), or a combination of at least two of these forms of integrated circuits. As another example, when a unit in the device can be implemented in the form of a processing element scheduler, the processing element can be a processor, such as a general-purpose central processing unit (CPU), or other processor capable of calling programs. Furthermore, these units can be integrated together and implemented as a System-on-a-Chip (SoC).

[0202] The receiving unit described above is an interface circuit of the device, used to receive signals from other devices. For example, when the device is implemented as a chip, the receiving unit is an interface circuit for the chip to receive signals from other chips or devices. The transmitting unit described above is an interface circuit of the device, used to transmit signals to other devices. For example, when the device is implemented as a chip, the transmitting unit is an interface circuit for the chip to transmit signals to other chips or devices.

[0203] Based on the same technical concept, embodiments of this application also provide a communication device, which is used to implement the functions of the first or second communication device in the above embodiments. For example... Figure 11 As shown, the device can be a network switch or a component within a network switch (e.g., a processor, chip, or chip system), or the device can be a network host or a component within a network host (e.g., a processor, chip, or chip system). The device includes a processor 1101 and a communication interface 1102, and optionally, a memory 1103. The memory 1103 can be independent of the processor 1101 or integrated into the processor 1101; no specific limitation is made. It is understood that... Figure 11 Only the main components of the communication device are shown. Furthermore, the communication device may further include input / output devices (not shown in the figure).

[0204] The processor 1101 is used to execute the program code stored in the memory 1103, specifically to perform the actions of the aforementioned processing unit 1002, which will not be described in detail here. The communication interface 1102 is specifically used to perform the actions of the aforementioned communication unit 1003, which will not be described in detail here.

[0205] Processor 1101 can be a CPU, a digital processing unit, etc. Processor 1101 can be used to process communication protocols and communication data, control the entire communication device, execute software programs, and process software program data, such as, but not limited to, baseband-related processing. Communication interface 1102 can be used for transmitting and receiving signals, such as, but not limited to, radio frequency transceiver. The above-mentioned devices can be disposed on separate chips, or at least partially or entirely on the same chip. For example, processor 1101 can be further divided into an analog baseband processor and a digital baseband processor. The analog baseband processor can be integrated with the transceiver on the same chip, while the digital baseband processor can be disposed on a separate chip. With the continuous development of integrated circuit technology, more and more devices can be integrated on the same chip. For example, a digital baseband processor can be integrated with multiple application processors (such as, but not limited to, graphics processors, multimedia processors, etc.) on the same chip. Such a chip can be called a system-on-a-chip (SoC). Whether to dispose of individual devices independently on different chips or integrate them on one or more chips often depends on the specific needs of the product design. The embodiments of this application do not limit the specific implementation of the above-mentioned devices.

[0206] The communication interface 1102 can be a transceiver, an interface circuit such as a transceiver circuit, or a transceiver chip, etc. Optionally, the communication interface 1102 may include a radio frequency (RF) circuit and an antenna. The RF circuit is mainly used for converting baseband signals to RF signals and processing RF signals. The antenna is mainly used for transmitting and receiving RF signals in the form of electromagnetic waves. Input / output devices, such as touch screens, displays, and keyboards, are mainly used for receiving user input data and outputting data to the user.

[0207] Memory 1103 is used to store the program executed by processor 1101. Memory 1103 can be non-volatile memory, such as a hard disk drive (HDD) or solid-state drive (SSD), or it can be volatile memory, such as random-access memory (RAM). Memory 1103 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto.

[0208] When the communication device is powered on, the processor 1101 can read the software program in the memory 1103, interpret and execute the instructions of the software program, and process the data of the software program. When data needs to be transmitted wirelessly, the processor 1101 performs baseband processing on the data to be transmitted and outputs the baseband signal to the radio frequency (RF) circuit. The RF circuit processes the baseband signal and transmits the RF signal outward in the form of electromagnetic waves through the antenna. When data is sent to the communication device, the RF circuit receives the RF signal through the antenna, converts the RF signal into a baseband signal, and outputs the baseband signal to the processor 1101. The processor 1101 converts the baseband signal into data and processes the data.

[0209] In another implementation, the radio frequency circuitry and antenna can be set up independently of the processor performing baseband processing. For example, in a distributed scenario, the radio frequency circuitry and antenna can be arranged remotely, independent of the communication device.

[0210] This application embodiment does not limit the specific connection medium between the communication interface 1102, processor 1101, and memory 1103. This application embodiment... Figure 11 The memory 1103, processor 1101, and communication interface 1102 are connected via a bus 1104. Figure 11 The connections between other components are shown in bold lines only and are not intended to be limiting. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0211] Optionally, the communication device described above can be a standalone device or part of a larger device. For example, the communication device can be:

[0212] (1) An independent integrated circuit (IC), or chip, or chip system or subsystem;

[0213] (2) A collection of one or more ICs, optionally including a storage component for storing data and instructions;

[0214] (3) Application-specific integrated circuit (ASIC), such as modem;

[0215] (4) Modules that can be embedded in other devices;

[0216] (5) Others, etc.

[0217] This application provides a chip (or chip system) including a processor for implementing any of the above-described method embodiments.

[0218] This application provides a computer-readable storage medium storing a computer program or instructions that, when executed, implement any of the above-described method embodiments.

[0219] This application provides a computer program product, which includes a computer program or instructions that, when executed, implement any of the above-described method embodiments.

[0220] This application provides a communication system, including the above-mentioned... Figure 4 The first communication device and the second communication device in the method embodiment.

[0221] This application provides a communication system, including the above-mentioned... Figure 9 The first communication device and the second communication device in the method embodiment.

[0222] In this application embodiment, "multiple" can refer to two or more. Therefore, in this application embodiment, "multiple" can also be understood as "at least two". "At least one" can be understood as one or more, such as one, two, or more. For example, "including at least one" means including one, two, or more. For example, including at least one of A, B, and C, then it could include A, B, C, A and B, A and C, B and C, or A, B, and C. "And / or" describes the association relationship between related objects. Specifically, there can be three relationships. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / ", unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0223] Furthermore, the terms "system" and "network" in the embodiments of this application can be used interchangeably, as can "according to" and "based on". The ordinal numbers such as "first" and "second" mentioned in the embodiments of this application are generally used to distinguish different objects and are not used to limit the order, sequence, priority, or importance of multiple objects. For example, the first communication device and the second communication device in the embodiments of this application are used to distinguish between two communication devices, and do not limit the priority or importance of these two communication devices.

[0224] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0225] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0226] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0227] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

Claims

1. A communication method, characterized in that, Applied to a first communication device, the method includes: Receive N1 first segments and send the N1 first segments to the second communication device, wherein the N1 first segments include part or all of the first data, and N1 is an integer greater than or equal to 1; Receive M1 second segments, wherein the M1 second segments include a first cyclic redundancy check code corresponding to the first data, and M1 is an integer greater than or equal to 1; If the first data fails to pass the verification based on the first cyclic redundancy check (CRCD), the first CRCD in the M1 second segments is modified to a second CRCD to obtain M1 third segments. The second CRCD is used to verify the first data. The M1 third segments are then sent to the second communication device. The second CRCD is obtained by flipping at least one bit value of a third CRCD, which is determined based on the first data.

2. The method as described in claim 1, characterized in that, Also includes: The bit values ​​at at least one odd or even position of the third cyclic redundancy check code are flipped to obtain the second cyclic redundancy check code.

3. The method as described in claim 1 or 2, characterized in that, Also includes: After sending the M1 third fragments to the second communication device, the N1 first fragments and the M1 third fragments are discarded.

4. The method as described in claim 3, characterized in that, Also includes: After discarding the N1 first fragments and the M1 third fragments, a first retransmission request corresponding to the first data is sent to the third communication device.

5. The method according to any one of claims 1 to 4, characterized in that, Also includes: After sending the M1 third segments to the second communication device, a second retransmission request corresponding to the first data is received from the second communication device.

6. A communication method, characterized in that, Applied to a second communication device, the method includes: Receive N2 fourth segments and M2 fifth segments, wherein the N2 fourth segments include part or all of the second data, and the M2 fifth segments include a fourth cyclic redundancy check code corresponding to the second data, where N2 is an integer greater than or equal to 1 and M2 is an integer greater than or equal to 1. If the second data fails to pass verification based on the fourth cyclic redundancy check (CRCD), a decision is made, based on the fourth CRCD and the fifth CRCD, whether to send a retransmission request corresponding to the second data to the first communication device; wherein the fifth CRCD is obtained by flipping at least one bit value of the sixth CRCD, and the sixth CRCD is determined based on the second data.

7. The method as described in claim 6, characterized in that, The step of determining whether to send a retransmission request corresponding to the second data to the first communication device based on the fourth and fifth cyclic redundancy check codes includes: If the fourth cyclic redundancy code and the fifth cyclic redundancy code are different, the retransmission request is sent to the first communication device.

8. The method as described in claim 6 or 7, characterized in that, Also includes: If the second data fails to be verified based on the fourth cyclic redundancy check code, the N2 fourth segments and the M2 fifth segments are discarded.

9. The method according to any one of claims 6 to 8, characterized in that, Also includes: The bit values ​​at at least one odd or even position of the sixth cyclic redundancy check code are flipped to obtain the fifth cyclic redundancy check code.

10. A communication method, characterized in that, Applied to a first communication device, the method includes: If the first data in the storage area is allowed to be consumed, at least one bit value of the first error check and correction code in the storage area is flipped to obtain a second error check and correction code; Wherein, both the first error check and correction code and the second error check and correction code correspond to the first data, and the second error check and correction code is used to indicate that the first data is allowed to be consumed.

11. The method as described in claim 10, characterized in that, The step of flipping at least one bit value of the first error check and correction code in the storage area to obtain the second error check and correction code includes: The second error check and correction code is obtained by flipping the bit value at at least one odd or even position of the first error check and correction code.

12. The method as described in claim 10 or 11, characterized in that, Also includes: When the second error check and correction code is flipped to the first error check and correction code, the first data and the first error check and correction code in the storage area are updated to the second data and the third error check and correction code corresponding to the second data.

13. A communication method, characterized in that, Applied to a second communication device, the method includes: A first error check and correction code is obtained based on a second error check and correction code within the storage area; wherein the first error check and correction code is obtained by flipping at least one bit value of the second error check and correction code; If the first data in the storage area is successfully checked based on the first error check and correction code, the first data is consumed.

14. The method as described in claim 13, characterized in that, Also includes: The first error check and correction code is obtained by flipping the bit value at at least one odd or even position of the second error check and correction code.

15. The method as described in claim 13 or 14, characterized in that, Also includes: After consuming the first data, the second error check and correction code in the storage area is flipped to the first error check and correction code.

16. A communication device, characterized in that, The device includes a processor coupled to a memory storing a computer program; the processor is configured to invoke part or all of the computer program in the memory to cause the method as described in any one of claims 1 to 5 to be executed, or the method as described in any one of claims 6 to 9 to be executed, or the method as described in any one of claims 10 to 12 to be executed, or the method as described in any one of claims 13 to 15 to be executed.

17. A communication system, characterized in that, The communication system includes a first communication device and a second communication device; wherein the first communication device is used to perform the method as described in any one of claims 1 to 5, and the second communication device is used to perform the method as described in any one of claims 6 to 9.

18. A communication system, characterized in that, The communication system includes a first communication device and a second communication device; wherein the first communication device is used to perform the method as described in any one of claims 10 to 12, and the second communication device is used to perform the method as described in any one of claims 13 to 15.

19. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when some or all of the computer program is executed by a computer, causes the method as described in any one of claims 1 to 5 to be executed, or causes the method as described in any one of claims 6 to 9 to be executed, or causes the method as described in any one of claims 10 to 12 to be executed, or causes the method as described in any one of claims 13 to 15 to be executed.

20. A computer program product, characterized in that, When the computer reads and executes the computer program product, the method as described in any one of claims 1 to 5 is executed, or the method as described in any one of claims 6 to 9 is executed, or the method as described in any one of claims 10 to 12 is executed, or the method as described in any one of claims 13 to 15 is executed.