Load balancing method and system

By configuring response coordination information in the distributed coordination system, the communication connection between the client and the real server can be flexibly configured, solving the problem of the load balancer becoming a system bottleneck, realizing an efficient and secure data transmission path, and reducing the pressure on the load balancer.

CN119544718BActive Publication Date: 2025-11-04AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411733308.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-11-04
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

In a distributed coordination system, the load balancer connecting the connections can easily become a system bottleneck, limiting system performance.

Method used

By determining the response coordination configuration information of the distributed coordination system for each real server, the communication connection between the client and the real server can be flexibly configured, realizing the data transmission path between the client and the real server and reducing the pressure on the load balancer.

Benefits of technology

It improves communication security, reduces the load balancer's workload, prevents the load balancer from becoming a system bottleneck, and enhances data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544718B_ABST
    Figure CN119544718B_ABST
Patent Text Reader

Abstract

The application discloses a load balancing method and system. The method comprises the following steps: determining response coordination configuration information of a distributed coordination system for each real server configuration; querying a transfer target corresponding to a target real server based on the response coordination configuration information corresponding to the target real server; when the transfer target corresponding to the target real server is a target load balancer, forwarding a response message corresponding to a client request message returned by the target real server to the load balancer, and forwarding the response message corresponding to the client request message returned by the target real server to a target client through the load balancer; and when the transfer target corresponding to the target real server is the target client, directly returning the response message corresponding to the client request message to the target client through the target real server. The scheme can relieve the pressure of the load balancer connected with the distributed coordination system, and avoid the load balancer from becoming a system bottleneck.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of communication, and in particular, to a load balancing method and system. BACKGROUND

[0002] In today's network environment, load balancing technology is essential for efficient operation of network services. Load balancers can distribute network requests or data traffic to multiple servers or processing units to balance the load, prevent single point failures, and improve overall performance, availability and scalability.

[0003] Network layer load balancing (four layers) and application layer load balancing (seven layers) are common types. Network layer load balancing has the advantages of fast processing speed and low resource consumption. Its working mode is "forwarding", which can directly forward the underlying data format (such as IP packets or Ethernet frames) carrying TCP messages to the real server, and the client and the real server responding to the request maintain the same TCP channel. Application layer load balancing can only proxy, and the real server, load balancer, and client need two independent TCP channels to maintain communication, which results in its performance being inferior to network layer load balancer, and the performance is difficult to meet the growing network demand. SUMMARY

[0004] The present application provides a load balancing method and system to solve the problem that the load balancer connected in the distributed coordination system is easy to become a system bottleneck, limiting the performance of the system.

[0005] According to an aspect of the present application, a load balancing method is provided, the method comprising:

[0006] determining response coordination configuration information configured by a distributed coordination system for each real server, the distributed coordination system supporting connection with a plurality of real servers and a plurality of load balancers, each response coordination configuration information being used to indicate that after each real server completes processing of a client request message, a response message returned by each real server corresponds to a delivery target belonging to a client sending the client request message or a load balancer forwarding the client request message to the real server;

[0007] querying a delivery target corresponding to the target real server based on the response coordination configuration information corresponding to the target real server, the delivery target corresponding to the target real server being a target client sending a client request message to the target real server or a target load balancer forwarding a client request message sent by the target client to the target real server;

[0008] when the transfer target corresponding to the target real server is a target load balancer, forwarding the response message corresponding to the client request message returned by the target real server to the load balancer, and forwarding the response message corresponding to the client request message returned by the target real server to the target client through the load balancer;

[0009] when the transfer target corresponding to the target real server is a target client, directly returning the response message corresponding to the client request message to the target client through the target real server.

[0010] According to another aspect of the present application, a load balancing system is provided, which comprises:

[0011] The real server is configured to determine response coordination configuration information configured by a distributed coordination system for each real server, the distributed coordination system supports connection with a plurality of real servers and a plurality of load balancers, and each response coordination configuration information is used to indicate that, after each real server completes processing of a client request message, a transfer target of a response message returned by each real server is a client sending the client request message or a load balancer forwarding the client request message to the real server;

[0012] The load balancer is configured to query a transfer target corresponding to a target real server based on the response coordination configuration information corresponding to the target real server, the transfer target corresponding to the target real server being a target client sending a client request message to the target real server or a target load balancer forwarding a client request message sent by the target client to the target real server;

