Data Processing Method and System

Through RDMA data transmission between the client and the server, the problem of insufficient programmability in the RDMA data processing mode is solved, and efficient data processing and CPU resource conservation are achieved.

CN115334134BActive Publication Date: 2025-07-08ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210870380.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-07-08
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

The existing RDMA data processing mode has the problem of insufficient programmability when local devices need to provide data to remote devices for processing. The bypass mode requires large-scale modification of the device, while the reply mode fails to fully utilize the bypass characteristics of RDMA.

Method used

The client stores the call request data to the memory area of the server through RDMA write operation, and the server processes and stores the result data. The client obtains the result data through RDMA read operation, which avoids the client processing itself and the server actively returns data, retains programmability and reduces CPU consumption.

Benefits of technology

It realizes the preservation of programmability in RDMA data transmission, reduces the performance consumption of server CPUs, and improves data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115334134B_ABST
    Figure CN115334134B_ABST
Patent Text Reader

Abstract

One or more embodiments of this specification provide a data processing method and system. This method is applied to a client. The client maintains a first memory area corresponding to a first RDMA network card installed in the network device where it is located, and a second memory area. The method includes: in response to a remote call initiated by the client to the server, storing call request data corresponding to the remote call in the first memory area. The server maintains a third memory area corresponding to a second RDMA network card installed in the network device where it is located, and a fourth memory area. By performing an RDMA write operation, writing the call request data from the first memory area to the third memory area, so that the server can obtain the call request data from the third memory area, perform call processing based on the call request data to obtain call result data corresponding to the call request data, and store the call result data in the fourth memory area. By performing an RDMA read operation, remotely reading the call result data from the fourth memory area to the second memory area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to the field of computer technology, and in particular, to a data processing method and system. Background Art

[0002] Nowadays, data centers widely adopt a distributed deployment method, including large-scale parallel device clusters, to improve the performance of data centers in storage, computing, etc. Usually, an RDMA (Remote Direct Memory Access) network card can be equipped for each device to perform RDMA-based data transmission between different devices. RDMA is a direct memory access technology that can directly transfer data from the memory of one device to the memory of another device without the intervention of the operating systems of both parties and without consuming too much device performance, thereby enabling high-throughput and low-latency data transmission.

[0003] For the situation where a local device needs to provide data to a remote device for data processing, two data processing modes can be achieved based on RDMA: the bypass mode and the reply mode. Among them, the bypass mode must rely on developers to design special data structures and algorithms to make large-scale modifications to the device itself to enable the device to support the bypass mode, thus losing programmability; while the reply mode still requires the CPU of the remote device to participate in data transmission, so the bypass characteristics of RDMA are not fully utilized. Summary of the Invention

[0004] One or more embodiments of this specification provide the following technical solutions:

[0005] This specification provides a data processing method, which is applied to a client; the network device where the client is located is equipped with a first Remote Direct Memory Access (RDMA) network card; the client maintains a first memory area corresponding to the first RDMA network card for storing call request data, and a second memory area for storing call result data; the method includes:

[0006] In response to a remote call initiated by the client to the server, storing the call request data corresponding to the remote call in the first memory area; wherein, the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data;

[0007] Through an RDMA write operation, write the call request data from the first memory area to the third memory area, so that the server obtains the call request data from the third memory area, performs call processing based on the call request data to obtain call result data corresponding to the call request data, and stores the call result data in the fourth memory area;

[0008] Through an RDMA read operation, remotely read the call result data from the fourth memory area to the second memory area.

[0009] This specification also provides a data processing method, which is applied to a server; the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data; the method includes:

[0010] Obtain call request data from the third memory area; wherein, the call request data is written from the first memory area to the second memory area by the client through an RDMA write operation; the network device where the client is located is equipped with a first RDMA network card; the client maintains the first memory area corresponding to the first RDMA network card for storing call request data, and the second memory area for storing call result data;

[0011] Perform call processing based on the call request data to obtain call result data corresponding to the call request data;

[0012] Store the call result data in the fourth memory area, so that the client remotely reads the call result data from the fourth memory area to the second memory area through an RDMA read operation.

[0013] This specification also provides a data processing system, including:

[0014] A client and a server; wherein, the network device where the client is located is equipped with a first Remote Direct Memory Access (RDMA) network card; the client maintains a first memory area corresponding to the first RDMA network card for storing call request data, and a second memory area for storing call result data; the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data;

[0015] The client and the server are used for:

[0016] In response to a remote call initiated by the client for the server, the client stores call request data corresponding to the remote call in the first memory area;

[0017] The client writes the call request data from the first memory area to the third memory area through an RDMA write operation;

[0018] The server obtains the call request data from the third memory area;

[0019] The server performs call processing based on the call request data to obtain call result data corresponding to the call request data;

[0020] The server stores the call result data in the fourth memory area;

[0021] The client remotely reads the call result data from the fourth memory area to the second memory area through an RDMA read operation.

[0022] This specification also provides an electronic device, including:

