Data transmission method, device, electronic device and storage medium

By pre-registering RDMA memory when the data transfer process is initialized and managing the memory life cycle, the problem of low data transmission efficiency caused by the increase in memory registration time is solved, and more efficient data transmission and system performance optimization is achieved.

CN115604291BActive Publication Date: 2025-08-08SANGFOR TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110722988.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-28
Publication Date
2025-08-08
Estimated Expiration
2041-06-28

AI Technical Summary

Technical Problem

In the prior art, the increase in memory registration time leads to low data transmission efficiency, affecting the performance of distributed storage systems.

Method used

When the data transmission process is initialized, RDMA memory with a preset depth is pre-registered for the target node, and the memory life cycle is managed through reference counters to avoid temporary registration, use linked lists to record the registered memory space, and use the RoCE protocol to transmit data.

Benefits of technology

It reduces the delay during data transmission, improves data transmission efficiency, reduces CPU overhead and memory bandwidth usage, and optimizes the read and write performance of distributed storage systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115604291B_ABST
    Figure CN115604291B_ABST
Patent Text Reader

Abstract

This application discloses a data transmission method, comprising: initializing a data transmission process for a target node and pre-registering a Remote Direct Data Access (RDMA) memory of a preset depth for the data transmission process; receiving a data transmission instruction for the target node; storing the target data in the RDMA memory according to the data transmission instruction; and, after the target data is stored in the RDMA memory, transmitting the target data in the RDMA memory to a data receiving end. This application also discloses a data transmission device, an electronic device, and a storage medium, all of which have the above-mentioned beneficial effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data storage, and in particular to a data transmission method, device, electronic device and storage medium. Background Art

[0002] The widespread adoption of cloud computing, big data, artificial intelligence, 5G, and the Internet of Things (IoT) presents new challenges for data storage and transmission. Distributed storage systems utilize the Socket-based TCP / IP protocol for interconnection and data transmission between different nodes. With the rapid growth of network interface card (NIC) hardware performance and network bandwidth, users are placing higher demands on storage I / O latency and system throughput. Network protocol stack overhead has become a bottleneck constraining storage system network performance. RDMA technology supports kernel bypass and does not require CPU involvement. However, unlike traditional socket-based mechanisms that directly request and use memory, RDMA requires the creation of protection domains and the registration of memory for use.

[0003] In the related art, memory space is usually temporarily registered when there is a storage demand. However, the time of memory registration increases the access delay, affecting the data transmission efficiency.

[0004] Therefore, how to improve data transmission efficiency is a technical problem that those skilled in the art currently need to solve. Summary of the Invention

[0005] The purpose of this application is to provide a data transmission method, device, electronic device and storage medium, which can improve data transmission efficiency.

[0006] To solve the above technical problems, the present application provides a data transmission method, which includes:

[0007] Initialize a data transmission process of a target node, and pre-register a remote direct data access (RDMA) memory of a preset depth for the data transmission process;

[0008] receiving a data transmission instruction for the target node;

[0009] storing the target data into the RDMA memory according to the data transmission instruction;

[0010] After the target data is stored in the RDMA memory, the target data in the RDMA memory is transmitted to a data receiving end.

[0011] Optionally, pre-registering an RDMA memory of a preset depth for the data transmission process includes:

[0012] Obtaining a storage configuration, and determining a maximum bilateral memory depth based on the storage configuration;

[0013] Pre-register an RDMA bilateral memory with a maximum bilateral memory depth for the data transfer process.

[0014] Optionally, pre-registering an RDMA memory of a preset depth for the data transmission process includes:

[0015] Pre-register N memory areas as RDMA single-sided memory for the data transmission process;

[0016] After storing the target data in the RDMA memory according to the received data transmission instruction, the method further includes:

[0017] New memory areas are pre-registered according to the number of occupied memory areas in the RDMA unilateral memory, so that the number of unoccupied memory areas in the RDMA unilateral memory is N.

[0018] Optionally, after pre-registering the RDMA memory of a preset depth for the data transmission process, the method further includes:

[0019] Use the linked list to record the registered memory space;