[0013] The real server is further configured to, when the transfer target corresponding to the target real server is a target load balancer, forward the response message corresponding to the client request message to the load balancer; and when the transfer target corresponding to the target real server is a target client, directly return the response message corresponding to the client request message to the target client.

[0014] The load balancer is further configured to, when the transfer target corresponding to the target real server is a target load balancer, forward the response message corresponding to the client request message returned by the target real server to the target client.

[0015] The technical scheme of the embodiment of the application determines the response coordination configuration information configured by the distributed coordination system for each real server, the distributed coordination system supports connection with a plurality of real servers and a plurality of load balancers, each response coordination configuration information is used to indicate that, after each real server completes processing of a client request message, a transmission target corresponding to a response message returned by each real server is a client sending the client request message or a load balancer forwarding the client request message to the real server; based on the response coordination configuration information corresponding to the target real server, the transmission target corresponding to the target real server is queried, the transmission target corresponding to the target real server is a target client sending the client request message to the target real server or a target load balancer forwarding the client request message sent by the target client to the target real server, the transmission target of the response message returned by the real server is determined based on the response coordination configuration information configured by the real server, so that the data transmission path in the request response process between the client and the real server is determined, at the same time, the communication connection between the client and the real server is flexibly configured according to actual needs; when the transmission target corresponding to the target real server is the target load balancer, the response message corresponding to the client request message returned by the target real server is forwarded to the load balancer, and the response message corresponding to the client request message returned by the target real server is forwarded to the target client through the load balancer, so that the client and the real server communicate through the load balancer, and the security during communication is improved; when the transmission target corresponding to the target real server is the target client, the response message corresponding to the client request message is directly returned to the target client through the target real server, so that direct communication between the client and the real server is realized, the data processing efficiency is improved, the pressure on the load balancer is reduced, and the load balancer is avoided from becoming a system bottleneck.

[0016] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the application, nor is it used to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0018] Figure 1 A flowchart of a load balancing method provided for the first embodiment of the application is shown in FIG. 1.

[0019] Figure 2This is a schematic diagram of a load balancing system provided in Embodiment 2 of the present invention. Detailed Implementation

[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0022] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0023] Example 1

[0024] Figure 1 This is a flowchart illustrating a load balancing method provided in Embodiment 1 of the present invention. This embodiment of the invention is applicable to situations where a client communicates with a real server connected to a distributed coordination system, and the load balancer connected to the distributed coordination system needs to perform load balancing. This method can be executed by the load balancing system, which can be implemented in hardware and / or software. Figure 1 As shown, the method includes:

[0025] S101. Determine the response coordination configuration information configured by the distributed coordination system for each real server. The distributed coordination system supports connection with several real servers and several load balancers. Each response coordination configuration information is used to indicate that after each real server completes the processing of the client request message, the corresponding transmission target of the response message returned by each real server belongs to the client that sent the client request message or to the load balancer that forwards the client request message to the real server.

[0026] In the embodiments of the present application, the distributed coordination system can refer to a highly available system that is available as long as a majority of nodes are alive, for managing and coordinating data interaction between nodes. The Watch mechanism exists in the distributed coordination system, for viewing changes in data in the system, and when data in the distributed coordination system changes, it can be immediately updated to the local cache.

[0027] The real server can be a physical hardware device or a computer, for providing services for the client. The load balancer can refer to a network device or software for distributing network requests or data traffic to multiple servers or processing units, to ensure that the servers or processing units can evenly handle the load, avoid single point of failure, and improve overall performance, availability and scalability. The real server and the load balancer can both be connected to the distributed coordination system.

[0028] The delivery target can refer to a target of the real server returning a response message corresponding to the client request message. The delivery target can be a client sending the client request message to the real server, or a load balancer forwarding the client request message to the real server.

[0029] Specifically, the configuration information configured in each real server connected to the distributed coordination system and capable of identifying the delivery target of the response message returned by the real server is determined as the response coordination configuration information configured in each real server. The response coordination configuration information determines the data transmission path in the request response process between the client and the real server, and is closely related to the working level of the load balancer. For example, the response coordination configuration information configured in each real server can be queried through the Watch mechanism in the distributed coordination system.

