Load balancing method, apparatus, device, storage medium and computer program

By sending probe messages to the back-end server at the load balancing node to obtain health and load conditions, intelligent scheduling of business traffic is realized, avoiding server overload and improving processing efficiency.

WO2024187893A1PCT designated stage expired Publication Date: 2024-09-19HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Application Number
PCT/CN2023/141405
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-15
Filing Date
2023-12-25
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

When existing load balancing methods distribute business traffic, they cannot effectively avoid back-end server overload, causing server crashes and affecting business traffic processing efficiency.

Method used

By sending probe messages to the back-end servers at the load balancing node, the health and load status of the back-end servers are obtained, and traffic scheduling is performed based on this information to ensure that traffic is only distributed to servers that are active and not overloaded.

Benefits of technology

It effectively avoids back-end server overload, improves the efficiency of business traffic processing, simplifies the steps to obtain server status, and improves the work efficiency of load balancing nodes and servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023141405_19092024_PF_FP_ABST
    Figure CN2023141405_19092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of communications. Disclosed are a load balancing method, an apparatus, a device, a storage medium and a computer program. The method comprises: a load balancing node sends a probe message to each back-end server among a plurality of back-end servers; receives echo messages sent by some or all of the plurality of back-end servers; on the basis of the received echo messages, determines a health probe result and a load probe result of each back-end server among the plurality of back-end servers; and schedules service traffic on the basis of the health probe results and the load probe results of the plurality of back-end servers. The present application determines the health probe result and the load probe result of each back-end server among the plurality of back-end servers, and schedules the service traffic on the basis of the health probe results and the load probe results of the plurality of back-end servers, so as to avoid overloading the back-end servers, thus avoiding crashes of the back-end servers and effectively ensuring the efficiency of processing the service traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Load balancing method, device, equipment, storage medium and computer program

[0001] This application claims priority to Chinese patent application number 202310250621.4, filed on March 15, 2023, entitled “Load balancing method, apparatus, device, storage medium and computer program,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a load balancing method, apparatus, device, storage medium, and computer program. Background Art

[0003] With the continuous development of computer and Internet technology, the scale of business traffic and the complexity of business logic have also developed accordingly. In order to adapt to the increasing business traffic and increasingly complex and diverse business logic, it is often necessary to use multiple back-end servers to process business traffic in order to improve business processing capabilities and business processing speed.

[0004] When processing service traffic, load balancing is typically used to distribute the traffic to the multiple backend servers. Specifically, the load balancing node sends a probe message to the multiple backend servers, determines whether the corresponding backend server is active based on the responses to the probe message, and then distributes the service traffic to the active backend server based on a traffic scheduling algorithm.

[0005] However, when the above method is used to distribute business traffic, it may cause the backend server to crash, thereby affecting the efficiency of business traffic processing.

[0006] Summary of the Invention

[0007] This application provides a load balancing method, apparatus, device, storage medium, and computer program that can solve the problem of backend server crashes in related technologies. The technical solution is as follows:

[0008] In a first aspect, a load balancing method is provided, which is applied to a load balancing node included in a cloud platform, wherein the load balancing node distributes business traffic to multiple backend servers through a load balancing strategy. The method includes: the load balancing node sends a probe message to each of the multiple backend servers, the probe message instructing the backend server to detect its own health status and load status, the load balancing node receives a reply message sent by some or all of the multiple backend servers, the reply message including the health status and load status of the corresponding backend server, the load balancing node determines a health detection result and a load detection result of each of the multiple backend servers based on the received reply message, the health detection result indicating whether the corresponding backend server is in an active state, and the load detection result indicating whether the load of the corresponding backend server is overloaded, the load balancing node determines at least one backend server in the multiple backend servers that is in an active state and not overloaded based on the health detection results and load detection results of the multiple backend servers, and the load balancing node schedules the business traffic based on the load detection result of each of the at least one backend server.

[0009] Since the health detection result of the back-end server can indicate whether the corresponding back-end server is in an active state, and the load detection result can indicate whether the load of the corresponding back-end server is overloaded, by determining the health detection result and load detection result of each back-end server among multiple back-end servers, and scheduling business traffic based on the health detection results and load detection results of the multiple back-end servers, it is possible to avoid overloading of the back-end server and then avoid crashing of the back-end server, thereby effectively ensuring the efficiency of business traffic processing.

[0010] Because the probe message can instruct the backend server to detect its own health status and load status at the same time, it can instruct the backend server to detect its own health status and load status only once, instead of sending the probe message multiple times. This can effectively simplify the steps of obtaining the health status and load status of the backend server, thereby improving the working efficiency of the backend server and the load balancing node.

[0011] Optionally, the probe message is an ICMP (Internet Control Message Protocol) message, which includes a probe type field and a load indicator field. The probe type field indicates that the ICMP message is used to detect health conditions and load conditions, and the load indicator field indicates a measurement indicator of the load condition.

[0012] Optionally, before the load balancing node sends the detection message to each of the multiple backend servers, the load balancing node also generates a detection message using a health detection script. In other words, the load balancing node is loaded with a health detection script. In this case, the load balancing node can generate the detection message using the health detection script.

[0013] Optionally, before the load balancing node generates a detection message through the health detection script, the load balancing node needs to obtain and load the health detection script. In actual applications, the measurement indicators used to detect the load conditions of the back-end server can be fixed or adjusted according to different needs. In other words, these measurement indicators can be fixed or dynamically changing. When the measurement indicators are fixed, the health detection script used to generate the detection message is also fixed. When the measurement indicators change dynamically, the health detection script used to generate the detection message is also dynamically changing. Therefore, for dynamically changing measurement indicators, different detection messages can be generated through different health detection scripts, thereby realizing load detection for different needs, avoiding changes to the implementation logic of the load balancing node, and only needing to load different health detection scripts to achieve it. In different situations, the load balancing node obtains the health detection script in different ways.

[0014] When the load condition measurement index remains unchanged, the load balancing node stores a health detection script, and the load balancing node can directly obtain the health detection script. Optionally, the cloud platform also includes a load balancing management node, which is used to manage the load balancing nodes included in the cloud platform. In this case, the load balancing management node stores a health detection script, and the load balancing management node can send the stored health detection script to the load balancing node, so that the load balancing node can obtain the health detection script sent by the load balancing management node. In other words, when the load condition measurement index remains unchanged, the health detection script can be pre-stored in the load balancing node or sent by the load balancing management node.

[0015] When load indicators change dynamically, there are multiple ways to implement the load balancing node to obtain the health detection script. The following describes two of these implementation methods.

[0016] In a first implementation manner, the load balancing node generates a health detection script based on at least one load indicator, where the at least one load indicator is a measurement indicator of the load situation.

[0017] In a second implementation, the load balancing management node generates a health detection script based on at least one load indicator, and then sends the health detection script to the load balancing node. The at least one load indicator is a measurement indicator of the load situation.

[0018] Optionally, the load balancing management node can generate a health detection script based on at least one load indicator and send the health detection script to the load balancing node, and can also generate a backend server script based on at least one load indicator and send the backend server script to the backend server. Therefore, before the load balancing node generates a detection message through the health detection script, the load balancing management node can receive at least one load indicator sent by the client, and the load balancing management node generates a health detection script and a backend server script based on the at least one load indicator. The backend server script is used to parse the detection message and generate a response message. The load balancing management node sends the health detection script to the load balancing node and sends the backend server script to the client to instruct the client to load the backend server script into the multiple backend servers.

[0019] Since the backend server scripts and health detection scripts are generated and sent by the load balancing management node, the backend server and the load balancing management node can save computing power, thereby effectively improving the work efficiency of the backend server and the load balancing node.

[0020] The load balancing node parses the received response message based on the health detection script, and determines the health detection result and load detection result of each backend server that sends the response message based on the parsing result.

[0021] In actual applications, due to network link failures, unreachable backend servers, and other reasons, the load balancing node may be unable to receive response messages from some backend servers. In this case, the load balancing node may only receive response messages from some of the backend servers. Furthermore, due to network latency and other factors, even if the load balancing node receives a response message from a backend server, the response message may time out. Therefore, in different situations, the load balancing node determines the health detection status and load detection results of each of the multiple backend servers based on the received response messages in different ways, which will be explained below.

[0022] For each of the multiple back-end servers, if a response message sent by the back-end server is not received, or the response message sent by the back-end server is received within a timeout, the health detection result of the back-end server is determined to be inactive, and the load detection result is determined to be empty. If a response message sent by the back-end server is not received within a timeout, and the detection result field in the response message indicates that the connectivity of the target port is disconnected, the health detection result of the back-end server is determined to be inactive, and the load detection result is determined to be empty. Otherwise, the health detection result of the back-end server is determined to be active, and the load detection result is determined to be the load condition indicated by the detection result field in the response message.

[0023] The backend servers whose health detection results are active are determined as the backend servers in the active state. Based on the load detection results of the backend servers in the active state, at least one backend server in the multiple backend servers is determined to be active and not overloaded.

[0024] The implementation process of determining at least one backend server in an active state and not overloaded among multiple backend servers based on the load detection results of the backend servers in an active state includes: determining the load weight of at least one backend server in an active state among the multiple backend servers based on the load detection results of the backend servers in an active state; and determining at least one backend server in an active state and not overloaded among the multiple backend servers based on the load weight of at least one backend server in an active state.

[0025] For any one of the at least one active backend servers, at least one detection parameter can be determined based on the load detection result of the backend server. The at least one detection parameter corresponds one-to-one with the at least one load indicator. Based on the at least one detection parameter, the load weight of the backend server can be determined. After processing each active backend server in the same manner, the load weight of the at least one active backend server can be determined.

[0026] Load indicators include memory usage, CPU usage, number of running processes, system response time, etc. Therefore, the load detection result includes the detection result corresponding to each load indicator in at least one load indicator. The load indicator indicates the load situation of the back-end server in different dimensions, that is, the units of the detection results corresponding to different load indicators are different. Therefore, converting the load situation of the back-end server in different dimensions to the same dimension can make it easier to determine the load weight later. In addition, since the units of the detection results corresponding to different load indicators are different, the method of converting the detection results corresponding to the load indicators is different for different load indicators, which will be introduced in turn below.

[0027] When the load indicator is memory usage, since the unit of the detection result corresponding to the memory usage is a percentage (or ratio), the detection result corresponding to the memory usage can be directly used as the detection parameter corresponding to the memory usage.

[0028] When the load indicator is CPU occupancy, since the unit of the detection result corresponding to the CPU occupancy is a percentage (or ratio), the detection result corresponding to the CPU occupancy can be directly used as the detection parameter corresponding to the CPU occupancy.

[0029] When the load indicator is the number of TCP connections, the value obtained by dividing the detection result corresponding to the number of TCP connections by the maximum number of connections is used as the detection parameter corresponding to the number of TCP connections.

[0030] In the case where the load indicator is the number of running processes, the value obtained by dividing the detection result corresponding to the number of running processes by the maximum number of processes is used as the detection parameter corresponding to the number of running processes.

[0031] When the load indicator is system response time, if the detection result corresponding to the system response time is less than the response time threshold, the detection parameter corresponding to the system response time is determined to be 0; if the detection result corresponding to the system response time is greater than or equal to the response time threshold, the value obtained by subtracting the response time threshold from the detection result corresponding to the system response time and dividing it by the response time threshold is used as the detection parameter corresponding to the system response time.

