Load balancing system and method and computing device cluster

By adding a four-layer load balancing instance between the seven-layer load balancing instance and the real server, using the resource tenant VPC address and converting it to an ordinary tenant address, the problem of the seven-layer load balancing instance occupying a large number of tenant VPC addresses is solved, and the burden on ordinary tenants is reduced. The IP address occupation of the tenant address pool improves the utilization efficiency of address resources.

CN118764435APending Publication Date: 2024-10-11HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310307993.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

In a cloud environment or data center, Layer 7 load balancing instances occupy a large number of tenant VPC addresses, causing tenants to continuously reserve addresses, affecting their use of tenant VPC addresses.

Method used

Add a four-layer load balancing instance between the seven-layer load balancing instance and the real server. The seven-layer load balancing instance uses the IP address in the resource tenant VPC address pool for communication instead of the IP address in the ordinary tenant VPC address pool. The layer load balancing instance converts the resource tenant address into a common tenant address, reducing the IP address occupation of the VPC address pool of common tenants.

Benefits of technology

It reduces the number of VPC addresses that ordinary tenants need to reserve, avoids affecting tenants' use of IP addresses in the VPC address pools they rent, and improves the utilization efficiency of address resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764435A_ABST
    Figure CN118764435A_ABST
Patent Text Reader

Abstract

The invention discloses a load balancing system and method and a computing device cluster, the system comprises a first load balancing instance, a second load balancing instance and a third load balancing instance, the first load balancing instance and the third load balancing instance are four-layer load balancing instances, and the second load balancing instance is a seven-layer load balancing instance; the first load balancing instance is used for receiving a first message from a client and sending a second message to the second load balancing instance; the second load balancing instance is used for performing application layer identification processing on the second message, determining a first common tenant VPC address corresponding to the first real server, and sending a third message to a third load balancing instance; and the third load balancing instance is used for sending the fourth message to the first real server, so that the number of occupied tenant VPC addresses is reduced, and the influence on the use of the tenant VPC addresses by the tenant is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a load balancing system, method and computing device cluster. Background Art

[0002] In cloud environments or data centers, medium and large services are generally provided with accessibility through cluster deployment, and cluster deployment generally uses load balancing to share loads, distributing service requests to different service nodes in the cluster according to the selection algorithm. For example, a client will establish a transmission control protocol (TCP) connection with a layer 4 load balancing (L4 LB) instance and send the service request to the layer 4 load balancing instance. After receiving the service request from the client, the layer 4 load balancing instance will send it to different layer 7 load balancing (L7 LB) instances according to the balancing algorithm. The layer 7 load balancing instance will establish a TCP connection with a real server (RS), identify and process the application layer service after receiving the service request from the layer 4 load balancing instance, and send it to different real servers according to the balancing algorithm.

[0003] When the seven-layer load balancing instance establishes a TCP connection with the real server, the source Internet Protocol (IP) address it uses is generally requested from the virtual private cloud (VPC) address pool rented by the tenant. Since the seven-layer load balancing instance is deployed in a cluster, each service node in the cluster must occupy at least one tenant VPC address. As the number of clusters or service nodes in the cluster increases, the number of tenant VPC addresses that the seven-layer load balancing instance in the cluster needs to occupy will also increase, resulting in tenants needing to continuously reserve tenant VPC addresses for the seven-layer load balancing instance, which in turn affects the tenant's own use of the tenant VPC address. Summary of the invention

[0004] The embodiments of the present application provide a load balancing system, method and computing device cluster to reduce the number of occupied tenant VPC addresses and avoid affecting the tenant's own use of the tenant VPC addresses.

[0005] In the first aspect, the present application implements a load balancing system, the load balancing system comprising a first load balancing instance, a second load balancing instance and a third load balancing instance, the first load balancing instance and the third load balancing instance are four-layer load balancing instances, and the second load balancing instance is a seven-layer load balancing instance. The first load balancing instance can: receive a first message from a client, and send a second message to the second load balancing instance; wherein the second message is obtained by replacing the source Internet Protocol IP address of the first message with the first resource tenant virtual private cloud VPC address corresponding to the first load balancing instance, and replacing the destination IP address of the first message with the second resource tenant VPC address corresponding to the second load balancing instance, the resource tenant VPC address belongs to an address in the VPC address pool rented by the resource tenant, and the resource tenant is allowed to access the load balancing system. The second load balancing instance can: perform application layer identification processing on the second message, determine the first common tenant VPC address corresponding to the first real server, and send the third message to the third load balancing instance; wherein the third message is obtained by replacing the source IP address of the second message with the second resource tenant VPC address, and replacing the destination IP address of the second message with the third resource tenant VPC address corresponding to the third load balancing instance, and the third message carries the first common tenant VPC address, and the common tenant VPC address belongs to the address in the VPC address pool rented by the common tenant, and the common tenant is not allowed to access the load balancing system. The third load balancing instance can: send the fourth message to the first real server; wherein the fourth message is obtained by replacing the source IP address in the third message with the second common tenant VPC address corresponding to the third load balancing instance.

[0006] Based on the above system, a four-layer load balancing instance (i.e., the third load balancing instance) is added between the seven-layer load balancing instance (i.e., the second load balancing instance) and the real server. The seven-layer load balancing instance can use the IP address in the VPC address pool rented by the resource tenant as the source IP address or the destination IP address, instead of using the IP address in the VPC address pool rented by the ordinary tenant as the source IP address or the destination IP address, to achieve communication with the two four-layer load balancing instances (i.e., the first load balancing instance and the third load balancing instance). The seven-layer load balancing instance can also convert the IP address in the VPC address pool rented by the resource tenant into the IP address in the VPC address pool rented by the ordinary tenant through the four-layer load balancing instance added between it and the real server, so that the ordinary tenant does not need to continuously reserve the IP address in the VPC address pool rented by the ordinary tenant for the seven-layer load balancing instance to use, thereby reducing the number of IP addresses in the VPC address pool rented by the ordinary tenant and avoiding affecting the ordinary tenant's own use of the IP addresses in the VPC address pool rented by the ordinary tenant.

[0007] In one possible design, the source IP address of the third message may be the second resource tenant VPC address, the destination IP address of the third message may be the third resource tenant VPC address, and the option field of the third message may carry the first common tenant VPC address; or, the source IP address of the inner message of the third message may be the second resource tenant VPC address, the destination IP address of the inner message of the third message may be the first common tenant VPC address, the source IP address of the outer message of the third message may be the second resource tenant VPC address, the destination IP address of the outer message of the third message may be the third resource tenant VPC address, and the outer message of the third message may carry the first virtual network interface VNI corresponding to the first common tenant VPC address.

[0008] With this design, the seven-layer load balancing instance can add the common tenant VPC address corresponding to the real server to the option field of the message or encapsulate it in the inner message of the message. Then, the four-layer load balancing instance added between the seven-layer load balancing instance and the real server can first obtain the common tenant VPC address corresponding to the real server from the option field or inner message of the message from the seven-layer load balancing instance, and then forward the message to the real server through the common tenant VPC address corresponding to the four-layer load balancing instance itself, so as to realize the communication between the seven-layer load balancing instance and the real server, so that the common tenant does not need to continuously reserve IP addresses in the VPC address pool rented by the common tenant for the seven-layer load balancing instance to use, thereby reducing the number of IP addresses occupied in the VPC address pool rented by the common tenant and avoiding affecting the use of the IP addresses in the VPC address pool rented by the common tenant itself.