[0023] A processor;

[0024] A memory for storing instructions executable by the processor;

[0025] Wherein, the processor realizes the steps of the method as described in any one of the above by running the executable instructions.

[0026] This specification also provides a computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method as described in any one of the above are realized.

[0027] In the above technical solution, the client can store call request data in the first memory area maintained by it corresponding to the first RDMA network card, and through an RDMA write operation, write the call request data from the first memory area to the third memory area maintained by the server corresponding to the second RDMA network card; the server can obtain the call request data from the third memory area, perform call processing based on the call request data to obtain call result data corresponding to the call request data, and store the call result data in the fourth memory area maintained by it corresponding to the second RDMA network card; the client can remotely read the call result data from the fourth memory area to the second memory area maintained by it corresponding to the first RDMA network card.

[0028] In the above - mentioned manner, on the one hand, since the client can send the call - request data to the server, and the server is responsible for performing call processing based on the call - request data, it can avoid the client from performing call processing by itself. Instead, the server performs call processing based on the call - request data. In this case, functions, methods, or services in the server called by the client can be flexibly modified according to actual needs, retaining programmability.

[0029] On the other hand, since the server does not need to actively return the call - result data obtained through call processing to the client, but the client remotely obtains the call - result data stored in the server through an RDMA read operation, the CPU of the server does not need to participate in data transmission, which can reduce the performance consumption of the server's CPU. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is an architecture diagram of a data - processing system shown in an exemplary embodiment of this specification.

[0031] Figure 2 is a software - architecture diagram of a data - processing mode shown in an exemplary embodiment of this specification.

[0032] Figure 3 is a flowchart of a data - processing method shown in an exemplary embodiment of this specification.

[0033] Figure 4 is a flowchart of another data - processing method shown in an exemplary embodiment of this specification.

[0034] Figure 5 is a schematic diagram of the hardware structure of a device shown in an exemplary embodiment of this specification.

[0035] Figure 6 is a block diagram of a data - processing device shown in an exemplary embodiment of this specification.

[0036] Figure 7 is a block diagram of another data - processing device shown in an exemplary embodiment of this specification. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0037] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. On the contrary, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0038] It should be noted that: In other embodiments, the steps of the corresponding method are not necessarily executed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step for description in other embodiments.

[0039] For TCP / IP (Transmission Control Protocol / Internet Protocol), data generally needs to be sent from the user-mode memory of the local device to the user-mode memory of the remote device. Specifically, the local device first needs to copy the data from the user-mode memory to the kernel-mode memory, and then encapsulate the data based on a series of multi-layer network protocols in the kernel-mode memory. These network protocols include TCP, UDP (User Datagram Protocol), IP, ICMP (Internet Control Message Protocol), etc. Finally, the encapsulated data is pushed to the Network Interface Card (NIC) for network transmission; the remote device first needs to copy the data from the NIC to the kernel-mode memory, and then de-encapsulate the data based on a series of multi-layer network protocols in the kernel-mode memory. Finally, the de-encapsulated data is copied from the kernel-mode memory to the user-mode memory.

[0040] For RDMA, it can directly access the RDMA NIC from the user-mode memory through the RDMA NIC (RDMA Network Interface Card, RNIC), bypassing the kernel. The local device does not need to copy the data, but can directly push the data from the user-mode memory to the RDMA NIC, and transmit the data to the RDMA NIC of the remote device through the RDMA NIC. The remote device stores the data from the RDMA NIC of the remote device to the user-mode memory of the remote device. Thus, the data can be written from the memory of the local device to the memory of the remote device by the local device.

[0041] That is to say, RDMA has a bypass feature, allowing the CPU of the local device to directly read / write the data in the memory of the remote device without the participation of the CPU of the remote device. In addition, RDMA also has the zero-copy feature of data, which can avoid the explicit copy of data between the user-mode memory and the kernel-mode memory on both the local device and the remote device. Due to features such as bypass and zero-copy of data, as well as a simpler protocol stack, RDMA has better performance compared to TCP / IP.

[0042] In the related art, for the case where a local device needs to provide data to a remote device for data processing, two data processing modes can be implemented based on RDMA: the bypass mode and the reply mode.

[0043] The bypass mode enables the local device to directly read / write the data in the memory of the remote device through RDMA operations. Thus, when the local device needs to call functions, methods, or services deployed in the remote device, the local device can complete the call on its own through RDMA operations and obtain the corresponding call result data without the participation of the CPU of the remote device. Therefore, the performance consumption of the CPU of the remote device can be reduced. However, the bypass mode must rely on developers to design special data structures and algorithms, and make extensive modifications to the device itself to enable the device to support the bypass mode. As a result, the programmability is lost.

