Data transmission method and related equipment

By caching and locking the cache resources of the receiver host in RDMA communication, the inefficiency problem caused by frequent replacement of cache resources is solved, and efficient data transmission is achieved.

CN120336247APending Publication Date: 2025-07-18HYGON INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510400248.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

During the communication process of existing RDMA technology, frequent replacement of cache resources leads to inefficient communication.

Method used

Before data transmission, the sending host sends resource request messages to the receiving host, caches the context information and page table information of the data to be transmitted, and locks the corresponding cache space until the data transmission is completed and released.

Benefits of technology

Ensure that during data transmission, the cache resources of the receiver host are not replaced, which improves the communication efficiency of RDMA.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336247A_ABST
    Figure CN120336247A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data transmission method and related equipment, and the method comprises the steps: obtaining a resource request message transmitted by a transmitting end host; based on the resource request message, caching context information and page table information of the to-be-transmitted data, and locking a context cache space occupied by the context information and a page table cache space occupied by the page table information; sending a request confirmation message to the sending end host; when the sending end host sends the to-be-transmitted data from the memory based on a remote direct memory access mechanism, receiving and storing the to-be-transmitted data sent by the sending end host based on the context information in the context cache space and the page table information in the page table cache space; and after the transmission of the to-be-transmitted data is completed, releasing the context cache space occupied by the context information and the page table cache space occupied by the page table information. According to the embodiment of the invention, the communication efficiency of the RDMA is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technology, and more particularly to a data transmission method and related devices. Background Art

[0002] Remote Direct Memory Access (RDMA) technology is a high-performance network communication technology. This technology allows a node in a distributed computing architecture to directly access the memory of another node without the intervention of the operating system or the CPU. Therefore, this technology can reduce CPU overhead and improve the efficiency and speed of network communication in the computing architecture.

[0003] However, the current communication efficiency of RDMA needs to be improved. Summary of the Invention

[0004] In view of this, embodiments of the present application provide a data transmission method and related devices to improve the communication efficiency of RDMA.

[0005] To achieve the above object, embodiments of the present application provide the following technical solutions.

[0006] In a first aspect, embodiments of the present application provide a data transmission method applied to a receiving host, the method including:

[0007] Obtain a resource request message sent by a sending host, where the resource request message is used to request cache resources for data to be transmitted;

[0008] Based on the resource request message, cache context information and page table information of the data to be transmitted, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information;

[0009] Send a request confirmation message to the sending host;

[0010] When the sending host sends the data to be transmitted from memory based on the remote direct memory access mechanism, receive and store the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space;

[0011] After the data to be transmitted is transmitted, release the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0012] Optionally, the caching the context information and page table information of the data to be transmitted and locking the context cache space occupied by the context information and the page table cache space occupied by the page table information based on the resource request message includes:

[0013] Query whether there is free context cache space and page table cache space;

[0014] If there is free context cache space and page table cache space, cache the context information of the data to be transmitted into the free context cache space, cache the page table information of the data to be transmitted into the free page table cache space, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0015] Optionally, in the step of querying whether there is free context cache space and page table cache space, it further includes:

[0016] If there is no free context cache space and page table cache space, send a request failure message to the sending host, and record the resource request message sent by the sending host as a resource request message to be processed;

[0017] Wherein, when there is free context cache space and page table cache space, for the data to be transmitted corresponding to the resource request message to be processed, store the context information of the data to be transmitted in the free context cache space, store the page table information of the data to be transmitted in the free page table cache space, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0018] Optionally, the data to be transmitted includes multiple data packets, and the data packet includes a queue pair identifier and a virtual address corresponding to the data to be transmitted; receiving and storing the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space includes:

[0019] Based on the queue pair identifier in the data packet, determine the corresponding context information in the context cache;

[0020] Based on the context information, determine the corresponding page table information in the page table cache;

[0021] Based on the page table information, determine the physical address corresponding to the virtual address in the data packet;

[0022] Store the data to be transmitted in the data packet into the memory space pointed to by the physical address.

[0023] Optionally, before the step of obtaining the resource request message sent by the sending host, it further includes:

[0024] Create a queue pair corresponding to the data to be transmitted to store the context information and page table information of the data to be transmitted in memory.

[0025] Optionally, the step of creating a queue pair corresponding to the data to be transmitted includes:

[0026] Obtain a receive queue creation request, where the receive queue creation request includes at least the virtual address of the data to be transmitted;

[0027] Create a receive queue based on the receive queue creation request, establish and store the page table information and context information corresponding to the data to be transmitted. The page table information is used to indicate the mapping relationship between the virtual address and the physical address, and the context information at least includes the page table base address for indicating the page table information.

[0028] In a second aspect, an embodiment of the present application provides a data transmission method applied to a sending host. The method includes:

[0029] Send a resource request message to the receiving host;

[0030] Obtain a request confirmation message sent by the receiving host. The request confirmation message is used to indicate that the receiving host has cached the context information and page table information of the data to be transmitted and locked the context cache space occupied by the context information and the page table cache space occupied by the page table information;

[0031] Based on the remote direct memory access mechanism, send the data to be transmitted from the memory to the memory of the receiving host, so that the receiving host receives and stores the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space. After the data to be transmitted is transmitted, the receiving host releases the context cache space and page table cache space corresponding to the data to be transmitted.

[0032] Optionally, before the step of sending a resource request message to the receiving host, it further includes:

[0033] Create a queue pair corresponding to the data to be transmitted to store the context information and page table information of the data to be transmitted in the memory of the receiving host.

[0034] Optionally, the step of creating a queue pair corresponding to the data to be transmitted includes:

[0035] Create a send queue corresponding to the data to be transmitted. The send queue is used to communicate with the receive queue of the receiving host;

[0036] Send a receive queue creation request to the receiving host, where the receive queue creation request includes at least the context information and virtual address of the data to be transmitted, so that the receiving host creates a receive queue based on the receive queue creation request, and establishes and stores page table information corresponding to the data to be transmitted in the memory of the receiving host. The page table information is used to indicate the mapping relationship between the virtual address and the physical address, and store the context information of the data to be transmitted.

[0037] In a third aspect, an embodiment of the present application provides a data transmission device configured in a receiving host, and the device includes:

[0038] A first message acquisition unit, configured to acquire a resource request message sent by a sending host, where the resource request message is used to request cache resources for data to be transmitted;

[0039] A cache locking unit, configured to cache the context information and page table information of the data to be transmitted based on the resource request message, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information;

[0040] A first message sending unit, configured to send a request confirmation message to the sending host;