[0009] In one possible design, the option field of the third message carries the first common tenant VPC address; the third load balancing instance can specifically send the fourth message to the first real server in the following manner: obtain the first common tenant VPC address from the option field of the third message; determine the first VNI according to the first mapping relationship, wherein the first mapping relationship is used to indicate the mapping relationship between the common tenant VPC address corresponding to the real server and the VNI; delete the option field of the third message, and replace the source IP address of the third message with the second common tenant VPC address, and replace the destination IP address of the third message with the first common tenant VPC address to obtain the fourth message; send the fourth message to the first real server through the first VNI.

[0010] With this design, the added four-layer load balancing instance between the seven-layer load balancing instance and the real server can obtain the common tenant VPC address corresponding to the real server from the option field of the message from the seven-layer load balancing instance, and determine the VNI corresponding to the common tenant VPC address corresponding to the real server, and forward the message to the real server through the VNI corresponding to the common tenant VPC address corresponding to the real server, so as to realize the communication between the seven-layer load balancing instance and the real server, so that the common tenant does not need to continuously reserve IP addresses in the VPC address pool rented by the common tenant for the seven-layer load balancing instance to use, thereby reducing the number of IP addresses occupied in the VPC address pool rented by the common tenant and avoiding affecting the use of the IP addresses in the VPC address pool rented by the common tenant itself.

[0011] In one possible design, the outer layer message of the third message carries the first VNI corresponding to the first common tenant VPC address; the third load balancing instance can send the fourth message to the first real server in the following manner: obtain the first VNI from the outer layer message of the third message; strip off the outer layer message of the third message, and replace the source IP address of the inner layer message of the third message with the second common tenant VPC address to obtain the fourth message; send the fourth message to the first real server through the first VNI.

[0012] With this design, the added four-layer load balancing instance between the seven-layer load balancing instance and the real server can obtain the common tenant VPC address corresponding to the real server from the inner message of the message from the seven-layer load balancing instance, obtain the VNI corresponding to the common tenant VPC address corresponding to the real server from the outer message, and forward the message to the real server through the VNI corresponding to the common tenant VPC address corresponding to the real server, so as to realize the communication between the seven-layer load balancing instance and the real server, so that the common tenant does not need to continuously reserve IP addresses in the VPC address pool rented by the common tenant for the seven-layer load balancing instance to use, thereby reducing the number of IP addresses occupied in the VPC address pool rented by the common tenant and avoiding affecting the use of the IP addresses in the VPC address pool rented by the common tenant itself.

[0013] In a possible design, the third load balancing instance can also: receive the fifth message from the first real server, and send the sixth message to the second load balancing instance; wherein the sixth message is obtained by replacing the source IP address of the fifth message with the third resource tenant VPC address, and replacing the destination IP address of the fifth message with the second resource tenant VPC address. The second load balancing instance can also: send the seventh message to the first load balancing instance; wherein the seventh message is obtained by replacing the source IP address of the sixth message with the second resource tenant VPC address, and replacing the destination IP address of the sixth message with the first resource tenant VPC address. The first load balancing instance can also: send the eighth message to the client; wherein the eighth message is obtained by replacing the source IP address of the seventh message with the third common tenant VPC address corresponding to the first load balancing instance.

[0014] With this design, the added four-layer load balancing instance between the seven-layer load balancing instance and the real server can receive messages from the real server and forward the messages to the seven-layer load balancing instance through the resource tenant VPC address corresponding to the four-layer load balancing instance itself, while the four-layer load balancing instance between the seven-layer load balancing instance and the client can receive messages from the seven-layer load balancing instance and forward the messages to the client through the common tenant VPC address corresponding to the four-layer load balancing instance itself, so that the seven-layer load balancing instance can use the IP address in the VPC address pool rented by the resource tenant as the source IP address or the destination IP address, instead of using the IP address in the VPC address pool rented by the common tenant as the source IP address or the destination IP address, to achieve communication with the two four-layer load balancing instances, thereby making it unnecessary for the common tenant to continuously reserve the IP addresses in the VPC address pool rented by the common tenant for the seven-layer load balancing instance to use, thereby reducing the number of IP addresses in the VPC address pool rented by the common tenant and avoiding affecting the use of the IP addresses in the VPC address pool rented by the common tenant itself.

[0015] In one possible design, the source IP address of the sixth message may be the third resource tenant VPC address, and the destination IP address of the sixth message may be the second resource tenant VPC address; or, the source IP address of the inner message of the sixth message may be the first common tenant VPC address, the destination IP address of the inner message of the sixth message may be the second resource tenant VPC address, the source IP address of the outer message of the sixth message may be the third resource tenant VPC address, the destination IP address of the outer message of the sixth message may be the second resource tenant VPC address, and the outer message of the sixth message may carry the first VNI corresponding to the first common tenant VPC address.

[0016] With this design, the added four-layer load balancing instance between the seven-layer load balancing instance and the real server can directly forward the message from the real server to the seven-layer load balancing instance through the resource tenant VPC address corresponding to the four-layer load balancing instance without encapsulating the message from the real server. When encapsulating the message from the real server, the common tenant VPC address corresponding to the real server is first encapsulated in the inner message of the message, and then the message is forwarded to the seven-layer load balancing instance through the resource tenant VPC address corresponding to the four-layer load balancing instance, so as to realize the communication between the seven-layer load balancing instance and the real server, so that the common tenant does not need to continuously reserve IP addresses in the VPC address pool rented by the common tenant for the seven-layer load balancing instance to use, thereby reducing the number of IP addresses occupied in the VPC address pool rented by the common tenant and avoiding affecting the use of the IP addresses in the VPC address pool rented by the common tenant itself.

[0017] In a second aspect, the present application implements a load balancing method, which is applied to a second load balancing instance, where the second load balancing instance is a seven-layer load balancing instance, and the method includes: the second load balancing instance can receive a second message from the first load balancing instance; wherein the first load balancing instance is a four-layer load balancing instance, and the second message is obtained by the first load balancing instance replacing the source Internet Protocol IP address of the first message from the client with the first resource tenant virtual private cloud VPC address corresponding to the first load balancing instance, and replacing the destination IP address of the first message with the second resource tenant VPC address corresponding to the second load balancing instance, wherein the resource tenant VPC address belongs to an address in the VPC address pool leased by the resource tenant, and the resource tenant is allowed to access the load balancing system; the second load balancing instance can perform application layer identification processing on the second message to determine the first a first common tenant VPC address corresponding to the real server; wherein the common tenant VPC address belongs to an address in a VPC address pool rented by a common tenant, and the common tenant is not allowed to access the load balancing system; the second load balancing instance can send a third message to a third load balancing instance; wherein the third load balancing instance is a four-layer load balancing instance, and the third message is obtained by replacing the source IP address of the second message with the second resource tenant VPC address, and replacing the destination IP address of the second message with the third resource tenant VPC address corresponding to the third load balancing instance, and the third message carries the first common tenant VPC address, and the third load balancing instance is used to send a fourth message to the first real server, and the fourth message is obtained by replacing the source IP address in the third message with the second common tenant VPC address corresponding to the third load balancing instance.

[0018] In one possible design, the source IP address of the third message may be the second resource tenant VPC address, the destination IP address of the third message may be the third resource tenant VPC address, and the option field of the third message may carry the first common tenant VPC address; or, the source IP address of the inner message of the third message may be the second resource tenant VPC address, the destination IP address of the inner message of the third message may be the first common tenant VPC address, the source IP address of the outer message of the third message may be the second resource tenant VPC address, the destination IP address of the outer message of the third message may be the third resource tenant VPC address, and the outer message of the third message may carry the first virtual network interface VNI corresponding to the first common tenant VPC address.

