Dynamic load balancing processing method for high-availability distributed service cluster

Through dynamic load balancing processing methods, the load situation of server nodes is monitored and evaluated in real time, and the load information and priority list are combined to match the target server, which solves the load imbalance caused by static allocation algorithms and improves system performance and availability.

CN118921371APending Publication Date: 2024-11-08HUASHU INTELLIGENT RING (BEIJING) DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411107335.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

Traditional load balancing cluster systems use static allocation algorithms to adapt to real-time load changes, resulting in load imbalance and performance degradation.

Method used

A dynamic load balancing method for highly available distributed service cluster is proposed. By monitoring the load information of the server node in real time, calculating the load information evaluation value, and matching the target server node with the priority list of the server node, ensuring that the connection request is distributed to the load On lighter and higher priority servers.

Benefits of technology

It realizes the rapid finding of server nodes with lighter loads, ensures that connection requests are distributed to the appropriate server, maintains the accuracy and timeliness of load information, improves system performance and availability, and optimizes load balancing effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921371A_ABST
    Figure CN118921371A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic load balancing processing method for a high-availability distributed service cluster, and the method comprises the steps: obtaining a load information list of server nodes of a current cluster according to a load information evaluation value of each server node, and taking the priority of the server nodes into consideration; in combination with a cluster server node load information list and a server node priority list, an appropriate server node can be matched to serve as a target server node so as to ensure that a connection request is distributed to a server with lighter load and higher priority; and the accuracy and timeliness of the load information are kept, so that load balancing can be better carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cloud computing cluster applications, and in particular to a dynamic load balancing processing method for a high-availability distributed service cluster. Background Art

[0002] A distributed service cluster is a highly scalable and fault-tolerant system architecture that achieves load balancing and high availability by running services on multiple physical or virtual nodes. There are many types of distributed service clusters, such as high-availability distributed service cloud clusters, adaptive distributed service cluster frameworks, and self-healing distributed service clusters.

[0003] The management of distributed service clusters generally requires load balancing and coordination processing, and a service cluster that can achieve load balancing and coordination processing capabilities is often itself a highly available service cluster.

[0004] Research has found that traditional load balancing cluster systems use static allocation algorithms to implement node weight settings for pre-processing based on the processing capabilities and load conditions of server nodes. However, due to the dynamic nature of actual load conditions, static allocation algorithms are difficult to adapt to real-time load changes, leading to load imbalance and performance degradation. Summary of the invention

[0005] The purpose of the present invention is to provide a dynamic load balancing processing method for a high-availability distributed service cluster, which solves the above-mentioned technical problems pointed out in the prior art.

[0006] The present invention proposes a dynamic load balancing processing method for a high-availability distributed service cluster, comprising the following steps:

[0007] Monitor the load information of each server node in the current server cluster in real time; calculate the load information evaluation value of each server node according to the load information and the server attribute information corresponding to each server;

[0008] The load information includes the number of client connections and the instance response creation time; the server attribute information includes the maximum number of client connections and the maximum instance response creation time;

[0009] The calculation method of the load information evaluation value is:

[0010] Load information evaluation value = w1×(number of client connections / maximum number of client connections)+w2×(1-(instance response creation time / maximum instance response creation time));

[0011] In the formula, w1 is the weight of the number of client connections; w2 is the weight of the instance response creation time;

[0012] Arrange the server nodes from large to small according to the load information evaluation value to obtain a current cluster server node load information list;

[0013] Obtaining a connection request from the current client, parsing the connection request, and obtaining request information; matching the request information with a cluster server node load information list and a cluster server node priority list to obtain a target server node; and distributing the connection request to the target server node;

[0014] The request information includes the type of the current client;

[0015] Preferably, the elements in the cluster server node priority list represent the connection priorities of all types of server nodes corresponding to the current client.

[0016] Preferably, the step of obtaining the target server node by matching the request information with the cluster server node load information list and the cluster server node priority list specifically includes the following steps:

[0017] Selecting a plurality of first candidate server nodes with the highest priority from the current cluster server node priority list;

[0018] Use polling to select the top N second candidate server nodes in the cluster server node load information list;

[0019] Based on the request information, analyzing and screening the first candidate server node and the second candidate server node to obtain a target server node;

[0020] Preferably, before "selecting the cluster server node type with the highest priority from the current cluster server node priority list", the method further includes calling the cluster server node priority list corresponding to the current client according to the type of the current client.

[0021] Preferably, based on the request information, analyzing and screening the first candidate server node and the second candidate server node to obtain the target server node includes the following steps:

[0022] Acquire a third server node to be selected based on the first server node to be selected and the second server node to be selected;

