Distributed data transmission method and distributed data access system
By pre-registering memory pools on the client and server, and directly creating RPC messages in the client memory pool during transmission and transmitting them to the target server memory pool, the problem of low transmission efficiency caused by dynamic memory registration in the existing technology is solved. Efficient distributed data transmission is achieved.
Patent Information
- Application Number
- CN202410752543.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-08-23
AI Technical Summary
The existing distributed data transmission method based on RDMA technology has low transmission efficiency, mainly because the client and server need to dynamically register memory addresses during data transmission, resulting in the overhead of data copying and context switching during the transmission process.
By pre-registering memory pools on the client and server, creating RPC messages directly in the client memory pool during transmission, and transmitting them to the target server memory pool based on RDMA, avoiding the overhead caused by dynamic memory registration, using pre-registration The memory pool mapping relationship is used for data transmission.
The transmission overhead is reduced, the data transmission efficiency is improved, the transmission delay is reduced and the processing efficiency is improved, achieving efficient data transmission.
Smart Images

Figure CN118540336A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of distributed data access, and in particular to a distributed data transmission method and a distributed data access system. Background Art
[0002] In order to improve performance, distributed storage systems are mostly interconnected using high-speed networks. In order to maximize the performance of high-speed networks and reduce processing overhead, the client and server of distributed storage systems mainly use the Remote Direct Memory Access (RMAD) technology of high-speed networks for data transmission. RDMA technology allows data to be quickly moved from the memory of one machine to the memory of another machine without the involvement of the processor, which eliminates the overhead of data copying and context switching during the transmission process.
[0003] In the related art, in the distributed data transmission method based on RDMA technology, when the client needs to send or receive data to the server, the client first registers the local memory address space to the network card, and then unregisters the memory address space from the network card after the reception is completed.
[0004] However, the transmission efficiency of the above method is low. Summary of the invention
[0005] Based on this, it is necessary to provide a distributed data transmission method and a distributed data access system that can improve transmission efficiency in response to the above technical problems.
[0006] In a first aspect, the present application provides a distributed data transmission method for a client, the method comprising:
[0007] Get the transmission request to be sent to the server;
[0008] Based on the transmission request, a remote procedure call (RPC) message is created in the client memory pool, which is pre-registered in the client's network card.
[0009] The RPC message is transmitted to a target server memory pool in the server based on a remote direct memory access (RDMA) mode. The target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server. The multiple server memory pools are pre-registered in the network card of the server.
[0010] In one embodiment, the client memory pool includes a plurality of client memory blocks, the server memory pool includes a plurality of server memory blocks, and the plurality of client memory blocks correspond one-to-one to the plurality of server memory blocks in the target server memory pool;
[0011] Create a remote procedure call (RPC) message in the client memory pool based on the transfer request, including:
[0012] Creating an RPC message in a first client memory block, wherein the first client memory block is any one of the plurality of client memory blocks;
[0013] The RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA method, including:
[0014] The RPC message is transmitted to a first server-side memory block in a target server-side memory pool based on an RDMA mode, where the first server-side memory block corresponds to the first client-side memory block.
[0015] In one of the embodiments, the transmission request includes data to be written, and the RPC message includes a first message and a second message, the first message includes the data to be written, and the second message is used to notify the server that the data to be written has been sent;
[0016] The RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA method, including:
[0017] Transmitting the first message to the target server memory pool based on a write operation in the RDMA mode;
[0018] The second message is transmitted to the target server memory pool based on the send operation in the RDMA mode.
[0019] In one of the embodiments, the transmission request includes a metadata operation request, and the RPC message includes a third message;
[0020] The RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA method, including:
[0021] Transmitting the third message to the target server memory pool based on the send operation in the RDMA mode, where the third message is used for the server to execute the metadata operation request;
[0022] and / or,
[0023] The transmission request includes a read data request, and the RPC message includes a fourth message;
[0024] The RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA method, including:
[0025] The fourth message is transmitted to the target server memory pool based on the send operation in the RDMA mode. The fourth message is used for the server to store the corresponding data to be read in the target server memory pool based on the read data request, and transmit the data to be read to the client memory pool based on the write operation in the RDMA mode.
[0026] In one embodiment, the method further comprises:
[0027] Send connection detection messages to the server periodically;
[0028] If no detection reply message of the server in response to the connection detection message is received, the mapping relationship between the client memory pool and the target server memory pool is terminated;
[0029] If there is an unsent RPC message in the client memory pool when the mapping relationship between the client memory pool and the target server memory pool is terminated, the transmission request to be sent corresponding to the unsent RPC message is saved, and after a mapping relationship is established between the client memory pool and other server memory pools, a new RPC message is generated based on the transmission request to be sent, and the new RPC message is transmitted to other server memory pools based on the RDMA method.
[0030] In a second aspect, the present application also provides a distributed data transmission method for a server, including:
[0031] Obtaining a remote procedure call (RPC) message transmitted by the client based on a remote direct memory access (RDMA) mode from a target server memory pool, wherein the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, and the RPC message is created by the client in the client memory pool based on a transmission request, wherein the multiple server memory pools are pre-registered in the server network card, and the client memory pool is pre-registered in the client network card;
[0032] Based on the RPC message, the transfer request is obtained and executed.
[0033] In one embodiment, the method further comprises:
[0034] Receive a connection request message sent by a client, where the connection request message includes a client address of a client memory pool;
[0035] Based on the connection request message, determine an idle server memory pool from a plurality of server memory pools;
[0036] Determine the target server memory pool based on the free server memory pool;
[0037] A mapping relationship between the client memory pool and the target server memory pool is established based on the client address and the target server address corresponding to the target server memory pool.
[0038] In one embodiment, the method includes:
[0039] When an RPC message is received in the target server memory pool, the elimination time is reset;
[0040] If the elimination time meets the preset elimination condition, the connection with the client is disconnected and the target server memory pool is set as the idle server memory pool.
[0041] In one embodiment, the method further comprises:
[0042] In the process of determining the idle server memory pool from the multiple server memory pools, if there is no idle server memory pool among the multiple server memory pools, registering a first number of server memory pools in the network card of the server, and updating the multiple server memory pools;
[0043] When it is detected that none of the first number of server memory pools has a mapping relationship with the client, the first number of server memory pools are deregistered in the network card of the server.
[0044] In a third aspect, the present application further provides a distributed data access system, including a client and a server, wherein the client is used to obtain a transmission request to be sent to the server, create a remote procedure call RPC message in the client memory pool based on the transmission request, and transmit the RPC message to a target server memory pool in the server based on a remote direct memory access RDMA method, the client memory pool is pre-registered in the client's network card, the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, and the multiple server memory pools are pre-registered in the server's network card;
[0045] The server is used to obtain RPC messages from the target server memory pool, obtain the transfer request based on the RPC message, and execute it.
[0046] In the above-mentioned distributed data transmission method and distributed data access system, one aspect of the method is used for a client, by obtaining a transmission request to be sent to a server; creating a remote procedure call RPC message in a client memory pool based on the transmission request, and the client memory pool is pre-registered in the client's network card; transmitting the RPC message to a target server memory pool in the server based on a remote direct memory access RDMA method, and the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, and multiple server memory pools are pre-registered in the server's network card; in this way, a mapping relationship is established based on the pre-registered client memory pool and the target server memory pool, and during data transmission, an RPC message is directly created in the client memory pool and transmitted to the target server memory pool, thereby avoiding the transmission overhead caused by the dynamic memory registration method in the related art. The above-mentioned distributed data transmission method can reduce the transmission overhead and improve the transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 An application environment diagram of a distributed data transmission method in an embodiment;
[0049] Figure 2 A schematic diagram of a flow chart of a distributed data transmission method in one embodiment;
[0050] Figure 3 It is a schematic diagram of the architecture of a distributed data access system with a memory pool mapping relationship in one embodiment;
[0051] Figure 4 A schematic diagram of data transmission between a client and a server having a memory pool mapping relationship in one embodiment;
[0052] Figure 5 A schematic diagram of a flow chart of a distributed data transmission method in another embodiment;
[0053] Figure 6 A schematic diagram of a flow chart of a distributed data transmission method in another embodiment;
[0054] Figure 7 A schematic diagram of a flow chart of a distributed data transmission method in another embodiment;
[0055] Figure 8A schematic diagram of a flow chart of a distributed data transmission method in another embodiment;
[0056] Fig. 9 is an internal structure diagram of a computer device in one embodiment;
[0057] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] The distributed data transmission method provided in the embodiment of the present application can be applied to Figure 1 In the distributed access system shown in FIG. 1 , multiple clients 102 communicate with a server 104 via a network. The data storage system can store data that the client 102 needs to process. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The client 102 can be, but is not limited to, various terminal devices, such as personal computers and laptops. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0060] In an exemplary embodiment, please refer to Figure 2 , provides a distributed data transmission method, which can be used for Figure 1 Any client 102 in the distributed access system shown. Figure 2 As shown, the method may include the following steps 202 to 206. Among them:
[0061] Step 202: Obtain a transmission request to be sent to the server.
[0062] The transmission request is generally generated by an upper layer application in the client, and may include a data writing request, a data reading request, or a metadata operation request.
[0063] Step 204: Create a remote procedure call (RPC) message in the client memory pool based on the transmission request.
[0064] Among them, RPC (full name Remote Procedure Call) generally allows programs to communicate and exchange data in different address spaces, just like local programs. RPC technology implements communication based on network protocols (HTTP\TCP, etc.) and uses a specific message format to pass parameters and return values.
[0065] The client memory pool is pre-registered in the client's network card. In the embodiment of the present application, the client pre-registers the client memory pool on the network card for use when transmitting data with the server, thereby avoiding the problem of low data transmission efficiency caused by the method in the related art where the client registers the memory on the network card in real time when data transmission with the server is required.
[0066] When the upper layer application generates a transmission demand, the client directly creates a corresponding RPC message in the client memory pool of the pre-registered number. In the embodiment of the present application, the organization form of the RPC message is network header+RPCheader+payload, where network header is the network header, RPC header is the remote procedure call header, and payload is the load part; the network header+RPC header is filled according to the operation type corresponding to the transmission request, and if the transmission request is a data write request, the data to be written is filled into the payload area.
[0067] Step 206: Transmit the RPC message to the target server memory pool of the server based on the remote direct memory access (RDMA) method.
[0068] Among them, please refer to Figure 3 , is a schematic diagram of the architecture of a distributed data access system with a memory pool mapping relationship in an embodiment; the server includes multiple server memory pools, and the multiple server memory pools are mapped to multiple clients one by one. The target server memory pool is a server memory pool with a mapping relationship with the client among the multiple server memory pools in the server.
[0069] Among them, multiple server memory pools are pre-registered in the server network card. In the server network card of the embodiment of the present application, multiple server memory pools are pre-registered, and the server is used for data transmission with multiple clients, avoiding the problem of low data transmission efficiency caused by the method in the related art that the server needs to register the memory on the network card in real time when data transmission with the client is required.
[0070] Among them, the server first completes the initialization of the storage system memory pool, then registers all memory pools to the RDMA space of the high-speed network card, divides the registered memory pool into m parts, and obtains m server memory pools. In one possible implementation, the m server memory pools are all set as available identifiers. Among them, the initial number of server memory pools m can be set according to the specific application scenario. In one possible implementation, the number m is consistent with the number of clients that the server can initially serve; in another possible implementation, the number m can also be slightly more or slightly less than the number of clients that the server can initially serve.
[0071] In a possible implementation, the transmission request includes data to be written, and the RPC message includes a first message and a second message, the first message includes the data to be written, and the second message is used to notify the server that the data to be written has been sent. In this implementation, the process of transmitting the RPC message to the target server memory pool in the server based on the remote direct memory access RDMA method includes: transmitting the first message to the target server memory pool based on the write operation in the RDMA method, and transmitting the second message to the target server memory pool based on the send operation in the RDMA method.
[0072] Wherein, depending on whether the data to be written is written into the actual file data, the write data operation includes but is not limited to the write data operation and the setattr data operation. Regardless of whether it is a write data operation or a setattr data operation, in the embodiment of the present application, the write operation in the RDMA mode is used to directly transmit the corresponding first message to the target server memory pool. Wherein, the setattr write data operation is used to set or modify certain attributes of the remote node file. The write write data operation is used to write actual file data between remote nodes.
[0073] Among them, the client writes the data to be written into the payload area of the first message to obtain the first message; uses the write operation in the RMDA method to directly write the data to be written into the target server memory pool according to the mapping relationship between the client memory pool and the target server memory pool; the client generates a second message (also called a request) based on the data to be written, and writes the second message into the target client server memory pool based on the send operation in the RDMA technology to notify the server that the data to be written has been sent. Correspondingly, when the server receives the RPC message, it parses the RPC message, determines based on the first message that the client needs to write data to the server, determines based on the second message that the data to be written has been written, and stores the data to be written directly from the target server memory pool to the underlying storage medium.
[0074] In the related art, due to the use of dynamic memory registration, the process of the client writing data to the server includes: first, the client registers the memory address of the data to be written to the local high-speed network card, and then sends the memory address and the write data request to the server. After receiving the prepared local address space, the server reads the relevant data from the client through the read operation in the RDMA mode. The write data method, wherein the write data request issued by the client is received by the server and the server uses the read operation to read data from the client, these two stages are serial, resulting in low processing efficiency of the client write data request; in this embodiment, based on the mapping relationship between the pre-registered client memory pool and the target server memory pool, the client can directly write the data to be written to the server through the write operation in the RDMA mode, avoiding the memory address exchange overhead between the client and the server in the related art. In this embodiment, only one transmission process is required to complete the client write data request, with low latency and high efficiency.
[0075] In a possible implementation, the transmission request includes a metadata operation request, and correspondingly, the RPC message includes a third message, wherein the third message is used for the server to execute the metadata operation request. Exemplarily, the metadata operation request includes an open metadata operation request, a stat metadata operation request, or a close metadata operation request. In this implementation, the process of transmitting the RPC message to the target server memory pool in the server based on the RDMA method includes: transmitting the third message to the target server memory pool based on the send operation in the RDMA method.
[0076] Correspondingly, the server receives the third message based on the receive operation in the RDMA mode, parses the third message to obtain a metadata operation request, sends the metadata operation request to the backend storage system for execution, and sends a reply request to the client through a send operation to notify the client.
[0077] In a possible implementation, the transmission request includes a read data request, and correspondingly, the RPC message includes a fourth message. The read data request includes but is not limited to a read read data operation request, a readdir read data operation request, and a getattr read data operation request. The fourth message is used for the server to store the corresponding data to be read in the target server memory pool based on the read data request, and to transmit the data to be read to the client memory pool based on the write operation in the RDMA mode.
[0078] In this embodiment, the process of transmitting the RPC message to the target server memory pool in the server based on the RDMA method includes: transmitting the fourth message to the target server memory pool based on the send operation in the RDMA method. Correspondingly, the server receives the fourth message based on the receive operation in the RDMA method, parses the fourth message to obtain a read data request, and stores the corresponding data to be read in the target server memory pool based on the read data request, and directly writes the client memory pool that has a mapping relationship with the target server memory pool through the write operation in the RDMA method. Exemplarily, the server generates a reply request based on the data to be read to notify the client that the data to be read has been sent.
[0079] In the above-mentioned distributed data transmission method, it is used in the client to obtain a transmission request to be sent to the server, and based on the transmission request, an RPC message is created in the client memory pool pre-registered in the client's network card, and the RPC message is transmitted to the target server memory pool in the server that has a mapping relationship with the client memory pool based on the RDMA method, wherein the target server memory pool is pre-registered in the server's network card; in this way, a mapping relationship is established based on the pre-registered client memory pool and the target server memory pool, and during data transmission, the RPC message is directly created in the client memory pool and transmitted to the target server memory pool, thereby avoiding the transmission overhead caused by the dynamic memory registration method in the related art. The above-mentioned distributed data transmission method can reduce the transmission overhead and improve the transmission efficiency.
[0080] Please refer to Figure 4 , is a schematic diagram of data transmission between a client and a server with a memory pool mapping relationship in an exemplary embodiment. Figure 4 As shown, in this embodiment, the client memory pool includes multiple client memory blocks, the server memory pool includes multiple server memory blocks, and the multiple client memory blocks correspond to multiple server memory blocks in the target server memory pool. Exemplarily, the client memory pool and each server memory pool are each divided into n blocks.
[0081] In this embodiment, the process of creating an RPC message in a client memory pool based on a transmission request includes: creating an RPC message in a first client memory block, wherein the first client memory block is any one of a plurality of client memory blocks. Correspondingly, the process of transmitting the RPC message to a target server memory pool in a server based on an RDMA method includes: transmitting the RPC message to a first server memory block in a target server memory pool based on an RDMA method, wherein the first server memory block corresponds to the first client memory block.
[0082] In this way, based on the distributed data transmission method provided by this embodiment, the client can process multiple transmission requests concurrently through multiple client memory blocks, thereby improving the data transmission efficiency between the client and the server. Exemplarily, the client memory blocks with the same index have a mapping relationship with the server memory blocks in the target server memory pool; in the current transmission process, the client memory block with index 1 and the server memory block with index 1 in the target server memory pool are used for sending write data requests and receiving corresponding response information; when the write data request has not been completed, the client can use the client memory block with index 2 to send metadata operation requests and receive corresponding response information; when the aforementioned write data request and metadata operation request are completed, the client can use the client memory block with index n-1 to send read data requests and receive data to be read.
[0083] In a possible implementation, when the current transmission request is executed, the client can set the corresponding client memory block to the "used" mark, and when the current transmission request is completed, the client can set the corresponding client memory block to the "available" mark; when the client executes the transmission request, it determines the client memory block used by the transmission request from the client memory blocks marked as "available".
[0084] In a possible implementation, the sizes of the multiple client memory blocks in the client memory pool are the same; in this implementation, a transfer request is executed, and any client memory block is selected from the available client memory blocks for use.
[0085] In another possible implementation, the sizes of the client memory blocks in the client memory pool are not necessarily exactly the same. For example, 6 client memory blocks are provided in the client memory pool, of which 3 client memory blocks are relatively large and are preferentially used for writing and reading large data blocks, and the other 3 client memory blocks are relatively small and are preferentially used for general data and metadata operations. In this implementation, client memory blocks of different sizes are provided according to different transmission types, so that the utilization rate of the client memory pool is higher. It can be understood that the size setting of each server memory block in the server memory pool is the same as the size setting of each client memory block in the client memory block.
[0086] In an exemplary embodiment, it involves a process in which the client establishes a mapping relationship with the server memory pool before executing data transmission. The process includes: the client sends a connection request message to the server, wherein the connection request includes the memory space address of the client memory pool (for the convenience of description, this embodiment refers to it as the client address), and the connection request message is used for the server to establish a mapping relationship between the target server memory pool and the client memory pool; receiving a connection reply message from the server in response to the connection request message, wherein the connection reply message includes the memory space address of the target server memory pool (for the convenience of description, this embodiment refers to it as the target server address); and establishing a mapping relationship between the client memory pool and the target server memory pool based on the connection reply message. Exemplarily, the mapping relationship includes a mapping relationship between the client address and the server address.
[0087] In a possible implementation, if the client does not receive a connection reply message from the server in response to the connection request message, the client resends the connection request message to the server after a preset interval, and waits to reestablish a connection with the server.
[0088] In a possible implementation, if the client fails to connect to the server within a preset number of times or fails to connect to the server within a preset time, the server is considered to be faulty and a corresponding error prompt message is returned to the upper layer application.
[0089] In an exemplary embodiment, it involves how the client responds to network failures after establishing a memory pool mapping relationship with the server. The distributed data transmission method provided in this embodiment also includes: the client periodically sends a connection detection message to the server, wherein the connection detection message can also be called a heartbeat packet; if the client does not receive a detection recovery message from the server in response to the connection detection message, the client terminates the mapping relationship between the client memory pool and the target server memory pool; if there is an unsent RPC message in the client memory pool when terminating the mapping relationship between the client memory pool and the target server memory pool, the transmission request to be sent corresponding to the unsent RPC message is saved, and after establishing a mapping relationship between the client memory pool and other server memory pools, a new RPC message is generated based on the transmission request to be sent, and the new RPC message is transmitted to other server memory pools based on the RDMA method.
[0090] Among them, if the client does not receive the detection reply message of the server in response to the connection detection message, the client believes that the server is faulty or the network is faulty, and actively disconnects from the server, and sets the client memory pool to available. If there are unsuccessful RPC messages in the client memory pool at this time, the corresponding transmission request to be sent is saved.
[0091] In a possible implementation, after the client actively disconnects from the server, it periodically sends a connection request message to the server. If the server responds to the connection request message, a mapping relationship between the client memory pool and other server memory pools in the server is established; a corresponding RPC message is re-created based on the server address of the other server memory pool, and transmitted to the other server memory pool based on the RDMA message. In particular, when the target server memory pool has been recycled and set to an available state by the server, the other server memory pool may still be the target server memory pool that was previously connected, or it may be other idle server memory pools.
[0092] In a possible implementation, if the client fails to connect to the server within a preset number of times or within a preset duration, the client considers that the server has failed, releases the unsuccessful transmission request, and returns an error message to the upper layer application.
[0093] The distributed data storage method provided in this embodiment provides a fault-tolerant mechanism, which can actively restore to normal after a temporary failure of the server or the network, realize the update of the memory pool mapping relationship between the client and the server, and allow network disconnection failures without interrupting the distributed data access service.
[0094] In an exemplary embodiment, please refer to Figure 5 , provides a distributed data transmission method, which can be used for Figure 1 Any client 102 in the distributed access system shown, wherein a client memory pool is pre-registered on the network card of the client 102, wherein the client memory pool includes multiple client memory blocks, multiple server memory pools are pre-registered on the network card of the server 104, the server memory pool includes multiple server memory blocks, the client memory pool corresponds to a target server memory pool in the multiple server memory pools, and the multiple client memory blocks correspond one-to-one to the multiple server memory blocks in the target server memory pool, such as Figure 4 As shown. Figure 5 As shown, the method may include the following steps:
[0095] Step 502: Obtain a transmission request to be sent to the server.
[0096] Step 504: Create an RPC message in a first client memory block, wherein the first client memory block is any client memory block among a plurality of client memory blocks.
[0097] Step 506: Transmit the RPC message to a first server memory block in the target server memory pool based on the RDMA mode, where the first server memory block corresponds to the first client memory block.
[0098] Optionally, the transmission request includes data to be written, and the RPC message includes a first message and a second message, the first message includes the data to be written, and the second message is used to notify the server that the data to be written has been sent; the RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA method, including: transmitting the first message to the target server memory pool based on the write operation in the RDMA method; transmitting the second message to the target server memory pool based on the send operation in the RDMA method.
[0099] Optionally, the transmission request includes a metadata operation request, and the RPC message includes a third message; the RPC message is transmitted to a target server memory pool in the server based on a remote direct memory access (RDMA) method, including: transmitting the third message to the target server memory pool based on a send operation in the RDMA method, and the third message is used for the server to execute the metadata operation request.
[0100] Optionally, the transmission request includes a read data request, and the RPC message includes a fourth message; the RPC message is transmitted to a target server memory pool in the server based on a remote direct memory access (RDMA) method, including: transmitting the fourth message to the target server memory pool based on a send operation in the RDMA method, the fourth message being used for the server to store corresponding data to be read in the target server memory pool based on the read data request, and transmitting the data to be read to the client memory pool based on a write operation in the RDMA method.
[0101] Step 508: Send a connection detection message to the server at a regular interval.
[0102] Step 510: If no detection reply message is received from the server in response to the connection detection message, the mapping relationship between the client memory pool and the target server memory pool is terminated.
[0103] Step 512: If there is an unsent RPC message in the client memory pool when the mapping relationship between the client memory pool and the target server memory pool is terminated, the transmission request to be sent corresponding to the unsent RPC message is saved, and after a mapping relationship is established between the client memory pool and other server memory pools, a new RPC message is generated based on the transmission request to be sent, and the new RPC message is transmitted to the other server memory pool based on the RDMA method.
[0104] In an exemplary embodiment, please refer to Figure 6 , provides a distributed data transmission method, which can be used for Figure 1 In the server 104 of the distributed access system shown. Figure 6 As shown, the method may include the following steps 602 to 604, wherein:
[0105] Step 602, obtaining a remote procedure call (RPC) message transmitted by the client based on remote direct memory access (RDMA) from a target server memory pool, wherein the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, and the RPC message is created by the client in the client memory pool based on a transmission request, wherein multiple server memory pools are pre-registered in the server's network card, and the client memory pool is pre-registered in the client's network card.
[0106] Step 604: Based on the RPC message, obtain and execute the transmission request.
[0107] Exemplarily, the transmission request includes the data to be written. After the server parses the RPC message, it takes out the data to be written from the target server memory pool and stores it in the server's backend storage system, and generates a reply request. Based on the send operation in the RDMA mode, the reply request is transmitted to the client to notify the client that the data to be written has been stored.
[0108] Exemplarily, the transmission request includes a metadata operation request. After parsing the RPC message, the server sends the metadata operation to the server's backend storage system for execution and generates a reply request, which is notified to the client based on the send operation in the RDMA mode.
[0109] Exemplarily, the transmission request includes a request to read data. After the server parses the RPC message, it copies the data to be read from the backend storage system and fills it into the target server memory pool. Then, based on the mapping relationship between the client memory pool and the target server memory pool, it uses the write operation in the RDMA method to write the data to be read directly to the client memory pool, and sends a reply request to the client to notify the client that the writing of the data to be read is completed.
[0110] In the distributed data transmission method provided in the above embodiment, the server establishes a mapping relationship with the client memory pool based on the pre-registered target server memory pool. During data transmission, the client's RPC message is directly obtained from the target server memory pool to parse the client's transmission request, avoiding the transmission overhead caused by the dynamic memory registration method in the related technology; the distributed data transmission method provided in this embodiment can reduce transmission overhead and improve transmission efficiency.
[0111] Please refer to Figure 7 In an exemplary embodiment, based on Figure 6 In the embodiment shown, the distributed data transmission method provided further includes steps 702 to 708, wherein:
[0112] Step 702: Receive a connection request message sent by a client, wherein the connection request message includes a client address of a client memory pool.
[0113] Step 704: Determine an idle server memory pool from multiple server memory pools based on the connection request message.
[0114] In a possible implementation, after the server registers multiple server memory pools in the network card, it sets an "available" flag for each server memory pool, and after a mapping relationship is established between a certain server memory pool and a client memory pool, the "available" flag is changed to a "used" flag. In this implementation, the process of determining an idle server memory pool from multiple server memory pools includes identifying a server memory pool with a flag of "available" and determining it as an idle server memory pool.
[0115] In another possible implementation, a mapping relationship management table is provided in the server; after the server registers multiple server memory pools in the network card, a mapping relationship management table is generated accordingly to record the mapping relationship established for each server memory pool; in this implementation, the process of determining an idle server memory pool from multiple server memory pools includes: determining an idle server memory pool based on the mapping relationship management table.
[0116] In a possible implementation, in the process of determining an idle server memory pool from multiple server memory pools, if no idle server memory pool exists among the multiple server memory pools, a first number of server memory pools are registered in a network card of the server, and the multiple server memory pools are updated.
[0117] If there is no idle server memory pool among the multiple server memory pools, it can be considered that a new client has joined the initial state of the distributed data access system, and the number of initial server memory pools is insufficient; in this case, the present embodiment newly registers a first number of server memory pools on the server network card to achieve memory pool expansion. Exemplarily, the first number is greater than 1. Another exemplary embodiment, the first number is equal to the number of initial server memory pools.
[0118] Exemplarily, if a mapping relationship management table is used, when the plurality of server memory pools are updated, the mapping relationship management table is also expanded synchronously to record the mapping relationships of the first number of newly registered server memory pools.
[0119] In this embodiment, when it is detected that the first number of server-side memory pools do not have a mapping relationship with the client, the first number of server-side memory pools are deregistered in the server-side network card. After the first number of server-side memory pools registered by the server are all marked as "available", the first number of server-side memory pools will be deregistered to achieve the shrinkage of the memory pool. The server retains the multiple server-side memory pools applied for during initialization, which can avoid frequent registration and shrinkage of memory pools in the network card.
[0120] Through the method provided in this implementation, the expansion and contraction of the server-side memory pool is achieved, the fragmentation of the server-side memory is reduced, and the resource utilization of the memory is improved.
[0121] Step 706: determine a target server memory pool based on the idle server memory pool.
[0122] In a possible implementation, according to a preset query sequence, the target server memory pool is determined from the idle servers according to the query sequence, for example, the first idle server corresponding to the query sequence is the target server memory pool.
[0123] Step 708: Establish a mapping relationship between the client memory pool and the target server memory pool based on the client address and the target server address corresponding to the target server memory pool.
[0124] In a possible implementation, the client memory pool includes a plurality of client memory blocks, the server memory pool includes a plurality of server memory blocks, and the plurality of client memory blocks correspond one-to-one to the plurality of server memory blocks in the target server memory pool. In this implementation, exemplarily, the client address includes the client sub-address corresponding to each client memory block, the target server address includes the server terminal address corresponding to each server memory block in the target server memory pool, and the mapping relationship includes the mapping relationship between each client sub-address and each server terminal address. Also exemplarily, the client address includes the starting address of the client memory pool and the size of the space occupied by each client memory block, the server address includes the starting address of the target server memory pool and the size of the space occupied by each server memory block, the mapping relationship includes the mapping relationship between the starting address of the client memory pool and the starting address of the target server memory pool, and in this example, the mapping relationship between the client memory block and the server memory block is determined based on the starting addresses of the two memory pools and the index order of the memory blocks in the memory pool.
[0125] In an exemplary embodiment, the provided distributed data transmission method also includes: when an RPC message is received in the target server memory pool, resetting the elimination time; if the elimination time meets the preset elimination condition, disconnecting the connection with the client and setting the target server memory pool to an idle server memory pool.
[0126] Among them, after the target server memory pool and the client memory pool establish a mapping relationship, the service order sets the target server memory pool to the "used" mark and sets the elimination time for the target server memory pool. The preset elimination condition is that the target server memory pool has no RPC message from the client within the preset time. Exemplarily, the initial value of the elimination time set by the server for the target server memory pool is T; after the target server memory pool and the client memory pool establish a mapping relationship, the elimination time is initialized, and the countdown is started to update the elimination time. If an RPC message is received in the target memory pool, the elimination time is reset and the countdown is restarted. If the elimination time drops from T to 0, the connection with the client is disconnected, the mapping relationship between the client memory pool and the target server memory pool is terminated, and the target server memory pool is set to an idle server memory pool. Another exemplary example is that the initial value of the elimination time set by the server for the target server memory pool is 0, and the elimination time is updated by accumulating the elimination time.
[0127] After disconnecting from the client, if the client has a new transmission request, it will re-apply to establish a connection with the server and the mapping relationship between the memory pool.
[0128] In an exemplary embodiment, please refer to Figure 8 , provides a distributed data transmission method, which can be used for Figure 1 In the server 104 of the distributed access system shown. Figure 8 As shown, the method may include the following steps 802 to 816, wherein:
[0129] Step 802: Receive a connection request message sent by a client, where the connection request message includes a client address of a client memory pool.
[0130] Step 804: Determine an idle server memory pool from multiple server memory pools based on the connection request message.
[0131] Optionally, during the execution of step 806, if there is no idle server memory pool among the multiple server memory pools, a first number of server memory pools are registered in the server's network card, and the multiple server memory pools are updated; when it is detected that the first number of server memory pools do not have a mapping relationship with the client, the first number of server memory pools are deregistered in the server's network card.
[0132] Step 806: determine a target server memory pool based on the idle server memory pool.
[0133] Step 808: Establish a mapping relationship between the client memory pool and the target server memory pool based on the client address and the target server address corresponding to the target server memory pool.
[0134] Step 810, obtain a remote procedure call RPC message transmitted by the client based on remote direct memory access RDMA from a target server memory pool, the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, the RPC message is created by the client in the client memory pool based on a transmission request, multiple server memory pools are pre-registered in the server's network card, and the client memory pool is pre-registered in the client's network card.
[0135] Step 812: Based on the RPC message, obtain and execute the transmission request.
[0136] Step 814, when an RPC message is received in the target server memory pool, the elimination time is reset.
[0137] Step 816: If the elimination time meets the preset elimination condition, the connection with the client is disconnected, and the target server memory pool is set as an idle server memory pool.
[0138] In the distributed data transmission method provided in the above embodiment, the server exchanges memory data with the client based on a pre-registered server memory pool, thereby reducing the transmission overhead between the server and the client and improving the efficiency of distributed data transmission; allowing dynamic scaling of the server memory pool to achieve defragmentation of the server memory pool.
[0139] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0140] It is understood that the term "based on" used in this application is used to describe one or more factors that affect the determination, and does not exclude other factors that may affect the determination. For example, the phrase "determine A based on B" means that the determination of A can be based entirely or at least partially on factor B, that is, B is a factor that affects the determination of A, but does not exclude that the determination of A is also based on C.
[0141] In an exemplary embodiment, a distributed data access system is provided, including a client and a server, wherein:
[0142] The client is used to obtain a transmission request to be sent to the server, create an RPC message in the client memory pool based on the transmission request, and transmit the RPC message to the target server memory pool in the server based on the RDMA mode, wherein the client memory pool is pre-registered in the client's network card, the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, and the multiple server memory pools are pre-registered in the server's network card.
[0143] The server is used to obtain RPC messages from the target server memory pool, obtain the transmission request based on the RPC message and execute it.
[0144] In an exemplary embodiment, a client memory pool includes multiple client memory blocks, a server memory pool includes multiple server memory blocks, and the multiple client memory blocks correspond one-to-one to the multiple server memory blocks in the target server memory pool; the client is used to create an RPC message in a first client memory block, wherein the first client memory block is any one of the multiple client memory blocks; and the client is used to transmit the RPC message to the first server memory block in the target server memory pool based on RDMA, and the first server memory block corresponds to the first client memory block.
[0145] The server is used to obtain the RPC message from the first server memory block, obtain the transmission request based on the RPC message and execute it.
[0146] In an exemplary embodiment, the transmission request includes data to be written, and the RPC message includes a first message and a second message, the first message includes the data to be written, and the second message is used to notify the server that the sending of the data to be written is completed; the client is used to transmit the first message to the target server memory pool based on the write operation in the RDMA mode, and transmit the second message to the target server memory pool based on the send operation in the RDMA mode.
[0147] In an exemplary embodiment, the transmission request includes a metadata operation request, and the RPC message includes a third message; the client is used to transmit the third message to the target server memory pool based on a send operation in the RDMA mode, and the third message is used for the server to execute the metadata operation request;
[0148] In an exemplary embodiment, the transmission request includes a read data request, and the RPC message includes a fourth message; the client is used to transmit the fourth message to the target server memory pool based on the send operation in the RDMA mode, and the fourth message is used for the server to store the corresponding data to be read in the target server memory pool based on the read data request, and transmit the data to be read to the client memory pool based on the write operation in the RDMA mode.
[0149] In an exemplary embodiment, the client is used to periodically send a connection detection message to the server.
[0150] The server is used to send a detection reply message to the client in response to the connection detection message.
[0151] The client is used to terminate the mapping relationship between the client memory pool and the target server memory pool when no detection reply message is received from the server in response to the connection detection message; and if there is an unsent RPC message in the client memory pool when terminating the mapping relationship between the client memory pool and the target server memory pool, save the transmission request to be sent corresponding to the unsent RPC message, after establishing a mapping relationship between the client memory pool and the other server memory pools, generate a new RPC message based on the transmission request to be sent, and transmit the new RPC message to the other server memory pool based on the RDMA method.
[0152] In an exemplary embodiment, the client is used to send a connection request message to the server, wherein the connection request message includes a client address of the client memory pool.
[0153] The server is used to determine an idle server memory pool from multiple server memory pools based on the connection request message, determine a target server memory pool based on the idle server memory pool, establish a mapping relationship between the client memory pool and the target server memory pool based on the client address and the target server address corresponding to the target server memory pool, and send a connection reply message to the client, wherein the connection reply message includes the target server address.
[0154] The client is used to establish a mapping relationship between the client memory pool and the target server memory pool based on the connection reply message. Exemplarily, the mapping relationship includes a mapping relationship between the client address and the server address.
[0155] In an exemplary embodiment, the server is used to reset the elimination time when receiving an RPC message in the target server memory pool; if the elimination time meets the preset elimination condition, the connection with the client is disconnected and the target server memory pool is set to an idle server memory pool.
[0156] In an exemplary embodiment, the server is used to register a first number of server memory pools in a network card of the server and update the multiple server memory pools if there is no free server memory pool among the multiple server memory pools during the process of determining a free server memory pool from multiple server memory pools; and unregister the first number of server memory pools in the network card of the server when it is detected that none of the first number of server memory pools has a mapping relationship with the client.
[0157] Based on the same inventive concept, the embodiment of the present application also provides a distributed data transmission device for implementing the above-mentioned distributed data transmission method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more distributed data transmission device embodiments provided below can refer to the above-mentioned limitations on the distributed data transmission method, and will not be repeated here.
[0158] In an exemplary embodiment, a distributed data transmission device is provided, which is used for a client, and includes: a request acquisition module, a message creation module and a remote transmission module, wherein:
[0159] The request acquisition module is used to obtain the transmission request to be sent to the server;
[0160] The message creation module is used to create a remote procedure call RPC message in the client memory pool based on the transmission request. The client memory pool is pre-registered in the client's network card;
[0161] The remote transmission module is used to transmit the RPC message to the target server memory pool in the server based on the remote direct memory access RDMA method. The target server memory pool is a server memory pool with a mapping relationship with the client among multiple server memory pools in the server. Multiple server memory pools are pre-registered in the network card of the server.
[0162] In an exemplary embodiment, the client memory pool includes multiple client memory blocks, the server memory pool includes multiple server memory blocks, and the multiple client memory blocks correspond one-to-one to the multiple server memory blocks in the target server memory pool; the message creation module is used to create an RPC message in a first client memory block, wherein the first client memory block is any one of the multiple client memory blocks; the remote transmission module is used to transmit the RPC message to the first server memory block in the target server memory pool based on the RDMA method, and the first server memory block corresponds to the first client memory block.
[0163] In an exemplary embodiment, a transmission request includes data to be written, and an RPC message includes a first message and a second message, the first message includes the data to be written, and the second message is used to notify the server that the data to be written has been sent; the remote transmission module is used to transmit the first message to the target server memory pool based on the write operation in the RDMA mode; and transmit the second message to the target server memory pool based on the send operation in the RDMA mode.
[0164] In an exemplary embodiment, the transmission request includes a metadata operation request, and the RPC message includes a third message; the remote transmission module is used to transmit the third message to the target server memory pool based on the send operation in the RDMA mode, and the third message is used for the server to execute the metadata operation request.
[0165] In an exemplary embodiment, the transmission request includes a read data request, and the RPC message includes a fourth message; the remote transmission module is used to transmit the fourth message to the target server memory pool based on the send operation in the RDMA mode, and the fourth message is used for the server to store the corresponding data to be read in the target server memory pool based on the read data request, and to transmit the data to be read to the client memory pool based on the write operation in the RDMA mode.
[0166] In an exemplary embodiment, the distributed data transmission device also includes a connection detection module, which is used to periodically send a connection detection message to the server; if the server does not receive a detection reply message in response to the connection detection message, the mapping relationship between the client memory pool and the target server memory pool is terminated; if there is an unsent RPC message in the client memory pool when the mapping relationship between the client memory pool and the target server memory pool is terminated, the transmission request to be sent corresponding to the unsent RPC message is saved, and after a mapping relationship is established between the client memory pool and other server memory pools, a new RPC message is generated based on the transmission request to be sent, and the new RPC message is transmitted to other server memory pools based on the RDMA method.
[0167] In an exemplary embodiment, a distributed data transmission device is provided, which is used in a server, and includes: a message acquisition module and a request execution module, wherein:
[0168] The message acquisition module is used to obtain the remote procedure call RPC message transmitted by the client based on the remote direct memory access RDMA mode from the target server memory pool. The target server memory pool is a server memory pool with a mapping relationship with the client among multiple server memory pools in the server. The RPC message is created by the client in the client memory pool based on the transmission request. The multiple server memory pools are pre-registered in the server's network card, and the client memory pool is pre-registered in the client's network card.
[0169] The request execution module is used to obtain and execute the transmission request based on the RPC message.
[0170] In an exemplary embodiment, the distributed data transmission device also includes a connection response module, which is used to receive a connection request message sent by a client, the connection request message including a client address of a client memory pool; based on the connection request message, determine an idle server memory pool from multiple server memory pools; determine a target server memory pool based on the idle server memory pool; and establish a mapping relationship between the client memory pool and the target server memory pool based on the client address and the target server address corresponding to the target server memory pool.
[0171] In an exemplary embodiment, the distributed data transmission device also includes a dynamic scaling module, which is used to reset the elimination time when an RPC message is received in the target server memory pool; if the elimination time meets the preset elimination condition, the connection with the client is disconnected and the target server memory pool is set to an idle server memory pool.
[0172] In an exemplary embodiment, the dynamic scaling module is also used to register a first number of server memory pools in a network card of the server and update the multiple server memory pools if there is no free server memory pool among the multiple server memory pools during the process of determining the free server memory pool from the multiple server memory pools; and to deregister the first number of server memory pools in the network card of the server when it is detected that none of the first number of server memory pools has a mapping relationship with the client.
[0173] Each module in the above-mentioned distributed data transmission device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0174] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data that needs to be stored in a distributed data access system. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a distributed data transmission method for a server is implemented.
[0175] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a distributed data transmission method for a client is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0176] Those skilled in the art will understand that Fig. 9 and Fig.10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0177] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0178] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0179] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0180] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0182] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0183] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A distributed data transmission method, characterized in that: For a client, the method comprises: Get the transmission request to be sent to the server; Creating a remote procedure call (RPC) message in a client memory pool based on the transmission request, wherein the client memory pool is pre-registered in a network card of the client; The RPC message is transmitted to a target server memory pool in the server based on a remote direct memory access (RDMA) mode, wherein the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, and the multiple server memory pools are pre-registered in the network card of the server.
2. The method according to claim 1, characterized in that The client memory pool includes a plurality of client memory blocks, the server memory pool includes a plurality of server memory blocks, and the plurality of client memory blocks correspond one to one with the plurality of server memory blocks in the target server memory pool; The step of creating a remote procedure call (RPC) message in a client memory pool based on the transmission request includes: Creating the RPC message in a first client memory block, wherein the first client memory block is any one of the plurality of client memory blocks; The RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA mode, including: The RPC message is transmitted to a first server-side memory block in the target server-side memory pool based on an RDMA mode, where the first server-side memory block corresponds to the first client-side memory block.
3. The method according to claim 1, characterized in that The transmission request includes the data to be written, and the RPC message includes a first message and a second message, the first message includes the data to be written, and the second message is used to notify the server that the data to be written has been sent; The RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA mode, including: Transmitting the first message to the target server memory pool based on a write operation in an RDMA manner; The second message is transmitted to the target server memory pool based on a send operation in an RDMA manner.
4. The method according to claim 1, characterized in that: The transmission request includes a metadata operation request, and the RPC message includes a third message; The RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA mode, including: Transmitting the third message to the target server memory pool based on a send operation in an RDMA manner, wherein the third message is used for the server to execute the metadata operation request; and / or, The transmission request includes a read data request, and the RPC message includes a fourth message; The RPC message is transmitted to the target server memory pool in the server based on the remote direct memory access RDMA mode, including: The fourth message is transmitted to the target server memory pool based on the send operation in the RDMA mode, and the fourth message is used for the server to store the corresponding data to be read in the target server memory pool based on the read data request, and transmit the data to be read to the client memory pool based on the write operation in the RDMA mode.
5. The method according to claim 1, characterized in that The method further comprises: Periodically sending a connection detection message to the server; If no detection reply message of the server in response to the connection detection message is received, terminating the mapping relationship between the client memory pool and the target server memory pool; If there is an unsent RPC message in the client memory pool when the mapping relationship between the client memory pool and the target server memory pool is terminated, the transmission request to be sent corresponding to the unsent RPC message is saved, and after a mapping relationship is established between the client memory pool and other server memory pools, a new RPC message is generated based on the transmission request to be sent, and the new RPC message is transmitted to the other server memory pool based on the RDMA method.
6. A distributed data transmission method, characterized in that: For the server, the method includes: Acquire a remote procedure call (RPC) message transmitted by the client based on a remote direct memory access (RDMA) mode from a target server memory pool, wherein the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, and the RPC message is created by the client in the client memory pool based on a transmission request, the multiple server memory pools are pre-registered in the network card of the server, and the client memory pool is pre-registered in the network card of the client; Based on the RPC message, the transmission request is obtained and executed.
7. The method according to claim 6, characterized in that The method further comprises: receiving a connection request message sent by the client, wherein the connection request message includes a client address of the client memory pool; Based on the connection request message, determining an idle server memory pool from the multiple server memory pools; Determine the target server memory pool based on the idle server memory pool; A mapping relationship between the client memory pool and the target server memory pool is established based on the client address and the target server address corresponding to the target server memory pool.
8. The method according to claim 7, characterized in that The method comprises: When the RPC message is received in the target server memory pool, the elimination time is reset; If the elimination time meets the preset elimination condition, the connection with the client is disconnected, and the target server memory pool is set as an idle server memory pool.
9. The method according to claim 7, characterized in that: The method further comprises: In the process of determining the idle server memory pool from the multiple server memory pools, if there is no idle server memory pool among the multiple server memory pools, registering a first number of server memory pools in the network card of the server, and updating the multiple server memory pools; When it is detected that none of the first number of server memory pools has a mapping relationship with the client, the first number of server memory pools are deregistered in the network card of the server.
10. A distributed data access system, comprising a client and a server, characterized in that: The client is used to obtain a transmission request to be sent to the server, create a remote procedure call (RPC) message in the client memory pool based on the transmission request, and transmit the RPC message to a target server memory pool in the server based on a remote direct memory access (RDMA) mode, wherein the client memory pool is pre-registered in the network card of the client, and the target server memory pool is a server memory pool having a mapping relationship with the client among multiple server memory pools in the server, and the multiple server memory pools are pre-registered in the network card of the server; The server is used to obtain the RPC message from the target server memory pool, and based on the RPC message, obtain and execute the transmission request.
Citation Information
Cited By
RDMA (Remote Direct Memory Access) distributed data transmission method supporting high-concurrency message transmission
CN119603340A