[0020] If it is detected that the target memory space is destroyed, the registration of the target memory space is cancelled according to the linked list.

[0021] Optionally, transmitting the target data in the RDMA memory to a data receiving end includes:

[0022] Using the operating system Unix socket to transfer the target data in the RDMA memory to the local data receiving end;

[0023] Alternatively, the target data in the RDMA memory is transmitted to a non-local data receiving end via a remote direct data access (RoCE) protocol based on Ethernet.

[0024] Optionally, after pre-registering the RDMA memory of a preset depth for the data transmission process, the method further includes:

[0025] A reference counter is used to record the number of references to the RDMA memory.

[0026] Optionally, after pre-registering the RDMA memory of a preset depth for the data transmission process, the method further includes:

[0027] If it is detected that the data transmission process exits or the RDMA service exits, the RDMA memory is unregistered and the RDMA memory is released.

[0028] The present application also provides a data transmission device, which includes:

[0029] A pre-registration module is used to initialize a data transmission process of a target node and pre-register a remote direct data access (RDMA) memory of a preset depth for the data transmission process;

[0030] An instruction receiving module, configured to receive a data transmission instruction for the target node;

[0031] A data storage module, configured to store the target data into the RDMA memory according to the data transmission instruction;

[0032] The data transmission module is used to transmit the target data in the RDMA memory to a data receiving end after the target data is stored in the RDMA memory.

[0033] The present application also provides a storage medium on which a computer program is stored, and when the computer program is executed, the steps of the above-mentioned data transmission method are implemented.

[0034] The present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned data transmission method when calling the computer program in the memory.

[0035] The present application provides a data transmission method, comprising: initializing a data transmission process of a target node and pre-registering a remote direct data access (RDMA) memory of a preset depth for the data transmission process; receiving a data transmission instruction for the target node; storing target data in the RDMA memory according to the data transmission instruction; and after the target data is stored in the RDMA memory, transmitting the target data in the RDMA memory to a data receiving end.

[0036] During the initialization of the data transmission process, the present application pre-registers an RDMA memory of a preset depth for the data transmission process. After receiving the data transmission instruction, there is no need to temporarily register the RDMA memory used to store the target data. The pre-registered RDMA memory can be directly used to store and transmit data, reducing the latency during the data transmission process. By pre-registering the RDMA memory, the present application avoids the access latency generated when temporarily registering the memory, thereby improving data transmission efficiency. The present application also provides a data transmission device, an electronic device, and a storage medium, which have the above-mentioned beneficial effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0038] Figure 1 A flowchart of a data transmission method provided in an embodiment of the present application;

[0039] Figure 2 A framework diagram of a RoCE-based memory pre-registration and usage method provided in an embodiment of the present application;

[0040] Figure 3 A diagram showing a registration structure of a bilateral memory in a distributed storage system provided by an embodiment of the present application;

[0041] Figure 4 A registration structure diagram of a single-sided memory in a distributed storage system provided by an embodiment of the present application;

[0042] Figure 5 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0044] See below Figure 1 , Figure 1 A flowchart of a data transmission method provided in an embodiment of the present application.

[0045] Specific steps may include:

[0046] S101: Initialize a data transmission process of a target node and pre-register a preset depth of RDMA (Remote Direct Memory Access) memory for the data transmission process;

[0047] Among them, this embodiment can be applied to any node of a distributed storage system to realize data transmission between nodes. The above-mentioned distributed storage system can be a storage system that adopts RDMA technology. RDMA technology supports kernel bypass and does not require CPU participation, but RDMA has special constraints on memory usage. Unlike the traditional socket-based mechanism to directly apply for and use memory, RDMA needs to create a protection domain and register the memory before it can be used. Unlike the transmission of TCP (Transmission Control Protocol) / IP (Internet Protocol), RDMA requires that the physical address of the memory is continuous and realizes data transmission by manipulating the memory.

[0048] When a target node needs to perform data transmission, a process may be initiated for the target node's data transmission process. In this process, this embodiment preregisters a preset depth of RDMA memory for the data transmission process, allowing the preregistered RDMA memory to be used for data transmission. Furthermore, because memory preregistration consumes a certain amount of physical memory, the depth of the preregistered RDMA memory in this embodiment is less than the maximum value of the target node's preregistered RDMA memory.