[0044] The reply mode usually adopts the RPC (Remote Procedure Call) mechanism. The RPC mechanism adopts the C / S (Client / Server) architecture; the client can make an RPC call to the server to call functions, methods, or services deployed in the server; the functions, methods, or services in the server are usually encapsulated as RPC interfaces. Specifically, the client can send the RPC call request data including the identifiers of the functions, methods, or services to be called, as well as the relevant call parameters, etc. to the server through RDMA operations. The server makes an RPC call based on the RPC call request data, obtains the RPC call result data corresponding to the RPC call request data, and actively returns the RPC call result data to the client through RDMA operations. The reply mode uses RDMA to replace TCP / IP for data transmission, but does not need to modify the RPC interface provided for user-mode threads. Therefore, it has good programmability. However, the reply mode still requires the participation of the CPU of the server in data transmission. Therefore, the bypass characteristics of RDMA are not fully utilized.

[0045] In the technical solution for data transmission provided by one or more embodiments of this specification, the client can store the call request data in the first memory area corresponding to the first RDMA network card maintained by it, and write the call request data from this first memory area to the third memory area corresponding to the second RDMA network card maintained by the server through an RDMA write operation; the server can obtain the call request data from the third memory area, perform call processing based on the call request data to obtain call result data corresponding to the call request data, and store the call result data in the fourth memory area corresponding to the second RDMA network card maintained by it; the client can remotely read the call result data from the fourth memory area to the second memory area corresponding to the first RDMA network card maintained by it through an RDMA read operation.

[0046] In specific implementation, the network device where the above client is located can be equipped with an RDMA network card (which can be called the first RDMA network card) to implement RDMA-based data transmission. Further, the client can maintain a memory area corresponding to the first RDMA network card for storing call request data (which can be called the first memory area), and a memory area for storing call result data (which can be called the second memory area).

[0047] Similarly, the network device where the server in the C / S architecture is located can be equipped with an RDMA network card (which can be called the second RDMA network card) to implement RDMA-based data transmission. Further, the server can maintain a memory area corresponding to the second RDMA network card for storing call request data (which can be called the third memory area), and a memory area for storing call result data (which can be called the fourth memory area).

[0048] When the above client needs to remotely call the above server to call functions, methods, services, etc. in the server, it can generate call request data corresponding to the remote call to the server. In this case, the client can store the call request data in the above first memory area in the client.

[0049] The above client can write the above call request data from the above first memory area in the client to the above third memory area in the above server through an RDMA write operation.

[0050] The above server can obtain the above call request data from the above third memory area in the server.

[0051] In the above case, the above server can perform call processing based on the above call request data to obtain call result data corresponding to the call request data.

[0052] Subsequently, the above server can store the above call result data in the above fourth memory area in the server.

[0053] The above client can remotely read the above call result data from the above fourth memory area in the above server to the above second memory area in the client through an RDMA read operation.

[0054] That is, the above server only needs to perform call processing based on the call request data, and does not need to actively return the call result data obtained through call processing to the above client.

[0055] In the above manner, on the one hand, since the client can send the call request data to the server, and the server is responsible for performing call processing based on the call request data, it can avoid the client performing call processing by itself, and the server performs call processing based on the call request data. In this case, the functions, methods, or services in the server called by the client can be flexibly modified according to actual needs, retaining programmability.

[0056] On the other hand, since the server does not need to actively return the call result data obtained through call processing to the client, but the client remotely obtains the call result data stored in the server through an RDMA read operation, the CPU of the server does not need to participate in data transmission, which can reduce the performance consumption of the CPU of the server.

[0057] Please refer to Figure 1 , Figure 1 which is an architecture diagram of a data processing system shown in an exemplary embodiment of this specification.

[0058] As Figure 1 shown, the above data processing system may include a network 10, a server 11, and several clients, such as client 13, client 14, etc.

[0059] The server 11 may be a physical server including an independent host, or the server 11 may be a virtual server, a cloud server, etc. hosted by a host cluster. The clients 13 to 14 may be electronic devices such as computers, laptops, tablets, and personal digital assistants (PDAs). One or more embodiments of this specification do not limit this. The network 10 may include various types of wired or wireless networks.

[0060] In practical applications, the clients 13 to 14 and the server 11 may form a C / S architecture; network cards supporting RDMA may be respectively equipped for the server 11, the client 13, and the client 14 to perform RDMA-based data transmission between the clients 13 to 14 and the server 11.

[0061] As shown Figure 2 in Figure 2 Figure 1, it is a software architecture diagram of a data processing mode shown in an exemplary embodiment of this specification. Please combine with Figure 2 Figure 2 Figure 3 and refer to Figure 3 Figure 3, which is a flowchart of a data processing method shown in an exemplary embodiment of this specification.

[0062] The above data processing method can be applied to the client in the C / S architecture. For example, this data processing method can be implemented by a user-mode thread in the client.

[0063] In this embodiment, the network device where the above client is located can be equipped with an RDMA network card (which can be called the first RDMA network card) to implement RDMA-based data transmission. Further, the client can maintain a memory area (which can be called the first memory area) corresponding to the first RDMA network card for storing call request data, and a memory area (which can be called the second memory area) for storing call result data.

