Data transmission method, device, and storage medium
By introducing proxy modules and task management queues between network card devices and applications, combining bypass kernels and zero-copy technology, the delay problem caused by memory management interaction in RDMA technology is solved, and more efficient data transmission is achieved.
Patent Information
- Application Number
- PCT/IB2024/063267
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-15
- Filing Date
- 2024-12-30
- Publication Date
- 2025-07-24
AI Technical Summary
The existing RDMA technology has delay problems during data transmission, especially when frequent memory management interactions are required, resulting in reduced transmission efficiency.
A new direct memory access interface is adopted, and by introducing proxy modules between network card devices and applications, using task management queues and memory management queues, the bypass kernel and zero copy technology are realized, memory management interaction is reduced, and data transmission efficiency is improved.
On the basis of realizing direct memory access, the data transmission delay is further reduced, the data transmission efficiency is improved, and the memory management interactive operation is reduced.
Smart Images

Figure IB2024063267_24072025_PF_FP_ABST
Abstract
Description
[0001] TECHNICAL FIELD The present disclosure relates to the field of cloud computing technology, and more particularly to a data transmission method, device, and storage medium. Background: Remote Direct Memory Access (RDDMA) is a kernel-bypass and zero-copy network transmission technology that, compared to traditional Transmission Control Protocol / Internet Protocol (TCP / IP), can achieve lower transmission latency and lower CPU utilization. It has found increasing application in artificial intelligence (AI), high-performance computing (HPC), and other scenarios requiring high latency. However, when using RDMA for data transmission, latency issues still exist, which urgently need to be addressed. SUMMARY: Various aspects of the present disclosure provide a data transmission method, device, and storage medium to further reduce data transmission latency while achieving direct memory access. An embodiment of the present disclosure provides a data transmission method, which is applied to a first proxy module, where a first application is also running on a first electronic device where the first proxy module is located. The method includes: obtaining, based on a task management queue, a first request message sent by the first application, where the first request message is used to request first data from a second application on a second electronic device; sending the first request message to the second application via a first network card device on the first electronic device, and receiving first data returned by the second application based on the first request message; when available memory space in a first memory pool shared with the first application is insufficient, requesting the first application to apply for new available memory space for the first memory pool based on a memory management queue; and writing the first data into the newly added available memory space in the first memory pool so that the first application can read the first data.An embodiment of the present disclosure provides a data transmission method, which is applied to a first application, wherein a first agent module runs on a first electronic device on which the first application is located. The method comprises: issuing a first request message to the first agent module based on a task management queue, for the first agent module to send the message to a second application on a second electronic device via a first network card device on the first electronic device, so as to request first data from the second application; when available memory space in a first memory pool shared with the first agent module is insufficient, cooperating with the first agent module based on the memory management queue to apply for new available memory space for the first memory pool; and reading the first data from the first memory pool, wherein the first data is written by the first agent module into the newly added available memory space in the first memory pool after the second application returns the first data. Embodiments of the present disclosure provide a data transmission method, applied to a second proxy module, where a second application is also running on a second electronic device where the second proxy module resides. The method comprises: receiving, via a second network interface card device of the second electronic device, a first request message sent by a first application on a first electronic device, requesting first data from the second application; reporting the first request message to the second application based on a task management queue, so that the second application writes the first data to a second memory pool shared with the second proxy module in accordance with the first request message; reading the first data from the second memory pool and sending the first data to the first application via the second network interface card device. Embodiments of the present disclosure provide a data transmission method, applied to a first proxy module, where a first application is also running on the first electronic device where the first proxy module resides. The method comprises: obtaining, via a task management queue, a second request message sent by the first application, instructing the second application on the second electronic device to send second data, the second data being written by the first application to a first memory pool shared with the first application; reading the second data from the first memory pool in accordance with the second request message, and sending the second data to the second application via the first network interface card device.The present disclosure provides a data transmission method, applied to a first application, wherein a first agent module runs on a first electronic device where the first application resides. The method comprises: issuing a second request message to the first agent module based on a task management queue, wherein the second request message instructs the first agent module to send second data to a second application on a second electronic device; writing the second data to a first memory pool shared with the first agent module, so that the first agent module can read the second data and send the second data to the second application via a first network interface card device of the first electronic device. The present disclosure provides a data transmission method, applied to a second agent module, wherein a second application also runs on the second electronic device where the second agent module resides. The method comprises: receiving second data, via a second network interface card device of the second electronic device, wherein the second data is sent by the first application on the first electronic device; requesting the second application to apply for new available memory space in the second memory pool shared with the second application based on a memory management queue when available memory space is insufficient; and writing the second data to the newly available memory space in the second memory pool so that the second application can read the second data. Embodiments of the present disclosure also provide a computer program product, including a computer program / instructions. When executed by a processor, the computer program / instructions cause the processor to implement the steps of any of the methods provided in the above-described embodiments of the present disclosure. In embodiments of the present disclosure, during data transmission between two ends, both ends can, on the one hand, utilize bypass kernel and zero-copy technologies based on their respective task management queues to improve data transmission efficiency. On the other hand, both ends can proactively implement memory management for data storage based on their respective memory management queues, eliminating the need for memory management interaction with the other end. This reduces the number of interactive operations between the two ends during data transmission and, based on direct memory access, further reduces transmission latency. BRIEF DESCRIPTION OF THE DRAWINGS The drawings described herein are provided to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are provided to explain the present disclosure and are not intended to unduly limit the present disclosure.In the accompanying drawings: Figure 1 is a schematic diagram of the state of data transmission in which the RDMA bypass kernel is used; Figure 2 is a simple interactive diagram of RDMA write operations performed at both ends; Figure 3a is a schematic diagram of network communication based on a direct memory access interface provided in an embodiment of the present disclosure; Figure 3b is a protocol architecture diagram of an electronic device including a direct memory access interface provided in an embodiment of the present disclosure; Figure 4a is a schematic diagram of the interactive flow of a data transmission method provided in an embodiment of the present disclosure; Figure 4b is a schematic diagram of an interactive flow based on a task management queue and a memory management queue provided in an embodiment of the present disclosure; Figure 5a is a schematic diagram of the interactive flow of another data transmission method provided in an embodiment of the present disclosure; Figure 5b is another schematic diagram of an interactive flow based on a task management queue and a memory management queue provided in an embodiment of the present disclosure; Figure 6a is a schematic diagram of the flow of a data transmission method described from the perspective of a first agent module provided in an embodiment of the present disclosure; Figure 6b is a schematic diagram of the flow of a data transmission method described from the perspective of a first application provided in an embodiment of the present disclosure; Figure 6c is a schematic diagram of the flow of a data transmission method described from the perspective of a second agent module provided in an embodiment of the present disclosure; Figure 7a is a schematic diagram of the structure of a data transmission device provided in an embodiment of the present disclosure; Figure 7b is a schematic diagram of the structure of another data transmission device provided in an embodiment of the present disclosure; Figure 7c is a schematic diagram of the structure of yet another data transmission device provided in an embodiment of the present disclosure; Figure 8 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. To further clarify the objectives, technical solutions, and advantages of the present disclosure, 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 represent only a portion of the embodiments of the present disclosure, and are not exhaustive. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present disclosure without inventive effort are within the scope of protection of the present disclosure. 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, storage, and display) involved in the present disclosure are all authorized by the user or fully authorized by all parties. The collection, use, and processing of such data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or reject such data. Furthermore, the various models involved in the present disclosure (including but not limited to language models or large models) comply with relevant laws and standards.
[0002] RDMA is a high-speed, direct access technology for remote memory that utilizes a fully optimized network card device and software architecture. It utilizes a bypass kernel and zero-copy technology to achieve lower transmission latency than TCP / IP. As shown in Figure 1, this involves user-mode applications, including caches, kernel-mode operating systems, including caches, and traditional network cards in hardware. RDMA technology can be implemented at the protocol level in the following ways, for example, but not limited to:
[0003] InfiniBand Protocol: This RDMA technology, based on the InfiniBand architecture, was proposed by the IBTA (InfiniBand Trade Association) and is abbreviated as IB. Building an IB-based RDMA network requires dedicated IB network cards and switches. InfiniBand networks offer superior performance, but network cards and switches are relatively expensive. iWARP Protocol: The Internet Wide Area RDMA Protocol (IWARP) is an RDMA technology based on the Transmission Control Protocol / Internet Protocol (TCP / IP) and is 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 cards.
[0004] RoCE protocol: RDMA over Converged Ethernet (RDMA over Converged Ethernet), also proposed by IBTA, supports RDMA technology over standard Ethernet infrastructure. However, it requires switches supporting lossless Ethernet transmission and servers equipped with RoCE network interface cards (NICs). Its performance is comparable to IB. RDMA technologies using different protocols have different hardware implementations, specifically different physical and link layers. However, regardless of the protocol or hardware implementation, application development can use the same application programming interface (API). The RDMA API provided for application development is also known as the software transport interface (STI) between the application and the NIC, also known as the Verbs interface. In other words, developers can develop RDMA applications based on these Verbs interfaces. During runtime, RDMA applications can operate on the RDMA NIC using these STIs, allowing RDMA to bypass the kernel and directly access the RDMA application's user space. Examples of RDMA applications include video processing, instant messaging, e-commerce, and other applications implemented using STIs. There are two traditional verbs interfaces: memory verbs and messaging verbs. Based on these two verbs interfaces, RDMA provides two basic operations for applications: unilateral operations and bilateral operations.
[0005] Memory verbs: These include at least RDMA read and write operations. These operations are unilateral, meaning that only the local end needs 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 completed between the remote network card device and the application's buffer using Direct Memory Access (DMA) technology, without the remote application's awareness or participation.
[0006] RDMA Read: The local application uses RDMA technology to read a portion of memory data from the remote client. Before executing an RDMA read operation, the remote client must grant the local client the appropriate permissions to access the remote client's memory. Once permissions are set, the RDMA read operation can be performed without notifying the remote client. The local application specifies a virtual address on the remote client. The local network card then uses RDMA technology to read data directly from the remote client's memory, just as if it were reading data from local memory. Without the remote application's knowledge, the local application can read the data directly from the specified virtual address.
[0007] RDMA Write: The local application uses RDMA technology to write data to the remote memory. Before executing the RDMA write operation, the remote end must provide the local end with appropriate permissions to access the remote memory. Once the permissions are set, the RDMA write operation can be performed without notifying the remote end. The local application specifies a virtual address on the remote end. The local network card then uses RDMA technology to write data to the remote memory directly at the specified virtual address, just like writing data to local memory, without the remote application being aware of the data.
[0008] Messaging verbs: Includes RDMA send (Send) operations and RDMA receive (Receive) operations. These operations are bilateral operations, that is, data sending and receiving operations that require the remote application to perceive and participate in order to complete.
[0009] RDMA Send: This is the process of sending data from local memory to remote memory using RDMA technology. Specifically, the local application places a Work Queue Element (WQE), representing a send task, into the send queue (SQ) of a queue pair (QP). Similarly, the remote application sends a WQE, representing a receive task, to the remote QP's receive queue (RQ). This ensures the RDMA network card knows where to store the received data in memory. The local RDMA network card then retrieves the send task from the SQ, retrieves the data from local memory based on the send task, and transmits it over the network to the remote RDMA network card. The remote RDMA network card receives the data, verifies it, and sends an acknowledgment (ACK) to the sender. It then places the data in the specified location in the WQE (Work 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.
[0010] RDMA Receive: This is the process of receiving data from remote memory into local memory using RDMA technology. Specifically, the remote application sends a WQE (Warning Query Entity) representing a send task to the gateway device (i.e., the RDMA network card) and places it into the remote QP's SQ. The local application places the WQE representing a receive task into the QP's RQ. This allows the RDMA network card to know where to place the received data in memory. The remote RDMA network card then retrieves the send task from the SQ, retrieves the data from the remote memory based on the send task, and transmits it to the local RDMA network card over the network. The local RDMA network card receives the data, verifies it, and sends an acknowledgment (ACK) to the remote end. It then places the data into the location specified in the WQE, generates a CQE for the receive task, and places it into the CQ. The local application then receives the task completion message. After receiving the ACK, the remote end also generates a CQE for the send task and places it into the CQ. The remote application then receives the task completion message. The entire process requires the awareness and participation of both the local and remote applications. Whether it's a unilateral or bilateral RDMA operation, a data transfer requires multiple network operations to complete. Taking an RDMA Write operation as an example, as shown in Figure 2, during an RDMA Write operation, the local end notifies the remote end of the address and size of the data to be written. The remote end then uses the Memory Registration (MR) mechanism to register sufficient memory space. The remote end then returns the local key for the registered memory space to the local end, effectively granting the local end access to the memory space. Next, the local end writes the data into the registered memory space using the local key. Both parties engage in memory negotiation. After receiving the data, the remote end returns data transfer status information to the local end. Throughout this process, the local end needs to interact with the remote end to manage its memory space. For uncertain data transfer sizes or complex communication scenarios, multiple interactions with the remote end may be required to update memory usage, resulting in data transfer delays. To address the data transmission latency issues of RDMA technology, a new direct memory access solution is provided in the embodiments of the present disclosure. Similar to RDMA technology, this direct memory access solution also uses a bypass kernel and zero-copy data transmission technology, but is different from RDMA technology.The direct memory access solution provided by the embodiments of the present disclosure is a direct memory access solution in which the data receiving end actively implements memory management during data transmission without the involvement of the data sending end. Since the memory management of the data receiving end does not require the participation of the data sending end, the interactive operations for memory management between the two ends during data transmission can be reduced. Furthermore, based on the implementation of direct memory access, transmission latency can be further reduced. The direct memory access solution provided by the embodiments of the present disclosure can be implemented as a direct memory access interface. This direct memory access interface is implemented between the network card device and the application. The network card device and the application communicate through this direct memory access interface, allowing the network card device to directly access the application's memory space, bypassing the kernel. As shown in Figure 3a, the first application directly accesses the memory access interface to the first network card device and the first proxy module; then, the first network card device and the first proxy module access the memory access to the second network card device and the second proxy module; and finally, the direct memory access interface to the second application. Furthermore, FIG. 3b illustrates a protocol model architecture diagram for an electronic device provided by an embodiment of the present disclosure. This architecture diagram, from bottom to top, includes the hardware layer (using a network card device as an example), the transport link layer, the direct memory access interface provided by the embodiment of the present disclosure, the runtime library API, and applications written in high-level programming languages. In the embodiments of the present disclosure, the data transmission technology employed by the transport link layer is not limited; any data transmission technology that supports a direct memory access interface between a network card device and an application on the electronic device where the network card device resides is applicable to the embodiments of the present disclosure. For example, these technologies may include shared memory (shmem), virtual memory (virtio-mem), or a virtual bus interface (virtio-pci), as long as they support the establishment of a direct memory access interface. In terms of functional implementation, the direct memory access interface provided in the embodiments of this disclosure primarily involves memory access logic between applications and network interface cards (NICs). To this end, a memory access agent module is provided for the NIC device. This agent module is deployed on the electronic device where the NIC device resides. It collaborates with applications running on the electronic device to implement direct memory access (i.e., directly access the application's memory space while bypassing the kernel) during data transmission with peer applications and proactively manages memory space. The agent module acts as a proxy for the NIC device, implementing direct memory access operations on its behalf. The operations of the agent module described in the following embodiments of this disclosure can also be understood as operations of the NIC device.In the embodiments of the present disclosure, an "application" refers to an application program capable of cooperating with the proxy module provided in the embodiments of the present disclosure to implement the corresponding functions of the direct memory access interface described above. This can be all or part of the applications on the electronic device. From a functional perspective, the "application" in the embodiments of the present disclosure may include, but is not limited to, video processing applications, instant messaging applications, e-commerce applications, database clients, reading applications, and other applications with remote data transmission requirements. From a program development perspective, the "application" in the embodiments of the present disclosure may be an application program developed by directly calling a system interface to implement the direct memory access solution provided in the embodiments of the present disclosure, or an application developed by pre-implementing the functions involved in the direct memory access interface as library functions in a runtime library and then calling these library functions. As shown in Figure 3b, the network between the first network card device + the first proxy module and the application may include a memory pool, a memory allocation queue, a task request queue, a task response queue, and a memory request queue to implement new memory requests. A runtime library is a standard library provided by the compiler, offering reusable functional code (e.g., functions and classes) for application developers' convenience. This means that during application development, application developers can directly reference existing functional code in the runtime library without having to develop their own, which improves application development efficiency. A runtime library that supports direct memory access can be either a dynamic link library or a static link library, which is not limited in this embodiment. Taking a first application as an example, when a static link library is used, during the development of the first application, the library functions used in the first application's source files are merged with the application's code files to generate a standalone executable file. When a dynamic link library is used, only a small amount of information, such as the address of the dynamic link library, is recorded in the first application's executable file during development. When the first application's executable file is executed, the library functions in the dynamic link library are dynamically loaded when they are called. In this embodiment, the deployment implementation of the proxy module and application is not limited. For example, the proxy module and the application on the electronic device are deployed in the same virtualization instance on the electronic device; or, the proxy module and the application on the electronic device are deployed in different virtualization instances on the electronic device; or, the proxy module is deployed in a virtualization manager on the electronic device, and the application on the electronic device is deployed in the virtualization instance; or, the proxy module is deployed on the network card device, and the application on the electronic device is deployed in the virtualization instance.In the above example, a virtualization manager runs on the electronic device. The virtualization manager is responsible for creating and maintaining virtualization instances, which provide independent operating environments for hosting various applications. The virtualization manager can be a virtual machine monitor (VMM), also known as a hypervisor. o A virtualized instance can be a cloud host, Elastic Compute Service (ECS), virtual machine (VM), or container, among others. It should be noted that the examples above all illustrate applications deployed in virtualized instances on electronic devices, but this is not limiting. For example, the application can also run directly on the electronic device. Regardless of the deployment method, the process by which the application and the proxy module cooperate to implement direct memory access and proactively manage memory space during data transmission is the same or similar. Specifically, the application and the proxy module cooperate to implement direct memory access and proactively manage memory space during data transmission, primarily involving the following operations:
[0011] (1) Memory Pool Application: When a first application on a first electronic device needs to communicate with a second application on a second electronic device, the first application and the second application apply in advance to the operating system of their respective electronic devices for a memory pool for this data transfer. The memory pool includes available memory resources, such as one or more memory pages. Memory pool application here refers to the process by which applications on electronic devices that need to communicate apply to the operating system for a memory pool.
[0012] (2) Memory pool sharing: When the first application or the second application applies for a memory pool, it provides the information of the memory pool to the proxy module on the electronic device where it is located. The proxy module is responsible for maintaining the memory pool and allocating required memory resources from the memory pool. For example, when receiving data sent by the other end, it can allocate memory resources from the memory pool to store the received data. Memory pool sharing here means that the application and the proxy module on the same electronic device share the memory space in the memory pool. The memory space in the memory pool is visible to each other and can be accessed by both parties. In the embodiments of the present disclosure, the implementation method of implementing memory space sharing in the memory pool between the application and the proxy module on the same electronic device is not limited. The specific implementation method is related to the deployment method of the application and the proxy module. The following describes this in different cases: Case 1: The application and the proxy module are deployed in the same virtualization instance (such as a VM) on the electronic device. In this case, the application requests one or more blocks of memory space from the operating system of its VM (i.e., the guest operating system) to form a memory pool. The memory space in the memory pool has address information in the guest's physical address space. For ease of description and distinction, the address information of the pre-requested memory space in the guest's physical address space is referred to as fourth address information. Since the application and the proxy module are deployed in the same VM and belong to different processes within the same VM, the application can provide the fourth address information of the memory space in the memory pool to the proxy module through an inter-process communication mechanism. The proxy module receives the fourth address information of the memory space in the guest's physical address space provided by the application and maintains the fourth address information. Based on the fourth address information, the proxy module accesses the memory space in the memory pool, sharing the memory space in the memory pool with the application. This memory sharing method is also known as inter-process shared memory (shmem). Case 2: The application is deployed in a virtualization instance (e.g., a VM) on the electronic device, and the proxy module is deployed in the virtualization manager (e.g., a hypervisor) on the electronic device, which is responsible for creating and managing the virtualization instance. In this case, the application applies for one or more blocks of memory space from the operating system of the VM to which it belongs (i.e., the client operating system) to form a memory pool. The memory space in the memory pool has address information in the client's physical address space. For the convenience of description and distinction, the address information of the memory space in the pre-applied memory pool in the client's physical address space is called the fourth address information.Because the application is deployed in a VM and the proxy module is deployed in a hypervisor, they reside in different layers and have different address spaces. Therefore, the application and the proxy module see different address information for the same physical memory space. Therefore, if the application successfully requests a memory pool from the guest operating system, the guest operating system can provide the fourth address information of the memory space in the client's physical address space to the virtualization manager. The virtualization manager translates the fourth address information into intermediate address information in the virtualization manager's address space. This intermediate address information is then translated into fifth address information in the proxy module's address space and provided to the proxy module. The proxy module receives the fifth address information of the memory space in the memory pool provided by the virtualization manager and maintains a mapping between the fifth address information and the fourth address information. Based on this mapping, the proxy module accesses the memory space in the memory pool and shares the memory space in the memory pool with the application. This memory sharing method is also known as the virtual memory (virtio-mem) method. The process of the proxy module accessing the memory space in the memory pool based on the mapping relationship includes the following: when an application writes data to the memory pool for the proxy module to read, the proxy module may query the mapping relationship based on address information provided by the application, convert the address information provided by the application (i.e., address information in the client's physical address space) into address information in the address space where the proxy module is located (i.e., address information recognized by the proxy module), and then read the data written by the application from the corresponding memory space based on the converted address information; accordingly, when the proxy module writes data to the memory pool for the application to read, the proxy module may first query the mapping relationship, convert the address information in the address space where the written data is located (i.e., address information in the address space where the proxy module is located) into address information recognizable by the application (i.e., address information in the client's physical address space), and provide the recognizable address information to the application so that the application can read the data from the corresponding memory space. Scenario 3: The application is deployed in a virtualized instance (e.g., a VM) on an electronic device, and the proxy module is deployed on a network interface card (e.g., a SmartNIC) on the electronic device. The electronic device also hosts a virtualization manager (e.g., a hypervisor) responsible for creating and managing virtualized instances. In this scenario, the application requests one or more blocks of memory space from the operating system of its VM (i.e., the client operating system) to form a memory pool. The memory space in the memory pool has address information in the client's physical address space. For ease of description and distinction, the address information of the pre-requested memory space in the memory pool in the client's physical address space is referred to as fourth address information.Because the application is deployed in a VM and the proxy module is deployed on a network card, they are located at different levels and have different address spaces. Therefore, the application and the proxy module see different address information for the same physical memory space. Therefore, if the application successfully requests a memory pool from the guest operating system, the guest operating system can provide the virtualization manager with the fourth address information of the memory space in the client's physical address space requested by the application. Since the proxy module is deployed on the network card, the virtualization manager can treat the proxy module as a host peripheral and use the virtual bus interface (Virtio-PCI) to virtualize the proxy module into a PCI device of the VM. The virtualization manager then directly converts the fourth address information into the sixth address information in the host's physical address space and provides the sixth address information to the proxy module. The proxy module receives the sixth address information of the memory space in the memory pool provided by the virtualization manager and maintains a mapping between the sixth address information and the fourth address information. Based on this mapping, the proxy module accesses the memory space in the memory pool, sharing the memory space with the application. This memory sharing method is also known as the virtual bus interface (Virtio-PCI) method. The process of the proxy module accessing the memory space in the memory pool based on the mapping relationship includes the following: when an application writes data to the memory pool for the proxy module to read, the proxy module may query the mapping relationship based on address information provided by the application, convert the address information provided by the application (i.e., address information in the client's physical address space) into address information in the address space where the proxy module is located (i.e., address information in the host's physical address space), and then read the data written by the application from the corresponding memory space based on the converted address information; accordingly, when the proxy module writes data to the memory pool for the application to read, it may first query the mapping relationship, convert the address information in the address space where the written data is located (i.e., address information in the host's physical address space) into address information recognizable to the application (i.e., address information in the client's physical address space), and provide the recognizable address information to the application so that the application can read the data from the corresponding memory space.
[0013] (3) Active memory management: When allocating memory resources from the memory pool, if the proxy module cannot allocate sufficient memory resources, it can proactively request an increase in the memory pool through the application on the electronic device where it is located, so that sufficient memory resources can be allocated from it. Active memory management here refers to the process in which the proxy module proactively requests an increase in the memory pool through the application on the electronic device where it is located when it cannot allocate sufficient memory resources from the memory pool.
[0014] (4) Direct memory access channel: This refers to a channel for direct interaction between the application and the proxy module. Through this direct memory access channel, the application and the proxy module can interact directly without going through the kernel. In the embodiment of the present disclosure, the direct memory access channel can be implemented in the form of a queue pair (QP). The queue pair includes at least two types of queues, namely, a task management queue and a memory management queue. The task management queue is a channel for the application and the proxy module to interact with each other across the kernel for data transmission tasks. The memory management queue is an interaction channel required for the application and the proxy module to actively implement memory management. Further, as shown in FIG3b, the task management queue includes two queues: a task request queue and a task response queue. The Request queue is used to carry various task requests issued by the application to the proxy module, including but not limited to requests to send data to a peer, retrieve data from a peer, and instruct a peer to delete data. The proxy module retrieves the task requests from the Request queue and, based on the task requests, performs corresponding data transmission operations through the network card device, such as sending data to a peer, retrieving data from a peer, or instructing a peer to delete data. The Response queue and the Request queue form a pair, carrying response messages corresponding to task requests reported by the proxy module to the application. Furthermore, as shown in Figure 3b, the memory management queue includes two queues: a memory allocation (Memalloc) queue and a memory request (Memreq) queue. The Memalloc and Memreq queues work together to assist the application and the proxy module in proactively implementing memory management. The Memalloc queue is responsible for memory allocation, specifically carrying the address information of the memory pool requested by the application, enabling memory pool sharing with the proxy module. The Memreq queue is used to carry memory allocation requests or responses to memory allocations. The memory allocation request can be initiated by the user or by the proxy module; the response to the memory allocation is issued by the proxy module. In the disclosed embodiment, the aforementioned queues can be considered as first-in, first-out (FIFO) queues. Furthermore, these queues are optionally located at fixed memory locations in the memory pool. These memory locations are known to the application and the proxy module, and can be negotiated and determined by both. Both can then read the request or response messages in the queues from the corresponding memory locations.For any queue, there are two message roles: message consumers and message producers. The party that writes messages (e.g., request messages or response messages) to a queue is called a message producer, and the party that reads messages (e.g., request messages or response messages) from a queue is called a message consumer. If an application writes a message to a queue, the application is the message producer for that queue, and the proxy module is the message consumer for that queue. Conversely, if a proxy module writes a message to a queue, the proxy module is the message producer for that queue, and the application is the message consumer for that queue. Optionally, to facilitate message consumers identifying the validity of messages in a queue, each message can carry a flag indicating whether the message is valid. When a message producer writes a message to a queue, it can add a valid flag to the message. For example, the last bit of the message can be used as a flag. If the flag is 1, it indicates that the message is valid. Message consumers can periodically poll or read messages from the queue based on interrupt messages. When reading a message, they can check whether the message flag is valid, thereby determining whether the message is the latest message written and has not yet been processed. For example, if the last bit of the message is 1, the message is considered newly written and read for processing. After processing the message, the flag of the message in the queue is set to an invalid value, for example, the value of the last bit is set from 1 to 0o. Furthermore, after the message consumer reads the message, if the message also instructs the message consumer to process data in the memory pool (for example, the message contains the address information of a memory space in the memory pool), the message consumer can read the data from the corresponding memory space in the memory pool based on the address information and perform the corresponding processing on the data. If the message consumer is a proxy module, the proxy module can access the memory space in the memory pool using any of the three aforementioned methods, depending on the deployment scenario. In particular, in methods 2 and 3, the proxy module can access the memory space in the memory pool based on the maintained address mapping relationship. In the disclosed embodiments, the method by which the message consumer reads messages from each queue is not limited. For example, regardless of the deployment method of the message consumer and message producer, a method of periodically polling each queue can be employed. When a new message is detected in a queue, the newly written message is read from the queue. Furthermore, optionally, when the message consumer and message producer are deployed using the deployment methods shown in methods 2 or 3, the message consumer can also read messages from the corresponding queue based on an interrupt message generated by the virtualization manager when the message producer writes a message to the queue.If an application writes a corresponding message to a task request queue or a memory allocation queue, the client operating system can issue an interrupt request to the virtualization manager. The virtualization manager then sends an interrupt message to the proxy module, which then reads the corresponding message written by the application from the task request queue or the memory allocation queue based on the interrupt message. If the proxy module is deployed in the virtualization manager, this interrupt is in soft interrupt mode; if the proxy module is deployed on the network card, this interrupt is a hardware interrupt. After successfully applying for a memory pool and creating each queue, data can be transmitted between the two ends based on the memory pool and each queue. During data transmission, both ends can utilize kernel bypass and zero-copy technologies based on their respective task management queues to improve data transmission efficiency. Furthermore, both ends can proactively implement memory management for data storage based on their respective memory management queues, eliminating the need for memory management interaction with the other end. This reduces the number of interactions between the two ends during data transmission and, while enabling direct memory access, further reduces transmission latency. The following describes the data transmission process based on the direct memory access interface provided by the present disclosure in the following embodiments, with reference to Figures 4a-5b. In the following embodiments, communication between a first application on a first electronic device and a second application on a second electronic device is used as an example. The first electronic device includes a first network card device, and a first proxy module corresponding to the first network card device is running on the first electronic device; the second electronic device includes a second network card device, and a second proxy module corresponding to the second network card device is running on the second electronic device. In the embodiments of the present disclosure, the device form of the first or second electronic device is not limited; for example, it can be a mobile phone, laptop computer, tablet computer, desktop computer, smart bracelet, or various terminal devices, or a traditional server, cloud server, server cluster, or various server devices. Accordingly, in the embodiments of the present disclosure, the implementation form of the first or second network card device is not limited; for example, it can be a chip or module such as a Cloud Infrastructure Processing Unit (CIPU) integrated with a network card module, a Smart NIC (Smart NIC), a Network Interface Card (NIC), a Data Processing Unit (DPU), or an Infrastructure Processing Unit (IPU). Figure 4a is a schematic diagram of the interaction flow of a data transmission method provided in the embodiments of the present disclosure.This method is used to describe a process in which a first application requests data A from a second application. Data A may also be referred to as first data. As shown in FIG4a , the method includes:
[0015] 41. A first application sends a first request message to a first proxy module based on a task management queue. Accordingly, the first proxy module receives the first request message sent by the first application based on the task management queue. The first request message is used to request data A from a second application. Depending on the application scenario, the method by which the first application requests data A from the second application and the specific implementation of data A may vary. In some application scenarios, the second application is implemented as a data source, and the first application, as a client, can request resource data from the second application. For example, the second application is a video server and the first application is a video player. When the video player needs to play a video, it can request video data from the video server. Video data is an example of data A. In other application scenarios, the second application is implemented as a data processing application. The first application, as a client, can request the second application to provide data processing services and return the data processing results. For example, the second application is a photo editing application and the first application is a live broadcast application. During a live broadcast, the live broadcast application requests the photo editing application to edit the original image and return the edited image. The edited image is an example of data A. In an optional embodiment, the task management queue on the first electronic device includes a first task request queue and a first task response queue, as shown in FIG4b. Based on the first task request queue and the first task response queue, in step 41, the first application sends a first request message to the first agent module based on the task management queue, including:
[0016] 411. A first application writes a first request message to a first task request queue; accordingly, the first agent module reads the first request message from the first task request queue. Further, optionally, the first application writes the first request message to the first task request queue, and the first request message carries a valid flag, allowing the first agent module to determine that the first request message is a newly written message based on the valid flag. Further, optionally, the first agent module periodically polls the first task request queue to retrieve the first request message written by the first application from the first task request queue. Alternatively, when the first application is deployed in a virtualized instance and the first agent module is deployed in a virtualization manager or on a first network interface card (NIC), after the first application writes the first request message to the first task request queue, the NIC triggers an interrupt message to the first agent module via the NIC. Based on the interrupt message, the first agent module retrieves the first request message written by the first application from the first task request queue. 42. The first agent module sends the first request message to a second NIC device on a second electronic device via the first NIC device; accordingly, the second NIC device receives the first request message sent by the first NIC device and provides it to the second agent module.
[0017] 43. The second agent module reports the first request message to the second application based on the task management queue. Accordingly, the second application receives the first request message reported by the second agent module based on the task management queue. In an optional embodiment, the task management queue on the second electronic device includes a second task request queue and a second task response queue, as shown in FIG4b. Based on the second task request queue and the second task response queue, in step 43, the second agent module reports the first request message to the second application based on the task management queue, including:
[0018] 431. The second agent module writes the first request message to the second task request queue. Accordingly, the second application reads the first request message from the second task request queue. Further, optionally, the second application periodically polls the second task request queue to obtain the first request message from the second task request queue. Alternatively, when the second application is deployed in a virtualized instance and the second agent module is deployed in a virtualization manager or on a second network interface card device, the second agent module writes the first request message to the second task request queue and then triggers an interrupt message to the second application via the virtualization manager. The second application then obtains the first request message from the second task request queue based on the interrupt message.
[0019] 44. The second application obtains data A based on the first request message and writes data A into a second memory pool. The second memory pool is a memory pool requested by the second application from the operating system of the second electronic device for communication with the first application. This description does not limit the manner in which the second application obtains data A based on the first request message. Data A may be generated based on the first request message, obtained from pre-stored data based on the first request data, or obtained by processing existing data based on the first request data, etc. In an optional embodiment, based on the second task request queue and the second task response queue, as shown in FIG4a , the following steps may be performed between steps 44 and 45:
[0020] 441. The second application writes a first notification message to the second task response queue to notify the second agent module to read data A from the second memory pool. Accordingly, the second agent module reads the first notification message written by the second application from the second task response queue, and then executes step 45 according to the first notification message.
[0021] 45. The second agent module reads data A from the second memory pool and sends data A to the first network card device via the second network card device. Accordingly, the first network card device receives data A sent by the second network card device and provides it to the first agent module. The first notification message includes address information ddrl of data A in the second memory pool. This address information ddrl is address information in the client's physical address space. The second agent module can obtain address information ddrl from the first notification message, convert address information ddrl into recognizable address information ddr2, and read data A from the corresponding memory space in the memory pool based on address information ddr2. Furthermore, optionally, if the second agent module and the second application are deployed in the same virtualization instance on the second electronic device, address information ddr2 and address information ddrl both belong to address information in the client's physical address space. The second agent module and the second application are two processes in the same virtualization instance, and address information ddr2 and address information ddrl are virtual addresses maintained by the two processes, respectively. Further optionally, if the second application is deployed in a virtualization instance and the second agent module is deployed in a virtualization manager, the second agent module may convert the address information ddr1 into address information ddr2 based on a pre-maintained mapping relationship between address information of each memory space in the memory pool in the client's physical address space and address information of each memory space in the memory pool in the address space where the second agent module is located, that is, the mapping relationship between the fourth address information and the fifth address information described in the aforementioned embodiment. The second agent module may then read data A from the corresponding memory space in the memory pool based on the address information ddr2. The address information ddr2 is the address information in the address space where the second agent module is located. Further optionally, if the second application is deployed in a virtualized instance and the second agent module is deployed in a second network card device, the second agent module may convert the address information ddr1 into address information ddr2 based on a pre-maintained mapping relationship between address information of each memory space in the memory pool in the client's physical address space and address information of each memory space in the memory pool in the host's physical address space, that is, the mapping relationship between the fourth address information and the sixth address information described in the aforementioned embodiment, and then read data A from the corresponding memory space in the memory pool based on the address information ddr2. The address information ddr2 is address information in the host's physical address space.
[0022] 46. The first agent module allocates memory space for data A from the first memory pool. When the available memory space in the first memory pool is insufficient, the first agent module requests the first application to apply for new available memory space for the first memory pool based on the memory management queue. Accordingly, the first application cooperates with the first agent module to apply for new available memory space for the first memory pool based on the memory management queue. The first memory pool is a memory pool that the first application requests from the client operating system of the first electronic device for communication with the second application. The memory space in the first memory pool is limited. When the first agent module receives data A, it may attempt to allocate the memory space required to store data A from the first memory pool. If the available memory space in the first memory pool is less than the memory space required to store data A, it is considered that the available memory space in the first memory pool is insufficient. In this case, the first application may be requested to apply for new available memory space for the first memory pool based on the memory management queue. In an optional embodiment, the memory management queue on the first electronic device includes a first memory request queue and a first memory allocation queue, as shown in FIG. 4b. Based on the first memory request queue and the first memory allocation queue, in step 46, the first agent module requests the first application to apply for a new first memory space for the first memory pool based on the memory management queue, including:
[0023] 461. The first agent module writes a first memory allocation request to the first memory request queue to request the first application to apply for new available memory space for the first memory pool. Accordingly, the first application retrieves the first memory allocation request written by the first agent module from the first memory request queue. The process of the first agent module writing the first memory allocation request to the first memory request queue and the first application retrieving the first memory allocation request from the first memory request queue is the same or similar to the corresponding descriptions in steps 411 and 431 above and is not further described here.
[0024] 462. The first application requests new available memory space from its client operating system based on the first memory allocation request. Specifically, the first application may send a memory request instruction, such as a mem alloc instruction, to its client operating system. The client operating system allocates new available memory space to the first application based on the memory request instruction, thereby expanding the first memory pool. Here, mem alloc is a function used to allocate memory space and is an example of a memory request instruction. Memory request instructions may vary depending on the client operating system and are not limited thereto. 463. The first application provides target address information corresponding to the new available memory space to the first proxy module through a first memory allocation queue, so that the first proxy module can use the new available memory space to implement memory allocation. Accordingly, the first proxy module obtains the target address information corresponding to the new available memory space based on the first memory allocation queue. The target address information is address information recognizable by the first proxy module. Optionally, when the first application and the first agent module are deployed in the same virtualization instance on the first electronic device, the first application writes a shared memory handle to the first memory allocation queue. The shared memory handle represents first address information of the newly available memory space in the client's physical address space. Accordingly, the first agent module retrieves the shared memory handle written by the first application from the first memory allocation queue and determines, based on the shared memory handle, the first address information of the newly available memory space in the client's physical address space as the target address information. Alternatively, when the first application is deployed in the virtualization instance on the first electronic device and the first agent module is deployed in a virtualization manager responsible for managing the virtualization instance on the first electronic device, the first application writes the first address information to the first memory allocation queue. Accordingly, the first agent module retrieves the first address information written by the first application from the first memory allocation queue and requests address translation from the virtualization manager based on the first address information to obtain second address information corresponding to the first address information in the address space where the first agent module resides as the target address information.Alternatively, in a virtualized instance in which a first application is deployed on a first electronic device and a first agent module is deployed on a first network interface card device, the first application writes third address information of the newly available memory space in the host's physical address space into the first memory allocation queue. The third address information is obtained by the virtualization manager performing address translation from the client's physical address space to the host's physical address space. Accordingly, the first agent module obtains the third address information of the newly available memory space written by the first application in the host's physical address space from the first memory allocation queue as target address information. It is noted that, upon obtaining the target address information, the first agent module maintains a mapping relationship between the first address information corresponding to the newly available memory space and the target address information, and updates the mapping relationship to the address mapping relationship corresponding to each memory space in the memory pool.
[0025] 47. The first proxy module writes data A into the first memory pool. Specifically, if the available memory space in the first memory pool is insufficient and new available memory space has been requested, the first proxy module may write data A into the newly added available memory space in the first memory pool. Alternatively, if the available memory space in the first memory pool is equal to or greater than the memory space required to store data A (i.e., sufficient), the first proxy module may directly write data A into the available memory space in the first memory pool. The first proxy module records the address information ddr4 of data A in the first memory pool. This address information ddr4 is address information that the first proxy module can recognize. Furthermore, optionally, based on the first task request queue and the first task response queue, as shown in FIG. 4a , the following steps may be performed between steps 47 and 48:
[0026] At 471, the first agent module writes a first response message to the first task response queue. The first response message is used to notify the first application to read data A from the first memory pool. Accordingly, the first application reads the first response message written by the first agent module from the first task response queue, and then executes step 48. The process of the first agent module writing the first response message to the first task response queue and the first application reading the first response message from the first task response queue is the same or similar to the corresponding descriptions in steps 411 and 431 above and is not further described here.
[0027] 48. A first application reads data A from a first memory pool. After reading data A, the first application may perform corresponding processing on data A. The first response message includes address information ddr3 of data A in the first memory pool. Address information ddr3 is address information recognizable by the first application and is address information in the client's physical address control. Based on this, the first application may read data A from the first memory pool based on address information ddr3. Address information ddr3 is generated by the first agent module based on address information ddr4 and written into the first response message. Optionally, if the first agent module and the first application are deployed in the same virtualization instance on the first electronic device, address information ddr3 and address information ddr4 both belong to address information in the client's physical address space. The first agent module and the first application are two processes in the same virtualization instance. Address information ddr3 and address information ddr4 are virtual addresses maintained by the two processes, respectively. Address information ddr4 may be converted into address information ddr3. Alternatively, optionally, if the first application is deployed in a virtualization instance and the first proxy module is deployed in a virtualization manager, the first proxy module may convert the address information ddr4 into address information ddr3 based on a pre-maintained mapping relationship between address information of each memory space in the memory pool in the client's physical address space and address information of each memory space in the memory pool in the address space where the first proxy module is located, that is, the mapping relationship between the fourth address information and the fifth address information or the mapping relationship between the first address information and the target address information described in the aforementioned embodiment, and further write the address information ddr3 into a first response message to provide to the first application, so that the first application can read data A from the first memory pool. Alternatively, optionally, if the first application is deployed in a virtualized instance and the first proxy module is deployed in the first network card device, the first proxy module may convert the address information ddr4 into address information ddr3 based on a pre-maintained mapping relationship between address information of each memory space in the client's physical address space and address information of each memory space in the memory pool in the host's physical address space, that is, the mapping relationship between the fourth address information and the sixth address information or the mapping relationship between the first address information and the target address information described in the aforementioned embodiment, and then write the address information ddr3 into the first response message and provide it to the first application, so that the first application can read data Ao from the first memory pool. In an optional embodiment, the memory management queue on the second electronic device includes a second memory request queue and a second memory allocation queue, as shown in Figure 4b.Based on the second memory request queue and the second memory allocation queue, the second application and the second proxy module can also proactively implement memory management. For example, when the second application writes data A to the second memory pool, the memory space required for data A can be allocated from the second memory pool. If the available memory space in the second memory pool is less than the memory space required to store data A, then the available memory space in the second memory pool is insufficient. In this case, the second application can proactively request new available memory space from the operating system of the second electronic device. After requesting the new available memory space, the second application writes the address information of the new available memory space to the second memory allocation queue for provision to the second proxy module. The second proxy module retrieves the address information of the new available memory space written by the second application from the second memory allocation queue and uses the expanded second memory pool accordingly. The second application also writes data A to the newly added available memory space in the second memory pool. Furthermore, the method of this embodiment further optionally includes: upon determining that communication with the second application is required, the first application requests the first memory pool from the operating system of the first electronic device; and writes the address information of the first memory pool to the first memory allocation queue for provision to the first proxy module. Optionally, after obtaining the address information of the first memory pool from the first memory allocation queue, the first agent module may write a response message to the first memory request queue to inform the first application that it has obtained the address information of the first memory pool, thereby enabling sharing of the first memory pool between the first and second applications. Similarly, when the second application determines that it needs to communicate with the first application, the second application requests a second memory pool from the operating system of the second electronic device and writes the address information of the second memory pool into the second memory allocation queue to provide it to the second agent module. Optionally, after obtaining the address information of the second memory pool from the second memory allocation queue, the second agent module may write a response message to the second memory request queue to inform the second application that it has obtained the address information of the second memory pool, thereby enabling sharing of the second memory pool between the first and second applications. It is noted that in the following embodiments, the process of writing and reading relevant information to and from the task request queue and the task response queue, as well as the content related to writing and reading data from the memory pool, regardless of which application or agent module, will not be described in detail. For details, reference is made to the corresponding descriptions in the preceding embodiments. Based on the descriptions in the preceding embodiments, those skilled in the art can directly implement or easily infer the specific implementation methods.In the embodiments shown in Figures 4a and 4b, the first application is described as requesting data A from the second application without carrying any other data payload. However, this is not limiting. For example, when the first application requests data A from the second application, the first application may also send data B to the second application, allowing the second application to obtain data A based on data B, or for the second application to process data B. The process of the first application requesting data A from the second application and simultaneously sending data B to the second application includes the following:
[0028] 51. The first application writes a first request message to the first task request queue; accordingly, the first proxy module reads the first request message from the first task request queue. The first request message is used to request data A from the second application, and corresponds to the data payload to be sent, recorded as data B.
[0029] 52. The first application writes data B into the first memory pool; accordingly, the first agent module reads data B from the first memory pool.
[0030] 53. The first proxy module sends the first request message and data B to the second network card device on the second electronic device via the first network card device. Correspondingly, the second network card device receives the first request message and data B sent by the first network card device and provides them to the second proxy module. It should be noted that the first request message and data B can be sent in the same process or in two separate processes, and this is not limited to this. Furthermore, when the first request message and data B are sent in two separate processes, the order in which they are sent is not limited.
[0031] 54. The second proxy module writes the first request message into the second task request queue. Correspondingly, the second application reads the first request message from the second task request queue.
[0032] 55. The second agent module writes data B into the second memory pool. Specifically, when the available memory space in the second memory pool is greater than or equal to the memory space required to store data B, data B is directly written into the available memory space in the second memory pool. When the available memory space in the second memory pool is less than the memory space required to store data B, the second application is requested to apply for new available memory space for the second memory pool based on the memory management queue. Accordingly, the second application cooperates with the second agent module to apply for new available memory space for the second memory pool based on the memory management queue. Furthermore, when the memory management queue on the second electronic device includes a second memory request queue and a second memory allocation queue, a process of requesting the second application to apply for new available memory space for the second memory pool based on the memory management queue includes: the second agent module writing a second memory allocation request to the second memory request queue to request the second application to apply for new available memory space for the second memory pool; the second application accordingly obtaining the second memory allocation request written by the second agent module from the second memory request queue; the second application applying for new available memory space from the operating system of the second electronic device based on the second memory allocation request; the second application writing address information of the new available memory space to the second memory allocation queue to provide it to the second agent module; and the second agent module accordingly obtaining the address information of the new available memory space written by the second application from the second memory allocation queue. It should be noted that the embodiments of the present disclosure do not limit the order in which steps S3 and S4 are implemented; they may be performed in parallel or in any order.
[0033] 56. The second application reads data B from the second memory pool according to the first request message, generates data A according to data B, and writes data A into the second memory pool.
[0034] 57. The second application writes a first notification message to the second task response queue to notify the second agent module to read data A from the second memory pool; accordingly, the second agent module reads the first notification message written by the second application from the second task response queue.
[0035] 58. The second agent module reads data A from the second memory pool and sends data A to the first network card device through the second network card device. Correspondingly, the first network card device receives the data A sent by the second network card device and provides it to the first agent module.
[0036] 59. The first agent module writes data A into the first memory pool. Specifically, when the available memory space in the first memory pool is greater than or equal to the memory space required to store data A, data A is directly written into the available memory space in the first memory pool. When the available memory space in the first memory pool is less than the memory space required to store data A, the first application is requested to apply for new available memory space for the first memory pool based on the memory management queue. Accordingly, the first application cooperates with the first agent module to apply for new available memory space for the first memory pool based on the memory management queue. Furthermore, in a case where the memory management queue on the first electronic device includes a first memory request queue and a first memory allocation queue, a process of requesting the first application to apply for new available memory space for the first memory pool based on the memory management queue includes: the first agent module writes a first memory allocation request to the first memory request queue to request the first application to apply for new available memory space for the first memory pool; accordingly, the first application obtains the first memory allocation request written by the first agent module from the first memory request queue; the first application applies for new available memory space from the operating system of the first electronic device based on the first memory allocation request; the first application writes address information of the new available memory space into the first memory allocation queue to provide it to the first agent module; accordingly, the first agent module obtains the address information of the new available memory space written by the first application from the first memory allocation queue.
[0037] 510. The first agent module writes a first response message to the first task response queue. The first response message is used to notify the first application to read data A from the first memory pool. Accordingly, the first application reads the first response message written by the first agent module from the first task response queue, and then executes step S11.
[0038] 511. A first application reads data A from a first memory pool. After reading data A, the first application may perform corresponding processing on data A. Figure 5a is a schematic diagram of an interaction flow of another data transmission method provided in an embodiment of the present disclosure. This method describes the process of a first application sending data C to a second application. Data C may also be referred to as second data. As shown in Figure 5a, the method includes:
[0039] 51. The first application sends a second request message to the first proxy module based on the task management queue. Accordingly, the first proxy module obtains the second request message sent by the first application based on the task management queue. The second request message is used to instruct the second application to send data C. In an optional embodiment, the task management queue on the first electronic device includes a first task request queue and a first task response queue, as shown in FIG5b. Based on the first task request queue and the first task response queue, in step 51, the first application sends the second request message to the first proxy module based on the task management queue, including:
[0040] 511. The first application writes a second request message to the first task request queue; accordingly, the first agent module reads the second request message from the first task request queue.
[0041] 52. The first application writes data C into the first memory pool, so that the first agent module reads the data C and sends it to the second application through the first network card device.
[0042] 53. The first agent module reads data C from the first memory pool according to the second request message.
[0043] 54. The first agent module sends data C to the second network card device via the first network card device. Correspondingly, the second network card device receives the data C sent by the first network card device and provides it to the second agent module. Further, optionally, based on the first task request queue and the first task response queue, as shown in FIG5a , after step 54, i.e., after the first agent module sends data C via the first network card device, the following steps may be further performed:
[0044] 541. The first agent module writes a second response message to the first task response queue to notify the first application that the data C has been sent. Accordingly, the first application reads the second response message written by the first agent module from the first task response queue, thereby knowing that the data C has been sent.
[0045] 55. The second agent module allocates storage space for data C from the second memory pool. When the available memory space in the second memory pool is insufficient, the second agent module requests the second application to apply for new available memory space for the second memory pool based on the memory management queue. Accordingly, the second application cooperates with the second agent module to apply for new available memory space for the second memory pool based on the memory management queue. The second memory pool is a memory pool that the second application requests from the operating system of the second electronic device for communication with the first application. The memory space in the second memory pool is limited. When the second agent module receives data C, it may attempt to allocate the memory space required to store data C from the second memory pool. If the available memory space in the second memory pool is less than the memory space required to store data C, it is considered that the available memory space in the second memory pool is insufficient. In this case, the second agent module may request the second application to apply for new available memory space for the second memory pool based on the memory management queue. In an optional embodiment, the memory management queue on the second electronic device includes a second memory request queue and a second memory allocation queue, as shown in FIG5b. Based on the second memory request queue and the second memory allocation queue, in step 55, the second agent module requests the second application to apply for new second memory space for the second memory pool based on the memory management queue, including:
[0046] S51. The second agent module writes a second memory allocation request to the second memory request queue to request the second application to apply for new available memory space for the second memory pool. Accordingly, the second application obtains the second memory allocation request written by the second agent module from the second memory request queue.
[0047] 552. The second application requests new available memory space from the operating system of the second electronic device based on the second memory allocation request. Specifically, the second application may send a memory request instruction, such as a mem alloc instruction, to the operating system. The operating system allocates new available memory space to the second application based on the memory request instruction, thereby expanding the second memory pool. Here, mem alloc is a function used to allocate memory space and is an example of a memory request instruction. The memory request instruction may vary depending on different operating systems and is not limited thereto.
[0048] S53. The second application writes the address information of the new available memory space into the second memory allocation queue to provide it to the second agent module, which is referred to as memory allocation. Accordingly, the second agent module obtains the address information of the new available memory space written by the second application from the second memory allocation queue.
[0049] 56. The second agent module writes data C into the second memory pool. Specifically, if the available memory space in the second memory pool is insufficient and new available memory space has been requested, the second agent module may write data C into the newly added available memory space in the second memory pool. Alternatively, if the available memory space in the second memory pool is greater than or equal to the memory space required to store data C (i.e., sufficient), the second agent module may directly write data C into the available memory space in the second memory pool. In an optional embodiment, the task management queue on the second electronic device includes a second task request queue and a second task response queue. Based on the second task request queue and the second task response queue, as shown in FIG5a , between steps 56 and 57, the following may also be included:
[0050] S61. The second agent module writes a third request message to the second task request queue to notify the second application to read data C from the second memory pool. Accordingly, the second application reads the third request message from the second task request queue and executes step 57 according to the third request message.
[0051] 57. The second application reads data C from the second memory pool. After reading data C, the second application may perform corresponding processing on data C. Further, optionally, based on the second task request queue and the second task response queue, as shown in FIG5a , after step 57, the following may also be included:
[0052] S71. The second application writes a third response message to the second task response message to notify the second agent module that data C has been read from the second memory pool. Accordingly, the second agent module reads the third response message from the second task response queue, thereby notifying the second agent module that data C has been read. In an optional embodiment, the memory management queue on the first electronic device includes a first memory request queue and a first memory allocation queue, as shown in FIG5b. Based on the first memory request queue and the first memory allocation queue, the first application and the first agent module can also proactively implement memory management. For example, when a first application writes data C to the first memory pool, the memory space required for data C can also be allocated from the first memory pool. If the available memory space in the first memory pool is less than the memory space required to store data C, then the available memory space in the first memory pool is insufficient. In this case, the first application can proactively request new available memory space from the operating system of the first electronic device. After requesting the new available memory space, the first application writes the address information of the new available memory space into the first memory allocation queue to provide it to the first agent module. The first agent module retrieves the address information of the new available memory space written by the first application from the first memory allocation queue and, accordingly, manages and uses the expanded first memory pool. Furthermore, the first application writes data C into the newly added available memory space in the first memory pool. In the embodiments shown in Figures 5a and 5b, the first application sends data C to the second application as an example. The process for the second application to send or return data to the first application is the same or similar, and is not further described. In the above embodiment, except for the interaction with the operating system (i.e., the kernel) required to apply for new memory space for the memory pool, the entire data transmission process allows the application and the proxy module to directly access the memory pool through the task management queue and the memory management queue, without going through the kernel, thereby improving data transmission efficiency. Furthermore, when storing data sent by the peer, there is no need to negotiate storage space with the peer; instead, data is directly stored in the local memory pool. If the memory pool is insufficient, memory can be directly requested through the memory management queue, ensuring successful data reception and storage. This eliminates the need for storage space negotiation between the two endpoints, further improving data transmission efficiency.Furthermore, in various embodiments of the present disclosure, applications and the proxy module directly access the memory pool through the task management queue and the memory management queue. The proxy module can directly drive the network card device for data transmission. This means that applications do not need to operate the network card device through the network card driver in the kernel. This provides greater flexibility for application development and allows applications to be written in a variety of programming languages. For example, applications can be written in high-level languages such as Go, JSP, Python, Java, and Rust, without being restricted by programming languages. If an application needs to operate a network card device through the kernel's network card driver, given that the network card driver involves hardware operations such as registers, high-level languages like Go, JSP, Python, Java, and Rust do not support hardware operations. Therefore, access to kernel-mode code such as the network card driver must be performed through transit code implemented in C or C++. However, each call to a function in C / C++ code involves a system call, which not only starts a new thread to run the function but also involves parameter movement in memory and stack switching. This can easily disrupt the high-level language's scheduling mechanism and cause stack overflows. Preventing C / C++ code from disrupting the high-level language's scheduling mechanism and causing stack overflows introduces significant overhead. However, the technical solutions provided in the embodiments of the present disclosure can address the aforementioned issues. It should be noted that in the various embodiments of the present disclosure, the agent module's interaction with the application through the task request queue, task response queue, memory allocation queue, and memory request queue is not limited. Alternatively, the agent module can periodically poll each queue to obtain request messages or response messages from the corresponding queue, but this is not a limitation. Specifically, when the proxy module runs on a network card device, the proxy module can use either polling or interruption to access each queue. When the proxy module and the application are deployed on the same virtualized instance on an electronic device, the proxy module can use polling to access each queue. When the proxy module and the application are deployed on different virtualized instances on the electronic device, either polling or virtual interruption can be used. An exemplary embodiment of the present disclosure provides a data transmission method, which is applied to a first proxy module, where a first application is also running on a first electronic device where the first proxy module is located. As shown in FIG6a , the method includes the following steps: 601a, obtaining, based on a task management queue, a first request message sent by the first application, where the first request message is used to request first data from a second application on a second electronic device.
[0053] 602a. Send a first request message to a second application through a first network card device on a first electronic device, and receive first data returned by the second application according to the first request message.
[0054] 603a. When the available memory space in the first memory pool shared with the first application is insufficient, request the first application to apply for new available memory space for the first memory pool based on the memory management queue.
[0055] 604a. Write the first data into the newly added available memory space in the first memory pool, so that the first application can read the first data. In an optional embodiment, the memory management queue includes a first memory request queue and a first memory allocation queue. Requesting the first application to apply for new first memory space for the first memory pool based on the memory management queue includes: writing a first memory allocation request to the first memory request queue to request the first application to apply for new available memory space for the first memory pool; and obtaining target address information corresponding to the new available memory space based on the first memory allocation queue, where the new available memory space is shared memory space requested by the first application from the client operating system to which it belongs, and the target address information is address information recognizable by the first agent module. In an optional embodiment, obtaining target address information corresponding to the new available memory space written by the first application based on the first memory allocation queue includes: when the first application and the first agent module are deployed in the same virtualization instance on the first electronic device, obtaining a handle of the shared memory written by the first application from the first memory allocation queue; determining, based on the shared memory handle, first address information of the new available memory space in the client physical address space as the target address information; when the first application is deployed in the virtualization instance on the first electronic device and the first agent module is deployed in a virtualization manager responsible for managing the virtualization instance on the first electronic device, obtaining the first address information written by the first application from the first memory allocation queue, requesting address translation from the virtualization manager based on the first address information to obtain second address information corresponding to the first address information in the address space where the first agent module is located, as the target address information; when the first application is deployed in the virtualization instance on the first electronic device and the first agent module is deployed on the first network interface card device, obtaining third address information of the new available memory space written by the first application in the host physical address space as the target address information from the first memory allocation queue. The third address information is obtained by the virtualization manager performing address conversion on the first address information from the client physical address space to the host physical address space.In an optional embodiment, the method provided by an embodiment of the present disclosure further includes: obtaining, based on a task management queue, a second request message issued by the first application, the second request message being used to instruct the first application to send second data to the second application, and the second data being written into the first memory pool by the first application; reading the second data from the first memory pool in response to the second request message, and sending the second data to the second application via the first network card device. Optionally, the task management queue includes a first task request queue and a first task response queue; obtaining, based on the task management queue, the first request message or the second request message issued by the first application includes: obtaining, from the first task request queue, the first request message or the second request message written by the first application; accordingly, the method provided by an embodiment of the present disclosure further includes: after receiving the first data, writing a first response message to the first task response queue to notify the first application to read the first data from the first memory pool; or, after sending the second data to the second application, writing a second response message to the first task response queue to notify the first application that the second data has been sent. Further optionally, obtaining the first request message written by the first application from the first task request queue includes: periodically polling the first task request queue to obtain the first request message written by the first application from the first task request queue; or, in a virtualization instance in which the first application is deployed on the first electronic device, the first agent module is deployed in a virtualization manager responsible for managing the virtualization instance on the first electronic device or is deployed on the first network card device, obtaining the first request message written by the first application from the first task request queue according to an interrupt message triggered by the virtualization manager after the first application writes the first request message to the first task request queue.In an optional embodiment, the method of this embodiment further includes: when the first application and the first agent module are deployed in the same virtualization instance on the first electronic device, receiving fourth address information of the memory space in the first memory pool in the client physical address space provided by the first application, and maintaining the fourth address information to share the memory space in the first memory pool with the first application; or, when the first application is deployed in the virtualization instance on the first electronic device and the first agent module is deployed in a virtualization manager on the first electronic device for managing the virtualization instance, receiving fifth address information of the memory space in the first memory pool in the address space where the first agent module is located provided by the virtualization manager, and maintaining a mapping relationship between the fifth address information and the fourth address information to share the memory space in the first memory pool with the first application, wherein the fifth address information is obtained by the virtualization manager performing address translation on the fourth address information; and when the first application is deployed in the virtualization instance on the first electronic device and the first agent module is deployed on the first network interface card device, receiving sixth address information of the memory space in the first memory pool in the host physical address space provided by the virtualization manager, and maintaining a mapping relationship between the sixth address information and the fourth address information. The sixth address information is obtained by the virtualization manager performing address translation of the fourth address information from the client physical address space to the host physical address space to share the memory space in the first memory pool with the first application. The memory space in the first memory pool is the shared memory space requested by the first application from the client operating system to which it belongs. The exemplary embodiments of the present disclosure also provide another data transmission method, which is applied to a first application, and a first agent module is running on a first electronic device where the first application is located. As shown in FIG6b , the method includes:
[0056] 601b. Sending a first request message to the first agent module based on the task management queue, for the first agent module to send to the second application on the second electronic device via the first network card device on the first electronic device, so as to request the first data from the second application. 602b. When available memory space in a first memory pool shared with the first agent module is insufficient, cooperating with the first agent module based on the memory management queue to apply for new available memory space for the first memory pool.
[0057] 603b. Read first data from the first memory pool. The first data is written by the first agent module into newly created available memory space in the first memory pool after the second application returns the first data. In an optional embodiment, the memory management queue includes a first memory request queue and a first memory allocation queue. Cooperating with the first agent module based on the memory management queue to apply for new available memory space for the first memory pool includes: obtaining the first memory allocation request written by the first agent module from the first memory request queue; applying for new available memory space from the client operating system to which the first agent module belongs based on the first memory allocation request; and providing target address information corresponding to the new available memory space to the first agent module based on the first memory allocation queue, so that the first agent module can use the new available memory space. The target address information is address information recognizable by the first agent module. Further optionally, providing the target address information corresponding to the new available memory space to the first agent module based on the first memory allocation queue includes: when the first application and the first agent module are deployed in the same virtualization instance on the first electronic device, writing a shared memory handle into the first memory allocation queue, the shared memory handle indicating first address information of the new available memory space in the client's physical address space, so that the first agent module obtains the first address information as the target address information; when the first application is deployed in the virtualization instance on the first electronic device and the first agent module is deployed in a virtualization manager responsible for managing the virtualization instance on the first electronic device, writing the first address information into the first memory allocation queue so that the first agent module requests address translation from the virtualization manager to obtain second address information corresponding to the first address information in the address space where the first agent module is located as the target address information; and when the first application is deployed in the virtualization instance on the first electronic device and the first agent module is deployed on the first network card device, writing third address information of the new available memory space in the host's physical address space into the first memory allocation queue. The first agent module obtains the third address information as the target address information, where the third address information is obtained by the virtualization manager performing address conversion on the first address information from the client physical address space to the host physical address space.Optionally, the method provided by an embodiment of the present disclosure further includes: upon determining that communication with the second application is required, requesting a first memory pool from the operating system; and writing address information of the first memory pool into a first memory allocation queue for provision to the first agent module. In an optional embodiment, the method provided by an embodiment of the present disclosure further includes: issuing a second request message to the first agent module based on the task management queue, the second request message being used to instruct the first agent module to send second data to the second application; and writing the second data into the first memory pool so that the first agent module can read the second data and send it to the second application via the first network card device. Optionally, the task management queue includes a first task request queue and a first task response queue; and issuing the first request message or the second request message to the first agent module based on the task management queue includes: writing the first request message or the second request message into the first task request queue so that the first agent module can read the first request message or the second request message therefrom. Accordingly, the method provided in an embodiment of the present disclosure further includes: reading a first response message written by the first agent module from the first task response queue, the first response message being used to notify the first application to read the first data from the first memory pool; or reading a second response message written by the first agent module from the first task response queue, the second response message being used to indicate that the first agent module has sent the second data. An exemplary embodiment of the present disclosure also provides another data transmission method, which is applied to a second agent module, where a second application is also running on a second electronic device where the second agent module is located. As shown in FIG6c , the method includes:
[0058] 601c. Receive second data through a second network card device on a second electronic device, where the second data is sent by a first application on a first electronic device.
[0059] 602c. When the available memory space in the second memory pool shared with the second agent module is insufficient, request the second application to apply for new available memory space for the second memory pool based on the memory management queue.
[0060] 603c. Write the second data into the newly added available memory space in the second memory pool, so that the second application can read the second data. In an optional embodiment, the memory management queue includes a second memory request queue and a second memory allocation queue. Requesting the second application to apply for new available memory space for the second memory pool based on the memory management queue includes: writing a second memory allocation request to the second memory request queue to notify the second application to apply for new available memory space for the second memory pool; obtaining target address information corresponding to the new available memory space based on the second memory allocation queue, where the new available memory space is shared memory space requested by the second application from the client operating system to which it belongs, and the target address information is address information recognizable by the second agent module. In an optional embodiment, the method provided in this embodiment of the present disclosure further includes: receiving a first request message via a second network card device, where the first request message is sent by the first application to request the first data from the second application; reporting the first request message to the second application based on the task management queue, so that the second application can write the first data into the second memory pool according to the first request message; reading the first data from the second memory pool, and sending the first data to the first application via the second network card device. Optionally, the task management queue includes a second task request queue and a second task response queue; reporting the first request message to the second application based on the task management queue includes: writing the first request message to the second task request queue, so that the second application can read the first request message from the second task request queue; accordingly, the method further includes: before reading the first data from the second memory pool, reading a first notification message written by the second application from the second task response queue, where the first notification message is used to notify the second agent module to read the first data from the second memory pool. Further, optionally, the method provided in this embodiment of the present disclosure further includes: after receiving the second data, writing a third request message to the second task request queue, where the third request message is used to notify the second application to read the second data from the second memory pool; and reading a third response message from the second task response queue, where the third response message is used to notify the second agent module that the second data has been read from the second memory pool. The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated upon here. It should be noted that, in the above-mentioned FIG. 6a to FIG. 6c, the order of the operations of “sending the second data to the second application” or “requesting the first data from the second application” is not constrained. The sending of the second data or the request for the first data is determined according to the communication requirements of the application.It should be noted that the execution entity of each step of the method provided in the above embodiments may be the same device, or the method may be executed by different devices. For example, steps 601a to 603a may be executed by device A; for another example, steps 601a and 602a may be executed by device A, and step 603a may be executed by device B; and so on. Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be understood that these operations may be executed out of the order presented herein or in parallel. Operation sequence numbers, such as 601a and 602a, are merely used to distinguish between different operations and do not represent any specific execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the terms "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not indicate a sequential order, nor do they limit the "first" and "second" to different types. An exemplary embodiment of the present disclosure provides a data transmission device. This device corresponds to a first proxy module. A first application is also running on a first electronic device where the first proxy module resides. As shown in FIG7a , the device includes an acquisition module 71a, a transceiver module 72a, a request module 73a, and a write module 74a. The acquisition module 71a is configured to obtain a first request message sent by the first application based on the task management queue, where the first request message is used to request the first data from the second application on the second electronic device; the transceiver module 72a is configured to send the first request message to the second application through the first network card device on the first electronic device, and receive the first data returned by the second application based on the first request message; the request module 73a is configured to request the first application to apply for new available memory space for the first memory pool based on the memory management queue when the available memory space in the first memory pool shared with the first application is insufficient; the write module 74a is configured to write the first data into the newly added available memory space in the first memory pool so that the first application can read the first data. In an optional embodiment, the device also includes: a reading module; the obtaining module is further configured to: obtain a second request message issued by the first application based on the task management queue, the second request message is used to instruct to send the second data to the second application, and the second data is written into the first memory pool by the first application; the reading module is configured to read the second data from the first memory pool according to the second request message, and the transceiver module is further configured to: send the second data to the second application through the first network card device.An exemplary embodiment of the present disclosure provides another data transmission device. This device corresponds to a first application, and a first agent module is running on a first electronic device where the first application resides. As shown in FIG7b , the device includes a transceiver module 71b, a coordination module 72b, and a reading module 73b. The transceiver module 71b is configured to send a first request message to the first agent module based on a task management queue, for the first agent module to send to a second application on a second electronic device via a first network card device on the first electronic device, thereby requesting first data from the second application. The coordination module 72b is configured to coordinate with the first agent module to request new available memory space for the first memory pool shared with the first agent module based on the memory management queue when available memory space in the first memory pool is insufficient. The reading module 73b is configured to read first data from the first memory pool. The first data is written by the first agent module into the newly created available memory space in the first memory pool after the second application returns the first data. Optionally, the device further includes: an application module and a write module; the application module is configured to, upon determining that communication with the second application is required, apply for a first memory pool from the client operating system to which the application belongs; the write module is configured to write address information of the first memory pool into a first memory allocation queue for provision to the first proxy module. The disclosed embodiment also provides another data transmission device, which is applied to a second proxy module, wherein a second application is also running on a second electronic device where the second proxy module is located. As shown in FIG7c , the device includes: a transceiver module 71c, a request module 72c, and a write module 73c. The transceiver module 71c is configured to receive second data sent by the first application on the first electronic device via a second network card device on the second electronic device; the request module 72c is configured to, when available memory space in the second memory pool shared with the second application is insufficient, request the second application to apply for new available memory space for the second memory pool based on the memory management queue; and the write module 73c is configured to write the second data into the newly available memory space in the second memory pool, so that the second application can read the second data. In an optional embodiment, the device further includes: a reading module; the transceiver module is further configured to receive a first request message through a second network card device, where the first request message is sent by the first application and is used to request the first data from the second application; reporting the first request message to the second application based on the task management queue, so that the second application writes the first data into the second memory pool according to the first request message; and the reading module is configured to read the first data from the second memory pool and send the first data to the first application through the second network card device.The detailed implementation and beneficial effects of each functional module in the apparatus of this embodiment have been described in detail in the previous embodiments and will not be elaborated upon here. Figure 8 is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present disclosure. This device corresponds to a first proxy module. A first application is also running on a first electronic device where the first proxy module is located. As shown in Figure 8, the device includes a memory 84, a processor 85, and a first network card device 83. Memory 84 is configured to store a computer program corresponding to the first application and can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device. The processor 85 is coupled to the memory 84 and configured to execute a computer program in the memory 84 to: obtain, based on a task management queue, a first request message sent by a first application, the first request message being used to request first data from a second application on a second electronic device; send the first request message to the second application via a first network interface card device on the first electronic device, and receive the first data returned by the second application in response to the first request message; request the first application to apply for new available memory space in the first memory pool, based on the memory management queue, when available memory space in a first memory pool shared with the first application is insufficient; and write the first data into the newly available memory space in the first memory pool, so that the first application can read the first data. In an optional embodiment, the processor 85 is further configured to: obtain, based on the task management queue, a second request message sent by the first application, the second request message being used to instruct the second application to send second data, the second data being written into the first memory pool by the first application; read the second data from the first memory pool in response to the second request message, and send the second data to the second application via the first network interface card device. Furthermore, as shown in FIG8 , the electronic device also includes other components, such as other communication components 86, a display 87, a power supply component 88, and an audio component 89. FIG8 only schematically illustrates some components, and does not mean that the electronic device only includes the components shown in FIG8 . Furthermore, the components within the dashed box in FIG8 are optional, not mandatory, and their specific selection depends 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, laptop computer, smartphone, or IoT device, or as a server-side device such as a conventional server, cloud server, or server array.If the electronic device of this embodiment is implemented as a terminal device such as a desktop computer, laptop computer, or smartphone, it may include the components within the dashed box in Figure 8 . If the electronic device of this embodiment is implemented as a server-side device such as a conventional server, cloud server, or server array, it may not include the components within the dashed box in Figure 8 . The disclosed embodiments also provide an electronic device corresponding to a first application. A first agent module runs on a first electronic device where the first application resides. The implementation structure of this electronic device is the same as or similar to the implementation structure of the electronic device shown in Figure 8 , and can be implemented with reference to the structure of the electronic device shown in Figure 8 . The electronic device provided in this embodiment differs primarily from the electronic device shown in Figure 8 in that the functions implemented by the processor executing the computer program stored in the memory are different. In the electronic device provided in this embodiment, the processor executes a computer program stored in a memory, and is configured to: send a first request message to a first agent module based on a task management queue, for the first agent module to send to a second application on a second electronic device via a first network interface card device on the first electronic device, requesting first data from the second application; when available memory space in a first memory pool shared with the first agent module is insufficient, cooperate with the first agent module based on the memory management queue to request new available memory space for the first memory pool; and read first data from the first memory pool, where the first data is written by the first agent module to the newly available memory space in the first memory pool after the second application returns the first data. In an optional embodiment, the processor is further configured to: request the first memory pool from the client operating system to which the second application belongs, if communication with the second application is determined to be necessary; and provide target address information corresponding to the newly available memory space to the first agent module based on a first memory allocation queue, so that the first agent module can use the newly available memory space, where the target address information is address information recognizable by the first agent module. An embodiment of the present disclosure also provides an electronic device, which is used with a second agent module. A second application is also running on a second electronic device where the second agent module is located. The implementation structure of this electronic device is the same as or similar to the implementation structure of the electronic device shown in FIG8 , and can be implemented with reference to the structure of the electronic device shown in FIG8 . The electronic device also includes a second network card device. The electronic device provided in this embodiment differs from the electronic device shown in FIG8 primarily in that the functions implemented by the processor executing the computer program stored in the memory are different.In the electronic device provided in this embodiment, the processor executes a computer program stored in a memory, and is configured to: receive second data via a second network card device on a second electronic device, the second data being sent by a first application on a first electronic device; when available memory space in a second memory pool shared with the second application is insufficient, request the second application to apply for new available memory space in the second memory pool based on a memory management queue; and write the second data into the newly available memory space in the second memory pool, allowing the second application to read the second data. In an optional embodiment, the processor is further configured to: receive a first request message via the second network card device, the first request message being sent by the first application to request the first data from the second application; report the first request message to the second application based on a task management queue, so that the second application writes the first data into the second memory pool based on the first request message; and read the first data from the second memory pool and send the first data to the first application via the second network card device. The detailed implementation and beneficial effects of each step in the electronic device provided in the above-mentioned embodiments of the present disclosure have been described in detail in the aforementioned embodiments and will not be elaborated upon here. Accordingly, embodiments of the present disclosure further provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor is enabled to implement the steps of the method embodiments shown in Figures 6a to 6c . Embodiments of the present disclosure further provide a computer program product comprising a computer program / instructions. When the computer program / instructions are executed by a processor, the processor is enabled to implement the steps of the method embodiments shown in Figures 6a to 6c . The aforementioned memory 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. The aforementioned other communication components are configured to facilitate wired or wireless communication between the device where the communication component is located and other devices.The device containing the communication component can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G, or other mobile communication networks, or a combination thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one 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), infrared data association (IrDA), ultra-wideband (UWB), Bluetooth (BT), or other technologies. The aforementioned display includes a screen, which can include a liquid crystal display (LCD) and a touch panel (TP). OIf the screen includes a touch panel, it can be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors can not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. The power supply assembly described above 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. The audio assembly described above can be configured to output and / or input audio signals. For example, the audio assembly includes a microphone (MIC) that is configured to receive external audio signals when the device in which the audio assembly is located is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals may be further stored in a memory or transmitted via a communication component. In some embodiments, the audio assembly also includes a speaker for outputting audio signals. 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 an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. 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. 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 block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, such that the instructions, executed by the processor of the computer or other programmable data processing device, produce means for implementing the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams. 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, which implements the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing the computer or other programmable device to execute a series of operational steps to produce a computer-implemented process. The instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flow charts and / or one or more blocks in a block diagram. In a typical configuration, a computing device includes one or more processors (Central Processing Units, CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. oMemory is an example of computer-readable media. Computer-readable media includes both permanent and non-permanent, removable and non-removable media, and can be implemented using any method or technology to store information. 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-transmitting medium that can be used to store information accessible 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. It should also be noted that the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, product, or apparatus comprising a list of elements may include not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, product, or apparatus. Without further limitation, the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, product, or apparatus comprising the elements. The foregoing are merely examples of the present disclosure and are not intended to limit the present disclosure. Those skilled in the art will readily appreciate that various modifications and variations of the present disclosure are possible. Any modifications, equivalent substitutions, improvements, and the like made within the spirit and principles of the present disclosure are intended to be encompassed by the claims of the present disclosure. Industrial Applicability In the disclosed embodiments, during data transmission between two ends, both ends can, on the one hand, improve data transmission efficiency by using bypass kernels and zero-copy technology based on their respective task management queues. Furthermore, both ends can proactively implement memory management for data storage based on their respective memory management queues, eliminating the need for memory management interaction with the other end. This reduces the number of interactive operations between the two ends during data transmission and, while enabling direct memory access, further reduces transmission latency.
Claims
Claims 1. A data transmission method is applied to a first proxy module. A first application is also running on a first electronic device where the first proxy module is located. The method includes: Obtain a first request message sent by a first application based on a task management queue, where the first request message is used to request first data from a second application on a second electronic device; Send the first request message to the second application through a first network card device on the first electronic device, and receive the first data returned by the second application according to the first request message; When the available memory space in a first memory pool shared with the first application is insufficient, request the first application to apply for a new available memory space for the first memory pool based on a memory management queue; write the first data into the newly added available memory space in the first memory pool for the first application to read the first data.
2. The method according to claim 1, wherein The memory management queue includes a first memory request queue and a first memory allocation queue; Request the first application to apply for a new first memory space for the first memory pool based on the memory management queue, including: writing a first memory allocation request into the first memory request queue to request the first application to apply for a new available memory space for the first memory pool; Obtain target address information corresponding to the new available memory space based on the first memory allocation queue, where the new available memory space is a shared memory space applied by the first application from its affiliated client operating system, and the target address information is address information recognizable by the first proxy module.
3. The method according to claim 2, wherein Obtaining the target address information corresponding to the new available memory space written by the first application based on the first memory allocation queue includes: in the case where the first application and the first proxy module are deployed in the same virtualization instance on the first electronic device, obtaining the handle of the shared memory written by the first application from the first memory allocation queue; determining the first address information of the new available memory space in the client physical address space according to the handle of the shared memory as the target address information; in the case where the first application is deployed in the virtualization instance on the first electronic device and the first proxy module is deployed in the virtualization manager on the first electronic device responsible for managing the virtualization instance, obtaining the first address information written by the first application from the first memory allocation queue, and applying for address translation to the virtualization manager according to the first address information to obtain the second address information corresponding to the first address information in the address space where the first proxy module is located as the target address information; in the case where the first application is deployed in the virtualization instance on the first electronic device and the first proxy module is deployed on the first network card device, obtaining the third address information of the new available memory space written by the first application in the host physical address space from the first memory allocation queue as the target address information, and the third address information is obtained by the virtualization manager performing address conversion on the first address information from the client physical address space to the host physical address space.
4. The method according to claim 1, wherein The task management queue includes a first task request queue and a first task response queue; Obtaining the first request message sent by the first application based on the task management queue includes: obtaining the first request message written by the first application from the first task request queue; correspondingly, the method further includes: after receiving the first data, writing a first response message to the first task response queue to notify the first application to read the first data from the first memory pool.
5. The method according to claim 4, wherein Obtaining the first request message written by the first application from the first task request queue includes: periodically polling the first task request queue to obtain the first request message written by the first application from the first task request queue; or, when the first application is deployed in a virtualization instance on the first electronic device and the first proxy module is deployed in the virtualization manager on the first electronic device responsible for managing the virtualization instance or deployed on the first network card device, obtaining the first request message written by the first application from the first task request queue according to the interrupt message triggered by the virtualization manager after the first application writes the first request message into the first task request queue.
6. The method according to any one of claims 1-5, wherein The method further includes: when the first application and the first proxy module are deployed in the same virtualization instance on the first electronic device, receiving the fourth address information of the memory space in the first memory pool provided by the first application in the client physical address space and maintaining the fourth address information to share the memory space in the first memory pool with the first application; or, when the first application is deployed in a virtualization instance on the first electronic device and the first proxy module is deployed in the virtualization manager on the first electronic device for managing the virtualization instance, receiving the fifth address information of the memory space in the first memory pool in the address space where the first proxy module is located provided by the virtualization manager and maintaining the mapping relationship between the fifth address information and the fourth address information to share the memory space in the first memory pool with the first application, where the fifth address information is obtained by the virtualization manager through address translation of the fourth address information; when the first application is deployed in a virtualization instance on the first electronic device and the first proxy module is deployed on the first network card device, receiving the sixth address information of the memory space in the first memory pool in the host physical address space provided by the virtualization manager and maintaining the mapping relationship between the sixth address information and the fourth address information to share the memory space in the first memory pool with the first application, where the sixth address information is obtained by the virtualization manager through address conversion of the fourth address information from the client physical address space to the host physical address space; where the memory space in the first memory pool is the shared memory space applied for by the first application to its affiliated client operating system. The shared memory space applied for by the first application to its affiliated client operating system.
7. A data transmission method, applied to a first application, where a first proxy module runs on a first electronic device where the first application is located, the method comprising: Send a first request message to the first agent module based on the task management queue for the first agent module to send to the second application on the second electronic device through the first network card device on the first electronic device to request the first data from the second application; When the available memory space in the first memory pool shared with the first agent module is insufficient, apply for new available memory space for the first memory pool in cooperation with the first agent module based on the memory management queue; and read the first data from the first memory pool, where the first data is written by the first agent module into the newly added available memory space in the first memory pool after the second application returns the first data.
8. The method according to claim 7, wherein The memory management queue includes a first memory request queue and a first memory allocation queue; Applying for new available memory space for the first memory pool in cooperation with the first agent module based on the memory management queue includes: obtaining the first memory allocation request written by the first agent module from the first memory request queue; applying for new available memory space from the client operating system according to the first memory allocation request; providing the target address information corresponding to the new available memory space to the first agent module based on the first memory allocation queue for the first agent module to use the new available memory space, where the target address information is the address information recognizable by the first agent module.
9. The method according to claim 8, wherein Providing the target address information corresponding to the new available memory space to the first proxy module based on the first memory allocation queue includes: in the case where the first application and the first proxy module are deployed in the same virtualization instance on the first electronic device, writing a handle of a shared memory into the first memory allocation queue, where the handle of the shared memory represents the first address information of the new available memory space in the client physical address space, so that the first proxy module can obtain the first address information as the target address information; in the case where the first application is deployed in the virtualization instance on the first electronic device and the first proxy module is deployed in the virtualization manager on the first electronic device responsible for managing the virtualization instance, writing the first address information into the first memory allocation queue, so that the first proxy module can apply for address translation from the virtualization manager to obtain the second address information corresponding to the first address information in the address space where the first proxy module is located as the target address information; in the case where the first application is deployed in the virtualization instance on the first electronic device and the first proxy module is deployed on the first network card device, writing the third address information of the new available memory space in the host physical address space into the first memory allocation queue, so that the first proxy module can obtain the third address information as the target address information, and the third address information is obtained by the virtualization manager performing an address conversion of the first address information from the client physical address space to the host physical address space.
10. The method according to any one of claims 7-9, wherein, The task management queue includes a first task request queue and a first task response queue; Issuing the first request message to the first proxy module based on the task management queue includes: writing the first request message into the first task request queue so that the first proxy module can read the first request message therefrom; correspondingly, before reading the first data from the first memory pool, the method further includes: reading a first response message written by the first proxy module from the first task response queue, where the first response message is used to notify the first application to read the first data from the first memory pool.
11. A data transmission method, which is applied to a second proxy module, and a second application is also running on a second electronic device where the second proxy module is located. The method includes: Receiving a first request message through a second network card device of a second electronic device, where the first request message is sent by a first application on a first electronic device and is used to request first data from the second application; Report the first request message to the second application based on a task management queue, so that the second application writes first data into a second memory pool shared with the second proxy module according to the first request message; read the first data from the second memory pool, and send the first data to the first application through the second network card device.
12. The method according to claim 11, wherein The task management queue includes a second task request queue and a second task response queue; Reporting the first request message to the second application based on a task management queue includes: writing the first request message into the second task request queue for the second application to read the first request message from the second task request queue; correspondingly, before reading the first data from the second memory pool, the method further includes: reading a first notification message written by the second application from the second task response queue, where the first notification message is used to notify the second proxy module to read the first data from the second memory pool.
13. A data transmission method, applied to a first proxy module, where a first application also runs on a first electronic device where the first proxy module is located. The method includes: Obtain a second request message sent by the first application based on a task management queue, where the second request message is used to indicate sending second data to a second application on a second electronic device, and the second data is written by the first application into a first memory pool shared with the first application; According to the second request message, read the second data from the first memory pool, and send the second data to the second application through a first network card device.
14. A data transmission method, applied to a second proxy module. A second application also runs on a second electronic device where the second proxy module is located. The method includes: Receive second data through a second network card device on a second electronic device, where the second data is sent by a first application on a first electronic device; When the available memory space in the second memory pool shared with the second application is insufficient, request the second application to apply for a new available memory space for the second memory pool based on a memory management queue; write the second data into the newly added available memory space in the second memory pool for the second application to read the second data.
15. The method according to claim 14, wherein, The memory management queue includes a second memory request queue and a second memory allocation queue; requesting the second application to apply for a new available memory space for the second memory pool based on a memory management queue includes: writing a second memory allocation request into the second memory request queue to notify the second application to apply for a new available memory space for the second memory pool; Obtain target address information corresponding to the new available memory space based on the second memory allocation queue, where the new available memory space is a shared memory space applied by the second application from the client operating system to which it belongs, and the target address information is address information recognizable by the second proxy module.
16. An electronic device, comprising: A memory, a processor, and a network card device; A computer program is stored in the memory, and the processor is coupled to the memory and configured to execute the computer program to implement the steps in the method according to any one of claims 1-15.
17. A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to be able to implement the steps in the method according to any one of claims 1-15.
18. A computer program product comprising a computer program / instructions, which, when executed by a processor, causes the processor to be able to implement the steps in the method according to any one of claims 1-15.
Citation Information
Patent Citations
Communication method and device
CN112422615A
Cited By
Robot sensing-reasoning inter-node communication system and method based on page lock memory
CN122044915A
Business processing method and device based on AI data lake, medium and electronic equipment
CN122412167A