[0049] The pre-registered RDMA memory may be RDMA single-sided memory, RDMA double-sided memory, or RDMA single-sided memory and RDMA double-sided memory. The depth of different types of RDMA pre-registration may be different.

[0050] After pre-registering RDMA memory of a preset depth for the data transmission process, a reference counter can be used to record the number of references to the RDMA memory. This embodiment uses a reference counter to maintain the memory lifecycle, ensuring memory allocation and release, and preventing memory leaks. The use of a reference counter also prevents memory from being released prematurely when multiple threads are operating on the memory, thus avoiding data errors.

[0051] S102: Receive a data transmission instruction for the target node;

[0052] S103: storing the target data into the RDMA memory according to the data transmission instruction;

[0053] After receiving the data transmission instruction, the corresponding target data can be determined, and then the target data can be stored in the RDMA memory pre-registered in S101.

[0054] It is understandable that after the pre-registered RDMA memory is occupied, new RDMA memory may be pre-registered to ensure that the target node has sufficient RDMA memory to store data corresponding to the data transmission instruction.

[0055] S104: After the target data is stored in the RDMA memory, the target data in the RDMA memory is transmitted to a data receiving end.

[0056] Among them, after all the target data are stored in the RDMA memory, this embodiment can transmit the target data in the RDMA memory to the data receiving end, thereby completing the data transmission. This embodiment can determine the corresponding data transmission method according to the type of the data receiving end. Specifically, this embodiment can use a unix socket to transmit the target data in the RDMA memory to the local data receiving end; it can also transmit the target data in the RDMA memory to a non-local data receiving end through the RoCE (RDMA over Convergent Ethernet, remote direct data access based on Ethernet) protocol. Unix is a multi-user, multi-tasking operating system that supports multiple processor architectures. According to the classification of operating systems, Unix belongs to a time-sharing operating system.

[0057] During the initialization of the data transfer process, this embodiment pre-registers RDMA memory of a preset depth for the data transfer process. Upon receiving a data transfer instruction, there is no need to temporarily register RDMA memory for storing the target data. The pre-registered RDMA memory can be used directly to store and transfer data, reducing latency during the data transfer process. By pre-registering RDMA memory, this embodiment avoids the access latency associated with temporary memory registration and improves data transfer efficiency.

[0058] As for Figure 1 Further introduction to the corresponding embodiment: in order to keep the memory registration lifecycle consistent with the memory usage cycle, after pre-registering the RDMA memory of a preset depth for the data transmission process, a linked list (such as a map mapping table) can also be used to record the registered memory space. If it is detected that the target memory space is destroyed, the registration of the target memory space is canceled according to the linked list to achieve one-time memory registration (one-register). After pre-registering the RDMA memory of a preset depth for the data transmission process, if it is detected that the data transmission process exits or the RDMA service exits, the RDMA memory is canceled and the RDMA memory is released. The above-mentioned released RDMA memory may include used RDMA memory and unused RDMA memory.

[0059] See Figure 2 , Figure 2A framework diagram of a memory pre-registration and usage method based on RoCE provided in an embodiment of the present application is shown in the figure. As shown in the figure, a virtual machine accesses a distributed storage system by issuing requests and receiving request replies. The distributed storage system is composed of multiple nodes, each node including a client and multiple servers. The client uses a Unix socket to connect to the local server, while the client connects to other node servers through RoCE. Both the client and the server use a memory pre-registration module to apply for and register memory, count memory references, and release and cancel memory registration. Since memory registration is time-consuming and increases with the size of the data block, the registration lifecycle is consistent with the memory lifecycle. Registration is performed when memory is applied, and registration is canceled when memory is released. Among them, memory reference counting is used to ensure that the applied memory is passed between multiple threads, ensuring that the memory in RoCE-based data transmission is copy-free, thereby reducing memory bandwidth usage and CPU overhead. Using RoCE to transmit data can ensure that the service writes data directly to the applied memory, and using reference counting to maintain memory lifecycle management, thereby achieving zero-copy memory (zero-copy) to reduce CPU overhead and memory bandwidth usage. This embodiment can reduce the read and write latency and CPU usage of the distributed storage system by pre-registering the memory and avoiding memory copying. Figure 2 Here, device indicates the hard disk.