[0041] A data receiving unit, configured to receive and store the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space when the sending host sends the data to be transmitted from the memory based on the remote direct memory access mechanism;

[0042] A cache releasing unit, configured to release the context cache space occupied by the context information and the page table cache space occupied by the page table information after the data to be transmitted is transmitted.

[0043] In a fourth aspect, an embodiment of the present application provides a data transmission device configured in a sending host, and the device includes:

[0044] A second message sending unit, configured to send a resource request message to the receiving host;

[0045] A second message acquisition unit, configured to acquire a request confirmation message sent by the receiving host, where the request confirmation message is used to indicate that the receiving host has cached the context information and page table information of the data to be transmitted, and locked the context cache space occupied by the context information and the page table cache space occupied by the page table information;

[0046] A data sending unit, configured to send the data to be transmitted from a memory to a memory of a receiving host based on a Remote Direct Memory Access (RDMA) mechanism, so that the receiving host receives and stores the data to be transmitted based on context information in a context cache space and page table information in a page table cache space; wherein, after the data to be transmitted is transmitted, the receiving host releases the context cache space and the page table cache space corresponding to the data to be transmitted.

[0047] In a fifth aspect, an embodiment of the present application provides an electronic device, including at least one memory and at least one processor, where the memory stores one or more computer-executable instructions, and the processor invokes the one or more computer-executable instructions to execute the data transmission method as described in the first aspect above, or execute the data transmission method as described in the second aspect above.

[0048] In a sixth aspect, an embodiment of the present application provides a storage medium, where the storage medium stores one or more computer-executable instructions, and when the one or more computer-executable instructions are executed, the data transmission method as described in the first aspect above is implemented, or the data transmission method as described in the second aspect above is implemented.

[0049] In a seventh aspect, an embodiment of the present application provides a computer program product, including one or more computer-executable instructions, and when the one or more computer-executable instructions are executed, the data transmission method as described in the first aspect above is implemented, or the data transmission method as described in the second aspect above is implemented.

[0050] An embodiment of the present application provides a data transmission method and related devices. Among them, the data transmission method applied to a receiving host includes: obtaining a resource request message sent by a sending host, where the resource request message is used to request cache resources for data to be transmitted; caching context information and page table information of the data to be transmitted based on the resource request message, and locking a context cache space occupied by the context information and a page table cache space occupied by the page table information; sending a request confirmation message to the sending host; when the sending host sends the data to be transmitted from a memory based on a Remote Direct Memory Access (RDMA) mechanism, receiving and storing the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space; after the data to be transmitted is transmitted, releasing the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0051] It can be seen that in the data transmission method provided by the embodiments of the present application, before the sending host sends the data to be transmitted from the memory to the memory of the receiving host based on the Remote Direct Memory Access (RDMA) mechanism, it will first send a resource request message to the receiving host, so that the receiving host caches the context information and page table information of the data to be transmitted, and locks the context cache space occupied by the context information and the page table cache space occupied by the page table information until after the data to be transmitted is transmitted, the context cache space occupied by the context information and the page table cache space occupied by the page table information are released, ensuring that during the process of the sending host sending the data to be transmitted, the context information and page table information corresponding to the data to be transmitted in the receiving host are not replaced in the corresponding caches, so that the receiving host can continuously and efficiently receive and store the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space, thereby improving the communication efficiency of RDMA. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.

[0053] Figure 1 It is an optional structural schematic diagram for communication between two hosts based on Remote Direct Memory Access;

[0054] Figure 2 It is an optional structural schematic diagram for communication between multiple hosts based on Remote Direct Memory Access;

[0055] Figure 3 It is an optional flowchart of the data transmission method provided by the embodiments of the present application;

[0056] Figure 4 It is an optional flowchart of step S110 provided by the embodiments of the present application;

[0057] Figure 5 It is an optional flowchart of step S140 provided by the embodiments of the present application;

[0058] Figure 6 It is an optional example diagram for a host HOST A to transmit data to another host HOST B provided by the embodiments of the present application;

[0059] Figure 7 It is another optional example diagram for a host HOST A to transmit data to another host HOST B provided by the embodiments of the present application;

[0060] Figure 8 Another alternative flowchart diagram of the data transmission method provided by the embodiment of the present application;

[0061] Figure 9 An alternative flowchart diagram of step S200 provided by the embodiment of the present application;

[0062] Figure 10 An alternative flowchart diagram of step S300 provided by the embodiment of the present application;

[0063] Figure 11 An alternative block diagram of a data transmission device provided by the embodiment of the present application;

[0064] Figure 12 An alternative block diagram of another data transmission device provided by the embodiment of the present application;

[0065] Figure 13 An alternative block diagram of an electronic device provided by the embodiment of the present application. Detailed implementation manners

[0066] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0067] As described in the background art, the Remote Direct Memory Access (RDMA) technology can directly access and transfer data from the memory of one host to the memory of another host without the intervention of the operating system or the CPU.

[0068] For ease of understanding, refer to Figure 1 An alternative structural schematic diagram of communication between two hosts based on remote direct memory access, as Figure 1 shown, host (also referred to as HOST) 10 is coupled to the network as a node, host 20 can be coupled to the network as another node, and the network between the two can perform data interaction based on a switch.

[0069] Among them, to achieve data interaction between hosts, a network interface controller (NIC, Network Interface Controller) for implementing data interaction can be configured in the host. For example, the network interface controller can receive data packets from the network and send data packets to the network. Take Figure 1For example, a network interface controller 13 and a network interface controller 23 are respectively configured in the host 10 and the host 20 to connect to a switch (i.e., Switch) in the network based on the network interface controller 13 and the network interface controller 23.

[0070] In an optional implementation, the network interface controller may support RDMA and implement direct access between two or more computers (which may also be referred to as hosts) and transmission of memory data based on the RDMA mechanism. In a specific example, an RDMA engine (not shown in the figure) for processing RDMA communication data may be provided in the network interface controller. Among them, the RDMA engine (i.e., RDMA Engine, Remote Direct Memory Access Engine) is a network communication technology engine that allows network devices (such as servers, storage devices, high-performance computing nodes, etc.) to directly access the memory of a remote host without the intervention of the CPU and without passing through the network stack of the operating system.

[0071] Still taking Figure 1 For example, in the RDMA data transmission process, the memory 11 in the host 10 first sends the data to be transmitted to the network interface controller 13 integrated with the RDMA engine, and the network interface controller 13 encapsulates the data into data packets. These data packets are transmitted through a network (such as Ethernet, InfiniBand, or other networks supporting RDMA). During the network transmission process, the data packets may be routed and forwarded by the switch. Then, the data packets reach the network interface controller 23 integrated with the RDMA engine in the host 20, and then the RDMA engine in the network interface controller 23 processes these data packets and directly writes the processed data into the memory 21 of the host 20 without the intervention of the operating system or the processor (such as the processor 12 of the host 10 or the processor 22 of the host 20).