[0032] Among them, the maximum number of connections is set in advance. The maximum number of connections corresponding to different backend servers may be the same or different. The maximum number of connections is the maximum number of TCP connections that the corresponding backend server can connect to. The maximum number of processes is set in advance. The maximum number of processes corresponding to different backend servers may be the same or different. The maximum number of processes is the maximum number of processes that the corresponding backend server can run. The response time threshold is set in advance. The response time thresholds corresponding to different backend servers may be the same or different. It is related to the performance of the corresponding backend server. The better the performance of the backend server, the smaller the response time threshold. Of course, different backend servers can also correspond to the same response time threshold. The load weight threshold is set in advance and can be adjusted according to different needs in different situations.

[0033] By converting the detection results corresponding to each load indicator in at least one load indicator, at least one detection parameter can be obtained. At this time, the largest detection parameter among the at least one detection parameter can be used as the load weight of the back-end server. Optionally, the load balancing node stores the correspondence between load indicators and indicator weights. The load balancing node can determine the indicator weight corresponding to each detection parameter from the correspondence between load indicators and indicator weights, and add the values ​​after multiplying the at least one detection parameter by the corresponding indicator weight to obtain the load weight of the back-end server.

[0034] A backend server whose load weight is less than a load weight threshold among the at least one backend server in an active state is determined as at least one backend server in an active state and not overloaded among the multiple backend servers.

[0035] The load balancing node determines the load weight of each backend server among the multiple backend servers based on the load detection result of at least one backend server that is active and not overloaded. The load weight indicates the load condition of the corresponding backend server. The load balancing node schedules the business traffic based on the load weight of at least one backend server.

[0036] Based on the above description, traffic scheduling algorithms include round-robin, random, weighted, and minimum connection algorithms. These various traffic scheduling algorithms can be divided into two types: those that perform scheduling based on scheduling weights and those that do not. The method provided in this application can be combined with the above scheduling algorithms. Different types of traffic scheduling algorithms can be combined with this application in different ways, which will be introduced below.

[0037] If the type of traffic scheduling algorithm is an algorithm that performs scheduling based on scheduling weights, in this case, the load balancing node adjusts the scheduling weights of the first type of backend servers based on the load weights of at least one backend server that is active and not overloaded among multiple backend servers to reduce the scheduling priority of the first type of backend servers. The first type of backend servers are backend servers whose load weights are greater than or equal to the load threshold, and the scheduling weight indicates the scheduling priority of the corresponding backend servers. The load balancing node schedules the business traffic according to the algorithm that performs scheduling based on scheduling weights based on the scheduling weights of the second type of backend servers in at least one backend server and the adjusted scheduling weights of the first type of backend servers. The second type of backend servers are backend servers whose load weights are less than the load threshold.

[0038] For each backend server in the first category of backend servers, the load balancing node can multiply the value obtained by subtracting the load weight of the backend server from 1 by the scheduling weight of the backend server to obtain the adjusted scheduling weight of the backend server. Of course, the adjusted scheduling weight of the backend server can also be determined as the difference between the value obtained by multiplying the load weight of the backend server by 100 and the scheduling weight of the backend server.

[0039] It should be noted that the scheduling weight is set in advance and is related to the performance of the corresponding backend server.

[0040] If the type of traffic scheduling algorithm is an algorithm that is not based on scheduling weights, in this case, the load balancing node selects a second type of backend server from the at least one backend server based on the load weight of at least one backend server that is active and not overloaded among the multiple backend servers. The second type of backend server is a backend server whose load weight is less than the load threshold. The load balancing node schedules the business traffic based on the second type of backend server according to the algorithm that is not based on scheduling weights.

[0041] The load balancing method provided in this application is combined with the traffic scheduling algorithm to effectively solve the problem of back-end server overload, that is, to improve the efficiency of business traffic processing without increasing additional hardware and software costs.

[0042] In the second aspect, a load balancing method is provided, which is applied to a back-end server. The load balancing node included in the cloud platform distributes business traffic to multiple back-end servers through a load balancing strategy. The method includes: the back-end server receives a detection message sent by the load balancing node, and the detection message instructs the back-end server to detect its own health status and load status. The back-end server determines its own health status and load status based on the detection message. The back-end server generates a response message based on its own health status and load status, and the response message includes the health status and the load status. The back-end server sends the response message to the load balancing node.

[0043] Optionally, the backend server determines its own health and load conditions based on the detection message through a loaded backend server script, and generates the response message based on its own health and load conditions through the backend server script.

[0044] The backend server script can instruct the backend server to determine the connectivity of the target port. The target port refers to the port used by the backend server to process business traffic. The connectivity of the target port can indicate whether the target port is connected or disconnected. In this case, the backend server determines the connectivity of the target port by running the backend server script, and determines its own health status based on the connectivity of the target port. If the target port is connected, the health status of the server is determined to be healthy; if the target port is disconnected, the health status of the server is determined to be unhealthy.

[0045] If the target port is connected, it means that the target server can handle business traffic normally, so the server's health can be determined to be healthy. If the target port is disconnected, it means that the target server cannot handle business traffic normally, so the server's health can be determined to be unhealthy. Of course, you can also directly determine the health of the server based on the target port's connectivity.

[0046] The backend server script can instruct the backend server to determine its own load condition according to at least one load indicator indicated by the load indicator field of the probe message. In this case, the backend server can determine its own load condition by running the backend server script.

[0047] Before the backend server determines its own health and load conditions, the backend server needs to obtain and load the backend server script. Similarly, the measurement indicators used to detect the load conditions of the backend server can be fixed or adjusted according to different needs. In other words, these measurement indicators can be fixed or dynamically changing. When the measurement indicators are fixed, the backend server script used to determine the load conditions of the backend server is also fixed. When the measurement indicators change dynamically, the backend server script used to determine the load conditions of the backend server also changes dynamically. Therefore, for dynamically changing measurement indicators, different backend server scripts can be used to determine the load conditions of the backend server, thereby realizing load detection for different needs, avoiding changes to the implementation logic of the backend server, and only needing to load different backend servers to achieve it. In different situations, the way the backend server obtains the backend server script is different.

[0048] In the case where the load condition measurement index remains unchanged, the back-end server stores a back-end server script. In this case, the back-end server can directly obtain and load the back-end server script. Optionally, the cloud platform also includes a load balancing management node, which is used to manage the load balancing nodes included in the cloud platform. In this case, the load balancing management node stores a back-end server script, and the load balancing management node can send the stored back-end server script to the client to instruct the client to load the back-end server script to multiple back-end servers. In this way, the back-end server can obtain the back-end server script sent by the load balancing management node. That is to say, in the case where the load condition measurement index remains unchanged, the back-end server script can be pre-stored in the back-end server or sent by the load balancing management node.

[0049] When load metrics dynamically change, there are multiple implementations for a backend server to obtain a backend server script. Two of these implementations are described below. In the first implementation, the backend server generates a backend server script based on at least one load metric, where the at least one load metric is a load metric. In the second implementation, the load balancing management node generates a backend server script based on at least one load metric, and then sends the backend server script to the client or backend server. The at least one load metric is a load metric.

[0050] In a third aspect, a cloud platform is provided, which includes a load balancing node, and the load balancing node is used to implement the load balancing method described in the first aspect.

[0051] In a fourth aspect, a backend server is provided, which is used to implement the load balancing method described in the second aspect.

[0052] In a fifth aspect, a computing device cluster is provided, wherein the computing device cluster includes at least one computing device, each computing device includes a processor and a memory, and the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the load balancing method provided by the first aspect above.

[0053] Optionally, each computing device may further include a communication bus, which is used to establish a connection between the processor and the memory of each computing device.

[0054] In a sixth aspect, a backend server is provided, comprising a processor and a memory, wherein the memory is configured to store a computer program for executing the load balancing method provided in the second aspect. The processor is configured to execute the computer program stored in the memory to implement the load balancing method described in the second aspect.

[0055] Optionally, the back-end server may further include a communication bus, which is used to establish a connection between the processor and the memory.

[0056] In a seventh aspect, a computer-readable storage medium is provided, wherein the storage medium stores instructions. When the instructions are executed on a computing device cluster, the computing device cluster executes the steps of the load balancing method described in the first aspect.

[0057] In an eighth aspect, a computer-readable storage medium is provided, wherein the storage medium stores instructions. When the instructions are executed on a back-end server, the back-end server executes the steps of the load balancing method described in the second aspect.

[0058] In a ninth aspect, a computer program product comprising instructions is provided. When the instructions are executed on a computing device cluster, the computing device cluster executes the steps of the load balancing method described in the first aspect.

[0059] In a tenth aspect, a computer program product comprising instructions is provided. When the instructions are executed on a back-end server, the back-end server executes the steps of the load balancing method described in the second aspect.

[0060] The technical effects obtained in the above-mentioned second to tenth aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] FIG1 is a schematic diagram of a load balancing method provided in an embodiment of the present application;

[0062] FIG2 is a schematic diagram of an implementation environment shown in an embodiment of the present application;

[0063] FIG3 is a flow chart of a load balancing method provided in an embodiment of the present application;

[0064] FIG4 is a schematic diagram of an ICMP message provided in an embodiment of the present application;

[0065] FIG5 is a schematic diagram of a load indicator selection interface provided in an embodiment of the present application;

[0066] FIG6 is a flow chart of another load balancing method provided in an embodiment of the present application;

[0067] FIG7 is an architecture diagram of a cloud platform provided in an embodiment of the present application;

[0068] FIG8 is a schematic structural diagram of a computer device provided in an embodiment of the present application;

[0069] FIG9 is an architecture diagram of a computing device cluster provided in an embodiment of the present application;

[0070] FIG10 is a schematic diagram of a connection between computing devices provided in an embodiment of the present application;

[0071] FIG11 is a schematic diagram of the structure of a load balancing node provided in an embodiment of the present application;

[0072] FIG12 is a schematic structural diagram of a load balancing management node provided in an embodiment of the present application;

[0073] FIG13 is a schematic structural diagram of a back-end server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0075] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0076] For ease of understanding, before explaining in detail the load balancing method provided in the embodiment of the present application, the application scenarios and implementation environment involved in the embodiment of the present application are first introduced.

[0077] With the continuous development of computer and Internet technology, the scale of business traffic and the complexity of business logic have also developed accordingly. In order to adapt to the increasing business traffic and increasingly complex and diverse business logic, it is often necessary to use multiple back-end servers to process business traffic in order to improve business processing capabilities and business processing speed.

[0078] When processing service traffic, load balancing is typically used to distribute the traffic to the multiple backend servers. Specifically, referring to Figure 1, a load balancing node sends a probe message to the multiple backend servers and determines whether the corresponding backend server is active based on the responses of the multiple backend servers to the probe message. After the service traffic is transmitted to the load balancing node via the network, the load balancing node can distribute the service traffic to the active backend servers based on a traffic scheduling algorithm.

[0079] These traffic scheduling algorithms typically include round-robin, random, weighted, and minimum connection algorithms, among others. The round-robin algorithm refers to forwarding service traffic to active backend servers in sequence and in turn. The random algorithm refers to randomly distributing service traffic to active backend servers. The weighted algorithm sets a corresponding scheduling weight for each backend server based on its performance. Backend servers with good performance are usually assigned a larger weight value, while backend servers with poor performance are usually assigned a smaller weight value, so that backend servers with larger weights can handle more service traffic. The minimum connection algorithm distributes service traffic to the backend server with the least current connections among the active backend servers.

[0080] However, the above method can only determine whether the back-end server is active, but cannot determine the load situation of the back-end server. If the load of the back-end server is very high, and the business traffic is still distributed to the high-load back-end server, the back-end server will be overloaded, and eventually the back-end server will crash, thereby affecting the efficiency of business traffic processing. Based on this, an embodiment of the present application provides a load balancing method, which can determine the health detection result and load detection result of each back-end server in the multiple back-end servers, and schedule the business traffic based on the health detection results and load detection results of the multiple back-end servers. Since the health detection result of the back-end server can indicate whether the corresponding back-end server is in an active state, and the load detection result can indicate whether the load of the corresponding back-end server is overloaded, by determining the health detection result and load detection result of each back-end server in the multiple back-end servers, and scheduling the business traffic based on the health detection results and load detection results of the multiple back-end servers, it is possible to avoid overloading of the back-end server, and then avoid crashing of the back-end server, thereby effectively ensuring the efficiency of business traffic processing.

[0081] Please refer to Figure 2, which is a schematic diagram of an implementation environment shown in an embodiment of the present application. The implementation environment includes a load balancing node 201 and multiple backend servers 202 (three backend servers are schematically illustrated in Figure 2). Optionally, the implementation environment also includes a load balancing management node 203. The load balancing node 201 and the load balancing management node 203 belong to the cloud platform. The load balancing node can distribute business traffic to multiple backend servers 202 through a load balancing strategy. The load balancing management node 203 is used to manage the load balancing nodes 201 included in the cloud platform.

[0082] The load balancing node 201 is in communication connection with the backend server 202, and the load balancing node 201 is in communication connection with the load balancing management node 203. The communication connection can be a wired or wireless connection, which is not limited in the embodiment of the present application.

[0083] The load balancing node 201 sends a probe message to each of the multiple backend servers 202. The backend server 202 receives the probe message sent by the load balancing node 201 and determines its own health and load status based on the probe message to obtain a health detection result and a load detection result. The backend server 202 then generates a response message based on the health detection result and the load detection result. The backend server 202 sends the response message to the load balancing node. The load balancing node 201 receives the response messages sent by some or all of the multiple backend servers 202 and, based on the received response messages, determines the health detection result and the load detection result of each of the multiple backend servers 202. The backend server 202 then schedules the service traffic based on the health detection results and the load detection results of the multiple backend servers 202.

[0084] Optionally, the implementation environment further includes a load balancing management node 203. In this case, the user who uses the load balancing node to distribute service traffic can be referred to as a first user or tenant. The first user can determine at least one load indicator on the client and send the at least one load indicator to the load balancing management node 203. The load balancing management node 203 can receive the at least one load indicator sent by the client and generate a health detection script and a backend server script based on the at least one load indicator. The load balancing management node 203 sends the health detection script to the load balancing node 201 and sends the backend server script to the client to instruct the client to load the backend server script to multiple backend servers 202. The load balancing node 201 can receive the health detection script and generate a detection message using the health detection script.

[0085] Among them, the back-end server 202 can be an independent server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, or a cloud computing service center. It can also be a virtual machine, physical machine, container, etc., and the embodiments of the present application do not limit this.

[0086] A cloud platform can be a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or it can be a cloud computing service center.

[0087] It should be noted that the load balancing node 201 and the load balancing management node 203 can be the same node or two different nodes, and this embodiment of the application does not limit this. The multiple back-end servers 202 can belong to the same cloud platform as the load balancing node 201 and the load balancing management node 203, or they can belong to different cloud platforms, and this embodiment of the application does not limit this.

[0088] Those skilled in the art should understand that the above-mentioned load balancing node 201, back-end server 202, load balancing management node 203 and cloud platform are only examples. Other existing or future load balancing nodes, back-end servers, load balancing management nodes and cloud platforms that are applicable to the embodiments of the present application should also be included in the scope of protection of the embodiments of the present application and are included here by reference.

[0089] It should be noted that the application scenarios and implementation environments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0090] FIG3 is a flow chart of a load balancing method provided by an embodiment of the present application, which is applied to a load balancing node included in a cloud platform, and the load balancing node distributes business traffic to multiple backend servers through a load balancing strategy. Referring to FIG3 , the method includes the following steps.

[0091] Step 301: The load balancing node sends a detection message to each of the multiple backend servers. The detection message instructs the backend server to detect its own health status and load status.

[0092] Because the probe message sent by the embodiment of the present application can instruct the backend server to detect its own health status while also instructing the backend server to detect its own load status, the embodiment of the present application does not need to send the probe message multiple times. Instead, it only needs to send the probe message once to instruct the backend server to detect its own health status and load status. This can effectively simplify the steps of obtaining the health status and load status of the backend server, thereby improving the working efficiency of the backend server and the load balancing node.

[0093] In some embodiments, the probe message is an ICMP (Internet Control Message Protocol) message, which includes a probe type field and a load index field. The probe type field indicates that the ICMP message is used to detect health conditions and load conditions, and the load index field indicates a load condition measurement indicator. Of course, in actual applications, the probe message can also be other types of messages, such as HTTP (Hyper Text Transfer Protocol) messages, which are not limited in the embodiments of the present application. For ease of description, the following text will take the probe message as an ICMP message as an example for introduction.

[0094] As an example, please refer to Figure 4. The ICMP message in Figure 4 includes a type (Type) field, a code (Code) field, a checksum (Checksum) field and a payload (Payload) field. The Type field and the Code field can be used as detection type fields to indicate that the ICMP message currently needs to detect the health and load conditions of the back-end server. The Payload field can be used as a load indicator field to indicate the measurement indicator of the load condition that needs to be detected. The Checksum field represents the checksum of the ICMP message.

[0095] The ICMP message can be an ICMP message based on IPv4 (Internet Protocol version 4) or IPv6 (Internet Protocol version 6). In ICMP messages of different protocols, the Type field and Code field can have different values ​​to indicate the health and load of the backend server that needs to be detected.

[0096] For example, as shown in Table 1 below, in an IPv4-based ICMP message, the Type field value is 44 and the Code field value is 0. The values ​​of the Type and Code fields indicate the need to detect the health and load of the backend server. The content of the Payload field is the content shown in the second row, third column of Table 1, instructing the backend server to detect its own CPU usage and TCP connection status, etc.

[0097] Table 1

[0098] As shown in Table 2 below, in an IPv6-based ICMP message, the Type field value is 244 and the Code field value is 0. The values ​​of the Type and Code fields indicate the need to detect the health and load of the backend server. The content of the Payload field is the content shown in the second row, third column of Table 2, instructing the backend server to detect its own CPU usage and TCP connection status, etc.

[0099] Table 2

[0100] In some embodiments, before the load balancing node sends a probe message to each of the multiple back-end servers, the load balancing node also generates a probe message through a health probe script. That is to say, the load balancing node is loaded with a health probe script. In this case, the load balancing node can generate a probe message through the health probe script. Of course, in actual applications, the load balancing node can also generate a probe message in other ways. For example, the load balancing node stores a logic code for generating a probe message, and the load balancing node can generate a probe message through the logic code. The embodiments of the present application do not limit this. For ease of description, the following text will take the example of the load balancing node generating a probe message through a health probe script as an example.

[0101] In some embodiments, before the load balancing node generates a detection message through the health detection script, the load balancing node needs to obtain and load the health detection script. In actual applications, the measurement indicators used to detect the load conditions of the back-end server can be fixed or adjusted according to different needs. In other words, these measurement indicators can be fixed or dynamically changing. In the case where the measurement indicators are fixed, the health detection script used to generate the detection message is also fixed. In the case where the measurement indicators change dynamically, the health detection script used to generate the detection message is also dynamically changing. Therefore, for dynamically changing measurement indicators, different detection messages can be generated through different health detection scripts, thereby realizing load detection of different needs, avoiding changes to the implementation logic of the load balancing node, and only needing to load different health detection scripts to achieve it. In different situations, the load balancing node obtains the health detection script in different ways.

[0102] In the case where the load condition measurement index remains unchanged, in some embodiments, the load balancing node stores a health detection script. In this case, the load balancing node can directly obtain the health detection script. In other embodiments, the cloud platform also includes a load balancing management node, which is used to manage the load balancing nodes included in the cloud platform. In this case, the load balancing management node stores a health detection script, and the load balancing management node can send the stored health detection script to the load balancing node. In this way, the load balancing node can obtain the health detection script sent by the load balancing management node. In other words, in the case where the load condition measurement index remains unchanged, the health detection script can be pre-stored in the load balancing node or sent by the load balancing management node.

[0103] When load indicators change dynamically, there are multiple ways to implement the load balancing node to obtain the health detection script. The following describes two of these implementation methods.

[0104] In a first implementation manner, the load balancing node generates a health detection script based on at least one load indicator, where the at least one load indicator is a measurement indicator of the load situation.

[0105] The load balancing node stores a correspondence between load indicators and health detection subscripts, with one load indicator corresponding to one health detection subscript. In this case, based on the at least one load indicator, the load balancing node determines the health detection subscript corresponding to each load indicator in the at least one load indicator from the correspondence between the load indicators and the health detection subscripts, and sequentially superimposes the health detection subscripts corresponding to each load indicator to obtain a health detection script. In other words, when the load balancing node stores a correspondence between load indicators and health detection subscripts, it is possible to combine the health detection subscripts corresponding to each load indicator in the at least one load indicator to obtain a health detection script.

[0106] In actual applications, health detection scripts can also be generated in other ways, which are not limited in the embodiments of the present application. For example, the load balancing node can also store multiple load indicator sets, and candidate health detection scripts corresponding to each load indicator set. The load balancing node can determine the load indicator set corresponding to the at least one load indicator from the multiple load indicator sets, and determine the candidate health detection script corresponding to the load indicator set as the health detection script. That is, the load balancing node stores the candidate health detection script corresponding to the load indicator set in advance, so that the candidate health detection script corresponding to the load indicator set consistent with the at least one load indicator in the multiple load indicator sets can be used as the health detection script.

[0107] In some embodiments, before the load balancing node generates a health detection script based on the at least one load indicator, the load balancing node can receive the at least one load indicator sent by the client.

[0108] As an example, a client displays a load indicator selection interface that includes multiple load indicators. In response to a load indicator selection completion operation, the client sends at least one selected load indicator to the load balancing node. That is, after the client displays the load indicator selection interface, a first user selects at least one load indicator on the load indicator selection interface. After completing the selection, the first user triggers the load indicator selection completion operation. In response to the load indicator selection completion operation triggered by the first user, the client determines the at least one load indicator selected by the first user and then sends the at least one load indicator to the load balancing node.

[0109] Among them, load indicators include memory usage, CPU (central processing unit) usage, number of running processes, system response time, number of TCP (transmission control protocol) connections, etc., which are not limited in the embodiments of the present application.

[0110] For example, please refer to Figure 5. The client displays the load indicator selection interface as shown in Figure 5. The load indicator selection interface displays five load indicators, namely memory usage, CPU usage, number of running processes, system response time and number of TCP connections. The first user can select at least one load indicator in the load indicator selection interface. After the selection is completed, the first user triggers the load indicator selection completion operation by clicking the OK button.

[0111] It should be noted that the load indicator field of the above detection message can indicate at least one load indicator sent by the client, so as to instruct the backend server to detect its own load condition according to the at least one load indicator.

[0112] In addition, in an embodiment of the present application, the system response time can be determined by the back-end server or by the load balancing node. In different situations, the meaning represented by the system response time is different. If the system response time is determined by the back-end server, the back-end server can use the time length between the moment of receiving the probe message sent by the load balancing node and the moment of sending the response message as the system response time. If the system response time is determined by the load balancing node, for a back-end server among the multiple back-end servers, the load balancing node can use the time length between the moment of sending the probe message and the moment of receiving the response message sent by the back-end server as the system response time.

[0113] In the above content, the first user can select at least one load indicator on the client, and then the client can send the at least one load indicator to the load balancing node, and the load balancing node can receive the at least one load indicator. Of course, in actual applications, at least one load indicator can also be obtained by other means, and the embodiments of the present application are not limited to this. For example, the cloud platform can also include a load balancing management node. In this case, the client can send the at least one load indicator to the load balancing management node, and the load balancing management node can forward the at least one load indicator to the load balancing node.

[0114] In a second implementation, the load balancing management node generates a health detection script based on at least one load indicator, and then sends the health detection script to the load balancing node. The at least one load indicator is a measurement indicator of the load situation.

[0115] The implementation process of the load balancing management node generating a health detection script based on at least one load indicator is similar to the implementation process of the above-mentioned load balancing node generating a health detection script based on at least one load indicator. For details, please refer to the relevant content above and will not be repeated here.

[0116] In some embodiments, before the load balancing management node generates a health detection script based on the at least one load indicator, the load balancing management node can receive the at least one load indicator sent by the client.

[0117] The implementation process of the load balancing management node receiving at least one load indicator sent by the client is similar to the implementation process of the load balancing node receiving at least one load indicator sent by the client above. For details, please refer to the relevant content above and will not be repeated here.

[0118] In summary, when load condition metrics dynamically change, the health detection script can be generated by the load balancing node based on at least one load metric, or generated by the load balancing management node based on at least one load metric and sent to the load balancing node. Of course, in practical applications, health detection scripts can also be obtained through other methods, which are not limited in this embodiment of the present application.

[0119] It should be noted that the health detection script can be an extended Berkeley packet filter (ebpf) script. Of course, it can also be other types of scripts, which is not limited in the embodiment of the present application.

[0120] Step 302: The backend server receives the detection message sent by the load balancing node, and determines its own health status and load status based on the detection message.

[0121] Based on the detection message, the back-end server determines its own health status and load status through the back-end server script. Of course, in actual applications, the back-end server can also determine its own health status and load status through other means. For example, the back-end server stores logic code for determining its own health status and load status, and the back-end server can determine its own health status and load status through this logic code. This embodiment of the present application does not limit this. For ease of description, the following text will use the example of the back-end server determining its own health status and load status through the back-end server script as an example.

[0122] Because the Probe Type field included in a probe message can have different values, and these different values ​​correspond to different functions of the probe message, the backend server needs to respond differently to probe messages with different functions. To determine the function of the probe message, in some embodiments, if the value of the Probe Type field included in the probe message is a target value, the backend server can run the backend server script. If the value of the Probe Type field included in the probe message is not the target value, the backend server does not run the backend server script.

[0123] If the value of the Probe Type field included in the probe message is the target value, it means that the probe message is used to detect health and load conditions. In this case, the backend server can run the backend server script and determine its own health and load conditions through the backend server script. If the value of the Probe Type field included in the probe message is not the target value, it means that the probe message is not used to detect health and load conditions. In this case, the backend server does not run the backend server script.

[0124] Among them, the target value is set in advance and is consistent with the value of the detection type field included in the detection message that instructs the back-end server to detect its own health and load conditions. For example, the detection message is an ICMP message based on IPv4, and the value of the Type field is 44, and the value of the Code field is 0. In this case, the target value includes a first value and a second value, wherein the first value is 44 and the second value is 0. If the value of the Type field included in the detection message is the first value and the value of the Code field is the second value, then the value of the detection type field included in the detection message is determined to be the target value. For another example, the detection message is an ICMP message based on IPv6, and the value of the Type field is 244, and the value of the Code field is 0. In this case, the target value includes a first value and a second value, wherein the first value is 244 and the second value is 0. If the value of the Type field included in the detection message is the first value and the value of the Code field is the second value, then the value of the detection type field included in the detection message is determined to be the target value.

[0125] In some embodiments, a backend server script can instruct the backend server to determine the connectivity of a target port, where the target port refers to a port used by the backend server to process service traffic. The connectivity of the target port can indicate whether the target port is connected or not. In this case, the backend server determines the connectivity of the target port by running the backend server script, and determines its own health based on the connectivity of the target port.

[0126] If the target port is connected, the health condition of the device is determined to be healthy; if the target port is disconnected, the health condition of the device is determined to be unhealthy.

[0127] If the target port is connected, it means that the target server can process business traffic normally, so the health of the target server can be determined to be healthy. If the target port is disconnected, it means that the target server cannot process business traffic normally, so the health of the target server can be determined to be unhealthy. Of course, in other embodiments, the connectivity of the target port can also be directly determined as the health of the target server, and this embodiment of the application is not limited to this.

[0128] In some embodiments, the backend server script can also instruct the backend server to determine its own load situation according to at least one load indicator indicated by the load indicator field of the detection message. In this case, the backend server can determine its own load situation by running the backend server script.

[0129] It should be noted that the backend server script may not instruct the backend server to determine the connectivity of the target port. In this case, the backend server can determine its own load condition after receiving the detection message without determining its own health condition, and then generate a response message based on its own load condition in the subsequent steps. That is to say, when the backend server script does not instruct the backend server to determine the connectivity of the target port, the backend server can directly generate a response message after determining its own load condition. When the backend server script instructs the backend server to determine the connectivity of the target port, the backend server needs to determine the connectivity of the target port and its own load condition, and then generate a response message based on the connectivity of the target port and its own load condition in the subsequent steps.

[0130] In some embodiments, before the back-end server determines its own health and load conditions, the back-end server needs to obtain and load the back-end server script. In the same way as above, the measurement indicators used to detect the load conditions of the back-end server can be fixed or adjusted according to different needs. In other words, these measurement indicators can be fixed or dynamically changing. When the measurement indicators are fixed, the back-end server script used to determine the load conditions of the back-end server is also fixed. When the measurement indicators change dynamically, the back-end server script used to determine the load conditions of the back-end server is also dynamically changing. Therefore, for dynamically changing measurement indicators, different back-end server scripts can be used to determine the load conditions of the back-end server, thereby realizing load detection for different needs, avoiding changes to the implementation logic of the back-end server, and only needing to load different back-end servers to achieve it. In different situations, the way the back-end server obtains the back-end server script is different.

[0131] In the case where the load condition measurement index remains unchanged, in some embodiments, the back-end server stores a back-end server script. In this case, the back-end server can directly obtain and load the back-end server script. In other embodiments, the cloud platform also includes a load balancing management node, which is used to manage the load balancing nodes included in the cloud platform. In this case, the load balancing management node stores a back-end server script, and the load balancing management node can send the stored back-end server script to the client to instruct the client to load the back-end server script to multiple back-end servers. In this way, the back-end server can obtain the back-end server script sent by the load balancing management node. That is to say, in the case where the load condition measurement index remains unchanged, the back-end server script can be pre-stored in the back-end server or sent by the load balancing management node.

[0132] If the load balancing management node does not have permission to load the backend server script into the backend server, the load balancing management node can send the generated backend server script to the client, and the first user can download the backend server script from the client and then load the backend server script into the backend server. If the load balancing management node has permission to load the backend server script into the backend server, the load balancing management node can directly send the backend server script to the backend server and instruct the backend server to load the backend server script.

[0133] Optionally, after downloading the backend server script, the first user can verify the backend server script to determine whether the backend server script is safe and reliable. If the first user determines that the backend server script is safe and reliable, the first user can load the backend server script into the backend server.

[0134] In actual applications, the multiple back-end servers can be managed by a back-end server management system. In this case, if the load balancing management node does not have the authority to load the back-end server script into the back-end server, the first user can send the back-end server script to the back-end server management system, and the back-end server management system can then distribute the back-end server script to the multiple back-end servers. If the load balancing management node has the authority to load the back-end server script into the back-end server, the load balancing management node can directly send the back-end server script to the back-end server management system, and the back-end server management system can then distribute the back-end server script to the multiple back-end servers.

[0135] When load indicators change dynamically, there are multiple ways to enable the backend server to obtain the backend server script. Two of these methods are introduced below.

[0136] In a first implementation manner, the back-end server generates a back-end server script based on at least one load indicator, where the at least one load indicator is a measurement indicator of the load situation.

[0137] The backend server stores a correspondence between load indicators and backend server sub-scripts, with each load indicator corresponding to one backend server sub-script. In this case, based on the at least one load indicator and the correspondence between the load indicators and the backend server sub-scripts, the backend server determines the backend server sub-script corresponding to each load indicator in the at least one load indicator, and sequentially superimposes the backend server sub-scripts corresponding to each load indicator to obtain a backend server script. In other words, if the backend server stores a correspondence between load indicators and backend server sub-scripts, the backend server sub-scripts corresponding to each load indicator in the at least one load indicator can be combined to obtain a backend server script.

[0138] In actual applications, the back-end server script can also be generated by other means, which is not limited in the embodiments of the present application. For example, the back-end server can also store multiple load indicator sets, and candidate back-end server scripts corresponding to each load indicator set. The back-end server can determine the load indicator set corresponding to the at least one load indicator from the multiple load indicator sets, and determine the candidate back-end server script corresponding to the load indicator set as the back-end server script. That is, the back-end server stores the candidate back-end server script corresponding to the load indicator set in advance, so that the candidate back-end server script corresponding to the load indicator set consistent with the at least one load indicator in the multiple load indicator sets can be used as the back-end server script.

[0139] In some embodiments, when the client has permission to send at least one load indicator to the backend server, the backend server is able to receive at least one load indicator sent by the client before generating a backend server script based on the at least one load indicator.

[0140] As an example, a client displays a load indicator selection interface that includes multiple load indicators. In response to a load indicator selection completion operation, the client sends at least one selected load indicator to a backend server. That is, after the client displays the load indicator selection interface, a first user selects at least one load indicator on the load indicator selection interface. After completing the selection, the first user triggers the load indicator selection completion operation. In response to the load indicator selection completion operation triggered by the first user, the client determines the at least one load indicator selected by the first user and then sends the at least one load indicator to the backend server.

[0141] That is to say, the first user can select at least one load indicator on the client, and then the client can send the at least one load indicator to the back-end server, and the back-end server can receive the at least one load indicator. Of course, in actual applications, at least one load indicator can also be obtained in other ways, and the embodiments of the present application are not limited to this. For example, the cloud platform can also include a load balancing management node. In this case, the client can send the at least one load indicator to the load balancing management node. If the load balancing management node has the authority to send at least one load indicator to the back-end server, the load balancing management node can forward the at least one load indicator to the back-end server.

[0142] In a second implementation, the load balancing management node generates a backend server script based on at least one load indicator, and then sends the backend server script to the client or the backend server. The at least one load indicator is a measurement indicator of the load situation.

[0143] The implementation process of the load balancing management node generating a backend server script based on at least one load indicator is similar to the implementation process of the backend server generating a backend server script based on at least one load indicator mentioned above. For details, please refer to the relevant content above and will not be repeated here.

[0144] When the load balancing management node does not have the authority to load the back-end server script into the back-end server, the load balancing management node will send the generated back-end server script to the client, and the first user can download the back-end server script from the client and then load the back-end server script into the back-end server.

[0145] Of course, in other embodiments, if the load balancing management node has the authority to load the back-end server script into the back-end server, the load balancing management node can directly send the back-end server script to the back-end server and instruct the back-end server to load the back-end server script.

[0146] In some embodiments, before the load balancing management node generates the backend server script based on the at least one load indicator, the load balancing management node can receive the at least one load indicator sent by the client.

[0147] The implementation process of the load balancing management node receiving at least one load indicator sent by the client is similar to the implementation process of the load balancing node receiving at least one load indicator sent by the client above. For details, please refer to the relevant content above and will not be repeated here.

[0148] In summary, when the load condition measurement indicators change dynamically, the backend server script can be generated by the backend server based on at least one load indicator, or can be generated by the load balancing management node based on at least one load indicator and sent to the backend server. Of course, in actual applications, the backend server script can also be obtained through other methods, and the embodiments of the present application are not limited to this.

[0149] Based on the above description, the load balancing management node can generate a health detection script based on at least one load indicator and send the health detection script to the load balancing node. It can also generate a back-end server script based on at least one load indicator and send the back-end server script to the back-end server. Therefore, in some embodiments, before the load balancing node generates a detection message through the health detection script, the load balancing management node can receive at least one load indicator sent by the client. The load balancing management node generates a health detection script and a back-end server script based on the at least one load indicator. The back-end server script is used to parse the detection message and generate a response message. The load balancing management node sends the health detection script to the load balancing node and sends the back-end server script to the client to instruct the client to load the back-end server script into the multiple back-end servers.

[0150] The load balancing management node stores a correspondence between load indicators, health detection sub-scripts, and backend server sub-scripts, where one load indicator corresponds to one health detection sub-script and one backend server sub-script. In this case, based on the at least one load indicator, the load balancing management node determines the health detection sub-script and backend server sub-script corresponding to each load indicator in the at least one load indicator from the correspondence between the load indicators, health detection sub-scripts, and backend server sub-scripts, and sequentially superimposes the health detection sub-scripts corresponding to each load indicator to obtain a health detection script, and sequentially superimposes the backend server sub-scripts corresponding to each load indicator to obtain a backend server script.

[0151] That is to say, when the load balancing management node stores the correspondence between the load index, the health detection sub-script and the back-end server sub-script, the health detection sub-script and the back-end server sub-script corresponding to each load index can be combined respectively to obtain the health detection script and the back-end server script. In actual applications, the health detection script and the back-end server script can also be generated in other ways, and the embodiments of the present application are not limited to this. For example, the load balancing management node can also store multiple load index sets, as well as candidate health detection scripts and candidate back-end server scripts corresponding to each load index set. The load balancing management node can determine the load index set corresponding to the at least one load index from the multiple load index sets, determine the candidate health detection script corresponding to the load index set as the health detection script, and determine the candidate back-end server script corresponding to the load index set as the back-end server script. That is, the load balancing management node stores the candidate health detection script and the candidate back-end server script corresponding to the load index set in advance. In this way, the candidate health detection script and the candidate back-end server script corresponding to the load index set in the multiple load index sets that are consistent with at least one load index sent by the client can be used as the health detection script and the back-end server script, respectively.

[0152] Among them, the backend server script can also be an ebpf script. Of course, it can also be other types of scripts, which is not limited in the embodiment of the present application.

[0153] Step 303: The backend server generates a response message based on its own health status and load status, and sends the response message to the load balancing node. The response message includes the health status and load status of the backend server.

[0154] In some embodiments, the response message is an ICMP message, which includes a response type field and a detection result field. The response type field indicates that the ICMP message is used to respond to the detection message, and the detection result field indicates the load status. Of course, in actual applications, the response message can also be other types of messages, such as HTTP messages, which are not limited in the embodiments of the present application. For ease of description, the following description will take the response message as an ICMP message as an example.

[0155] As an example, please refer to Figure 4. The ICMP message in Figure 4 includes a Type field, a Code field, a Checksum field, and a Payload field. The Type field and the Code field can be used as a response type field to indicate that the ICMP message is a response message. The Payload field can be used as a detection result field to indicate the load of the backend server. The Checksum field represents the checksum of the ICMP message.

[0156] Similarly, the ICMP message can be an ICMP message based on IPv4 or an ICMP message based on IPv6. In ICMP messages of different protocols, the Type field and the Code field can take different values ​​to indicate that the ICMP message is used to respond to the probe message.

[0157] Based on the above description, the back-end server script may not instruct the back-end server to determine the connectivity of the target port. In this case, the load status of the back-end server can be directly written into the detection result field. For example, as shown in Table 3 below, in an IPv4-based ICMP message, the value of the Type field is 45, and the value of the Code field is 0. The values ​​of the Type field and the Code field indicate that the ICMP message is used to respond to the detection message. The content of the Payload field is the content shown in the second row and third column of Table 3, which indicates the CPU occupancy and TCP connection status of the back-end server, etc.

[0158] Table 3

[0159] As shown in Table 4 below, in an IPv6-based ICMP message, the Type field value is 245, and the Code field value is 0. The values ​​of the Type and Code fields indicate that the ICMP message is used to respond to a probe message. The content of the Payload field is shown in the second row, third column of Table 4, indicating the backend server's CPU usage and TCP connection status, etc.

[0160] Table 4

[0161] In some embodiments, the backend server can write its own health status and load status into the detection result field through the backend server script to obtain a response message. In other words, if the backend server script can instruct the backend server to determine the connectivity status of the target port in the backend server, in this case, the connectivity status of the target port can also be written into the detection result field. In this way, the detection result field not only indicates the load status of the backend server, but also indicates the connectivity status of the target port.

[0162] Step 304: The load balancing node receives response messages sent by some or all of the multiple back-end servers, and based on the received response messages, determines the health detection result and load detection result of each of the multiple back-end servers. The health detection result indicates whether the corresponding back-end server is in an active state, and the load detection result indicates whether the load of the corresponding back-end server is overloaded.

[0163] In some embodiments, the load balancing node parses the received response message based on the health detection script, and determines the health detection result and load detection result of each backend server that sends the response message based on the parsing result.

[0164] In actual applications, due to network link failures, unreachable backend servers, and other reasons, the load balancing node may be unable to receive response messages from some backend servers. In this case, the load balancing node may only receive response messages from some of the backend servers. Furthermore, due to network latency and other factors, even if the load balancing node receives a response message from a backend server, the response message may time out. Therefore, in different situations, the load balancing node determines the health detection status and load detection results of each of the multiple backend servers based on the received response messages in different ways, which will be explained below.

[0165] For each of the multiple back-end servers, if a response message sent by the back-end server is not received, or the response message sent by the back-end server is received within a timeout, the health detection result of the back-end server is determined to be inactive, and the load detection result is determined to be empty. If a response message sent by the back-end server is not received within a timeout, and the detection result field in the response message indicates that the connectivity of the target port is disconnected, the health detection result of the back-end server is determined to be inactive, and the load detection result is determined to be empty. Otherwise, the health detection result of the back-end server is determined to be active, and the load detection result is determined to be the load condition indicated by the detection result field in the response message.

[0166] If the reply message sent by the backend server is not received, it means that the network link of the backend server is faulty or the backend server is unreachable. Therefore, the health detection result of the backend server can be determined as inactive, and the load detection result can be determined as empty. If the reply message sent by the backend server is received after a timeout, it means that the network quality of the backend server is poor and there is a network delay. Therefore, the health detection result of the backend server can be determined as inactive, and the load detection result can be determined as empty. If the reply message sent by the backend server is not received after a timeout, and the detection result field in the reply message indicates that the connectivity of the target port is disconnected, it means that the target server cannot process the business traffic normally. Therefore, the health detection result of the backend server can be determined as inactive, and the load detection result can be determined as empty. Otherwise, it means that the load balancing node has received the reply message sent by the backend server, the reply message has not timed out, and the target server can process the business traffic normally. Therefore, the health detection result of the backend server can be determined as active, and the load detection result can be determined as the load condition indicated by the detection result field in the reply message.

[0167] Step 305: The load balancing node determines at least one backend server among the multiple backend servers that is in an active state and is not overloaded based on the health detection results and load detection results of the multiple backend servers.

[0168] The backend servers whose health detection results are active are determined as the backend servers in the active state. Based on the load detection results of the backend servers in the active state, at least one backend server in the multiple backend servers is determined to be active and not overloaded.

[0169] The implementation process of determining at least one backend server in an active state and not overloaded among multiple backend servers based on the load detection results of the backend servers in an active state includes: determining the load weight of at least one backend server in an active state among the multiple backend servers based on the load detection results of the backend servers in an active state; and determining at least one backend server in an active state and not overloaded among the multiple backend servers based on the load weight of at least one backend server in an active state.

[0170] In some embodiments, for any one of the at least one active backend servers, at least one detection parameter can be determined based on the load detection result of the backend server, the at least one detection parameter corresponding one-to-one to the at least one load indicator, and the load weight of the backend server can be determined based on the at least one detection parameter. After processing each active backend server in the same manner, the load weight of the at least one active backend server can be determined.

[0171] Load indicators include memory occupancy, CPU occupancy, number of running processes, system response time, etc. Therefore, the load detection result includes the detection result corresponding to each load indicator in at least one load indicator. The load indicator indicates the load situation of the back-end server in different dimensions, that is, the units of the detection results corresponding to different load indicators are different. For example, the unit of the detection result corresponding to memory occupancy and CPU occupancy is percentage (or ratio), the unit of the detection result corresponding to system response time is time (or ratio), and the unit of the detection result corresponding to the number of TCP connections and the number of running processes is quantity. Therefore, converting the load situation of the back-end server in different dimensions into the same dimension can make it easier to determine the load weight later. In addition, since the units of the detection results corresponding to different load indicators are different, the method of converting the detection results corresponding to the load indicators is different for different load indicators, which will be introduced in turn below.

[0172] When the load indicator is memory usage, since the unit of the detection result corresponding to the memory usage is a percentage (or ratio), the detection result corresponding to the memory usage can be directly used as the detection parameter corresponding to the memory usage.

[0173] When the load indicator is CPU occupancy, since the unit of the detection result corresponding to the CPU occupancy is a percentage (or ratio), the detection result corresponding to the CPU occupancy can be directly used as the detection parameter corresponding to the CPU occupancy.

[0174] When the load indicator is the number of TCP connections, the value obtained by dividing the detection result corresponding to the number of TCP connections by the maximum number of connections is used as the detection parameter corresponding to the number of TCP connections.

[0175] In the case where the load indicator is the number of running processes, the value obtained by dividing the detection result corresponding to the number of running processes by the maximum number of processes is used as the detection parameter corresponding to the number of running processes.

[0176] When the load indicator is system response time, if the detection result corresponding to the system response time is less than the response time threshold, the detection parameter corresponding to the system response time is determined to be 0; if the detection result corresponding to the system response time is greater than or equal to the response time threshold, the value obtained by subtracting the response time threshold from the detection result corresponding to the system response time and dividing it by the response time threshold is used as the detection parameter corresponding to the system response time.

[0177] Among them, the maximum number of connections is set in advance, and the maximum number of connections corresponding to different back-end servers may be the same or different. The maximum number of connections is the maximum number of TCP connections that the corresponding back-end server can connect to. The maximum number of processes is set in advance, and the maximum number of processes corresponding to different back-end servers may be the same or different. The maximum number of processes is the maximum number of processes that the corresponding back-end server can run. The response time threshold is set in advance, and the response time thresholds corresponding to different back-end servers may be the same or different, which is related to the performance of the corresponding back-end server. The better the performance of the back-end server, the smaller the response time threshold. Of course, different back-end servers can also correspond to the same response time threshold, and the embodiments of the present application do not limit this. The load weight threshold is set in advance, and in different situations, it can also be adjusted according to different needs.

[0178] By converting the detection result corresponding to each load indicator in at least one load indicator, at least one detection parameter can be obtained. At this time, the largest detection parameter in at least one detection parameter can be used as the load weight of the back-end server. In other embodiments, the correspondence between load indicators and indicator weights is stored in the load balancing node. The load balancing node can determine the indicator weight corresponding to each detection parameter from the correspondence between the load indicators and the indicator weights, and add the values ​​after multiplying the at least one detection parameter by the corresponding indicator weight to obtain the load weight of the back-end server. Of course, the load weight of the back-end server can also be determined by other means, which is not limited in the embodiments of the present application.

[0179] A backend server whose load weight is less than a load weight threshold among the at least one backend server in an active state is determined as at least one backend server in an active state and not overloaded among the multiple backend servers.

[0180] Since the load weight can represent the load status of the backend server, if the load weight is less than the load weight threshold, it means that the backend server is not overloaded. Therefore, the backend server can be determined as an active backend server and not overloaded. If the load weight is greater than or equal to the load weight threshold, it means that the backend server is overloaded. Therefore, the backend server can be not determined as an active backend server and not overloaded.

[0181] It should be noted that if the load weight of each backend server in at least one active backend server is greater than or equal to the load weight threshold, then the multiple backend servers are considered to be overloaded. In this case, the first user can be prompted to add a new backend server to expand the cluster processing capacity, and / or randomly discard business traffic to reduce the business traffic distributed to the backend server, and / or send a reset command to the client that generates business traffic to disconnect the transmission path of the business traffic. If the load balancing node has the authority to expand the backend server, then the load balancing node can directly add a new backend server if the load weight of each backend server is greater than or equal to the load weight threshold.

[0182] Step 306: The load balancing node schedules the service traffic based on the load detection result of each backend server in at least one backend server that is active and not overloaded among the multiple backend servers.

[0183] In some embodiments, the load balancing node determines the load weight of each backend server among the multiple backend servers based on the load detection results of at least one backend server that is active and not overloaded. The load weight indicates the load status of the corresponding backend server. The load balancing node schedules business traffic based on the load weight of at least one backend server.

[0184] Based on the above description, traffic scheduling algorithms include polling algorithms, random algorithms, weighted algorithms, and minimum connection number algorithms, etc. The above-mentioned various traffic scheduling algorithms can be divided into two types, namely, algorithms that schedule based on scheduling weights and algorithms that schedule not based on scheduling weights. The method provided in the embodiment of the present application can be combined with the above-mentioned scheduling algorithms. Different types of traffic scheduling algorithms are combined with the embodiments of the present application in different ways, which will be introduced below.

[0185] If the type of traffic scheduling algorithm is an algorithm that performs scheduling based on scheduling weights, in this case, the load balancing node adjusts the scheduling weights of the first type of backend servers based on the load weights of at least one backend server that is active and not overloaded among multiple backend servers to reduce the scheduling priority of the first type of backend servers. The first type of backend servers are backend servers whose load weights are greater than or equal to the load threshold, and the scheduling weight indicates the scheduling priority of the corresponding backend servers. The load balancing node schedules the business traffic according to the algorithm that performs scheduling based on scheduling weights based on the scheduling weights of the second type of backend servers in at least one backend server and the adjusted scheduling weights of the first type of backend servers. The second type of backend servers are backend servers whose load weights are less than the load threshold.

[0186] In some embodiments, for each backend server in the first category of backend servers, the load balancing node can multiply the value obtained by subtracting the load weight of the backend server from 1 by the scheduling weight of the backend server to obtain the adjusted scheduling weight of the backend server. Of course, in other embodiments, the difference between the value of multiplying the load weight of the backend server by 100 and the scheduling weight of the backend server can also be determined as the adjusted scheduling weight of the backend server.

[0187] It should be noted that the scheduling weight is set in advance and is related to the performance of the corresponding backend server.

[0188] If the type of traffic scheduling algorithm is an algorithm that is not based on scheduling weights, in this case, the load balancing node selects a second type of backend server from the at least one backend server based on the load weight of at least one backend server that is active and not overloaded among the multiple backend servers. The second type of backend server is a backend server whose load weight is less than the load threshold. The load balancing node schedules the business traffic based on the second type of backend server according to the algorithm that is not based on scheduling weights.

[0189] Next, the load balancing method provided in the embodiment of the present application will be introduced with reference to FIG6 .

[0190] Referring to Figure 6 , a first user can select at least one load metric on a client and trigger a load metric selection completion operation. In response to the load metric selection completion operation triggered by the first user, the client determines the at least one load metric selected by the first user and then sends the at least one load metric to the load balancing management node. The load balancing management node receives the at least one load metric sent by the client and generates a health detection script and a backend server script based on the at least one load metric. It then sends the health detection script to the load balancing node and the backend server script to the client. The first user downloads the backend server script from the client and then sends it to the backend server management node, which then distributes the backend server script to the multiple backend servers. After the load balancing management node sends the health detection script to the load balancing node, the load balancing node receives and loads the health detection script. The load balancing node then sends a detection message to each of the multiple backend servers. The backend server receives the detection message sent by the load balancing node and determines its own health and load status based on the detection message. It then generates a response message, which the backend server sends to the load balancing node. The load balancing node receives response messages sent by some or all of the multiple backend servers, and based on the received response messages, determines at least one backend server among the multiple backend servers that is in an active state and is not overloaded, and then schedules the business traffic based on the load detection results of each backend server among the at least one backend server that is in an active state and is not overloaded.

[0191] Since the health detection result of the back-end server can indicate whether the corresponding back-end server is in an active state, and the load detection result can indicate whether the load of the corresponding back-end server is overloaded, by determining the health detection result and load detection result of each back-end server among multiple back-end servers, and scheduling business traffic based on the health detection results and load detection results of the multiple back-end servers, it is possible to avoid overloading of the back-end server and then avoid crashing of the back-end server, thereby effectively ensuring the efficiency of business traffic processing.

[0192] Moreover, the detection message sent by the embodiment of the present application can instruct the back-end server to detect its own health condition while also instructing the back-end server to detect its own load condition. Therefore, the embodiment of the present application does not need to send the detection message multiple times. It only needs to send the detection message once to instruct the back-end server to detect its own health condition and load condition. In this way, the steps of obtaining the health condition and load condition of the back-end server can be effectively simplified, thereby improving the working efficiency of the back-end server and the load balancing node. In addition, the load balancing method provided by the embodiment of the present application can also be combined with the traffic scheduling algorithm to effectively solve the problem of back-end server overload, that is, to improve the efficiency of business traffic processing without increasing additional hardware and software costs.

[0193] Figure 7 is an architectural diagram of a cloud platform provided in an embodiment of the present application. The cloud platform includes a load balancing node, which distributes service traffic to multiple backend servers using a load balancing strategy. Optionally, the cloud platform also includes a load balancing management node, which is used to manage the load balancing nodes included in the cloud platform. The load balancing nodes establish a communication connection with the load balancing management node.

[0194] The load balancing node is configured to send a probe message to each of the multiple backend servers, receive response messages sent by some or all of the multiple backend servers, and determine a health probe result and a load probe result for each of the multiple backend servers based on the received response messages. The load balancing node schedules service traffic based on the health probe results and load probe results of the multiple backend servers.

[0195] The load balancing management node is used to receive at least one load indicator sent by the client, generate a health detection script and a back-end server script based on the at least one load indicator, and then send the health detection script to the load balancing node and the back-end server script to the client to instruct the client to load the back-end server script to multiple back-end servers.

[0196] The load balancing node and load balancing management node in Figure 7 can be implemented in software or hardware. For example, the following describes the implementation of a load balancing node using a load balancing node as an example. Similarly, the implementation of a load balancing management node can refer to the implementation of a load balancing node.

[0197] The load balancing node may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the load balancing node may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0198] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0199] The load balancing node may include at least one computing device, such as a server. Alternatively, the load balancing node may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0200] The multiple computing devices included in a load balancing node can be distributed in the same region or in different regions. They can also be distributed in the same AZ or in different AZs. Similarly, they can be distributed in the same VPC or across multiple VPCs. These multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0201] The present application also provides a computing device 100. As shown in FIG8 , computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. Processor 104, memory 106, and communication interface 108 communicate with each other via bus 102. Computing device 100 may be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 100.

[0202] Bus 102 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG8 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 102 may include a path for transmitting information between various components of computing device 100 (e.g., memory 106, processor 104, and communication interface 108).

[0203] Processor 104 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), a digital signal processor (DSP), an integrated circuit, and the like. The integrated circuit may include an ASIC, a programmable logic device (PLD), or a combination thereof. Optionally, the PLD may be a CPLD, an FPGA, a GAL, or any combination thereof.

[0204] The memory 106 may include volatile memory, such as random access memory (RAM). The memory 106 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD) or solid state drive (SSD), or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 106 exists independently and is connected to the processor 104 via the bus 102, or the memory 106 is integrated with the processor 104.

[0205] The memory 106 stores executable program codes, and the processor 104 executes the executable program codes to implement the functions of the aforementioned load balancing node or load balancing management node, thereby implementing the load balancing method. That is, the memory 106 stores instructions for executing the load balancing method.

[0206] For example, the memory 106 stores executable code, and the processor 104 executes the executable code to respectively implement the functions of the sending module, receiving module, first determination module, second determination module, and scheduling module in the load balancing node shown in FIG11 below, or implement the functions of the receiving module, generation module, and sending module in the load balancing management node shown in FIG12, thereby implementing the load balancing method provided in the embodiment of the present application. That is, the memory 106 stores instructions for executing the load balancing method provided in the embodiment of the present application.

[0207] The communication interface 108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to enable communication between the computing device 100 and other devices or communication networks. Network interfaces include wired communication interfaces or wireless communication interfaces. Examples of wired communication interfaces include Ethernet interfaces. Ethernet interfaces can be optical interfaces, electrical interfaces, or a combination thereof. Wireless communication interfaces can include wireless local area network (WLAN) interfaces, cellular network communication interfaces, or a combination thereof.

[0208] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes multiple computing devices. The computing devices can be servers, such as central servers, edge servers, or local servers in a local data center. In some embodiments, the computing devices can also be terminal devices such as desktop computers, laptop computers, or smartphones.

[0209] As shown in Figure 9, the computing device cluster includes multiple computing devices 100. The same instructions for executing the above load balancing method may be stored in the memory 106 of the multiple computing devices 100 in the computing device cluster.

[0210] In some possible implementations, the memories 106 of the multiple computing devices 100 in the computing device cluster may each store partial instructions for executing the aforementioned load balancing method. In other words, the combination of the multiple computing devices 100 can collectively execute all instructions for executing the aforementioned load balancing method. For example, the multiple computing devices 100 include load balancing nodes and load balancing management nodes, and the memories 106 of the load balancing nodes and the load balancing management nodes each store partial instructions for executing the aforementioned load balancing method. The combination of the load balancing nodes and the load balancing management nodes can collectively execute all instructions for executing the aforementioned load balancing method.

[0211] It should be noted that the memory 106 in different computing devices 100 in the computing device cluster can store different instructions, each for executing part of the functions of a load balancing node and a load balancing management node. In other words, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of some or all of the modules included in the load balancing node or the load balancing management node.

[0212] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. FIG10 shows a possible implementation. As shown in FIG10 , two computing devices 100A and 100B 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 106 in the computing device 100A stores instructions for executing the functions of a portion of the modules included in the load balancing node or the load balancing management node. At the same time, the memory 106 in the computing device 100B stores instructions for executing the functions of another portion of the modules included in the load balancing node or the load balancing management node.

[0213] For example, the memory 106 of the computing device 100A stores instructions for executing the functions of the sending module and the receiving module included in the load balancing node. Meanwhile, the memory 106 of the computing device 100B stores instructions for executing the functions of the first determination module, the second determination module, and the scheduling module included in the load balancing node.

[0214] It should be understood that the functions of the computing device 100A shown in FIG10 may also be completed by multiple computing devices 100. Similarly, the functions of the computing device 100B may also be completed by multiple computing devices 100.

[0215] Figure 11 is a schematic diagram of the structure of a load balancing node provided in an embodiment of the present application. The load balancing node is included in a cloud platform and distributes service traffic to multiple backend servers using a load balancing strategy. Referring to Figure 11 , the load balancing node includes a sending module 1101, a receiving module 1102, a first determination module 1103, a second determination module 1104, and a scheduling module 1105.

[0216] The sending module 1101 is used to send a detection message to each of the multiple backend servers, and the detection message instructs the backend server to detect its own health and load conditions. The detailed implementation process refers to the corresponding content of the above embodiments and will not be repeated here.

[0217] The receiving module 1102 is configured to receive a response message sent by some or all of the backend servers in the plurality of backend servers, the response message including the health status and load status of the corresponding backend servers. The detailed implementation process is referred to the corresponding content in the above embodiments and will not be repeated here.

[0218] The first determination module 1103 is configured to determine, based on the received response message, a health detection result and a load detection result for each of the plurality of backend servers, wherein the health detection result indicates whether the corresponding backend server is active, and the load detection result indicates whether the corresponding backend server is overloaded. The detailed implementation process is referred to the corresponding content in the above embodiments and will not be repeated here.

[0219] The second determining module 1104 is configured to determine at least one backend server among the multiple backend servers that is active and not overloaded based on the health detection results and load detection results of the multiple backend servers. The detailed implementation process is referred to the corresponding content in the above embodiments and will not be repeated here.

[0220] The scheduling module 1105 is used to schedule the service traffic based on the load detection result of each backend server in at least one backend server. The detailed implementation process is referred to the corresponding content of each embodiment above and will not be repeated here.

[0221] Optionally, the load balancing node further includes:

[0222] The generation module is used to generate detection messages through health detection scripts;

[0223] The first determining module 1103 is specifically configured to:

[0224] The received response message is parsed based on the health detection script, and the health detection result and load detection result of each backend server that sends the response message are determined based on the parsing result.

[0225] Optionally, the probe message is an Internet Control Message Protocol (ICMP) message. The ICMP message includes a probe type field and a load indicator field. The probe type field indicates that the ICMP message is used to detect health conditions and load conditions, and the load indicator field indicates a measurement indicator of the load condition.

[0226] Optionally, the scheduling module 1105 is specifically configured to:

[0227] Determining a load weight of each backend server in the at least one backend server based on a load detection result of the at least one backend server, where the load weight indicates a load condition of the corresponding backend server;

[0228] The service traffic is scheduled based on the load weight of at least one backend server.

[0229] Optionally, the scheduling module 1105 is specifically configured to:

[0230] Adjusting, based on a load weight of a first type of backend server among at least one backend server, a scheduling weight of the first type of backend server to reduce a scheduling priority of the first type of backend server, the first type of backend server being a backend server having a load weight greater than or equal to a load threshold, the scheduling weight indicating a scheduling priority of the corresponding backend server;

[0231] Based on the scheduling weight of a second type of backend server in at least one backend server and the adjusted scheduling weight of the first type of backend server, the business traffic is scheduled. The second type of backend server is a backend server whose load weight is less than the load threshold.

[0232] Optionally, the scheduling module 1105 is specifically configured to:

[0233] Based on the load weight of the at least one backend server, selecting a second type of backend server from the at least one backend server, the second type of backend server being a backend server having a load weight less than a load threshold;

[0234] Based on the second type of backend servers, business traffic is scheduled.

[0235] Since the health detection result of the back-end server can indicate whether the corresponding back-end server is in an active state, and the load detection result can indicate whether the load of the corresponding back-end server is overloaded, by determining the health detection result and load detection result of each back-end server among multiple back-end servers, and scheduling business traffic based on the health detection results and load detection results of the multiple back-end servers, it is possible to avoid overloading of the back-end server and then avoid crashing of the back-end server, thereby effectively ensuring the efficiency of business traffic processing.

[0236] Moreover, the detection message sent by the embodiment of the present application can instruct the back-end server to detect its own health condition while also instructing the back-end server to detect its own load condition. Therefore, the embodiment of the present application does not need to send the detection message multiple times. It only needs to send the detection message once to instruct the back-end server to detect its own health condition and load condition. In this way, the steps of obtaining the health condition and load condition of the back-end server can be effectively simplified, thereby improving the working efficiency of the back-end server and the load balancing node. In addition, the load balancing method provided by the embodiment of the present application can also be combined with the traffic scheduling algorithm to effectively solve the problem of back-end server overload, that is, to improve the efficiency of business traffic processing without increasing additional hardware and software costs.

[0237] It should be noted that the load balancing node provided in the above embodiment is merely an example of the division of the aforementioned functional modules when performing load balancing. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to perform all or part of the functions described above. In addition, the load balancing node provided in the above embodiment and the load balancing method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0238] Figure 12 is a schematic diagram of the structure of a load balancing management node provided in an embodiment of the present application. The load balancing management node is a load balancing management node included in a cloud platform and is used to manage the load balancing nodes included in the cloud platform. Referring to Figure 12 , the load balancing management node includes a receiving module 1201, a generating module 1202, and a sending module 1203.

[0239] The receiving module 1201 is configured to receive at least one load indicator sent by the client, where the at least one load indicator is a load condition measurement indicator. The detailed implementation process is described in the corresponding contents of the above embodiments and will not be repeated here.

[0240] The generation module 1202 is used to generate a health detection script and a backend server script based on at least one load indicator. The backend server script is used to parse the detection message and generate a response message. The detailed implementation process is referred to the corresponding content of each embodiment above and will not be repeated here.

[0241] The sending module 1203 is used to send the health detection script to the load balancing node and send the backend server script to the client to instruct the client to load the backend server script to multiple backend servers. The detailed implementation process refers to the corresponding content in the above embodiments and will not be repeated here.

[0242] Since the health detection result of the back-end server can indicate whether the corresponding back-end server is in an active state, and the load detection result can indicate whether the load of the corresponding back-end server is overloaded, by determining the health detection result and load detection result of each back-end server among multiple back-end servers, and scheduling business traffic based on the health detection results and load detection results of the multiple back-end servers, it is possible to avoid overloading of the back-end server and then avoid crashing of the back-end server, thereby effectively ensuring the efficiency of business traffic processing.

[0243] Moreover, the detection message sent by the embodiment of the present application can instruct the back-end server to detect its own health condition while also instructing the back-end server to detect its own load condition. Therefore, the embodiment of the present application does not need to send the detection message multiple times. It only needs to send the detection message once to instruct the back-end server to detect its own health condition and load condition. In this way, the steps of obtaining the health condition and load condition of the back-end server can be effectively simplified, thereby improving the working efficiency of the back-end server and the load balancing node. In addition, the load balancing method provided by the embodiment of the present application can also be combined with the traffic scheduling algorithm to effectively solve the problem of back-end server overload, that is, to improve the efficiency of business traffic processing without increasing additional hardware and software costs.

[0244] It should be noted that the load balancing management node provided in the above embodiment is merely an example of the division of the aforementioned functional modules when performing load balancing. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to perform all or part of the functions described above. In addition, the load balancing management node provided in the above embodiment and the load balancing method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0245] Figure 13 is a schematic diagram of the structure of a backend server provided in an embodiment of the present application. The cloud platform includes a load balancing node that distributes service traffic to multiple backend servers using a load balancing strategy. Referring to Figure 13 , the backend server includes a receiving module 1301, a determining module 1302, a generating module 1303, and a sending module 1304.

[0246] The receiving module 1301 is used to receive a detection message sent by the load balancing node, which instructs the backend server to detect its own health and load conditions. The detailed implementation process refers to the corresponding content of the above embodiments and will not be repeated here.

[0247] The determination module 1302 is configured to determine its own health and load status based on the detection message. The detailed implementation process is referred to the corresponding content of each of the above embodiments and will not be repeated here.

[0248] The generating module 1303 is configured to generate a response message based on its own health status and load status, wherein the response message includes the health status and load status. The detailed implementation process is referred to the corresponding content in the above embodiments and will not be repeated here.

[0249] The sending module 1304 is configured to send a response message to the load balancing node. The detailed implementation process is described in the corresponding contents of the above embodiments and will not be repeated here.

[0250] Optionally, the determining module 1302 is specifically configured to:

[0251] The backend server determines its own health and load status based on the probe message and the loaded backend server script;

[0252] The generation module 1303 is specifically used for:

[0253] The backend server generates a response message through the backend server script based on its own health and load conditions.

[0254] Optionally, the backend server further includes:

[0255] The acquisition module is used to obtain and load backend server scripts from the client.

[0256] Since the health detection result of the back-end server can indicate whether the corresponding back-end server is in an active state, and the load detection result can indicate whether the load of the corresponding back-end server is overloaded, by determining the health detection result and load detection result of each back-end server among multiple back-end servers, and scheduling business traffic based on the health detection results and load detection results of the multiple back-end servers, it is possible to avoid overloading of the back-end server and then avoid crashing of the back-end server, thereby effectively ensuring the efficiency of business traffic processing.

[0257] Moreover, the detection message sent by the embodiment of the present application can instruct the back-end server to detect its own health condition while also instructing the back-end server to detect its own load condition. Therefore, the embodiment of the present application does not need to send the detection message multiple times. It only needs to send the detection message once to instruct the back-end server to detect its own health condition and load condition. In this way, the steps of obtaining the health condition and load condition of the back-end server can be effectively simplified, thereby improving the working efficiency of the back-end server and the load balancing node. In addition, the load balancing method provided by the embodiment of the present application can also be combined with the traffic scheduling algorithm to effectively solve the problem of back-end server overload, that is, to improve the efficiency of business traffic processing without increasing additional hardware and software costs.

[0258] It should be noted that the back-end server provided in the above embodiment only uses the division of the above functional modules as an example to illustrate load balancing. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the back-end server provided in the above embodiment and the load balancing method embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0259] The sending module, receiving module, first determination module, second determination module, and scheduling module in the load balancing node shown in Figure 11, the receiving module, generation module, and sending module in the load balancing management node shown in Figure 12, and the receiving module, determination module, generation module, and sending module in the back-end server shown in Figure 13 can all be implemented through software, or can be implemented through hardware, or can be implemented through a combination of software and hardware. Next, taking the sending module in the load balancing node as an example, the implementation method of the sending module is introduced. Similarly, the implementation methods of the other modules mentioned above can refer to the implementation method of the sending module.

[0260] As an example of a software functional unit, a sending module may include code running on a computing instance. The computing instance may include at least one of a physical host, a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the sending module may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same AZ or in different AZs, and each AZ includes one data center or multiple data centers with close geographical locations. Generally, a region may include multiple AZs.

[0261] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same VPC or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0262] As an example of a hardware functional unit, a sending module may include at least one computing device, such as a server. Alternatively, the sending module may be implemented using an ASIC or a PLD. The PLD may be implemented using a CPLD, FPGA, GAL, or any combination thereof.

[0263] The multiple computing devices included in the sending module can be distributed in the same region or in different regions. The multiple computing devices included in the sending module can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the sending module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0264] In other embodiments, the sending module in the load balancing node can be used to execute any step in the above-mentioned load balancing method, the receiving module in the load balancing node can be used to execute any step in the above-mentioned load balancing method, and the first determination module in the load balancing node can be used to execute any step in the above-mentioned load balancing method. The steps that the sending module, receiving module, first determination module, second determination module and scheduling module in the load balancing node are responsible for implementing can be specified as needed. The different steps in the above-mentioned load balancing method are respectively implemented by the sending module, receiving module, first determination module, second determination module and scheduling module in the load balancing node, thereby realizing all the functions of the load balancing node.

[0265] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can 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 drive). The computer-readable storage medium includes instructions that instruct the computing devices in the computer device cluster to execute the load balancing method provided in the present application.

[0266] The present application also provides a computer program product including instructions. This computer program product can be software or a program product including instructions that can be run on a computing device or stored on any available medium. When this computer program product is run on a computing device included in a computing device cluster, it causes the computing device cluster to execute the load balancing method provided in the present application.

[0267] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)). It is worth noting that the computer-readable storage medium mentioned in the embodiments of the present application may be a non-volatile storage medium, in other words, a non-transient storage medium.

[0268] It should be understood that the "plurality" mentioned herein refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0269] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in the embodiments of this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the health and load conditions of the back-end servers involved in the embodiments of this application are obtained with full authorization.

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

Claims

1. A load balancing method, characterized in that: Applied to a load balancing node included in a cloud platform, the load balancing node distributes business traffic to multiple backend servers through a load balancing strategy, and the method includes: The load balancing node sends a detection message to each of the multiple backend servers, wherein the detection message instructs the backend server to detect its own health status and load status; The load balancing node receives a response message sent by some or all of the multiple backend servers, wherein the response message includes the health status and load status of the corresponding backend server; The load balancing node determines, based on the received response message, a health detection result and a load detection result of each backend server among the multiple backend servers, wherein the health detection result indicates whether the corresponding backend server is in an active state, and the load detection result indicates whether the load of the corresponding backend server is overloaded; The load balancing node determines, based on the health detection results and load detection results of the multiple backend servers, at least one backend server among the multiple backend servers that is in an active state and is not overloaded; The load balancing node schedules the service traffic based on the load detection result of each backend server in the at least one backend server.

2. The method according to claim 1, characterized in that Before the load balancing node sends a detection message to each of the multiple backend servers, the method further includes: The load balancing node generates the detection message through a health detection script; The load balancing node determines the health detection result and the load detection result of each backend server in the plurality of backend servers based on the received response message, including: The load balancing node parses the received response message based on the health detection script, and determines the health detection result and load detection result of each backend server that sends the response message based on the analysis result.

3. The method according to claim 2, characterized in that The cloud platform also includes a load balancing management node, and the load balancing management node is used to manage the load balancing nodes included in the cloud platform; Before the load balancing node generates the detection message through the health detection script, the method further includes: The load balancing management node receives the at least one load indicator sent by the client, where the at least one load indicator is a measurement indicator of the load condition; The load balancing management node generates the health detection script and the backend server script based on the at least one load indicator, and the backend server script is used to parse the detection message and generate the response message; The load balancing management node sends the health detection script to the load balancing node, and sends the backend server script to the client to instruct the client to load the backend server script to the multiple backend servers.

4. The method according to any one of claims 1 to 3, characterized in that: The detection message is an Internet Control Message Protocol (ICMP) message, and the ICMP message includes a detection type field and a load indicator field. The detection type field indicates that the ICMP message is used to detect health conditions and load conditions, and the load indicator field indicates a measurement indicator of the load condition.

5. The method according to claim 1, characterized in that The load balancing node schedules the service traffic based on the load detection result of each backend server in the at least one backend server, including: The load balancing node determines a load weight of each backend server in the at least one backend server based on the load detection result of the at least one backend server, wherein the load weight indicates a load condition of the corresponding backend server; The load balancing node schedules the service traffic based on the load weight of the at least one backend server.

6. The method according to claim 5, characterized in that The load balancing node schedules the service traffic based on the load weight of the at least one backend server, including: The load balancing node allocates a first type of backend server in the at least one backend server based on the load weight of the first type of backend server. The scheduling weight of the backend server is adjusted to reduce the scheduling priority of the first type of backend server, the first type of backend server is a backend server whose load weight is greater than or equal to the load threshold, and the scheduling weight indicates the scheduling priority of the corresponding backend server; The load balancing node schedules the business traffic based on the scheduling weight of the second type of back-end server in the at least one back-end server and the adjusted scheduling weight of the first type of back-end server, wherein the second type of back-end server is a back-end server whose load weight is less than the load threshold.

7. The method according to claim 5, characterized in that The load balancing node schedules the service traffic based on the load weight of the at least one backend server, including: The load balancing node selects a second type of backend server from the at least one backend server based on the load weight of the at least one backend server, where the second type of backend server is a backend server whose load weight is less than the load threshold; The load balancing node schedules the service traffic based on the second-type back-end server.

8. A load balancing method, characterized in that: Applied to the backend server, the load balancing node included in the cloud platform distributes business traffic to multiple backend servers through a load balancing strategy, and the method includes: The backend server receives a detection message sent by the load balancing node, wherein the detection message instructs the backend server to detect its own health status and load status; The backend server determines its own health status and load status based on the detection message; The backend server generates a response message based on its own health status and load status, wherein the response message includes the health status and the load status; The backend server sends the response message to the load balancing node.

9. The method according to claim 8, characterized in that The backend server determines its own health status and load status based on the detection message, including: The backend server determines its own health status and load status based on the detection message through the loaded backend server script; The backend server generates a response message based on its own health status and load status, including: The backend server generates the response message through the backend server script based on its own health status and load status.

10. The method according to claim 9, characterized in that Before the backend server determines its own health status and load status based on the detection message by loading the backend server script, the method further includes: The back-end server obtains and loads the back-end server script from the client.

11. A cloud platform, characterized in that: The cloud platform includes a load balancing node, which distributes business traffic to multiple backend servers through a load balancing strategy; The load balancing node is used to send a detection message to each of the multiple backend servers, wherein the detection message instructs the backend server to detect its own health status and load status; The load balancing node is used to receive a response message sent by some or all of the multiple backend servers, wherein the response message includes the health status and load status of the corresponding backend server; The load balancing node is used to determine a health detection result and a load detection result of each backend server among the multiple backend servers based on the received response message, wherein the health detection result indicates whether the corresponding backend server is in an active state, and the load detection result indicates whether the load of the corresponding backend server is overloaded; The load balancing node is used to determine at least one backend server among the multiple backend servers that is in an active state and is not overloaded based on the health detection results and load detection results of the multiple backend servers; The load balancing node is used to schedule the service traffic based on the load detection result of each backend server in the at least one backend server.

12. The cloud platform according to claim 11, characterized in that: The load balancing node is used to generate the detection message through a health detection script; The load balancing node is used to parse the received response message based on the health detection script, and determine the health detection result and load detection result of each backend server that sends the response message based on the analysis result.

13. The cloud platform according to claim 12, characterized in that: The cloud platform also includes a load balancing management node, and the load balancing management node is used to manage the load balancing nodes included in the cloud platform; The load balancing management node is used to receive the at least one load indicator sent by the client, where the at least one load indicator is a measurement indicator of the load condition; The load balancing management node is used to generate the health detection script and the back-end server script based on the at least one load indicator, and the back-end server script is used to parse the detection message and generate the response message; The load balancing management node is used to send the health detection script to the load balancing node and send the backend server script to the client to instruct the client to load the backend server script to the multiple backend servers.

14. The cloud platform according to any one of claims 11 to 13, characterized in that: The detection message is an Internet Control Message Protocol (ICMP) message, and the ICMP message includes a detection type field and a load indicator field. The detection type field indicates that the ICMP message is used to detect health conditions and load conditions, and the load indicator field indicates a measurement indicator of the load condition.

15. The cloud platform according to claim 11, characterized in that: The load balancing node is used to determine the load weight of each backend server in the at least one backend server based on the load detection result of the at least one backend server, wherein the load weight indicates the load condition of the corresponding backend server; The load balancing node is used to schedule the service traffic based on the load weight of the at least one backend server.

16. The cloud platform according to claim 15, characterized in that: The load balancing node is used to adjust the scheduling weight of a first type of backend server among the at least one backend server based on the load weight of the first type of backend server to reduce the scheduling priority of the first type of backend server, the first type of backend server being a backend server having a load weight greater than or equal to a load threshold, and the scheduling weight indicating the scheduling priority of the corresponding backend server; The load balancing node is used to schedule the business traffic based on the scheduling weight of the second type of back-end server in the at least one back-end server and the adjusted scheduling weight of the first type of back-end server, wherein the second type of back-end server is a back-end server whose load weight is less than the load threshold.

17. The cloud platform according to claim 15, characterized in that: The load balancing node is used to select a second type of backend server from the at least one backend server based on the load weight of the at least one backend server, where the second type of backend server is a backend server whose load weight is less than the load threshold; The load balancing node is used to schedule the business traffic based on the second-type back-end server.

18. A backend server, characterized in that: The load balancing node included in the cloud platform distributes business traffic to the multiple backend servers through a load balancing strategy; The backend server is used to receive the detection message sent by the load balancing node, and the detection message instructs the backend server to detect its own health and load conditions; The backend server is used to determine its own health status and load status based on the detection message; The backend server is used to generate a response message based on its own health status and load status, wherein the response message includes the health status and the load status; The backend server is used to send the response message to the load balancing node.

19. The backend server according to claim 18, characterized in that: The back-end server is used to determine its own health status and load status based on the detection message through the loaded back-end server script. Loading conditions; The back-end server is used to generate the response message through the back-end server script based on its own health status and load status.

20. The backend server according to claim 19, characterized in that: The back-end server is used to obtain and load the back-end server script from the client.

21. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, each computing device including a processor and a memory; The processor of the at least one computing device is used 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 1-7.

22. A backend server, characterized in that: The backend server includes a memory and a processor, the memory is used to store a computer program, and the processor is configured to execute the computer program stored in the memory to implement the steps of the method according to any one of claims 8 to 10.

23. A computer-readable storage medium, characterized in that: The storage medium includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 7.

24. A computer-readable storage medium, characterized in that: The storage medium includes computer program instructions. When the computer program instructions are executed by a backend server, the backend server executes the method according to any one of claims 8 to 10.

25. 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 1 to 7.

26. A computer program product comprising instructions, characterized in that When the instruction is executed by the backend server, the backend server executes the method according to any one of claims 8 to 10.

Citation Information

Patent Citations

  • Load balancing method and device, equipment, storage medium and computer program

    CN118714136A

  • Redirection method and redirection system based on cache server state

    CN106487607A

  • State-aware load balancing

    CN108292243A

  • Management for a load balancer cluster

    US20210281637A1

Cited By

  • Load balancing method, system and device and storage medium

    CN119814793A