[0064] Similarly, the network device where the server in the C / S architecture is located can be equipped with an RDMA network card (which can be called the second RDMA network card) to implement RDMA-based data transmission. Further, the server can maintain a memory area (which can be called the third memory area) corresponding to the second RDMA network card for storing call request data, and a memory area (which can be called the fourth memory area) for storing call result data.

[0065] In practical applications, the above first memory area and the above second memory area can be located in the user-mode memory of the above client; the above third memory area and the above fourth memory area can be located in the user-mode memory of the above server.

[0066] In an illustrated implementation, in order to perform RDMA-based data transmission through the above first RDMA network card, several memory areas for RDMA data transmission are usually pre-registered on the first RDMA network card. Therefore, these several memory areas can be used as the memory areas corresponding to the first RDMA network card.

[0067] Subsequently, the above client can apply for a memory area of a preset size from the above several memory areas as the above first memory area or the above second memory area. For example, several memory areas in the memory equipped on the network device where the client is located can be pre-registered on the first RDMA network card, so that the first RDMA network card can use these several memory areas for RDMA-based data transmission subsequently. In this case, a memory area of a preset size can be allocated from these several memory areas for the first memory area or the second memory area.

[0068] Correspondingly, the above client can release the above first memory area or the above second memory area back to the above several memory areas. For example, a memory area of a preset size can be released from the first memory area or the second memory area back to these several memory areas.

[0069] Similarly, in an illustrated embodiment, in order to perform RDMA-based data transmission through the above second RDMA network card, several memory areas for RDMA data transmission are usually pre-registered on the second RDMA network card. Therefore, these several memory areas can be used as the memory areas corresponding to the second RDMA network card.

[0070] Subsequently, the above server can apply for a memory area of a preset size from the above several memory areas as the above third memory area or the above fourth memory area. For example, several memory areas in the memory carried on the network device where the server is located can be pre-registered on the second RDMA network card, so that the second RDMA network card can subsequently use these several memory areas for RDMA-based data transmission. In this case, a memory area of a preset size can be allocated from these several memory areas for the third memory area or the fourth memory area.

[0071] Correspondingly, the above server can release the above third memory area or the above fourth memory area back to the above several memory areas. For example, a memory area of a preset size can be released from the third memory area or the fourth memory area back to these several memory areas.

[0072] In practical applications, the above client can apply for or release the above first memory area or the above second memory area in the form of a call interface. Similarly, the above server can apply for or release the above third memory area or the above fourth memory area in the form of a call interface.

[0073] The interfaces for applying for and releasing memory areas can be as shown in Table 1 below:

[0074] Interface Name Interface Description malloc_buf(size) Apply for a memory area that has been registered on the RDMA network card free_buf(local_buf) Release the memory area applied through the malloc_buf interface

[0075] Table 1

[0076] Among them, size in the malloc_buf interface represents the size of the applied memory area, and local_buf in the free_buf interface represents the applied memory area.

[0077] Applying for or releasing memory areas for RDMA-based data transmission in the form of a call interface allows for flexible modification of the interface according to actual needs, retaining programmability.

[0078] The above data processing method may include the following steps:

[0079] Step 301: In response to a remote call initiated by the client to the server, store the call request data corresponding to the remote call in the first memory area.

[0080] In this embodiment, when the above client needs to make a remote call to the above server to call a function, method, service, etc. in the server, it may generate call request data corresponding to the remote call to the server. In this case, the client may store the call request data in the above first memory area in the client.

[0081] In practical applications, the remote call initiated by the above client to the above server may specifically be an RPC call or other types of calls that meet actual requirements. One or more embodiments of this specification do not limit this.

[0082] Step 302: Through an RDMA write operation, write the call request data from the first memory area to the third memory area, so that the server can obtain the call request data from the third memory area, perform call processing based on the call request data to obtain call result data corresponding to the call request data, and store the call result data in the fourth memory area.

[0083] In this embodiment, the above client may, through an RDMA write operation, write the above call request data from the above first memory area in the client to the above third memory area in the above server.

[0084] Specifically, the above client may push the above call request data from its user-mode memory to the above first RDMA network card, and the first RDMA network card transmits the call request data to the above second RDMA network card, and the above server stores the call request data from the second RDMA network card in its user-mode memory.

[0085] The above server (for example, a user-mode thread in the server) may obtain the above call request data from the above third memory area in the server.

[0086] In an illustrated implementation manner, the above server may periodically obtain data from the above third memory area according to a preset time period (which may be referred to as a second time period), so as to obtain the above call request data.

[0087] In the above case, the above server may perform call processing based on the above call request data to obtain call result data corresponding to the call request data.

[0088] Subsequently, the above server can store the above call result data in the above fourth memory area in the server.

[0089] Step 303: Remotely read the call result data from the fourth memory area to the second memory area through an RDMA read operation.

[0090] In this embodiment, the above client can remotely read the above call result data from the above fourth memory area in the above server to the above second memory area in the client through an RDMA read operation.