[0019] In one possible design, the option field of the third message carries the first common tenant VPC address; the source IP address of the fourth message may be the second common tenant VPC address, and the destination IP address of the fourth message may be the first common tenant VPC address.

[0020] In one possible design, the outer message of the third message carries the first VNI corresponding to the first common tenant VPC address; the source IP address of the inner message of the fourth message may be the second common tenant VPC address.

[0021] In one possible design, the second load balancing instance can also receive a sixth message from the third load balancing instance; wherein the sixth message is obtained by the third load balancing instance replacing the source IP address of the fifth message from the first real server with the third resource tenant VPC address, and replacing the destination IP address of the fifth message with the second resource tenant VPC address; the second load balancing instance can also send a seventh message to the first load balancing instance; wherein the seventh message is obtained by replacing the source IP address of the sixth message with the second resource tenant VPC address, and replacing the destination IP address of the sixth message with the first resource tenant VPC address; the first load balancing instance is used to send an eighth message to the client, and the eighth message is obtained by replacing the source IP address of the seventh message with the third common tenant VPC address corresponding to the first load balancing instance.

[0022] In a third aspect, the present application also provides a computing device cluster, including at least one computing device, and the structure of each computing device includes a processor and a memory. The processor is configured to support the second load balancing instance to execute the method of the second aspect or any possible design of the second aspect. The memory is coupled to the processor, which stores program instructions and data necessary for the communication device. The structure of the communication device also includes a communication interface for communicating with other devices.

[0023] In a fourth aspect, the present application also provides a computer-readable storage medium, which includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method of the second aspect or any possible design of the second aspect.

[0024] In a fifth aspect, the present application also provides a computer program product comprising instructions, which, when executed by a computing device cluster, enables the computing device cluster to execute the method of the second aspect or any possible design of the second aspect.

[0025] In a sixth aspect, the present application also provides a chip, which can be coupled to a memory, and is used to call a computer program stored in the memory and execute the method of the second aspect or any possible design of the second aspect.

[0026] The beneficial effects of the above-mentioned second to sixth aspects and possible designs thereof can refer to the description of the beneficial effects of the method described in the above-mentioned first aspect and any possible design thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a schematic diagram of an existing load balancing scenario;

[0028] Figure 2 A schematic diagram of another existing load balancing scenario;

[0029] Figure 3 A schematic diagram of the structure of a load balancing system provided in an embodiment of the present application;

[0030] Figure 4 A flow chart of a load balancing method provided in an embodiment of the present application;

[0031] Figure 5 A schematic diagram of a load balancing scenario provided in an embodiment of the present application;

[0032] Figure 6 A schematic diagram of another load balancing scenario provided in an embodiment of the present application;

[0033] Figure 7 A schematic diagram of the structure of a second load balancing instance provided in an embodiment of the present application;

[0034] Figure 8 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0035] Fig. 9 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

[0036] Fig.10 A schematic diagram of a connection method between computing device clusters provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0038] Some of the terms involved in the embodiments of the present application are explained below to facilitate understanding of the embodiments of the present application.

[0039] (1) At least one of the embodiments of the present application includes one or more; wherein, more than one means greater than or equal to two. In addition, it should be understood that in the description of this specification, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as expressing or implying relative importance, nor can they be understood as expressing or implying order. For example, the first object and the second object do not represent the importance of the two or the order of the two, but are only for distinguishing the description. In the embodiments of the present application, "and / or" is only used to describe the association relationship, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects related to each other are in an "or" relationship.

[0040] In the description of the embodiments of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "installation" and "connection" should be understood in a broad sense. For example, "connection" can be a detachable connection or a non-detachable connection; it can be a direct connection or an indirect connection through an intermediate medium. The directional terms mentioned in the embodiments of the present application, such as "upper", "lower", "left", "right", "inside", "outside", etc., are only reference directions of the accompanying drawings. Therefore, the directional terms used are for better and clearer explanation and understanding of the embodiments of the present application, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application. "Multiple" means at least two.

[0041] Reference to "one embodiment" or "some embodiments" etc. described in this document means that one or more embodiments provided in this application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this document do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0042] (2) Layer 4 load balancing (L4 LB) determines the final internal server selection based on the destination Internet Protocol (IP) address and destination port in the message, as well as the server selection method set by the load balancer. It mainly works in the transport layer in the middle of the open system interconnection reference model (OSI) model, processing the transmission of messages regardless of the actual content of the messages.

[0043] (3) Layer 7 load balancing (L7 LB), also known as "content switching", uses the truly meaningful application layer content in the message and the server selection method set by the load balancer to determine the final internal server. It mainly works at the application layer at the top of the OSI model and processes the real content of the message.

[0044] (4) Cluster deployment is a service deployment method. For example, in a cloud environment or data center, medium and large services generally provide accessibility through cluster deployment, and cluster deployment generally uses a load balancer to share the load, distributing business requests to different service nodes in the cluster according to the selection algorithm. The load balancer can be a four-layer load balancer or a seven-layer load balancer. The load balancer can be deployed on a physical machine or a cloud virtual machine, that is, a load balancing instance can be a physical machine or a cloud virtual machine on which the load balancer is deployed.

[0045] For example, Figure 1 A schematic diagram of an existing load balancing scenario is shown in FIG. Figure 1As shown, for a service node in a cluster, when the load balancer of the service node is a seven-layer load balancer, the client can establish a transmission control protocol (TCP) connection with the seven-layer load balancing instance, and send application layer service requests such as hypertext transfer protocol (http) and hypertext transfer protocol secure (https) to the seven-layer load balancing instance. For example, client1 establishes a TCP1 connection with the L7 LB instance, client2 establishes a TCP2 connection with the L7 LB instance, and client3 establishes a TCP2 connection with the L47 LB instance. Client1 sends request 1 to the L7 LB instance through the TCP1 connection, client2 sends request 2 to the L7 LB instance through the TCP2 connection, and client3 sends request 3 to the L7LB instance through the TCP3 connection. The seven-layer load balancing instance can establish a TCP connection with a real server (RS), and after receiving the application layer service request from the client, it performs application layer service identification and processing, and then sends the application layer service request to different real servers according to the balancing algorithm. For example, the L7 LB instance establishes a TCP4 connection with RS1 and a TCP5 connection with RS2. When the L7 LB instance receives requests 1, 2, and 3 from client1, client2, and client3, respectively, the L7LB instance identifies and processes the application layer services for requests 1, 2, and 3, and sends requests 1 and 3 to RS1 through a TCP4 connection and requests 2 to RS2 through a TCP5 connection according to the balancing algorithm. After receiving the application layer service request from the seven-layer load balancing instance, the real server can send the response to the application layer service request to the seven-layer load balancing instance, so that the seven-layer load balancing instance sends the response to the application layer service request to the corresponding client. For example, RS1 sends the responses to requests 1 and 3 to the L7 LB instance through a TCP4 connection, and RS2 sends the response to request 2 to the L7 LB instance through a TCP4 connection, so that the L7 LB instance sends the response to request 1 to client1 through a TCP1 connection, sends the response to request 2 to client2 through a TCP2 connection, and sends the response to request 3 to client3 through a TCP3 connection.

