Communication method, system and device and storage medium

By introducing proxy processes on client and server devices, and establishing RDMA connections using proxy communication connections, the problem that TCP protocol-based applications in the prior art are difficult to support RDMA protocol, and efficient RDMA communication is achieved without modifying the operating system core.

CN119583619APending Publication Date: 2025-03-07HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311151038.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-06
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the prior art, applications written based on the TCP protocol are difficult to support the RDMA protocol, and it is costly to modify the server operating system core to support RDMA.

Method used

The proxy process is introduced on the client device and the server device, and the connection establishment request is sent through the proxy communication connection between the proxy processes, so as to establish an RDMA connection between applications without modifying the operating system kernel.

Benefits of technology

Without modifying the operating system kernel, communication based on the RDMA protocol between applications is realized, reducing the complexity and cost of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583619A_ABST
    Figure CN119583619A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a communication method, system and device and a storage medium. The method is applied to a first proxy process on client equipment, and comprises the following steps: acquiring a first connection establishment request initiated by a first application process on the client equipment; the first connection establishment request carries a port number of a first port of the server equipment and connection establishment information required for establishing a preset protocol connection; sending the first connection establishment request to a second proxy process through proxy communication connection between the first proxy process and the second proxy process on the server equipment; receiving response information through the proxy communication connection; the response information carries connection establishment information required for establishing the preset protocol connection; and sending the response information to the first application process to establish a preset protocol connection between the first application process and a target application process for monitoring the first port on the server device. According to the scheme, on the premise that an operating system kernel is not modified, the purpose of communication based on the preset protocol of the application program is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a communication method, system, device and storage medium. Background Art

[0002] The Remote Direct Memory Access (RDMA) protocol, with its kernel bypass feature, allows direct data reading and writing between applications and network cards. It can transfer data directly from the memory of one computer to another computer without the intervention of the operating systems of both parties, circumventing the limitations of the Transmission Control Protocol / Internet Protocol (TCP / IP), and can effectively reduce communication latency and CPU (Central Processing Unit) occupancy. It is widely used in in-memory databases, distributed storage, and high-performance computing.

[0003] However, in the prior art, many existing applications are written based on the TCP protocol and the operating systems of many servers themselves only support the TCP protocol but cannot support the RDMA protocol.

[0004] In the prior art, in order to enable these applications to use RDMA for communication, it is necessary not only to modify the application code but also to modify the server's operating system kernel. It can be seen that in the prior art, it is costly to enable applications written based on the TCP protocol to support RDMA communication. Summary of the invention

[0005] In view of the above problems, the present application is proposed to provide a communication method, system, device and storage medium that solve the above problems or at least partially solve the above problems.

[0006] Therefore, in one embodiment of the present application, a communication method is provided, which is applied to a first agent process; the first agent process runs on a client device; a first application process also runs on the client device;

[0007] Obtaining a first connection establishment request initiated by the first application process; the first connection establishment request carries the port number of the first port of the server device and first connection establishment information required to establish a preset protocol connection;

[0008] Sending the first connection establishment request to the second proxy process through a proxy communication connection between the first proxy process and the second proxy process on the server device;

[0009] Receiving a response message through the proxy communication connection; wherein the response message carries the second connection establishment information required to establish the preset protocol connection;

[0010] The response information is sent to the first application process to establish the preset protocol connection between the first application process and a target application process on the server device that listens to the first port.

[0011] In another embodiment of the present application, a communication method is provided.

[0012] Applied to a second proxy process; the second proxy process runs on a server device;

[0013] Receiving a first connection establishment request sent by a first proxy process on a client device through a proxy communication connection; the proxy communication connection is connected between the first proxy process and the second proxy process; the first connection establishment request carries the port number of the first port and first connection establishment information required to establish a preset protocol connection;

[0014] A response message is sent through the proxy communication connection to establish the preset protocol connection between the first application process and the target application process listening to the first port on the server device; the response message carries second connection establishment information required to establish the preset protocol connection.

[0015] In another embodiment of the present application, a communication system is provided, comprising:

[0016] A client device and a server device; a first proxy process and a first application process are running on the client device; a second proxy process and a target application process that monitors a first port are running on the server device;

[0017] The first proxy process is used to obtain a first connection request initiated by the first application process; the first connection request carries the port number of the first port and the first connection information required to establish a preset protocol connection; the first connection request is sent to the second proxy process through the proxy communication connection between the first proxy process and the second proxy process on the server device;

[0018] The second proxy process is used to receive the first connection establishment request sent through the proxy communication connection; send a response message through the proxy communication connection; wherein the response message carries the second connection establishment information required to establish the preset protocol connection;

[0019] The first proxy process is further configured to receive the response information through the proxy communication connection; and send the response information to the first application process to establish the preset protocol connection between the first application process and the target application process.

[0020] In another embodiment of the present application, an electronic device is provided. The electronic device includes: a memory and a processor, wherein:

[0021] The memory is used to store programs;

[0022] The processor is coupled to the memory, and is used to execute the program stored in the memory to implement any of the above communication methods.