[0072] It should be noted that before data transmission, the hosts of the data to be transmitted will perform pre-configuration related to the data transmission task and create a queue pair (Queue Pair, QP) to support subsequent memory data interaction. Among them, the QP consists of a send queue (Send Queue, SQ) and a receive queue (Receive Queue, RQ) corresponding to the data transmission task. Taking the host of the data sender as the sending-end host and the host of the data receiver as the receiving-end host, in the creation process of the send queue and the receive queue, the sending-end host will create a send queue, which is used to communicate with the receive queue of the receiving-end host. Then, the sending-end host sends a receive queue creation request to the receiving-end host. This request may include information related to the data transmission task, such as the initial context information of the data to be transmitted (such as the type, size, priority, etc. of the data), the virtual address of the data to be transmitted, etc.

[0073] After receiving a receive queue creation request, the receiving host can create a receive queue according to the information in the receive queue creation request. Meanwhile, on the receiving host side, corresponding memory can be further allocated for the data transmission task, and page table information and context information corresponding to the data to be transmitted can be established and stored. The page table information is used to indicate the mapping relationship between the virtual address of the data to be transmitted and the physical address of the allocated memory.

[0074] Among them, the page table information corresponding to the data to be transmitted is stored in the memory of the receiving host and the Translation Lookaside Buffer (TLB) at the same time. Meanwhile, on the basis of the initial context information, the context information further records the page table base address of the page table information in the TLB, and is further stored in the memory of the receiving host and the Context Cache.

[0075] Correspondingly, in the subsequent data transmission process of the data to be transmitted, the page table base address of the page table information can be determined based on the context information stored in the context cache, and then the corresponding page table information can be determined in the TLB. Thus, based on this page table information, the data to be transmitted is transmitted to the physical address indicated by the page table information.

[0076] It should be further noted that in the process of creating a queue pair, in addition to the above information, key information such as the Queue Pair Number (QPN) and Remote Key also needs to be exchanged. Among them, the QPN is used to uniquely identify a queue pair to ensure that the sending end and the receiving end can correctly find each other. The remote key is used for security verification to ensure that the two communication parties are legal communication partners.

[0077] It is found by clear people's analysis that in the existing RDMA technology solution, referring to Figure 2 The optional structural schematic diagram of multiple hosts communicating based on Remote Direct Memory Access is exemplarily shown, such as Figure 2 As shown, hosts 10, 20, 30, and 40 can access each other. Among them, taking host 10 accessing host 20 as an example, when the data to be transmitted of host 10 is sent to host 20, after host 20 receives the data packet (the data unit transmitted in network communication) of the data to be transmitted, it first searches the context cache by the queue pair number, and based on the page table base address corresponding to the data to be transmitted stored in the context cache, queries the page table information in the TLB, so as to determine the physical address corresponding to the virtual address of the data to be transmitted based on this page table information. After determining the physical address, host 20 can write the data packet of the data to be transmitted into the corresponding position of the corresponding memory 21 (i.e., the position indicated by the physical address) based on the RDMA mechanism.

[0078] However, if the context information of the data to be transmitted is not found in the context cache (i.e., ContextCache miss), the host 20 needs to look for the corresponding context information in the memory 21 and cache the corresponding context information in the context cache. It can be understood that, based on the fact that the access speed of the memory is much slower than that of the cache, the process of looking for information in the memory 21 will cause corresponding delays. Similarly, if the corresponding page table information is not found in the TLB (i.e., TLB miss), the host 20 needs to go to the memory 21 to look for the corresponding page table information and cache the corresponding page table information in the page table cache, thus also causing corresponding delays.

[0079] After research, the inventors believe that the reason why the context information of the data to be transmitted is not found in the context cache and the corresponding page table information is not found in the TLB is the resource preemption in the multi-task parallel processing process. As Figure 2 shown, taking the example that the host 10, host 30, and host 40 access the host 20 simultaneously, each host will establish a QP with the target host (such as Figure 2 the host 20 shown). When the target host (host 20) receives the packets sent by multiple QPs, if the resources of the context cache and the page table cache are not sufficient to support all the QPs, the data will be updated based on the replacement mechanism of the cached data, for example, eliminating the temporarily unused data and updating the data that needs to be used.

[0080] However, during the data transmission process, a data transmission task usually corresponds to multiple data packets. After the current data packet is transmitted to the host 20, the data needs to be stored based on the cached context information and page table information. Before the next data packet is transmitted to the host 20, the cached context information and page table information may be occupied by the context information and page table information of other data transmission tasks, that is, the context information and page table information of this data transmission task are eliminated, and the space originally used to cache the context information and page table information of this data transmission task is updated with the context information and page table information of other data transmission tasks. As a result, after the next data packet of this data transmission task is transmitted to the host 20, it is necessary to look for the corresponding information in the memory again and update it to the cache space. For other data transmission tasks, the original cache space is occupied, and when their next data packet is transmitted, they can only look for the corresponding information in the memory again and update it to the cache space. In this case, the context cache is frequently replaced with different context information. Similarly, the page table information in the TLB is also frequently replaced.

[0081] It can be understood that such frequent replacement situations are manifested as low cache hit rates in the context cache and TLB. It can be understood that in a specific process, when the context cache or TLB hit rate is low, the target host (host 20) needs to frequently obtain corresponding information from the memory, resulting in a large delay, thus affecting the communication efficiency of RDMA.

[0082] In view of this, the embodiments of the present application provide a data transmission method and related devices. Among them, the data transmission method applied to the receiving host includes: obtaining a resource request message sent by the sending host, where the resource request message is used to request the cache resources of the data to be transmitted; based on the resource request message, caching the context information and page table information of the data to be transmitted, and locking the context cache space occupied by the context information and the page table cache space occupied by the page table information; sending a request confirmation message to the sending host; when the sending host sends the data to be transmitted from the memory based on the remote direct memory access mechanism, receiving and storing the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space; after the data to be transmitted is transmitted, releasing the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0083] It can be seen that in the data transmission method provided by the embodiments of the present application, before the sending host sends the data to be transmitted from the memory to the memory of the receiving host based on the remote direct memory access mechanism, it will first send a resource request message to the receiving host, so that the receiving host caches the context information and page table information of the data to be transmitted, and locks the context cache space occupied by the context information and the page table cache space occupied by the page table information until after the data to be transmitted is transmitted, releasing the context cache space occupied by the context information and the page table cache space occupied by the page table information, ensuring that during the process of the sending host sending the data to be transmitted, the context information and page table information corresponding to the data to be transmitted in the receiving host are not replaced in the corresponding cache, so that the receiving host can continuously and efficiently receive and store the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space, thereby improving the communication efficiency of RDMA.