[0046] For example, Figure 2 A schematic diagram of another existing load balancing scenario is shown in FIG. Figure 2As shown, for multiple service nodes in a cluster, when the load balancers of multiple service nodes are all layer-7 load balancers, the client can first establish a TCP connection with the layer-4 load balancing instance and send the service request to the layer-4 load balancing instance. After the layer-4 load balancing instance receives the application layer service request from the client, it sends the application layer service request to different layer-7 load balancing instances in the cluster according to the balancing algorithm. Each layer-7 load balancing instance in the cluster can establish a TCP connection with a real server. After receiving the service request from the layer-4 load balancing instance, each layer-7 load balancing instance in the cluster identifies and processes the application layer service and sends the application layer service request to different real servers according to the balancing algorithm. For example, after the L4 LB instance receives request 1 from the client, it sends request 1 to L7 LB instance 2 in cluster 1 according to the balancing algorithm. After receiving request 1 from the L4 LB instance, L7 LB instance 2 identifies and processes the application layer service and sends request 1 to RS3 according to the balancing algorithm.

[0047] When the above-mentioned seven-layer load balancing instance establishes a TCP connection with the real server, the source Internet Protocol (IP) address used by the seven-layer load balancing instance can be an IP address allocated from the address segment reserved by the data center, such as the 100.64.xx address segment commonly used by cloud vendors. In most cloud vendors, this address segment will be used as a reserved address segment for internal services and will not be open to tenants. Alternatively, the source IP address used by the seven-layer load balancing instance can also be an IP address applied for from the virtual private cloud (VPC) address pool rented by the tenant.

[0048] However, since the seven-layer load balancing instance is deployed in a cluster, each service node in the cluster must occupy at least one IP address in the VPC address pool rented by the tenant (that is, the tenant VPC address). As the number of clusters increases or the number of service nodes in the cluster increases, the number of tenant VPC addresses that the seven-layer load balancing instances in the cluster need to occupy will also increase, causing tenants to continuously reserve tenant VPC addresses from their rented VPC address pool for the seven-layer load balancing instance to use, which in turn affects the tenant's own use of the tenant VPC address.

[0049] In view of this, a technical solution of an embodiment of the present application is provided. In an embodiment of the present application, after a four-layer load balancing instance (i.e., a third load balancing instance) is added between a seven-layer load balancing instance (i.e., a second load balancing instance) and a real server, the seven-layer load balancing instance can use the IP address in the VPC address pool rented by the resource tenant as the source IP address or the destination IP address, instead of using the IP address in the VPC address pool rented by the common tenant as the source IP address or the destination IP address, to realize communication with two four-layer load balancing instances (i.e., the first load balancing instance and the third load balancing instance), and the seven-layer load balancing instance can also convert the IP address in the VPC address pool rented by the resource tenant into the IP address in the VPC address pool rented by the common tenant through the four-layer load balancing instance added between it and the real server, so that the common tenant does not need to continuously reserve the IP address in the VPC address pool rented by the common tenant for the seven-layer load balancing instance to use, thereby reducing the number of IP addresses in the VPC address pool rented by the common tenant, and avoiding affecting the use of the IP addresses in the VPC address pool rented by the common tenant itself.

[0050] The technical features involved in the embodiments of the present application are described below to facilitate understanding of the embodiments of the present application.

[0051] The load balancing method provided in the embodiment of the present application can be applied to a load balancing system. The load balancing system may include at least two four-layer load balancing instances, wherein the four-layer load balancing instance may be a physical machine or a cloud virtual machine on which a four-layer load balancer is deployed; and may also include at least one seven-layer load balancing instance, wherein the seven-layer load balancing instance may be a physical machine or a cloud virtual machine on which a seven-layer load balancer is deployed. Exemplary, Figure 3 A schematic diagram of the structure of a load balancing system provided in an embodiment of the present application. Figure 3 As shown, three load balancing instances are exemplarily drawn, namely, a first load balancing instance 101, a second load balancing instance 102, and a third load balancing instance 103. Among them, the first load balancing instance 101 and the third load balancing instance 103 are four-layer load balancing instances, and the second load balancing instance 103 is a seven-layer load balancing instance.

[0052] A load balancing system provided by an embodiment of the present application is introduced above. Next, a load balancing method provided by an embodiment of the present application is introduced in conjunction with the accompanying drawings.

[0053] Figure 4 A flow chart of a load balancing method provided in an embodiment of the present application, which can be applied to Figure 3 As shown or with Figure 3The load balancing system with similar functional structure is not specifically limited in the present application embodiment. The specific process of the load balancing method is described as follows. Figure 3 For example, the load balancing system shown in FIG. 1 may be a load balancing system. Figure 3 The first load balancing instance 101 in the system shown in FIG. 101, the second load balancing instance described below may be Figure 3 The second load balancing instance 102 in the system shown in FIG. 104 , the third load balancing instance described below may be Figure 3 The third load balancing instance 103 in the system shown. In the embodiment of the present application, the load balancing system is taken as an example to introduce the execution subject of the method, or the execution subject of the method can also be other devices or systems, such as a chip, chip system or processor applied to the load balancing system.

[0054] S401: A first load balancing instance receives a first message from a client, and sends a second message to a second load balancing instance. Correspondingly, the second load balancing instance receives the second message from the first load balancing instance.

[0055] In some embodiments, the first load balancing instance can receive a first message from a client, wherein the source IP address of the first message can be the IP address of the client, and the destination IP address of the first message can be the elastic public network (Elastic) IP address or virtual (Virtual) IP address of the first load balancing instance, that is, the common tenant VPC address corresponding to the first load balancing instance. The first load balancing instance can replace the source IP address of the first message with the resource tenant VPC address corresponding to the first load balancing instance (for example, called the first resource tenant VPC address), and replace the destination IP address of the first message with the resource tenant VPC address corresponding to the second load balancing instance (for example, called the second resource tenant VPC address), obtain a second message, and send the second message to the second load balancing instance. Correspondingly, the second load balancing instance can receive the second message from the first load balancing instance.

[0056] Among them, the common tenant VPC address belongs to the address in the VPC address pool rented by the common tenant, and the resource tenant VPC address belongs to the address in the VPC address pool rented by the resource tenant. Common tenants and resource tenants are both tenants in the tenant zone. The difference between the two is that both common tenants and resource tenants can access common services (such as but not limited to patch servers, application programming interface gateways, etc.), but only resource tenants can access resource services (such as but not limited to relational database services, elastic load balancing services, etc.), that is, common tenants are tenants who are not allowed to access the first load balancing instance, the second load balancing instance, and the second load balancing instance in the load balancing system, and resource tenants are tenants who are allowed to access the first load balancing instance, the second load balancing instance, and the second load balancing instance in the load balancing system.

[0057] For example, Figure 5 A schematic diagram of a load balancing scenario provided in an embodiment of the present application, such as Figure 5 As shown in Table 1, the client can send message 1 to L4 LB instance 1, where the source IP address of message 1 can be the IP address of the client: IP1, and the destination IP address of message 1 can be the EIP address or VIP address of L4 LB instance 1 (that is, the common tenant VPC address corresponding to L4 LB instance 1): IP2. That is, as shown in Table 1, message 1: SIP = IP1, DIP = IP2.

[0058] After L4 LB instance 1 receives message 1 (SIP=IP1, DIP=IP2) from the client, it can select L7 LB instance 1 from multiple L7 LB instances according to the balancing algorithm, where the resource tenant VPC address corresponding to L7 LB instance 1 can be IP4. L4 LB instance 1 can also replace the source IP address of message 1 with the resource tenant VPC address corresponding to L4 LB instance 1: IP3, and replace the destination IP address of message 1 with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, to obtain message 2, and send message 2 to L7 LB instance 1 through IP3. As shown in Table 1, message 2: SIP=IP3, DIP=IP4.