[0030] S102, based on the response coordination configuration information corresponding to the target real server, the delivery target corresponding to the target real server is queried, and the delivery target corresponding to the target real server is a target client sending a client request message to the target real server or a target load balancer forwarding a client request message sent by the target client to the target real server.

[0031] In the embodiments of the present application, the target real server can refer to a real server connected to the distributed coordination system and actually communicating with the target client. The target load balancer can refer to a load balancer connected to the distributed coordination system and used for forwarding a client request message sent by the target client to the target real server. The client request message can refer to a data packet sent by the client and containing request information, complying with a specific protocol format.

[0032] Specifically, the delivery target of the response message returned by the target real server to the client request message can be queried according to the response coordination configuration information of the target real server.

[0033] As an option, before querying the delivery target of the target real server according to the response coordination configuration information of the target real server, the method further includes:

[0034] The virtual IP used for communication between the real server and the client is determined as the target address, and the client request message of the target client is sent to the target load balancer.

[0035] Specifically, when the target client sends a client request message to the target real server for communication, the target client can use the virtual IP used for communication with the target real server as the target address, and then send the client request message to the target load balancer. The target address can be a target IP. The configuration of the virtual IP can be completed by the configuration center of the distributed coordination system, and there is no need to configure the virtual IP on the real server, which reduces the difficulty of virtual IP configuration. For example, the target client can ensure that the client request message is sent to the target load balancer through ARP spoofing, ARP proxy or routing configuration.

[0036] As an option, correspondingly, after querying the delivery target of the target real server according to the response coordination configuration information of the target real server, the method further includes:

[0037] The target load balancer forwards the received client request message of the target client to the target real server, so that the target real server returns a response message to the client request message.

[0038] Specifically, when the target load balancer receives the client request message sent by the target client to the target real server, the target load balancer can forward the client request message sent by the target client to the target real server according to the load balancing strategy. The load balancing strategy needs to match the strategy and resources of the distributed coordination system. Further, the target real server can respond to the client request message sent by the target client and return a corresponding response message.

[0039] As an option, forwarding the received client request message of the target client to the target real server through the target load balancer includes:

[0040] The target load balancer modifies the target IP of the client request message of the target client to the target real server IP, and sends the client request message of the target client to the target real server, and waits for the target real server to return the response message of the client request message to the target load balancer or does not need to wait for the target real server to return the response message of the client request message to the target load balancer.

[0041] Specifically, when the target load balancer receives the client request message sent by the target client to the target real server, the target IP of the client request message needs to be modified to the target real server IP first, so as to ensure that the client request message of the target client can be successfully forwarded to the corresponding target real server. When the target load balancer forwards the client request message to the target real server, it can be selected whether to wait for the response message corresponding to the client request message returned by the target real server.

[0042] S103、In the case that the transmission target corresponding to the target real server is the target load balancer, the response message corresponding to the client request message returned by the target real server is forwarded to the load balancer, and the response message corresponding to the client request message returned by the target real server is forwarded to the target client through the load balancer.

[0043] Specifically, when the transmission target corresponding to the target real server is the target load balancer based on the response coordination configuration information corresponding to the target real server, the response message corresponding to the client request message returned by the target real server needs to be sent to the target load balancer first, and then the target load balancer forwards the response message corresponding to the client request message to the target client.

[0044] As an option, the response message corresponding to the client request message returned by the target real server is forwarded to the load balancer, and the response message corresponding to the client request message returned by the target real server is forwarded to the target client through the load balancer, including the following steps A1-A2:

[0045] Step A1, after the target real server processes the client request message of the target client, the response message corresponding to the client request message returned by the target real server is sent to the target load balancer, and the source IP of the response message corresponding to the client request message is the target real server IP.

[0046] Step A2, the target load balancer modifies the source IP in the response message corresponding to the client request message returned by the target real server to a virtual IP used for communication between the target real server and the target client and returns it to the target client.

[0047] Specifically, when the delivery target corresponding to the target real server is the target load balancer, the target real server needs to set the source IP of the response message corresponding to the client request message to the IP of the target real server after generating the response message corresponding to the client request message, and then sends the response message corresponding to the client request message to the target load balancer. Further, the target load balancer needs to set the source IP of the response message corresponding to the client request message to the virtual IP used for communication between the target real server and the target client after receiving the response message corresponding to the client request message returned by the target real server, and then forwards the response message corresponding to the client request message to the target client.

