Data transmission method and device

By determining the packet aggregation threshold based on the maximum number of aggregable packets and flow control information during inter-GPU communication, and performing data aggregation processing, the problem of low link bandwidth utilization is solved, and efficient data transmission is achieved.

CN122053515APending Publication Date: 2026-05-15CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE COMM LTD RES INST
Filing Date
2026-02-03
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, during inter-GPU card communication, data is transmitted through fixed caches or data information is encapsulated together with the data packet header, resulting in low link bandwidth utilization and thus reduced data transmission efficiency.

Method used

By determining the packet aggregation threshold at the sending end based on the maximum number or maximum length of aggregable packets in the data queue to be sent, combined with flow control information, data aggregation is performed, and the aggregation result is encapsulated and forwarded to the receiving end.

Benefits of technology

When the link is open, large packet transmission can be achieved, improving bandwidth utilization and avoiding buffer overflow and packet loss problems when the link is congested or the receiver's buffer is insufficient, thereby improving data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122053515A_ABST
    Figure CN122053515A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and provides a data transmission method and device, the method is applied to a sending end, and the method comprises the following steps: determining a packet splicing threshold according to an aggregation condition of a transaction message in a to-be-sent data queue; the aggregation condition comprises the maximum number or the maximum length of the aggregable messages, or the maximum number and flow control information of the aggregable messages; and when the packet splicing threshold value is greater than 0, performing aggregation processing on the transaction messages in the to-be-sent data queue according to the packet splicing threshold value, and forwarding an aggregation result to a corresponding receiving end after packaging the aggregation result. According to the method and the device provided by the invention, large packet transmission can be realized by utilizing the MNSP upper limit when the link is smooth, the bandwidth utilization rate is improved, the sending threshold can be dynamically reduced when the link is congested or the cache of the receiving end is insufficient, the problems of overflow and packet loss of the buffer area of the receiving end caused by excessive sent data are avoided from the source, and the data transmission efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In related technologies, during inter-GPU (Graphics Processing Unit) communication, a load / store-based data transmission scheme is typically used. This scheme generally has a fixed data size, typically equivalent to a cacheline (64B or 128B), and is only suitable for scenarios with high transmission frequency and small data size. Another related technology employs a DMA (Direct Memory Access) message semantics-based data transmission scheme. This scheme encapsulates data information and packet headers together and transmits them according to certain rules (such as Ethernet frame intervals). Besides large-scale computational data, this process also involves numerous small data packets used for responding to feedback and operation requests. These small packets, due to their small size or lack of payload and high transmission frequency, along with the additional overhead of protocol headers and frame intervals, reduce the proportion of effective data on the link, leading to lower link bandwidth utilization and consequently reduced data transmission efficiency.

[0003] Application content This application provides a data transmission device method and apparatus to solve the technical problem that when the prior art uses fixed buffer to transmit data or encapsulates data information together with data packet headers, the link bandwidth utilization becomes low, which in turn leads to a decrease in data transmission efficiency.

[0004] In a first aspect, embodiments of this application provide a data transmission method applied at a sending end, comprising: The packet concatenation threshold is determined based on the aggregation conditions of transaction messages in the data queue to be sent; the aggregation conditions include the maximum number or maximum length of aggregable messages, or the maximum number of aggregable messages and flow control information; the flow control information is used to indicate the remaining buffer space or link status of the receiving end corresponding to the data queue to be sent. When the packet concatenation threshold is greater than 0, the transaction messages in the data queue to be sent are aggregated according to the packet concatenation threshold, and the aggregation result is encapsulated and forwarded to the corresponding receiving end.

[0005] In one embodiment, the aggregation condition includes the maximum number of aggregable messages; The step of determining the packet concatenation threshold based on the aggregation conditions of the data queue to be sent includes: Obtain the number of messages in the queue of data to be sent; If the number of messages exceeds 1 but does not exceed the maximum number of aggregable messages, the number of messages is determined as the packet concatenation threshold. If the number of packets exceeds the maximum number of aggregable packets, the maximum number of aggregable packets is determined as the packet concatenation threshold. If the number of messages does not exceed 1, the packet concatenation threshold is determined to be 0.

[0006] In one embodiment, after obtaining multiple queues of data to be sent, the method further includes: When the number of messages in the data queue to be sent is 1, the transaction message is encapsulated and sent to the corresponding receiving end.

[0007] In one embodiment, the aggregation conditions include the maximum number of aggregable packets and the flow control information; The step of determining the packet concatenation threshold based on the aggregation conditions of the data queue to be sent includes: The maximum length of aggregable packets in the data queue to be sent is determined based on the flow control information. The packet concatenation threshold is determined based on the maximum length of the aggregable message and the maximum number of aggregable messages.

[0008] In one embodiment, the method further includes: when the number of messages in the data queue to be sent is 1 and the maximum length of the aggregateable message is greater than the length of the corresponding transaction message, encapsulating the corresponding transaction message and sending it to the corresponding receiving end.