[0023] The third server node to be selected is a server node that belongs to the first server node to be selected and also belongs to the second server node to be selected;

[0024] Acquire server attribute information of each of the third server nodes to be selected; and at the same time, acquire the data volume of the request information;

[0025] The server attribute information includes unit data volume processing time;

[0026] Calculate and obtain data processing time Ti according to the server attribute information and the data volume;

[0027] The data processing time Ti is calculated as follows:

[0028] Data processing time

[0029] Obtaining a task processing scheduling value for each third candidate server node based on a comprehensive analysis of the data processing time and the real-time parameters of each third candidate server node;

[0030] The third candidate server node corresponding to the largest task processing scheduling value is selected as the target server node.

[0031] Preferably, the step of performing a comprehensive analysis based on the data processing time and the real-time parameters of each of the third candidate server nodes to obtain the task processing scheduling value of each of the third candidate server nodes comprises the following steps:

[0032] Obtaining the real-time parameters Pi={pi1, pi2, pi3, ...pij} of each of the third server nodes to be selected; wherein pij is the j-th real-time parameter of the i-th third server node to be selected;

[0033] Obtain the real-time parameter weight Qi={qip1, qip2, qip3, ...qipj} corresponding to each of the real-time parameters; wherein qipj is the weight of the j-th real-time parameter of the i-th third candidate server node; wherein the sum of each parameter in Qi is 1;

[0034] Establishing an initial task processing scheduling matrix R based on the real-time parameters and the real-time parameter weights;

[0035] Calculate and obtain the task processing scheduling value of each third candidate server node based on the initial task processing scheduling matrix R and the data processing time;

[0036] Preferably, the initial task processing scheduling matrix R is expressed as:

[0037]

[0038] Wherein, (pij, qipj) represents the specific value of the jth real-time parameter of the i-th server node and its corresponding weight value;

[0039] The task processing scheduling value of the third candidate server node is calculated as follows:

[0040]

[0041] Where R is the initial task processing scheduling matrix; qipj is the weight of the jth real-time parameter of the i-th third candidate server node; pij is the jth real-time parameter of the i-th third candidate server node; Ti is the data processing time.

[0042] Preferably, obtaining the real-time parameter weight corresponding to each of the real-time parameters includes the following steps:

[0043] Initialize iterative optimization parameters of the real-time parameter weights;

[0044] The iterative optimization parameters include a population size and an iteration counter, and the number of iterations of the iteration counter is initially 0;

[0045] Mapping each real-time parameter weight to the initial search space according to a preset mapping function to obtain a search grid;

[0046] Initializing each real-time parameter weight to obtain an initial position m of the initial real-time parameter weight in the search grid and an initial iterative search speed d;

[0047] Based on the initial position m and the initial iteration speed, a first fitness f is calculated according to a preset fitness function f(x);

[0048] Determine whether the first fitness is greater than or equal to a preset minimum fitness threshold; if so, output the initial real-time parameter weight corresponding to the initial position m as the target real-time parameter weight; if not, add 1 to the iteration number of the iteration counter to obtain the current iteration number k;

[0049] An iterative calculation and analysis is performed based on the first fitness f and the initial position m to obtain a target real-time parameter weight.

[0050] Preferably, the iterative calculation and analysis based on the first fitness f and the initial position m to obtain the target real-time parameter weight includes the following steps:

[0051] Calculate and obtain a new iterative search speed d' based on the current number of iterations and the initial position m;

[0052] Calculate and obtain a new position m' according to the new iterative search speed d';

[0053] The new iterative search speed d' is used as the initial iterative search speed and the new position m' is used as the initial position m and the above operation is returned until the target real-time parameter weight is output.

[0054] Preferably, the new iterative search speed d' is calculated as follows:

[0055]

[0056] Where g is the iterative search speed weight; k is the current iteration number; α, β represent the first learning factor and the second learning factor respectively; h1, h2 are random numbers in the range of [0,1]; pbest z represents the local optimal solution of the initial position m; gbest represents the global optimal solution of the initial position m; The initial position of the zth real-time parameter determined for the kth iteration;

[0057] The new position m' (i.e., the final position of the zth real-time parameter determined by the k+1th iteration) is calculated as follows:

[0058]

[0059] Compared with the prior art, the embodiments of the present invention have at least the following technical advantages:

[0060] By analyzing the above-mentioned dynamic load balancing processing method of a high-availability distributed service cluster provided by the present invention, it can be known that by arranging the cluster server node load information list in descending order according to the load information evaluation value of each server node, the current cluster server node load information list is obtained, so that the server node with a lighter load can be quickly found; by quickly determining the server node with a lower load, the client connection request can be better distributed; at the same time, the priority of the server node is also taken into account; in combination with the cluster server node load information list and the server node priority list, a suitable server node can be matched as the target server node to ensure that the connection request is distributed to the server with a lighter load and a higher priority;

