Data transmission method, and device and storage medium

By introducing double-write single-sided operation in RDMA technology, using one-time network transmission to realize double-write of remote memory data, the network bandwidth waste and delay problems caused by the double-write mechanism in the existing technology are solved, and the system performance is improved.

WO2025060718A1PCT designated stage expired Publication Date: 2025-03-27HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD

Patent Information

Application Number
PCT/CN2024/110308
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-21
Filing Date
2024-08-07
Publication Date
2025-03-27

AI Technical Summary

Technical Problem

When existing RDMA technologies write data to remote memory, in order to ensure data atomicity, they often use a double write mechanism, but this leads to waste of network bandwidth and increased latency, affecting system performance.

Method used

A new RDMA operation is proposed, namely, double-write single-sided operation. Through a network transmission, the target data and information of two memory addresses are sent to the network card device of the receiving end. The receiving end performs local memory write operations and copy operations to realize double-write data.

Benefits of technology

This method saves network bandwidth resources, reduces network latency, improves the efficiency of dual-write data, and thus improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024110308_27032025_PF_FP_ABST
    Figure CN2024110308_27032025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a data transmission method, and a device and a storage medium. In the embodiments of the present disclosure, in a scenario where remote memory access is performed by means of RDMA, a new RDMA operation, i.e., a double-write one-sided operation, is provided; by means of the double-write one-sided operation, target data and information of two memory addresses of the target data on a receiving end can be sent to a network card device of the receiving end by means of one network transmission; and the network card device of the receiving end executes a local memory write operation and a local memory copy operation on the basis of the information of the two memory addresses, thereby realizing double-write for the target data, and ensuring the atomicity and consistency of the target data in a memory. During double-write, the target data only needs to undergo one network transmission, such that network bandwidth resources can be saved on. In addition, the double-write operation is completed at the receiving end by means of local memory copy, such that compared with two network transmissions, the method can reduce the network delay, thereby facilitating an improvement in the efficiency of data double-write, and improving the system performance.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method, device and storage medium

[0001] This disclosure claims priority to a Chinese patent application filed with the Patent Office of China on September 21, 2023, with application number 202311226896.0 and application name “Data Transmission Method, Device and Storage Medium,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present disclosure relates to the field of cloud computing technology, and in particular to a data transmission method, device, and storage medium. Background Art

[0003] Remote Direct Memory Access (RDMA) is actually a high-speed direct access technology for remote memory with fully optimized smart network cards and software architecture. By solidifying the RDMA protocol in the network card hardware and supporting zero-copy network technology and kernel memory bypass technology, it achieves high-performance remote direct data access without time-consuming processing by the Central Processing Unit (CPU). Therefore, it is widely used in many scenarios such as databases, data warehouses, and distributed data storage.

[0004] In some application scenarios, when writing data to remote memory via RDMA, it is necessary to ensure the atomicity of the data being written to the remote memory to avoid memory inconsistencies. To this end, some existing solutions introduce a double-write mechanism when writing data to remote memory via RDMA. This mechanism uses two RDMA single-sided operations to write the same data to two different remote memory addresses to ensure data atomicity. However, this double-write mechanism not only wastes network bandwidth resources but also increases network latency, which in turn affects system performance.

[0005] Summary of the Invention

[0006] Various aspects of the present disclosure provide a data transmission method, device, and storage medium for saving network bandwidth resources and reducing network latency while implementing data double writing.

[0007] An embodiment of the present disclosure provides a data transmission method, which is applied to a network card device at a sending end, where a first application is running on the sending end. The method includes: obtaining target data of the first application and dual-write address information corresponding to the target data, where the dual-write address information includes first memory address information and second memory address information of a receiving end; using a dual-write unilateral operation of remote direct data access (RDMA) to send the target data, the first memory address information, and the second memory address information to the network card device at the receiving end, so as to instruct the network card device at the receiving end to first write the target data to a first memory address corresponding to the first memory address information, and then perform a local memory copy operation to copy the target data from the first memory address to the second memory address corresponding to the second memory address information, so as to achieve dual writing of the target data.

[0008] An embodiment of the present disclosure also provides a data transmission method, which is applied to a network card device at a receiving end, and the method includes: receiving target data and dual-write address information corresponding to the target data sent by the network card device at the sending end using a dual-write unilateral operation of remote direct data access (RDMA), wherein the dual-write address information includes first memory address information and second memory address information of the receiving end; writing the target data into a first memory address corresponding to the first memory address information; and after writing the target data into the first memory address, performing a local memory copy operation to copy the target data from the first memory address to the second memory address corresponding to the second memory address information, so as to realize dual writing of the target data.

[0009] The present disclosure also provides a network card device, which is applied to a transmitting end, wherein the transmitting end runs a first application, and the network card device is implemented based on programmable hardware, including:

[0010] An acquisition module, configured to acquire target data of a first application and dual-write address information corresponding to the target data, wherein the dual-write address information includes first memory address information and second memory address information of a receiving end;

[0011] A transmission module is used to use a double-write single-sided operation of remote direct data access (RDMA) to send the target data, the first memory address information, and the second memory address information to a network card device at a receiving end, so as to instruct the network card device at the receiving end to first write the target data to a first memory address corresponding to the first memory address information, and then perform a local memory copy operation to copy the target data from the first memory address to a second memory address corresponding to the second memory address information, so as to realize double writing of the target data.

[0012] An embodiment of the present disclosure also provides a network card device, which is applied to a sending end. The network card device includes: a storage unit and a processing unit. The storage unit is used to store a computer program. The processing unit is coupled to the storage unit and is used to execute the computer program to implement the steps in the data transmission method applied to the sending end provided in an embodiment of the present disclosure.

[0013] An embodiment of the present disclosure provides a network card device, applied to a receiving end, wherein the network card device is implemented based on programmable hardware and includes:

[0014] a receiving module, configured to receive target data and dual-write address information corresponding to the target data sent by a network card device at a sending end using a dual-write unilateral operation of remote direct data access (RDMA), wherein the dual-write address information includes first memory address information and second memory address information of the receiving end;

[0015] a writing module, configured to write the target data into a first memory address corresponding to the first memory address information; and

[0016] A copy module is used to perform a local memory copy operation after writing the target data to the first memory address, so as to copy the target data from the first memory address to the second memory address corresponding to the second memory address information, so as to realize double writing of the target data.

[0017] An embodiment of the present disclosure also provides a network card device, which is applied to a receiving end. The network card device includes: a storage unit and a processing unit. The storage unit is used to store a computer program. The processing unit is coupled to the storage unit and is used to execute the computer program to implement the steps in the data transmission method applied to the receiving end provided in an embodiment of the present disclosure.

[0018] An embodiment of the present disclosure further provides an electronic device, comprising any network card device provided by the embodiment of the present disclosure.

[0019] The embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor or a network card unit, the processor or the network card unit implements the steps in the data transmission method provided by the embodiment of the present disclosure.

[0020] An embodiment of the present disclosure provides a computer program product, including a computer program, which implements the method described in any one of the above aspects when executed by a processor.

[0021] In an embodiment of the present disclosure, in a scenario where remote memory access is performed via RDMA, a new RDMA operation, namely a double-write single-sided operation, is provided. Through this double-write single-sided operation, the target data to be double-written to the receiving end and the information of the two memory addresses of the target data at the receiving end can be sent to the network card device at the receiving end via a single network transmission. The network card device at the receiving end then performs a local memory write operation and a local memory copy operation based on the information of the two memory addresses, thereby achieving double writing of the target data and ensuring the atomicity and consistency of the target data in memory. At the same time, during this double-write process, the target data only needs to be transmitted over the network once, which can save network bandwidth resources. In addition, the double-write operation is completed at the receiving end through a local memory copy, which can reduce network latency compared to two network transmissions, which is conducive to improving the efficiency of data double-writing and thus improving system performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:

[0023] FIG1 is a schematic diagram of an interactive process of a data transmission method provided by an embodiment of the present disclosure;