[0009] In one embodiment, encapsulating the aggregation result and forwarding it to the corresponding receiving end includes: A first identifier is added to the header of the aggregation result, and a second identifier is added to the header of each sub-packet corresponding to the aggregation result to obtain a new aggregation result, which is then sent to the corresponding receiving end. The first identifier is used to indicate at least one of the following: the number of sub-packets, the common fields of the transaction messages corresponding to each sub-packet, and the fields related to forwarding; the second identifier is used to indicate at least one of the following: the tag number, packet length, completion status, memory address, and user-defined information of the transaction messages corresponding to each sub-packet.

[0010] In one embodiment, before determining the packet concatenation threshold based on the aggregation conditions of the data queue to be sent, the method further includes: Multiple transaction messages are distributed to the corresponding data queues according to their business types, resulting in multiple data queues to be sent. The data queue to be sent can be any one of the plurality of data queues to be sent; different data queues to be sent correspond to different message types.

[0011] Secondly, embodiments of this application provide a data transmission apparatus, applied at a transmitting end, comprising: The threshold determination module is used to determine the packet concatenation threshold based on the aggregation conditions of transaction packets in the data queue to be sent; the aggregation conditions include the maximum number or maximum length of aggregable packets, or the maximum number of aggregable packets and flow control information; the flow control information is used to indicate the remaining buffer space or link status of the receiving end corresponding to the data queue to be sent. The transmission module is used to aggregate transaction messages in the data queue to be sent according to the packet aggregation threshold when the packet aggregation threshold is greater than 0, and then encapsulate the aggregation result and forward it to the corresponding receiving end.

[0012] Thirdly, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described intelligent agent interaction methods.

[0013] Fourthly, this application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described intelligent agent interaction methods.

[0014] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described intelligent agent interaction methods.

[0015] The data transmission method and apparatus provided in this application determine the packet concatenation threshold by the sending end based on the maximum number or maximum length of aggregable packets in the data queue to be sent, or the maximum number of aggregable packets and flow control information. It utilizes Static Configuration Service (MNSP) and / or dynamic environment (flow control) to intelligently calculate the most reasonable sending window size. Then, it aggregates the transaction packets in the data queue to be sent according to the packet concatenation threshold, encapsulates the aggregation result, and forwards it to the corresponding receiving end. This method can achieve large packet transmission by utilizing the MNSP limit when the link is smooth, thereby improving bandwidth utilization. It can also dynamically reduce the sending threshold when the link is congested or the receiving end buffer is insufficient, thereby avoiding the problem of receiving end buffer overflow and packet loss caused by sending too much data from the source and improving data transmission efficiency. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is one of the flowcharts illustrating the data transmission method provided in this application.

[0018] Figure 2 This is the second flowchart illustrating the data transmission method provided in this application.

[0019] Figure 3 This is a schematic diagram of transaction message aggregation and decomposition provided in this application.

[0020] Figure 4 This is the third flowchart illustrating the data transmission method provided in this application.

[0021] Figure 5 This is a schematic diagram of the structure of the aggregation package provided in this application.

[0022] Figure 6 This is a schematic diagram of the data transmission device provided in this application.

[0023] Figure 7 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] The following is combined with Figures 1-6 This application describes the data transmission method and apparatus.

[0026] Figure 1 This is one of the flowcharts illustrating the data transmission method provided in this application; see reference. Figure 1 This data transmission method is applied to the sending end.

[0027] It should be noted that the sending end can be any one of two or more graphics processing units (GPUs) that are exchanging data, and the other GPU that is exchanging data is the receiving end.

[0028] For example, during the process of GPU1 using the Switch architecture to interact with other GPUs, GPU1 prepares the data at the source end and sends it to the IO port. The Switch forwards the data to the corresponding port of the Switch according to the packet header information, and finally the data reaches the destination GPU and is written to the corresponding memory address.

[0029] Specifically, the method includes the following steps: Step 110: Determine the packet concatenation threshold based on the aggregation conditions of transaction messages in the data queue to be sent; the aggregation conditions include the maximum number or maximum length of aggregable messages, or the maximum number of aggregable messages and flow control information; the flow control information is used to indicate the remaining buffer space or link status of the corresponding receiver in the data queue to be sent.

[0030] In this step, the queue of data to be sent can be a Virtual Channel (VC) queue that stores transaction messages at the sending end (such as the source GPU) according to the business type (such as read request, write response, etc.).

[0031] In this embodiment, the transaction messages in each queue are of the same type, and different queues correspond to different message types.

[0032] In this step, the Maximum Number of Subpackets (MNSP) is a preset configuration parameter used to limit the upper limit of the number of subpackets contained in a single aggregated packet, in order to balance transmission efficiency and unpacking latency.

[0033] In this step, flow control information is used to reflect the real-time reception capability of the receiving end, specifically including remaining buffer space (such as Credit value) or link status (such as congestion indication).

[0034] In this step, the packet concatenation threshold is the maximum number of transaction messages that the data queue to be sent is allowed to be packaged and sent at the current moment.

[0035] In this step, aggregation conditions are used to determine whether data aggregation can be performed and how much data to aggregate. Aggregation conditions can be the maximum number or maximum length of aggregateable messages and are applied to opportunity-based dynamic aggregation mechanisms.