[0061] By monitoring the actual load information of the target server node in real time, the load information of each server node in the cluster server node load information list is periodically updated; this can maintain the accuracy and timeliness of the load information for better load balancing. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0063] Figure 1A schematic diagram of the overall operation steps of a dynamic load balancing processing method for a high-availability distributed service cluster provided by the present invention;

[0064] Figure 2 A schematic diagram of a simulation of the operation flow of a dynamic load balancing processing method for a high-availability distributed service cluster provided by the present invention, which combines a cluster server node load information list and a server node priority list to match a target server node;

[0065] Figure 3 A schematic diagram of the operation steps of matching and obtaining a target server node in a dynamic load balancing processing method for a high-availability distributed service cluster provided by the present invention;

[0066] Figure 4 A schematic diagram of the operation steps of obtaining a target server node by analyzing and screening a dynamic load balancing processing method for a high-availability distributed service cluster provided by the present invention;

[0067] Figure 5 A schematic diagram of the operation steps of analyzing a dynamic load balancing processing method for a high-availability distributed service cluster provided by the present invention to obtain task processing scheduling values ​​for each third candidate server node;

[0068] Figure 6 A schematic diagram of the operational flow of obtaining real-time parameter weights for a dynamic load balancing processing method for a high-availability distributed service cluster provided by the present invention. DETAILED DESCRIPTION

[0069] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0070] The present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings.

[0071] Embodiment 1

[0072] like Figure 1 As shown, the present invention proposes a dynamic load balancing processing method for a high-availability distributed service cluster, comprising the following steps:

[0073] Step S10: monitoring the load information of each server node in the current server cluster in real time; calculating the load information evaluation value of each server node according to the load information and the server attribute information corresponding to each server;

[0074] The load information includes the number of client connections and the instance response creation time; the server attribute information includes the maximum number of client connections and the maximum instance response creation time;

[0075] The calculation method of the load information evaluation value is:

[0076] Load information evaluation value = w1×(number of client connections / maximum number of client connections)+w2×(1-(instance response creation time / maximum instance response creation time));

[0077] In the formula, w1 is the weight of the number of client connections; w2 is the weight of the instance response creation time;

[0078] It should be noted that the above load information includes indicators such as the number of client connections of the current server node and the instance response creation time of the current server node. Through real-time monitoring, the load status of each server node can be timely understood;

[0079] In the calculation formula of the above load information evaluation value, the number of client connections and the instance response creation time are both positive indicators, that is, the larger the value, the heavier the load; the maximum number of client connections is the maximum number of client connections that the current server node can handle, and the maximum instance response creation time is the maximum instance response creation time that the current server node can withstand when creating an instance; the maximum number of client connections and the maximum instance response creation time are data information that can be obtained by obtaining the model parameters of each server node (that is, server attribute information), and the above data information can be directly called; weight w1 and weight w2 are used to adjust the relative weights of the number of client connections and the instance response creation time in the evaluation value, so that the calculation of the load information evaluation value of the server node is more in line with the actual situation of each server node (that is, the load information evaluation value of the server node is more accurate).

[0080] By monitoring the load information of server nodes in real time, you can monitor the load information of each server node in real time, including the number of client connections and the instance response creation time of the current server node. This way, you can understand the load status of each server node in a timely manner;

[0081] By calculating the load information evaluation value of the server node, the load situation of the server node can be comprehensively considered. Through this evaluation value, the load situation of the server node can be quantitatively measured; by accurately understanding the load situation of each server node and providing a basis for subsequent load balancing decisions, this will help optimize the performance and resource utilization of the cluster and achieve better load balancing effects.

[0082] S20: Arrange the server nodes from large to small according to the load information evaluation values ​​to obtain a current cluster server node load information list;

[0083] S30: (Load balancer) obtains the connection request of the current client, parses the connection request, and obtains request information; based on the request information, matches the cluster server node load information list and the cluster server node priority list to obtain the target server node; distributes the connection request to the target server node;

[0084] The request information includes the type of the current client;

[0085] It should be noted that the above-mentioned embodiment of the present application arranges the cluster server node load information list in descending order according to the load information evaluation value of each server node to obtain the current cluster server node load information list, so that the server node with a lighter load can be quickly found; by quickly determining the server node with a lower load, the client connection request can be better allocated (usually, the server node with a lower load is more likely to be allocated to process the client connection request, that is, the server node with the lowest evaluation value in the current cluster server node load information list is more likely to be allocated to process the client connection request);