[0023] In yet another embodiment of the present application, a computer-readable storage medium storing a computer program is provided. When the computer program is executed by a computer, the communication method described in any one of the above can be implemented.

[0024] In the technical solution provided by the embodiment of the present application, proxy processes are introduced on the client device and the server device respectively; when the application process on the client device needs to establish a preset protocol connection with the application process on the server device, such as an RDMA connection, the application process on the client device sends a connection request through the proxy communication connection between the two proxy processes; after receiving the connection request, the proxy process on the server device returns a response message carrying the second connection information required to establish the preset protocol connection through the proxy communication connection, thereby establishing a preset protocol connection between the application process on the client device and the application process on the server device. It can be seen that by introducing a proxy process, this solution allows the application to achieve the purpose of communication based on the preset protocol without modifying the operating system kernel. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0026] Figure 1 A schematic diagram of the structure of a communication system provided in one embodiment of the present application;

[0027] Figure 2 A flow chart of a communication method provided in one embodiment of the present application;

[0028] Figure 3 A flow chart of a communication method provided in yet another embodiment of the present application;

[0029] Figure 4 An example diagram of the connection between the parent-child process and the second proxy process provided in an embodiment of the present application;

[0030] Figure 5 A schematic diagram of a connection between a non-parent-child process and a second proxy process provided in an embodiment of the present application;

[0031] Figure 6 A signaling diagram of a communication method provided in an embodiment of the present application;

[0032] Figure 7 A structural block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0033] Currently, most applications are written based on TCP, such as the reverse proxy service Nginx, the remote dictionary service Redis (Remote Dictionary Server), the relational database management system MySQL, etc. These TCP applications and the servers used to host these TCP applications are widely used, but these applications and their servers do not support the RDMA protocol, and it is very costly to enable them to support the RDMA protocol through the server operating system kernel.

[0034] Therefore, the present application provides a new communication method, which enables these applications to implement the RDMA communication function of the application without modifying the kernel. Specifically, in the technical solution provided by the embodiment of the present application, proxy processes are introduced on the client device and the server device respectively; when the application process on the client device needs to establish a preset protocol connection with the application process on the server device, such as an RDMA connection, the application process on the client device sends a connection request through the proxy communication connection between the two proxy processes; after the proxy process on the server device receives the connection request, it returns a response message carrying the second connection information required to establish the preset protocol connection through the proxy communication connection, and then establishes a preset protocol connection between the application process on the client device and the application process on the server device. It can be seen that this solution allows the application to achieve the purpose of communication based on the preset protocol by introducing a proxy process without modifying the kernel of the operating system.

[0035] In addition, in actual applications, applications such as Nginx use a multi-process architecture and rely on the feature that multiple processes listen to the same port. However, RDMA itself does not involve multiple processes listening to the same port, which means that the existing technology cannot meet the requirements of multiple processes of applications such as Nginx to listen to the same port.

[0036] In order to solve or partially solve the above problems, the embodiment of the present application also proposes that: after the proxy process on the server device receives the connection request, it distributes the connection request to multiple application processes listening to the first port according to the port number of the first port of the server device carried in the connection request; the application process on the server device that obtains the connection request is also the target application process selected this time that needs to establish a preset protocol connection with the application process on the client device. It can be seen that this solution realizes the ability of multiple processes listening to the same port to improve the system concurrency based on the communication using the preset protocol connection, such as RDMA connection.

[0037] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below according to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0038] In addition, some of the processes described in the specification, claims and the above-mentioned figures of the present application include multiple operations that appear in a specific order, and these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0039] 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 the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0040] Before introducing the communication method provided in the embodiment of the present application, the system architecture involved in the communication method provided in the embodiment of the present application is introduced. Figure 1 As shown, the communication system includes: a client device 1 and a server device 2; the client device 1 runs a first proxy process 11 and a first application process 12; the server device 2 runs a second proxy process 21 and a target application process that monitors a first port;

[0041] The first proxy process 11 is used to obtain a first connection request initiated by the first application process 12; the first connection request carries the port number of the first port and the first connection information required to establish a preset protocol connection; the first connection request is sent to the second proxy process 21 through the proxy communication connection between the first proxy process 11 and the second proxy process 21 on the server device 2;

[0042] The second proxy process 21 is used to receive the first connection establishment request sent through the proxy communication connection; send a response message through the proxy communication connection; wherein the response message carries the second connection establishment information required to establish the preset protocol connection;

[0043] The first proxy process 11 is further configured to receive the response information through the proxy communication connection; and send the response information to the first application process 12 to establish the preset protocol connection between the first application process 12 and the target application process.

[0044] In one example, the server device and the client device may be two different servers in the cloud.

[0045] The specific implementation of the server device and the client device in the above communication system will be described in detail in the following embodiments.

[0046] The embodiment of the present application provides a communication method. The execution subject of the method may be a first proxy process running on a client device in the above communication system; a first application process is also running on the client device. The method includes:

[0047] 101. Obtain a first connection establishment request initiated by the first application process.

[0048] The first connection establishment request carries the port number of the first port of the server device and the first connection establishment information required to establish a preset protocol connection.