[0048] S104, when the delivery target corresponding to the target real server is the target client, the response message corresponding to the client request message is directly returned to the target client by the target real server.

[0049] Specifically, when the delivery target corresponding to the target real server is the target client, the response message corresponding to the client request message returned by the target real server can be directly sent to the target client based on the response coordination configuration information corresponding to the target real server. For example, a large number of static resources returned by the real server can be directly returned to the client.

[0050] As an option, the response message corresponding to the client request message is directly returned to the target client by the target real server, including:

[0051] The source IP in the response message corresponding to the target client request processed by the target real server itself is set to the virtual IP used for communication between the target real server and the target client, and then the response message is directly returned to the target client by the target real server.

[0052] Specifically, when the delivery target corresponding to the target real server is the target client, the target real server needs to set the source IP of the response message corresponding to the client request message to the virtual IP used for communication between the target real server and the target client after generating the response message corresponding to the client request message, and then sends the response message corresponding to the client request message to the target client. It should be noted that using a virtual IP in the communication process between the client and the real server can avoid additional operations such as encapsulating and disassembling IP packets, thereby improving the communication performance and security between the client and the real server.

[0053] As an option, the load balancing method of the embodiment of the application further includes:

[0054] The input value of the reference configuration field is recorded to obtain the corresponding response coordination configuration information of each real server in response to the input operation of the reference configuration field of the load balancing configuration of each real server. The reference configuration field includes a virtual IP for the real server to communicate with the client, a uniform resource locator (URL) for downloading static resources, a rule expression for judging the selection of the delivery target, and an IP of the real server.

[0055] In the embodiment of the present application, the values corresponding to the virtual IP of each real server for communicating with the client, the uniform resource locator (URL) for downloading static resources, the rule expression for judging the selection of the delivery target, and the IP of the real server are determined in advance as the input values of the reference configuration field of each real server, and can be used as the response coordination configuration information of each real server after being recorded, which can be used to determine the delivery target of the response message returned by the real server. The rule expression for judging the selection of the delivery target can be set according to the actual needs of each real server connected to the distributed coordination system.

[0056] For example, the input values corresponding to the virtual IP of each real server for communicating with the client, the uniform resource locator (URL) for downloading static resources, and the IP of the real server can be substituted into the rule expression for judging the selection of the delivery target to determine the delivery target of the response message returned by each real server.

[0057] Currently, network layer load balancers mainly adopt IP tunnel protocol mode and NAT mode. In the IP tunnel protocol mode, the load balancer uses IP tunnel technology to forward the request message of the client to the real server, and the real server directly returns the response message to the client after processing the request. However, when using the IP tunnel protocol mode, the virtual IP of the real server needs to be configured in the same way as the virtual IP of the load balancer, which causes the real server node to be able to communicate directly with the client through a gateway other than the load balancer, making the real service node unable to be hidden and the security poor. In the NAT mode, the load balancer needs to modify the target address of the client request message, and then forward the client request message to the real server, which causes the client to be unable to identify the IP of the response message returned by the real server, and the client needs to forward the response message returned by the real server to the client through the load balancer to ensure normal communication between the client and the real server. At the same time, when using the NAT mode, all response messages returned by the real server to the client need to pass through the load balancer, which increases the pressure on the load balancer and makes the load balancer easily become the performance bottleneck of the system. The technical scheme of the embodiment of the present application can flexibly determine the transfer target of the response message returned by the real server by configuring the response coordination configuration information of each real server connected by the distributed coordination system, which improves the security of the communication between the client and the real server, reduces the pressure on the load balancer, and avoids the load balancer becoming the performance bottleneck of the system.