[0086] However, the solution of this embodiment not only refers to the cluster server node load information list, but also refers to the cluster server node priority list, taking the priority of the server node into consideration; combining the cluster server node load information list and the server node priority list, a suitable server node can be matched as the target server node (such as Figure 2 ) to ensure that connection requests are distributed to servers with lighter load and higher priority.

[0087] Finally, within a preset time period, the load information of each server node in the cluster server node load information list is periodically updated based on the actual load information of the current target server node in real time; the load information of each server node in the cluster server node load information list is periodically updated by real-time monitoring of the actual load information of the target server node. In this way, the accuracy and timeliness of the load information can be maintained for better load balancing.

[0088] By analyzing the technical solution of the dynamic load balancing processing method of the above-mentioned high-availability distributed service cluster, it can be known that: its specific implementation process includes: real-time monitoring of the load information of each server node; calculating the current load information evaluation value of each server node; calculating the current cluster server node load information list according to the load information evaluation value of each server node; the cluster server node load information list is arranged in descending order according to the current load information evaluation value of each server node; obtaining the current client's connection request, parsing the connection request, matching the appropriate server node in combination with the cluster server node load information list and the cluster server node priority list, and determining the current appropriate server node as the target server node; distributing the connection request to the target server node; real-time monitoring of the current target server node according to the actual load information, and periodically updating the load information of each server node in the cluster server node load information list.

[0089] In summary, the technical solution adopted in the embodiment of the present invention can realize dynamically adjusted load balancing cluster processing. By real-time monitoring and evaluating the load of server nodes, combined with the sorting of load information lists and the matching of connection requests, connection requests can be distributed to server nodes with lighter loads to achieve load balancing.

[0090] Preferably, as an implementable method, the elements in the cluster server node priority list represent the connection priorities of all types of server nodes corresponding to the current client, wherein the connection priorities of different types of server nodes are arranged in descending order.

[0091] Specifically, Figure 3 As shown, in step S30, based on the request information, the target server node is matched in combination with the cluster server node load information list and the cluster server node priority list, which specifically includes the following operation steps:

[0092] S31: Selecting a plurality of first candidate server nodes with the highest priority from the current cluster server node priority list;

[0093] S32: Using a polling method, select N second candidate server nodes that are ranked high in the cluster server node load information list;

[0094] S33: Based on the request information, analyzing and screening the first candidate server node and the second candidate server node to obtain a target server node;

[0095] The client's request is then distributed to the target server node for processing.

[0096] Through the above steps, the appropriate server node can be matched according to the client connection request and the load information of the server node, combined with the reference factors of the cluster server node load information list and the called cluster server node priority list, and the appropriate server node can be selected as the target server node, and the request can be forwarded to the node for processing. In this way, the load balancing function can be realized and the performance and availability of the system can be improved.

[0097] Preferably, as an implementable method, before "selecting the cluster server node type with the highest priority from the current cluster server node priority list", it also includes calling the cluster server node priority list corresponding to the current client according to the type of the current client.

[0098] Specifically, Figure 4 As shown, in step S33, based on the request information, the first candidate server node and the second candidate server node are analyzed and screened to obtain a target server node, including the following operation steps:

[0099] Step S331: acquiring a third server node to be selected based on the first server node to be selected and the second server node to be selected;

[0100] The third server node to be selected is a server node that belongs to the first server node to be selected and also belongs to the second server node to be selected;

[0101] It should be noted that the above-mentioned embodiment of the present application obtains the third candidate server node by screening the first candidate server node and the second candidate server node, and screens from two dimensions of the server node priority and load information list, and selects a server node with high priority and low load as the third candidate server node. In the subsequent screening process of the target server node, some server nodes with low priority or high load can be screened out, thereby reducing the amount of data for subsequent screening, thereby improving the subsequent screening efficiency.

[0102] Step S332: obtaining server attribute information of each of the third server nodes to be selected; and at the same time, obtaining the data volume of the request information;

[0103] The server attribute information includes a unit data volume processing time; the unit data volume processing time refers to the time consumed by the server node to process a unit data volume;

[0104] It should be noted that the above-mentioned embodiment of the present application improves the data basis for the data processing time of the subsequent single server node to process the data volume of the above-mentioned request information by obtaining the attribute information of the third candidate server node (that is, the above-mentioned unit data volume processing time) and the data volume of the request information.

[0105] Step S333: Calculate and obtain data processing time Ti according to the server attribute information and the data volume;

[0106] The data processing time Ti is calculated as follows:

[0107] Data processing time

[0108] It should be noted that the above-mentioned embodiment of the present application provides a data basis for subsequent further screening by calculating the data processing time of the current request information for each third candidate server node.