[0091] In an illustrated implementation, the above client can periodically remotely read data from the above fourth memory area in the above server through an RDMA read operation according to a preset time period (which can be referred to as the first time period), so as to remotely read the above call result data.

[0092] That is to say, the above server only needs to perform call processing based on the call request data, rather than actively returning the call result data obtained through call processing to the above client.

[0093] In practical applications, the above client can perform the above RDMA write operation or the above RDMA read operation in the form of a call interface. Correspondingly, the above server can obtain or store the above call request data in the form of a call interface.

[0094] The interfaces corresponding to the above functions can be as shown in Table 2 below:

[0095]

[0096] Table 2

[0097] Among them, server_id in the client_send interface and the client_recv interface represents the identifier of the server; client_id in the server_send interface and the server_recv interface represents the identifier of the client; size in the client_send interface and the server_send interface represents the size of the data.

[0098] That is to say, the above client can call the client_send interface and write the above call request data from the above first memory area in the client to the above third memory area in the above server through an RDMA write operation; call the client_recv interface and remotely read the above call result data from the above fourth memory area in the above server to the above second memory area in the client through an RDMA read operation.

[0099] The above-mentioned server can call the server_send interface to obtain the above-mentioned call request data from the above-mentioned third memory area in the server; call the server_recv interface to store the above-mentioned call result data in the above-mentioned fourth memory area in the server.

[0100] By means of calling interfaces, performing the above-mentioned RDMA write operation or the above-mentioned RDMA read operation, or obtaining the above-mentioned call request data or storing the above-mentioned call request data, the interfaces can be flexibly modified according to actual requirements, retaining programmability.

[0101] In an illustrated embodiment, when the above-mentioned client writes the above-mentioned call request data from the above-mentioned first memory area to the above-mentioned third memory area through an RDMA write operation, it can specifically first set corresponding status information for the call request data, and then write the status information and the call request data from the first memory area to the third memory area through an RDMA write operation.

[0102] In this case, the above-mentioned server can obtain the above-mentioned status information and the above-mentioned call request data from the above-mentioned third memory area in the server. Subsequently, it can first determine whether the call request data is in a to-be-processed state based on the status information. If the call request data is in a to-be-processed state, it can then perform call processing based on the call request data to obtain call result data corresponding to the call request data, so as to avoid repeated processing of the call request data.

[0103] It should be noted that in order to facilitate the detection of the status information corresponding to the call request data, the status information can be used as header information and added before the call request data, as shown in Table 3 below:

[0104] Status Information Request Data

[0105] Table 3

[0106] In this case, the above-mentioned server can first obtain the status information corresponding to the call request data and determine whether the call request data is in a to-be-processed state based on the status information.

[0107] In another illustrated embodiment, when the above-mentioned client writes the above-mentioned call request data from the above-mentioned first memory area to the above-mentioned third memory area through an RDMA write operation, it can specifically first set corresponding status information and a variable for indicating whether the RDMA write operation is completed for the call request data, and then write the variable, the status information and the call request data from the first memory area to the third memory area through an RDMA write operation.

[0108] In this case, the above-mentioned server can obtain the above-mentioned variable, the above-mentioned status information, and the above-mentioned call request data from the above-mentioned third memory area in the server. Subsequently, it is possible to first determine whether the RDMA write operation has been completed based on the variable, and determine whether the call request data is in a to-be-processed state based on the status information. If the RDMA write operation has been completed and the call request data is in a to-be-processed state, then call processing can be performed based on the call request data to obtain call result data corresponding to the call request data, so as to ensure that complete call request data is obtained and avoid duplicate processing of the call request data.

[0109] It should be noted that, on the one hand, in order to facilitate the detection of the status information corresponding to the call request data, the status information can be used as the header information and added before the request data. On the other hand, in order to facilitate the detection of the variable used to indicate whether the RDMA write operation has been completed, the variable can be used as the tail variable and added after the call request data, as shown in Table 4 below:

[0110] Status Information Request Data Variable

[0111] Table 4

[0112] In this case, on the one hand, the above-mentioned server can first obtain the status information corresponding to the call request data and determine whether the call request data is in a to-be-processed state based on the status information. On the other hand, when it is determined that the RDMA write operation has been completed based on the variable after the call request data, it can be determined that the complete call request data has been received.

[0113] In practical applications, the header information set for the call request data in the above-mentioned first memory area of the above-mentioned client can include, in addition to the status information corresponding to the call request data, information indicating the data size of the call request data, as shown in Table 5 below:

[0114] Status Information Data Size Information Request Data Variable

[0115] Table 5

[0116] Similarly, header information can also be set for the call result data in the above-mentioned fourth memory area of the above-mentioned server. Among them, the header information can include the status information corresponding to the call result data, information indicating the data size of the call result data, and information indicating the time duration consumed by the server for call processing based on the corresponding call request data to obtain the call result data, as shown in Table 6 below:

[0117] Status Information Data Size Information Elapsed Time Information Result Data Variable

[0118] Table 6

[0119] Among them, the time duration for the server to perform call processing based on the call request data to obtain the call result data can be used to reflect the load condition of the server.

[0120] In the above technical solution, the client can store the call request data in a first memory area maintained by it corresponding to a first RDMA network card, and through an RDMA write operation, write the call request data from the first memory area to a third memory area maintained by the server corresponding to a second RDMA network card; the server can obtain the call request data from the third memory area, perform call processing based on the call request data to obtain call result data corresponding to the call request data, and store the call result data in a fourth memory area maintained by it corresponding to the second RDMA network card; the client can remotely read the call result data from the fourth memory area to a second memory area maintained by it corresponding to the first RDMA network card through an RDMA read operation.

[0121] In the above manner, on the one hand, since the client can send the call request data to the server, and the server is responsible for performing call processing based on the call request data, it can avoid the client performing call processing by itself, and the server performs call processing based on the call request data. In this case, functions, methods, services, etc. in the server called by the client can be flexibly modified according to actual requirements, retaining programmability.

[0122] On the other hand, since the server does not need to actively return the call result data obtained through call processing to the client, but the client remotely obtains the call result data stored in the server through an RDMA read operation, the CPU of the server does not need to participate in data transmission, which can reduce the performance consumption of the CPU of the server.

[0123] Please combine Figure 2 with Figure 4 and Figure 4 is a flowchart of another data processing method shown in an exemplary embodiment of this specification.

[0124] The above data processing method can be applied to the server in a C / S architecture. For example, the data processing method can be implemented by a user-mode thread in the server.

[0125] The above data processing method may include the following steps:

[0126] Step 401: Obtain call request data from the third memory area; wherein, the call request data is written from the first memory area to the second memory area by the client through an RDMA write operation.

[0127] Step 402: Perform call processing based on the call request data to obtain call result data corresponding to the call request data.

[0128] Step 403: Store the call result data in the fourth memory area, so that the client remotely reads the call result data from the fourth memory area to the second memory area through an RDMA read operation.

[0129] For the specific implementation of the above steps 401 to 403, reference can be made to the foregoing steps 301 to 303, which will not be elaborated herein.

[0130] In the above technical solution, the client can store the call request data in the first memory area maintained by it corresponding to the first RDMA network card, and write the call request data from the first memory area to the third memory area maintained by the server corresponding to the second RDMA network card through an RDMA write operation; the server can obtain the call request data from the third memory area, perform call processing based on the call request data to obtain call result data corresponding to the call request data, and store the call result data in the fourth memory area maintained by it corresponding to the second RDMA network card; the client can remotely read the call result data from the fourth memory area to the second memory area maintained by it corresponding to the first RDMA network card through an RDMA read operation.

[0131] In the above manner, on the one hand, since the client can send the call request data to the server, and the server is responsible for performing call processing based on the call request data, it can avoid the client performing call processing by itself, and the server performs call processing based on the call request data. In this case, the functions, methods, or services in the server called by the client can be flexibly modified according to actual needs, retaining programmability.

[0132] On the other hand, since the server does not need to actively return the call result data obtained through call processing to the client, but the client remotely obtains the call result data stored in the server through an RDMA read operation, the CPU of the server does not need to participate in data transmission, which can reduce the performance consumption of the CPU of the server.

[0133] Please refer to Figure 5 , Figure 5 which is a schematic diagram of the hardware structure of a device shown in an exemplary embodiment of this specification.

[0134] Such as Figure 5As shown, at the hardware level, the above device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 710. Of course, it may also include other hardware required for other services. One or more embodiments of this specification can be implemented in software. For example, the processor 502 reads the corresponding computer program from the non-volatile memory 710 into the memory 508 and then runs it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic module, but can also be hardware or logic devices.

[0135] Please refer to Figure 6 , Figure 6 which is a block diagram of a data processing device shown in an exemplary embodiment of this specification.

[0136] The above data processing device can be applied to a client; the network device where the client is located is equipped with a first Remote Direct Memory Access (RDMA) network card; the client maintains a first memory area corresponding to the first RDMA network card for storing call request data, and a second memory area for storing call result data.

[0137] The above data processing device may include:

[0138] A storage module 601, configured to store call request data corresponding to the remote call initiated by the client into the first memory area in response to the remote call to the server; wherein, the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data;

[0139] A sending module 602, configured to write the call request data from the first memory area to the third memory area through an RDMA write operation, so that the server obtains the call request data from the third memory area, performs call processing based on the call request data, obtains call result data corresponding to the call request data, and stores the call result data in the fourth memory area;

[0140] A obtaining module 603, configured to remotely read the call result data from the fourth memory area to the second memory area through an RDMA read operation.

[0141] Optionally, the sending module is specifically configured to:

[0142] Set status information for the call request data, and through an RDMA write operation, write the status information and the call request data from the first memory area to the third memory area, so that the server can obtain the status information and the call request data from the third memory area. When it is determined that the call request data is in a to-be-processed state based on the status information, perform a call process based on the call request data to obtain call result data corresponding to the call request data, and store the call result data in the fourth memory area.

[0143] Optionally, the sending module is specifically configured to:

[0144] Set status information for the call request data and a variable indicating whether the RDMA write operation is completed, and through an RDMA write operation, write the variable, the status information, and the call request data from the first memory area to the third memory area, so that the server can obtain the variable, the status information, and the call request data from the third memory area. When it is determined that the RDMA write operation is completed based on the variable and the call request data is in a to-be-processed state based on the status information, perform a call process based on the call request data to obtain call result data corresponding to the call request data, and store the call result data in the fourth memory area.

[0145] Optionally, the obtaining module is specifically configured to:

[0146] Periodically read the call result data from the fourth memory area to the second memory area remotely through an RDMA read operation according to a preset first time period.

[0147] Optionally, the client has pre-registered several memory areas for RDMA data transmission on the first RDMA network card; the apparatus further includes:

[0148] An application module, configured to apply for the first memory area or the second memory area from the several memory areas;

[0149] A release module, configured to release the first memory area or the second memory area back to the several memory areas.

[0150] Please refer to Figure 7 , Figure 7 which is a block diagram of another data processing apparatus shown in an exemplary embodiment of this specification.

[0151] The above data processing device can be applied to a server; the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data.

[0152] The above data processing device may include:

[0153] An acquisition module 701, configured to acquire call request data from the third memory area; wherein, the call request data is written from a first memory area to a second memory area by a client through an RDMA write operation; the network device where the client is located is equipped with a first RDMA network card; the client maintains the first memory area corresponding to the first RDMA network card for storing call request data, and the second memory area for storing call result data;

[0154] A processing module 702, configured to perform call processing based on the call request data to obtain call result data corresponding to the call request data;

[0155] A storage module 703, configured to store the call result data in the fourth memory area, so that the client remotely reads the call result data from the fourth memory area to the second memory area through an RDMA read operation.

[0156] Optionally, the acquisition module is specifically configured to:

[0157] Acquire call request data and status information set by the client for the call request data from the third memory area;

[0158] The processing module is specifically configured to:

[0159] Determine whether the call request data is in a to-be-processed state based on the status information;

[0160] If the call request data is in a to-be-processed state, perform call processing based on the call request data to obtain call result data corresponding to the call request data.

[0161] Optionally, the acquisition module is specifically configured to:

[0162] Acquire call request data, status information set by the client for the call request data, and a variable for indicating whether the RDMA write operation is completed from the third memory area;

[0163] The processing module is specifically configured to:

[0164] Determine whether the RDMA write operation is completed based on the variable, and determine whether the call request data is in a pending state based on the status information;

[0165] If the RDMA write operation is completed and the call request data is in a pending state, perform call processing based on the call request data to obtain call result data corresponding to the call request data.

[0166] Optionally, the obtaining module is specifically configured to:

[0167] Periodically obtain call request data from the third memory area according to a preset second time period.

[0168] Optionally, the server has pre-registered a number of memory areas for RDMA data transmission on the second RDMA network card; the device further includes:

[0169] An application module, configured to apply for the third memory area or the fourth memory area from the number of memory areas;

[0170] A release module, configured to release the third memory area or the fourth memory area back to the number of memory areas.

[0171] Continue to refer to Figure 1 As described above, the data processing system may include:

[0172] A client and a server; wherein, the network device where the client is located is equipped with a first Remote Direct Memory Access (RDMA) network card; the client maintains a first memory area corresponding to the first RDMA network card for storing call request data, and a second memory area for storing call result data; the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data;

[0173] The client and the server are configured to:

[0174] The client, in response to a remote call initiated by the client to the server, stores call request data corresponding to the remote call in the first memory area;

[0175] The client writes the call request data from the first memory area to the third memory area through an RDMA write operation;

[0176] The server obtains the call request data from the third memory area;

[0177] The server performs a call process based on the call request data to obtain call result data corresponding to the call request data;

[0178] The server stores the call result data in the fourth memory area;

[0179] The client remotely reads the call result data from the fourth memory area to the second memory area through an RDMA read operation.

[0180] For the device embodiments and system embodiments, they basically correspond to the method embodiments. Therefore, for the relevant parts, refer to the partial descriptions of the method embodiments.

[0181] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the technical solution of this specification.

[0182] The systems, devices, modules or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any several of these devices.

[0183] In a typical configuration, a computer includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.

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

[0185] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change 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 technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0186] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0187] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0188] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0189] It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0190] The above are only the preferred embodiments of one or more embodiments of this specification and are not intended to limit one or more embodiments of this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of one or more embodiments of this specification shall be included within the scope protected by one or more embodiments of this specification.

Claims