[0049] 102. Send the first connection establishment request to the second proxy process through a proxy communication connection between the first proxy process and the second proxy process on the server device.

[0050] 103. Receive response information through the proxy communication connection.

[0051] The response information carries the second connection establishment information required to establish the preset protocol connection.

[0052] 104. Send the response information to the first application process to establish the preset protocol connection between the first application process and a target application process on the server device that listens to the first port.

[0053] In the above 101, the server device may provide multiple ports, and different ports provide different network services. The first port is one of the multiple ports. The first port refers to the port that the first application process needs to access or the port corresponding to the network service that the first application process needs to access.

[0054] The preset protocol connection refers to a connection established based on a preset protocol; the preset protocol is different from the communication protocol supported by the operating system of the client device and the operating system of the server device, for example, TCP. It can be understood that the preset protocol is a communication protocol that the operating system of the client device and the operating system of the server device cannot support. In one example, the preset protocol refers to RDMA; the preset protocol connection refers to an RDMA connection.

[0055] The first connection establishment information refers to information required to establish a preset protocol connection. Taking RDMA connection as an example, the first connection establishment information generally includes: QP (Queue Pair) information of the first application process.

[0056] The first application process sends the first connection request initiated by it to the first proxy process through the communication connection between it and the first proxy process. In one example, the communication connection between the first application process and the first proxy process on the client device can be established based on a communication protocol supported by the operating system of the client device.

[0057] In the above 102, a proxy communication connection is established between the first proxy process and the second proxy process on the server device. The proxy communication connection can be established based on a communication protocol supported by the operating system of the client device. In one example, the proxy communication connection can be a TCP connection.

[0058] The first proxy process sends the first connection establishment request to the second proxy process through the proxy communication connection.

[0059] In the above 103, in one example, the above response information may be generated by the target application process. Specifically, after receiving the above first connection request, the second proxy process sends the first connection request to the target application process, and the target application process generates a response message carrying the second connection information required to establish the preset protocol connection for the first connection request and sends the response message to the second proxy process; the second proxy process sends the response message via the proxy communication connection, that is, sends the response message to the first proxy process via the proxy communication connection.

[0060] In the above 104, the first proxy process sends the response information to the first application process to establish the preset protocol connection between the first application process and the target application process. In this way, the first application process and the target application process can communicate through the preset protocol connection. The second connection establishment information refers to the information required to establish the preset protocol connection. Taking the RDMA connection as an example, the second connection establishment information includes: QP information of the second application process.

[0061] The connection method used in the embodiment of the present application can be called an out-of-band (OOB) connection method, which requires exchanging connection information in an "out-of-band" manner, and then completing the preset protocol connection through the connection information, such as the establishment of RDMA. "Out-of-band" here refers to the information exchange method that is not provided by the preset protocol, such as RDMA itself, and requires developers to complete the exchange of information required for connection through other methods.

[0062] In the technical solution provided by the embodiment of the present application, proxy processes are introduced on the client device and the server device respectively; when the application process on the client device needs to establish a preset protocol connection with the application process on the server device, such as an RDMA connection, the application process on the client device sends a connection request through the proxy communication connection between the two proxy processes; after receiving the connection request, the proxy process on the server device returns a response message carrying the second connection information required to establish the preset protocol connection through the proxy communication connection, thereby establishing a preset protocol connection between the application process on the client device and the application process on the server device. It can be seen that this solution allows the application to achieve the purpose of communication based on the preset protocol without modifying the operating system kernel.

[0063] Figure 2 The flowchart of the communication method provided by the embodiment of the present application is shown. The execution subject of the method may be the first proxy process running on the client device in the above communication system; the client device also runs a first application process. Figure 2 As shown, the method comprises:

[0064] 201. Obtain a first connection establishment request initiated by the first application process.

[0065] The first connection establishment request carries the port number of the first port of the server device and the first connection establishment information required to establish a preset protocol connection.

[0066] 202. Send the first connection establishment request to the second proxy process through the proxy communication connection between the first proxy process and the second proxy process on the server device.

[0067] 203. Receive response information through the proxy communication connection.

[0068] Among them, the response information carries the second connection information required to establish the preset protocol connection; the response information is generated by the target application process; the target application process is a process among multiple second application processes that obtains the first connection request after the second proxy process distributes the first connection request to the multiple second application processes; the multiple second application processes run on the server device and listen to the first port together.

[0069] 204. Send the response information to the first application process to establish the preset protocol connection between the first application process and the target application process.

[0070] The second proxy process distributes the first connection establishment request to a plurality of second application processes on the server device that monitor the first port according to the port number of the first port.

[0071] In the above 201, the server device may provide multiple ports, and different ports provide different network services. The first port is one of the multiple ports. The first port refers to the port that the first application process needs to access or the port corresponding to the network service that the first application process needs to access.

[0072] The preset protocol connection refers to a connection established based on a preset protocol; the preset protocol is different from the communication protocol supported by the operating system of the client device and the operating system of the server device, for example, TCP. It can be understood that the preset protocol is a communication protocol that the operating system of the client device and the operating system of the server device cannot support. In one example, the preset protocol refers to RDMA; the preset protocol connection refers to an RDMA connection.