[0024] FIG2 is a schematic diagram of an interaction flow of another data transmission method provided by an embodiment of the present disclosure;

[0025] FIG3 is a schematic diagram of an interaction flow of another data transmission method provided by an embodiment of the present disclosure;

[0026] FIG4 is a flow chart of a data transmission method described from the perspective of a network card device at a sending end according to an embodiment of the present disclosure;

[0027] FIG5 is a flow chart of a data transmission method described from the perspective of a network card device at a receiving end according to an embodiment of the present disclosure;

[0028] FIG6 is a schematic diagram of a resource architecture of a transmitting end and a receiving end provided by an embodiment of the present disclosure;

[0029] FIG7 is a flow chart of a data transmission method implemented based on the architecture shown in FIG6 ;

[0030] FIG8a is a schematic structural diagram of a network card device provided by an embodiment of the present disclosure;

[0031] FIG8b is a schematic structural diagram of another network card device provided by an embodiment of the present disclosure;

[0032] FIG9a is a schematic structural diagram of another network card device provided by an embodiment of the present disclosure;

[0033] FIG9 b is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

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

[0035] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0036] In response to technical problems such as the waste of network bandwidth resources and increased network latency in the existing double-write mechanism, in the embodiment of the present disclosure, in the scenario of remote memory access via RDMA, a new RDMA operation, namely a double-write unilateral operation, is provided. Through this double-write unilateral operation, the target data to be double-written to the receiving end and the information of the two memory addresses of the target data at the receiving end can be sent to the network card device at the receiving end through a single network transmission. The network card device at the receiving end performs a local memory write operation and a local memory copy operation based on the information of the two memory addresses, thereby realizing double-writing of the target data and ensuring the atomicity and consistency of the target data in the memory. At the same time, during the double-write process, the target data only needs to go through one network transmission, which can save network bandwidth resources. In addition, the double-write operation is completed at the receiving end through local memory copy, which can reduce network latency compared to two network transmissions, which is conducive to improving the efficiency of data double-writing and thus improving system performance.

[0037] The technical solution provided by the embodiment of the present disclosure is implemented by the network card device at the sending end and the network card device at the receiving end. In the embodiment of the present disclosure, the implementation method of the network card device is not limited, and it can be any network card device that supports the RDMA protocol, for example, it can be a cloud infrastructure processing unit (CIPU), smart network card (Smart NIC), network interface card (NIC) or infrastructure processor (IPU) chip or module integrated with a network card module that supports the RDMA protocol.

[0038] RDMA is a high-speed direct access technology for remote memory that is optimized for network card devices and software architecture. In the embodiments disclosed herein, there is no limitation on the implementation of RDMA technology at the protocol level. For example, it may include but is not limited to the following:

[0039] InfiniBand protocol: This RDMA technology, based on the InfiniBand architecture, was proposed by the InfiniBand Trade Association (IBTA) and is abbreviated as IB. Building an RDMA network based on IB technology requires dedicated IB network cards and switches. While InfiniBand networks offer superior performance, network cards and switches are relatively expensive.

[0040] iWARP (Internet Wide Area RDMA Protocol), short for Internet Wide Area RDMA Protocol, is an RDMA technology based on the Transmission Control Protocol / Internet Protocol (TCP / IP) and defined by the Internet Engineering Task Force (IETF). iWARP supports RDMA over standard Ethernet infrastructure, eliminating the need for switches to support lossless Ethernet transmission. However, servers must use iWARP-capable network adapters.

[0041] RoCE (RoCE) protocol, also proposed by IBTA, stands for RDMA over Converged Ethernet. It supports RDMA technology over standard Ethernet infrastructure, but requires switches that support lossless Ethernet transmission and servers that use RoCE network adapters. Its performance is comparable to IB.

[0042] RDMA technology using different protocols will have different hardware implementations, specifically different physical layers and link layers. However, no matter which protocol or hardware implementation RDMA adopts, the same set of application programming interfaces (APIs) can be used for applications. The API provided by RDMA for applications can also be called the software transport interface (software transport interface) between the application and the network card device, that is, the Verbs interface. In other words, RDMA provides a series of Verbs interfaces in the user space of the application. The application operates the RDMA hardware through these Verbs interfaces, allowing RDMA to bypass the kernel and directly access the user space of the application. An application refers to an application that needs to transmit data with the remote end through RDMA. The application in the embodiment of the present disclosure refers to an application that can directly read and write remote memory through RDMA technology, that is, an application that is implemented based on the API programming provided by RDMA. From a functional point of view, the application in the embodiment of the present disclosure can be a video processing application, instant messaging application, e-commerce application, and other applications that are implemented based on the API programming provided by RDMA.

[0043] Traditional verbs interfaces include two types: memory verbs and messaging verbs. Based on these two verbs interfaces, RDMA provides two basic operations for applications: unilateral operations and bilateral operations.

[0044] Memory verbs: These include RDMA read, write, and atomic operations. These operations are unilateral, requiring only the local end to clearly identify the source and destination addresses of the data to be transmitted. The remote application does not need to be aware of this communication. Data reading or writing is accomplished between the remote network card device and the application's buffer using Direct Memory Access (DMA) technology, without requiring the remote application's awareness or participation.

[0045] RDMA Read: The local application uses RDMA technology to read some memory data from the remote end. Before performing an RDMA read operation, the remote end needs to provide the local end with appropriate permissions so that the local end has permission to access the remote end's memory. Once the permissions are set, the RDMA read operation can be performed without any notification to the remote end. The local application needs to specify a virtual address on the remote end, and then the local network card device uses RDMA technology to read data from the remote end's memory directly according to the specified virtual address without the remote application being aware of it.

[0046] RDMA Write: Similar to RDMA Read, it writes data to the remote end's memory. Before executing an RDMA write operation, the remote end needs to provide the local end with appropriate permissions so that the local end has permission to access the remote end's memory. Once the permissions are set, the RDMA write operation can be executed without any notification to the remote end. The local application needs to specify a virtual address on the remote end. Then, the local network card device uses RDMA technology, just like writing data to local memory, to write data directly to the remote end's memory according to the specified virtual address without the remote application being aware of it.

[0047] RDMA Atomic: includes atomic load, atomic add, atomic compare, and atomic swap, and is an extension of RDMA atomic operations. This disclosure does not focus on this.

[0048] Messaging verbs: These include RDMA send and receive operations. These operations are bilateral operations, meaning that they require the remote application to perceive and participate in data transmission and reception.

[0049] RDMA Send: is the process of sending data in the local memory to the remote memory using RDMA technology. Specifically, the local application needs to put the work queue element (WQE) representing a send task into the send queue (SQ) of the queue pair (QP). Similarly, the remote application needs to send a WQE representing a receive task to the gateway device (i.e., RDMA hardware) to the receive queue (RQ) of the remote QP, so that the RDMA hardware knows where to put the received data in the memory. Then, the local RDMA hardware obtains the send task from the SQ, obtains the data from the local memory according to the send task, and transmits it to the remote RDMA hardware via the network. The remote RDMA hardware receives the data, verifies it, and then sends an acknowledgment (ACK) to the sender. It then places the data in the location specified in the WQE (Warning Queue Element). It then generates a Completion Queue Element (CQE) for the receiving task and places it in the Completion Queue (CQ). The remote application then receives the task completion message. After receiving the ACK, the local application also generates a CQE for the sending task and places it in the CQ. The local application then receives the task completion message. This entire process requires the awareness and participation of both the local and remote applications.