1. A data processing method, which is applied to a client; the network device where the client is located is equipped with a first Remote Direct Memory Access (RDMA) network card; the client maintains a first memory area corresponding to the first RDMA network card for storing call request data, and a second memory area for storing call result data; the method includes: In response to a remote call initiated by the client to the server, storing the call request data corresponding to the remote call in the first memory area; wherein, the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data; Setting status information for the call request data, and writing the status information and the call request data from the first memory area to the third memory area through an RDMA write operation, so that the server can obtain the status information and the call request data from the third memory area, and when it is determined that the call request data is in a to-be-processed state based on the status information, performing call processing based on the call request data to obtain call result data corresponding to the call request data, and storing the call result data in the fourth memory area; Remotely reading the call result data from the fourth memory area to the second memory area through an RDMA read operation.

2. The method according to claim 1, wherein setting status information for the call request data, and writing the call request data from the first memory area to the third memory area through an RDMA write operation, so that the server can obtain the call request data from the third memory area, performing call processing based on the call request data to obtain call result data corresponding to the call request data, and storing the call result data in the fourth memory area, includes: Setting status information and a variable for indicating whether the RDMA write operation is completed for the call request data, and writing the variable, the status information, and the call request data from the first memory area to the third memory area through an RDMA write operation, so that the server can obtain the variable, the status information, and the call request data from the third memory area, and when it is determined that the RDMA write operation is completed based on the variable and it is determined that the call request data is in a to-be-processed state based on the status information, performing call processing based on the call request data to obtain call result data corresponding to the call request data, and storing the call result data in the fourth memory area.

3. The method according to claim 1, wherein remotely reading the call result data from the fourth memory area to the second memory area through an RDMA read operation, includes: Periodically remotely reading the call result data from the fourth memory area to the second memory area through an RDMA read operation according to a preset first time period.

4. According to the method described in claim 1, the client has pre-registered several memory areas for RDMA data transmission on the first RDMA network card; the method further includes: Applying for the first memory area or the second memory area from the several memory areas; Releasing the first memory area or the second memory area back to the several memory areas.

5. A data processing method, which is applied to a server; the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data; the method includes: Obtaining call request data and status information set by the client for the call request data from the third memory area; wherein, the call request data is written from the first memory area to the second memory area by the client through an RDMA write operation; the network device where the client is located is equipped with a first RDMA network card; the client maintains the first memory area corresponding to the first RDMA network card for storing call request data, and the second memory area for storing call result data; Determining whether the call request data is in a to-be-processed state based on the status information; If the call request data is in a to-be-processed state, performing call processing based on the call request data to obtain call result data corresponding to the call request data; Storing the call result data in the fourth memory area so that the client can remotely read the call result data from the fourth memory area to the second memory area through an RDMA read operation.

6. According to the method described in claim 5, the obtaining of call request data from the third memory area includes: Obtaining call request data, status information set by the client for the call request data, and a variable for indicating whether the RDMA write operation has been completed from the third memory area; The performing call processing based on the call request data to obtain call result data corresponding to the call request data includes: Determining whether the RDMA write operation has been completed based on the variable, and determining whether the call request data is in a to-be-processed state based on the status information; If the RDMA write operation has been completed and the call request data is in a to-be-processed state, performing call processing based on the call request data to obtain call result data corresponding to the call request data.

7. According to the method described in claim 5, the obtaining of call request data from the third memory area includes: Periodically obtaining call request data from the third memory area according to a preset second time period.

8. According to the method described in claim 5, the server has pre-registered several memory areas for RDMA data transmission on the second RDMA network card; the method further includes: Applying for the third memory area or the fourth memory area from the several memory areas; Releasing the third memory area or the fourth memory area back to the several memory areas.

9. A data processing system, comprising: a client and a server; wherein, the network device where the client is located is equipped with a first Remote Direct Memory Access (RDMA) network card; the client maintains a first memory area corresponding to the first RDMA network card for storing call request data, and a second memory area for storing call result data; the network device where the server is located is equipped with a second RDMA network card; the server maintains a third memory area corresponding to the second RDMA network card for storing call request data, and a fourth memory area for storing call result data; The client and the server are configured to: In response to a remote call initiated by the client to the server, the client stores call request data corresponding to the remote call in the first memory area; The client sets status information for the call request data, and writes the call request data from the first memory area to the third memory area through an RDMA write operation; The server obtains the call request data and the status information set by the client for the call request data from the third memory area; The server determines whether the call request data is in a to-be-processed state based on the status information; if the call request data is in a to-be-processed state, the server performs call processing based on the call request data to obtain call result data corresponding to the call request data; The server stores the call result data in the fourth memory area; The client remotely reads the call result data from the fourth memory area to the second memory area through an RDMA read operation.

10. An electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein, the processor realizes the method according to any one of claims 1 to 8 by running the executable instructions.

11. A computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the method according to any one of claims 1 to 8 is realized.

Citation Information

Patent Citations

  • Method and system for obtaining remote data based on RDMA (Remote Direct Memory Access) characteristics

    CN105630426A