[0036] Specifically, in this embodiment, when performing queue scheduling, sub-packet aggregation can be performed on transaction messages in each queue on an opportune basis, which is reflected in the number and length of the aggregated sub-packets. In aggregation mode, transmission efficiency and processing latency need to be considered comprehensively. It is necessary to configure the maximum number of sub-packets (MNSP) or the maximum length of aggregated packets (MLAP) for each type of data packet in aggregation mode as a condition to constrain the degree of data aggregation and the sending of aggregated packets.

[0037] For example, if the number of messages in a certain data queue to be sent is greater than 1 but less than the preset MNSP value, the number of messages can be used as the packet aggregation threshold, that is, all data packets in the queue are aggregated now; if the number of messages in the queue is 1, no clustering is required, and the transaction message is sent directly to the corresponding receiver; if the number of messages in the queue is 0, wait for the next data transmission.

[0038] In this embodiment, the aggregation conditions may include both the maximum number of aggregable packets and flow control information, and can be applied to an opportunistic transaction aggregation mechanism driven by both business and flow control.

[0039] Specifically, to avoid packet loss due to excessively large aggregated data packets received by the receiving end during transaction packet aggregation, which could lead to link congestion or insufficient buffer space at the receiving end, this embodiment, in addition to considering whether there are similar packets that can be aggregated, also comprehensively considers the link status to determine the degree of transaction packet aggregation. Combined with the flow control mechanism, the size of the aggregated transaction packets is flexibly determined based on whether the link is congested and whether the receiving end has sufficient buffer space.

[0040] For example, if there are 3 packets in a certain data queue to be sent, the preset MNSP value is 4, and the maximum number of data packets that the receiver can receive is determined to be 2 based on the remaining buffer space or link congestion at the receiver, then the 2 transaction packets in the queue are aggregated and packaged and sent to the receiver, and the remaining 1 transaction packet waits for subsequent data transmission.

[0041] This embodiment intelligently calculates the most reasonable sending window size, i.e., the packet aggregation threshold, through static configuration (MNSP) and / or dynamic environment (flow control). It can realize an opportunity-based dynamic aggregation mechanism, thereby achieving large packet transmission by utilizing the MNSP upper limit when the link is smooth, improving bandwidth utilization. It can also realize an opportunity-based transaction aggregation mechanism driven by both service and flow control, thereby dynamically reducing the sending threshold when the link is congested or the receiver buffer is insufficient. This avoids the receiver buffer overflow and packet loss problems caused by sending too much data from the source, ensuring the reliability of transmission.

[0042] Step 120: If the packet concatenation threshold is greater than 0, aggregate the transaction messages in the data queue to be sent according to the packet concatenation threshold, and encapsulate the aggregation result before forwarding it to the corresponding receiving end.

[0043] In this step, if the packet concatenation threshold is greater than 0, it indicates that the transaction messages of the same type in the current queue meet the aggregation conditions. Then, no more than the number of transaction messages to be sent are extracted from the data queue and processed for aggregation. Specifically, if the number of extracted messages is 1, it is a single packet processing; if it is greater than 1, it is a multi-packet merging, and the merging method is determined by the packet concatenation threshold.

[0044] In this step, the aggregation result is a data carrier after aggregation processing, which contains data from multiple sub-packages and corresponding sub-package headers. Each sub-package header includes unique attributes such as indicating the current sub-package size, data content, and format.

[0045] In this step, the aggregated data packet corresponding to the aggregation result also corresponds to an aggregated packet header, which may include aggregated packet attributes, such as the number of packets merged and common attributes of each sub-packet.

[0046] In this embodiment, a unified aggregation header (such as a header containing a Packing Number field) can be added to the aggregation result to form a final transmittable data packet, which is then sent to the corresponding receiving end.

[0047] In this embodiment, if the packet concatenation threshold is equal to 0, it indicates that the current queue is empty and will not participate in the data transmission process of aggregation or direct transmission, and will wait for the next data transmission process.

[0048] The data transmission method provided in this application determines the packet concatenation threshold by the sending end based on the maximum number of aggregable packets in the data queue to be sent, or the maximum number of aggregable packets and flow control information. It utilizes Static Configuration Service (MNSP) and / or dynamic environment (flow control) to intelligently calculate the most reasonable sending window size. Then, it aggregates the transaction packets in the data queue to be sent according to the packet concatenation threshold, encapsulates the aggregation result, and forwards it to the corresponding receiving end. This method can achieve large packet transmission by utilizing the MNSP limit when the link is smooth, thereby improving bandwidth utilization. It can also dynamically reduce the sending threshold when the link is congested or the receiving end buffer is insufficient, thus avoiding the problem of receiving end buffer overflow and packet loss caused by sending too much data from the source, and improving data transmission efficiency.

[0049] In one embodiment, the aggregation condition includes the maximum number of aggregateable packets; determining the packet concatenation threshold based on the aggregation condition of the data queue to be sent includes: obtaining the number of packets in the data queue to be sent; determining the number of packets as the packet concatenation threshold when the number of packets exceeds 1 but does not exceed the maximum number of aggregateable packets; determining the maximum number of aggregateable packets as the packet concatenation threshold when the number of packets exceeds the maximum number of aggregateable packets; and determining the packet concatenation threshold as 0 when the number of packets does not exceed 1.