[0109] Step S334: performing a comprehensive analysis based on the data processing time and the real-time parameters of each of the third candidate server nodes to obtain a task processing scheduling value of each of the third candidate server nodes;

[0110] It should be noted that the above-mentioned task processing scheduling value refers to the data processing evaluation value of each third candidate server node for the current request information, that is, the evaluation value of the impact on the current server cluster when the current request information runs on each third candidate server node, and the higher the task processing scheduling value, the easier it is for the corresponding third candidate server node to be selected as the target server node and execute the processing task of the current request information.

[0111] Step S335: Select the third candidate server node corresponding to the maximum task processing scheduling value as the target server node.

[0112] It should be noted that, in the above-mentioned embodiment of the present application, the third server node is firstly selected from the selected first and second server nodes to ensure that the third node must belong to the first and second nodes at the same time, that is, the priority and load information are satisfied at the same time; further, the data processing time of the current request information is calculated for each third server node to provide a data basis for subsequent further screening; the impact of running the current request information on a specific server node on the entire server cluster is measured by analyzing and comparing the task processing scheduling values ​​of each third server node to be selected; the above-mentioned embodiment of the present application ensures the selection of the most suitable node among many server nodes to process specific requests through the above-mentioned calculation and measurement operations, which not only improves the response speed and processing efficiency of the server node, but also reduces the risk of resource waste and performance degradation, thereby optimizing the overall system operation effect and user experience.

[0113] Specifically, Figure 5As shown, in step S335, a task processing scheduling value of each third candidate server node is obtained based on a comprehensive analysis of the data processing time and the real-time parameters of each third candidate server node, including the following operation steps:

[0114] Step S3351: obtaining the real-time parameters Pi={pi1, pi2, pi3, ...pij} of each of the third server nodes to be selected; wherein pij is the j-th real-time parameter of the i-th third server node to be selected;

[0115] It should be noted that the above-mentioned real-time parameters are real-time server status data that will affect the scheduling of request information in addition to the load information of the server node, the priority information of the server node and the data processing time of the server node, such as network delay and bandwidth, data locality, data consistency information, resource usage strategy (GPU, CPU resource allocation strategy) and fault tolerance mechanism and redundant data, etc. These real-time server status data will have a great impact on the scheduling of request information. For example, when the network delay of a third candidate server node is large, the third candidate server node will process the current request information slowly, so the current request information is less likely to be scheduled to the third candidate server node;

[0116] For example, the current request information is inconsistent with the data attributes of a third candidate server node, where data attribute consistency refers to maintaining the same and correct attributes between data copies in a distributed system. In this case, the data on different copies should have the same value at a specific point in time. Data attribute consistency is very important for distributed systems because different parts of the system may process data independently and need to ensure the consistency of the final data. For example, the current request information is int type data, and the processing data of the third candidate server node is short type. If the current request information is processed by the third candidate server node, then the data conversion processing must be performed in the server node first, which undoubtedly adds more complicated computing and processing operations. At this time, it is even less likely that the third candidate server node will be scheduled to enter the current request information for data processing task operations.

[0117] Step S3352: Obtain the real-time parameter weight Qi={qip1, qip2, qip3, ...qipj} corresponding to each of the real-time parameters; wherein qipj is the weight of the j-th real-time parameter of the i-th third candidate server node; wherein the sum of each parameter in Qi is 1;

[0118] Step S3353: establishing an initial task processing scheduling matrix R based on the real-time parameters and the real-time parameter weights;

[0119] The initial task processing scheduling matrix R is expressed as:

[0120]

[0121] Wherein, (pij, qipj) represents the specific value of the jth real-time parameter of the i-th server node and its corresponding weight value;

[0122] It should be noted that in the above-mentioned initial task processing scheduling matrix R, the real-time parameters and real-time parameter weights in each matrix factor can be multiplied to calculate the parameter scheduling impact value represented by it, wherein the larger the parameter scheduling impact value is, the better the performance of the corresponding third candidate server node is (for example, the bandwidth is larger, the fault tolerance mechanism is better), which proves that the corresponding third candidate server node should be scheduled into the current request information to perform data processing tasks;

[0123] Step S3354: Calculate and obtain the task processing scheduling value of each third candidate server node based on the initial task processing scheduling matrix R and the data processing time;

[0124] The task processing scheduling value of the third candidate server node is calculated as follows:

[0125]

[0126] Where R is the initial task processing scheduling matrix; qipj is the weight of the jth real-time parameter of the i-th third candidate server node; pij is the jth real-time parameter of the i-th third candidate server node; Ti is the data processing time (i.e., the time required for the i-th third candidate server node to process the current request information data);