[0059] Table 1

[0060] Source / Destination Device Message SIP DIP client->L4 LB instance 1 Message 1 IP1 IP2(Normal) L4 LB instance 1 -> L7 LB instance 1 Message 1 IP3(resource) IP4(resource)

[0061] S402: The second load balancing instance performs application layer identification processing on the second message, determines the first common tenant VPC address corresponding to the first real server, and sends the third message to the third load balancing instance. Accordingly, the third load balancing instance receives the third message from the second load balancing instance.

[0062] In some embodiments, after receiving the second message from the first load balancing instance, the second load balancing instance can perform application layer identification processing on the second message to determine the common tenant VPC address corresponding to the first real server (for example, referred to as the first common tenant VPC address). The second load balancing instance can replace the source IP address of the second message with the second resource tenant VPC address, replace the destination IP address of the second message with the resource tenant VPC address corresponding to the third load balancing instance (for example, referred to as the third resource tenant VPC address), and add the first common tenant VPC address to the second message to obtain a third message, and send the third message to the third load balancing instance. Accordingly, the third load balancing instance can receive the third message from the second load balancing instance.

[0063] In the specific implementation, the second load balancing instance can add the first common tenant VPC address to the options field of the second message, that is, the source IP address of the third message can be the second resource tenant VPC address, the destination IP address of the third message can be the third resource tenant VPC address, and the options field of the third message can carry the first common tenant VPC address.

[0064] For example, Figure 5 As shown, after L7 LB instance 1 receives message 2 (SIP=IP3, DIP=IP4) from L4 LB instance 1 via IP4, it can perform application layer identification processing on message 2 and select RS1 from multiple RSs according to the balancing algorithm, wherein the common tenant VPC address corresponding to RS1 can be IP7. L7 LB instance 1 can also replace the source IP address of message 2 with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, replace the destination IP address of message 2 with the resource tenant VPC address corresponding to L4 LB instance 2: IP5, and add the common tenant VPC address corresponding to RS1: IP7 to the option field of message 2 to obtain message 3, and send message 3 to L4 LB instance 2 via IP4. That is, as shown in Table 2, message 3: SIP=IP4, DIP=IP5, Options=IP7.

[0065] Table 2

[0066] Source / Destination Device Message SIP DIP L7 LB instance 1 -> L4 LB instance 2 Message 3 IP4(resource) IP5(resource)

[0067] Alternatively, the second load balancing instance may encapsulate the first common tenant VPC address in the inner layer message of the second message, that is, perform virtual extensible local area network (VXLAN) encapsulation on the second message to obtain a third message, the source IP address of the inner layer message of the third message may be the second resource tenant VPC address, the destination IP address of the inner layer message of the third message may be the first common tenant VPC address, the source IP address of the outer layer message of the third message may be the second resource tenant VPC address, the destination IP address of the outer layer message of the third message may be the third resource tenant VPC address, and the outer layer message of the third message may carry the first virtual network interface (virtual network interface, VNI) corresponding to the first common tenant VPC address.

[0068] For example, Figure 6 A schematic diagram of another load balancing scenario provided in an embodiment of the present application, such as Figure 6 As shown, the client can send message 1 to L4 LB instance 1, where the source IP address of message 1 can be the client's IP address: IP1, and the destination IP address of message 1 can be the EIP address or VIP address of L4 LB instance 1 (that is, the common tenant VPC address corresponding to L4 LB instance 1): IP2. That is, message 1: SIP = IP1, DIP = IP2.

[0069] After L4 LB instance 1 receives message 1 (SIP = IP1, DIP = IP2) from the client, it can select L7 LB instance 1 from multiple L7 LB instances according to the balancing algorithm, where the resource tenant VPC address corresponding to L7 LB instance 1 can be IP4. L4 LB instance 1 can also replace the source IP address of message 1 with the resource tenant VPC address corresponding to L4 LB instance 1: IP3, and replace the destination IP address of message 1 with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, to obtain message 2, and send message 2 to L7 LB instance 1 through IP3. That is, message 2: SIP = IP3, DIP = IP4.

[0070] After L7 LB instance 1 receives message 2 (SIP=IP3, DIP=IP4) from L4 LB instance 1 through IP4, it can perform application layer identification processing on message 2 and select RS1 from multiple RSs according to the balancing algorithm, where the common tenant VPC address corresponding to RS1 can be IP7. L7 LB instance 1 can also encapsulate message 2. During encapsulation, the source IP address of the inner message of message 2 is replaced with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, the destination IP address of the inner message of message 2 is replaced with the common tenant VPC address corresponding to RS1: IP7, the source IP address of the outer message of message 2 is replaced with the resource tenant VPC address corresponding to L7LB instance 1: IP4, the destination IP address of the outer message of message 2 is replaced with the resource tenant VPC address corresponding to L4 LB instance 2: IP5, and the VNI corresponding to the common tenant VPC address corresponding to RS1: VNI1 corresponding to IP7 is added to the outer message of message 2 to obtain message 3, and message 3 is sent to L4 LB instance 2 via IP4. As shown in Table 3, the inner message of message 3: SIP = IP4, DIP = IP7, the outer message of message 3: SIP = IP4, DIP = IP5, VNI = VNI1.

[0071] Table 3

[0072]

[0073] S403: The third load balancing instance sends the fourth message to the first real server.

[0074] In some embodiments, after the third load balancing instance receives the third message from the second load balancing instance, it can replace the source IP address in the third message with the common tenant VPC address corresponding to the third load balancing instance (for example, called the third common tenant VPC address) to obtain a fourth message, and send the fourth message to the first real server.

[0075] In a specific implementation, if the second load balancing instance encapsulates the first common tenant VPC address in the option field of the second message to obtain the third message, the third load balancing instance can obtain the first common tenant VPC address from the option field of the third message. The third load balancing instance can also determine the first VNI corresponding to the first common tenant VPC address according to the first mapping relationship, wherein the first mapping relationship is used to indicate the mapping relationship between the common tenant VPC address and the VNI corresponding to the real server. The third load balancing instance can also delete the option field of the third message. The third load balancing instance can also replace the source IP address of the third message with the second common tenant VPC address, and replace the destination IP address of the third message with the first common tenant VPC address to obtain a fourth message. That is to say, the third load balancing instance is currently in a bidirectional address translation (full network address translation, FULLNAT) mode. In FULLNAT mode, the third load balancing instance can convert the source IP address and destination IP address of the received message. The third load balancing instance can also send the fourth message to the first real server through the first VNI corresponding to the first common tenant VPC address.

[0076] For example, Figure 5 As shown, after L4 LB instance 2 receives message 3 (SIP=IP4, DIP=IP5, Options=IP7) from L7 LB instance 1 through IP5, it can obtain IP7 from the option field of message 3. L4 LB instance 2 can also determine the VNI1 corresponding to IP7. L4 LB instance 2 can also delete the option field of message 3. L4 LB instance 2 can also replace the source IP address of message 3 with the common tenant VPC address corresponding to L4 LB instance 2: IP6, and replace the destination IP address of message 3 with the common tenant VPC address corresponding to RS1: IP7, to obtain message 4. L4 LB instance 2 can also send message 4 to RS1 through VNI1 corresponding to IP7. That is, as shown in Table 4, message 4: SIP=IP6, DIP=IP7.

[0077] Table 4

[0078] Source / Destination Device Message SIP DIP L4 LB instance 2 -> RS1 Message 4 IP6 (normal) IP7(normal)

[0079] If the second load balancing instance encapsulates the first common tenant VPC address in the inner message of the second message to obtain the third message, the third load balancing instance can obtain the first VNI corresponding to the first common tenant VPC address from the outer message of the third message. The third load balancing instance can also strip off the outer message of the third message. The third load balancing instance can also replace the source IP address of the inner message of the third message with the second common tenant VPC address to obtain a fourth message. That is to say, the third load balancing instance is currently in source address translation (source network address translation, SNAT) mode. In SNAT mode, the third load balancing instance can convert the source IP address of the received message. The third load balancing instance can also send the fourth message to the first real server through the first VNI corresponding to the first common tenant VPC address.

[0080] For example, Figure 6 As shown, after L4 LB instance 2 receives message 3 (inner message: SIP=IP4, DIP=IP7, outer message: SIP=IP4, DIP=IP5, VNI=VNI1) from L7 LB instance 1 through IP5, VNI1 corresponding to IP7 can be obtained from the outer message of message 3. L4 LB instance 2 can also strip off the outer message of message 3. L4LB instance 2 can also replace the source IP address of the inner message of message 3 with the common tenant VPC address corresponding to L4 LB instance 2: IP6 to obtain message 4. L4 LB instance 2 can also send message 4 to RS1 through VNI1 corresponding to IP7. That is, as shown in Table 4, message 4: SIP=IP6, DIP=IP7.

[0081] In addition, after the third load balancing instance sends the fourth message to the first real server, it can also receive the fifth message from the first real server, replace the source IP address of the fifth message with the third resource tenant VPC address, and replace the destination IP address of the fifth message with the second resource tenant VPC address, obtain the sixth message, and send the sixth message to the second load balancing instance.

[0082] Correspondingly, the second load balancing instance can receive the sixth message from the third load balancing instance, replace the source IP address of the sixth message with the second resource tenant VPC address, and replace the destination IP address of the sixth message with the first resource tenant VPC address, obtain the seventh message, and send the seventh message to the first load balancing instance.

[0083] Correspondingly, the first load balancing instance can receive the seventh message from the second load balancing instance, replace the source IP address of the seventh message with the common tenant VPC address corresponding to the first load balancing instance (for example, called the third common tenant VPC address), obtain the eighth message, and send the eighth message to the client.

[0084] In a specific implementation, the source IP address of the sixth message may be the third resource tenant VPC address, and the destination IP address of the sixth message may be the second resource tenant VPC address.

[0085] For example, Figure 5 As shown in Table 5, L4 LB instance 2 receives message 5 from RS1 via IP6, wherein the source IP address of message 5 may be the common tenant VPC address corresponding to RS1: IP7, and the destination IP address of message 5 may be the common tenant VPC address corresponding to L4 LB instance 2: IP6. That is, as shown in Table 5, message 5: SIP = IP7, DIP = IP6.

[0086] L4 LB instance 2 can replace the source IP address of message 5 with the resource tenant VPC address corresponding to L4 LB instance 2: IP5, and replace the destination IP address of message 5 with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, to obtain message 6, and send message 6 to L7 LB instance 1 through IP5. As shown in Table 5, message 6: SIP = IP5, DIP = IP4.

[0087] After L7 LB instance 1 receives message 6 from L4 LB instance 2 through IP4, it can replace the source IP address of message 6 with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, and replace the destination IP address of message 6 with the resource tenant VPC address corresponding to L4 LB instance 1: IP3, to obtain message 7, and send message 7 to L4 LB instance 1 through IP4. As shown in Table 5, message 7: SIP = IP4, DIP = IP3.

[0088] After L4 LB instance 1 receives message 7 from L7 LB instance 1 through IP3, it can replace the source IP address of message 7 with the common tenant VPC address corresponding to L4 LB instance 1: IP2, and replace the destination IP address of message 7 with the client's IP address: IP1, to obtain message 8, and send message 8 to the client through IP1. As shown in Table 5, message 8: SIP = IP2, DIP = IP1.

[0089] Table 5

[0090] Source / Destination Device Message SIP DIP RS1->L4 LB instance 2 Message 5 IP7(normal) IP6 (normal) L4 LB instance 2 -> L7 LB instance 1 Message 6 IP5(resource) IP4(resource) L7 LB instance 1 -> L4 LB instance 1 Message 7 IP4(resource) IP3(resource) L4 LB instance 1->client Message 8 IP2(Normal) IP1

[0091] Alternatively, the source IP address of the inner message of the sixth message may be the first common tenant VPC address, the destination IP address of the inner message of the sixth message may be the second resource tenant VPC address, the source IP address of the outer message of the sixth message may be the third resource tenant VPC address, the destination IP address of the outer message of the sixth message may be the second resource tenant VPC address, and the outer message of the sixth message may carry the first VNI corresponding to the first common tenant VPC address.

[0092] For example, Figure 6 As shown in Table 6, L4 LB instance 2 receives message 5 from RS1 via IP6, wherein the source IP address of message 5 may be the common tenant VPC address corresponding to RS1: IP7, and the destination IP address of message 5 may be the common tenant VPC address corresponding to L4 LB instance 2: IP6. That is, as shown in Table 6, message 5: SIP = IP7, DIP = IP6.

[0093] L4 LB instance 2 can encapsulate message 5. During encapsulation, the source IP address of the inner message of message 5 is replaced with the common tenant VPC address corresponding to RS1: IP7, the destination IP address of the inner message of message 5 is replaced with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, the source IP address of the outer message of message 5 is replaced with the resource tenant VPC address corresponding to L4 LB instance 2: IP5, the destination IP address of the outer message of message 5 is replaced with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, and message 6 is obtained, and message 6 is sent to L7 LB instance 1 through IP5. As shown in Table 6, the inner message of message 6: SIP = IP7, DIP = IP4, the outer message of message 6: SIP = IP5, DIP = IP4.

[0094] After L7 LB instance 1 receives message 6 from L4 LB instance 2 through IP4, it can strip off the outer message of message 6, replace the source IP address of the inner message of message 6 with the resource tenant VPC address corresponding to L7 LB instance 1: IP4, replace the destination IP address of the inner message of message 6 with the resource tenant VPC address corresponding to L4 LB instance 1: IP3, obtain message 7, and send message 7 to L4 LB instance 1 through IP4. As shown in Table 6, message 7: SIP = IP4, DIP = IP3.

[0095] After L4 LB instance 1 receives message 7 from L7 LB instance 1 through IP3, it can replace the source IP address of message 7 with the common tenant VPC address corresponding to L4 LB instance 1: IP2, and replace the destination IP address of message 7 with the client's IP address: IP1, to obtain message 8, and send message 8 to the client through IP1. As shown in Table 6, message 8: SIP = IP2, DIP = IP1.

[0096] Table 6

[0097]

[0098] Based on the above solution, after adding a four-layer load balancing instance (i.e., the third load balancing instance) between the seven-layer load balancing instance (i.e., the second load balancing instance) and the real server, the seven-layer load balancing instance can use the IP address in the VPC address pool rented by the resource tenant as the source IP address or the destination IP address, instead of using the IP address in the VPC address pool rented by the common tenant as the source IP address or the destination IP address, to achieve communication with the two four-layer load balancing instances (i.e., the first load balancing instance and the third load balancing instance). The seven-layer load balancing instance can also convert the IP address in the VPC address pool rented by the resource tenant into the IP address in the VPC address pool rented by the common tenant through the four-layer load balancing instance added between it and the real server, so that the common tenant does not need to continuously reserve the IP address in the VPC address pool rented by the common tenant for the seven-layer load balancing instance to use, thereby reducing the number of IP addresses in the VPC address pool rented by the common tenant and avoiding affecting the use of the IP addresses in the VPC address pool rented by the common tenant itself.