[0050] RDMA Receive: This is the process of receiving data from remote memory into local memory using RDMA technology. Specifically, the remote application needs to send a WQE (Warning Query Entity) to the gateway device (i.e., RDMA hardware) representing a send task to the remote QP's SQ. The local application needs to place the WQE representing a receive task into the QP's RQ. This allows the RDMA hardware to know where to place the received data in memory. The remote RDMA hardware then retrieves the send task from the SQ, retrieves the data from the remote memory based on the send task, and transmits it over the network to the local RDMA hardware. The local RDMA hardware receives the data, verifies it, and sends an acknowledgment (ACK) to the remote end. It then places the data in the location specified in the WQE. It then generates a CQE for the receive task and places it in the CQ. The local application then receives the task completion information. After receiving the ACK, the remote end also generates a CQE for the send task and places it in the CQ. The remote application then receives the task completion information. The entire process requires the awareness and participation of both the local and remote applications. Optionally, the local application and the remote application may be instant messaging applications, or the local application may be a client of a database storage system and the remote application may be a server of the database storage system, and so on.

[0051] In the disclosed embodiments, the traditional Verbs interface is expanded to provide a new application-oriented Verbs interface, known as Double Write verbs. This new Verbs interface enables RDMA hardware to extend a new application-oriented single-sided operation, namely, a double-write single-sided operation, referred to as RDMA Double Write. This new Verbs interface, also known as the target RDMA interface, is compatible with the double-write single-sided operation.

[0052] RDMA Double Write is similar to RDMA Write in that it writes local data to remote memory, but it requires writing the data to two different locations in remote memory, effectively writing local data to remote memory. RDMA Double Write single-sided operations are performed without notifying the remote end. This means the local end only needs to specify the data to be transferred and the two destination addresses on the remote end. The remote application does not need to be aware of or participate in this communication.

[0053] Compared to RDMA in traditional solutions, the RDMA of this embodiment supports single-sided operations, double-sided operations, and dual-write single-sided operations. Compared to traditional RDMA operations, dual-write single-sided operations are a new type of RDMA operation. To distinguish the write operation in traditional single-sided operations from the newly expanded dual-write single-sided operations of the disclosed embodiment, the write operation in traditional single-sided operations can be referred to as a single-write single-sided operation, which is responsible for writing local data to remote memory, and each write operation only writes data to one location in remote memory, that is, writing local data to remote memory alone.

[0054] The process of double-writing data to remote memory through RDMA double-write single-side operation will be described in the following embodiments. The following details the technical solutions provided by various embodiments of the present disclosure in conjunction with the accompanying drawings.

[0055] FIG1 is a schematic diagram of an interactive process of a data transmission method provided by an embodiment of the present disclosure. As shown in FIG1 , the method includes:

[0056] 101. A network card device at a sending end obtains target data and dual-write address information corresponding to the target data. The target data is data that a first application running at the sending end needs to dual-write to a receiving end. The dual-write address information includes first memory address information and second memory address information of the receiving end.

[0057] 102. The network card device at the sending end uses RDMA's double-write single-sided operation to send the target data, the first memory address information, and the second memory address information to the receiving end.

[0058] 103. After receiving the target data, the first memory address information, and the second memory address information sent by the network card device of the sending end, the network card device of the receiving end writes the target data into the first memory address corresponding to the first memory address information.

[0059] 104. After writing the target data into the first memory address, the network card device at the receiving end performs a local memory copy operation to copy the target data from the first memory address to a second memory address corresponding to the second memory address information, thereby achieving double writing of the target data.

[0060] In the embodiments disclosed herein, the receiving end and the sending end are the ends that have data reception and data transmission requirements, respectively. In terms of implementation, the receiving end and the sending end can be various terminal devices such as mobile phones, laptops, platform computers, desktop computers, etc., or various server devices such as traditional servers, cloud servers, cloud hosts, virtual centers, or server arrays. Regardless of the form of the receiving end and the sending end, both include a network card device and support remote memory reading via RDMA. In addition to the network card device, the receiving end and the sending end also include components such as a processor, a hard disk, memory, and a system bus. Furthermore, if the receiving end or the sending end is implemented as a terminal device, it can also include some peripheral devices, such as a keyboard, a mouse, an input pen, a printer, and other devices.

[0061] In this embodiment, applications are running on the receiving end and the sending end, and the applications at both ends can communicate with each other. In the embodiment disclosed herein, the applications at both ends use the RDMA method to directly perform remote memory read operations on each other's memory space through the network card devices at their respective ends to achieve communication between the two. Of course, the applications at both ends can also communicate with each other in other ways, such as TCP / IP, which is not limited to this. In addition, in the embodiment disclosed herein, the implementation method of the applications at both ends is not limited. For example, the applications at both ends can be the client and server of the same application, or they can be different applications of the same type, such as both instant messaging applications, or they can be different types of applications, such as one is a short video application and the other is an e-commerce shopping application.

[0062] In the embodiments of the present disclosure, for ease of description and partitioning, the application running on the sending end is referred to as the first application, and the application running on the receiving end is referred to as the second application. The first application on the sending end needs to write target data to the memory space of the second application on the receiving end via the sending end's network card device in an RDMA manner. In order to ensure the atomicity and consistency of the target data in the receiving end's memory space, the target data needs to be double-written, that is, the target data needs to be written to two different memory addresses on the receiving end in sequence. The network card device on the sending end can obtain the target data that the first application needs to double-write to the receiving end and the double-write address information corresponding to the target data. The double-write address information includes the first memory address information and the second memory address information of the receiving end. These two memory address information represent two memory addresses of the receiving end, denoted as the first memory address and the second memory address. These two memory addresses are the two memory addresses to which the receiving end needs to double-write the target data. In the embodiments of the present disclosure, the implementation method of the first memory address information and the second memory address information is not limited. Any information method that can uniquely identify the first memory address and the second memory address is applicable to the embodiments of the present disclosure, such as the address information of a specific memory address, or the combination of the identification information of the memory block to which the memory address belongs and the address offset.

[0063] Next, the network card device at the sending end uses RDMA's double-write unilateral operation to send the target data, the first memory address information, and the second memory address information to the receiving end, specifically to the network card device at the receiving end. In this embodiment, the double-write unilateral operation of RDMA has the following two functions: for the network card device at the sending end, its function is to send the target data, the first memory address information, and the second memory address information to the receiving end; for the network card device at the receiving end, its function is to instruct the network card device at the receiving end to first write the target data to the first memory address corresponding to the first memory address information, then perform a local memory copy operation, and then copy the target data from the first memory address to the second memory address corresponding to the second memory address information. Based on this, the network card device at the receiving end will receive the target data, the first memory address information, and the second memory address information sent by the network card device at the sending end via the double-write unilateral operation of RDMA, and then write the target data to the first memory address according to the first memory address information, and then perform a local memory copy operation to copy the target data from the first memory address to the second memory address, thereby achieving double writing of the target data.

[0064] In the disclosed embodiment, by expanding the Verbs interface of RDMA, a new Verbs interface is provided for applications. Based on the new Verbs interface, RDMA hardware can expand a new type of unilateral operation for applications, namely a double-write unilateral operation. Through the double-write unilateral operation, the network card device at the receiving end can simultaneously send the target data and two memory address information to the network card device at the receiving end during a single network transmission. With the cooperation of the receiving network card device, the local memory write operation and the local memory copy operation can be performed according to the two memory address information to achieve double writing of the target data, ensuring the atomicity and consistency of the target data in the memory. During the entire double-write process, the target data only needs to be transmitted over the network once, which can save network bandwidth resources compared to a solution that requires transmitting the target data twice to achieve double writing or a solution that requires transmitting two copies of the target data at the same time to achieve double writing. In addition, the double-write operation is completed at the receiving end through local memory copy, which can reduce network latency compared to two network transmissions, which is conducive to improving the efficiency of data double writing and thus improving system performance.

[0065] In the above or below embodiments of the present disclosure, before executing the RDMA double-write unilateral operation, an RDMA connection needs to be established between the first application on the receiving end and the second application on the sending end, and the creation and initialization operations of resources such as QP and CQ associated with the RDMA connection are completed. In addition, the second application on the receiving end needs to register the two memory addresses for storing target data in the local memory space to the network card device on the receiving end, so that the network card device obtains access rights to the two memory addresses. On this basis, the network card device on the receiving end can provide the information of the two memory addresses (i.e., the first memory address information and the second memory address information) to the network card device on the sending end through the aforementioned RDMA connection to provide the network card device on the sending end with appropriate memory access rights, so that the network card device on the sending end has the right to directly access the memory of the receiving end. Accordingly, from the perspective of the network card device on the sending end, based on the RDMA connection between the first application and the second application, the double-write address information (i.e., the first memory address information and the second memory address information) provided by the network card device on the sending end can be received to obtain access rights to the first memory address and the second memory address. Once the access permissions to the first memory address and the second memory address are set, the RDMA double-write single-side operation can be performed without any notification to the receiving end.

[0066] In an optional embodiment, the first memory address and the second memory address belong to different memory regions, denoted as the first memory region and the second memory region. Based on this, the second application on the receiving end needs to register the addresses of the first memory region and the second memory region with the receiving end's network card device. The receiving end's network card device will assign a local key (Local-Key) to each of the first and second memory regions and return it to the second application, which is equivalent to the receiving end's network card device obtaining access rights to the two memory regions. For ease of description and distinction, the address of the first memory region is denoted as VB1, the address of the second memory region is denoted as VB2, the local key of the first memory region is denoted as L-Key1, and the local key of the second memory region is denoted as L-Key2. The address information of the first memory region can be expressed as (VB1, L-Key1), and the address information of the second memory region can be expressed as (VB2, L-Key2). In this optional embodiment, the address information of the first memory region (VB1, L-Key1) can be provided to the sending end's network card device as the first memory address information, and the address information of the second memory region (VB2, L-Key2) can be provided to the sending end's network card device as the second memory address information. For the sender, since the first and second memory areas are remote memory areas, L-Key1 in the address information of the first memory area can be represented as R-Key1, and correspondingly, L-Key2 in the address information of the second memory area can be represented as R-Key2. R-Key is the abbreviation of Remote-Key.

[0067] In the case of obtaining the double-write address information, when the first application needs to double-write the target data to the second application, the target RDMA interface can be called to send the data double-write task to the network card device at the receiving end. Compared with the traditional RDMA interface, the target RDMA interface here is an interface provided by RDMA for applications that is adapted to the double-write unilateral operation. It is a new RDMA interface. The data double-write task includes the virtual address of the target data, and the virtual address points to the memory space of the first application. The network card device at the sending end receives the data double-write task issued by the first application, obtains the virtual address of the target data from the task, and then converts the virtual address of the target data into a physical address, and obtains the target data from the memory space of the first application according to the physical address. Optionally, a cached page table entry is included in the network card device, and the cached page table entry stores the mapping relationship between the virtual address (such as a virtual page) and the physical address (such as a physical page). By querying the cached page table entry, the virtual address of the target data can be mapped to the corresponding physical address.

[0068] It is to be noted that, in addition to the above-mentioned method, the network card device at the sending end may also adopt other methods to obtain the target data, and this is not limited.

[0069] In the embodiments of the present disclosure, the specific implementation method of the double-write unilateral operation is not limited. In an optional embodiment, a double-write request adapted to the double-write unilateral operation may be provided, and the double-write request is different from the write request corresponding to the traditional single-write unilateral operation, and the double-write request includes at least a data field and two address fields, which are respectively used to carry the target data, the first memory address information and the second memory address information. Based on this, in each embodiment of the present disclosure, an implementation method of using the double-write unilateral operation of RDMA to send the target data, the first memory address information and the second memory address information to the receiving end includes: generating a double-write request supported by the double-write unilateral operation based on the target data, the first memory address information and the second memory address information, and sending the double-write request to the network card device of the receiving end based on the RDMA connection between the first application and the second application. Wherein, the double-write request includes the target data, the first memory address information and the second memory address information. For the receiving network card device, receiving the target data, first memory address information, and second memory address information sent by the sending network card device via an RDMA dual-write unilateral operation specifically involves receiving a dual-write request sent by the sending network card device based on the RDMA connection between the first application and the second application, and obtaining the target data, first memory address information, and second memory address information from the dual-write request. Using dual-write requests to solve the implementation issues of dual-write unilateral operations is relatively simple and efficient, and requires minimal changes to the RDMA protocol, providing strong compatibility with the RDMA protocol.

[0070] In the embodiments of the present disclosure, the implementation method of the receiving end network card device performing the local memory copy operation is not limited. Any implementation method that involves the receiving end network card device and can copy the target data from a first memory address to a second memory address is applicable to the embodiments of the present disclosure. The following provides two specific implementation methods of the local memory copy operation, as shown in Figures 2 and 3, respectively, as embodiments of the data transmission method.

[0071] FIG2 is a schematic diagram of an interaction flow of another data transmission method provided by an embodiment of the present disclosure. As shown in FIG2 , the method includes:

[0072] 201. A network card device at a sending end obtains target data and dual-write address information corresponding to the target data. The target data is data that a first application at the sending end needs to dual-write to a receiving end. The dual-write address information includes first memory address information and second memory address information of the receiving end.

[0073] 202. The network card device at the sending end uses RDMA's double-write single-sided operation to send the target data, the first memory address information, and the second memory address information to the receiving end.

[0074] 203. After receiving the target data, the first memory address information, and the second memory address information sent by the network card device of the sending end, the network card device of the receiving end writes the target data into the first memory address corresponding to the first memory address information.

[0075] 204. The network card device at the receiving end returns a confirmation message to the network card device at the sending end, so that the network card device at the sending end can report the first application.

[0076] 205. After writing the target data into the first memory address, the network card device at the receiving end performs a DMA operation according to the first memory address information and the second memory address information to copy the target data from the first memory address to the second memory address, thereby achieving double writing of the target data.

[0077] 206. After copying the target data from the first memory address to the second memory address, the network card device at the receiving end returns a specific notification message to the network card device at the sending end, so that the network card device at the sending end reports the specific notification message to the first application, wherein the specific notification message is a notification message supported by a double-write unilateral operation and needs to be reported to the first application.

[0078] 207. The network card device at the sending end receives the specific notification message and reports it to the first application.

[0079] In the disclosed embodiment, the receiving end network card device has read and write permissions for the first memory address and the second memory address, and has DMA capabilities. Based on this, after writing the target data to the first memory address, the DMA operation can be performed based on the first memory address information and the second memory address information to copy the target data from the first memory address to the second memory address, thereby achieving a double write of the target data. Among them, the use of DMA operation to implement local memory copy does not require the participation of the processor, can save the processing of the kernel protocol stack, is conducive to improving the execution efficiency of the local memory copy operation, and thus improves the effect of the entire data double write process.

[0080] FIG3 is a schematic diagram of an interaction flow of another data transmission method provided by an embodiment of the present disclosure. As shown in FIG3 , the method includes:

[0081] 301. A network card device at a sending end obtains target data and dual-write address information corresponding to the target data. The target data is data that a first application at the sending end needs to dual-write to a receiving end. The dual-write address information includes first memory address information and second memory address information of the receiving end.

[0082] 302. The network card device at the sending end uses RDMA's double-write single-sided operation to send the target data, the first memory address information, and the second memory address information to the receiving end.

[0083] 303. After receiving the target data, the first memory address information, and the second memory address information sent by the network card device at the sending end, the network card device at the receiving end writes the target data into the first memory address corresponding to the first memory address information.

[0084] 304. The network card device at the receiving end returns a confirmation message to the network card device at the sending end, so that the network card device at the sending end can report the first application.

[0085] 305. After writing the target data into the first memory address, the network card device at the receiving end sends a copy instruction message to the processor at the receiving end according to the first memory address information and the second memory address information, so that the processor copies the target data from the first memory address to the second memory address.

[0086] 306. The network card device at the receiving end receives a completion notification message returned by the processor after copying the target data from the first memory address to the second memory address.

[0087] 307. After copying the target data from the first memory address to the second memory address, the network card device at the receiving end returns a specific notification message to the network card device at the sending end, so that the network card device at the sending end reports the specific notification message to the first application, wherein the specific notification message is a notification message supported by a double-write unilateral operation and needs to be reported to the first application.

[0088] 308. The network card device at the sending end receives the specific notification message and reports it to the first application.

[0089] In the embodiment of the present disclosure, the network card device at the receiving end cooperates with the processor at the receiving end to complete the local memory copy operation. Specifically, the network card device sends a copy indication message to the processor, carrying the first memory address information and the second memory address information in the copy indication message, so that the processor can copy the target data from the first memory address to the second memory address, and after copying the target data from the first memory address to the second memory address, return a completion notification message to the network card device to notify the network card device that the target data has been copied from the first memory address to the second memory address, so that the network card device understands that the double write operation is completed. In this embodiment, the local memory copy operation requires the participation of the processor, which is suitable for situations where the network card device has no access permission to the second memory address or is not suitable for accessing the second memory address, which is conducive to improving the data security of the second memory address.

[0090] Furthermore, to maintain compatibility with existing RDMA protocols, after writing the target data to the first memory address, the receiving end can return a confirmation message to the sending end's network card device, so that the sending end's network card device is informed that the target data has been written to the first memory address. For details, see step 204 in FIG2 and step 304 in FIG3. For the sending end's network card device, after using RDMA's double-write single-sided operation to send the target data, the first memory address information, and the second memory address information to the receiving end's network card device, the sending end's network card device can also receive a confirmation message returned by the receiving end's network card device after writing the target data to the first memory address, and report the confirmation message to the first application. In this embodiment, the sending end's network card device can learn from the confirmation message returned by the receiving end's network card device that the receiving end's network card device has successfully written the target data to the first memory address. Based on this, the sending end's network card device can perform subsequent or other data transmission and reception operations without waiting for the receiving end's network card device to perform a local memory copy operation, which is beneficial for improving the sending end's data transmission and reception efficiency and reducing data transmission delays. After receiving the confirmation message returned by the receiving network card device, the sending network card device can place the confirmation message as a CQE into the CQ corresponding to the first application. The first application can read the CQE from the CQ to confirm that the target data has been successfully transmitted to the receiving end. It should be noted that step 204 in Figure 2 and step 304 in Figure 3 are optional operations.

[0091] Furthermore, since the double-write operation of the target data is completed by the receiving end performing a local memory copy operation, the operation is imperceptible to the sending end. In order to allow the sending end to perceive whether the receiving end has successfully copied the target data from the first memory address to the second memory address, in the embodiment of the present disclosure, a specific notification message is provided for the double-write unilateral operation. The specific notification message is a notification message that is returned to the network card device of the sending end after the network card device of the receiving end successfully copies the target data from the first memory address to the second memory address, and the specific notification message also requires the network card device of the sending end to report it to the first application that sent the target data after receiving it, so that the first application can perceive the completion of the double-write operation. Compared with the above-mentioned confirmation information, the specific notification message here is a more explicit message, that is, a message that requires the first application to clearly perceive it, and is a notification message unique to the double-write unilateral operation. Based on this, the receiving end network card device, after copying the target data from the first memory address to the second memory address, returns a specific notification message to the sending end network card device, so that the sending end network card device reports the specific notification message to the first application. The sending end network card device is also used to receive the specific notification message returned by the receiving end network card device after copying the target data from the first memory address to the second memory address, and report the specific notification message to the first application. For details, please refer to steps 206 and 207 in Figure 2, and steps 307 and 308 in Figure 3. It should be noted that steps 206 and 207 in Figure 2, and steps 307 and 308 in Figure 3 are optional steps.

[0092] In the embodiments of the present disclosure, the implementation method of the specific notification message is not limited. For example, it can be distinguished from other messages by the format of the message, or it can be distinguished from other messages by carrying a unique identifier or field in the message. The difference of the specific notification message is that it needs to be reported to the first application that sends the target data, that is, a message in a specific format or a message carrying a unique identifier or field can be used to indicate that the message is a specific notification message that needs to be reported to the first application that sends the target data. In an optional embodiment, the RDMA Write With Immediate mechanism based on immediate numbers in the RDMA standard can be used to implement the specific notification message, that is, a message reporting identifier is carried in the specific notification message, and the message reporting identifier indicates that the specific notification message to which it belongs needs to be reported to the first application. In this embodiment, the specific implementation of the message reporting identifier is not limited. Optionally, the message reporting identifier can be implemented as an immediate number. In addition, this embodiment does not focus on the value of the immediate number. It can be any meaningless value or a value representing a certain meaning. There is no limitation on this.

[0093] In the embodiments disclosed herein, the manner in which the network card device at the sending end reports the specific notification message to the first application is not limited. In an optional embodiment, after receiving the specific notification message, the network card device at the sending end can parse out the message reporting identifier (e.g., an immediate number) therefrom, and then initiate an interrupt message to the first application, and report the message reporting identifier to the first application as a parameter of the interrupt message, that is, report the specific notification message to the application in an interrupt manner. The first application actively reads the specific notification message according to the message reporting identifier in the interrupt message, and thereby learns that the target data has been successfully double-written to the memory space of the second application at the receiving end.

[0094] Furthermore, in some optional embodiments, considering that it takes a certain amount of time for the network card device at the receiving end to perform the local memory copy operation, other applications may access the first memory address and / or the second memory address during this period, in order to avoid the problem of address access conflict caused by two operations performing operations on the same memory address at the same time, during the execution of the local memory copy, the network card device at the receiving end can block the write operation to the first memory address and the read and write operations to the second memory address.

[0095] In the embodiments of the present disclosure, the specific implementation method of blocking is not limited. For example, one blocking method is discarding, that is, discarding the write operation for the first memory address, and correspondingly, discarding the read and write operations for the second memory address. For another example, another blocking method is waiting, that is, adding the write operation for the first memory address to the first waiting queue to wait for the local memory copy operation to end; correspondingly, adding the read and write operations for the second memory address to the second waiting queue to wait for the local memory copy operation to end. After the local memory copy operation ends, it can be scheduled and executed one by one according to the order or priority of the arrival of each write operation in the first waiting queue to implement the write operation to the first memory address. Correspondingly, after the local memory copy operation ends, it can be scheduled and executed one by one according to the order or priority of the arrival of each read and write operation in the second waiting queue to implement the read and write operation to the second memory address.

[0096] From the perspective of a network card device at the sending end, an embodiment of the present disclosure provides a data transmission method, as shown in FIG4 , including:

[0097] 401. Obtain target data of a first application and dual-write address information corresponding to the target data, where the dual-write address information includes first memory address information and second memory address information of a receiving end.

[0098] 402. Use the double-write unilateral operation of remote direct data access (RDMA) to send the target data, the first memory address information, and the second memory address information to the network card device at the receiving end, so as to instruct the network card device at the receiving end to first write the target data to the first memory address corresponding to the first memory address information, and then perform a local memory copy operation to copy the target data from the first memory address to the second memory address corresponding to the second memory address information, so as to realize double writing of the target data.

[0099] From the perspective of the second network card, an embodiment of the present disclosure provides a data transmission method, as shown in FIG5 , including:

[0100] 501. Receive target data and dual-write address information corresponding to the target data sent by a network card device at a sending end using a dual-write unilateral operation of RDMA, where the dual-write address information includes first memory address information and second memory address information at the receiving end.

[0101] 502. Write the target data into the first memory address corresponding to the first memory address information; and

[0102] 503. After writing the target data into the first memory address, perform a local memory copy operation to copy the target data from the first memory address to a second memory address corresponding to the second memory address information, so as to achieve double writing of the target data.

[0103] The detailed implementation of the steps in the above methods and their beneficial effects can be found in the description of the above embodiments and will not be repeated here.

[0104] In the above embodiments, the overall process of performing data double writing based on RDMA double write single-sided operation is described in detail. The following will be combined with the RDMA resource architecture of the receiving end and the sending end shown in Figure 6 to describe the process of performing data double writing based on RDMA double write single-sided operation in the embodiment of the present disclosure in detail.

[0105] As shown in Figure 6, a network interconnection exists between the sending end A (referred to as A) and the receiving end B (referred to as B). A first application and a second application are running on ends A and B, respectively. When the two applications need to communicate, a tunnel (Channel) connection is pre-established, called an RDMA connection. Each end of this RDMA connection is connected to a set of queues (QPs). Each QP set includes an SQ and an RQ, which manage various types of messages. The QP is mapped to the application's memory space (i.e., virtual address space), allowing the application to directly access the network card device through it. In addition, RDMA also provides CQs, which are used to notify applications that messages in the SQ or RQ have been processed. RDMA provides point-to-point communication based on message queues, allowing each application to directly access its own messages without the intervention of the operating system or protocol stack.

[0106] In the embodiment of the present disclosure, the first application can call various verbs interfaces provided by RDMA to create different data transmission tasks, such as data sending tasks or data receiving tasks. In the present embodiment, taking the data sending task as an example, the first application can further call different verbs interfaces to create different data sending tasks. For example, it can call the Memory verbs interface to create a data sending task corresponding to RDMA Write, or call the Messaging verbs interface to create a data sending task corresponding to RDMA Send, or call the newly added verbs interface (i.e., the target RDMA interface) to create a data sending task corresponding to RDMA Double Write. In the present embodiment, there are three operations for data sending tasks: RDMA Send, RDMA Write, and RDMA Double Write. In the embodiment of the present disclosure, the creation process and data transmission process of RDMA Double Write are mainly described in detail. Specifically, as shown in Figure 7, it includes:

[0107] a1. End A and end B establish an RDMA connection. The QP and CQ associated with the RDMA connection have been created and initialized. The QP includes the SQ and QR.

[0108] a2. The second application registers the addresses VB1 and VB2 of the two memory areas of the target data to be received in the network card of the B side in advance. VB1 and VB2 represent two different memory areas.

[0109] a3. The network card on the B side returns the remote keys R-key1 and R-key2 corresponding to the memory areas VB1 and VB2 to the second application, which means that the network card on the B side has the RDMA operation permissions for these two memory areas.

[0110] a4. The network card on end B encapsulates the address information of the two memory areas (VB1, R-key1) and (VB2, R-key2) into a dedicated message and sends it to the network card on end A. This is equivalent to end B handing over the operation rights of memory areas VB1 and VB2 to end A.

[0111] a5. The network card at end B registers a work receive task (Work Receive, WR) in its RQ to receive the status information returned by end A.

[0112] a6. When the network card at end A receives the address information of two memory addresses (VB1, R-key1) and (VB2, R-key2) sent by the network card at end B, when the first application at end A needs to send target data to end B, it sends a data double write task to SQ in the form of WQE. The WQE includes the virtual address of the target data in the memory space of the first application.

[0113] a7. The network card at end A obtains the WQE corresponding to the data dual write task from the SQ, converts the virtual address in the WQE into a physical address, and obtains the target data to be sent from the memory space of the first application according to the physical address.

[0114] a8. The network card at end A encapsulates its own sending address VA, the target data to be sent, and (VB1, R-key1) and (VB2, R-key2) into the double-write request corresponding to the data double-write task.

[0115] a9. The A-side network card sends the dual write request to the B-side network card through the physical link.

[0116] a10. The network card at end B parses the received dual write request and writes the target data into the memory area VB1 corresponding to (VB1, Rkey1).

[0117] a11. The network card at end B returns a confirmation message to the network card at end A.

[0118] a12. After receiving the confirmation message, the network card at end A generates a CQE and places it in the CQ so that the first application can obtain the CQE information.

[0119] a13. The network card at end B performs a local copy operation, copying the target data from the memory area VB1 corresponding to (VB1, R-key1) to the memory area VB2 corresponding to (VB2, R-key2).

[0120] Step a13 includes two methods:

[0121] Method 1: The network card at end B uses DMA to copy the target data from the memory address VB1 corresponding to (VB1, R-key1) to the memory address VB2 corresponding to (VB2, R-key2).

[0122] Method 2: The B-side network card notifies the B-side CPU, which copies the target data from the memory address VB1 corresponding to (VB1, R-key1) to the memory address VB2 corresponding to (VB2, R-key2), and receives the copy completion notification returned by the CPU.

[0123] a14. After the target data is copied from memory address VB1 to memory address VB2, the B-side network card constructs a specific notification message and returns it to the A-side network card.

[0124] a15. The network card at end A receives a specific notification message, generates a CQE, and places it in the CQ.

[0125] a16. The first application on the A side obtains the CQE corresponding to the specific notification message from the CQ to confirm that the data double-write task is completed.

[0126] In an embodiment of the present disclosure, in a scenario where remote memory access is performed via RDMA, a new RDMA operation, namely a double-write single-sided operation, is provided. Through this double-write single-sided operation, the target data to be double-written to the receiving end and the information of the two memory addresses of the target data at the receiving end can be sent to the network card device at the receiving end via a single network transmission. The network card device at the receiving end then performs a local memory write operation and a local memory copy operation based on the information of the two memory addresses, thereby achieving double writing of the target data and ensuring the atomicity and consistency of the target data in memory. At the same time, during this double-write process, the target data only needs to be transmitted over the network once, which can save network bandwidth resources. In addition, the double-write operation is completed at the receiving end through a local memory copy, which can reduce network latency compared to two network transmissions, which is conducive to improving the efficiency of data double-writing and thus improving system performance.

[0127] The data transmission solution provided by the embodiments of the present disclosure can be applied to any application scenario that uses the RDMA protocol for data transmission, for example, in various database, data warehouse, and distributed data storage system scenarios. In scenarios such as database, data warehouse, or distributed data storage system, the client of the database, data warehouse, or distributed data storage system can use the solution provided by the embodiments of the present disclosure to store, update, or back up data in the database, data warehouse, or distributed data storage system. The following takes the storage and computing separation scenario as an example to explain in detail the application of the data transmission solution provided by the embodiments of the present disclosure in the storage and computing separation scenario.

[0128] The storage-and-computing separation scenario is a system architecture proposed for cloud-native database applications, driven by the development of cloud-native technologies. This architecture comprises compute nodes and remote memory nodes. Compute nodes primarily provide computing resources, while remote memory nodes, acting as extensions of the memory buffer pool on the compute nodes, are responsible for providing remote memory buffer pool resources. Persistent storage nodes provide persistent storage resources, forming three independent resource pools. The compute resources on the compute nodes are separated from the memory buffer pool resources provided by the remote memory nodes. Each resource pool can be scaled up or down independently, enabling more refined on-demand resource requests and greater elasticity.

[0129] In the aforementioned storage-and-computing separation architecture, applications hosted by compute nodes are interconnected with remote memory nodes via RDMA. As applications hosted by compute nodes run, they generate increasing amounts of data. If the compute node's local memory cache pool is insufficient, a page replacement mechanism can be used to swap out old page data. The swapped-out page data can then be cached in the shared memory cache pool provided by the remote memory node. Furthermore, in the storage-and-computing separation architecture, the same application may need to run simultaneously on multiple compute nodes or require collaboration between multiple compute nodes. This means that multiple compute nodes need to share the same page data, raising the issue of data consistency between the shared and local memory cache pools to ensure that each compute node uses the correct page data. One way to maintain data consistency between the shared and local memory cache pools is to synchronize the changed page data with the shared memory cache pool when page data in the local memory cache pool changes, so that other compute nodes can obtain the correct and latest page data from the shared memory cache pool.