[0058] The technical scheme of the embodiment of the present application determines the response coordination configuration information configured by the distributed coordination system for each real server, the distributed coordination system supports connection with a plurality of real servers and a plurality of load balancers, each response coordination configuration information is used to indicate that, after each real server completes processing of a client request message, a transmission target corresponding to a response message returned by each real server is a client sending the client request message or a load balancer forwarding the client request message to the real server; based on the response coordination configuration information corresponding to the target real server, the transmission target corresponding to the target real server is queried, the transmission target corresponding to the target real server is a target client sending the client request message to the target real server or a target load balancer forwarding the client request message sent by the target client to the target real server, the transmission target of the response message returned by the real server is determined based on the response coordination configuration information configured by the real server, so as to determine the data transmission path in the request response process between the client and the real server, and at the same time, it is convenient to flexibly configure the communication connection between the client and the real server according to actual needs; when the transmission target corresponding to the target real server is the target load balancer, the response message corresponding to the client request message returned by the target real server is forwarded to the load balancer, and the response message corresponding to the client request message returned by the target real server is forwarded to the target client through the load balancer, so that the client and the real server communicate through the load balancer, and the security during communication is improved; when the transmission target corresponding to the target real server is the target client, the response message corresponding to the client request message is directly returned to the target client through the target real server, so that the direct communication between the client and the real server is realized, the data processing efficiency is improved, the pressure on the load balancer is reduced, and the load balancer is avoided to become a system bottleneck.

[0059] Embodiment two

[0060] Figure 2 A structural schematic diagram of a load balancing system provided by the embodiment two of the present application. The embodiment of the present application can be applied to the case that the load balancer connected with the distributed coordination system needs to be balanced when the real server connected with the distributed coordination system communicates with the client, and the system can be realized in the form of hardware and / or software. As shown in the figure, the system comprises: Figure 2

[0061] ​The real server 201 is configured to determine response coordination configuration information configured by a distributed coordination system for each real server, the distributed coordination system supports connection with a plurality of real servers and a plurality of load balancers, and each response coordination configuration information is used to indicate that, after each real server completes processing of a client request message, a response message returned by each real server corresponds to a delivery target belonging to a client sending the client request message or a load balancer forwarding the client request message to the real server;

[0062] The load balancer 202 is configured to query a delivery target corresponding to the target real server based on the response coordination configuration information corresponding to the target real server, and the delivery target corresponding to the target real server is a target client sending a client request message to the target real server or a target load balancer forwarding a client request message sent by the target client to the target real server;

[0063] The real server 201 is further configured to, when the delivery target corresponding to the target real server is the target load balancer, forward the response message corresponding to the client request message to the load balancer, and when the delivery target corresponding to the target real server is the target client, directly return the response message corresponding to the client request message to the target client.

[0064] The load balancer 202 is further configured to, when the delivery target corresponding to the target real server is the target load balancer, forward the response message corresponding to the client request message returned by the target real server to the target client.

[0065] Optionally, the load balancing system of the embodiment of the present application further comprises:

[0066] The real server 201 is further configured to, in response to input operation on a reference configuration field for load balancing configuration of each real server, save and record an input value of the reference configuration field to obtain the response coordination configuration information corresponding to each real server.

[0067] The reference configuration field includes a virtual IP used for communication between the real server and the client, a uniform resource locator (URL) used for downloading static resources, a rule expression used for judging the selected delivery target, and an IP of the real server.

[0068] Optionally, before querying the delivery target corresponding to the target real server based on the response coordination configuration information corresponding to the target real server, the method further comprises:

[0069] The target client request message of the target client is sent to the target load balancer by taking the virtual IP used for communication between the real server and the client as the target address; correspondingly, after the delivery target corresponding to the target real server is queried based on the response coordination configuration information corresponding to the target real server, the method further includes:

[0070] The target client request message of the target client received by the target load balancer is forwarded to the target real server, so that the target real server returns a response message for the client request message.

[0071] Optionally, the target client request message of the target client received by the target load balancer is forwarded to the target real server, including:

[0072] The target client request message of the target client is sent to the target real server by modifying the target IP of the target client request message to the target real server IP through the target load balancer, and the target real server returns a response message for the client request message to the target load balancer or does not need to wait for the target real server to return the response message for the client request message to the target load balancer.

[0073] Optionally, the response message corresponding to the client request message returned by the target real server is forwarded to the load balancer, and the response message corresponding to the client request message returned by the target real server is forwarded to the target client through the load balancer, including:

[0074] After the target real server processes the client request message of the target client, the response message corresponding to the client request message returned by the target real server is sent to the target load balancer, and the source IP of the response message corresponding to the client request message is the target real server IP;