[0073] The first connection establishment information refers to information required to establish a preset protocol connection. Taking RDMA connection as an example, the first connection establishment information generally includes: QP (Queue Pair) information of the first application process.

[0074] The first application process sends the first connection request initiated by it to the first proxy process through the communication connection between it and the first proxy process. In one example, the communication connection between the first application process and the first proxy process on the client device can be established based on a communication protocol supported by the operating system of the client device.

[0075] In the above 202, a proxy communication connection is established between the first proxy process and the second proxy process on the server device. The proxy communication connection can be established based on a communication protocol supported by the operating system of the client device. In one example, the proxy communication connection can be a TCP connection.

[0076] The first proxy process sends the first connection request to the second proxy process through the proxy communication connection. After receiving the first connection request, the second proxy process distributes the first connection request to multiple second application processes listening to the first port on the server device according to the port number of the first port carried in the first connection request. After distribution, only one application process among the multiple second application processes can obtain the first connection request. The target application process that obtains the first connection request among the multiple second application processes generates a response message, wherein the response message carries the second connection information required to establish the preset protocol connection. The target application process can send the response message to the second proxy process; the second proxy process sends the response message through the proxy communication connection.

[0077] In the above 203, the first agent process receives the response information through the agent communication connection.

[0078] In the above 204, the first proxy process sends the response information to the first application process to establish the preset protocol connection between the first application process and the target application process. In this way, the first application process and the target application process can communicate through the preset protocol connection. The second connection establishment information refers to the information required to establish the preset protocol connection. Taking the RDMA connection as an example, the second connection establishment information includes: QP information of the second application process.

[0079] The connection method used in the embodiment of the present application can be called an out-of-band (OOB) connection method, which requires exchanging connection information in an "out-of-band" manner, and then completing the preset protocol connection through the connection information, such as the establishment of RDMA. "Out-of-band" here refers to the information exchange method that is not provided by the preset protocol, such as RDMA itself, and requires developers to complete the exchange of information required for connection through other methods.

[0080] In the technical solution provided by the embodiment of the present application, proxy processes are introduced on the client device and the server device respectively; when the application process on the client device needs to establish a preset protocol connection with the application process on the server device, such as an RDMA connection, the application process on the client device sends a connection request through the proxy communication connection between the two proxy processes; after the proxy process on the server device receives the connection request, it distributes the connection request to multiple application processes listening to the first port according to the port number of the first port of the server device carried in the connection request; the application process on the server device that obtains the connection request is also the target application process that needs to establish a preset protocol connection with the application process on the client device. It can be seen that this solution realizes the ability of multiple processes listening to the same port to improve the system concurrency on the basis of communicating with a preset protocol connection, such as an RDMA connection.

[0081] In actual applications, many applications are not written based on RDMA. In order to enable these applications to communicate using RDMA, a user-mode link library can be added to the application, such as a user-mode dynamic link library (DLL). Specifically, the first application process can run a first application and a first user-mode link library for implementing the RDMA communication function; the first connection information is added to the first connection request by the first user-mode link library in user mode. The first application loads the first user-mode link library when it is running, and then obtains the first application process. Specifically, the first user-mode link library intercepts the first connection request issued by the first application, and the first connection request carries the network address of the server device and the port number of the first port of the server device. After adding the first connection information to the first connection request, the first user-mode link library sends it to the first proxy process.

[0082] In addition, a second application and a second user-state link library for implementing the RDMA communication function may be running in the target application process; the second connection information is added to the response information by the second user-state link library in the user state. Among them, the second user-state link library may be a user-state dynamic link library. When the second application is running, the second user-state link library is loaded to obtain the second application process. Among them, the content of the first user-state link library and the content of the second user-state link library may be the same. Specifically, after the second user-state link library receives the first connection request sent by the second proxy process, it obtains the first connection information from the first connection request; the second user-state link library records the first connection information to facilitate the subsequent establishment of the RDMA connection; after the second user-state link library deletes the first connection information carried in the first connection request, it sends the first connection request to the second application. The second application generates corresponding response information for the first connection establishment request; the second user-state link library intercepts the response information; after the second user-state link library adds the second connection establishment information to the response information in user mode, the response information is sent to the second agent process, so that the second agent process sends it to the first agent process through the above-mentioned agent communication connection, and the first agent process sends it to the first application process; the first user-state link library in the first application process obtains the second connection establishment information from the response information and records it to facilitate the subsequent establishment of the RDMA connection, and after the first user-state link library deletes the second connection establishment information in the response information, the response information is sent to the first application.

[0083] In one example, the first user-mode link library and the second user-mode link library can be referred to as user-mode network acceleration libraries, which are loaded and used by preloading (LD_PRELOAD) without modifying the application code. The user-mode network acceleration library utilizes the advantages of eRDMA such as low latency, high throughput, kernel bypass, and protocol stack unloading, and achieves acceleration effects on existing TCP applications through compatible socket interfaces.

[0084] It should be noted that after the RDMA connection is established between the target application process and the first application process, the first user state link library and the second user state link library are used to assist the second application in the target application process and the first application in the first application process to implement RDMA communication.

[0085] In this embodiment, there is no need to modify the application program and the kernel, and only an additional user-mode link library needs to be introduced to enable the application program to implement RDMA communication in the user mode.

[0086] In one example, the first connection establishment request may also carry the network address of the server device. The above method may also include:

[0087] 205. According to the network address of the server device, search for a proxy communication connection between the first proxy process and a second proxy process on the server device from existing proxy communication connections of the first proxy process.

[0088] In the above 205, each existing proxy communication connection of the first proxy process is uniquely identified by a local network address, a local port number, a remote network address, and a remote port number. Among them, the local network address refers to the IP address of the client device, and the local port number refers to the port number of the proxy port listened by the first proxy process; the remote network address refers to the IP address of the network device where the proxy process at the other end of the existing proxy communication connection is located, and the remote port number refers to the port number of the proxy port listened by the proxy process at the other end of the existing proxy communication connection. Note: The local network address and local port number are used to identify the local proxy process; the remote network address and remote port number are used to uniquely identify the remote proxy process.

[0089] Therefore, in one example, an existing proxy communication connection whose remote network address is the network address of the server device can be searched from at least one existing proxy communication connection of the first proxy process. Therefore, the existing proxy communication connection whose remote network address is the network address of the server device is the proxy communication connection between the first proxy process and the second proxy process on the server device. In this embodiment, the proxy communication connection between the first proxy process and the second proxy process can be reused after being established, which can improve the efficiency of establishing a preset protocol connection.

[0090] If a proxy communication connection between the first proxy process and the second proxy process on the server device is found from the existing proxy communication connections of the first proxy process, the first connection establishment request may be sent through the proxy communication connection.

[0091] If no proxy communication connection between the first proxy process and the second proxy process on the server device is found from the existing proxy communication connections of the first proxy process, the following steps are performed:

[0092] 206. Establish a proxy communication connection between the first proxy process and the second proxy process according to the network address of the server device and the port number of the proxy port monitored by the second proxy process on the server device.

[0093] In one example, the port number of the proxy port listened by the proxy process on each device is defaulted to a designated port number. For example, the designated port number is 9000. In this way, the first proxy process on the client device can directly determine the port number of the proxy port listened by the second proxy process on the server device.

[0094] According to the network address of the server device and the port number of the proxy port monitored by the second proxy process, a proxy communication connection between the first proxy process and the second proxy process can be established.

[0095] In another example, the client device may have stored in advance a correspondence between a network address and a port number, and the correspondence may be searched based on the network address of the server device to determine the port number corresponding to the network address of the server device, and the port number corresponding to the network address of the server device may be determined as the port number of the proxy port listened to by the second proxy process.

[0096] After the proxy communication connection between the first proxy process and the second proxy process is established, the first connection establishment request is sent to the second proxy process through the proxy communication connection.

[0097] Another embodiment of the present application provides a communication method, which is applicable to a second proxy process running on a server device. The method includes:

[0098] A. receiving a first connection establishment request sent by a first proxy process on a client device through a proxy communication connection; the proxy communication connection is connected between the first proxy process and the second proxy process; the first connection establishment request carries the port number of the first port and first connection establishment information required for establishing a preset protocol connection;

[0099] B. Send a response message through the proxy communication connection to establish the preset protocol connection between the first application process and the target application process listening to the first port on the server device; the response message carries the second connection establishment information required to establish the preset protocol connection.

[0100] The specific implementation of the above steps A and B can be found in the corresponding contents of the above embodiments, which will not be repeated here.

[0101] In the technical solution provided by the embodiment of the present application, proxy processes are introduced on the client device and the server device respectively; when the application process on the client device needs to establish a preset protocol connection with the application process on the server device, such as an RDMA connection, the application process on the client device sends a connection request through the proxy communication connection between the two proxy processes; after receiving the connection request, the proxy process on the server device returns a response message carrying the second connection information required to establish the preset protocol connection through the proxy communication connection, thereby establishing a preset protocol connection between the application process on the client device and the application process on the server device. It can be seen that this solution allows the application to achieve the purpose of communication based on the preset protocol without modifying the operating system kernel.

[0102] It should be noted here that: for the contents of each step not fully described in detail in the method provided in the embodiment of the present application, please refer to the corresponding contents in the above embodiment, which will not be repeated here. In addition, in addition to the above steps, the method provided in the embodiment of the present application may also include other parts or all of the steps in the above embodiments, which can be specifically referred to the corresponding contents in the above embodiments, which will not be repeated here.

[0103] Figure 3 The flow chart of the communication method provided by the embodiment of the present application is shown. The method is applicable to the second proxy process running on the server device. The server device also runs multiple second application processes; the ports on the server device and the multiple second application processes jointly monitor the first port on the server device. Figure 3 As shown, the method comprises:

[0104] 301. Receive a first connection establishment request sent by a first proxy process on a client device through a proxy communication connection.

[0105] The proxy communication connection is connected between the first proxy process and the second proxy process; the first connection establishment request carries the port number of the first port and the first connection establishment information required to establish a preset protocol connection.