[0050] In this embodiment, according to the opportunity-based dynamic aggregation mechanism, when reading data packets from the queue for encapsulation and transmission, if the number of aggregateable data packets of the same type and destination accumulated in the cache of a specific virtual channel (VC) at the sending end (source GPU) at the current moment reaches the corresponding sub-packet number limit or packet length limit, then the aggregateable packets must be aggregated and sent in accordance with the limit setting.

[0051] For example, if a transaction message is a write request message, the maximum number of aggregated messages (MNSP) is 4. When the scheduler polls the write request queue, it obtains the number of messages in the current queue. If there are 3 write request messages in the current queue, since 3 is greater than 1 and less than or equal to 4, the packet assembly threshold is determined to be 3, and these 3 messages will be packaged together. If there are 6 write request messages in the current queue, since 6 is greater than 4, the packet assembly threshold is determined to be 4 due to the MNSP configuration. The first 4 messages will be taken out and packaged, and the remaining 2 will be reserved for the next scheduling.

[0052] The data transmission method provided in this application embodiment can maximize the use of the MNSP upper limit for data merging when business data arrives in large quantities (number of packets > 1), significantly reducing packet header overhead and frame interval waste on the link and improving bandwidth utilization. At the same time, setting the threshold to 0 when the number does not exceed 1 can effectively distinguish between aggregation mode and non-aggregation mode, avoiding the forced application of complex aggregation protocol headers (such as additional sub-packet header overhead) to a single packet, and optimizing the processing efficiency or protocol overhead in small packet scenarios.

[0053] In one embodiment, after obtaining multiple data queues to be sent, the data transmission method further includes: when the number of messages in the data queue to be sent is 1, encapsulating the transaction message and sending it to the corresponding receiving end.

[0054] In this embodiment, if the number of aggregateable data packets in the data queue to be sent is insufficient to reach the upper limit, the data should be sent immediately to control transmission delay, rather than waiting until the aggregation limit is reached.

[0055] For example, when the scheduler polls a specific virtual channel (VC), if there is only one write request message in the current VC queue and the packet concatenation threshold is determined to be 0, it will not enter the aggregation and encapsulation process (i.e., it will not generate a multi-sub-packet structure containing Packing Numbers). Instead, it may directly send the message in the traditional single-packet format, or continue to wait for subsequent messages to arrive under the forced aggregation strategy.

[0056] Figure 2 This is the second flowchart illustrating the data transmission method provided in this application. Figure 2 In the illustrated embodiment, when the scheduler polls a VC queue and reads data, it first determines whether the VC queue has aggregation mode enabled (i.e., if the number of packets in the queue is greater than or equal to 1, indicating that the transaction packets in the queue can be aggregated, then aggregation mode is enabled; otherwise, aggregation mode is not enabled). If it is not enabled, sub-packets are directly read from the queue and the PackingNumber (number of sub-packets) field in the packet header is marked as 0, and then the sub-packet is encapsulated and sent. If aggregation mode is enabled, it needs to be determined based on the number of aggregable sub-packets in the current queue (Number of...). Sub-packets (NSP) are used to determine the number of packets to be aggregated. If NSP ≤ MNSP, the NSP sub-packets are aggregated to obtain an aggregated data packet, which is then encapsulated. The number of sub-packets in this aggregated data packet is NSP, and a sub-packet header is encapsulated for each sub-packet. If NSP > MNSP, the MNSP sub-packets in the current queue are aggregated to obtain an aggregated data packet, which is then encapsulated. The number of sub-packets in this aggregated data packet is MNSP, and a sub-packet header is encapsulated for each sub-packet. The remaining unaggregated sub-packets in the current queue are to be transmitted in the next data transmission. Finally, the encapsulated data packet is sent to the corresponding receiving end.

[0057] Figure 3 This is a schematic diagram of transaction message aggregation and decomposition provided in this application. Figure 3In the illustrated embodiment, the scheduler polls seven different queues (VC0-VC7), setting the maximum number of sub-packets (transaction messages) in each queue to 4, i.e., MNSP=4. When GPU0 (sender) sends data to GPU1 (receiver), when the data packet is read from the VC0 queue, there are two data packets destined for GPU1 in the VC0 queue, so the two sub-packets are aggregated and sent. When polling the VC1 queue, even though there is only one data packet destined for GPU1 at present, it should be sent immediately instead of waiting for subsequent data packets. When polling the VC7 queue, four sub-packets destined for GPU1 are aggregated. For GPU2, when polling the VC1 queue, there are five data packets destined for GPU2 in the current queue. Since the maximum number of aggregated sub-packets is 4, even if there are five data sub-packets of the same type in the current queue, the number of aggregated packets is still 4. The fifth sub-packet should wait for the next round of aggregation to determine whether to aggregate with the newly arrived data packet or send it separately.

[0058] The data transmission method provided in this application ensures that single messages with high intermittent or real-time requirements can be sent immediately when the number of messages in the data queue to be sent is 1, thereby avoiding additional transmission delays caused by forcibly waiting for subsequent messages.

[0059] In one embodiment, the aggregation conditions include the maximum number of aggregable packets and flow control information; determining the packet concatenation threshold based on the aggregation conditions of the data queue to be sent includes: determining the maximum length of aggregable packets in the data queue to be sent based on the flow control information; and determining the packet concatenation threshold based on the maximum length of aggregable packets and the maximum number of aggregable packets.

[0060] In this embodiment, the opportunistic transaction aggregation mechanism driven by both business and flow control adopts a credit-based flow control (CBFC) approach to provide packet concatenation thresholds for the data queue to be sent.

[0061] The following explanation uses the remaining buffer space of the receiving end as an example to illustrate the process. In this case, the sending end needs to maintain a credit counter to record the remaining buffer space of the receiving end's VC queue. Data can only be sent when the receiving end's VC queue has enough buffer space; otherwise, data cannot be sent.

[0062] In this embodiment, the receiver's credit unit size is CS (Credit Size), and the current remaining credit value is CR (Credit Rest). Therefore, the maximum length of the data packet that the sender can send is ML (Maximum Length), where ML = CS × CR. Excluding the overhead of logical messages, the maximum length of the aggregated transaction payload is MLAP (Maximum Length of Aggregated Payload), which is the maximum length of the aggregated message. In this embodiment, when performing data aggregation, it is necessary to ensure that not only the number of sub-packets does not exceed the MNSP limit, but also the total length of the aggregated message does not exceed the credit limit.

[0063] For example, the sending GPU is sending a series of read data response messages to the receiving end through the virtual channel VC1. The standard length of each message is 128 bytes (including the sub-packet header), and the preset maximum number of aggregateable messages (MNSP) is 16. The scheduler reads the current flow control information and finds that the remaining credit value (Credit) of the receiving end corresponding to VC1 is 20 units. Each credit unit corresponds to 64 bytes. Based on this, the maximum length of the aggregateable message is calculated as 20 (credit) × 64 (bytes / credit) = 1280 bytes. That is, at the current moment, the physical link and the receive buffer can only accept a maximum of 1280 bytes of data. Then, the capacity is calculated based on the maximum length: 1280 bytes / 128 bytes (single packet length) = 10. That is, the flow control environment allows 10 packets to be sent. Then, this calculated value (10) is compared with the preset configuration limit (16). If 10 < 16, then the flow control is determined to be the current bottleneck. The final packet concatenation threshold is 10. If the calculated flow control allowed number is 20, then MNSP is used as the packet concatenation threshold.

[0064] Taking the link status as an example of flow control information, if the size of the data packets that the current data transmission link between the sender and receiver can send is P, the congestion control algorithm allocates a maximum transmission unit window or time slice of data to the current sender based on the current network congestion situation. That is, the maximum aggregable data packet value corresponding to the value of P is calculated as n. The value of n is used to compete with MNSP, and the smaller value between the two is taken as the packet aggregation threshold. This ensures that even when the link is limited, the service data can still continue to flow at the maximum rate allowed by the network, thus improving the transmission stability of the entire intelligent computing network.

[0065] For example, the congestion control algorithm allocates a maximum transmission unit window or time slice of data of 12 to the current sender based on the current network congestion situation. The preset maximum transmission unit window (MNSP) is 16. Since 12 < 16, the flow control is determined to be the current bottleneck, and the packet concatenation threshold is set to 12. If the maximum transmission unit window or time slice of data allocated to the current sender is 18, then the MNSP is used as the packet concatenation threshold.

[0066] The data transmission method provided in this application determines the maximum length of aggregable packets in the data queue to be sent through flow control information; and determines the packet assembly threshold based on the maximum length and maximum number of aggregable packets. This method dynamically and accurately adjusts the packet assembly threshold of the sending end by comprehensively considering the link status or the receiver's buffer status. In this way, the coordinated optimization of flow control and aggregation during data transmission is achieved, effectively avoiding problems such as packet loss or buffer overflow caused by simply packing packets with a fixed threshold in traditional solutions.

[0067] In one embodiment, the data transmission method further includes: when the number of messages in the data queue to be sent is 1 and the maximum length of the aggregateable message is greater than the length of the corresponding transaction message, encapsulating the corresponding transaction message and sending it to the corresponding receiving end.

[0068] In this embodiment, there is only one transaction message in the data queue to be sent, so there is no need to perform multi-packet merging operation. However, the sending action is still constrained by the flow control mechanism. Only when the transmission limit (maximum length of the aggregated message) covers the length of the message is the single packet allowed to pass.

[0069] Figure 4 This is the third flowchart illustrating the data transmission method provided in this application. Figure 4 In the illustrated embodiment, in this mode, each service data packet is cached in its respective VC queue space, awaiting scheduling. When scheduled (i.e., a data packet is dequeued from the VC queue), it is first determined whether the VC has enabled the transaction aggregation mechanism. If not, it means that at most one data packet will be scheduled for transmission. At this time, it is determined whether the credit value is sufficient, i.e., whether the receiver's buffer space is sufficient. If the credit is sufficient, it is scheduled for transmission; otherwise, it is skipped and waits for the next scheduling output. If the transaction aggregation mode is enabled, it is determined whether the sub-packet at the head of the queue has sufficient transmission credit. If it has sufficient credit, it is scheduled out, the sub-packet header is encapsulated, and the Packing Number (number of sub-packets) value and transmission credit value are updated. Then, it is determined whether there are any data packets in the queue that can be aggregated. If the next packet has the same type and destination information, it means that there is an opportunity to continue aggregation, which is represented by the Remaining Number of Aggregable Sub-packets (RNSP) RNSP>0. At this time, the new head packet of the queue can be aggregated, so the process continues to loop to determine whether there is sufficient credit value to send the packet. If sufficient credit is available, the scheduler outputs the data, encapsulates the sub-packet header, and updates the Packing Number and remaining sending credit. Otherwise, the aggregation ends, and the final aggregated packet header is encapsulated and sent.

[0070] The data transmission method provided in this application embodiment encapsulates and sends the corresponding transaction message to the corresponding receiver when the number of messages in the data queue to be sent is 1 and the maximum length of the aggregateable message is greater than the length of the corresponding transaction message. This avoids the problem of receiver buffer overflow or silent packet loss at the physical link layer caused by blindly sending a standard small packet, thereby ensuring the absolute reliability of data transmission in extreme congestion scenarios.

[0071] In one embodiment, encapsulating the aggregation result and forwarding it to the corresponding receiving end includes: adding a first identifier to the header of the aggregation result packet, adding a second identifier to the header of each sub-packet corresponding to the aggregation result to obtain a new aggregation result, and sending the new aggregation result to the corresponding receiving end; wherein, the first identifier is used to indicate at least one of the following: the number of sub-packets, the common fields of the transaction messages corresponding to each sub-packet, and the fields related to forwarding; the second identifier is used to indicate at least one of the following: the tag number, packet length, completion status, memory address, and user-defined information of the transaction messages corresponding to each sub-packet.

[0072] In this embodiment, in order to distinguish whether a data packet is an aggregated packet, a Packing Number field can be designed in the data packet header to indicate whether a data packet is an aggregated packet; if the Packing Number is 0, it means that the data packet is a non-aggregated packet, and if the Packing Number is greater than 0, it means that the data packet is an aggregated packet, that is, an aggregated result.

[0073] In this embodiment, the number of sub-packets (headers) in the aggregated packet is equal to the Packing Number, and in the aggregation mode, each sub-packet data is encapsulated with a sub-packet header, which facilitates the receiving GPU to parse and split the received aggregated packet.

[0074] Specifically, each sub-packet has a unique second identifier carried in its header. This second identifier includes the transaction tag number, sub-packet data length, completion status, memory address, and other user-defined information. The first identifier in the new aggregation result is shared by all sub-packets. This first identifier includes common fields of different sub-transaction messages or fields related to forwarding, such as the receiver's identifier (GPU ID), transaction type, and VC. In addition, this embodiment also sets the header length and field positions of each type of sub-packet to be fixed, further facilitating the receiver's parsing and splitting of the received aggregation packets.

[0075] In this embodiment, to reduce the complexity of hardware implementation, when the aggregation mode is enabled, all data sub-packets will be transmitted after inserting a sub-header. If the number of aggregable sub-packets NSP is greater than 1, it means that multiple data sub-packets can be aggregated and sent. If the number of aggregable sub-packets NSP is less than the maximum number limit, i.e., NSP≤MNSP, all currently aggregable sub-packets will be aggregated together and sent. If NSP>MNSP, then at most MNSP sub-packets can be aggregated together and sent.

[0076] Figure 5 This is a schematic diagram of the structure of the aggregation package provided in this application. Figure 5 In the illustrated embodiment, data packets for inter-GPU communication are categorized into various transaction types. Types such as read responses and write requests contain data content, while types such as write responses and read requests do not. Therefore, during data aggregation, different aggregation limits can be configured for different types of sub-packets. Figure 5 As shown in “(a) Data packets with payload - no aggregation”, the data packet corresponding to the transaction message includes a data packet header (including sub-packet quantity = 0, data length ≠ 0), data, and checksum; Figure 5 As shown in “(b) Payloadless Packet - No Aggregation”, this packet only includes the packet header and checksum; as Figure 5 As shown in "(c) Four sub-data packets with payload without aggregation", this data packet includes: data packet header, sub-header 0, data 0, sub-header 1, data 1, sub-header 2, data 2, sub-header 3, data 3, and checksum. This data packet is aggregated as a whole, with "sub-header + data". In this case, only a small number of sub-packets need to be aggregated to form a larger aggregated packet, meeting the line-speed forwarding requirements of the switching chip; as shown in the example. Figure 5 As shown in “(d) Aggregation of 8 Sub-packets without Load”, the data packet includes: data packet header, sub-header 0, sub-header 1, sub-header 2, sub-header 3, sub-header 4, sub-header 5, sub-header 6, sub-header 7 and checksum. The sub-packets without data need to be integrated as many sub-packets as possible during aggregation to form a longer data packet, thereby achieving line-speed forwarding.

[0077] The data transmission method provided in this application adds a first identifier to the header of the aggregation result and a second identifier to the header of each sub-packet corresponding to the aggregation result to obtain a new aggregation result. The new aggregation result is then sent to the corresponding receiving end. All sub-packet-specific information is packaged with the second identifier, and all sub-packet-shared information is packaged with the first identifier and transmitted. This avoids repeatedly carrying these redundant fields in each sub-packet, increasing the proportion of effective data transmission. Moreover, the intermediate switching device only needs to parse the outermost first identifier to complete routing and forwarding, without needing to deeply parse multiple internal sub-packets, reducing the processing complexity and latency of the switching chip. Finally, the receiving end can quickly locate and parse each internal sub-packet with the second identifier in parallel or serially by reading the quantity indication in the first identifier, achieving efficient data restoration.

[0078] In one embodiment, before determining the packet concatenation threshold based on the aggregation conditions of the data queues to be sent, the data transmission method further includes: distributing multiple transaction messages to corresponding data queues according to their service types to obtain multiple data queues to be sent; wherein, the data queues to be sent are any one of the multiple data queues to be sent; different data queues to be sent correspond to different message types.

[0079] In this embodiment, when data is transmitted between the sending and receiving ends, data packets are divided into different transaction types, such as read requests, read data, read responses, write requests, and write responses. Transaction messages of the same type often have the same message structure and header structure. Based on this characteristic, at the sending end (such as a GPU), different types of transaction messages are stored in different virtual channel queues for differentiation and scheduling. Transaction messages of the same type, when placed in the same sending queue, have the opportunity to be continuously scheduled for output. When scheduling output for a certain buffer queue, multiple small transaction messages are aggregated and encapsulated into an aggregated packet containing multiple sub-packets for transmission.

[0080] exist Figure 3 In the illustrated embodiment, when the sending GPU port sends data, the aggregation scheduler reads data packets from the buffer queues of multiple virtual channels (VCs) and performs aggregation operations. The diagram uses a round-robin scheduling algorithm as an example, where each VC queue sends data once in turn. When a VC queue is polled for data, if there are sub-packets that can be merged, the aggregation scheduler will read multiple sub-packets from that queue at once and aggregate them. D2-0, D2-1, and D2-2 in the sending queue VC0 of GPU0 are all data destined for GPU2. Therefore, when VC0 is reached, these three data packets can be aggregated and scheduled together for output. Finally, after encapsulating a logical header, they are sent. After receiving the aggregated packet, the receiving GPU2 unpacks the logical header, parses and splits the aggregated packet content to obtain multiple sub-packets, and enqueues them into its receiving queue VC0.

[0081] The data transmission method provided in this application distributes multiple transaction messages to corresponding data queues according to their service types, thereby obtaining multiple data queues to be sent. This avoids the drawback that after messages of different types of transactions or different destination addresses are aggregated together, they still need to be split and packaged again by the switching chip, effectively reducing the complexity of hardware implementation.

[0082] The data transmission apparatus provided in this application will be further described below. The data transmission apparatus described below can be referred to in correspondence with the data transmission method described above.

[0083] Figure 6 This is a schematic diagram of the data transmission device provided in this application, as shown below. Figure 6 As shown, the data transmission device, applied at the sending end, includes: a threshold determination module 610 and a transmission module 620.

[0084] The threshold determination module 610 is used to determine the packet concatenation threshold based on the aggregation conditions of transaction messages in the data queue to be sent; the aggregation conditions include the maximum number or maximum length of aggregable messages, or the maximum number of aggregable messages and flow control information; the flow control information is used to indicate the remaining buffer space or link status of the corresponding receiver of the data queue to be sent. The transmission module 620 is used to aggregate transaction messages in the data queue to be sent according to the packet aggregation threshold when the packet aggregation threshold is greater than 0, and then encapsulate the aggregation result and forward it to the corresponding receiving end.

[0085] The data transmission apparatus provided in this application determines the packet concatenation threshold by the sending end based on the maximum number or maximum length of aggregable packets in the data queue to be sent, or the maximum number of aggregable packets and flow control information. It utilizes Static Configuration Service (MNSP) and / or dynamic environment (flow control) to intelligently calculate the most reasonable sending window size. Then, it aggregates the transaction packets in the data queue to be sent according to the packet concatenation threshold, encapsulates the aggregation result, and forwards it to the corresponding receiving end. When the link is smooth, it can use the MNSP upper limit to achieve large packet transmission and improve bandwidth utilization. It can also dynamically reduce the sending threshold when the link is congested or the receiving end buffer is insufficient, thus avoiding the problem of receiving end buffer overflow and packet loss caused by sending too much data from the source and improving data transmission efficiency.

[0086] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 770. The processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 770. The processor 710 can call logical instructions in the memory 730 to execute a data transmission method applied to the sending end. This method includes: determining a packet concatenation threshold based on the aggregation conditions of transaction messages in the data queue to be sent; the aggregation conditions include the maximum number or maximum length of aggregable messages, or the maximum number of aggregable messages and flow control information; the flow control information is used to indicate the remaining buffer space or link status of the receiving end corresponding to the data queue to be sent; when the packet concatenation threshold is greater than 0, aggregating the transaction messages in the data queue to be sent according to the packet concatenation threshold, encapsulating the aggregation result, and forwarding it to the corresponding receiving end.

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