[0060] In a RoCE-based distributed storage system, data I / O reads and writes in three stages: request command, data transmission, and reply command. Data I / O reads and writes are initiated by the client, while RDMA read and write operations are initiated by the server. Control commands are implemented using bilateral RDMA send / recv, data writes are implemented using unilateral RDMA reads, and data reads are implemented using unilateral RDMA writes. Therefore, RDMA-based memory management is divided into two parts: memory for sending control commands using bilateral RDMA send / recv, and memory for unilateral RDMA read / writes.

[0061] This embodiment can register RDMA bilateral memory at the maximum depth and pre-register RDMA unilateral memory to ensure that there are always N regions that are unused, thereby achieving a balance between memory registration latency and memory physical overhead on the IO path.

[0062] See Figure 3 , Figure 3A diagram of the registration structure of bilateral memory in a distributed storage system provided in an embodiment of the present application is provided. As shown in the diagram, the client of the distributed storage system establishes a receive queue and a send queue, while the server establishes a receive queue and a send queue. The structures and configuration parameters of the receive and send queues are identical. This embodiment can pre-register RDMA bilateral memory by: obtaining a storage configuration and determining a maximum bilateral memory depth based on the storage configuration; and pre-registering RDMA bilateral memory with the maximum bilateral memory depth for the data transfer process.

[0063] The client or server will pre-apply for a maximum depth (e.g., 128 depth) to register RDMA bilateral memory. Each entry in the receive queue and send queue may include: type, buf, refcount, and a registration information triple (addr, length, and key). Type indicates the queue type, such as send or receive. buf indicates a fixed-length space requested from heap memory (e.g., malloc); because command control information is sent, the format is fixed and the length is short, and the above fixed-length space can be 2KB. refcount indicates the reference count of the memory, and the registration information triple (addr, length, and key) are the memory address, length, and registration key of buf, respectively.

[0064] The client and server create a receive queue and a send queue during process initialization. At this time, memory is requested and registered, and the generated entries are inserted into the queues. The client sends a request command and then obtains an element (e.g., post) from the send queue. Post is a structure that records the pre-requested bilateral memory information (address, length, key, etc.). After rdma_send is completed asynchronously, the memory information is returned to the send queue to control the send depth. The server receives commands by obtaining bilateral memory and attribute information from the receive queue. After rdma_recv is completed asynchronously, the memory information is returned to the receive queue. When the client and server processes exit or the rdma service exits, the memory of the send queue and receive queue is unregistered, and the bilateral memory of the send queue and receive queue is released.

[0065] See Figure 4 , Figure 4 The present invention provides a registration structure diagram of a single-sided memory in a distributed storage system. In this embodiment, N memory areas can be pre-registered as RDMA single-sided memory for the data transmission process, and new memory areas can be pre-registered according to the number of occupied memory areas in the RDMA single-sided memory, so that the number of unoccupied memory areas in the RDMA single-sided memory is N. The above method can keep the number of pre-registered and unused RDMA single-sided memories in a node constant. Figure 3This is a structural diagram of unilateral memory application registration in a distributed storage system. As shown in the figure, unilateral memory application comes from the system's memory pool and is only used on the server side. Unilateral memory application is based on regions (memory areas), which are relatively large fixed-length memory units (for example, 16MB). During the RDMA initialization phase, the server can apply for N regions in advance. This can not only complete memory pre-registration to reduce IO latency, but also avoid the increase in memory overhead caused by memory pre-registration. Each region contains pre_reg, mr_count, and mr; pre_reg indicates whether it has been registered to avoid secondary registration; mr_count records the number of pre-registered regions, and mr is the result of region registration, including the memory address addr of the registered region, length length, and key key.