[0130] In the above process, the process of writing page data to the remote memory node is involved. In the embodiment of the present disclosure, in order to ensure the consistency and atomicity of the page data in the remote memory node, the RDMA-based double-write unilateral operation provided by the embodiment of the present disclosure can be used to perform a double-write operation on the page data to the remote memory node. The remote memory node may include a double-write buffer and a remote buffer pool. Specifically, the double-write operation of the page data can be completed by the network card device of the computing node and the network card device of the remote memory node in cooperation with each other. The network card device of the computing node uses the RDMA double-write unilateral operation to provide the address information of the page data and the double-write buffer and the address information of the remote buffer pool to the network card device of the remote memory node; the network card device of the remote memory node first writes the page data into the doublewrite buffer, and then performs a local memory copy operation to copy the page data from the doublewrite buffer to the Remote Buffer Pool to implement the double-write operation of the page data. Among them, the page data that is double-written here can be page data that needs to be synchronized in the data consistency maintenance scenario, or it can be page data that is replaced on the computing node due to the page replacement mechanism. The process of the entire double-write operation can be referred to the aforementioned embodiment and will not be repeated here. In the storage and computing separation architecture, the data double-write solution based on RDMA double-write unilateral operation provided by the embodiment of the present disclosure is introduced, which can greatly reduce network bandwidth resources, save data transmission delays, and improve the performance of the entire storage and computing separation architecture.

[0131] It should be noted that the execution entity of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution entity of steps 101 to 103 can be device A; for another example, the execution entity of steps 101 and 102 can be device A, and the execution entity of step 103 can be device B; and so on.

[0132] In addition, some of the processes described in the above embodiments and the accompanying drawings include multiple operations that appear in a specific order, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0133] Figure 8a is a schematic diagram of the structure of a network card device provided by an embodiment of the present disclosure. The network card device is applied to a transmitting end, and a first application is running on the transmitting end. The network card device can be implemented based on programmable hardware, where the programmable hardware includes but is not limited to: a complex programmable logic device (CPLD), a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC) chip, etc. As shown in Figure 8a, the network card device includes the following modules:

[0134] The acquisition module 81a is configured to acquire target data of the first application and dual-write address information corresponding to the target data, where the dual-write address information includes first memory address information and second memory address information of the receiving end.

[0135] The transmission module 82a is used to use the double-write single-sided operation of remote direct data access (RDMA) to send the target data, the first memory address information, and the second memory address information to the network card device at the receiving end, so as to instruct the network card device at the receiving end to first write the target data to the first memory address corresponding to the first memory address information, and then perform a local memory copy operation to copy the target data from the first memory address to the second memory address corresponding to the second memory address information, so as to realize double writing of the target data.

[0136] In an optional embodiment, the acquisition module 81a includes a first acquisition unit and a second acquisition unit, wherein the first acquisition unit is used to acquire target data that the first application needs to double-write to the receiving end; and the second acquisition unit is used to acquire double-write address information corresponding to the target data.

[0137] Furthermore, the first acquisition unit is used to receive the data double-write task issued by the first application calling the target RDMA interface, the target RDMA interface is an interface adapted to the double-write unilateral operation, and the data double-write task includes the virtual address of the target data; the virtual address of the target data is converted into a physical address, and the target data is obtained from the memory space of the first application according to the physical address.

[0138] The second acquisition unit is used to receive the dual write address information sent by the network card device of the receiving end based on the RDMA connection between the first application and the second application running on the receiving end, so as to obtain access rights to the first memory address and the second memory address.

[0139] In an optional embodiment, the transmission module 82a is specifically used to: generate a dual-write request supported by a dual-write unilateral operation, and send the dual-write request to the receiving end based on the RDMA connection between the first application and the second application running on the receiving end; the dual-write request includes target data, first memory address information and second memory address information.

[0140] Further optionally, the acquisition module 81a also includes: a third acquisition unit, used to receive a confirmation message returned by the network card device at the receiving end after writing the target data to the first memory address, and report the confirmation message to the application; and / or, receive a specific notification message returned by the network card device at the receiving end after copying the target data from the first memory address to the second memory address, and report the specific notification message to the first application, the specific notification message is a notification message supported by double-write unilateral operation and needs to be reported to the first application.

[0141] In an optional embodiment, the specific notification message includes a message reporting identifier, which indicates that the specific notification message needs to be reported to the first application. Based on this, the third acquisition unit is specifically configured to send an interrupt message to the first application, the interrupt message including the message reporting identifier, so that the first application can read the specific notification message based on the message reporting identifier.

[0142] It is noted that the modules in the embodiments of the present disclosure can be flexibly split or merged to obtain network card devices with different structures. In other words, any network card device structure that can implement the above-mentioned corresponding functions is applicable to the embodiments of the present disclosure.

[0143] In addition to the aforementioned network card devices, embodiments of the present disclosure also provide a network card device that combines software and hardware. This network card device is applied to a transmitting end, which runs a first application. As shown in Figure 8b, the network card device includes a storage unit 81b and a processing unit 82b. Storage unit 81b is used to store computer programs, and processing unit 82b is coupled to storage unit 81b to execute the computer programs to implement the various steps that can be performed by the network card device on the transmitting end in various method embodiments of the present disclosure.

[0144] Figure 9a is a schematic diagram of the structure of another network card device provided by an embodiment of the present disclosure. The network card device is used at the receiving end and can be implemented based on programmable hardware, where the programmable hardware includes but is not limited to: CPLD, FPGA, ASIC chip, etc. As shown in Figure 9a, the network card device includes the following modules:

[0145] A receiving module 91a is configured to receive target data and dual-write address information corresponding to the target data sent by a network card device at a sending end using a dual-write unilateral operation of Remote Direct Data Access (RDMA), where the dual-write address information includes first memory address information and second memory address information at a receiving end;

[0146] A writing module 92a, configured to write target data into a first memory address corresponding to the first memory address information; and

[0147] The copy module 93a is used to perform a local memory copy operation after writing the target data to the first memory address, so as to copy the target data from the first memory address to the second memory address corresponding to the second memory address information, so as to realize double writing of the target data.

[0148] In an optional embodiment, the receiving module 91a is specifically used to: receive a dual write request sent by the network card device at the sending end, the dual write request including target data, first memory address information and second memory address information, and the dual write request is a write request supported by dual write unilateral operation.

[0149] In an optional embodiment, the copy module 93a is specifically used to: perform a direct data access DMA operation based on the first memory address information and the second memory address information to copy the target data from the first memory address to the second memory address, thereby realizing double writing of the target data; or, based on the first memory address information and the second memory address information, send a copy indication message to the processor at the receiving end to enable the processor to copy the target data from the first memory address to the second memory address, and receive a completion notification message returned by the processor.

[0150] In an optional embodiment, as shown in Figure 9a, the network card device of this embodiment also includes: a sending module 94a, which is used to return a confirmation message to the network card device at the sending end after writing the target data to the first memory address, so that the network card device at the sending end knows that the target data has been written to the first memory address; and / or, after copying the target data from the first memory address to the second memory address, return a specific notification message to the network card device at the sending end, so that the network card device at the sending end reports the specific notification message to the first application to which the sending end sends the target data; wherein the specific notification message is a notification message supported by a double-write unilateral operation and needs to be reported to the first application.

[0151] Optionally, the above-mentioned specific notification message includes a message reporting identifier, and the message reporting identifier indicates that the specific notification message needs to be reported to the first application.

[0152] Further optionally, the copy module 93a is further configured to block write operations to the first memory address and read and write operations to the second memory address during the execution of the local memory copy operation.

[0153] It is noted that the modules in the embodiments of the present disclosure can be flexibly split or merged to obtain network card devices with different structures. In other words, any network card device structure that can implement the above-mentioned corresponding functions is applicable to the embodiments of the present disclosure.

[0154] In addition to the aforementioned network card devices, embodiments of the present disclosure also provide a network card device that combines software and hardware. This network card device is applied to a receiving end, where a second application runs. This network card device has the same or similar structure as the network card device shown in FIG8b , and includes a storage unit and a processing unit. The storage unit is used to store a computer program, and the processing unit is coupled to the storage unit to execute the computer program to implement the steps that can be performed by the receiving end network card device in various method embodiments of the present disclosure.

[0155] In addition to the aforementioned network card devices, embodiments of the present disclosure further provide an electronic device, as shown in FIG9b . The electronic device includes any of the network card devices 91b provided in embodiments of the present disclosure, and further includes a memory 92b and a processor 93b. The memory 92b stores program code for the electronic device's operating system and program code for various applications running on the electronic device. The processor 93b is coupled to the memory 92b and is configured to execute the various program codes stored in the memory 92b to implement corresponding functions.

[0156] Furthermore, as shown in Figure 9b, the electronic device also includes other components such as a display 95b, a power supply component 96b, and an audio component 97b. Figure 9b only schematically shows some components, which does not mean that the electronic device only includes the components shown in Figure 9b. In addition, the components in the dotted box in Figure 9b are optional components, not mandatory components, and the specific components may depend on the product form of the electronic device. The electronic device of this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone or an IOT device, or it can be a server-side device such as a conventional server, a cloud server or a server array. If the electronic device of this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, etc., it may include the components in the dotted box in Figure 9b; if the electronic device of this embodiment is implemented as a server-side device such as a conventional server, a cloud server or a server array, it may not include the components in the dotted box in Figure 9b.

[0157] Accordingly, an embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor or a processing unit, the processor or the processing unit is enabled to implement each step in the above-mentioned method embodiments.

[0158] The above-mentioned memory or storage unit can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0159] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0160] The above-mentioned display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundary of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0161] The power supply assembly provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.

[0162] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0163] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to magnetic disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.

[0164] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0165] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0166] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0167] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.

[0168] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0169] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0170] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0171] The above are merely examples of the present disclosure and are not intended to limit the present disclosure. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure are intended to be included within the scope of the claims of the present disclosure.

Claims

1. A data transmission method, wherein: A network card device applied to a sending end, wherein the sending end runs a first application, and the method includes: Acquire target data of a first application and dual-write address information corresponding to the target data, wherein the dual-write address information includes first memory address information and second memory address information of a receiving end; Using the double-write single-sided operation of remote direct data access RDMA, the target data, the first memory address information and the second memory address information are sent to the network card device at the receiving end to instruct the network card device at the receiving end to first write the target data to the first memory address corresponding to the first memory address information, and then perform a local memory copy operation to copy the target data from the first memory address to the second memory address corresponding to the second memory address information, so as to realize double writing of the target data.

2. The method according to claim 1, wherein: Obtain the target data that the first application needs to double-write to the receiving end, including: receiving a data double-write task issued by a first application calling a target RDMA interface, wherein the target RDMA interface is an interface adapted to the double-write unilateral operation, and the data double-write task includes a virtual address of target data; The virtual address of the target data is converted into a physical address, and the target data is obtained from the memory space of the first application according to the physical address.

3. The method according to claim 1, wherein: Obtaining the dual-write address information corresponding to the target data includes: Based on the RDMA connection between the first application and the second application running on the receiving end, the dual write address information sent by the network card device of the receiving end is received to obtain access rights to the first memory address and the second memory address.

4. The method according to claim 1, wherein: Using a double-write single-side operation of remote direct data access RDMA, the target data, the first memory address information and the second memory address information are sent to a network card device at a receiving end, including: Generate a dual write request supported by the dual write unilateral operation, and send the dual write request to the receiving end based on the RDMA connection between the first application and the second application running on the receiving end; the dual write request includes the target data, the first memory address information and the second memory address information.

5. The method according to any one of claims 1 to 4, wherein: Also includes: receiving a confirmation message returned by the network card device at the receiving end after writing the target data into the first memory address, and reporting the confirmation message to the first application; and / or, Receive the specific notification message returned by the network card device at the receiving end after copying the target data from the first memory address to the second memory address, and report the specific notification message to the first application, wherein the specific notification message is a notification message supported by the double-write unilateral operation and needs to be reported to the first application.

6. The method according to claim 5, wherein: The specific notification message includes a message reporting identifier, and the message reporting identifier indicates that the specific notification message needs to be reported to the first application; Reporting the specific notification message to the first application includes: An interrupt message is sent to the first application, where the interrupt message includes the message reporting identifier, so that the first application reads the specific notification message according to the message reporting identifier.

7. A data transmission method, wherein: The method is applied to a network card device at a receiving end, and comprises: Receive target data and double-write address information corresponding to the target data sent by a network card device at a sending end using a double-write single-side operation of remote direct data access RDMA, wherein the double-write address information includes first memory address information and second memory address information of the receiving end; Writing the target data into the first memory address corresponding to the first memory address information; and After writing the target data to the first memory address, a local memory copy operation is performed to copy the target data from the first memory address to a second memory address corresponding to the second memory address information, so as to achieve double writing of the target data.

8. The method according to claim 7, wherein: The receiving end network card device uses the remote direct data access RDMA double write single-side operation to send the target data and the double write address information corresponding to the target data, including: A dual write request is received from a network card device at a sending end, wherein the dual write request includes the target data, the first memory address information and the second memory address information, and the dual write request is a write request supported by the dual write unilateral operation.

9. The method according to claim 7, wherein: Performing a local memory copy operation to copy the target data from the first memory address to a second memory address corresponding to the second memory address information, thereby realizing double writing of the target data, includes: Performing a direct data access (DMA) operation according to the first memory address information and the second memory address information to copy the target data from the first memory address to the second memory address to achieve double writing of the target data; or A copy indication message is sent to the processor of the receiving end according to the first memory address information and the second memory address information, so that the processor copies the target data from the first memory address to the second memory address, and receives a completion notification message returned by the processor.

10. The method according to any one of claims 7 to 9, wherein: Also includes: After writing the target data into the first memory address, returning a confirmation message to the network card device at the sending end, so that the network card device at the sending end knows that the target data has been written into the first memory address; and / or After copying the target data from the first memory address to the second memory address, a specific notification message is returned to the network card device of the sending end, so that the network card device of the sending end reports the specific notification message to the first application of the sending end to send the target data; wherein the specific notification message is a notification message supported by the double-write unilateral operation and needs to be reported to the first application.

11. A network card device, wherein: The device is applied to a sending end, wherein the sending end runs a first application, and the network card device is implemented based on programmable hardware, including: An acquisition module, used to acquire target data of a first application and dual-write address information corresponding to the target data, wherein the dual-write address information includes first memory address information and second memory address information of a receiving end; A transmission module, used for using a double-write single-side operation of remote direct data access RDMA to send the target data, the first memory address information and the second memory address information to a network card device at a receiving end, so as to instruct the network card device at the receiving end to first write the target data into a first memory address corresponding to the first memory address information, and then perform a local memory copy operation to copy the target data from the first memory address to the second memory address information. The target data is written to the second memory address corresponding to the target information to realize double writing of the target data.

12. A network card device, wherein: Applied to the receiving end, the network card device is implemented based on programmable hardware, including: A receiving module, used for receiving target data and double-write address information corresponding to the target data sent by a network card device at a sending end using a double-write single-side operation of remote direct data access RDMA, wherein the double-write address information includes first memory address information and second memory address information of the receiving end; a writing module, configured to write the target data into a first memory address corresponding to the first memory address information; and A copy module is used to perform a local memory copy operation after writing the target data to the first memory address, so as to copy the target data from the first memory address to the second memory address corresponding to the second memory address information, so as to realize double writing of the target data.

13. A network card device, wherein: The network card device comprises: a storage unit and a processing unit, the storage unit is used to store a computer program, and the processing unit is coupled to the storage unit and is used to execute the computer program to implement the steps in the method of any one of claims 1-6 and claims 7-10.

14. An electronic device, wherein: include: A network card device as described in any one of claims 11 to 13.

15. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a processor or a network card unit, the processor or the network card unit is caused to implement the steps in the method according to any one of claims 1 to 6 and claims 7 to 10.

16. A computer program product, wherein: The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6 and claims 7 to 10.

Citation Information

Patent Citations

  • Remote direct memory access method, equipment and system

    CN105518611A

  • Data reading and writing method and device, equipment and medium

    CN115509435A

  • Data processing method and device

    CN115729444A

  • Memory cache pool maintenance method, device and system and storage medium

    CN116303128A

  • Data transmission method and device and storage medium

    CN117453582A

Cited By

  • Data transmission synchronization processing method and network card

    CN122470398A