[0075] The source IP in the response message corresponding to the client request message returned by the target real server is modified to the virtual IP used for communication between the target real server and the target client through the target load balancer and returned to the target client.

[0076] Optionally, the response message corresponding to the client request message is directly returned to the target client by the target real server, including:

[0077] The source IP in the response message corresponding to the target client request processed by the target real server itself is set to the virtual IP used for communication between the target real server and the target client by the target real server and directly returned to the target client.

[0078] The technical scheme of the embodiment of the present application determines the response coordination configuration information configured by the distributed coordination system for each real server, the distributed coordination system supports connection with a plurality of real servers and a plurality of load balancers, each response coordination configuration information is used to indicate that, after each real server completes processing of a client request message, a transmission target corresponding to a response message returned by each real server is a client sending the client request message or a load balancer forwarding the client request message to the real server; based on the response coordination configuration information corresponding to the target real server, the transmission target corresponding to the target real server is queried, the transmission target corresponding to the target real server is a target client sending the client request message to the target real server or a target load balancer forwarding the client request message sent by the target client to the target real server, the transmission target of the response message returned by the real server is determined based on the response coordination configuration information configured by the real server, so as to determine the data transmission path in the request response process between the client and the real server, at the same time, it is convenient to flexibly configure the communication connection between the client and the real server according to actual needs; when the transmission target corresponding to the target real server is the target load balancer, the response message corresponding to the client request message returned by the target real server is forwarded to the load balancer, and the response message corresponding to the client request message returned by the target real server is forwarded to the target client through the load balancer, so that the client and the real server communicate through the load balancer, and the security during communication is improved; when the transmission target corresponding to the target real server is the target client, the response message corresponding to the client request message is directly returned to the target client through the target real server, so that the direct communication between the client and the real server is realized, the data processing efficiency is improved, the pressure of the load balancer is reduced, and the load balancer is avoided to become a system bottleneck.

[0079] The load balancing system provided in the embodiment of the present application can execute the load balancing method provided in any embodiment of the present application, has the corresponding function modules and beneficial effects of executing the method.

[0080] It should be understood that the steps can be reordered, added, or deleted using the various forms of flowcharts shown above. For example, each step described in the present application can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical scheme of the present application can be achieved, which is not limited herein.

[0081] The above specific embodiments do not constitute a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent replacement and improvement made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A load balancing method, characterized by, The method comprises: determining response coordination configuration information of a distributed coordination system for each real server, the distributed coordination system supporting connection with a plurality of real servers and a plurality of load balancers, each of the response coordination configuration information being used to indicate that, after each real server completes processing of a client request message, a corresponding delivery target of a response message returned by each real server is a client sending the client request message or a load balancer forwarding the client request message to the real server; the response coordination configuration information records input values of reference configuration fields, the reference configuration fields including a virtual IP used for communication between the real server and the client, a uniform resource locator (URL) used for downloading static resources, a rule expression used for judging selection of the delivery target, and an IP of the real server; and the corresponding delivery target of the real server is determined by substituting the input values corresponding to the virtual IP used for communication between the real server and the client, the URL used for downloading static resources, and the IP of the real server into the rule expression used for judging selection of the delivery target; querying, based on the response coordination configuration information of the target real server, a corresponding delivery target of the target real server, the corresponding delivery target of the target real server being a target client sending a client request message to the target real server or a target load balancer forwarding a client request message sent by the target client to the target real server; when the corresponding delivery target of the target real server is the target load balancer, forwarding the response message corresponding to the client request message returned by the target real server to the load balancer, and forwarding, by the load balancer, the response message corresponding to the client request message returned by the target real server to the target client; when the corresponding delivery target of the target real server is the target client, directly returning, by the target real server, the response message corresponding to the client request message to the target client.

2. The method of claim 1, wherein, The method further comprises: saving and recording the input values of the reference configuration fields to obtain the response coordination configuration information of each real server in response to input operations of the reference configuration fields of the load balancing configuration of each real server.

3. The method of claim 1, wherein, Before querying, based on the response coordination configuration information of the target real server, the corresponding delivery target of the target real server, the method further comprises: determining a target address by using a virtual IP used for communication between the real server and the client, and sending a client request message of the target client to the target load balancer; and after querying, based on the response coordination configuration information of the target real server, the corresponding delivery target of the target real server, the method further comprises:

4. The method of claim 3, wherein, forwarding, by the target load balancer, the received client request message of the target client to the target real server, so that the target real server returns a response message for the client request message. forwarding, by the target load balancer, the received client request message of the target client to the target real server, comprises: The target load balancer modifies the target IP of the client request message of the target client to the target real server IP, and sends the client request message of the target client to the target real server, and waits for the target real server to return the response message of the client request message to the target load balancer or does not need to wait for the target real server to return the response message of the client request message to the target load balancer.

5. The method of claim 1, wherein, The response message corresponding to the client request message returned by the target real server is forwarded to the load balancer, and the response message corresponding to the client request message returned by the target real server is forwarded to the target client through the load balancer, comprising: After the target real server processes the client request message of the target client, the response message corresponding to the client request message returned by the target real server is sent to the target load balancer, and the source IP of the response message corresponding to the client request message is the target real server IP; The source IP in the response message corresponding to the client request message returned by the target real server is modified to a virtual IP used for communication between the target real server and the target client through the target load balancer and returned to the target client.

6. The method of claim 1, wherein, The response message corresponding to the client request message is directly returned to the target client through the target real server, comprising: The source IP in the response message corresponding to the target client request processed by the target real server itself is set to a virtual IP used for communication between the target real server and the target client and directly returned to the target client through the target real server.

7. A load balancing system, characterized by, The system comprises: The real server is configured to determine response coordination configuration information configured by a distributed coordination system for each real server, the distributed coordination system supports connection with a plurality of real servers and a plurality of load balancers, each response coordination configuration information is used to indicate that each real server returns a response message corresponding to a delivery target after completing processing of a client request message, the delivery target belongs to a client sending the client request message or a load balancer forwarding the client request message to the real server; the response coordination configuration information records input values of reference configuration fields, the reference configuration fields include a virtual IP used for communication between the real server and the client, a uniform resource locator URL used for downloading static resources, a rule expression used for judging selection of the delivery target, and an IP of the real server; the delivery target corresponding to the real server is determined by substituting input values corresponding to the virtual IP used for communication between the real server and the client, the uniform resource locator URL used for downloading static resources, and the IP of the real server into the rule expression used for judging selection of the delivery target; The load balancer is configured to query the delivery target corresponding to the target real server based on the response coordination configuration information corresponding to the target real server, and the delivery target corresponding to the target real server is a target client sending a client request message to the target real server or a target load balancer forwarding the client request message sent by the target client to the target real server; The real server is further configured to forward the response message corresponding to the client request message to the load balancer when the delivery target corresponding to the target real server is the target load balancer, and return the response message corresponding to the client request message directly to the target client when the delivery target corresponding to the target real server is the target client. The load balancer is further configured to forward the response message corresponding to the client request message returned by the target real server to the target client when the delivery target corresponding to the target real server is the target load balancer.

8. The system of claim 7, wherein, The system further comprises: The real server is further configured to save the input value of the reference configuration field to obtain the response coordination configuration information corresponding to each real server in response to the input operation of the reference configuration field of the load balancing configuration of each real server.

9. The system of claim 7, wherein, Before querying the delivery target corresponding to the target real server based on the response coordination configuration information corresponding to the target real server, the method further comprises: The target client's client request message is sent to the target load balancer by determining the target address as a virtual IP used for communication between the real server and the client. Correspondingly, after querying the delivery target corresponding to the target real server based on the response coordination configuration information corresponding to the target real server, the method further comprises: The target load balancer forwards the received client request message of the target client to the target real server, so that the target real server returns a response message for the client request message.

10. The system of claim 9, wherein, The target load balancer forwards the received client request message of the target client to the target real server, comprising: The target load balancer modifies the target IP of the client request message of the target client to the target real server IP, and then sends the client request message of the target client to the target real server, and waits for the target real server to return the response message of the client request message to the target load balancer or does not need to wait for the target real server to return the response message of the client request message to the target load balancer.

Citation Information

Patent Citations

  • Method and device for forwarding VXLAN message

    CN110545230A

  • Method for realizing transparent transmission of load balancer to client IP based on IP tunnel

    CN111818151A