[0066] The process for requesting and using single-sided memory is as follows: During the RDMA initialization phase, the server uses one thread to pre-register N regions and save the registered region information in a linked list. After consuming a region, the server thread pre-registers another region to ensure that the number of pre-registered regions remains at N. The server can also divide the region into smaller subspaces for on-demand request and use. After the server process exits, the RDMA service is released, or the single-sided memory for the entire region is used up, this embodiment can cancel the memory registration before releasing the memory.

[0067] The above embodiment can also use RoCE to directly transfer data from the client to the server to achieve memory copy-free, reducing CPU overhead and memory bandwidth usage. After the business applies for memory, it is only necessary to pass the memory address addr, length length and registration key key to the other party. The above embodiment uses counting to ensure the life cycle of memory transfer between different threads. When the memory is transmitted between different threads, it is only necessary to pass the memory address. The memory reference counting module counts up by one when the memory is used and decrements the count after use. For example, when the server calls the send / recv, read / write primitives of rdma, the business data can be directly transferred from the memory to the server's memory, and the entire process does not require memory copying.

[0068] The distributed storage system utilizes a combined RoCE (Route-Enabled CE) transport protocol, reducing I / O latency associated with registering RDMA memory during data transfer. Bilateral memory, due to its limited space, requires only a maximum depth of pre-application and registration. Unilateral memory, on the other hand, requires fixed-size regions and guarantees a total of N registered regions, thereby balancing memory registration latency and physical memory overhead along the I / O path. This embodiment also utilizes RoCE to directly transfer data from local memory to remote memory, employing reference counting throughout the memory lifecycle. This reduces memory copies between threads, lowering CPU overhead and memory bandwidth.

[0069] See Figure 5 , Figure 5 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;

[0070] The device may include:

[0071] A pre-registration module 501 is used to initialize a data transmission process of a target node and pre-register a remote direct data access (RDMA) memory of a preset depth for the data transmission process;

[0072] An instruction receiving module 502 is configured to receive a data transmission instruction for the target node;

[0073] A data storage module 503 is configured to store the target data into the RDMA memory according to the data transmission instruction;

[0074] The data transmission module 504 is configured to transmit the target data in the RDMA memory to a data receiving end after the target data is stored in the RDMA memory.

[0075] During the initialization of the data transfer process, this embodiment pre-registers RDMA memory of a preset depth for the data transfer process. Upon receiving a data transfer instruction, there is no need to temporarily register RDMA memory for storing the target data. The pre-registered RDMA memory can be used directly to store and transfer data, reducing latency during the data transfer process. By pre-registering RDMA memory, this embodiment avoids the access latency associated with temporary memory registration and improves data transfer efficiency.

[0076] Furthermore, the pre-registration module 501 is used to obtain a storage configuration and determine a maximum bilateral memory depth according to the storage configuration; and is also used to pre-register an RDMA bilateral memory with the maximum bilateral memory depth for the data transmission process.

[0077] Furthermore, the pre-registration module 501 is used to pre-register N memory areas as RDMA single-sided memory for the data transmission process;

[0078] Among them, also include:

[0079] The memory region supplement module is configured to pre-register new memory regions according to the number of occupied memory regions in the RDMA unilateral memory, so that the number of unoccupied memory regions in the RDMA unilateral memory is N.

[0080] Furthermore, it also includes:

[0081] The registration cancellation module is used to use a linked list to record the registered memory space after pre-registering the RDMA memory of a preset depth for the data transmission process; and is also used to cancel the registration of the target memory space according to the linked list if it is detected that the target memory space is destroyed.

[0082] Furthermore, the data transmission module 504 includes:

[0083] A local transmission unit, configured to transmit the target data in the RDMA memory to a local data receiving end using a Unix socket;

[0084] Or, a remote transmission unit is used to transmit the target data in the RDMA memory to a non-local data receiving end through the RoCE protocol.

[0085] Furthermore, it also includes:

[0086] The reference counting module is configured to, after pre-registering an RDMA memory of a preset depth for the data transmission process, record the number of references of the RDMA memory using a reference counter.

[0087] Furthermore, it also includes:

[0088] The memory release module is used to, after pre-registering an RDMA memory of a preset depth for the data transmission process, cancel the registration of the RDMA memory and release the RDMA memory if it is detected that the data transmission process exits or the RDMA service exits.