[0127] It should be noted that the above-mentioned embodiment of the present application comprehensively considers and analyzes the fact parameters and data processing time of each third candidate server node to ensure a more comprehensive analysis of the task processing scheduling value of each third candidate server node, so that the current request information can be transferred to the corresponding target server node. After that, the data processing task can be executed more efficiently.

[0128] During the specific implementation of the above-mentioned embodiment of the present application, the technicians also found that the weight assignment of each real-time parameter cannot be fixed. This is because the importance of each real-time parameter on different server nodes is also different. For example, when the source of the current request information is local, the locality of the data in the real-time parameter is not so important. Therefore, its weight should be appropriately adjusted down.

[0129] For another example, in the resource utilization strategy process, the server node focuses on data processing (that is, the CPU operation is given greater resources), therefore, the weight of its resource utilization strategy in the server node should be appropriately lowered; for another example, there is a server node that has a larger bandwidth and a smaller network delay than other server nodes, therefore, the network delay and bandwidth in its real-time parameters should be given a larger weight; therefore, the real-time parameter weight should be dynamically changed, however, the acquisition of the real-time parameter weight is also a direction that needs to be studied intensively in this application.

[0130] Specifically, Figure 6 As shown, in step S3352, obtaining the real-time parameter weight corresponding to each of the real-time parameters includes the following steps:

[0131] Step S33521: Initialize the iterative optimization parameters of the real-time parameter weights;

[0132] The iterative optimization parameters include a population size and an iteration counter, and the number of iterations of the iteration counter is initially 0;

[0133] It should be noted that the embodiment of the present application uses an example optimization algorithm to iteratively search for the optimal solution of each real-time parameter weight. The above population refers to the possible solutions of each real-time parameter weight in the process of searching for the optimal solution; the above population number refers to the number of possible solutions of each real-time parameter weight in the search process;

[0134] Step S33522: mapping each real-time parameter weight to the initial search space according to a preset mapping function to obtain a search grid;

[0135] It should be noted that the above search grid covers all solutions in the population and the positions of each solution;

[0136] Step S33523: Initialize each real-time parameter weight to obtain an initial position m of the initial real-time parameter weight in the search grid and an initial iterative search speed d;

[0137] It should be noted that the initial position obtained by initializing the real-time parameter weights is a position corresponding to any real-time parameter weight in the search grid that is randomly selected; the initial iterative search speed refers to the speed at which the particle moves in the search space during the initial preset iterative search for the optimal solution;

[0138] Step S33524: Calculate and obtain a first fitness f based on the initial position m and the initial iteration speed according to a preset fitness function f(x);

[0139] Step S33525: determine whether the first fitness is greater than or equal to a preset minimum fitness threshold; if so, output the initial real-time parameter weight corresponding to the initial position m as the target real-time parameter weight (i.e., the real-time parameter weight corresponding to the real-time parameter described in step S3352); if not, add 1 to the iteration number of the iteration counter to obtain the current iteration number k;

[0140] Step S33526: Perform iterative calculation and analysis based on the first fitness f and the initial position m to obtain the target real-time parameter weight.

[0141] Preferably, in step S33526, the iterative calculation and analysis based on the first fitness f and the initial position m to obtain the target real-time parameter weight includes the following steps:

[0142] Step S335261: a new iterative search speed d' is calculated based on the current number of iterations and the initial position m; that is, the new iterative search speed d' is calculated based on the iterative search speed weight, the current number of iterations, the preset first learning factor α and the preset second learning factor β, the local optimal solution of the initial position m (usually set as an empirical value) and the global optimal solution of the initial position m (usually set as an empirical value), and the initial position of the zth real-time parameter determined by the kth number of iterations;

[0143] The new iterative search speed d' is calculated as follows:

[0144]

[0145] Where g is the iterative search speed weight; k is the current iteration number; α, β represent the first learning factor and the second learning factor respectively; h1, h2 are random numbers in the range of [0,1]; pbest z represents the local optimal solution of the initial position m; gbest represents the global optimal solution of the initial position m; The initial position of the zth real-time parameter determined for the kth iteration;

[0146] Step S335262: Calculate and obtain a new position m' according to the new iterative search speed d'; that is, the calculation method of the new position m' (that is, the final position of the zth real-time parameter determined by the k+1th iteration number) is:

[0147]

[0148] Step S335263: Use the new iterative search speed d' as the initial iterative search speed and the new position m' as the initial position and return to the above operation (the above operation is step S33524) until the target real-time parameter weight is output.

[0149] It should be noted that the above-mentioned embodiment of the present application adopts a particle swarm optimization algorithm to perform search and analysis to obtain the optimal solution for each real-time parameter weight, and uses the possible solutions of each real-time parameter weight in the process of searching for the optimal solution as a population, and adopts an iterative optimization method to perform iterative search within a preset number of iterations. At the same time, by updating the search speed, the model convergence speed is accelerated, and through repeated iterative operations, it is possible to avoid falling into the optimal solution while improving the robustness of the model.

[0150] The present invention proposes a dynamic load balancing processing method for a high-availability distributed service cluster. The method arranges the cluster server node load information list in descending order according to the load information evaluation value of each server node, thereby obtaining the current cluster server node load information list, so that the server node with a lighter load can be quickly found; the server node with a lighter load can be quickly determined to better distribute the client connection request; the priority of the server node is also taken into consideration; and the cluster server node load information list and the server node priority list are combined to match a suitable server node as the target server node, thereby ensuring that the connection request is distributed to the server with a lighter load and a higher priority;

[0151] By monitoring the actual load information of the target server node in real time, the load information of each server node in the cluster server node load information list is periodically updated; this can maintain the accuracy and timeliness of the load information for better load balancing;

[0152] Furthermore, by first screening out the third server node from the selected first and second server nodes, it is ensured that the third node must belong to the first and second nodes at the same time, that is, it satisfies the priority and load information at the same time; further, by calculating the data processing time of the current request information for each third server node to be selected, a data basis is provided for subsequent further screening; by comprehensively considering and analyzing the fact parameters and data processing time of each third server node to be selected, it is ensured that the task processing scheduling value of each third server node to be selected is analyzed more comprehensively, so that the current request information can be transferred to the corresponding target server node. After the data processing task can be executed more efficiently; by analyzing and comparing the task processing scheduling values ​​of each third server node to be selected, the impact of running the current request information on the entire server cluster on a specific server node is measured; the above-mentioned embodiment of the present application ensures that the most suitable node is selected from a large number of server nodes to process a specific request through the above-mentioned calculation and measurement operations, which not only improves the response speed and processing efficiency of the server node, but also reduces the risk of resource waste and performance degradation, thereby optimizing the overall system operation effect and user experience;

[0153] At the same time, the particle swarm optimization algorithm is used for the real-time parameter weights to perform search and analysis to obtain the optimal solution of each real-time parameter weight. The possible solutions of each real-time parameter weight in the process of searching for the optimal solution are taken as the population, and the iterative optimization method is used to perform iterative search within a preset number of iterations. At the same time, the model convergence speed is accelerated by updating the search speed. Through repeated iterative operations, the model robustness is improved while avoiding falling into the optimal solution.

[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. A person skilled in the art may modify the technical solutions described in the above embodiments, or replace part or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A dynamic load balancing processing method for a high-availability distributed service cluster, characterized in that: The steps are as follows: Monitor the load information of each server node in the current server cluster in real time; calculate the load information evaluation value of each server node according to the load information and the server attribute information corresponding to each server; The load information includes the number of client connections and the instance response creation time; the server attribute information includes the maximum number of client connections and the maximum instance response creation time; The calculation method of the load information evaluation value is: Load information evaluation value = w1×(number of client connections / maximum number of client connections)+w2×(1-(instance response creation time / maximum instance response creation time)); In the formula, w1 is the weight of the number of client connections; w2 is the weight of the instance response creation time; Arrange the server nodes from large to small according to the load information evaluation value to obtain a current cluster server node load information list; Obtain a connection request from the current client, parse the connection request, and obtain request information; Based on the request information, a target server node is obtained by matching the cluster server node load information list and the cluster server node priority list; and the connection request is distributed to the target server node; The request information includes the type of the current client.

2. According to claim 1, a dynamic load balancing processing method for a high-availability distributed service cluster is characterized in that: The elements in the cluster server node priority list represent the connection priorities of all types of server nodes corresponding to the current client.

3. A dynamic load balancing processing method for a high-availability distributed service cluster according to claim 2, characterized in that: The step of matching the request information with the cluster server node load information list and the cluster server node priority list to obtain the target server node specifically includes the following steps: Selecting a plurality of first candidate server nodes with the highest priority from the current cluster server node priority list; Use polling to select the top N second candidate server nodes in the cluster server node load information list; Based on the request information, the first candidate server node and the second candidate server node are analyzed and screened to obtain a target server node.

4. The method for dynamic load balancing of a high-availability distributed service cluster according to claim 3, characterized in that: Before selecting the cluster server node type with the highest priority from the current cluster server node priority list, the method further includes calling the cluster server node priority list corresponding to the current client according to the type of the current client.

5. A dynamic load balancing processing method for a high-availability distributed service cluster according to claim 4, characterized in that: Based on the request information, analyzing and screening the first candidate server node and the second candidate server node to obtain a target server node includes the following steps: Acquire a third server node to be selected based on the first server node to be selected and the second server node to be selected; The third server node to be selected is a server node that belongs to the first server node to be selected and also belongs to the second server node to be selected; Acquire server attribute information of each of the third server nodes to be selected; and at the same time, acquire the data volume of the request information; The server attribute information includes unit data volume processing time; Calculate and obtain data processing time Ti according to the server attribute information and the data volume; The data processing time Ti is calculated as follows: Data processing time Obtaining a task processing scheduling value for each third candidate server node based on a comprehensive analysis of the data processing time and the real-time parameters of each third candidate server node; The third candidate server node corresponding to the largest task processing scheduling value is selected as the target server node.

6. A dynamic load balancing processing method for a high-availability distributed service cluster according to claim 5, characterized in that: The step of performing comprehensive analysis based on the data processing time and the real-time parameters of each of the third candidate server nodes to obtain the task processing scheduling value of each of the third candidate server nodes comprises the following steps: Obtaining the real-time parameters Pi={pi1, pi2, pi3, ...pij} of each of the third server nodes to be selected; wherein pij is the j-th real-time parameter of the i-th third server node to be selected; Obtain the real-time parameter weight Qi={qip1, qip2, qip3, ...qipj} corresponding to each of the real-time parameters; wherein qipj is the weight of the j-th real-time parameter of the i-th third candidate server node; wherein the sum of each parameter in Qi is 1; Establishing an initial task processing scheduling matrix R based on the real-time parameters and the real-time parameter weights; The task processing scheduling value of each third candidate server node is obtained based on the initial task processing scheduling matrix R and the data processing time calculation.

7. A dynamic load balancing processing method for a high-availability distributed service cluster according to claim 6, characterized in that: The initial task processing scheduling matrix R is expressed as: Wherein, (pij, qipj) represents the specific value of the jth real-time parameter of the i-th server node and its corresponding weight value; The task processing scheduling value of the third candidate server node is calculated as follows: Where R is the initial task processing scheduling matrix; qipj is the weight of the jth real-time parameter of the i-th third candidate server node; pij is the jth real-time parameter of the i-th third candidate server node; Ti is the data processing time.

8. The method for dynamic load balancing of a high-availability distributed service cluster according to claim 7, characterized in that: Obtaining the real-time parameter weight corresponding to each of the real-time parameters includes the following steps: Initialize iterative optimization parameters of the real-time parameter weights; The iterative optimization parameters include a population size and an iteration counter, and the number of iterations of the iteration counter is initially 0; Mapping each real-time parameter weight to the initial search space according to a preset mapping function to obtain a search grid; Initializing each real-time parameter weight to obtain an initial position m of the initial real-time parameter weight in the search grid and an initial iterative search speed d; Based on the initial position m and the initial iteration speed, a first fitness f is calculated according to a preset fitness function f(x); Determine whether the first fitness is greater than or equal to a preset minimum fitness threshold; if so, output the initial real-time parameter weight corresponding to the initial position m as the target real-time parameter weight; if not, add 1 to the iteration number of the iteration counter to obtain the current iteration number k; An iterative calculation and analysis is performed based on the first fitness f and the initial position m to obtain a target real-time parameter weight.

9. A dynamic load balancing processing method for a high-availability distributed service cluster according to claim 8, characterized in that: The iterative calculation and analysis based on the first fitness f and the initial position m to obtain the target real-time parameter weight includes the following steps: Calculate and obtain a new iterative search speed d' based on the current number of iterations and the initial position m; Calculate and obtain a new position m' according to the new iterative search speed d'; The new iterative search speed d' is used as the initial iterative search speed and the new position m' is used as the initial position m and the above operation is returned until the target real-time parameter weight is output.

10. A dynamic load balancing processing method for a high-availability distributed service cluster according to claim 9, characterized in that: A new iterative search speed d' is calculated by the iterative search speed weight, the current number of iterations, the first learning factor α and the second learning factor β, the local optimal solution of the initial position m and the global optimal solution of the initial position m, and the initial position of the zth real-time parameter determined by the kth number of iterations; The new iterative search speed d' is calculated as follows: Where g is the iterative search speed weight; k is the current iteration number; α, β represent the first learning factor and the second learning factor respectively; h1, h2 are random numbers in the range [0,1]; pbest z represents the local optimal solution of the initial position m; gbest represents the global optimal solution of the initial position m; The initial position of the zth real-time parameter determined for the kth iteration; The new position m' is calculated as follows: