RDMA-based reverse proxy method and data transmission method at the reverse proxy end.
By building interface libraries and QP queues on the client, reverse proxy, and server sides, and utilizing private connection and load balancing strategies, the data transmission bottleneck caused by limited RDMA network card resources is solved, achieving efficient and reliable data transmission, suitable for large-scale connection scenarios.
Patent Information
- Application Number
- CN202410928588.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-07-11
AI Technical Summary
In existing technologies, RDMA network cards have limited Queue Pair resources, making it impossible to allocate an independent Queue Pair for each network connection. This leads to bottlenecks when reverse proxies handle large-scale connections, affecting data transmission efficiency and performance. In particular, the insufficient number of QPs in optical gate secure host communication scenarios cannot meet the needs of high concurrency and large-volume data transmission.
By building interface libraries on the client, reverse proxy, and server sides respectively, and establishing a first QP queue between the client and the reverse proxy and a second QP queue between the reverse proxy and the server, resource allocation and data transmission paths are optimized using private connection and load balancing strategies, reducing dependence on RDMA hardware resources and achieving fast and efficient data transmission.
It effectively solves the bottleneck problem of connection count, improves the performance and scalability of reverse proxy, reduces development and maintenance costs, meets the needs of rapid transmission of large amounts of data, and improves network communication efficiency and reliability.
Smart Images

Figure CN118803044B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of network communication technology, and in particular to a reverse proxy method based on RDMA and a data transmission method for the reverse proxy end. Background Technology
[0002] In existing technologies, reverse proxy architectures utilize RDMA technology to improve network communication efficiency. However, in practical applications, reverse proxy software needs to be re-adapted to the RDMA interface, resulting in a significant development workload and making rapid adaptation difficult. More importantly, due to the limited Queue Pair (QP) resources of RDMA network cards, it is impossible to allocate an independent Queue Pair for each network connection, limiting the reverse proxy's ability to handle large-scale connections. In other words, when the number of connections exceeds the capacity of the QP resources, the reverse proxy will experience a bottleneck in connection count.
[0003] As the number of concurrent connections increases, the performance of RDMA will decrease. This is because the RNIC (RDMA Network Interface Card) must maintain the state related to the connection. When there are too many concurrent connections, the onboard memory of the RNIC will be exhausted, causing it to frequently retrieve the connection state from the host memory via the PCIe bus, which affects performance.
[0004] Especially in communication scenarios between optical gate security hosts, the number of QPs supported by the RDMA IP core of the FPGA chip is usually more than 100, which is far from enough to meet the actual needs, causing a bottleneck in the number of connections and seriously affecting data processing and transmission efficiency. Summary of the Invention
[0005] In view of this, the present disclosure provides an RDMA-based reverse proxy method and a data transmission method for the reverse proxy end, which can solve the problems in the prior art such as data transmission bottlenecks caused by the limited memory of RDMA network cards, low data transmission efficiency, small data processing volume, and inability to meet the needs of high-concurrency scenarios or large-volume data transmission.
[0006] In a first aspect, embodiments of this disclosure provide a reverse proxy method based on RDMA, specifically including the following scheme:
[0007] Establish the first QP queue between the client and the reverse proxy, and establish the second QP queue between the reverse proxy and the server;
[0008] Build the first interface library, the reverse proxy interface library, and the second interface library on the client, the reverse proxy, and the server, respectively;
[0009] The first private connection between the reverse proxy and the client is constructed based on the first connection establishment request received from the client by the reverse proxy interface library.
[0010] In response to the first private connection, the reverse proxy sends a second connection establishment request to the server;
[0011] Based on the second connection establishment request, a second private connection is established between the reverse proxy and the server;
[0012] Data is sent to the reverse proxy end through the first interface library, the first private connection, and the first QP queue.
[0013] The application data is obtained by reading the data through the reverse proxy interface library and the first private connection;
[0014] The application data is sent to the server through the second interface library, the second private connection, and the second QP queue.
[0015] Optionally, the construction of the first interface library, the reverse proxy interface library, and the second interface library on the reverse proxy end, the client, and the server respectively includes: constructing the reverse proxy interface library, the first interface library, and the second interface library on the client, the reverse proxy end, and the server respectively based on the libibverbs library and the librdmacm library;
[0016] The reverse proxy interface library includes a first listening interface, a first binding interface, a first accept connection interface, a first request connection interface, a first send interface, a first receive interface, a first close interface, and a first timed check interface;
[0017] The first interface library includes a second listening interface, a second binding interface, a second accept connection interface, a second request connection interface, a second send interface, a second receive interface, a second close interface, and a second timed check interface;
[0018] The second interface library includes a third listening interface, a third binding interface, a third accept connection interface, a third request connection interface, a third send interface, a third receive interface, a third close interface, and a third timed check interface.
[0019] Optionally, sending data to the reverse proxy end through the first interface library, the first private connection, and the first QP queue includes:
[0020] The second sending interface is invoked to encapsulate the first private connection and the data into a first private protocol data packet;
[0021] Write the first private protocol data packet into the first QP queue;
[0022] The first receiving interface is invoked to read the first private protocol data packet from the first QP queue.
[0023] Optionally, sending the application data to the server via the second interface library, the second private connection, and the second QP queue includes:
[0024] The first private protocol data packet is parsed through the first receiving interface to obtain the first private connection and data;
[0025] The second private connection is obtained based on the first private connection;
[0026] The first sending interface is invoked to encapsulate the second private connection and the data into a second private protocol data packet;
[0027] Write the second private protocol data packet into the second QP queue;
[0028] The third receiving interface is invoked to read the second private protocol data packet from the second QP queue.
[0029] Optionally, the first QP queue contains N downstream QP queues;
[0030] The second QP queue contains M upstream QP queues;
[0031] If N downstream QP queues are queues between a single downstream application in the client and a single worker process in the reverse proxy, and M upstream QP queues are queues between a single worker process in the reverse proxy and a single upstream application in the server, then M = N, and each upstream QP queue is uniquely associated with each downstream QP queue.
[0032] Optionally, the RDMA-based reverse proxy method further includes: if N downstream QP queues are queues between E downstream applications in the client and F worker processes in the reverse proxy, and M upstream QP queues are queues between F worker processes in the reverse proxy and G upstream applications in the server, M≠N, N≥2, M≥2, then a connection between the client and the reverse proxy is established based on a load balancing strategy, and a connection between the reverse proxy and the server is established based on a load balancing strategy.
[0033] The load balancing strategy includes: based on a preset QP matching strategy, distributing N downstream QP queues evenly to F worker processes according to E downstream applications, and distributing M upstream QP queues evenly to F worker processes according to G upstream applications, wherein the number of queues between each downstream application and each worker process is not less than 1, and the number of queues between each upstream application and each worker process is not less than 1.
[0034] Optionally, establishing the connection between the client and the reverse proxy based on the load balancing strategy includes:
[0035] The first interface library is invoked to send a first connection establishment request. The downstream QP queue corresponding to the downstream application is determined based on the average connection number strategy and recorded as the first downstream channel.
[0036] Based on the load balancing strategy, a working process associated with the first downstream channel is determined and denoted as the first process;
[0037] A first private connection is established between the downstream application and the first process through the first downstream channel and the first connection establishment request.
[0038] Optionally, establishing the connection between the reverse proxy and the server based on the load balancing strategy includes:
[0039] The first private protocol data packet is read from the first downstream channel through the first receiving interface and the first private connection.
[0040] The first process parses the first private protocol data packet to obtain the target IP and target port, as well as the IP hash value and port hash value;
[0041] Based on the IP hash value and the port hash value, the listening hash table is searched to obtain the associated upstream QP queue and upstream application, which are respectively recorded as the first upstream channel and the target application;
[0042] The first sending interface in the reverse proxy interface library is invoked to establish a second private connection with the target application through the first upstream channel.
[0043] Optionally, the RDMA-based reverse proxy method further includes: establishing multiple QP linked lists for data with the same destination IP and destination port, each QP linked list including several downstream QP queues and several upstream QP queues;
[0044] Based on the average connection count strategy or the weighted average count strategy, determine multiple QP queues for the upstream or downstream;
[0045] Based on the load balancing strategy, multiple QP queues are used for data transmission distribution.
[0046] Optionally, the RDMA-based reverse proxy method further includes configuring blocking management policies on the client, reverse proxy, and server respectively.
[0047] The blocking management strategy dynamically controls the data reception or data transmission of the client, the reverse proxy, and the server.
[0048] Congestion management strategies include:
[0049] Get the remaining buffer capacity of the receiver;
[0050] Obtain the target data volume that the sender will continuously send in each batch;
[0051] If it is determined whether the target data volume exceeds a preset percentage of the remaining cache capacity, and if so, the sender is triggered to generate a response data packet and send it to the sender.
[0052] In response to the response data packet, the amount of data sent in the next batch is dynamically adjusted;
[0053] The callback function based on the connection write event triggers the sender to start sending the next batch of data;
[0054] If the target data volume does not exceed a preset percentage of the remaining cache capacity, the sender is triggered to continue sending the next batch according to a preset sending strategy.
[0055] Optionally, the dynamic adjustment of the next batch of data transmission includes: adjusting the next batch of data transmission by the sender to 25% of the remaining buffer capacity.
[0056] Optionally, the RDMA-based reverse proxy method further includes: if the number of times the sender is dynamically adjusted exceeds one, then the percentage of the corresponding batch is decreased successively during dynamic adjustment.
[0057] Optionally, the RDMA-based reverse proxy method further includes: establishing a buffer space at the receiver, wherein the buffer space is a space to accommodate Z maximum data packets, Z≥2; the remaining buffer capacity does not include the capacity of the buffer space;
[0058] When the remaining buffer capacity is less than one maximum data packet, an emergency response data packet is generated;
[0059] Send the emergency response data packet to the sender;
[0060] The emergency response data packet includes a data volume Y, where Y = Z-1, that the sender is allowed to send in the next batch.
[0061] Optionally, the RDMA-based reverse proxy method further includes: triggering a transmission timeout management strategy when the remaining buffer capacity is zero;
[0062] The timeout management strategy includes: dynamically acquiring timeout connection information based on a time wheel;
[0063] A timeout notification is sent to the application corresponding to the timeout connection information via a callback function and the timeout connection information.
[0064] In response to the timeout notification, the preset fault tolerance handling strategy in the corresponding application is invoked.
[0065] Optionally, the RDMA-based reverse proxy method further includes: sending data to the reverse proxy end through the second interface library, the second private connection, and the second QP queue;
[0066] Data is read through the reverse proxy interface library and the second private connection;
[0067] The data is processed, and the processed data is sent to the client through the reverse proxy interface library, the first private connection, and the first QP queue;
[0068] Data is read through the first interface library, the first private connection, and the first QP queue.
[0069] Secondly, this disclosure provides a data transmission method for a reverse proxy, specifically including the following scheme:
[0070] Establish a first QP queue and a second QP queue with the client and server respectively;
[0071] Build a reverse proxy interface library;
[0072] Based on the aforementioned reverse proxy interface library, the first connection establishment request from the client is received;
[0073] A first private connection is constructed based on the first connection establishment request;
[0074] In response to the first private connection, a second connection establishment request is sent to the server;
[0075] A second private connection is constructed based on the second connection establishment request;
[0076] Receive data from the client through the first QP queue;
[0077] The application data is obtained by reading the data through the reverse proxy interface library and the first private connection;
[0078] The application data is processed, and the processed application data is sent to the server through the reverse proxy interface library, the second private connection, and the second QP queue.
[0079] Optionally, the construction of the reverse proxy interface library includes: constructing the reverse proxy interface library based on the libibverbs library and the librdmacm library;
[0080] The reverse proxy interface library includes a first listening interface, a first binding interface, a first accept connection interface, a first request connection interface, a first sending interface, a first receiving interface, a first closing interface, and a first timed check interface.
[0081] Optionally, receiving the first connection establishment request from the client based on the reverse proxy interface library includes: receiving the first connection establishment request from the client based on the first listening interface;
[0082] The step of reading the data through the reverse proxy interface library and the first private connection includes: reading the data through the first receiving interface and the first private connection;
[0083] The step of sending the processed application data to the server through the reverse proxy interface library, the second private connection, and the second QP queue includes: sending the processed application data to the server through the first sending interface, the second private connection, and the second QP queue.
[0084] Thirdly, this disclosure provides a data transmission method for a client, specifically including the following scheme:
[0085] Establish the first QP queue with the reverse proxy;
[0086] Build the first interface library;
[0087] Send the first connection establishment request to the reverse proxy.
[0088] In response to the reverse proxy's reply, a first private connection is established;
[0089] Data is sent to the reverse proxy end via the first interface library, the first private connection, and the first QP queue; and / or,
[0090] Data is received from the reverse proxy through the first interface library, the first private connection, and the first QP queue.
[0091] Optionally, the construction of the first interface library includes: constructing the first interface library based on the libibverbs library and the librdmacm library;
[0092] The first interface library includes a second listening interface, a second binding interface, a second accept connection interface, a second request connection interface, a second send interface, a second receive interface, a second close interface, and a second timed check interface.
[0093] Optionally, sending data to the reverse proxy end through the first interface library, the first private connection, and the first QP queue includes: sending data to the reverse proxy end through the second sending interface, the first private connection, and the first QP queue;
[0094] Receiving data from the reverse proxy through the first interface library, the first private connection, and the first QP queue includes: receiving data from the reverse proxy through the second receiving interface, the first private connection, and the first QP queue to obtain application data.
[0095] Fourthly, this disclosure provides a server-side data transmission method, specifically including the following scheme:
[0096] Establish a second QP queue with the reverse proxy;
[0097] Build a second interface library;
[0098] In response to the second connection establishment request sent by the reverse proxy, a second private connection is established;
[0099] Receive data sent by the reverse proxy through the second interface library, the second private connection, and the second QP queue; and / or,
[0100] Data is sent to the reverse proxy through the second interface library, the second private connection, and the second QP queue.
[0101] Optionally, the construction of the second interface library includes: constructing the second interface library based on the libibverbs library and the librdmacm library;
[0102] The second interface library includes a third listening interface, a third binding interface, a third accept connection interface, a third request connection interface, a third send interface, a third receive interface, a third close interface, and a third timed check interface.
[0103] Optionally, responding to the second connection establishment request sent by the reverse proxy includes: receiving the second connection establishment request sent by the reverse proxy through the second QP queue;
[0104] Receiving data sent by the reverse proxy through the second interface library, the second private connection, and the second QP queue includes: receiving data sent by the reverse proxy through the third receiving interface, the second private connection, and the second QP queue;
[0105] Sending data to the reverse proxy through the second interface library, the second private connection, and the second QP queue includes sending data to the reverse proxy through the third sending interface, the second private connection, and the second QP queue.
[0106] Fifthly, this disclosure provides a reverse proxy system, specifically including: a client, a reverse proxy terminal, and a server, wherein a first QP queue is established between the client and the reverse proxy terminal, and a second QP queue is established between the reverse proxy terminal and the server.
[0107] The client, the reverse proxy, and the server each have a first interface library, a reverse proxy interface library, and a second interface library, respectively.
[0108] A first private connection is established between the reverse proxy and the client.
[0109] The reverse proxy and the server establish a second private connection associated with the first private connection.
[0110] Sixthly, embodiments of this disclosure also provide a computer device, the computer device comprising:
[0111] At least one processor; and,
[0112] A memory communicatively connected to the at least one processor; wherein,
[0113] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to execute the RDMA-based reverse proxy method, the data transmission method of the reverse proxy end, the data transmission method of the client, or the data transmission method of the server.
[0114] In a seventh aspect, embodiments of this disclosure also provide a computer-readable storage medium storing computer instructions for causing a computer to execute the RDMA-based reverse proxy method, the data transmission method of the reverse proxy end, the data transmission method of the client, or the data transmission method of the server.
[0115] Eighthly, this disclosure also provides a computer program product, including computer instructions that, when executed by a processor, implement the steps of the RDMA-based reverse proxy method, the data transmission method of the reverse proxy end, the data transmission method of the client, or the data transmission method of the server.
[0116] The RDMA-based reverse proxy method disclosed in this application provides an adaptation interface library for the reverse proxy architecture. Specifically, it constructs a first interface library, a reverse proxy interface library, and a second interface library on the client, reverse proxy, and server sides, respectively, providing adaptation interfaces to meet different needs, effectively reducing the adaptation workload. By establishing a first QP queue between the client and the reverse proxy, and a second QP queue between the reverse proxy and the server, and by establishing a first private connection between the client and the reverse proxy in response to a first connection establishment request sent by the client, and triggering the establishment of a second private connection between the reverse proxy and the server based on the first private connection, it realizes a one-to-one association between the connections between the reverse proxy and the server, which can transform the network connection for data transmission in the prior art into interface calls between different interface libraries. That is, by managing the interfaces and QP queues, data forwarding between the client and the server can be realized, achieving fast and efficient adaptation, effectively reducing computer computing resources, improving network communication efficiency, and effectively reducing dependence on RDMA hardware card QP resources, meeting the needs of rapid transmission of large amounts of data.
[0117] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0118] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0119] Figure 1 This is a flowchart illustrating the RDMA-based reverse proxy method provided in an embodiment of this disclosure.
[0120] Figure 2 This is a schematic flowchart illustrating a data transmission method from a client to a reverse proxy provided in an embodiment of this disclosure.
[0121] Figure 3 This is a flowchart illustrating a method for forwarding data from a reverse proxy to a server, as provided in an embodiment of this disclosure.
[0122] Figure 4 This is a flowchart illustrating a method for establishing a connection between a client and a reverse proxy based on a load balancing strategy, as provided in an embodiment of this disclosure.
[0123] Figure 5 This is a flowchart illustrating a method for establishing a connection between a reverse proxy and a server based on a load balancing strategy, as provided in an embodiment of this disclosure.
[0124] Figure 6 This is a flowchart illustrating the execution method of the blocking management strategy provided in this embodiment of the disclosure.
[0125] Figure 7 This is a flowchart illustrating the data transmission method for a reverse proxy provided in an embodiment of this disclosure.
[0126] Figure 8 This is a schematic flowchart illustrating the data transmission method for a client provided in an embodiment of this disclosure.
[0127] Figure 9 This is a flowchart illustrating the data transmission method for the server provided in an embodiment of this disclosure.
[0128] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. Detailed Implementation
[0129] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0130] It should be understood that the following specific examples illustrate the implementation of this disclosure, and those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0131] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0132] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0133] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.
[0134] Reference Figure 1 The first aspect of this application discloses a reverse proxy method based on RDMA, which includes the following steps:
[0135] S100 establishes the first QP queue between the client and the reverse proxy, and the second QP queue between the reverse proxy and the server.
[0136] Specifically, a first QP queue is established between the client and the reverse proxy, and a second QP queue is established between the reverse proxy and the server.
[0137] S200 builds a first interface library, a reverse proxy interface library, and a second interface library on the client, reverse proxy, and server sides, respectively.
[0138] Specifically, the first interface library, the reverse proxy interface library, and the second interface library are built based on the libibverbs library and the librdmacm library, respectively. Asynchronous communication and synchronous communication modes can be provided in the corresponding interface libraries, and single-threaded safety is supported.
[0139] The reverse proxy uses an asynchronous communication mode, while the client and server can use either asynchronous or synchronous communication modes.
[0140] The reverse proxy interface library includes a first listening interface, a first binding interface, a first accept connection interface, a first request connection interface, a first send interface, a first receive interface, a first close interface, and a first timed check interface.
[0141] The first interface library includes a second listening interface, a second binding interface, a second accept connection interface, a second request connection interface, a second send interface, a second receive interface, a second close interface, and a second timed check interface.
[0142] The second interface library includes a third listening interface, a third binding interface, a third accept connection interface, a third request connection interface, and a third sending interface.
[0143] The interface includes a third receiving interface, a third closing interface, and a third timed check interface.
[0144] In this embodiment, the interfaces in the reverse proxy interface library, the first interface library, and the second interface library can all implement corresponding listening functions, binding functions, connection acceptance functions, connection request functions, sending functions, receiving functions, closing functions, and timed check functions, and are Socket-like interfaces.
[0145] The S300 receives the first connection establishment request from the client based on the reverse proxy interface library.
[0146] S400, construct the first private connection based on the first connection establishment request.
[0147] Specifically, a first private connection is established between the client and the reverse proxy based on the first connection establishment request.
[0148] S500, in response to the first private connection, sends a second connection establishment request to the server.
[0149] S600, constructs a second private connection based on the second connection establishment request.
[0150] Specifically, a second private connection is established between the server and the reverse proxy based on the second connection establishment request.
[0151] The S700 sends data to the reverse proxy end through the first interface library, the first private connection, and the first QP queue.
[0152] The S800 reads application data through the reverse proxy interface library and the first private connection.
[0153] The S900 sends application data to the server through the second interface library, the second private connection, and the second QP queue.
[0154] The RDMA-based reverse proxy method disclosed in this application provides an adaptation interface library for the reverse proxy architecture. Specifically, it constructs a first interface library, a reverse proxy interface library, and a second interface library on the client, reverse proxy, and server sides, respectively, providing adaptation interfaces to meet different needs, effectively reducing the adaptation workload. By establishing a first QP queue between the client and the reverse proxy, and a second QP queue between the reverse proxy and the server, and by establishing a first private connection between the client and the reverse proxy in response to a first connection establishment request sent by the client, and triggering the establishment of a second private connection between the reverse proxy and the server based on the first private connection, it realizes a one-to-one association between the connections between the reverse proxy and the server, which can transform the network connection for data transmission in the prior art into interface calls between different interface libraries. That is, by managing the interfaces and QP queues, data forwarding between the client and the server can be realized, achieving fast and efficient adaptation, effectively reducing computer computing resources, improving network communication efficiency, and effectively reducing dependence on RDMA hardware card QP resources, meeting the needs of rapid transmission of large amounts of data.
[0155] The RDMA-based reverse proxy method disclosed in this application does not require allocating a QP resource for each network connection, thus significantly increasing the number of connections that the reverse proxy can handle and effectively solving the connection bottleneck problem in the prior art. By using private connections, the workload of adapting the reverse proxy software to the RDMA software interface can be effectively reduced, simplifying the development and maintenance process. Through reasonable allocation of QP resources, the resources of the RDMA hardware can be utilized more effectively, improving overall network performance. This solution is suitable for hardware environments such as FPGA chips with limited QP resources, effectively improving the adaptability and flexibility of the solution.
[0156] This RDMA-based reverse proxy method can improve the performance and scalability of the reverse proxy without increasing RDMA hardware resources, while reducing development and maintenance costs. It is suitable for scenarios that need to handle a large number of network connections.
[0157] It should be noted that the RDMA-based reverse proxy method disclosed in this application also includes connection establishment and data transmission from the server to the client; specifically, it includes: sending data to the reverse proxy end through the second interface library, the second private connection, and the second QP queue; reading data through the reverse proxy interface library and the second private connection; processing the data and sending the processed data to the client through the reverse proxy interface library, the first private connection, and the first QP queue; and reading data through the first interface library, the first private connection, and the first QP queue.
[0158] Reference Figure 2The data transmission method from the client to the reverse proxy end specifically includes sending data to the reverse proxy end through the first interface library, the first private connection, and the first QP queue:
[0159] S710 calls the second sending interface to encapsulate the first private connection and data into a first private protocol data packet.
[0160] Specifically, the second sending interface is called, that is, a sending interface function is called. This function receives the private connection object and the data to be sent as parameters; using the private protocol header structure, the data and necessary control information (such as sequence number, check code, etc.) are encapsulated into a data packet.
[0161] In this step, encapsulation can determine the standardization of data packets, making them easier to manage and identify. By using private protocol data packets, better compatibility and scalability can be provided across different network environments and protocol stacks.
[0162] S720 writes the first private protocol data packet into the first QP queue.
[0163] Specifically, the API provided by the RDMA library (such as libibverbs) can be used to write the encapsulated private protocol data packets into the QP queue (i.e., the first QP queue) corresponding to the communication between the client and the reverse proxy, thereby reducing the number of data copies during the transmission process and reducing latency. By managing the transmission operation through the QP queue, the hardware capabilities of the RDMA network card can be effectively utilized to improve data transmission efficiency.
[0164] S730 calls the first receiving interface to read the first private protocol data packet from the first QP queue.
[0165] Specifically, the first receiving interface is called, that is, a receiving interface function is called to read the first private protocol data packet from the first QP queue, and then pass it to the reverse proxy end. By calling the interface, the correct processing and transmission of data packets are effectively guaranteed, and the reliability of data transmission is improved.
[0166] Furthermore, the APIs provided by the RDMA library can be used to listen to and poll the completion queue in order to obtain data packets from the sender in a timely manner.
[0167] The data transmission method from the client to the reverse proxy disclosed in this embodiment has better scalability through the encapsulation of private protocols and the management of private connections, and can adapt to different network environments and communication needs. Through the management of private connections and QP queues, the resources of the RDMA network card are utilized more effectively, avoiding the problem of limited connection numbers due to limited QP resources.
[0168] Reference Figure 3The method of sending application data to the server through the second interface library, the second private connection, and the second QP queue, that is, forwarding data to the server through the reverse proxy, specifically includes:
[0169] S910 parses the first private protocol data packet through the first receiving interface to obtain the first private connection and data.
[0170] Specifically, the first receiving interface is used to extract the arriving data packets (i.e., the first private protocol data packets) from the first QP queue by calling a receiving interface function; the extracted first private protocol data packets are parsed, and relevant information and data of the first private connection are extracted according to the private protocol specification to ensure the accuracy of data transmission.
[0171] S920 obtains a second private connection based on the first private connection.
[0172] Specifically, establishing a private connection between the reverse proxy and the server based on the parsed information ensures the relevance of private connections between upstream and downstream, which helps optimize resource utilization and reduce the overhead of frequently establishing and disconnecting connections.
[0173] S930 calls the first sending interface to encapsulate the second private connection and data into a second private protocol data packet.
[0174] Specifically, a send interface function is called to encapsulate the second private connection and data into a second private protocol data packet, which is fast and efficient.
[0175] S940 writes the second private protocol data packet into the second QP queue.
[0176] Specifically, the API provided by the RDMA library can be used to write the encapsulated second private protocol data packet into the second QP queue corresponding to the communication between the reverse proxy end and the server end.
[0177] S950 calls the third receiving interface to read the second private protocol data packet from the second QP queue.
[0178] Specifically, a receive interface function is called to extract data packets from the second QP queue and pass them to the server application.
[0179] The method disclosed in this embodiment improves the data transmission efficiency from client to server by performing fast receiving, parsing, and forwarding operations at the reverse proxy end; it reduces data transmission and processing latency by utilizing the zero-copy and kernel bypass features of RDMA; the encapsulation of private protocols and the management of private connections provide flexibility and scalability to adapt to different network environments and communication needs; by maintaining the private connection state, it reduces the overhead of connection establishment and termination, and improves the connection reuse rate; and by effectively managing QP queues and private connections, it optimizes the utilization of RDMA network card resources and improves the reverse proxy's ability to handle large-scale connections.
[0180] In summary, this solution, by combining RDMA technology and proprietary protocol design, aims to improve the efficiency, flexibility, scalability, and reliability of network communication, while also addressing the problem of limited QP resources in existing technologies.
[0181] Furthermore, the first QP queue contains N downstream QP queues;
[0182] The second QP queue contains M upstream QP queues;
[0183] If N downstream QP queues are queues between a single downstream application in the client and a single worker process in the reverse proxy, and M upstream QP queues are queues between a single worker process in the reverse proxy and a single upstream application in the server, then M = N, and each upstream QP queue is uniquely associated with each downstream QP queue.
[0184] In this scheme, each upstream QP queue is uniquely associated with each downstream QP queue, ensuring a direct correspondence (i.e., one-to-one mapping) between each single downstream application on the client and each single upstream application on the server. This simplifies the data forwarding process, and the one-to-one relationship helps to achieve load balancing and avoid overloading of a single process. The direct association between each upstream QP queue and the downstream QP queue simplifies the management of connections on the reverse proxy side, because each worker process only needs to manage the QP queue directly connected to it.
[0185] Since each QP queue has its own corresponding processing process, the need for inter-process communication can be reduced, thereby reducing additional communication overhead and improving the efficiency of data processing and forwarding. When it is necessary to increase the processing capacity of the client or server, it can be achieved simply by adding QP queues and corresponding worker processes without making large-scale changes to the existing architecture.
[0186] Furthermore, the one-to-one association allows the reverse proxy to allocate and utilize its resources more efficiently. For example, resource allocation can be dynamically adjusted based on the load of each worker process. The independence of each QP queue means that the failure of one queue will not affect other queues, thereby improving the reliability of the entire system. The one-to-one mapping relationship makes monitoring and debugging easier because the performance of each worker process and its corresponding QP queue can be observed and analyzed independently. Each worker process can independently perform flow control and congestion management, thereby optimizing data transmission performance under poor network conditions.
[0187] In summary, the design that ensures a unique association between each upstream QP queue and each downstream QP queue provides high efficiency for the reverse proxy architecture.
[0188] It offers high reliability and good scalability, while also simplifying the management and debugging process.
[0189] Furthermore, the RDMA-based reverse proxy method disclosed in this application also includes: if N downstream QP queues are queues between E downstream applications in the client and F worker processes in the reverse proxy, and M upstream QP queues are queues between F worker processes in the reverse proxy and G upstream applications in the server, M≠N, N≥2, M≥2, then a connection between the client and the reverse proxy is established based on a load balancing strategy, and a connection between the reverse proxy and the server is established based on a load balancing strategy.
[0190] The load balancing strategy includes: based on a preset QP matching strategy, N downstream QP queues are evenly distributed to F worker processes according to E downstream applications, and M upstream QP queues are evenly distributed to F worker processes according to G upstream applications, with the number of queues between each downstream application and each worker process not less than 1, and the number of queues between each upstream application and each worker process not less than 1.
[0191] Reference Figure 4 The specific methods for establishing a connection between the client and the reverse proxy based on a load balancing strategy include:
[0192] A100 calls the first interface library to send the first connection establishment request, determines the downstream QP queue corresponding to the downstream application based on the average connection number strategy, and records it as the first downstream channel.
[0193] A200 determines the working process associated with the first downstream channel based on the load balancing strategy and records it as the first process.
[0194] The average connection count strategy can ensure that connections are evenly distributed across QP queues, avoiding overload of certain queues. In other words, it can intelligently allocate connections to different QP queues, thereby improving the overall throughput and responsiveness of the system.
[0195] A300 establishes a first private connection between the downstream application and the first process through the first downstream channel and the first connection establishment request.
[0196] Once the downstream QP queue and associated worker processes are identified, this information is used to establish the actual connection. On the reverse proxy side, the first process should be ready to receive data from the downstream application and process it accordingly. A more customized and optimized communication path can be provided through a private connection.
[0197] The method disclosed in this embodiment ensures that connection requests are processed efficiently, reducing waiting time and potential bottlenecks. As the system load increases, more QP queues and worker processes can be dynamically added to handle new connections. By intelligently selecting downstream QP queues, system resources are allocated more rationally. Overload of certain parts is avoided, reducing the risk of system crashes. The load balancing strategy can be adjusted according to actual needs to adapt to different traffic patterns and system conditions.
[0198] Automated load balancing simplifies system management and monitoring, while fast and consistent connection establishment responses improve the end-user experience.
[0199] In summary, the connection establishment method based on load balancing strategy improves the efficiency, stability, and scalability of the reverse proxy by intelligently allocating connections to different processing units, while also optimizing the connection experience for the client.
[0200] Reference Figure 5 The specific methods for establishing a connection between the reverse proxy and the server based on a load balancing strategy include:
[0201] B100 reads the first private protocol data packet from the first downstream channel through the first receiving interface and the first private connection;
[0202] B200 parses the first private protocol data packet through the first process to obtain the target IP and target port, as well as the IP hash value and port hash value;
[0203] B300 searches the listening hash table based on the IP hash value and port hash value to obtain the associated upstream QP queue and upstream application, and records them as the first upstream channel and the target application, respectively.
[0204] B400 calls the first sending interface in the reverse proxy interface library to establish a second private connection with the target application through the first upstream channel.
[0205] In this embodiment, the IP hash value and port hash value are calculated based on the parsed information. By looking up the listening hash table, the corresponding upstream QP queue and application can be quickly located, which facilitates the establishment of a connection. That is, the hash-based load balancing strategy provides a flexible connection allocation method that can adapt to different network conditions and traffic patterns. The stability and security of data transmission are ensured through private connections.
[0206] As system load increases, more QP queues and applications can be dynamically added to handle new connections; automated load balancing and standardized interface libraries simplify system management and maintenance; fast and consistent connection establishment responses enhance the end-user experience.
[0207] In summary, the method of establishing a connection between the reverse proxy and the server based on a load balancing strategy improves the system's efficiency, stability, and scalability by intelligently allocating connections and optimizing packet processing.
[0208] Furthermore, the RDMA-based reverse proxy method disclosed in this application also includes: establishing multiple QP linked lists for data with the same destination IP and destination port, each QP linked list including several downstream QP queues and several upstream QP queues;
[0209] Based on the average connection count strategy or the weighted average count strategy, determine multiple QP queues for the upstream or downstream;
[0210] Based on a load balancing strategy, multiple QP queues are used for data transmission distribution.
[0211] The RDMA-based reverse proxy method disclosed in this application further includes configuring blocking management policies on the client, reverse proxy end, and server respectively.
[0212] The blocking management strategy dynamically controls the data reception or transmission of the client, reverse proxy, and server.
[0213] In the RDMA-based reverse proxy method disclosed in this application, the introduction of a congestion management strategy can dynamically control the reception or transmission of data between the client, reverse proxy, and server. It can dynamically adjust the data flow based on network conditions and system load, avoiding network congestion and system overload. By intelligently pausing or resuming data transmission, it can respond more quickly to different network conditions and user needs. Dynamically controlling data transmission can rationally allocate bandwidth and processing capacity based on current resource usage, improving resource utilization. When network conditions are poor, appropriately blocking data transmission can reduce data loss due to network packet loss. By controlling the data flow, it can prevent system crashes or service interruptions caused by sudden increases in data volume. Rational control of data transmission ensures that users receive stable and timely service responses under different conditions.
[0214] Furthermore, the congestion management strategy can also set priorities for different types of data packets to ensure that high-priority data is transmitted quickly; when a network or server failure occurs, the data flow can be quickly adjusted to bypass the failure point and ensure service continuity; by reducing unnecessary data transmission wait times, user waiting time can be reduced and service response speed can be improved.
[0215] Dynamic control can avoid unnecessary queuing and delays in the network, improving overall data transmission efficiency; it can flexibly adjust blocking strategies based on real-time monitoring data and predictive models to adapt to different usage scenarios and changing needs; the implementation of blocking management strategies is usually accompanied by detailed monitoring and logging, which facilitates system administrators in diagnosing problems and optimizing performance.
[0216] By configuring blocking management policies on the client, reverse proxy, and server sides, a more intelligent, efficient, and stable network communication system can be built, thereby improving the overall system reliability and user satisfaction while ensuring service quality.
[0217] Reference Figure 6 The specific methods for implementing the blocking management strategy include:
[0218] C100, retrieve the remaining buffer capacity of the receiver;
[0219] C200, obtains the target data volume that the sender will continuously send in each batch;
[0220] C300 determines whether the target data volume exceeds a preset percentage of the remaining cache capacity. If so, it triggers the sender to generate an acknowledgment data packet and sends it to the sender.
[0221] C400 responds to acknowledgment data packets and dynamically adjusts the amount of data to be sent in the next batch.
[0222] C500, based on the callback function of the connection write event, triggers the sender to start sending the next batch of data;
[0223] If the target data volume does not exceed a preset percentage of the remaining cache capacity, the sender is triggered to continue sending the next batch according to the preset sending strategy.
[0224] In this embodiment, by obtaining the receiver's remaining buffer capacity, it can be ensured that the sending operation will not exceed the receiver's processing capacity, avoiding data loss or overflow, and allowing the sender to adjust the data sending strategy according to the real-time receiver status. By obtaining the target data volume for each batch of continuous sending by the sender, the sender can control the data sending volume according to the predetermined target, optimize the use of network bandwidth, help achieve smooth data transmission, and reduce the impact on the network. By using a preset percentage threshold, dynamic control of the sending volume can be achieved, preventing receiver buffer overload, providing the sender with clear sending limits, and simplifying the sending decision-making process.
[0225] The response data packet provides real-time feedback on the receiver's status, enabling the sender to adjust its transmission strategy in a timely manner. This enhances the communication coordination between the two parties and improves the efficiency and reliability of the entire communication process. By dynamically adjusting the transmission volume based on the receiver's actual feedback, the system's adaptability and flexibility are improved, and transmission interruptions or delays caused by network fluctuations or changes in the receiver's processing capabilities are reduced.
[0226] Callback functions provide a mechanism to ensure that data is sent at the appropriate time, avoiding blind data transmission, enhancing the sender's control over the data stream, and improving the timeliness and accuracy of data transmission. When the receiver's buffer capacity is sufficient, the sender is allowed to continue sending data according to the plan, maintaining the continuity of the data stream, simplifying the sender's operation, and reducing the overhead caused by frequent adjustments to the sending strategy.
[0227] In this embodiment, by dynamically adjusting the data transmission volume, the system maximizes the utilization of available network and cache resources, improves data transmission efficiency, avoids communication interruptions caused by buffer overflow or network congestion, enhances system stability, rationally allocates network bandwidth and cache resources, improves resource utilization efficiency, adapts to different network conditions and receiver status, flexibly adjusts data transmission strategies, reduces the risk of data loss due to network problems by controlling the transmission volume, ensures the continuity and timeliness of data transmission, improves the end-user service experience, and reduces the overall system load by avoiding unnecessary data retransmission and processing.
[0228] In summary, this congestion management strategy provides an efficient, stable, and adaptable data transmission solution for network communication through meticulous flow control and dynamic adjustment.
[0229] Among them, dynamically adjusting the next batch of data transmission includes: adjusting the sender's next batch of data transmission to 25% of the remaining buffer capacity.
[0230] Furthermore, the RDMA-based reverse proxy method disclosed in this application also includes: if the number of dynamic adjustments to the sender exceeds one, the percentage of the corresponding batch is reduced successively during dynamic adjustments.
[0231] By gradually decreasing the amount of data sent, the sender can be prevented from frequently sending data at full or near-full buffer capacity, reducing the pressure on the receiver's buffer and allowing the receiver to have more space between different batches, thus making more efficient use of buffer resources.
[0232] As the number of dynamic adjustments increases, the sender gradually adjusts its sending strategy to better adapt to the current network conditions and the receiver's processing capacity; by reducing the amount of data in each batch, it helps to avoid network congestion caused by sending a large amount of data at the same time.
[0233] Decreasing the amount of data sent helps to distribute the load more evenly, especially when communicating between multiple senders and receivers; by controlling the data flow of the sender, it reduces the risk of system crashes or service interruptions caused by sudden increases in data volume; by smoothing data transmission, it can provide a more stable user experience even under unstable network conditions; this strategy provides the sender with the flexibility to adjust the sending strategy according to specific circumstances to adapt to different application scenarios; compared to frequently sending control messages to adjust the amount of data sent, the incremental decreasing strategy reduces additional control overhead.
[0234] Through this gradually decreasing dynamic control strategy, the RDMA-based reverse proxy method can manage the data transmission process more precisely and effectively, improving the efficiency, stability, and user satisfaction of the entire communication system.
[0235] Furthermore, the RDMA-based reverse proxy method disclosed in this application also includes: establishing a buffer space at the receiver, the buffer space being a space to accommodate Z maximum data packets, where Z≥2; the remaining buffer capacity does not include the capacity of the buffer space;
[0236] When the remaining buffer capacity is less than one maximum data packet, an emergency response data packet is generated;
[0237] Send an emergency response data packet to the sender;
[0238] The emergency response data packet includes a data volume Y that the sender is allowed to send in the next batch, where Y = Z-1.
[0239] A cache space is established on the receiving end (e.g., the receiving end is a reverse proxy server). This space can hold a maximum of Z data packets, where Z≥2. This means that the reverse proxy server can cache multiple data packets from the sender (e.g., the sender is a client). When the remaining cache capacity is less than 1 maximum data packet, the reverse proxy server will generate an emergency response data packet, which will be sent back to the sender (which may be the client) as a response mechanism.
[0240] By configuring the content of the emergency response data packet, the sender can continue to send a small number of data packets in an emergency to maintain the connection or traffic until the cache is ready to receive new data.
[0241] In this embodiment, by caching data packets, the frequency of remote resource requests by the reverse proxy server can be reduced, thereby lowering latency and improving response speed. When the remaining cache capacity is insufficient, emergency response packets allow the sender to continue sending a limited amount of data to avoid connection interruption or data loss. By optimizing the data transmission process, the user experience can be improved, and waiting time and the risk of connection interruption can be reduced. In summary, this RDMA-based reverse proxy method aims to optimize data transmission efficiency and stability through cache management and emergency response mechanisms, thereby improving the overall system performance and user experience.
[0242] Furthermore, the RDMA-based reverse proxy method disclosed in this application also includes: triggering the transmission of YY+242197P when the remaining buffer capacity is zero.
[0243] Overtime management strategy;
[0244] Timeout management strategies include: dynamically acquiring timeout connection information based on a time wheel;
[0245] Send a timeout notification to the application corresponding to the timeout connection information via callback function and timeout connection information;
[0246] In response to a timeout notification, invoke the corresponding default fault tolerance strategy in the application.
[0247] When the cache capacity is zero, meaning there is no remaining space to cache new data packets, a timeout management policy is triggered. Using the acquired timeout connection information, the reverse proxy server sends a timeout notification to the corresponding application via a callback function. After receiving the timeout notification, the application calls a pre-set fault tolerance policy, which means that the application can prepare a predefined response for timeout situations, such as reconnecting, retrying, or taking other recovery measures.
[0248] By dynamically acquiring timeout connection information and adopting corresponding timeout management strategies, reverse proxy servers can effectively avoid server performance degradation or even crashes due to excessive cache congestion. Pre-defined fault tolerance strategies enable applications to react quickly when faced with connection problems, thereby improving system stability and fault tolerance. By properly managing timeout connections, reverse proxy servers can allocate resources more effectively, ensure the stability of critical connections, and reduce resource waste on inactive connections.
[0249] In summary, this timeout management strategy helps reverse proxy servers operate stably, optimizes the efficiency of network resource utilization, and provides a better error handling mechanism, thereby comprehensively improving system reliability and user experience.
[0250] The time wheel can be a scheduling algorithm used to dynamically view and process connections that have not responded for a long time, thereby obtaining detailed information about these timed-out connections in real time.
[0251] Secondly, referring to Figure 7 This application discloses a data transmission method for a reverse proxy, including:
[0252] S10, establish the first QP queue and the second QP queue with the client and the server respectively;
[0253] S20, Build the reverse proxy interface library;
[0254] S30, receives the first connection establishment request from the client based on the reverse proxy interface library;
[0255] S40, construct the first private connection based on the first connection establishment request;
[0256] S50, in response to the first private connection, sends a second connection establishment request to the server;
[0257] S60, construct a second private connection based on the second connection establishment request;
[0258] S70 receives data from the client through the first QP queue;
[0259] S80 reads data through the reverse proxy interface library and the first private connection to obtain application data;
[0260] S90 processes the application data and sends the processed application data to the server through the reverse proxy interface library, the second private connection, and the second QP queue.
[0261] The data transmission method disclosed in this application for a reverse proxy end includes: establishing a first QP queue and a second QP queue for data transmission and communication between the client and the server; creating an interface library for handling client requests and communication with the server to ensure effective data exchange and processing; receiving a first connection establishment request from the client through the reverse proxy interface library; establishing a first private connection based on the first connection establishment request for secure and efficient data transmission; sending a second connection establishment request to the server through the first private connection; establishing a second private connection based on the server's response for data transmission between the server and the reverse proxy end; receiving data from the client through the first QP queue; reading and obtaining application data through the reverse proxy interface library and the first private connection; processing the application data; and sending the processed data to the server through the reverse proxy interface library, the second private connection, and the second QP queue.
[0262] By establishing private connections and using queues, privacy and integrity can be protected during data transmission; by utilizing multi-queue and parallel connection establishment methods, data transmission speed and response time can be optimized; through the reverse proxy interface library, data from clients and servers can be flexibly processed to meet different application needs; and queue and connection resources can be effectively managed and allocated to improve the overall performance and stability of the system.
[0263] This approach, through carefully designed connection and interface management, aims to bring more efficient, secure, and reliable data transmission capabilities to reverse proxy systems, thereby improving user experience and system operating efficiency.
[0264] This includes building a reverse proxy interface library, which involves building a reverse proxy interface library based on the libibverbs and librdmacm libraries.
[0265] The reverse proxy interface library includes a first listening interface, a first binding interface, a first accept connection interface, a first request connection interface, a first send interface, a first receive interface, a first close interface, and a first timed check interface.
[0266] Among them, receiving the first connection establishment request from the client based on the reverse proxy interface library includes: receiving the first connection establishment request from the client based on the first listening interface;
[0267] Reading data through the reverse proxy interface library and the first private connection includes: reading data through the first receiving interface and the first private connection;
[0268] The processed application data is sent to the server through the reverse proxy interface library, the second private connection, and the second QP queue, including: sending the processed application data to the server through the first sending interface, the second private connection, and the second QP queue.
[0269] In this embodiment, the first listening interface in the reverse proxy interface library is responsible for receiving the first connection establishment request from the client. Once the first private connection is established, data can be transmitted through this connection. The first receiving interface in the reverse proxy interface library works in conjunction with the first private connection to read the data sent by the client from the connection.
[0270] After processing the received application data, the reverse proxy sends the data to the server through the first sending interface, the second private connection, and the second QP queue in the reverse proxy interface library. The first sending interface can ensure that the data can be transmitted to the server correctly.
[0271] In this embodiment, by dividing different functions (such as listening, receiving, and sending) into independent interfaces, the reverse proxy system achieves a high degree of modularity. This design makes the system easier to maintain and expand because each module can be updated and optimized independently. The modular design also means that the system can easily add new functions or adjust existing functions to meet ever-changing business needs. For example, new interfaces can be added to support more data transmission protocols or processing methods; processing data through dedicated receive and send interfaces ensures the efficiency and accuracy of data transmission, reducing data transmission latency and error rates, and improving the overall system performance; the use of private connections enhances data transmission security, while the modular design improves system reliability, as each module can perform independent error handling and recovery, thereby reducing the impact of system failures on the entire system.
[0272] Through a modular reverse proxy interface library design and the use of private connections for data transmission, this reverse proxy system achieves efficient, secure, flexible, and reliable data transmission capabilities. These features enable the system to cope with complex network environments and diverse business needs, providing users with a superior service experience.
[0273] YY+242197P
[0274] Thirdly, referring to Figure 8 This application discloses a client-side data transmission method, comprising:
[0275] K10 establishes the first QP queue with the reverse proxy;
[0276] K20, building the first interface library;
[0277] K30 sends the first connection establishment request to the reverse proxy.
[0278] K40 establishes the first private connection in response to the reverse proxy's reply;
[0279] K50 sends data to the reverse proxy end through the first interface library, the first private connection, and the first QP queue; and / or receives data from the reverse proxy end through the first interface library, the first private connection, and the first QP queue.
[0280] In this embodiment, the client first establishes a first QP queue with the reverse proxy for data transmission. Simultaneously, the client constructs a first interface library to handle communication with the reverse proxy. The client sends a first connection establishment request to the reverse proxy through the first interface library; this request establishes a secure data transmission channel. The reverse proxy responds and establishes a first private connection, ensuring secure and efficient data transmission between the client and the reverse proxy. The client sends data to the reverse proxy through the first interface library, the first private connection, and the first QP queue; this method guarantees the stability and immediacy of data transmission. The client can also receive data from the reverse proxy through the first interface library, the first private connection, and the first QP queue. This bidirectional transmission method can meet complex application requirements, such as real-time communication or data synchronization.
[0281] The client-side data transmission method disclosed in this embodiment, by establishing a dedicated queue and interface library, enables the client to quickly and reliably send data to or receive data from the reverse proxy. This method maximizes data transmission efficiency and throughput. The use of a first private connection ensures the confidentiality and integrity of data during transmission, preventing data leakage or tampering. The client can freely choose to send or receive data according to specific business needs, and performs flexible data processing and control through the first interface library. Efficient, secure, and reliable data transmission capabilities mean that client users can enjoy a smooth application experience, whether in real-time communication, multimedia transmission, or other data-intensive application scenarios.
[0282] In summary, this client-side data transmission method, by combining queues and interface libraries, provides an efficient, secure, and flexible data transmission solution suitable for various complex network environments and business needs, offering users and applications a superior data interaction experience.
[0283] Specifically, the first interface library is constructed, including: constructing the first interface library based on the libibverbs library and the librdmacm library;
[0284] The first interface library includes a second listening interface, a second binding interface, a second accept connection interface, a second request connection interface, a second send interface, a second receive interface, a second close interface, and a second timed check interface.
[0285] Sending data to the reverse proxy end through the first interface library, the first private connection, and the first QP queue includes: sending data to the reverse proxy end through the second sending interface, the first private connection, and the first QP queue;
[0286] The process involves receiving data from the reverse proxy through the first interface library, the first private connection, and the first QP queue, including receiving data from the reverse proxy through the second receiving interface, the first private connection, and the first QP queue to obtain application data.
[0287] Fourthly, refer to Figure 9 This application discloses a server-side data transmission method, including:
[0288] F10, establish a second QP queue with the reverse proxy;
[0289] YY+242197P
[0290] F20, build the second interface library;
[0291] F30, in response to the second connection establishment request sent by the reverse proxy, establishes a second private connection;
[0292] F40 receives data sent by the reverse proxy through the second interface library, the second private connection, and the second QP queue; and / or sends data to the reverse proxy through the second interface library, the second private connection, and the second QP queue.
[0293] In this embodiment, the server first establishes a second QP queue with the reverse proxy for data transmission. Simultaneously, the server constructs a second interface library to handle communication with the reverse proxy. The server responds to a second connection establishment request sent by the reverse proxy and establishes a second private connection, which is a secure data transmission channel, ensuring secure and reliable data transmission. The server can receive data from the reverse proxy through the second interface library, the second private connection, and the second QP queue, ensuring efficient and accurate data transmission. The server can also send data to the reverse proxy through the second interface library, the second private connection, and the second QP queue. This bidirectional transmission method enables the server to respond to and process requests from the reverse proxy, fulfilling data interaction needs in complex application scenarios.
[0294] The server-side data transmission method disclosed in this embodiment, by establishing a dedicated queue and interface library, enables the server to receive and send data quickly and reliably, maximizing the efficiency and response speed of data interaction. The use of a second private connection ensures the security and integrity of data during transmission, preventing data leakage or tampering. The server can flexibly receive and send data according to specific business needs, and implement data processing and control through the second interface library to meet the requirements of complex application scenarios. The efficient data transmission and processing capabilities mean that the server can provide stable and reliable services, offering users and applications a better experience and service guarantee.
[0295] This server-side data transmission method, by combining queues and interface libraries, provides an efficient, secure, and flexible data interaction solution suitable for a variety of complex application scenarios and business needs, offering important support and guarantees for system operating efficiency and user experience.
[0296] The construction of the second interface library includes: building the second interface library based on the libibverbs library and the librdmacm library;
[0297] The second interface library includes a third listening interface, a third binding interface, a third accept connection interface, a third request connection interface, a third send interface, a third receive interface, a third close interface, and a third timed check interface.
[0298] The response to the second connection establishment request sent by the reverse proxy includes: receiving the second connection establishment request sent by the reverse proxy through the second QP queue;
[0299] Receive data sent by the reverse proxy through the second interface library, the second private connection, and the second QP queue, including: receiving data sent by the reverse proxy through the third receiving interface, the second private connection, and the second QP queue;
[0300] Sending data to the reverse proxy through the second interface library, the second private connection, and the second QP queue includes: sending data to the reverse proxy through the third sending interface, the second private connection, and the second QP queue.
[0301] The libibverbs library is an open-source library that provides user-space access to InfiniBand (IB) and other RDMA (Remote Direct Memory Access) technologies. This library implements the APIs described in the InfiniBand architecture specification and the RDMA protocol verb specification, allowing applications to interact directly with RDMA hardware for efficient data transfer.
[0302] The librdmacm (RDMAConnection Manager library) is a library for managing RDMA connections. It provides a set of APIs to simplify the establishment, maintenance, and teardown of RDMA connections. librdmacm allows applications to discover and connect to remote nodes. (YY+242197P)
[0303] And establish an RDMA connection when needed.
[0304] The private protocol header involved in the network communication in this application stores IP, port, protocol type, data packet length, and opcode (connection request, data transmission, response, etc.). The overall data packet length conforms to the MTU requirements of the IB and ROCE protocols. It provides private protocol encapsulation and parsing interfaces for use by other functional modules. The source IP, destination IP, source port, destination port, and protocol type are called a quintuple.
[0305] The private protocol header is the beginning of the private protocol data packet and contains necessary control information to guide the transmission and processing of the data packet.
[0306] The stored information may include: IP address, which is used to uniquely identify a device in a network; port, which is the logical port number on the IP address used to distinguish different services; protocol type, which specifies whether the protocol used is TCP, UDP or other types; packet length, which is the total number of bytes in the packet to ensure that the receiver knows how much data to receive; and opcode, which indicates the type of operation request or response contained in the packet, such as requesting a connection, sending data or responding.
[0307] MTU (Maximum Transmission Unit) is the maximum data packet size transmitted at the network layer. Proprietary protocols must conform to the MTU requirements of InfiniBand (IB) or ROCE (RDMA over Converged Ethernet) protocols to ensure efficient data packet transmission in these network environments.
[0308] Private protocols provide specific interfaces for creating (encapsulating) and interpreting (parsing) data packets. The encapsulation interface packages application-layer data and control information into a format conforming to the protocol specification. The parsing interface extracts information from the received data packets.
[0309] The five parameters—source IP, destination IP, source port, destination port, and protocol type—are collectively called a 5-tuple. In a network, the 5-tuple is used to uniquely identify a network connection, similar to the caller's and receiver's numbers and the type of communication service used in a phone call.
[0310] The snooping management involved in this application specifically includes: establishing a snooping connection data structure to store information such as local IP address, port, and snooping connection ID. This information is stored as nodes in a snooping hash table and a snooping linked list, respectively. The application initiates snooping through the snooping and binding interface functions. When a client initiates a connection request, it searches for a snooping connection in the snooping hash table using the IP address and port as keys. If a connection exists, it calls the callback function registered on the snooping connection to notify the application to accept the connection, and establishes a connection structure and adds it to the connection hash table.
[0311] Specifically, suppose there is a network-based instant messaging application that needs to accept connection requests from multiple clients and establish a stable communication channel; 1) Establish a listening connection data structure: The application first establishes a listening connection data structure, including information such as the local IP address, port number, and listening connection ID. This information is stored in a listening hash table and a listening linked list for quick access and management; 2) Listening and binding interface functions: The application starts the listening process by calling listening and binding interface functions. These functions take the local IP address and port as parameters, create a listening socket, and begin listening for connection requests from clients; 3) Client initiates a connection request: When a client wants to... When connecting to the server, it sends a connection request, including the target server's IP address and port number; 4) Lookup in the listening hash table: After receiving the connection request, the server uses the target IP address and port number sent by the client as the key to look up the corresponding listening connection in the listening hash table. If a match is found, the server can process the connection request based on the information stored in the connection, such as the registered callback function; 5) Notify the application to accept the connection: Once a matching listening connection is found, the server calls the callback function registered on the connection to notify the application that the new connection request has been accepted. At this time, the server creates a connection structure for the connection and adds it to the connection hash table for management.
[0312] In this instant messaging application scenario, the listening management process is crucial. It ensures that the server can effectively accept and process connection requests from multiple clients, and can perform appropriate data transmission and communication management after a connection is established. By using hash tables and linked lists to store connection information, the application can efficiently manage a large number of connection requests and connection states, ensuring system stability and performance.
[0313] The advantage of this monitoring and management method is that it can effectively handle complex network environments and high-concurrency connection requests, while providing good scalability and flexibility, making it suitable for application scenarios that require long-term stable operation and efficient communication.
[0314] Fifthly, this application discloses a reverse proxy system, including: a client, a reverse proxy end, and a server, wherein a first QP queue is established between the client and the reverse proxy end, and a second QP queue is established between the reverse proxy end and the server.
[0315] The client, reverse proxy, and server each have their own first interface library, reverse proxy interface library, and second interface library.
[0316] A first private connection is established between the reverse proxy and the client;
[0317] A second private connection, associated with the first private connection, is established between the reverse proxy and the server.
[0318] The reverse proxy system disclosed in this application includes a client, a reverse proxy terminal, and a server. A first QP queue is established between the client and the reverse proxy terminal, and a second QP queue is established between the reverse proxy terminal and the server. Each component has its own first interface library, reverse proxy interface library, and second interface library to handle interfaces and functions for external interaction. A first private connection is established between the reverse proxy terminal and the client, and a second private connection between the reverse proxy terminal and the server is associated with the first private connection. This association may help manage and optimize data transmission and communication efficiency. By using multiple queues and private connections, the system can process data transmission between the client and the server in parallel, reducing waiting time and improving overall transmission speed. The use of private connections ensures that data transmitted between the client and the server is protected and provides isolation to prevent external interference or attacks. By managing the first and second queues separately, the system can effectively schedule and allocate resources to meet different connection and transmission requirements, improving the overall performance and stability of the system.
[0319] This reverse proxy system architecture utilizes queues and private connections to improve data transmission efficiency, enhance security, and optimize system resource usage, thereby providing a better experience and service assurance for users and applications.
[0320] It should be noted that the RDMA-based reverse proxy method, the data transmission method on the reverse proxy end, the data transmission method on the client end, the data transmission method on the server end, and the schemes that are identical or substantially identical in the reverse proxy system disclosed in this application are all applicable to each other. To avoid duplication, they will not be described in detail here.
[0321] A computer device according to an embodiment of this disclosure includes a memory and a processor. The memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc.
[0322] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory, causing the computer device to perform all or part of the steps of the RDMA-based reverse proxy method described in the foregoing embodiments of this disclosure, or the data transmission method of the reverse proxy end, or the data transmission method of the client, or the data transmission method of the server.
[0323] Those skilled in the art will understand that, in order to solve the technical problem of how to achieve a good user experience, this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included within the protection scope of this disclosure.
[0324] like Figure 10 This is a schematic diagram of a computer device provided for an embodiment of the present disclosure. It illustrates a structural schematic diagram suitable for implementing the computer device in the embodiments of the present disclosure. Figure 10 The computer device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0325] like Figure 10 As shown, a computer device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) or programs loaded from storage devices into random access memory (RAM). The RAM also stores various programs and data required for the operation of the computer device. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0326] Typically, the following devices can be connected to the I / O interface: input devices, such as sensors or visual information acquisition devices; output devices, such as displays; storage devices, such as magnetic tapes or hard drives; and communication devices. Communication devices allow the computer device to communicate wirelessly or wiredly with other devices (such as edge computing devices) to exchange data. Although Figure 10 A computer apparatus with various devices is shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or included alternatively.
[0327] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from ROM. When the computer program is executed by a processor, all or part of the steps of the RDMA-based reverse proxy method, the data transmission method of the reverse proxy end, the data transmission method of the client, or the data transmission method of the server described in embodiments of this disclosure are performed.
[0328] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.
[0329] A computer-readable storage medium according to embodiments of the present disclosure stores non-transitory computer-readable instructions. When these non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the RDMA-based reverse proxy method, the data transmission method of the reverse proxy end, the data transmission method of the client, or the data transmission method of the server described in the foregoing embodiments of the present disclosure are performed.
[0330] The aforementioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or portable hard drive), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).
[0331] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.
[0332] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0333] In this disclosure, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The block diagrams of devices, apparatuses, devices, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.
[0334] Additionally, as used herein, the “or” used in a list of items beginning with “at least one” indicates a separate list, such that a list of, for example, “at least one of A, B, or C” means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word “exemplary” does not imply that the described example is preferred or better than other examples.
[0335] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.
[0336] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.
[0337] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0338] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A reverse proxy method based on RDMA, characterized in that, include: Establish the first QP queue between the client and the reverse proxy, and establish the second QP queue between the reverse proxy and the server; Build the first interface library, the reverse proxy interface library, and the second interface library on the client, the reverse proxy, and the server, respectively; The first private connection between the reverse proxy and the client is constructed based on the first connection establishment request received from the client by the reverse proxy interface library. In response to the first private connection, the reverse proxy sends a second connection establishment request to the server; Based on the second connection establishment request, a second private connection is established between the reverse proxy and the server; Data is sent to the reverse proxy end through the first interface library, the first private connection, and the first QP queue. The application data is obtained by reading the data through the reverse proxy interface library and the first private connection; The application data is sent to the server through the second interface library, the second private connection, and the second QP queue.
2. The reverse proxy method based on RDMA according to claim 1, characterized in that, The construction of a first interface library, a reverse proxy interface library, and a second interface library on the reverse proxy end, client, and server respectively includes: constructing the reverse proxy interface library, the first interface library, and the second interface library on the client, reverse proxy end, and server respectively based on the libibverbs library and the librdmacm library. Interface library, second interface library; The reverse proxy interface library includes a first listening interface, a first binding interface, a first accept connection interface, a first request connection interface, a first send interface, a first receive interface, a first close interface, and a first timed check interface; The first interface library includes a second listening interface, a second binding interface, a second accept connection interface, a second request connection interface, a second send interface, a second receive interface, a second close interface, and a second timed check interface; The second interface library includes a third listening interface, a third binding interface, a third accept connection interface, a third request connection interface, a third send interface, a third receive interface, a third close interface, and a third timed check interface.
3. The reverse proxy method based on RDMA according to claim 2, characterized in that, Sending data to the reverse proxy end through the first interface library, the first private connection, and the first QP queue includes: The second sending interface is invoked to encapsulate the first private connection and the data into a first private protocol data packet; Write the first private protocol data packet into the first QP queue; The first receiving interface is invoked to read the first private protocol data packet from the first QP queue.
4. The reverse proxy method based on RDMA according to claim 3, characterized in that, Sending the application data to the server via the second interface library, the second private connection, and the second QP queue includes: The first private protocol data packet is parsed through the first receiving interface to obtain the P. First private connection and data; The second private connection is obtained based on the first private connection; The first sending interface is invoked to encapsulate the second private connection and the data into a second private protocol data packet; Write the second private protocol data packet into the second QP queue; The third receiving interface is invoked to read the second private protocol data packet from the second QP queue.
5. The RDMA-based reverse proxy method according to claim 4, characterized in that, The first QP queue contains N downstream QP queues; The second QP queue contains M upstream QP queues; If N downstream QP queues are queues between a single downstream application in the client and a single worker process in the reverse proxy, and M upstream QP queues are queues between a single worker process in the reverse proxy and a single upstream application in the server, then M = N, and each upstream QP queue is uniquely associated with each downstream QP queue.
6. The reverse proxy method based on RDMA according to claim 5, characterized in that, The RDMA-based reverse proxy method further includes: if N downstream QP queues are queues between E downstream applications in the client and F worker processes in the reverse proxy, and M upstream QP queues are queues between F worker processes in the reverse proxy and G upstream applications in the server, M≠N, N≥2, M≥2, then a connection between the client and the reverse proxy is established based on a load balancing strategy, and a connection between the reverse proxy and the server is established based on a load balancing strategy. The load balancing strategy includes: based on a preset QP matching strategy, distributing N downstream QP queues evenly to F worker processes according to E downstream applications, and distributing M upstream QP queues evenly to F worker processes according to G upstream applications, wherein the number of queues between each downstream application and each worker process is not less than 1, and the number of queues between each upstream application and each worker process is not less than 1.
7. The RDMA-based reverse proxy method according to claim 6, characterized in that, The process of establishing a connection between the client and the reverse proxy based on a load balancing strategy includes: The first interface library is invoked to send a first connection establishment request. The downstream QP queue corresponding to the downstream application is determined based on the average connection number strategy and recorded as the first downstream channel. Based on the load balancing strategy, a working process associated with the first downstream channel is determined and denoted as the first process; A first private connection is established between the downstream application and the first process through the first downstream channel and the first connection establishment request.
8. The reverse proxy method based on RDMA according to claim 7, characterized in that, The process of establishing a connection between the reverse proxy and the server based on a load balancing strategy includes: The first private protocol data packet is read from the first downstream channel through the first receiving interface and the first private connection. The first process parses the first private protocol data packet to obtain the target IP and target port, as well as the IP hash value and port hash value; Based on the IP hash value and the port hash value, the listening hash table is searched to obtain the associated upstream QP queue and upstream application, which are respectively recorded as the first upstream channel and the target application; The first sending interface in the reverse proxy interface library is invoked to establish a second private connection with the target application through the first upstream channel.
9. The RDMA-based reverse proxy method according to claim 6, characterized in that, The RDMA-based reverse proxy method further includes: establishing multiple QP linked lists for data with the same destination IP and destination port, each QP linked list including several downstream QP queues and several upstream QP queues; Based on the average connection count strategy or the weighted average count strategy, determine multiple QP queues for the upstream or downstream; Based on the load balancing strategy, multiple QP queues are used for data transmission distribution.
10. The reverse proxy method based on RDMA according to claim 1, characterized in that, The RDMA-based reverse proxy method further includes configuring blocking management policies on the client, reverse proxy, and server sides respectively. The blocking management strategy dynamically controls the data reception or data transmission of the client, the reverse proxy, and the server. Congestion management strategies include: Get the remaining cache capacity of the receiver; Obtain the target data volume that the sender will continuously send in each batch; If it is determined whether the target data volume exceeds a preset percentage of the remaining cache capacity, and if so, the sender is triggered to generate a response data packet and send it to the sender. In response to the response data packet, the amount of data sent in the next batch is dynamically adjusted; The callback function based on the connection write event triggers the sender to start sending the next batch of data; If the target data volume does not exceed a preset percentage of the remaining cache capacity, the sender is triggered to continue sending the next batch according to a preset sending strategy.
11. The RDMA-based reverse proxy method according to claim 10, characterized in that, The dynamic adjustment of the next batch of data transmission includes: adjusting the next batch of data transmission volume of the sender to 25% of the remaining buffer capacity.
12. The RDMA-based reverse proxy method according to claim 11, characterized in that, The RDMA-based reverse proxy method further includes: if the number of times the sender is dynamically adjusted exceeds one, the percentage of the corresponding batch is decreased successively during dynamic adjustment.
13. The RDMA-based reverse proxy method according to claim 12, characterized in that, The RDMA-based reverse proxy method further includes: establishing a buffer space at the receiver, wherein the buffer space is a space to accommodate Z maximum data packets, Z≥2; the remaining buffer capacity does not include the capacity of the buffer space; When the remaining buffer capacity is less than one maximum data packet, an emergency response data packet is generated; Send the emergency response data packet to the sender; The emergency response data packet includes a data volume Y, where Y = Z-1, that the sender is allowed to send in the next batch.
14. The RDMA-based reverse proxy method according to claim 13, characterized in that, The RDMA-based reverse proxy method further includes: triggering a transmission timeout management strategy when the remaining buffer capacity is zero; The timeout management strategy includes: dynamically acquiring timeout connection information based on a time wheel; A timeout notification is sent to the application corresponding to the timeout connection information via a callback function and the timeout connection information. In response to the timeout notification, the preset fault tolerance handling strategy in the corresponding application is invoked.
15. The RDMA-based reverse proxy method according to claim 1, characterized in that, The RDMA-based reverse proxy method further includes: sending data to the reverse proxy end through the second interface library, the second private connection, and the second QP queue; Data is read through the reverse proxy interface library and the second private connection; The data is processed, and the processed data is sent to the client through the reverse proxy interface library, the first private connection, and the first QP queue; Data is read through the first interface library, the first private connection, and the first QP queue.
16. A data transmission method for a reverse proxy, characterized in that, include: Establish a first QP queue and a second QP queue with the client and server respectively; Build a reverse proxy interface library; Based on the aforementioned reverse proxy interface library, the first connection establishment request from the client is received; Based on the first connection establishment request, a first private connection is established between the reverse proxy and the client; In response to the first private connection, a second connection establishment request is sent to the server; A second private connection is constructed based on the second connection establishment request; Receive data from the client through the first QP queue; The application data is obtained by reading the data through the reverse proxy interface library and the first private connection; The application data is processed, and the processed application data is sent to the server through the reverse proxy interface library, the second private connection, and the second QP queue.
17. The data transmission method for the reverse proxy end according to claim 16, characterized in that, The construction of the reverse proxy interface library includes: constructing the reverse proxy interface library based on the libibverbs library and the librdmacm library; The reverse proxy interface library includes a first listening interface, a first binding interface, a first accept connection interface, a first request connection interface, a first sending interface, a first receiving interface, a first closing interface, and a first timed check interface.
18. The data transmission method for the reverse proxy end according to claim 17, characterized in that, The step of receiving a first connection establishment request from a client based on the reverse proxy interface library includes: receiving a first connection establishment request from a client based on the first listening interface; The step of reading the data through the reverse proxy interface library and the first private connection includes: reading the data through the first receiving interface and the first private connection; The step of sending the processed application data to the server through the reverse proxy interface library, the second private connection, and the second QP queue includes: sending the processed application data to the server through the first sending interface, the second private connection, and the second QP queue.
19. A data transmission method for a client, characterized in that, include: Establish the first QP queue with the reverse proxy; Build the first interface library; Send the first connection establishment request to the reverse proxy. In response to the reverse proxy's reply, the first private connection between the reverse proxy and the client is established; Data is sent to the reverse proxy end through the first interface library, the first private connection, and the first QP queue. And / or, Data is received from the reverse proxy through the first interface library, the first private connection, and the first QP queue.
20. The data transmission method for a client according to claim 19, characterized in that, The construction of the first interface library includes: constructing the first interface library based on the libibverbs library and the librdmacm library; The first interface library includes a second listening interface, a second binding interface, a second accept connection interface, a second request connection interface, a second send interface, a second receive interface, a second close interface, and a second timed check interface.
21. The data transmission method for a client according to claim 20, characterized in that, Sending data to the reverse proxy end through the first interface library, the first private connection, and the first QP queue includes: sending data to the reverse proxy end through the second sending interface, the first private connection, and the first QP queue; The step of receiving data from the reverse proxy through the first interface library, the first private connection, and the first QP queue includes: receiving data from the reverse proxy through the second receiving interface, the first private connection, and the first QP queue, and obtaining... Application data.
22. A server-side data transmission method, characterized in that, include: Establish a second QP queue with the reverse proxy; Build a second interface library; In response to the second connection establishment request sent by the reverse proxy, a second private connection is established with the reverse proxy. Receive data sent by the reverse proxy through the second interface library, the second private connection, and the second QP queue; and / or, Data is sent to the reverse proxy through the second interface library, the second private connection, and the second QP queue.
23. The server-side data transmission method according to claim 22, characterized in that, The construction of the second interface library includes: constructing the second interface library based on the libibverbs library and the librdmacm library; The second interface library includes a third listening interface, a third binding interface, a third accept connection interface, a third request connection interface, a third send interface, a third receive interface, a third close interface, and a third timed check interface.
24. The server-side data transmission method according to claim 23, characterized in that, The response to the second connection establishment request sent by the reverse proxy includes: receiving the second connection establishment request sent by the reverse proxy through the second QP queue; Receiving data sent by the reverse proxy through the second interface library, the second private connection, and the second QP queue includes: receiving data sent by the reverse proxy through the third receiving interface, the second private connection, and the second QP queue; Sending data to the reverse proxy through the second interface library, the second private connection, and the second QP queue includes sending data to the reverse proxy through the third sending interface, the second private connection, and the second QP queue.
25. A reverse proxy system, characterized in that, include: The system includes a client, a reverse proxy, and a server. A first QP queue is established between the client and the reverse proxy, and a second QP queue is established between the reverse proxy and the server. The client, the reverse proxy, and the server each have a first interface library, a reverse proxy interface library, and a second interface library, respectively. A first private connection is established between the reverse proxy and the client. The reverse proxy and the server establish a second private connection associated with the first private connection.
26. A computer device, characterized in that, The computer device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the RDMA-based reverse proxy method according to any one of claims 1-15, or to perform the data transmission method of the reverse proxy end according to any one of claims 16-18, or to perform the data transmission method of the client according to any one of claims 19-21, or to perform the data transmission method of the server according to any one of claims 22-24.
27. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the RDMA-based reverse proxy method of any one of claims 1-15, or the data transmission method of the reverse proxy end of any one of claims 16-18, or the data transmission method of the client end of any one of claims 19-21, or the data transmission method of the server end of any one of claims 22-24.
28. A computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instruction implements the RDMA-based reverse proxy method of any one of claims 1-15, or implements the data transmission method of the reverse proxy end of any one of claims 16-18, or implements the data transmission method of the client of any one of claims 19-21, or implements the data transmission method of the server of any one of claims 22-24.
Citation Information
Patent Citations
Distributed data receiving system and data receiving method
CN112019597A
Network congestion notification method, proxy node and computer device
WO2019029318A1