CN113326155B - Information processing method, device, system and storage medium - Google Patents

Information processing method, device, system and storage medium Download PDF

Info

Publication number
CN113326155B
CN113326155B CN202110720942.7A CN202110720942A CN113326155B CN 113326155 B CN113326155 B CN 113326155B CN 202110720942 A CN202110720942 A CN 202110720942A CN 113326155 B CN113326155 B CN 113326155B
Authority
CN
China
Prior art keywords
rdma
request
rpc
memory
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110720942.7A
Other languages
Chinese (zh)
Other versions
CN113326155A (en
Inventor
周炜
雍帅
霍道安
刘烨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202110720942.7A priority Critical patent/CN113326155B/en
Publication of CN113326155A publication Critical patent/CN113326155A/en
Application granted granted Critical
Publication of CN113326155B publication Critical patent/CN113326155B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the application discloses an information processing method, which is applied to a client node and comprises the following steps: detecting a first Remote Procedure Call (RPC) request generated by a first target application, and determining a server node and a target communication channel based on the first target application; generating a remote memory direct access RDMA request based on the first RPC request; sending the RDMA request to the server node by adopting an RDMA bilateral primitive through the target communication channel; receiving an RDMA response sent by the server node by adopting the RDMA bilateral primitive through the target communication channel; wherein the RDMA reply is generated by the server node in response to the RDMA request. The embodiment of the application also discloses a client device, a server device, a system and a storage medium.

Description

Information processing method, device, system and storage medium
Technical Field
The present application relates to the field of distributed systems, and in particular, to an information processing method, apparatus, system, and storage medium.
Background
With the development of the internet of things (The Internet of Things, IOT) and industry 4.0, cloud computing is also rapidly emerging. Distributed storage has also received extensive attention and development as the largest application of cloud computing. Distributed storage is used as a network storage, and clusters are built by using a network interconnection mode to enable storage nodes to provide more reliable high-performance storage side services to the outside. One distributed storage service that is currently in common use is remote memory direct access (Remote Direct Memory Access, RDMA), which bypasses the central processor (Central Process Unit, CPU) entirely through the network card, enabling memory data exchange between the two devices. RDMA is used as a network transmission technology realized by hardware, so that the network transmission efficiency can be greatly improved, and the network Input/Output (IO) dense service is helped to obtain lower time delay and larger throughput.
In the existing distributed storage system realized by RDMA, both communication parties need to copy and analyze the memory in the communication process, so that the resource consumption in the communication process is larger, and the performance of the distributed storage system realized by RDMA is lower.
Disclosure of Invention
In view of this, embodiments of the present application expect to provide an information processing method, an apparatus, a system, and a storage medium, which solve the problem that in the communication process of two communication parties in the distributed storage system implemented by RDMA at present, the memory needs to be copied and parsed, resulting in greater resource consumption in the communication process.
In order to achieve the above purpose, the technical scheme of the application is realized as follows:
in a first aspect, an information processing method, the method being applied to a client node, the method comprising:
detecting a first Remote Procedure Call (RPC) request generated by a first target application, and determining a server node and a target communication channel based on the first target application;
Generating a remote memory direct access RDMA request based on the first RPC request;
sending the RDMA request to the server node by adopting an RDMA bilateral primitive through the target communication channel;
receiving an RDMA response sent by the server node by adopting the RDMA bilateral primitive through the target communication channel; wherein the RDMA reply is generated by the server node in response to the RDMA request.
In a second aspect, an information processing method, the method being applied to a server node, the method comprising:
RDMA requests sent by client nodes are received by adopting RDMA bilateral primitives through a target communication channel; wherein the RDMA request is generated by the client node based on a first RPC request corresponding to a first target application;
generating an RDMA reply based on the RDMA request;
and sending the RDMA response to the client node by adopting the RDMA bilateral primitive through the target communication channel.
In a third aspect, a client device, the device comprising: the device comprises a first determining unit, a first generating unit, a first transmitting unit and a first receiving unit; wherein:
the first determining unit is configured to detect a first RPC request generated by a first target application, and determine, based on the first target application, a server node and a target communication channel;
The first generating unit is configured to generate a remote memory direct access RDMA request based on the first RPC request;
the first sending unit is configured to send, through the target communication channel, the RDMA request to the server node by using an RDMA bilateral primitive;
the first receiving unit is configured to receive, through the target communication channel, an RDMA response sent by the server node by using the RDMA bilateral primitive; wherein the RDMA reply is generated by the server node in response to the RDMA request.
In a fourth aspect, a server device, the device includes: a second receiving unit, a second generating unit and a second transmitting unit; wherein:
the second receiving unit is configured to receive, through a target communication channel, an RDMA request sent by a client node by using an RDMA bilateral primitive;
the second generating unit is configured to generate an RDMA response based on the RDMA request;
the second sending unit is configured to send, through the target communication channel, the RDMA reply to the client node by using the RDMA bilateral primitive.
In a fifth aspect, an information processing system includes: a client node and a server node; wherein:
The client node being configured to implement the steps of the information processing method according to any one of the above;
the server node is configured to implement the steps of the information processing method according to any one of the foregoing claims.
A sixth aspect is a storage medium having stored thereon an information processing program which, when executed by a processor, implements the steps of the information processing method according to any one of the above.
If a first RPC request generated by a first target application is detected, a client node determines a service node and a target communication channel based on the first target application, and sends an RDMA request to the service node by adopting an RDMA bilateral primitive through the target communication channel after generating the RDMA request based on the first RPC request, and the service node receives the RDMA request sent by the client node by adopting the RDMA bilateral primitive through the target communication channel, generates an RDMA response based on the RDMA request and sends the RDMA response to the client node by adopting the RDMA bilateral primitive through the target communication channel. In this way, the client node determines the server node and the target communication channel through the first RPC request generated by the first target application, generates the RDMA request based on the first RPC request, and then sends the RDMA request to the server node through the target communication channel, so that the server node responds to the RDMA request, generates a corresponding RDMA response, and sends the generated RDMA response to the client node through the target communication channel, thereby solving the problem that the memory needs to be copied and parsed in the communication process of both communication parties in the distributed storage system realized by RDMA at present, resulting in larger resource consumption in the communication process.
Drawings
Fig. 1 is a schematic flow chart of an information processing method according to an embodiment of the present application;
FIG. 2 is a flowchart of another information processing method according to an embodiment of the present application;
FIG. 3 is a flowchart of another information processing method according to an embodiment of the present application;
FIG. 4 is a flowchart of another information processing method according to an embodiment of the present application;
FIG. 5 is a flowchart of an information processing method according to another embodiment of the present application;
FIG. 6 is a flowchart illustrating another information processing method according to another embodiment of the present application;
FIG. 7 is a flowchart of another information processing method according to another embodiment of the present application;
FIG. 8 is a flowchart of another information processing method according to another embodiment of the present application;
FIG. 9 is a flowchart of an information processing method according to another embodiment of the present application;
FIG. 10 is a schematic diagram of a frame structure of an information processing system according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a data structure of an RPC request according to an embodiment of the present application;
FIG. 12 is a schematic diagram of a data structure of a request header according to an embodiment of the present application;
FIG. 13 is a schematic diagram of a data structure of request data according to an embodiment of the present application;
FIG. 14 is a schematic diagram of a data structure of a memory in request data according to an embodiment of the present application;
FIG. 15 is a schematic diagram of a data structure of an RDMA request according to an embodiment of the present application;
FIG. 16 is a schematic diagram of a data structure of an RDMA transfer request according to an embodiment of the present application;
FIG. 17 is a schematic diagram of a data structure of a memory in an RDMA transfer request according to an embodiment of the present application;
fig. 18 is a schematic diagram of a data structure of an RPC response according to an embodiment of the present application;
FIG. 19 is a schematic diagram of a data structure of an RDMA response according to an embodiment of the present application;
fig. 20 is a schematic structural diagram of a client device according to an embodiment of the present application;
fig. 21 is a schematic structural diagram of a server device according to an embodiment of the present application;
fig. 22 is a schematic structural diagram of an information processing system according to an embodiment of the present application.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
An embodiment of the present application provides an information processing method, which is applied to a client node, and is shown with reference to fig. 1, the method including the steps of:
Step 101, detecting a first remote procedure call RPC request generated by a first target application, and determining a server node and a target communication channel based on the first target application.
In the embodiment of the application, communication is performed between the client node and the server node in an RPC form, wherein the first target application is an upper layer application on the client node side in the RPC framework. The client node is a message initiator, the server node is a message receiving and responding agent, after receiving the request sent by the client node, the upper layer application at the server node side carries out corresponding processing on the request sent by the client node, obtains corresponding response, and then returns the obtained corresponding response to the client node. The target communication channel is an independent communication channel created separately when the client node communicates with the server node.
The service end node has a corresponding relation with the first target application, namely, the service requested by the first target application can be provided for the first target application.
Step 102, generating a remote memory direct access RDMA request based on the first RPC request.
In the embodiment of the application, the RPC communication is realized between the client node and the service end node, so the client node needs to generate RDMA request from the request content included in the first RPC request.
Illustratively, the first RPC request includes at least a communication Channel (Channel) pointer, a request header, request data, a callback function, and a callback parameter pointer, and the RDMA request is generated based on the request header in the first RPC request and the memory address in the first RPC request.
Step 103, sending an RDMA request to a server node by adopting an RDMA bilateral primitive through a target communication channel.
In an embodiment of the application, RDMA requests are sent to the server node over the target communication channel using RDMA double edge primitives, such as RDMA_SEND.
Step 104, receiving RDMA response sent by the service end node by adopting RDMA bilateral primitive through the target communication channel.
Wherein the RDMA reply is generated by the server node in response to the RDMA request.
In the embodiment of the application, RDMA double-sided primitives such as RDMA_RECV are adopted to receive RDMA response sent by a service end node through a target communication channel. In this way, the RDMA bilateral primitive mode is adopted for data transmission, and high-performance communication with low delay, low CPU (Central Processing Unit, CPU) overhead and low memory bandwidth overhead is realized.
According to the information processing method provided by the embodiment of the application, if the first RPC request generated by the first target application is detected, the client node determines the server node and the target communication channel based on the first target application, and after generating the RDMA request based on the first RPC request, the RDMA request is sent to the server node through the target communication channel by adopting the RDMA bilateral primitive, and finally, the RDMA response sent by the server node is received through the target communication channel by adopting the RDMA bilateral primitive. In this way, the client node determines the server node and the target communication channel through the first RPC request generated by the first target application, generates the RDMA request based on the first RPC request, and then sends the RDMA request to the server node through the target communication channel, so that the server node responds to the RDMA request, generates a corresponding RDMA response, and sends the generated RDMA response to the client node through the target communication channel, thereby solving the problem that the memory needs to be copied and parsed in the communication process of both communication parties in the distributed storage system realized by RDMA at present, resulting in larger resource consumption in the communication process.
Based on the foregoing embodiments, an embodiment of the present application provides an information processing method, which is applied to a server node, and is shown with reference to fig. 2, and includes the following steps:
step 201, receiving an RDMA request sent by a client node by using an RDMA bilateral primitive through a target communication channel.
Wherein the RDMA request is generated by the client node based on a first RPC request corresponding to the first target application.
In the embodiment of the present application, the server node is a specific node determined by the client node according to the first RPC request. It should be noted that, a client node may establish communication connection with multiple server nodes, and each server node may also establish communication connection with multiple client nodes. The server node may employ RDMA bilateral primitives, such as rdma_recv, to receive the first RPC request sent by the client node.
Step 202, generating an RDMA response based on the RDMA request.
In the embodiment of the application, after receiving the RDMA request, the server node calls an upper layer application corresponding to the RDMA request in the server node to respond to the RDMA request, and generates response information of the upper layer application in the server node to obtain an RDMA response.
Step 203, sending an RDMA response to the client node by using the RDMA bilateral primitive through the target communication channel.
In the embodiment of the application, after the server node generates the RDMA response, the RDMA response can be sent to the client node through an RDMA bilateral primitive such as RDMA_SEND.
According to the information processing method provided by the embodiment of the application, the server node receives the RDMA request sent by the client node through the target communication channel by adopting the RDMA bilateral primitive, generates an RDMA response based on the RDMA request, and finally sends the RDMA response to the client node through the target communication channel by adopting the RDMA bilateral primitive. In this way, the client node determines the server node and the target communication channel through the first RPC request generated by the first target application, generates the RDMA request based on the first RPC request, and then sends the RDMA request to the server node through the target communication channel, so that the server node responds to the RDMA request to generate a corresponding RDMA response, and sends the generated RDMA response to the client node, thereby solving the problem that the memory needs to be copied and parsed in the communication process of two parties in the distributed storage system realized by RDMA at present, resulting in larger resource consumption in the communication process.
Based on the foregoing embodiments, an embodiment of the present application provides an information processing method, as shown with reference to fig. 3, including the steps of:
step 301, detecting a first RPC request generated by a first target application, where the client node determines an internet protocol IP address and a port number indicated by the first target application.
Wherein the first RPC request includes: the system comprises a channel pointer, an RPC request header, request data, a callback function and a callback parameter pointer, wherein the channel pointer is used for pointing to a server node; wherein the first RPC request header includes at least: request type, data transmission direction, message version number and application custom block, the application custom block is used for realizing type conversion to the first RPC request according to the demand, and the request data at least comprises: at least one of remotely accessible memory information and reference counts.
In the embodiment of the application, the IP address and the port number indicated by the first target application are the IP address and the port number corresponding to the server node.
Step 302, the client node creates a connection between the channel creation interface and the server node based on the IP address and the port number, and obtains a target communication channel.
In embodiments of the application, the client node may invoke an RDMA programming library to create RDMA connection resources based on the determined IP address and port number of the server node and establish an RDMA communication connection by creating a target communication channel.
In the foregoing embodiment, step 101 may be implemented through steps 301 to 302. Steps 301-302 may be implemented as a stand-alone embodiment, where the target communication channel may be created only when there is information transfer between the client node and the server node, and may be removed when there is no information transfer between the client node and the server node.
Step 303, the client node generates a remote memory direct access RDMA request based on the first RPC request.
Step 304, the client node sends an RDMA request to the server node through the target communication channel by adopting an RDMA bilateral primitive.
In step 305, the server node receives, through the target communication channel, an RDMA request sent by the client node by using an RDMA bilateral primitive.
Wherein the RDMA request is generated by the client node based on a first RPC request corresponding to the first target application.
Step 306, the server node generates an RDMA response based on the RDMA request.
Step 307, the server node sends an RDMA response to the client node through the target communication channel by adopting an RDMA bilateral primitive.
Step 308, the client node receives, through the target communication channel, the RDMA response sent by the server node by adopting the RDMA bilateral primitive.
Wherein the RDMA reply is generated by the server node in response to the RDMA request.
Based on the foregoing embodiments, in other embodiments of the present application, referring to fig. 4, before the client node performs step 303, the method is further used to perform steps 309 to 310:
step 309, detecting that the RPC request queue corresponding to the target communication channel is not full, and the client node writes the first RPC request into the tail of the RPC request queue.
In the embodiment of the application, the RPC request queue is created by the client node when the target communication channel is created and is used for storing the RPC request issued by the upper layer application at the client node side. The RPC requests stored in the RPC request queue follow the first-in first-out, last-in last-out principle.
Step 310, the client node adds 1 to the reference count included in the first RPC request.
In the embodiment of the present application, the initial value of the reference count in the first RPC request is 1, 1 is added when the request data in the first RPC request is referenced, 1 is subtracted when the request data in the first RPC request is released, and the memory pointed by at least one memory information in the request data and the first RPC request in the first request is released when the reference count is subtracted to 0.
Based on the foregoing embodiments, in other embodiments of the present application, step 303 may be implemented by steps 303a to 303 c:
In step 303a, it is detected that the state of the target communication channel is the target state, and it is detected that the first RDMA request queue is not full, and the RPC request queue is not empty, and the client node fetches the first RPC request from the head of the RPC request queue.
Wherein the first RDMA request queue is used to record RDMA requests that have been issued but not returned an acknowledgement.
In the embodiment of the present application, the state of the target communication channel is a target state, which means that the target communication channel can normally transmit information, that is, connect to a normal state. The RDMA requests stored in the first RDMA request queue also follow the first-in-first-out principle. When detecting that the state of the target communication channel is in a connection abnormal state, or the first RDMA request queue is full or the RPC request queue is empty, the client node exits, and does not execute subsequent operations. The client node fetches the first RPC request from the head of the RPC request queue, which means that when the first RPC request moves to the head of the RPC request queue, the client node fetches the first RPC request from the head of the RPC request queue for subsequent operations.
Step 303b, the client node determines RDMA identification information of the RDMA request to be generated.
In the embodiment of the application, the RDMA identification information is identification information for uniquely identifying the RDMA request, and can be recorded as RDMA identity information.
In step 303c, the client node obtains an RPC request header, at least one accessible memory information, and RDMA identification information from the first RPC request, and generates an RDMA request.
In the embodiment of the application, the client node puts the RPC request header in the first RPC request into the created RDMA request, puts at least one piece of accessible memory information into the region of the memory address in the RDMA request, and sets RDMA identification information in the RDMA request, thereby obtaining the RDMA request.
Based on the foregoing embodiments, in other embodiments of the present application, referring to fig. 5, before the client node performs step 303c, the method is further used to perform steps 311 to 312:
step 311, the client node obtains at least one memory address included in the at least one accessible memory information.
In the embodiment of the present application, the client node obtains at least one memory address allocated to the memory that can be accessed remotely by the server node, that is, the memory that can be accessed remotely by the server node includes at least one memory address.
In step 312, it is detected that at least one memory address includes at least one destination address not registered as an RDMA memory, and the client node registers the memory corresponding to the at least one destination address as an RDMA memory.
In an embodiment of the present application, the memory registered as RDMA memory may be represented in the form of a Key-Value pair (Key-Value). Thus, the registered RDMA memory corresponds to a key word, so that the key words corresponding to different memory addresses can be searched to determine whether the acquired at least one memory address is registered, and if at least one unregistered target address exists, RDMA memory registration is performed on the at least one target address.
Based on the foregoing embodiments, in an embodiment of the present application, step 312 may be implemented by steps 312a to 312 b:
in step 312a, the client node obtains memory address information including memory registered as RDMA memory.
In the embodiment of the present application, the memory address information registered as the RDMA memory may be represented in the form of an RDMA memory key map, but may also be represented in other forms, such as a list, etc.
Step 312b, if the memory address information does not include at least one target address in the at least one memory address, registering the memory corresponding to the at least one target address as an RDMA memory.
In the embodiment of the application, if the keyword information indicating the correspondence of one target address is not found in the memory address information, it is determined that the memory corresponding to at least one target address is not registered as an RDMA memory, so that RDMA memory registration processing is performed on the memory corresponding to at least one target address, specifically, the memory corresponding to at least one target address can be registered by calling an RDMA library function, and the keyword corresponding to at least one target address is obtained.
Based on the foregoing embodiment, in the embodiment of the present application, after the client node performs step 312b, step 312c may also be performed:
step 312c, the client node updates the memory address information based on the at least one target address.
In the embodiment of the application, after the client node registers at least one target address as the RDMA memory, in order to ensure that the server node and the client node can quickly determine which memories are the RDMA memory, the memory corresponding to the registered at least one target address and the corresponding key words can be updated into the memory address information, thereby effectively improving the working efficiency of the server node and the client node.
Based on the foregoing embodiments, in other embodiments of the present application, as shown with reference to fig. 6, the client node is further configured to perform steps 313-317, and/or steps 318-320 before performing step 308:
step 313, the client node detects, at a preset time interval, a first duration from a time point when the first RPC request is fetched from the head of the RPC request queue to a current time point, and a second duration from a time point when the RDMA request is sent to the server node to the current time point.
In the embodiment of the application, the preset time interval is a time period experience value obtained according to a large number of experiments or users according to own needs or experiences. Namely, the client node detects a first duration from the first RPC request to the current time taken out of the RPC request queue at preset time intervals, and detects a second duration from the time of sending the RDMA request to the server node to the current time. It should be noted that the preset time interval and the time period when the first duration of the first RPC request is detected may be different from or the same as the preset time interval when the RDMA request is detected, that is, the time when the first duration of the first RPC request is detected may be the same as or different from the time when the second duration of the RDMA request is detected.
If the first time period is greater than the first threshold, the client node determines that the first response result for the first RPC request is a response timeout in step 314.
In the embodiment of the present application, the first threshold may be an empirical value of a duration obtained according to a plurality of experiments or user settings according to own needs or experiences.
Step 315, the client node calls a callback function in the first RPC request to return a first response result to the first target application.
In the embodiment of the application, the callback function in the first RPC request is specified by the first target application on the client node side. And the client node calls a callback function in the first RPC request to return a first response result of the response timeout of the first RPC request to the first target application, so that the first target application performs subsequent processing based on the first response result.
Step 316, the client node deletes the first RPC request from the RPC request queue.
In the embodiment of the application, because the response to the first RPC request is overtime, the first RPC request is deleted from the RPC request queue, so that the client node can quickly execute the operation to other RPC requests in the RPC request queue, and the processing efficiency of the client node is effectively improved.
In step 317, the client node decrements the reference count in the first RPC request by 1.
If the second time period is greater than the second threshold, the client node determines that the second response result for the RDMA request is a response timeout, step 318.
In the embodiment of the present application, the second threshold may be an empirical value of a duration obtained according to a plurality of experiments or user settings according to own needs or experiences.
In step 319, the client node calls a callback function in the first RPC request to return a second response result to the first target application.
Step 320, the client node identifies an RDMA request timeout.
Wherein, when the client node performs steps 313 to 317 and/or steps 318 to 320, the client node may perform steps 306 to 307 simultaneously with the server node, may perform steps 306 or 307, or may perform steps 306 and 307, and the specific execution situation may be determined according to the actual situation.
Based on the foregoing embodiment, in other embodiments of the present application, referring to fig. 7, after the client node performs step 304, the method further includes performing step 321:
step 321, the client node writes an RDMA request into a first RDMA request queue.
In an embodiment of the application, a client node writes an RDMA request to the tail of a first RDMA request queue.
Based on the foregoing embodiments, in other embodiments of the present application, referring to fig. 8, after the client node performs step 308, the method further includes performing steps 322 to 325:
step 322, the client node counts a third time period from a time when the RDMA request is sent to the server node to a time when the RDMA reply sent by the server node is received.
Step 323, if the third duration is less than or equal to the third threshold, the client node invokes a callback function in the first RPC request to return an RDMA response to the first target application.
In the embodiment of the present application, the third threshold may be an empirical value of a duration obtained according to a plurality of experiments or user settings according to own needs or experiences.
If the third time period is greater than the third threshold, the client node decrements the reference count in the first RPC request by 1, step 324.
Step 325, the client node deletes the RDMA request from the first RDMA request queue.
Based on the foregoing embodiment, in other embodiments of the present application, referring to fig. 9, after the server node performs step 305, the method further includes performing step 326:
step 326, the server node writes the RDMA request to the tail of the second RDMA request queue in the server node.
Step 326 may be performed simultaneously with step 321, or may be performed before or after step 321, and the specific execution sequence may be determined according to the actual situation.
Based on the foregoing embodiments, in other embodiments of the present application, step 306 may be implemented by steps 306 a-306 c:
in step 306a, if the second RDMA request queue is not empty, the server node obtains the RDMA request from the head of the second RDMA request queue.
In step 306b, the server node parses the RDMA request to obtain an RPC request header and at least one accessible memory information.
Wherein the at least one accessible information is RDMA memory in the client node.
Step 306c, the server node generates an RDMA reply based on the RPC request header and the at least one accessible memory information.
Based on the foregoing embodiments, in other embodiments of the present application, step 306c may be implemented by steps a11 to a16, or steps a11 to a12 and steps a17 to a 20. If the data transmission direction in the RPC request header is that the client node transmits the data to the server node, the server node selectively executes steps a11 to a16, and if the data transmission direction in the RPC request header is that the server node transmits the data to the client node, the server node selectively executes steps a11 to a12 and steps a17 to a20:
Step a11, the server node allocates the memory of the server node based on at least one piece of accessible memory information, and generates memory allocation information.
Step a12, the server node generates a second RPC request based on the RPC request header and the memory allocation information.
Step a13, if the data transmission direction in the RPC request header is that the client node transmits the data to the server node, the server node reads the first target data from the memory corresponding to the at least one accessible memory information in the client node.
Step a14, the server node stores the first target data to the memory corresponding to the memory allocation information.
Step a15, the server node determines a second target application, and controls the second target application to respond to the second RPC request and the memory allocation information, so as to obtain a first RPC response.
The second target application has an association relationship with the RPC request header.
In the embodiment of the present application, the second target application is determined by the server node based on the request type in the RPC request header.
Step a16, the server node generates an RDMA response based on the first RPC response.
And a step a17, if the data transmission direction in the RPC request header is that the server node transmits the data to the client node, the server node determines a third target application, and controls the third target application to respond to the second RPC request to obtain third target data.
The third target application has an association relationship with the RPC request header.
In the embodiment of the present application, the third target application is determined by the server node based on the request type in the RPC request header.
Step a18, the server node stores the third target data into the memory corresponding to the memory allocation information, and generates a second RPC response.
Step a19, the server node writes the third target data stored in the memory corresponding to the memory allocation information into the memory corresponding to the at least one accessible memory information of the client node.
Step a20, the server node generates an RDMA response based on the second RPC response.
Based on the foregoing embodiments, an embodiment of the present application provides a system architecture diagram of an information processing method, and referring to fig. 10, the system architecture diagram includes a client node 1, a client node 2, a server node 1, and a server node 2. The client node 1 is in communication connection with the service end node 1 and the service end node 2, and the client node 2 is also in communication connection with the service end node 1 and the service end node 2.
For each communication channel of each client node, an RPC request queue, an RDMA request queue, RDMA connection resources, and memory address information for storing memory registered as RDMA memory are provided. The RPC request queue is used for storing requests issued by upper-layer applications; the RDMA request queue is used for storing RDMA requests which are sent out through an RDMA communication mode and not returned yet; RDMA connection resources are related resources for RDMA data transfer defined by RDMA programming libraries, including request Queues (QPs), completion Queues (CQ), protection domains (Protection Domain, PD), etc.; the memory address information may be denoted as rdma_rkey_map, and is used for storing the key words of the registered RDMA memory, if the remote node, that is, the server node, directly accesses the data in the local memory through RDMA, the memory needs to be registered as an RDMA accessible memory, which is generally called RDMA memory, setting permission to be remotely accessible, and providing the key words to the remote node as a token when accessing.
For the server node side, there are RDMA request queues and RDMA connection resources, where the RDMA request queues of the server node side are used to store received and yet unresponsive client RDMA requests, and the RDMA connection resources are related resources for RDMA data transmission defined by the RDMA programming library, including QP, CP, PD, and the like.
The plurality of communication channels at the server node side share a memory pool at the server node side to allocate data memory, and the memory in the memory pool is RDMA memory.
Based on the system architecture diagram shown in fig. 10, the target communication channel between the client node and the server node is created in advance, and the creation method is as follows: after the upper layer application on the client node side designates the IP address and port number of the server node, the client node invokes the RPC create communication channel interface to create a communication channel, and establishes an RDMA connection between the client node and the server node. Further, the RPC also invokes the RDMA programming library to create corresponding RDMA connection resources between the client node and the server node.
When the upper layer application on the client node side, that is, the aforementioned first target application, initiates a first RPC request, a target communication channel from the client node to the server node is designated in the first RPC request, which is, for example, denoted as phxrpc channel, a request header, and request data, which is, for example, denoted as RPC _ibuf, a callback function, and a callback parameter. In some special cases, some request types may set rpc _ibuf to null if no data transfer is required. It should be noted that, after the first target application sends the first RPC request, the memory pointed to by RPC _iobuf cannot be operated until the first RPC request completes the callback. In this way, when the client node receives a first RPC request submitted by a first target application, firstly judging whether an RPC request queue corresponding to a phxrpc channel is full, and if so, calling a callback function to return an error; if not, adding the first RPC request to the end of the RPC request queue, increasing the reference count of RPC _ibuf in the RPC request, and then executing the operation of sending the first RPC request to the phxrpc channel.
The structure of the first RPC request may be shown with reference to fig. 11, and includes a channel pointer, a request header, a request data file RPC _ibuf, a callback function, and a callback parameter pointer. Wherein:
the channel pointer in the first RPC request is used to specify a target communication channel of the client node for sending messages to the server node.
The request header, the requested metadata, referring to fig. 12, includes at least a request type, a data transmission direction, a message version number, and an application-custom block. Wherein: two data transmission directions are adopted, wherein one data transmission direction from a client to a server can be marked as C2S, and the other data transmission direction from the server to the client can be marked as S2C; the application custom block is a section of fixed-length area, the area is set by a first target application at the client node side, different structures can be set for different request types, and the interior of the RPC does not sense the structure inside; the message version number is used for compatibility between different versions; RPC _ibuf, a structure for describing request data, implements that no data copying is performed between the RPC and the first target application between the client nodes, that is, no memory copying is performed, no matter whether the upper layer application on the client side should send the first RPC request through the client, or the service node gives the first RPC request to the upper layer application on the service side for processing, only the RPC _ibuf is used to transfer data to the reference of the corresponding memory area.
rpc _ibuf, i.e. for storing data to be transferred, as shown with reference to fig. 13, comprises at least: reference count, number of memories and memory 1, memory 2, … …, memory n, n is a positive integer greater than or equal to 1. For example, the representation of the memory in rpc _ibuf may be shown with reference to fig. 14. The data transferred by rpc _ibuf may be a continuous memory or may be composed of multiple discrete memories, in rpc _ibuf, a symbol of the iovec may be used to represent a memory, multiple iovecs may be set to set multiple memories, the number of the iovecs cannot exceed a set threshold, for example, the threshold may be 16, and the iovec uses a memory address and a data length to identify a memory. A reference count for controlling the life cycle of the memory, i.e. set to 1 at rpc _iobuf initialization, add 1 when rpc _iobuf is referenced, subtract 1 when rpc _iobuf is released, and release rpc _iobuf and the memory to which each iovec points when the reference count is reduced to 0.
The callback function is a callback function after the first RPC requests to execute and is specified by the first target application.
And the callback parameter pointer is a parameter which is transmitted when the callback function is called after the first RPC request is executed, and is designated by the first target application.
The operation procedure of sending the first RPC request may specifically be sending the first RPC request to the server node in RDMA when the first RPC request reaches the head of the RPC request queue. The step of the client node specifically implementing the sending of the first RPC request may be as follows:
step b11, the client node judges whether the phxrpc channel state is normal or not, and if the connection of the phxrpc channel state is abnormal, the client node exits;
step b12, if the phxrpc channel state connection is normal, the client node judges whether the RDMA request queue is full, and if the RDMA request queue is full, the client node exits;
the RDMA request queue stores RDMA requests which are sent out and are not completed;
step b13, the client node judges whether the RPC request queue is empty, and exits if the RPC request queue is empty;
step b14, if the RPC request queue is not empty, the client node fetches a first RPC request located at the head of the RPC request queue, creates a corresponding RDMA request for the first RPC request, fills the request header of the first RPC request into the RDMA request, sets rdma_iovec according to the iovec in RPC _iobuf of the first RPC request, searches for a corresponding rkey, i.e., the key, in the memory address information according to the memory address in the iovec, and if no corresponding rkey is found, indicates that the segment of memory has not been registered as RDMA memory, calls the RDMA library function to register the RDMA memory to obtain rkey, and updates the rkey into the rdma_rkey_map.
Among them, the structure of the RDMA request may be shown with reference to fig. 15, including: RDMA identification information, RPC request pointer, and RDMA transfer request. The RDMA identification information can be RDMA request identification information, is the unique identification of the RDMA request, and is generated when the client node creates the RDMA request; the RPC request pointer is a channel pointer of a first RPC request sent by a first target application; the RDMA transfer request is the portion actually required to be transferred to the server node by RDMA, and referring to FIG. 16, includes RDMA identification information of the RDMA request, a request header of the first RPC request, an rdma_iovec number describing the request data area, and at least one rdma_iovec; the rdma_iovec is the encapsulation of the iovec in the phx _iobuf of the first RPC request, and corresponds to the iovec in the phx _iobuf of the first RPC request one by one, wherein the memory address and the data length are the values in the iovec, the rdma_rkey is the key word obtained after the segment of memory is registered as RDMA memory by calling the RDMA programming library function, and the key word is provided to the server node by the client node and is used as an access token when the subsequent server node accesses the segment of memory on the client node. The structure of each rdma_iovec may be described with reference to fig. 17, including memory address, data length, and key.
Step b15, the client node SENDs the RDMA request to the client node by adopting RDMA bilateral primitive RDMA_SEND, and adds the RDMA request to the tail of the RDMA request queue and exits.
Step b16, the service end node receives the RDMA request by adopting the RDMA bilateral primitive RDMA_RECV, places the RDMA request at the end of the RDMA request queue at the service end node side, and then executes the operation of processing the RDMA request. Wherein: when RDMA requests are processed, the RDMA requests are fetched when the RDMA requests are positioned at the queue head of an RDMA request queue at the server node side, the RDMA requests are analyzed to obtain a first RPC request, required memory is allocated according to the first RPC request, and then the first RPC request is delivered to an upper layer application at the server node side, namely the second target application and the third target application, to be processed, and a response is obtained and sent to the client node. The specific implementation steps of the operation of the server node to process RDMA requests may be as follows:
step c11, the server node judges whether an RDMA request queue is empty, and exits if the RDMA request queue is empty;
step c12, if the RDMA request queue is not empty, the server node takes out the RDMA request at the head of the RDMA request queue, allocates the memory of the memory pool at the server node side according to each rdma_iovec in the RDMA request, creates a phx _iobuf structure to record the information of the memory allocation, and exits if the memory allocation fails;
Step c13, if the memory allocation is successful, the server node creates an RPC request, namely the second RPC request, and fills the header of the RPC request in the RDMA request and the phx _ibuf created in step c12 into the second RPC request;
step C14, the service end node judges the data transmission direction in the RPC request head, if the data transmission direction is C2S, the steps C15-C17 and C21 are executed; if S2C, executing steps C18-C21;
step c15, the server node READs data in the client memory indicated by each rdma_iovec from the client node by using RDMA unilateral primitive RDMA_READ, and stores the obtained data in the memory of the phx _iobuf record distributed by the server node;
step c16, the server node transmits the second RPC request and the phxrpc_iobff created in step c12 to the upper layer application at the server node side, namely the second target application to process, namely, according to the request type of the second RPC request, a corresponding processing program registered by the upper layer application is called to process the second RPC request;
step c17, after the upper layer application on the server side finishes processing the second RPC request, the server side receives the RPC response returned by the upper layer application on the server side, fills the RPC response into the RDMA response, and SENDs the response to the client side through RDMA bilateral primitive RDMA_SEND, and exits;
The structure of the RPC response may refer to fig. 18, where the structure includes a return value, a message version number, and an application custom block returned by an upper layer application at the server node side in response to the phxrpc request; the message version number and the application customization block are consistent with the above description, and are set by an upper layer application at the server node side. Correspondingly, the structure of the obtained RDMA response may be shown with reference to fig. 19, and includes RDMA identification information and an RPC response, where the RDMA identification information is identification information of the corresponding RDMA request.
Step c18, the client node transmits the second RPC request to the upper layer application at the server node side, namely the third target application for processing, namely a corresponding application registration processing program is called for processing according to the request type in the second RPC request;
step c19, after the second RPC application is completed by the third target application processing, the server node sends the data in the memory of the server node recorded by the phxrpc_iobuf to the memory of the client node recorded by the rdma_iovec through RDMA unilateral operation RDMA_WRITE;
and c20, the server node fills the RPC response returned by the third target application into the RDMA response, SENDs the RDMA response to the client node through the RDMA bilateral primitive RDMA_SEND and exits.
Step c21, the client node receives RDMA response through bilateral primitive RDMA_RECV, then acquires the previously transmitted RDMA request through rdma_req_id, judges whether the RDMA request is marked as overtime, if the RDMA request is not marked as overtime, calls a callback function of a first RPC request to return the RPC response obtained by analyzing the RDMA response to an upper layer application of the client node side, reduces the phx _ibuf reference count in the first RPC request by 1, and removes the RDMA request from an RDMA request queue of the client node side; if the RDMA request has marked a timeout, no callback is made, the reference count of phx _iobuf of the second RPC request contained in the RDMA request is decremented by 1, and the RDMA request is removed from the client node side RDMA request queue.
Wherein the client node records the time when the application submitted the first RPC request, periodically detects whether the execution time of any of the RPC request queue and the RDMA request queue exceeds a threshold, and the request exceeding the threshold is determined as a timeout request. Wherein:
if the request in the RPC request queue is overtime, creating an RPC response structure to set an overtime error code, calling a callback function in the first RPC request to return a result to an upper layer application at the client node side, then removing the first RPC request from the RPC request queue, and subtracting 1 from the reference count of phx _ibuf in the first RPC request;
If the RDMA request in the RDMA request queue is overtime, the established phxrpc answer structure sets an overtime error code, a callback function in the RDMA request is called to return a result to an upper layer application on the side of the client node, the RDMA request is marked as overtime, but the RDMA request is still reserved in the RDMA request queue, and the reference count of phx _iobuf in the RDMA request is not changed. The reason is that after the sent RDMA request is determined to be timeout, the server node may perform a read or write operation on the memory area pointed to by phx _ibuf in the RDMA request, and releasing the memory in advance may cause a data error. It should be noted that, when the client node receives the RDMA response of the server node to process, the client node also determines whether the RDMA request is marked as timeout and processes accordingly.
In the foregoing description, a section of application custom block with a fixed length is set in the request header of the first RPC request, so that the upper layer application on the client node side can customize the data structure in the block according to the message type, and only needs to make a type conversion by using the pointer of the application custom block when in use. When the upper layer application on the client side sends a first RPC request through the client node, the upper layer application on the client side carries out direct assignment on a structural body obtained by type conversion based on an application custom block, and after the server side receives a DRMA request comprising the first RPC request, the server side calls a corresponding processing program registered by the upper layer application according to the request type in the DRMA request to carry out request processing, and the upper layer application on the server side also carries out type conversion based on the application custom block to obtain a required structure. This approach has higher efficiency than the conventional RPC-using codec approach, and the first RPC request header is fixed in length, suitable for transmission using RDMA bilateral primitives.
By way of example, assume that the data structure desired by the upper layer application on the server node side is as follows:
struct phxrpc_header{
enum req_type type;
enum trans flag flag;
uint32_t version;
char appdata[MAXLEN];
};
the data structure in the first RPC request sent by the client node is as follows:
struct app_msg_type1{
uint32 t a;
uint32_t b;
uint64 t c;
};
in this way, the upper layer application in the service end node invokes the following conversion method in the custom region block to convert the data structure in the first RPC request, and the expected data structure is obtained for subsequent analysis.
struct phxrpc_header header;
struct app_msg_type1*msg;
msg=(struct app_msg_type1)&header.appdata。
It should be noted that, communication may be performed between the client node and the upper layer application on the client node side, or between the service node and the upper layer application on the service node side through a set RPC interface, that is, the upper layer application submits an RPC request to the client node or the service node through the RPC interface, where the RPC request is executed asynchronously, and an execution result for the RPC request is returned through a callback function. The RDMA memory can also be realized by a preset registered RDMA memory interface when registering the RDMA memory. After receiving the second RPC request, the server node invokes the registered upper layer application processing program to process according to the request type in the second RPC request, and when analyzing the structure of the RPC request header custom block according to the request type, the method can be implemented through a preset message processing program registration interface at the server node side.
It should be noted that, in this embodiment, the explanation of the same steps or concepts as those in other embodiments may refer to the descriptions in other embodiments, and are not repeated here.
According to the information processing method provided by the embodiment of the application, the client node determines the server node and the target communication channel through the first RPC request generated by the first target application, generates the RDMA request based on the first RPC request, and then sends the RDMA request to the server node through the target communication channel by adopting the RDMA bilateral primitive so as to enable the server node to respond to the RDMA request, generate the corresponding RDMA response, and send the generated RDMA response to the client node through the target communication channel by adopting the RDMA bilateral primitive, thereby solving the problem that the memory needs to be copied and analyzed in the communication process of two communication parties in the distributed storage system realized by RDMA at present, resulting in larger resource consumption in the communication process. And the RDMA bilateral primitive mode is adopted for data transmission, so that high-performance communication with low delay, low CPU overhead and low memory bandwidth overhead is realized.
Based on the foregoing embodiments, the embodiments of the present application provide a client device 4, where the client device 4 may be applied to the embodiments corresponding to fig. 1 to 9 and other methods, and referring to fig. 20, the client device 4 includes: a first determination unit 41, a first generation unit 42, a first transmission unit 43, and a first reception unit 44; wherein:
a first determining unit 41, configured to detect a first remote procedure call RPC request generated by a first target application, and determine, based on the first target application, a server node and a target communication channel;
a first generating unit 42, configured to generate a remote memory direct access RDMA request based on the first RPC request;
a first sending unit 43, configured to send an RDMA request to a server node through a target communication channel by using an RDMA bilateral primitive;
a first receiving unit 44, configured to receive, through a target communication channel, an RDMA response sent by a service end node by using an RDMA bilateral primitive; wherein the RDMA reply is generated by the server node in response to the RDMA request.
In other embodiments of the present application, the first RPC request includes: the system comprises a channel pointer, an RPC request header, request data, a callback function and a callback parameter pointer, wherein the channel pointer is used for pointing to a server node; wherein the first RPC request header includes at least: request type, data transmission direction, message version number and application custom block, the application custom block is used for realizing type conversion of the first RPC request, and the request data at least comprises: at least one of remotely accessible memory information and reference counts.
In other embodiments of the present application, the first determining unit includes: the first determining module and the creating module; wherein:
the first determining module is used for detecting a first RPC request generated by a first target application and determining an Internet Protocol (IP) address and a port number indicated by the first target application;
the creation module is used for creating connection between the channel creation interface and the server node based on the IP address and the port number to obtain a target communication channel.
In other embodiments of the present application, before the first generating unit, the apparatus further includes: a first writing unit and a processing unit; wherein:
the first writing unit is used for detecting that the RPC request queue corresponding to the target communication channel is not full, and writing the first RPC request into the tail of the RPC request queue;
and the processing unit is used for adding 1 to the reference count included in the first RPC request.
In other embodiments of the present application, the first generating module includes: the device comprises a taking-out module, a second determining module and a first generating module; wherein:
the fetching module is used for detecting that the state of the target communication channel is a target state, detecting that the first RDMA request queue is not full and the RPC request queue is not empty, and fetching the first RPC request from the head of the RPC request queue; wherein the first RDMA request queue is used for recording RDMA requests which are sent out but not returned to answer;
A second determining module, configured to determine RDMA identification information of an RDMA request to be generated;
the first generating module is used for acquiring an RPC request header, at least one piece of accessible memory information and RDMA identification information from the first RPC request and generating an RDMA request.
In other embodiments of the present application, before the first generating module, the first generating unit further includes: the first acquisition module and the registration module; wherein:
the first acquisition module is used for acquiring at least one memory address included in at least one piece of accessible memory information;
the registration module is used for detecting that at least one memory address comprises at least one target address which is not registered as an RDMA memory, and registering the memory corresponding to the at least one target address as the RDMA memory.
In other embodiments of the present application, the registration module is specifically configured to implement the following steps:
acquiring memory address information comprising a memory registered as an RDMA memory;
the memory address information does not include at least one target address in at least one memory address, and the memory corresponding to the at least one target address is registered as an RDMA memory.
Correspondingly, after registering the module, the first generating unit further includes: updating a module; wherein:
and the updating module is used for updating the memory address information based on at least one target address.
In other embodiments of the present application, before the first sending unit, the apparatus further includes: the device comprises a detection unit, a second determination unit, a calling unit and a deleting unit; wherein:
the detecting unit is used for detecting a first duration from the moment of taking out the first RPC request from the head of the RPC request queue to the current moment and a second duration from the moment of sending the RDMA request to the server node to the current moment according to a preset time interval;
the second determining unit is used for determining that a first response result aiming at the first RPC request is response timeout if the first time length is larger than a first threshold value;
the calling unit is used for calling a callback function in the first RPC request to return a first response result to the first target application;
a deleting unit, configured to delete the first RPC request from the RPC request queue;
the processing unit is further used for reducing the reference count in the first RPC request by 1;
and/or, a second determining unit, configured to determine that a second response result for the RDMA request is a response timeout if the second time period is greater than a second threshold;
the calling unit is used for calling a callback function in the first RPC request to return a second response result to the first target application;
the processing unit is further configured to identify an RDMA request timeout.
In other embodiments of the present application, the first writing unit is further configured to perform the following steps:
an RDMA request is written to a first RDMA request queue.
In other embodiments of the present application, after the first receiving unit, the apparatus further includes: a statistics unit; wherein:
a statistics unit, configured to count a third duration from a time point when the RDMA request is sent to the server node to a time point when the RDMA response sent by the server node is received;
the calling unit is further used for calling a callback function in the first RPC request to return an RDMA response to the first target application if the third duration is smaller than or equal to a third threshold value;
the processing unit is further configured to decrease the reference count in the first RPC request by 1 if the third time period is greater than the third threshold;
the deletion unit is further configured to delete an RDMA request from the first RDMA request queue.
It should be noted that, in the present embodiment, the interaction process between the steps implemented by each unit and module may refer to the interaction process in the information processing method provided in the embodiment corresponding to fig. 1 to 9 and the embodiment described above, which is not described herein again.
The client node provided by the embodiment of the application determines the service node and the target communication channel through the first RPC request generated by the first target application, generates the RDMA request based on the first RPC request, and then sends the RDMA request to the service node through the target communication channel by adopting the RDMA bilateral primitive so as to enable the service node to respond to the RDMA request, generate the corresponding RDMA response and send the generated RDMA response to the client node through the target communication channel, thereby solving the problem that the memory needs to be copied and analyzed in the communication process of two communication parties in the distributed storage system realized by RDMA at present, causing larger resource consumption in the communication process.
Based on the foregoing embodiments, the embodiments of the present application provide a server device 5, where the server device 5 may be applied to the embodiments corresponding to fig. 1 to 9 and other methods, and referring to fig. 21, the server device 5 includes: a second receiving unit 51, a second generating unit 52, and a second transmitting unit 53; wherein:
a second receiving unit 51, configured to receive, through a target communication channel, an RDMA request sent by a client node using an RDMA bilateral primitive;
a second generating unit 52, configured to generate an RDMA response based on the RDMA request;
a second sending unit 53, configured to send an RDMA response to the client node through the target communication channel using the RDMA bilateral primitive.
In other embodiments of the present application, after the second receiving unit, the server device further includes: a second writing unit; wherein:
a second write unit for writing the RDMA request to a tail of a second RDMA request queue in the server node.
In other embodiments of the present application, the second generating unit includes: the device comprises a second acquisition module, an analysis module and a second generation module; wherein:
a second obtaining module, configured to obtain an RDMA request from a head of a second RDMA request queue if the second RDMA request queue is not empty;
The analysis module is used for analyzing the RDMA request to obtain an RPC request head and at least one accessible memory information; wherein the at least one accessible information is RDMA memory in the client node;
a second generation module for generating an RDMA reply based on the RPC request header and the at least one accessible memory information.
In other embodiments of the present application, the second generating module may be specifically configured to implement the following steps:
distributing the memory of the server node based on at least one piece of accessible memory information to generate memory distribution information;
generating a second RPC request based on the RPC request header and the memory allocation information;
if the data transmission direction in the RPC request header is that the client node transmits the data to the server node, reading first target data from a memory corresponding to at least one accessible memory information in the client node;
storing first target data to a memory corresponding to the memory allocation information;
determining a second target application, and controlling the second target application to respond to the second RPC request and the memory allocation information to obtain a first RPC response; the second target application has an association relationship with the RPC request header;
based on the first RPC reply, an RDMA reply is generated.
In other embodiments of the present application, the second generating module may be further configured to implement the following steps:
if the data transmission direction in the RPC request header is that the server node transmits the data to the client node, determining a third target application, and controlling the third target application to respond to the second RPC request to obtain third target data; wherein, the third target application has an association relationship with the RPC request header;
storing the third target data into a memory corresponding to the memory allocation information, and generating a second RPC response;
writing third target data stored in a memory corresponding to the memory allocation information into a memory corresponding to at least one accessible memory information of the client node;
based on the second RPC reply, an RDMA reply is generated.
It should be noted that, in the present embodiment, the interaction process between the steps implemented by each unit and module may refer to the interaction process in the information processing method provided in the embodiment corresponding to fig. 1 to 9 and the embodiment described above, which is not described herein again.
According to the server device provided by the embodiment of the application, the client node determines the server node and the target communication channel through the first RPC request generated by the first target application, generates the RDMA request based on the first RPC request, and then sends the RDMA request to the server node through the target communication channel by adopting the RDMA bilateral primitive so as to enable the server node to respond to the RDMA request, generate the corresponding RDMA response and send the generated RDMA response to the client node, thereby solving the problem that the memory needs to be copied and parsed in the communication process of two communication parties in the distributed storage system realized by RDMA at present, resulting in larger resource consumption in the communication process.
Based on the foregoing embodiments, the embodiment of the present application provides an information processing system 6, where the information processing system 6 may be applied to the embodiments corresponding to fig. 1 to 9 and other methods, and referring to fig. 22, the information processing system 6 includes: a client node 61 and a server node 62; wherein:
the client node 61 is configured to implement the information processing method provided in the embodiments corresponding to fig. 1 and fig. 3 to 9, and will not be described in detail herein;
the server node 62 is configured to implement the information processing method provided in the embodiments corresponding to fig. 2 to 9, and will not be described in detail herein.
Based on the foregoing embodiments, the embodiments of the present application provide a computer readable storage medium, simply referred to as a storage medium, where one or more information processing programs are stored, and the one or more information processing programs may be executed by one or more processors, so as to implement the information processing method provided in the embodiments corresponding to fig. 1 and 3 to 9, or fig. 2 to 9, which are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, an air conditioner, or a network communication link device, etc.) to perform the method described in the embodiments of the present application.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (18)