[0106] 302. Distribute the first connection establishment request to the multiple second application processes.

[0107] 303. Send response information through the proxy communication connection to establish the preset protocol connection between the first application process and the target application process.

[0108] The response information carries the second connection establishment information required to establish the preset protocol connection; the response information is generated by the target application process; the target application process is the process that obtains the first connection establishment request among the multiple second application processes.

[0109] The specific implementation of the above steps 301 and 302 can refer to the corresponding content in the above embodiments, which will not be repeated here. In the technical solution provided by the embodiment of the present application, proxy processes are introduced on the client device and the server device respectively; when the application process on the client device needs to establish a preset protocol connection with the application process on the server device, such as an RDMA connection, the application process on the client device sends a connection request through the proxy communication connection between the two proxy processes; after the proxy process on the server device receives the connection request, it distributes the connection request to multiple application processes listening to the first port according to the port number of the first port of the server device carried in the connection request; the application process on the server device that obtains the connection request is also the target application process selected this time that needs to establish a preset protocol connection with the application process on the client device. It can be seen that this solution realizes the ability of multiple processes listening to the same port to improve the system concurrency on the basis of communicating with a preset protocol connection, such as an RDMA connection.

[0110] In one example, the preset protocol connection is an RDMA connection.

[0111] In one example, a second application program and a second user-mode link library for implementing the RDMA communication function are running in the target application process; the second connection establishment information is added to the response information by the second user-mode link library in the user mode.

[0112] In this embodiment, there is no need to modify the application and the kernel. You only need to introduce an additional user-mode link library to enable the application to implement RDMA communication in the user mode. In actual applications, for TCP applications, there are generally two ways for multiple processes to listen to the same port:

[0113] The first method: the parent process listens to the port, and then creates (forks) the child process, so that the parent and child processes can listen to the same port.

[0114] The second way: Set the port reusable attribute (SO_REUSEPORT) to a port through the socket setting (setsockopt) interface, which can also support multiple processes listening to the same port. Among them, the setsockopt interface is used to set option values ​​for network sockets.

[0115] Both of the above methods can monitor the same port, but the effects are slightly different:

[0116] In the first method, the parent and child processes essentially use the same receive queue for receiving new connection requests. When a new connection request arrives, the parent and child processes compete to create the corresponding TCP connection.

[0117] In the second method, any process can listen to the same port independently of the parent-child process relationship. The operating system kernel will create a receive queue for each process, and there is no competition between different processes.

[0118] In one example, if the multiple second application processes are in a parent-child process relationship, the step of “distributing the first connection establishment request to the multiple second application processes” in 302 above can be implemented by the following steps:

[0119] 3021a. Determine a parent process that monitors the first port according to the port number of the first port.

[0120] 3022a. Send the first connection establishment request through the communication connection between the second proxy process and the parent process.

[0121] The sub-processes in the plurality of second application processes inherit the communication connection; and the plurality of second application processes obtain the first connection establishment request sent through the communication connection in a competitive manner.

[0122] The above child process is created by the parent process. Before the child process is created, the above communication connection already exists. Therefore, the child process can inherit the above communication connection. This is equivalent to the second proxy process connecting the parent process and the child process at the same time through a TCP connection. Figure 4 shown.

[0123] After the second proxy process sends the first connection request through the communication connection between the second proxy process and the parent process, since the child process inherits the communication connection, both the parent process and the child process have the right to receive the first connection request, but the two need to compete to obtain the first connection request. If the parent process competes for the first connection request, the parent process is the above-mentioned target application process; if the child process competes for the second connection request, the child process is the above-mentioned target application process.

[0124] In an achievable solution, the above method may further include:

[0125] 303. Receive a second connection establishment request sent by the parent process.

[0126] 304. Establish a communication connection between the second proxy process and the parent process according to the second connection establishment request.

[0127] In the above 303, the parent process may send the second connection establishment request to the second agent process when the parent process is started or when the parent process detects that the communication connection between the parent process and the second agent process is disconnected.

[0128] In a specific example, when the parent process is started, it sends a second connection request to the second agent process to establish a communication connection between the parent process and the second agent process; and registers the port it needs to listen to with the second agent process through the communication connection.

[0129] In the above 304, the communication connection between the second proxy process and the parent process can be established based on the communication protocol supported by the operating system of the server device. In one example, the communication connection between the second proxy process and the parent process is a TCP connection.

[0130] The technical solution provided in this embodiment realizes that the parent and child processes jointly monitor the same port under RDMA communication. In another example, if the multiple second application processes are not in a parent-child process relationship, the "distributing the first connection establishment request to the multiple second application processes" in the above 302 can be implemented by the following steps:

[0131] 3021b. Determine the multiple second application processes that monitor the first port according to the port number of the first port.

[0132] 3022b. Select the target application process from the multiple second application processes.

[0133] 3023b. Send the first connection establishment request through the communication connection between the second proxy process and the target application process.

[0134] In the above 3022b, the target application process can be randomly selected from multiple second application processes, or the target application process can be selected from multiple second application processes according to a preset load balancing strategy. The above preset load balancing strategy can be set according to actual needs, and the embodiment of the present application does not specifically limit this.

[0135] The technical solution provided in this embodiment enables multiple application processes to jointly monitor the same reusable port under RDMA communication.

[0136] In order to improve the forwarding efficiency of the first connection establishment request, the communication connection between the second proxy process and the second application process may be established when the second application process is started.

[0137] Specifically, the above method may further include:

[0138] 305. Receive a third connection establishment request sent by the second application process.

[0139] 306. Establish a communication connection between the second proxy process and the second application process according to the third connection establishment request.

[0140] In the above 305, the second application process may send a third connection establishment request to the second proxy process when the second application process is started or when the second application process detects that the communication connection between the second application process and the second proxy process is disconnected.

[0141] In the above 306, the communication connection between the second agent process and the second application process can be selected according to actual needs. In one example, the communication connection between the second agent process and the second application process is a TCP connection.

[0142] In this embodiment, each of the plurality of second application processes is connected to the second proxy process via a different communication connection (eg, TCP connection). Figure 5 shown.

[0143] In this embodiment, the attribute of the first port is a port reusable attribute (SO_REUSEPORT).

[0144] In summary, by introducing the proxy process and taking advantage of the fact that the child process can inherit the resource characteristics of the parent process and the reusable properties of the port, the effect of RDMA multi-process listening to the same port, which is consistent with the TCP effect, is achieved in user mode without modifying the kernel.

[0145] It should be noted here that: for the contents of each step not fully described in detail in the method provided in the embodiment of the present application, please refer to the corresponding contents in the above embodiment, which will not be repeated here. In addition, in addition to the above steps, the method provided in the embodiment of the present application may also include other parts or all of the steps in the above embodiments, which can be specifically referred to the corresponding contents in the above embodiments, which will not be repeated here.

[0146] The following will be combined Figure 6 The signaling diagram shown introduces the communication method provided in the embodiment of the present application.

[0147] The first application process runs a first application and a first user-mode link library; the target application process runs a second application and a second user-mode link library.

[0148] Step 1: A first application initiates a first connection establishment request based on the TCP protocol.

[0149] The first connection establishment request carries the IP address of the server device and the port number of the first port of the server device.

[0150] Step 2: The first user-mode link library intercepts the first connection establishment request.

[0151] Step 3: The first user-mode link library adds the first RDMA connection establishment information in the first connection establishment request.

[0152] Step 4: The first user-mode link library sends a first connection establishment request to the first proxy process.

[0153] Step 5: The first proxy process sends a first connection establishment request to the second proxy process.

[0154] Among them, after the first proxy process receives the first connection establishment request, it determines the TCP connection between the first proxy process and the second proxy process based on the IP address of the server device carried in the first connection establishment request and the port number of the proxy port listened by the second proxy process on the server device, and sends the first connection establishment request to the second proxy process through the TCP connection.

[0155] Step 6: The second proxy process distributes the first connection establishment request to multiple second application processes that monitor the first port.

[0156] For the specific distribution process, please refer to the corresponding content in the above embodiments.

[0157] Step 7: After the target application process obtains the first connection establishment request, the second user-mode link library in the target application process obtains and records the first RDMA information from the first connection establishment request.

[0158] Step 8: After deleting the first RDMA information in the first connection establishment request, the second user-mode link library sends the first connection establishment request to the second application process.

[0159] Step 9: The second application process processes the first connection establishment request to generate response information.

[0160] Step 10: The second user-mode link library intercepts the response information.

[0161] Step 11: After the second user-mode link library adds the second RDMA information to the response information, it sends the response information to the second proxy process.

[0162] Step 12: The second agent process sends a response message to the first agent process.

[0163] Step 13: The first proxy process sends a response message to the first application process.

[0164] Step 14: The first user-mode link library in the first application process obtains and records the second RDMA information from the response information.

[0165] Step 15: After deleting the second RDMA information in the response information, the first user-mode link library sends the response information to the first application.

[0166] Step 16: The first user-mode link library requests the second user-mode link library to establish an RDMA connection between the first application process and the target application process.

[0167] Subsequently, with the assistance of the first user-mode link library and the second user-mode link library, the first application program communicates with the second application program via an RDMA connection.

[0168] Figure 7 FIG. 1 is a schematic diagram showing the structure of an electronic device provided by an embodiment of the present application. Figure 7 As shown, the electronic device includes a memory 1101 and a processor 1102. The memory 1101 can be configured to store various other data to support operations on the electronic device. Examples of these data include instructions for any application or method for operating on the electronic device. The memory 1101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read only memory (EEPROM), an erasable programmable read only memory (EPROM), a programmable read only memory (PROM), a read only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.

[0169] The memory 1101 is used to store programs;

[0170] The processor 1102 is coupled to the memory 1101 and is used to execute the program stored in the memory 1101 to implement the communication method provided by the above-mentioned method embodiments.

[0171] Further, if Figure 7 As shown, the electronic device also includes: a communication component 1103, a display 1104, a power component 1105, an audio component 1106 and other components. Figure 7 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 7 Components shown.

[0172] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the steps or functions of the communication method provided by the above-mentioned method embodiments can be implemented.

[0173] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0174] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM (Read Only Memory) / RAM (Random Access Memory), a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A communication method, characterized in that: applied to a first agent process; the first agent process runs on a client device; a first application process also runs on the client device; Obtaining a first connection establishment request initiated by the first application process; the first connection establishment request carries the port number of the first port of the server device and first connection establishment information required to establish a preset protocol connection; Sending the first connection establishment request to the second proxy process through a proxy communication connection between the first proxy process and the second proxy process on the server device; Receiving a response message through the proxy communication connection; wherein the response message carries the second connection establishment information required to establish the preset protocol connection; The response information is sent to the first application process to establish the preset protocol connection between the first application process and a target application process on the server device that listens to the first port.

2. The method according to claim 1, characterized in that: The response information is generated by the target application process; the target application process is a process among multiple second application processes that obtains the first connection request after the second proxy process distributes the first connection request to the multiple second application processes; the multiple second application processes run on the server device and listen to the first port together.

3. The method according to claim 1 or 2, characterized in that: The preset protocol connection is an RDMA connection.

4. The method according to claim 3, characterized in that: The first application process runs a first application program and a first user-mode link library for implementing an RDMA communication function; the first connection establishment information is added by the first user-mode link library to the first connection establishment request in user mode.

5. The method according to claim 1 or 2, characterized in that: The first connection establishment request also carries the network address of the server device; the method further includes: According to the network address of the server device, a proxy communication connection between the first proxy process and a second proxy process on the server device is searched from the existing proxy communication connections of the first proxy process.

6. The method according to claim 5, characterized in that Also includes: If the proxy communication connection between the first proxy process and the second proxy process on the server device is not found from the existing proxy communication connections of the first proxy process, a proxy communication connection is established between the first proxy process and the second proxy process based on the network address of the server device and the port number of the proxy port listened by the second proxy process on the server device.

7. A communication method, characterized in that: Applied to a second proxy process; the second proxy process runs on a server device; Receiving a first connection establishment request sent by a first proxy process on a client device through a proxy communication connection; the proxy communication connection is connected between the first proxy process and the second proxy process; the first connection establishment request carries the port number of the first port and first connection establishment information required to establish a preset protocol connection; A response message is sent through the proxy communication connection to establish the preset protocol connection between the first application process and the target application process listening to the first port on the server device; the response message carries second connection establishment information required to establish the preset protocol connection.

8. The method according to claim 7, characterized in that A plurality of second application processes are running on the server device; the plurality of second application processes jointly monitor the first port on the server device; The method further comprises: Distributing the first connection establishment request to the plurality of second application processes according to the port number of the first port; The response information is generated by the target application process; the target application process is a process among the multiple second application processes that obtains the first connection request after the second proxy process distributes the first connection request to the multiple second application processes.

9. The method according to claim 8, characterized in that The multiple second application processes are in a parent-child process relationship; Distributing the first connection establishment request to the plurality of second application processes according to the port number of the first port includes: Determine, according to the port number of the first port, a parent process that monitors the first port; Sending the first connection establishment request through the communication connection between the second proxy process and the parent process; The sub-processes in the plurality of second application processes inherit the communication connection; and the plurality of second application processes obtain the first connection establishment request sent through the communication connection in a competitive manner.

10. The method according to claim 8, characterized in that The multiple second application processes are not in a parent-child process relationship; Distributing the first connection establishment request to the plurality of second application processes according to the port number of the first port includes: Determining the plurality of second application processes that monitor the first port according to the port number of the first port; Selecting the target application process from the plurality of second application processes; The first connection establishment request is sent through the communication connection between the second proxy process and the target application process.

11. The method according to any one of claims 7 to 10, characterized in that: The preset protocol connection is an RDMA connection.

12. The method according to claim 11, characterized in that A second application program and a second user-mode link library for implementing the RDMA communication function are running in the target application process; the second connection establishment information is added to the response information by the second user-mode link library in the user mode.

13. A communication system, characterized in that: include: A client device and a server device; a first proxy process and a first application process are running on the client device; The server device runs a second proxy process and a target application process that monitors the first port; The first proxy process is used to obtain a first connection request initiated by the first application process; the first connection request carries the port number of the first port and the first connection information required to establish a preset protocol connection; the first connection request is sent to the second proxy process through the proxy communication connection between the first proxy process and the second proxy process on the server device; The second proxy process is used to receive the first connection establishment request sent through the proxy communication connection; send a response message through the proxy communication connection; wherein the response message carries the second connection establishment information required to establish the preset protocol connection; The first proxy process is further configured to receive the response information through the proxy communication connection; and send the response information to the first application process to establish the preset protocol connection between the first application process and the target application process.

14. An electronic device, characterized in that: include: A memory and a processor, wherein The memory is used to store programs; The processor is coupled to the memory, and is configured to execute the program stored in the memory to implement the communication method according to any one of claims 1 to 12.

15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the communication method according to any one of claims 1 to 12 can be implemented.

Citation Information

Cited By

  • Communication method and device, communication equipment, storage medium and program product

    CN121151449A