[0099] Based on the above embodiments, the present application also provides a second load balancing example, such as Figure 7 FIG. 1 is a schematic diagram of a structure of a second load balancing instance provided in an embodiment of the present application, wherein the second load balancing instance is used to implement the above Figure 4-Figure 6 The access control method shown. Figure 7 The second load balancing instance 700 may include a processing module 701 and a communication module 702.

[0100] The communication module 702 is used to receive a second message from the first load balancing instance; wherein the first load balancing instance is a layer-4 load balancing instance, and the second message is obtained by replacing the source Internet Protocol IP address of the first message from the client with the first resource tenant virtual private cloud VPC address corresponding to the first load balancing instance, and replacing the destination IP address of the first message with the second resource tenant VPC address corresponding to the second load balancing instance, wherein the resource tenant VPC address belongs to an address in the VPC address pool rented by the resource tenant, and the resource tenant is allowed to access the load balancing system;

[0101] The processing module 701 is used to perform application layer identification processing on the second message to determine a first common tenant VPC address corresponding to the first real server; wherein the common tenant VPC address belongs to an address in a VPC address pool rented by a common tenant, and the common tenant is not allowed to access the load balancing system;

[0102] The communication module 702 is also used to send a third message to a third load balancing instance; wherein the third load balancing instance is a four-layer load balancing instance, and the third message is obtained by replacing the source IP address of the second message with the second resource tenant VPC address, and replacing the destination IP address of the second message with the third resource tenant VPC address corresponding to the third load balancing instance, and the third message carries the first common tenant VPC address, and the third load balancing instance is used to send a fourth message to the first real server, and the fourth message is obtained by replacing the source IP address in the third message with the second common tenant VPC address corresponding to the third load balancing instance.

[0103] In one possible design, the source IP address of the third message may be the second resource tenant VPC address, the destination IP address of the third message may be the third resource tenant VPC address, and the option field of the third message may carry the first common tenant VPC address; or, the source IP address of the inner message of the third message may be the second resource tenant VPC address, the destination IP address of the inner message of the third message may be the first common tenant VPC address, the source IP address of the outer message of the third message may be the second resource tenant VPC address, the destination IP address of the outer message of the third message may be the third resource tenant VPC address, and the outer message of the third message may carry the first virtual network interface VNI corresponding to the first common tenant VPC address.

[0104] In one possible design, the option field of the third message carries the first common tenant VPC address; the source IP address of the fourth message may be the second common tenant VPC address, and the destination IP address of the fourth message may be the first common tenant VPC address.

[0105] In one possible design, the outer message of the third message carries the first VNI corresponding to the first common tenant VPC address; the source IP address of the inner message of the fourth message may be the second common tenant VPC address.

[0106] In one possible design, the communication module 702 is also used to: receive a sixth message from the third load balancing instance; wherein the sixth message is obtained by the third load balancing instance replacing the source IP address of the fifth message from the first real server with the third resource tenant VPC address, and replacing the destination IP address of the fifth message with the second resource tenant VPC address; send a seventh message to the first load balancing instance; wherein the seventh message is obtained by replacing the source IP address of the sixth message with the second resource tenant VPC address, and replacing the destination IP address of the sixth message with the first resource tenant VPC address, and the first load balancing instance is used to send an eighth message to the client, and the eighth message is obtained by replacing the source IP address of the seventh message with the third common tenant VPC address corresponding to the first load balancing instance.

[0107] Based on the above embodiments, the present application also provides a computing device, such as Figure 8 As shown, it is a schematic diagram of the structure of a computing device provided in an embodiment of the present application, and the computing device 800 includes: a bus 802, a processor 804, a memory 806, and a communication interface 808. The processor 804, the memory 806, and the communication interface 808 communicate through the bus 802. The computing device 800 can be a first load balancing instance, a second load balancing instance, or a third load balancing instance. It should be understood that the present application does not limit the number of processors and memories in the computing device 800.

[0108] The bus 802 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8The bus 802 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 802 may include a path for transmitting information between various components of the computing device 800 (eg, the memory 806, the processor 804, and the communication interface 808).

[0109] The processor 804 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0110] The memory 806 may include a volatile memory, such as a random access memory (RAM).

[0111] The processor 804 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0112] The memory 806 stores executable program codes, and the processor 804 executes the executable program codes to respectively implement the functions of the communication module and the processing module, thereby implementing the following: Figure 4-Figure 6 That is, the memory 806 stores the method for executing Figure 4-Figure 6 Instructions for the method shown.

[0113] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or communication networks.

[0114] Based on the above embodiments, the embodiments of the present application further provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a first load balancing instance, a second load balancing instance, or a third load balancing instance.

[0115] like Fig. 9 As shown, the computing device cluster includes at least one computing device 800. The memory 806 in one or more computing devices 800 in the computing device cluster may store the same Figure 4-Figure 6 Instructions for the method shown.

[0116] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store respectively the memory 806 for executing the following steps: Figure 4-Figure 6 In other words, the combination of one or more computing devices 800 can jointly execute instructions for performing the method shown in FIG. Figure 4-Figure 6 Instructions for the method shown.

[0117] It should be noted that the memory 806 in different computing devices 800 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the first load balancing instance. That is, the instructions stored in the memory 806 in different computing devices 800 can implement the functions of one or more modules in the communication module and the processing module.

[0118] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.10 A possible implementation is shown. Fig.10 As shown, two computing devices 800A and 800B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 806 in the computing device 800A stores instructions for executing the functions of the communication module. At the same time, the memory 806 in the computing device 800B stores instructions for executing the functions of the processing module.

[0119] It should be understood that Fig.10 The functions of the computing device 800A shown in FIG. 8 may also be completed by multiple computing devices 800. Similarly, the functions of the computing device 800B may also be completed by multiple computing devices 800.

[0120] Based on the above embodiments, the embodiments of the present application further provide a computer-readable storage medium, which may be any available medium that a computing device can store or a data storage device such as a data center that contains one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the following: Figure 4-Figure 6 The method shown.

[0121] Based on the above embodiments, the embodiments of the present application further provide a computer program product including instructions, which may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the following Figure 4-Figure 6 The method shown.

[0122] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0123] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0124] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0126] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A load balancing system, characterized in that: The load balancing system comprises a first load balancing instance, a second load balancing instance and a third load balancing instance, wherein the first load balancing instance and the third load balancing instance are four-layer load balancing instances, and the second load balancing instance is a seven-layer load balancing instance; The first load balancing instance is used to receive a first message from a client and send a second message to the second load balancing instance; wherein the second message is obtained by replacing a source Internet Protocol IP address of the first message with a first resource tenant virtual private cloud VPC address corresponding to the first load balancing instance, and replacing a destination IP address of the first message with a second resource tenant VPC address corresponding to the second load balancing instance, wherein the resource tenant VPC address belongs to an address in a VPC address pool rented by a resource tenant, and the resource tenant is allowed to access the load balancing system; The second load balancing instance is used to perform application layer identification processing on the second message, determine the first common tenant VPC address corresponding to the first real server, and send a third message to the third load balancing instance; wherein the third message is obtained by replacing the source IP address of the second message with the second resource tenant VPC address, and replacing the destination IP address of the second message with the third resource tenant VPC address corresponding to the third load balancing instance, the third message carries the first common tenant VPC address, the common tenant VPC address belongs to an address in the VPC address pool rented by the common tenant, and the common tenant is not allowed to access the load balancing system; The third load balancing instance is used to send a fourth message to the first real server; wherein the fourth message is obtained by replacing the source IP address in the third message with the second common tenant VPC address corresponding to the third load balancing instance.

2. The system according to claim 1, characterized in that The source IP address of the third message is the second resource tenant VPC address, the destination IP address of the third message is the third resource tenant VPC address, and the option field of the third message carries the first common tenant VPC address; or, The source IP address of the inner layer message of the third message is the second resource tenant VPC address, the destination IP address of the inner layer message of the third message is the first common tenant VPC address, the source IP address of the outer layer message of the third message is the second resource tenant VPC address, the destination IP address of the outer layer message of the third message is the third resource tenant VPC address, and the outer layer message of the third message carries the first virtual network interface VNI corresponding to the first common tenant VPC address.

3. The system according to claim 2, characterized in that The option field of the third message carries the first common tenant VPC address; the third load balancing instance is specifically used to send the fourth message to the first real server in the following manner: Acquire the first common tenant VPC address from the option field of the third message; Determine the first VNI according to the first mapping relationship, wherein the first mapping relationship is used to indicate a mapping relationship between a common tenant VPC address corresponding to a real server and the VNI; Deleting the option field of the third message, replacing the source IP address of the third message with the second common tenant VPC address, and replacing the destination IP address of the third message with the first common tenant VPC address, to obtain the fourth message; Send the fourth message to the first real server through the first VNI.

4. The system according to claim 2, characterized in that The outer layer message of the third message carries the first VNI corresponding to the first common tenant VPC address; the third load balancing instance is specifically used to send the fourth message to the first real server in the following manner: Acquire the first VNI from an outer message of the third message; Stripping off the outer layer message of the third message, and replacing the source IP address of the inner layer message of the third message with the second common tenant VPC address, to obtain the fourth message; Send the fourth message to the first real server through the first VNI.

5. The system according to any one of claims 1 to 4, characterized in that: The third load balancing instance is further configured to receive a fifth message from the first real server, and send a sixth message to the second load balancing instance; wherein the sixth message is obtained by replacing the source IP address of the fifth message with the third resource tenant VPC address, and replacing the destination IP address of the fifth message with the second resource tenant VPC address; The second load balancing instance is further used to send a seventh message to the first load balancing instance; wherein the seventh message is obtained by replacing the source IP address of the sixth message with the second resource tenant VPC address, and replacing the destination IP address of the sixth message with the first resource tenant VPC address; The first load balancing instance is also used to send an eighth message to the client; wherein the eighth message is obtained by replacing the source IP address of the seventh message with the third common tenant VPC address corresponding to the first load balancing instance.

6. The system according to claim 5, characterized in that The source IP address of the sixth message is the third resource tenant VPC address, and the destination IP address of the sixth message is the second resource tenant VPC address; or, The source IP address of the inner layer message of the sixth message is the first common tenant VPC address, the destination IP address of the inner layer message of the sixth message is the second resource tenant VPC address, the source IP address of the outer layer message of the sixth message is the third resource tenant VPC address, the destination IP address of the outer layer message of the sixth message is the second resource tenant VPC address, and the outer layer message of the sixth message carries the first VNI corresponding to the first common tenant VPC address.

7. A load balancing method, characterized in that: Applied to a second load balancing instance, where the second load balancing instance is a seven-layer load balancing instance, the method includes: Receive a second message from the first load balancing instance; wherein the first load balancing instance is a layer-4 load balancing instance, and the second message is obtained by replacing the source Internet Protocol IP address of the first message from the client with the first resource tenant virtual private cloud VPC address corresponding to the first load balancing instance, and replacing the destination IP address of the first message with the second resource tenant VPC address corresponding to the second load balancing instance, wherein the resource tenant VPC address belongs to an address in a VPC address pool rented by the resource tenant, and the resource tenant is allowed to access the load balancing system; Performing application layer identification processing on the second message to determine a first common tenant VPC address corresponding to the first real server; wherein the common tenant VPC address belongs to an address in a VPC address pool rented by common tenants, and the common tenant is not allowed to access the load balancing system; Send a third message to a third load balancing instance; wherein the third load balancing instance is a four-layer load balancing instance, and the third message is obtained by replacing the source IP address of the second message with the second resource tenant VPC address, and replacing the destination IP address of the second message with the third resource tenant VPC address corresponding to the third load balancing instance, and the third message carries the first common tenant VPC address. The third load balancing instance is used to send a fourth message to the first real server, and the fourth message is obtained by replacing the source IP address in the third message with the second common tenant VPC address corresponding to the third load balancing instance.

8. The method according to claim 7, characterized in that The source IP address of the third message is the second resource tenant VPC address, the destination IP address of the third message is the third resource tenant VPC address, and the option field of the third message carries the first common tenant VPC address; or, The source IP address of the inner layer message of the third message is the second resource tenant VPC address, the destination IP address of the inner layer message of the third message is the first common tenant VPC address, the source IP address of the outer layer message of the third message is the second resource tenant VPC address, the destination IP address of the outer layer message of the third message is the third resource tenant VPC address, and the outer layer message of the third message carries the first virtual network interface VNI corresponding to the first common tenant VPC address.

9. The method according to claim 8, characterized in that The option field of the third message carries the first common tenant VPC address; the source IP address of the fourth message is the second common tenant VPC address, and the destination IP address of the fourth message is the first common tenant VPC address.

10. The method according to claim 8, characterized in that The outer message of the third message carries the first VNI corresponding to the first common tenant VPC address; the source IP address of the inner message of the fourth message is the second common tenant VPC address.

11. The method according to any one of claims 7 to 10, characterized in that: The method further comprises: receiving a sixth message from the third load balancing instance; wherein the sixth message is obtained by the third load balancing instance replacing the source IP address of the fifth message from the first real server with the third resource tenant VPC address, and replacing the destination IP address of the fifth message with the second resource tenant VPC address; Send the seventh message to the first load balancing instance; wherein the seventh message is obtained by replacing the source IP address of the sixth message with the second resource tenant VPC address, and replacing the destination IP address of the sixth message with the first resource tenant VPC address, and the first load balancing instance is used to send the eighth message to the client, and the eighth message is obtained by replacing the source IP address of the seventh message with the third common tenant VPC address corresponding to the first load balancing instance.

12. The method according to claim 11, characterized in that The source IP address of the sixth message is the third resource tenant VPC address, and the destination IP address of the sixth message is the second resource tenant VPC address; or, The source IP address of the inner layer message of the sixth message is the first common tenant VPC address, the destination IP address of the inner layer message of the sixth message is the second resource tenant VPC address, the source IP address of the outer layer message of the sixth message is the third resource tenant VPC address, the destination IP address of the outer layer message of the sixth message is the second resource tenant VPC address, and the outer layer message of the sixth message carries the first VNI corresponding to the first common tenant VPC address.

13. A computing device cluster, characterized in that: comprising at least one computing device, wherein each computing device comprises a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 7 to 12.

14. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, which, when executed by a computing device cluster, enable the computing device cluster to execute the method according to any one of claims 7 to 12.

15. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 7 to 12.