1. An information processing method, wherein the method is applied to a client node, the method comprising:
detecting a first Remote Procedure Call (RPC) request generated by a first target application, and determining a server node and a target communication channel based on the first target application; wherein the first RPC request includes: the system comprises a channel pointer, an RPC request header, request data, a callback function and a callback parameter pointer, wherein the channel pointer is used for pointing to a server node; wherein the first RPC request header includes at least: the request type, the data transmission direction, the message version number and the application custom block, wherein the application custom block is used for realizing type conversion of the first RPC request, and the request data at least comprises: at least one remotely accessible memory information and reference count;
generating a remote memory direct access RDMA request based on the first RPC request;
sending the RDMA request to the server node by adopting an RDMA bilateral primitive through the target communication channel;
receiving an RDMA response sent by the server node by adopting the RDMA bilateral primitive through the target communication channel; wherein the RDMA reply is generated by the server node in response to the RDMA request.
2. The method of claim 1, wherein detecting the first remote procedure call, RPC, request generated by the first target application, and determining, based on the first target application, a server node and a target communication channel, comprises:
detecting the first RPC request generated by a first target application, and determining an Internet Protocol (IP) address and a port number indicated by the first target application;
and creating connection between a channel creation interface and the service end node based on the IP address and the port number to obtain the target communication channel.
3. The method of claim 2, wherein prior to generating a remote memory direct access, RDMA, request based on the first RPC request, the method further comprises:
detecting that an RPC request queue corresponding to the target communication channel is not full, and writing the first RPC request into the tail of the RPC request queue;
and adding 1 to the reference count included in the first RPC request.
4. The method of claim 3, wherein generating a remote memory direct access, RDMA, request based on the first RPC request comprises:
detecting that the state of the target communication channel is a target state, detecting that a first RDMA request queue is not full and the RPC request queue is not empty, and fetching the first RPC request from the head of the RPC request queue; wherein the first RDMA request queue is used for recording RDMA requests which are sent out but not returned with responses;
Determining RDMA identification information of the RDMA request to be generated;
the RPC request header, at least one piece of accessible memory information, and the RDMA identification information are obtained from the first RPC request, and the RDMA request is generated.
5. The method of claim 4, wherein the retrieving the RPC request header, at least one accessible memory information, and the RDMA identification information from the first RPC request, the method further comprises, prior to generating the RDMA request:
acquiring at least one memory address included in the at least one accessible memory information;
detecting that at least one target address is not registered as an RDMA memory in the at least one memory address, and registering the memory corresponding to the at least one target address as the RDMA memory.
6. The method of claim 5, wherein the detecting that the at least one memory address includes at least one target address not registered as an RDMA memory, registering the memory corresponding to the at least one target address as the RDMA memory, comprises:
acquiring memory address information comprising a memory registered as an RDMA memory;
the memory address information does not include the at least one target address in the at least one memory address, and the memory corresponding to the at least one target address is registered as the RDMA memory;
Correspondingly, the memory address information does not include the at least one target address in the at least one memory address, and after registering the memory corresponding to the at least one target address as the RDMA memory, the method further includes:
and updating the memory address information based on the at least one target address.
7. The method of claim 4, wherein prior to receiving the RDMA reply sent by the server node over the target communication channel using the RDMA bilateral primitive, the method further comprises:
detecting a first duration from the time when the first RPC request is fetched from the head of the RPC request queue to the current time and a second duration from the time when the RDMA request is sent to the server node to the current time according to a preset time interval;
if the first time length is greater than a first threshold value, determining that a first response result for the first RPC request is response timeout;
calling the callback function in the first RPC request to return the first response result to the first target application;
deleting the first RPC request from the RPC request queue;
decrementing the reference count in the first RPC request by 1;
And/or if the second time period is greater than a second threshold, determining that a second response result for the RDMA request is a response timeout;
calling the callback function in the first RPC request to return the second response result to the first target application;
the RDMA request timeout is identified.
8. The method of any of claims 4 to 7, wherein after sending the RDMA request to the server node over the target communication channel using an RDMA bilateral primitive, the method further comprises:
writing the RDMA request to the first RDMA request queue.
9. The method of claim 4, wherein after receiving the RDMA reply sent by the server node using an RDMA bilateral primitive over the target communication channel, the method further comprises:
counting a third time period from the time of sending the RDMA request to the server node to the time of receiving the RDMA response sent by the server node;
if the third duration is less than or equal to a third threshold, calling the callback function in the first RPC request to return the RDMA response to the first target application;
If the third time period is greater than the third threshold value, subtracting 1 from the reference count in the first RPC request;
deleting the RDMA request from the first RDMA request queue.
10. An information processing method, wherein the method is applied to a server node, and the method comprises:
RDMA requests sent by client nodes are received by adopting RDMA bilateral primitives through a target communication channel; wherein the RDMA request is generated by the client node based on a first RPC request corresponding to a first target application; wherein the first RPC request includes: the system comprises a channel pointer, an RPC request header, request data, a callback function and a callback parameter pointer, wherein the channel pointer is used for pointing to a server node; wherein the first RPC request header includes at least: the request type, the data transmission direction, the message version number and the application custom block, wherein the application custom block is used for realizing type conversion of the first RPC request, and the request data at least comprises: at least one remotely accessible memory information and reference count;
generating an RDMA reply based on the RDMA request;
and sending the RDMA response to the client node by adopting the RDMA bilateral primitive through the target communication channel.
11. The method of claim 10, wherein after receiving the RDMA request sent by the client node over the target communication channel, the method further comprises:
writing the RDMA request to a tail of a second RDMA request queue in the server node.
12. The method of claim 11, wherein the generating an RDMA reply based on the RDMA request comprises:
if the second RDMA request queue is not empty, acquiring the RDMA request from the head of the second RDMA request queue;
analyzing the RDMA request to obtain an RPC request header and at least one accessible memory information; wherein the at least one accessible information is RDMA memory in the client node;
the RDMA reply is generated based on the RPC request header and the at least one accessible memory information.
13. The method of claim 12, wherein the generating the RDMA reply based on the RPC request header and the at least one accessible memory information comprises:
based on the at least one piece of accessible memory information, memory of the server node is allocated, and memory allocation information is generated;
Generating a second RPC request based on the RPC request header and the memory allocation information;
if the data transmission direction in the RPC request header is that the client node transmits the data to the server node, reading first target data from a memory corresponding to the at least one accessible memory information in the client node;
storing the first target data to a memory corresponding to the memory allocation information;
determining a second target application, and controlling the second target application to respond to the second RPC request and the memory allocation information to obtain a first RPC response; wherein the second target application has an association relationship with the RPC request header;
the RDMA response is generated based on the first RPC response.
14. The method of claim 13, wherein the method further comprises:
if the data transmission direction in the RPC request header is that the server node transmits the data to the client node, determining a third target application, and controlling the third target application to respond to the second RPC request to obtain third target data; wherein the third target application has an association relationship with the RPC request header;
Storing the third target data into a memory corresponding to the memory allocation information, and generating a second RPC response;
writing the third target data stored in the memory corresponding to the memory allocation information into the memory corresponding to the at least one accessible memory information of the client node;
the RDMA response is generated based on the second RPC response.
15. A client device, the device comprising: the device comprises a first determining unit, a first generating unit, a first transmitting unit and a first receiving unit; wherein:
the first determining unit is configured to detect a first RPC request generated by a first target application, and determine, based on the first target application, a server node and a target communication channel; wherein the first RPC request includes: the system comprises a channel pointer, an RPC request header, request data, a callback function and a callback parameter pointer, wherein the channel pointer is used for pointing to a server node; wherein the first RPC request header includes at least: the request type, the data transmission direction, the message version number and the application custom block, wherein the application custom block is used for realizing type conversion of the first RPC request, and the request data at least comprises: at least one remotely accessible memory information and reference count;
The first generating unit is configured to generate a remote memory direct access RDMA request based on the first RPC request; the first sending unit is configured to send, through the target communication channel, the RDMA request to the server node by using an RDMA bilateral primitive;
the first receiving unit is configured to receive, through the target communication channel, an RDMA response sent by the server node by using the RDMA bilateral primitive; wherein the RDMA reply is generated by the server node in response to the RDMA request.
16. A server device, the device comprising: a second receiving unit, a second generating unit and a second transmitting unit; wherein:
the second receiving unit is configured to receive, through a target communication channel, an RDMA request sent by a client node by using an RDMA bilateral primitive, where the RDMA request is generated by the client node based on a first RPC request corresponding to a first target application; wherein the first RPC request includes: the system comprises a channel pointer, an RPC request header, request data, a callback function and a callback parameter pointer, wherein the channel pointer is used for pointing to a server node; wherein the first RPC request header includes at least: the request type, the data transmission direction, the message version number and the application custom block, wherein the application custom block is used for realizing type conversion of the first RPC request, and the request data at least comprises: at least one remotely accessible memory information and reference count;
The second generating unit is configured to generate an RDMA response based on the RDMA request;
the second sending unit is configured to send, through the target communication channel, the RDMA reply to the client node by using the RDMA bilateral primitive.
17. An information processing system, characterized in that the information processing system comprises: a client node and a server node; wherein:
-said client node for implementing the steps of the information processing method according to any of claims 1 to 9;
the server node being configured to implement the steps of the information processing method according to any one of claims 10 to 14.
18. A storage medium having stored thereon an information processing program which, when executed by a processor, implements the steps of the information processing method according to any one of claims 1 to 9 or claims 10 to 14.
CN202110720942.7A 2021-06-28 2021-06-28 Information processing method, device, system and storage medium Active CN113326155B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110720942.7A CN113326155B (en) 2021-06-28 2021-06-28 Information processing method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110720942.7A CN113326155B (en) 2021-06-28 2021-06-28 Information processing method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN113326155A CN113326155A (en) 2021-08-31
CN113326155B true CN113326155B (en) 2023-09-05

Family

ID=77424969

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110720942.7A Active CN113326155B (en) 2021-06-28 2021-06-28 Information processing method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN113326155B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113867940B (en) * 2021-09-07 2024-01-12 苏州浪潮智能科技有限公司 Memory management method and related device
CN113965587B (en) * 2021-09-18 2022-04-22 苏州浪潮智能科技有限公司 Data acquisition method, device, equipment and medium of artificial intelligence platform
CN114125081B (en) * 2021-10-27 2023-09-22 桂林长海发展有限责任公司 Method and device for processing received data and storage medium
CN114710515B (en) * 2022-06-06 2022-11-11 浪潮电子信息产业股份有限公司 Communication method and related assembly
WO2023241676A1 (en) * 2022-06-16 2023-12-21 华为云计算技术有限公司 Memory pool operation method and apparatus

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000020490A (en) * 1998-07-01 2000-01-21 Fujitsu Ltd Computer having remote procedure calling mechanism or object request broker mechanism, data transfer method and transfer method storage medium
CN1487418A (en) * 2002-09-05 2004-04-07 �Ҵ���˾ Far-end divect memory access invocating memory management unloading of network adapter
CN102546612A (en) * 2011-12-23 2012-07-04 华中科技大学 Remote procedure call implementation method based on remote direct memory access (RDMA) protocol in user mode
WO2014011084A1 (en) * 2012-07-10 2014-01-16 Bogdanov Alexander Yakovlevich Method for managing resources in a computer system
CN105978985A (en) * 2016-06-07 2016-09-28 华中科技大学 Memory management method of user-state RPC over RDMA
CN107771332A (en) * 2015-06-02 2018-03-06 微软技术许可有限责任公司 The fast read/write between Net-connected computer is asked via the RPC based on RDMA
CN107888657A (en) * 2017-10-11 2018-04-06 上海交通大学 Low latency distributed memory system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10871991B2 (en) * 2019-01-18 2020-12-22 EMC IP Holding Company LLC Multi-core processor in storage system executing dedicated polling thread for increased core availability

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000020490A (en) * 1998-07-01 2000-01-21 Fujitsu Ltd Computer having remote procedure calling mechanism or object request broker mechanism, data transfer method and transfer method storage medium
CN1487418A (en) * 2002-09-05 2004-04-07 �Ҵ���˾ Far-end divect memory access invocating memory management unloading of network adapter
CN102546612A (en) * 2011-12-23 2012-07-04 华中科技大学 Remote procedure call implementation method based on remote direct memory access (RDMA) protocol in user mode
WO2014011084A1 (en) * 2012-07-10 2014-01-16 Bogdanov Alexander Yakovlevich Method for managing resources in a computer system
CN107771332A (en) * 2015-06-02 2018-03-06 微软技术许可有限责任公司 The fast read/write between Net-connected computer is asked via the RPC based on RDMA
CN105978985A (en) * 2016-06-07 2016-09-28 华中科技大学 Memory management method of user-state RPC over RDMA
CN107888657A (en) * 2017-10-11 2018-04-06 上海交通大学 Low latency distributed memory system

Also Published As

Publication number Publication date
CN113326155A (en) 2021-08-31

Similar Documents

Publication Publication Date Title
CN113326155B (en) Information processing method, device, system and storage medium
JP4624110B2 (en) Usage of direct memory access to perform database operations between two or more machines
US20190199801A1 (en) Lock Management Method in Cluster, Lock Server, and Client
US7577707B2 (en) Method, system, and program for executing data transfer requests
US20160246657A1 (en) Reception according to a data transfer protocol of data directed to any of a plurality of destination entities
US20190132276A1 (en) Unified event processing for data/event exchanges with existing systems
US8984530B2 (en) Queued message dispatch
CN111431757B (en) Virtual network flow acquisition method and device
US10599529B2 (en) Instantiating data queues for management of remote data stores
US9838467B2 (en) Dynamically instantiating dual-queue systems
CN110677462B (en) Access processing method, system, device and storage medium for multi-block chain network
US10303529B2 (en) Protocol for communication of data structures
US9069592B2 (en) Generic transport layer mechanism for firmware communication
CN114237937A (en) Multithreading data transmission method and device
CN112968919B (en) Data processing method, device, equipment and storage medium
WO2017032152A1 (en) Method for writing data into storage device and storage device
US11947534B2 (en) Connection pools for parallel processing applications accessing distributed databases
US9860307B2 (en) System and method for virtual desktop infrastructure user level virtual channel
US10313450B2 (en) Method for transparently connecting augmented network socket operations
CN113645251B (en) Data transmission method and device suitable for cross-regional service
US8442939B2 (en) File sharing method, computer system, and job scheduler
US11711411B2 (en) Method for transparent zero-copy distribution of data to DDS applications
US10402307B2 (en) System and method for providing runtime tracing for a web-based client accessing a transactional middleware platform using an extension interface
WO2018182065A1 (en) Multi-resource subscription association method in m2m system
US20150081774A1 (en) System and method for implementing augmented object members for remote procedure call

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant