Intelligent load balancing method based on dynamic scheduling
By introducing a dynamic scheduling mechanism into the load balancing method, using algorithms such as weighted polling, response time weighting, IP hashing and other algorithms, combined with real-time monitoring of data, the problem that traditional load balancing methods cannot meet real-time dynamic scheduling is solved, and the system performance and Optimization of reliability.
Patent Information
- Application Number
- CN202411380061.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-11
AI Technical Summary
Traditional static load balancing methods cannot meet the needs of real-time dynamic scheduling and cannot effectively optimize system performance, reliability and availability.
Using an intelligent load balancing method based on dynamic scheduling, through weighted polling algorithm, response time weighting algorithm, IP hashing algorithm, real-time monitoring and dynamic scheduling, requests are dynamically allocated to adapt to server load conditions and real-time monitoring data.
It achieves optimization of system performance, reliability and availability, improves load balancing efficiency and resource utilization, and adapts to complex and changeable network environments.
Smart Images

Figure BDA0005069677180000023 
Figure BDA0005069677180000024 
Figure BDA0005069677180000031
Abstract
Description
Technical Field
[0001] The present invention relates to a load balancing scheduling method, and more specifically to an intelligent load balancing method based on dynamic scheduling. Background Art
[0002] Current computer network systems are facing an ever-increasing number of requests and complex and changing load conditions. Traditional static load balancing methods, most of which rely on adding servers, can no longer meet the needs of real-time dynamic scheduling.
[0003] Regarding load balancing scheduling, the existing technology currently has a patent number CN202111524870.5, named as a system and method for dynamic scheduling of security resources based on multi-mode load balancing. At the same time, the southbound interface of the software-defined network is designed, and the control plane of software-defined security schedules the traffic according to the established strategy and logical topology. This mechanism can match the load resources required by the security components, thereby avoiding the problem of individual devices being overloaded and queuing for too long, resulting in overall performance degradation. However, the above method only implements the scheduling of load resources through the interface solution, and does not consider the load situation and data of the server. Therefore, there is still a problem that it cannot meet the needs of real-time dynamic scheduling. Summary of the invention
[0004] In view of the deficiencies in the prior art, the purpose of the present invention is to provide an intelligent load balancing method based on dynamic scheduling, which dynamically allocates requests according to server load conditions and real-time monitoring data to achieve optimization of system performance, reliability and availability.
[0005] To achieve the above object, the present invention provides the following technical solution: an intelligent load balancing method based on dynamic scheduling, characterized in that it includes the following steps:
[0006] Step 1: Use a weighted round-robin algorithm to determine the weight of the server, so as to assign different weights according to the server load capacity to ensure load balancing;
[0007] Step 2: Dynamically adjust request allocation using a response time weighted algorithm to dynamically adjust request allocation according to server response time and optimize system performance;
[0008] Step 3: Perform hash calculations using an IP hashing algorithm to perform hash calculations based on the requested IP address to ensure that requests from the same source are routed to the same server;
[0009] Step 4: Perform real-time monitoring and dynamic scheduling to combine real-time data analysis and dynamically adjust the load balancing strategy to adapt to changes in network load.
[0010] As a further improvement of the present invention, the specific method of the weighted polling algorithm in step 1 is: there are N servers, and their weights are: w1, w2, ... w n , the total weight is: The probability that request r is assigned to server i is As a further improvement of the present invention, the specific method of the response time weighted algorithm in step 2 is: first, assuming that the average response time of server i is: T i , then the average response time of the server is normalized, and then the probability P(r→i) that request r is assigned to server i is calculated.
[0011] As a further improvement of the present invention, the specific method of normalizing the average response time of the server in step 2 is: first calculate a normalization factor N so that the sum of all probabilities is 1, and the formula is as follows:
[0012]
[0013] As a further improvement of the present invention, the calculation formula for calculating the probability P(r→i) of request r being assigned to server i in step 2 is as follows:
[0014]
[0015] As a further improvement of the present invention, the specific method of the IP hash algorithm in step 3 is as follows: First, assume that the IP address of the request r is IP r , the number of servers is n, and then the modulus operation mod is used to implement the hash calculation. After that, the calculation method of assigning the request r to the server can be expressed as: Server r =IP r mod n.
[0016] As a further improvement of the present invention, the specific method of performing real-time monitoring and dynamic scheduling in step 4 is: according to the initial weights w1, w2, ... w n , the usage rate after a certain period of monitoring is: c1,c2,...c n , then the adjusted weight of the i-th server is w' i for:
[0017]
[0018] The beneficial effect of the present invention is that requests are dynamically allocated according to server load conditions and real-time monitoring data to optimize system performance, reliability and availability. The present method utilizes multiple load balancing algorithms such as weighted polling, shortest connection priority, response time weighting and IP hashing, combined with queue theory and real-time data analysis, effectively solves the deficiencies in traditional load balancing methods, improves the load balancing efficiency and resource utilization of the system, realizes real-time dynamic scheduling, adapts to complex and changeable network environments, and combines multiple load balancing algorithms with high flexibility and adaptability. DETAILED DESCRIPTION
[0019] The present invention will be further described in detail with reference to the given embodiments below.
[0020] An intelligent load balancing method based on dynamic scheduling in this embodiment includes the following steps:
[0021] Step 1: Use a weighted round-robin algorithm: assign different weights according to the server load capacity to ensure load balancing. The conventional load strategy is to distribute the load evenly or proportionally at the SLB layer. We introduce a strategy to dynamically allocate weights according to the server load capacity. There are N servers, and their weights are:
[0022] w1,w2,...w n , the total weight is: The probability that request r is assigned to server i is
[0023] Step 2: Use a response time weighted algorithm: dynamically adjust request allocation based on server response time to optimize system performance; assume that the average response time of server i is: T i , intuitively, one might think that more requests should be assigned to servers with shorter response times to reduce the overall system response time. The probability of a request being assigned to server i is not completely accurate because it does not take into account the total impact of all servers and is not normalized. In order to construct a reasonable probability distribution, we need to ensure that the sum of the assignment probabilities of all servers is 1. Therefore, we need to normalize the average response time of the server. We usually first calculate a normalization factor N so that the sum of all probabilities is 1.
[0024]
[0025] Then, the probability P(r→i) that request r is assigned to server i should be the proportion of the reciprocal of server i's response time to the sum of the reciprocals of all server response times. That is:
[0026]
[0027] This gives us a reasonable, normalized probability distribution for distributing requests based on the average response time of the servers, in which servers with shorter response times have a higher probability of being selected, and servers with longer response times have a lower probability.
[0028] Step 3: Use IP hashing algorithm: perform hash calculation based on the requested IP address to ensure that requests from the same source are routed to the same server;
[0029] We assume that the IP address of the request r is IP r (The actual IP address needs to be converted into an integer. For example, if the IP address is 192.168.2.11, it can be converted into 192*256^3+168*256^2+2*256^1+11*256^0). The number of servers is n. Using the modulus operation mod to implement hash calculation is a simple and common method. The result of the modulus operation is an integer between 0 and n-1, which can be directly used as the index of the server.
[0030] Therefore, the calculation method for assigning request r to the server can be expressed as:
[0031] Server r =IP r mod n
[0032] It should be noted that when the number of servers n changes (for example, adding or removing servers), requests previously assigned to a specific server may be reallocated to other servers, which may cause session state loss or inconsistency. Therefore, when designing the system, you also need to carefully consider the impact of changes in the number of servers on system stability and consistency.
[0033] Step 4: Real-time monitoring and dynamic scheduling: Combine real-time data analysis to dynamically adjust the load balancing strategy to adapt to changes in network load.
[0034] The weight data method is generally to default to an average of 1 / n or set a corresponding value based on the initial configuration of the server in the cluster. During the actual operation, the resource usage of the server is monitored in real time and adjusted dynamically, including CPU, memory, disk IO, network, etc. Here, taking the monitoring of CPU usage as an example, the initial weights are w1, w2, ... w n , the CPU usage after a certain period of monitoring is: c1,c2,...c n , then the adjusted weight of the i-th server is w' i for:
[0035]
[0036] As for the response time weighted algorithm, in actual use, different servers can be matched for different business characteristics. For example, VIP users can be preferentially allocated to servers with shorter average processing time. This embodiment will not be described one by one.
[0037] In summary, the intelligent load balancing method based on dynamic scheduling of this embodiment dynamically allocates requests according to server load conditions and real-time monitoring data to optimize system performance, reliability and availability. This method utilizes multiple load balancing algorithms such as weighted polling, shortest connection priority, response time weighting and IP hashing, combined with queue theory and real-time data analysis, effectively solves the shortcomings of traditional load balancing methods, and improves the load balancing efficiency and resource utilization of the system.
[0038] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. An intelligent load balancing method based on dynamic scheduling, characterized in that: The steps include: Step 1: Use a weighted round-robin algorithm to determine the weight of the server, so as to assign different weights according to the server load capacity to ensure load balancing; Step 2: Dynamically adjust request allocation using a response time weighted algorithm to dynamically adjust request allocation according to server response time and optimize system performance; Step 3: Perform hash calculations using an IP hashing algorithm to perform hash calculations based on the requested IP address to ensure that requests from the same source are routed to the same server; Step 4: Perform real-time monitoring and dynamic scheduling to combine real-time data analysis and dynamically adjust the load balancing strategy to adapt to changes in network load.
2. The intelligent load balancing method based on dynamic scheduling according to claim 1, characterized in that: The specific method of the weighted polling algorithm in step 1 is: there are N servers, and their weights are: w1, w2, ... w n , the total weight is: The probability that request r is assigned to server i is 3. The intelligent load balancing method based on dynamic scheduling according to claim 1 or 2, characterized in that: The specific method of the response time weighted algorithm in step 2 is: first, assume that the average response time of server i is: T i , then the average response time of the server is normalized, and then the probability P(r→i) that request r is assigned to server i is calculated.
4. The intelligent load balancing method based on dynamic scheduling according to claim 3 is characterized in that: The specific method of normalizing the average response time of the server in step 2 is: first calculate a normalization factor N so that the sum of all probabilities is 1, and the formula is as follows:
5. The intelligent load balancing method based on dynamic scheduling according to claim 4 is characterized in that: The calculation formula for calculating the probability P(r→i) that request r is assigned to server i in step 2 is as follows:
6. The intelligent load balancing method based on dynamic scheduling according to claim 1 or 2, characterized in that: The specific method of the IP hash algorithm in step 3 is as follows: First, assume that the IP address of the request r is IP r , the number of servers is n, and then the modulus operation mod is used to implement the hash calculation. After that, the calculation method for assigning the request r to the server can be expressed as: Server r =IP r mod n。 7. The intelligent load balancing method based on dynamic scheduling according to claim 1 or 2, characterized in that: The specific method of performing real-time monitoring and dynamic scheduling in step 4 is: according to the initial weights w1, w2, ... w n , the usage rate after a certain period of monitoring is: c1,c2,...c n , then the adjusted weight of the i-th server is w' i for:
Citation Information
Patent Citations
Security resource dynamic scheduling system and method based on multi-mode load balancing
CN114268477A
Cited By
Dynamic load balancing transmission method based on synchronous adjustment
CN120434191A