[0088] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the data transmission method provided by the above methods and apply it to the sending end. The method includes: determining a packet concatenation threshold based on the aggregation conditions of transaction messages in the data queue to be sent; the aggregation conditions include the maximum number or maximum length of aggregable messages, or the maximum number of aggregable messages and flow control information; the flow control information is used to indicate the remaining buffer space or link status of the receiving end corresponding to the data queue to be sent; when the packet concatenation threshold is greater than 0, performing aggregation processing on the transaction messages in the data queue to be sent according to the packet concatenation threshold, and encapsulating the aggregation result before forwarding it to the corresponding receiving end.

[0089] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program is implemented to perform the data transmission methods provided by the above methods, applied to a sending end. The method includes: determining a packet concatenation threshold based on the aggregation conditions of transaction messages in a data queue to be sent; the aggregation conditions include the maximum number or maximum length of aggregable messages, or the maximum number of aggregable messages and flow control information; the flow control information is used to indicate the remaining buffer space or link status of the receiving end corresponding to the data queue to be sent; when the packet concatenation threshold is greater than 0, performing aggregation processing on the transaction messages in the data queue to be sent according to the packet concatenation threshold, and encapsulating the aggregation result before forwarding it to the corresponding receiving end.

[0090] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0091] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A data transmission method, applied at a sending end, characterized in that, include: The packet concatenation threshold is determined based on the aggregation conditions of transaction messages in the data queue to be sent; The aggregation conditions include the maximum number or maximum length of aggregateable packets, or the maximum number of aggregateable packets and flow control information; The flow control information is used to indicate the remaining buffer space or link status of the receiving end corresponding to the data queue to be sent; When the packet concatenation threshold is greater than 0, the transaction messages in the data queue to be sent are aggregated according to the packet concatenation threshold, and the aggregation result is encapsulated and forwarded to the corresponding receiving end.

2. The data transmission method according to claim 1, characterized in that, The aggregation condition includes the maximum number of aggregateable messages; The step of determining the packet concatenation threshold based on the aggregation conditions of the data queue to be sent includes: Obtain the number of messages in the queue of data to be sent; If the number of messages exceeds 1 but does not exceed the maximum number of aggregable messages, the number of messages is determined as the packet concatenation threshold. If the number of packets exceeds the maximum number of aggregable packets, the maximum number of aggregable packets is determined as the packet concatenation threshold. If the number of messages does not exceed 1, the packet concatenation threshold is determined to be 0.

3. The data transmission method according to claim 2, characterized in that, After obtaining multiple queues of data to be sent, the method further includes: When the number of messages in the data queue to be sent is 1, the transaction message is encapsulated and sent to the corresponding receiving end.

4. The data transmission method according to claim 1, characterized in that, The aggregation conditions include the maximum number of aggregateable packets and the flow control information; The step of determining the packet concatenation threshold based on the aggregation conditions of the data queue to be sent includes: The maximum length of aggregable packets in the data queue to be sent is determined based on the flow control information. The packet concatenation threshold is determined based on the maximum length of the aggregable message and the maximum number of aggregable messages.

5. The data transmission method according to claim 4, characterized in that, The method further includes: If the number of messages in the data queue to be sent is 1, and the maximum length of the aggregateable message is greater than the length of the corresponding transaction message, the corresponding transaction message is encapsulated and sent to the corresponding receiving end.

6. The data transmission method according to claim 4, characterized in that, The step of encapsulating the aggregation result and forwarding it to the corresponding receiving end includes: A first identifier is added to the header of the aggregation result, and a second identifier is added to the header of each sub-packet corresponding to the aggregation result to obtain a new aggregation result, which is then sent to the corresponding receiving end. The first identifier is used to indicate at least one of the following: the number of sub-packets, the common fields of the transaction messages corresponding to each sub-packet, and the fields related to forwarding; the second identifier is used to indicate at least one of the following: the tag number, packet length, completion status, memory address, and user-defined information of the transaction messages corresponding to each sub-packet.

7. The data transmission method according to any one of claims 1-6, characterized in that, Before determining the packet concatenation threshold based on the aggregation conditions of the data queue to be sent, the method further includes: Multiple transaction messages are distributed to the corresponding data queues according to their business types, resulting in multiple data queues to be sent. The data queue to be sent can be any one of the plurality of data queues to be sent; different data queues to be sent correspond to different message types.

8. A data transmission apparatus, applied at a transmitting end, comprising: The threshold determination module is used to determine the packet concatenation threshold based on the aggregation conditions of transaction messages in the data queue to be sent; The aggregation conditions include the maximum number or maximum length of aggregateable packets, or the maximum number of aggregateable packets and flow control information; The flow control information is used to indicate the remaining buffer space or link status of the receiving end corresponding to the data queue to be sent; The transmission module is used to aggregate transaction messages in the data queue to be sent according to the packet aggregation threshold when the packet aggregation threshold is greater than 0, and then encapsulate the aggregation result and forward it to the corresponding receiving end.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data transmission method as described in any one of claims 1-7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the data transmission method as described in any one of claims 1-7.