[0084] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments.

[0085] Refer to Figure 3 , Figure 3This is an optional flowchart of the data transmission method provided by the embodiments of the present application. As Figure 3 shown, the data transmission method may include the following steps:

[0086] Step S100, the sending host sends a resource request message to the receiving host.

[0087] The resource request message is used to request cache resources for the data to be transmitted. For example, it requests the receiving host to allocate context cache resources and page table cache resources corresponding to the data to be transmitted, etc. The context cache resources may be, for example, a context cache space, and the page table cache resources may be, for example, a page table cache space.

[0088] Among them, in a specific implementation, the resource request message at least includes the virtual address of the data to be transmitted. The virtual address is the logical address of the data to be transmitted, used to identify the location of the data to be transmitted, so that the physical address of the data to be transmitted on the receiving host can be determined based on the virtual address.

[0089] In a specific implementation, the resource request message may further include a QP identifier to mark the QP pair corresponding to the resource request message. It can be understood that based on the QP identifier, the data to be transmitted and the data transmission task corresponding to the resource request message can also be determined.

[0090] Correspondingly, the receiving host can obtain the resource request message sent by the sending host.

[0091] Step S110, the receiving host caches the context information and page table information of the data to be transmitted based on the resource request message, and locks the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0092] Among them, the context cache space is used to store the context information of the data to be transmitted, and the page table cache space is used to store the page table information of the data to be transmitted. The context information is used to indicate metadata or auxiliary information related to the data to be transmitted. For example, it may include transmission parameters of the data to be transmitted, the size, format and type of the data to be transmitted, associated information of the data to be transmitted, processing instructions of the data to be transmitted, etc. The page table information is used to indicate the mapping relationship between the virtual address and the physical address. In the embodiments of the present application, the context information further includes the page table base address corresponding to the page table information, so that the corresponding page table information can be found and determined based on the page table base address.

[0093] It should be noted that the data to be transmitted is used to indicate the data to be transmitted corresponding to a data transmission task. Correspondingly, the context information and page table information corresponding to the data to be transmitted can be understood as the context information and page table information corresponding to this data transmission task. It can be understood that in the RDMA mechanism, a data transmission task corresponds to a context information and a page table information. Correspondingly, the data to be transmitted also corresponds to the context information and page table information corresponding to the data transmission task.

[0094] Caching the context information and page table information of the data to be transmitted means caching the context information of the data to be transmitted into the context cache and caching the page table information of the data to be transmitted into the page table cache.

[0095] Among them, locking the context cache space occupied by the context information and the page table cache space occupied by the page table information means locking the data in the context cache space and the page table cache space, so that data update is no longer performed based on the data update mechanism until the context cache space and the page table cache space are released.

[0096] In an alternative implementation, refer to Figure 4 , Figure 4 which is an alternative process schematic diagram of step S110 provided by the embodiments of the present application. As Figure 4 shown, step S110 may include:

[0097] Step S111, query whether there is free context cache space and page table cache space.

[0098] If so (that is, there is free context cache space and page table cache space), then execute step S112 to implement corresponding data caching. If not, then execute step S113 to implement feedback of a request failure message.

[0099] Step S112, cache the context information of the data to be transmitted into the free context cache space, cache the page table information of the data to be transmitted into the free page table cache space, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0100] It can be understood that after implementing the caching of the corresponding information, the process of locking the context cache space occupied by the context information and the page table cache space occupied by the page table information is executed to prevent the cached information from being updated. That is to say, it is ensured that the context cache space and the page table cache space will not be occupied by other tasks during the data transmission process.

[0101] Step S113: Send a request failure message to the sending host, and record the resource request message sent by the sending host as a to-be-processed resource request message.

[0102] It can be understood that in the case of insufficient resources on the receiving host, the receiving host can promptly feedback a request failure message to the sending host to avoid invalid data transmission attempts by the sending host.

[0103] Among them, by recording this resource request message as a to-be-processed resource request message, a real-time cache resource management mechanism can be used to allocate and use corresponding idle resources when there are idle resources.

[0104] Specifically, on the receiving host side, when there are idle context cache spaces and page table cache spaces, the following steps can be executed:

[0105] Step S114: For the data to be transmitted corresponding to the to-be-processed resource request message, store the context information of the data to be transmitted in the idle context cache space, store the page table information of the data to be transmitted in the idle page table cache space, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0106] That is to say, if there are no idle context cache spaces and page table cache spaces, wait until the receiving host has idle context cache spaces and page table cache spaces, and then allocate and lock the context cache space and page table cache space corresponding to the data to be transmitted.

[0107] Continue to refer to Figure 3 , execute step S120, and the receiving host sends a request confirmation message to the sending host.

[0108] The request confirmation message is used to indicate that the receiving host has cached the context information and page table information of the data to be transmitted, and locked the context cache space occupied by the context information and the page table cache space occupied by the page table information. That is to say, at this time, the receiving host has configured the necessary cache resources, and the sending host can send the data to be transmitted to the receiving host, and can ensure that during the process of the sending host sending the data to be transmitted, the receiving host always maintains the state of having configured the necessary cache resources, thereby reducing the waiting time caused by insufficient or unprepared cache resources on the receiving host and improving the communication efficiency of RDMA.

[0109] Correspondingly, the sending host obtains the request confirmation message sent by the receiving host.

[0110] Step S130, the sending host sends the data to be transmitted from the memory to the memory of the receiving host based on the Remote Direct Memory Access (RDMA) mechanism.

[0111] It can be understood that the data to be transmitted can be transmitted based on multiple data packets. During the transmission of multiple data packets, the receiving host can perform corresponding receiving processes based on the context information in the context cache space and the page table information in the page table cache space.

[0112] Among them, the data packet can be understood as an encapsulated data packet including the data information of the data to be transmitted and the control information of the corresponding transmission process. Among them, the control information corresponding to the transmission process can include, for example, the virtual address corresponding to the data to be transmitted, and the queue pair identifier (such as the queue pair number).

[0113] Step S140, the receiving host receives and stores the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space.

[0114] It can be understood that based on the corresponding cache data being cached and locked, the reception and storage of the data to be transmitted in this step no longer cause delays due to the frequent replacement of cached data, thus enabling more efficient data transmission.

[0115] It should be noted that the data to be transmitted can include multiple data packets. Correspondingly, when any data packet is transmitted to the receiving host, the relevant data can be received and stored based on the context information in the context cache space and the page table information in the page table cache space.

[0116] In a specific example, for a data packet, refer to Figure 5 , Figure 5 which is the optional process schematic diagram of step S140 provided by the embodiment of the present application. Step S140 may include:

[0117] Step S141, based on the queue pair identifier in the data packet, determine the corresponding context information in the context cache;

[0118] It can be understood that there is a queue pair identifier in the data packet, so that the corresponding context information can be confirmed in the context cache based on this queue pair identifier. Among them, in view of the fact that the corresponding context cache has been locked in the previous step, the confirmation of context information can be realized in the context cache in this step.

[0119] Step S142, based on the context information, determine the corresponding page table information in the page table cache;

[0120] It can be understood that the page table base address is recorded in the context information, so that the corresponding page table information can be determined based on the page table base address. Similarly, in view of the fact that the corresponding page table cache has been locked in the foregoing steps, the confirmation of the page table information can be realized in the page table cache in this step.

[0121] Step S143: Determine the physical address corresponding to the virtual address in the data packet based on the page table information;

[0122] In view of the fact that the virtual address corresponding to the data to be transmitted is recorded in the data packet, the physical address corresponding to the virtual address can be determined based on the page table information.

[0123] Step S144: Store the data to be transmitted in the data packet into the memory space pointed to by the physical address;

[0124] Among them, the data to be transmitted in the data packet can be the complete data to be transmitted or a part of the data to be transmitted. When the data to be transmitted in the data packet is a part of the data to be transmitted, the corresponding data to be transmitted can be transmitted based on multiple data packets.

[0125] In the embodiment of the present application, the step of sending the data to be transmitted from the memory to the memory of the receiving end host based on the remote direct memory access mechanism is performed after obtaining the request confirmation packet sent by the receiving end host, ensuring that before the sending end host sends the data to be transmitted, the receiving end host has already prepared the necessary cache resources, thereby reducing the delay caused by insufficient communication resources or unpreparedness of the receiving end host, and further improving the communication efficiency of RDMA.

[0126] Among them, after the data to be transmitted is transmitted, the following steps are further executed:

[0127] Step S150: The receiving end host releases the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0128] Among them, after the data to be transmitted is transmitted, it can be determined based on the packet with specific data information sent by the sending end host, or it can be determined based on the control information pre-configured in the receiving end host (such as the length of the data to be transmitted), so as to release the relevant cache resources after confirming that the data to be transmitted is transmitted.

[0129] The receiving end host releases the context cache space and the page table cache space corresponding to the data to be transmitted, thereby ensuring the effective utilization of system resources and avoiding waste of resources.

[0130] It can be seen that in the data transmission method provided by the embodiments of the present application, before the sending-end host sends the data to be transmitted from the memory to the memory of the receiving-end host based on the Remote Direct Memory Access (RDMA) mechanism, it will first send a resource request message to the receiving-end host, so that the receiving-end host caches the context information and page table information of the data to be transmitted, and locks the context cache space occupied by the context information and the page table cache space occupied by the page table information until after the data to be transmitted is transmitted, the context cache space occupied by the context information and the page table cache space occupied by the page table information are released, ensuring that during the process of the sending-end host sending the data to be transmitted, the context information and page table information corresponding to the data to be transmitted in the receiving-end host are not replaced in the corresponding caches, so that the receiving-end host can continuously and efficiently receive and store the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space, thereby improving the communication efficiency of RDMA.

[0131] In a specific embodiment, referring to Figure 6 An optional example diagram of a host HOST A transmitting data to another host HOST B, as Figure 6 shown, the host HOST A first sends a resource request message CNTXT_REQ to the host HOST B (as shown by ① in the figure). After the host HOST B obtains the resource request message CNTXT_REQ sent by the host HOST A, it queries whether there are free context cache space and page table cache space in the host HOST B. If there are free context cache space and page table cache space in the host HOST B at this time, it stores the context information of the data to be transmitted in the free context cache space, stores the page table information of the data to be transmitted in the free page table cache space, and locks the context cache space and the page table cache space. Then it sends a request confirmation message CNTXT_ACK to the host HOST A (as shown by ② in the figure).

[0132] After the host HOST A obtains the request confirmation message CNTXT_ACK sent by the host HOST B, based on the Remote Direct Memory Access mechanism, it sends the data to be transmitted (Message) from the memory to the memory of the host HOST B (as shown by ③ in the figure). Then the host HOST B determines the physical address corresponding to the virtual address of the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space, and further based on the physical address, receives and stores the data to be transmitted sent by the host HOST A.

[0133] Further, after the host HOST B finishes processing the data to be transmitted sent by the host HOST A, it can release the context cache space and page table cache space corresponding to the data to be transmitted, thereby ensuring the effective utilization of system resources and avoiding waste of resources.

[0134] It can be seen that before the host HOST A sends the data to be transmitted from the memory to the memory of the host HOST B based on the Remote Direct Memory Access (RDMA) mechanism, it will first send a resource request message CNTXT_REQ to the host HOST B. Then, after obtaining the request confirmation message CNTXT_ACK sent by the host HOST B, it will, based on the RDMA mechanism, send the data to be transmitted from the memory to the memory of the host HOST B, so that the host HOST B can determine the physical address corresponding to the virtual address of the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space, and, based on the physical address, receive and store the data to be transmitted, ensuring that before the host HOST A sends the data to be transmitted, the host HOST B has already prepared the necessary cache resources, thereby reducing the waiting time caused by insufficient or unprepared cache resources of the host HOST B, and further improving the communication efficiency of RDMA.

[0135] In another specific embodiment, referring to Figure 7 Another optional example diagram showing a host HOST A transmitting data to another host HOST B, as Figure 7 shown, the host HOST A first sends a resource request message CNTXT_REQ to the host HOST B (as shown by ① in the figure). After the host HOST B obtains the resource request message CNTXT_REQ sent by the host HOST A, it queries whether there is any free context cache space and page table cache space in the host HOST B. If there is no free context cache space and page table cache space in the host HOST B at this time, it will send a request failure message CNTXT_REQ_NACK to the host HOST A (as shown by ② in the figure), and record the resource request message sent by the host HOST A as a resource request message to be processed. The request failure message CNTXT_REQ_NACK is used to inform the host HOST A that the data to be transmitted cannot be sent to the host HOST B at this time. In the case of insufficient resources of the host HOST B, the host HOST B can timely feedback to the host HOST A to avoid invalid data transmission attempts by the host HOST A.

[0136] Further, when there is free context cache space and page table cache space, Host HOST B stores the context information of the data to be transmitted corresponding to the resource request message to be processed in the free context cache space, stores the page table information of the data to be transmitted in the free page table cache space, and locks the context cache space and page table cache space allocated for the data to be transmitted. Then it sends a request confirmation message CNTXT_ACK to Host HOST A (as shown by ③ in the figure).

[0137] After Host HOST A obtains the request confirmation message CNTXT_ACK sent by Host HOST B, based on the remote direct memory access mechanism, it sends the data to be transmitted (Message) from its memory to the memory of Host HOST B (as shown by ④ in the figure). Then Host HOST B determines the physical address corresponding to the virtual address of the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space, and then receives and stores the data to be transmitted sent by Host HOST A based on the physical address.

[0138] Further, after Host HOST B finishes processing the data to be transmitted sent by Host HOST A, it can release the context cache space and page table cache space corresponding to the data to be transmitted, thus ensuring the effective utilization of system resources and avoiding waste of resources.

[0139] It can be seen that before Host HOST A sends the data to be transmitted from its memory to the memory of Host HOST B based on the remote direct memory access mechanism, it will first send a resource request message CNTXT_REQ to Host HOST B. Then, after obtaining the request confirmation message CNTXT_ACK sent by Host HOST B, it sends the data to be transmitted from its memory to the memory of Host HOST B based on the remote direct memory access mechanism, so that Host HOST B determines the physical address corresponding to the virtual address of the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space, and, based on the physical address, receives and stores the data to be transmitted, ensuring that Host HOST B has prepared the necessary cache resources before Host HOST A sends the data to be transmitted, thereby reducing the waiting time caused by insufficient or unprepared cache resources of Host HOST B, and further improving the communication efficiency of RDMA.

[0140] In an alternative implementation, referring to Figure 8 Another alternative flowchart of the exemplary data transmission method, as Figure 8As shown, before the step of the sending host sending a resource request message to the receiving host, a queue pair corresponding to the data to be transmitted can be further created. Specifically, this process can include:

[0141] Step S200, the sending host creates a queue pair corresponding to the data to be transmitted.

[0142] By creating a queue pair corresponding to the data to be transmitted, the context information and page table information of the data to be transmitted are stored in the memory of the receiving host. Among them, the queue pair QP consists of a send queue (SQ) and a receive queue (RQ).

[0143] In a specific implementation, refer to Figure 9 , Figure 9 which is the optional process schematic diagram of step S200 provided by the embodiments of the present application. As Figure 9 shown, step S200 can include:

[0144] Step S201, create a send queue corresponding to the data to be transmitted.

[0145] The send queue is used to communicate with the receive queue of the receiving host. For example, the send queue can temporarily store the data or messages (such as resource request messages) to be sent to the receiving host, and manage the sending order of the data according to certain rules (such as first in first out, priority, etc.), so as to transmit the data orderly based on the communication channel established with the receive queue of the receiving host. In the present application, the send queue can also receive the request confirmation message sent by the receiving host based on the receive queue.

[0146] Step S202, send a receive queue creation request to the receiving host.

[0147] The receive queue creation request includes at least the context information and virtual address of the data to be transmitted, so that the receiving host creates a receive queue based on the receive queue creation request, and establishes and stores the page table information corresponding to the data to be transmitted in the memory of the receiving host. The page table information is used to indicate the mapping relationship between the virtual address and the physical address, and store the context information of the data to be transmitted.

[0148] Correspondingly, as Figure 8 shown, on the receiving host, the creation process of the corresponding queue pair also needs to be executed. Specifically, the following steps are executed:

[0149] Step S300, the receiving host creates a queue pair corresponding to the data to be transmitted.

[0150] Create a queue pair corresponding to the data to be transmitted to store the context information and page table information of the data to be transmitted in memory. Among them, the queue pair QP consists of a send queue (SQ) and a receive queue (RQ).

[0151] In a specific implementation, refer to Figure 10 , Figure 10 which is an optional flowchart of step S300 provided by the embodiments of the present application. As Figure 10 shown, the step of step S300 to create a queue pair corresponding to the data to be transmitted may include:

[0152] Step S301, obtain a receive queue creation request.

[0153] The receive queue creation request includes at least the context information and virtual address of the data to be transmitted.

[0154] The context information refers to a series of metadata or auxiliary information closely related to the data to be transmitted, which may include but are not limited to the transmission parameters of the data to be transmitted; the size, format, and type of the data to be transmitted; the associated information of the data to be transmitted; the processing instructions of the data to be transmitted, etc. The virtual address is the logical address of the data to be transmitted, used to identify the location of the data to be transmitted.

[0155] Step S302, create a receive queue based on the receive queue creation request, and establish and store in memory the page table information corresponding to the data to be transmitted, where the page table information is used to indicate the mapping relationship between the virtual address and the physical address, and store the context information of the data to be transmitted.

[0156] The receive queue can be used to communicate with the send queue of the sending host, receive data or messages (such as resource request packets) from the send queue of the sending host, and temporarily store the received data before the data is further processed. In the present application, the receive queue can also send a request confirmation packet to the send queue in the sending host.

[0157] In a further example, the embodiments of the present application also provide a data transmission device, which can be understood as a software module configured to execute the data transmission method on the receiving host side described in the embodiments of the present application, or can be understood as a hardware logic configured to execute the data transmission method described in the embodiments of the present application. The data transmission device is configured in the receiving host to implement the corresponding data transmission process. In an optional example, refer to Figure 11 , Figure 11 which is an optional block diagram of a data transmission device provided by the embodiments of the present application. The data transmission device may include:

[0158] The first message acquisition unit 400 is configured to acquire a resource request message sent by a sending-end host, where the resource request message is used to request cache resources for data to be transmitted.

[0159] The cache locking unit 410 is configured to cache context information and page table information of the data to be transmitted based on the resource request message, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0160] The first message sending unit 420 is configured to send a request confirmation message to the sending-end host.

[0161] The data receiving unit 430 is configured to, when the sending-end host sends the data to be transmitted from memory based on the remote direct memory access mechanism, receive and store the data to be transmitted sent by the sending-end host based on the context information in the context cache space and the page table information in the page table cache space.

[0162] The cache releasing unit 440 is configured to release the context cache space occupied by the context information and the page table cache space occupied by the page table information after the data to be transmitted is transmitted.

[0163] In an optional example, the cache locking unit 410 is configured to cache context information and page table information of the data to be transmitted based on the resource request message, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information, including:

[0164] Query whether there is free context cache space and page table cache space.

[0165] If there is free context cache space and page table cache space, cache the context information of the data to be transmitted into the free context cache space, cache the page table information of the data to be transmitted into the free page table cache space, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0166] In an optional example, in the step where the cache locking unit 410 is configured to query whether there is free context cache space and page table cache space, it further includes:

[0167] If there is no free context cache space and page table cache space, send a request failure message to the sending-end host, and record the resource request message sent by the sending-end host as a resource request message to be processed.

[0168] Wherein, when there is idle context cache space and page table cache space, for the data to be transmitted corresponding to the resource request message to be processed, store the context information of the data to be transmitted in the idle context cache space, store the page table information of the data to be transmitted in the idle page table cache space, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

[0169] In an optional example, the data to be transmitted includes a plurality of data packets, and the data packet includes a queue pair identifier and a virtual address corresponding to the data to be transmitted; the data receiving unit 430 is configured to receive and store the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space, including:

[0170] Based on the queue pair identifier in the data packet, determine the corresponding context information in the context cache;

[0171] Based on the context information, determine the corresponding page table information in the page table cache;

[0172] Based on the page table information, determine the physical address corresponding to the virtual address in the data packet;

[0173] Store the data to be transmitted in the data packet into the memory space pointed to by the physical address.

[0174] In an optional example, the data transmission device further includes a first queue pair creation unit, configured to create a queue pair corresponding to the data to be transmitted, so as to store the context information and page table information of the data to be transmitted in the memory.

[0175] In an optional example, the step of the first queue pair creation unit for creating a queue pair corresponding to the data to be transmitted includes:

[0176] Obtain a receive queue creation request, where the receive queue creation request includes at least the virtual address of the data to be transmitted;

[0177] Create a receive queue based on the receive queue creation request, establish and store the page table information and context information corresponding to the data to be transmitted, where the page table information is used to indicate the mapping relationship between the virtual address and the physical address, and the context information at least includes a page table base address for indicating the page table information.

[0178] In a further example, an embodiment of the present application further provides a data transmission device. The data transmission device can be understood as a software module configured to execute the data transmission method on the sending end host side described in the embodiments of the present application, or can be understood as a hardware logic configured to execute the data transmission method described in the embodiments of the present application. The data transmission device is configured on the sending end host and is used to implement the corresponding data transmission process. In an alternative example, referring to Figure 12 , Figure 12 is an alternative block diagram of another data transmission device provided by an embodiment of the present application. The data transmission device may include:

[0179] A second message sending unit 500, configured to send a resource request message to the receiving end host;

[0180] A second message obtaining unit 510, configured to obtain a request confirmation message sent by the receiving end host. The request confirmation message is used to indicate that the receiving end host has cached the context information and page table information of the data to be transmitted, and locks the context cache space occupied by the context information and the page table cache space occupied by the page table information;

[0181] A data sending unit 520, configured to send the data to be transmitted from the memory to the memory of the receiving end host based on the remote direct memory access mechanism, so that the receiving end host receives and stores the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space; wherein, after the data to be transmitted is transmitted, the receiving end host releases the context cache space and the page table cache space corresponding to the data to be transmitted.

[0182] In an alternative example, the data transmission device further includes a second queue pair creating unit, configured to create a queue pair corresponding to the data to be transmitted, so as to store the context information and page table information of the data to be transmitted in the memory of the receiving end host.

[0183] In an alternative example, the step of the second queue pair creating unit for creating a queue pair corresponding to the data to be transmitted includes:

[0184] Create a sending queue corresponding to the data to be transmitted, where the sending queue is used to communicate with the receiving queue of the receiving end host;

[0185] Send a receiving queue creation request to the receiving end host. The receiving queue creation request at least includes the context information and virtual address of the data to be transmitted, so that the receiving end host creates a receiving queue based on the receiving queue creation request, and establishes and stores the page table information corresponding to the data to be transmitted in the memory of the receiving end host. The page table information is used to indicate the mapping relationship between the virtual address and the physical address, and store the context information of the data to be transmitted.

[0186] It can be seen that before the data transmission device provided by the embodiment of the present application sends the data to be transmitted from the memory to the memory of the receiving host based on the Remote Direct Memory Access (RDMA) mechanism, it will first send a resource request message to the receiving host, so that the receiving host caches the context information and page table information of the data to be transmitted, and locks the context cache space occupied by the context information and the page table cache space occupied by the page table information until after the data to be transmitted is transmitted, the context cache space occupied by the context information and the page table cache space occupied by the page table information are released, ensuring that during the process of the sending host sending the data to be transmitted, the context information and page table information of the corresponding data to be transmitted in the receiving host are not replaced in the corresponding cache, so that the receiving host can continuously and efficiently receive and store the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space, thereby improving the communication efficiency of RDMA.

[0187] The embodiment of the present application also provides an electronic device, which may include at least one memory and at least one processor. The memory stores one or more computer-executable instructions, and the processor invokes the one or more computer-executable instructions to execute the data transmission method described above.

[0188] As an optional implementation, refer to Figure 13 , Figure 13 is an optional block diagram of the electronic device provided by the embodiment of the present application. As shown in Figure 13 ,the electronic device may include: at least one processor 50, at least one communication interface 60, at least one memory 70, and at least one communication bus 80.

[0189] In the embodiment of the present application, the number of the processor 50, the communication interface 60, the memory 70, and the communication bus 80 is at least one, and the processor 50, the communication interface 60, and the memory 70 complete communication with each other through the communication bus 80.

[0190] Optionally, the processor 50 may be a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), an NPU (Neural-network Processing Unit), an FPGA (Field Programmable Gate Array), a TPU (Tensor Processing Unit), an AI chip, an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, etc.

[0191] Optionally, the communication interface 60 may be an interface of a communication module for network communication.

[0192] The memory 70 may include a high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory. The memory 70 stores one or more computer-executable instructions, and the processor 50 invokes the one or more computer-executable instructions to execute the data transmission method as described above.

[0193] The embodiments of the present application further provide a storage medium that stores one or more computer-executable instructions, and when the one or more computer-executable instructions are executed, the data transmission method as described above is implemented.

[0194] The embodiments of the present application further provide a computer program product that may include one or more computer-executable instructions, and when the one or more computer-executable instructions are executed, the data transmission method as described above is implemented.

[0195] The above describes multiple embodiment solutions provided by the embodiments of the present application. The optional methods described in each embodiment solution can be combined and cross-referenced with each other without conflict, thereby extending multiple possible embodiment solutions, all of which can be considered as the embodiment solutions disclosed and made public by the embodiments of the present application.