[0089] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, and they will not be repeated here.

[0090] The present application also provides a storage medium having a computer program stored thereon, which, when executed, can implement the steps provided in the above embodiments. The storage medium may include: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other media capable of storing program code.

[0091] The present application also provides an electronic device that may include a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps provided in the above embodiment can be implemented. Of course, the electronic device may also include various network interfaces, a power supply, and other components.

[0092] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method section. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

[0093] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.

Claims

1. A data transmission method, characterized in that: include: Initialize a data transmission process of a target node, and pre-register a remote direct data access (RDMA) memory of a preset depth for the data transmission process; receiving a data transmission instruction for the target node; storing the target data into the RDMA memory according to the data transmission instruction; After the target data is stored in the RDMA memory, the target data in the RDMA memory is transmitted to a data receiving end; Pre-registering an RDMA memory of a preset depth for the data transmission process includes: Obtaining a storage configuration, and determining a maximum bilateral memory depth based on the storage configuration; Pre-registering an RDMA bilateral memory with a maximum bilateral memory depth for the data transfer process; Pre-registering N memory areas as RDMA single-sided memory for the data transmission process, and maintaining the number of unoccupied memory areas in the RDMA single-sided memory at N; The RDMA unilateral memory application and usage process includes: during the RDMA initialization phase, the server uses one thread to pre-register N regions and saves the registered region information in a linked list; after consuming one region, the server thread pre-registers another region; the server is also used to divide the region into smaller subspaces for on-demand application and usage; a region represents a memory area.

2. The data transmission method according to claim 1, characterized in that: After pre-registering the RDMA memory of a preset depth for the data transmission process, the method further includes: Use the linked list to record the registered memory space; If it is detected that the target memory space is destroyed, the registration of the target memory space is cancelled according to the linked list.

3. The data transmission method according to claim 1, wherein: Transmitting the target data in the RDMA memory to a data receiving end includes: Using the operating system Unix socket to transfer the target data in the RDMA memory to the local data receiving end; Alternatively, the target data in the RDMA memory is transmitted to a non-local data receiving end via a remote direct data access (RoCE) protocol based on Ethernet.

4. The data transmission method according to claim 1, wherein: After pre-registering the RDMA memory of a preset depth for the data transmission process, the method further includes: A reference counter is used to record the number of references to the RDMA memory.

5. The data transmission method according to any one of claims 1 to 4, characterized in that: After pre-registering the RDMA memory of a preset depth for the data transmission process, the method further includes: If it is detected that the data transmission process exits or the RDMA service exits, the RDMA memory is unregistered and the RDMA memory is released.

6. A data transmission device, characterized in that: include: A pre-registration module is used to initialize a data transmission process of a target node and pre-register a remote direct data access (RDMA) memory of a preset depth for the data transmission process; An instruction receiving module, configured to receive a data transmission instruction for the target node; A data storage module, configured to store the target data into the RDMA memory according to the data transmission instruction; A data transmission module is used to transmit the target data in the RDMA memory to a data receiving end after the target data is stored in the RDMA memory; The pre-registration module is used to obtain a storage configuration and determine a maximum bilateral memory depth according to the storage configuration; the pre-registration module is also used to pre-register an RDMA bilateral memory with the maximum bilateral memory depth for the data transmission process; the pre-registration module is also used to pre-register N memory areas as RDMA unilateral memory for the data transmission process, and to maintain the number of unoccupied memory areas in the RDMA unilateral memory at N; The RDMA unilateral memory application and usage process includes: during the RDMA initialization phase, the server uses one thread to pre-register N regions and saves the registered region information in a linked list; after consuming one region, the server thread pre-registers another region; the server is also used to divide the region into smaller subspaces for on-demand application and usage; a region represents a memory area.

7. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the data transmission method according to any one of claims 1 to 5 are implemented.

8. A storage medium, characterized in that: The storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the steps of the data transmission method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data processing method and device

    CN103645994A

  • Asynchronous RDMA communication memory dynamic management method and system

    CN109194721A