[0196] Although the embodiments of the present application are disclosed as above, the present application is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the protection scope of the present application should be subject to the scope defined by the claims.

Claims

1. A data transmission method, characterized in that, Applied to the receiving host, the method includes: Obtain a resource request message sent by the sending host, where the resource request message is used to request cache resources for the data to be transmitted; Based on the resource request message, cache the context information and page table information of the data to be transmitted, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information; Send a request confirmation message to the sending host; When the sending host sends the data to be transmitted from memory based on the Remote Direct Memory Access (RDMA) mechanism, receive and store the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space; After the transmission of the data to be transmitted is completed, release the context cache space occupied by the context information and the page table cache space occupied by the page table information.

2. The data transmission method according to claim 1, wherein The step of caching the context information and page table information of the data to be transmitted based on the resource request message, and locking the context cache space occupied by the context information and the page table cache space occupied by the page table information includes: Query whether there are free context cache space and page table cache space; If there are free context cache space and page table cache space, cache the context information of the data to be transmitted into the free context cache space, cache the page table information of the data to be transmitted into the free page table cache space, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

3. The data transmission method according to claim 2, wherein In the step of querying whether there are free context cache space and page table cache space, it further includes: If there are no free context cache space and page table cache space, send a request failure message to the sending host, and record the resource request message sent by the sending host as a resource request message to be processed; Wherein, when there are free context cache space and page table cache space, for the data to be transmitted corresponding to the resource request message to be processed, store the context information of the data to be transmitted in the free context cache space, store the page table information of the data to be transmitted in the free page table cache space, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information.

4. The data transmission method according to claim 1, wherein The data to be transmitted includes multiple data packets, and each data packet includes a queue pair identifier and the virtual address corresponding to the data to be transmitted; the step of receiving and storing the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space includes: Based on the queue pair identifier in the data packet, determine the corresponding context information in the context cache; Based on the context information, determine the corresponding page table information in the page table cache; Based on the page table information, determine the physical address corresponding to the virtual address in the data packet; Store the data to be transmitted in the data packet into the memory space pointed to by the physical address.

5. The data transmission method according to claim 1, wherein Before the step of obtaining the resource request message sent by the sending host, the method further includes: Creating a queue pair corresponding to the data to be transmitted to store context information and page table information of the data to be transmitted in memory.

6. The data transmission method according to claim 5, wherein The step of creating a queue pair corresponding to the data to be transmitted includes: Obtaining a receive queue creation request, where the receive queue creation request includes at least the virtual address of the data to be transmitted; Creating a receive queue based on the receive queue creation request, and establishing and storing page table information and context information corresponding to the data to be transmitted. The page table information is used to indicate the mapping relationship between the virtual address and the physical address, and the context information includes at least a page table base address for indicating the page table information.

7. A data transmission method, characterized in that, Applied to the sending host, the method includes: Sending a resource request message to the receiving host; Obtaining a request confirmation message sent by the receiving host, where the request confirmation message is used to indicate that the receiving host has cached context information and page table information of the data to be transmitted, and locks the context cache space occupied by the context information and the page table cache space occupied by the page table information; Based on the remote direct memory access mechanism, sending the data to be transmitted from the memory to the memory of the receiving host, so that the receiving host receives and stores the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space; where, after the data to be transmitted is transmitted, the receiving host releases the context cache space and the page table cache space corresponding to the data to be transmitted.

8. The data transmission method according to claim 7, wherein Before the step of sending a resource request message to the receiving host, the method further includes: Creating a queue pair corresponding to the data to be transmitted to store context information and page table information of the data to be transmitted in the memory of the receiving host.

9. The data transmission method according to claim 8, characterized in that, The step of creating a queue pair corresponding to the data to be transmitted includes: Creating a send queue corresponding to the data to be transmitted, where the send queue is used to communicate with the receive queue of the receiving host; Sending a receive queue creation request to the receiving host, where the receive queue creation request includes at least the context information and virtual address of the data to be transmitted, so that the receiving host creates a receive queue based on the receive queue creation request, and establishes and stores page table information corresponding to the data to be transmitted in the memory of the receiving host. The page table information is used to indicate the mapping relationship between the virtual address and the physical address, and stores the context information of the data to be transmitted.

10. A data transmission device, characterized in that, Configured on the receiving host, the device includes: A first message obtaining unit, configured to obtain a resource request message sent by the sending host, where the resource request message is used to request cache resources of the data to be transmitted; A cache locking unit, configured to cache context information and page table information of the data to be transmitted based on the resource request message, and lock the context cache space occupied by the context information and the page table cache space occupied by the page table information; A first message sending unit, configured to send a request confirmation message to the sending host; A data receiving unit, configured to receive and store the data to be transmitted sent by the sending host based on the context information in the context cache space and the page table information in the page table cache space when the sending host transmits the data to be transmitted from the memory based on the Remote Direct Memory Access (RDMA) mechanism. A cache releasing unit, configured to release the context cache space occupied by the context information and the page table cache space occupied by the page table information after the data to be transmitted is transmitted.

11. A data transmission device, characterized in that, Configured in the sending host, the device includes: A second message sending unit, configured to send a resource request message to the receiving host. A second message obtaining unit, configured to obtain the request confirmation message sent by the receiving host, where the request confirmation message is used to indicate that the receiving host has cached the context information and the page table information of the data to be transmitted, and locked the context cache space occupied by the context information and the page table cache space occupied by the page table information. A data sending unit, configured to transmit the data to be transmitted from the memory to the memory of the receiving host based on the Remote Direct Memory Access (RDMA) mechanism, so that the receiving host receives and stores the data to be transmitted based on the context information in the context cache space and the page table information in the page table cache space; wherein, after the data to be transmitted is transmitted, the receiving host releases the context cache space and the page table cache space corresponding to the data to be transmitted.

12. An electronic device, characterized in that, Comprising at least one memory and at least one processor, the memory stores one or more computer-executable instructions, and the processor invokes the one or more computer-executable instructions to execute the data transmission method according to any one of claims 1 to 6, or execute the data transmission method according to any one of claims 7 to 9.

13. A storage medium, characterized in that, The storage medium stores one or more computer-executable instructions, and when the one or more computer-executable instructions are executed, the data transmission method according to any one of claims 1 to 6 is implemented, or the data transmission method according to any one of claims 7 to 9 is implemented.

14. A computer program product, characterized in that, Comprising one or more computer-executable instructions, and when the one or more computer-executable instructions are executed, the data transmission method according to any one of claims 1 to 6 is implemented, or the data transmission method according to any one of claims 7 to 9 is implemented.