Load balancing method and device, storage medium and electronic device

By monitoring the index usage rate of cluster nodes and performing node clustering when the critical value is reached, the problem of cluster resource load imbalance is solved, and the performance and efficiency of the cluster are improved.

CN113076197BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110423808.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-20
Publication Date
2025-02-21
Estimated Expiration
2041-04-20

AI Technical Summary

Technical Problem

Cluster resource load imbalance causes node search query latency and overall performance degradation.

Method used

By monitoring the metric usage of nodes, when the critical value is reached, node clustering is performed until the metric usage of all nodes is below the critical value.

Benefits of technology

Load balancing is realized, node search query latency is reduced, and the overall performance of the cluster is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113076197B_ABST
    Figure CN113076197B_ABST
Patent Text Reader

Abstract

The present disclosure provides a load balancing method, a load balancing device, a computer-readable storage medium, and an electronic device. The method includes: determining the indicator usage rates of multiple nodes in the current load cluster; when the indicator usage rate of at least one of the nodes reaches a critical value, performing node clustering on the load cluster until the indicator usage rates of all nodes in the load cluster are lower than the critical value. The present disclosure provides a method for solving load imbalance in cluster resources.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] As the complexity of business processing systems of enterprises increases, the amount of business that needs to be processed also increases, and clusters have become a commonly used middleware in business processing systems. A cluster is usually organized by one or more nodes to jointly hold the entire data.

[0003] Due to the differences and uncertainties in the information processing capabilities of each node server, cluster resource load imbalance may occasionally occur, resulting in cluster node search query delays and a decline in the performance of the entire cluster. Summary of the invention

[0004] The present disclosure provides a load balancing method, a load balancing device, a computer-readable storage medium and an electronic device, and further provides a method for solving load imbalance in cluster resources.

[0005] According to a first aspect of the present disclosure, a load balancing method is provided, comprising: determining an indicator usage rate of a plurality of nodes in a current load cluster; when the indicator usage rate of at least one of the nodes reaches a critical value, performing node clustering on the load cluster until the indicator usage rates of all nodes in the load cluster are lower than the critical value.

[0006] Optionally, performing node clustering on the load cluster includes: determining whether the total number of the multiple nodes is less than the number of expansion trigger nodes; if not, calculating the similarity between any two of the nodes; based on the similarity, clustering the two nodes in the load cluster into a new node, and then proceeding to determining the indicator usage rate of the multiple nodes in the current load cluster; if yes, expanding the current load cluster to add nodes, and proceeding to calculating the similarity between any two of the nodes.

[0007] Optionally, clustering two nodes in the load cluster into a new node according to the similarity includes:

[0008] The two nodes with the lowest similarity are clustered and combined into one new node.

[0009] Optionally, calculating the similarity between any two of the nodes includes:

[0010] The Euclidean distance between any two of the nodes based on the indicator usage rate is calculated, and the similarity is determined according to the Euclidean distance.

[0011] Optionally, determining the similarity according to the Euclidean distance includes:

[0012] The Euclidean distance reduced to (0, 1] is determined as the similarity.

[0013] Optionally, determining the metric usage of multiple nodes in the current load cluster includes:

[0014] The indicator usage rate of the new node is determined according to the total indicator amount and indicator usage rate of the two nodes being clustered.

[0015] Optionally, the indicator usage includes: one or more of: CPU usage, memory usage, disk space usage, interface usage and network traffic usage.

[0016] According to a second aspect of the present disclosure, a load balancing device is provided, comprising: an indicator usage rate determination module, used to determine the indicator usage rates of multiple nodes in a current load cluster; a node clustering module, used to perform node clustering on the load cluster when the indicator usage rate of at least one of the nodes reaches a critical value, until the indicator usage rates of all nodes in the load cluster are lower than the critical value.

[0017] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned load balancing method is implemented.

[0018] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing one or more programs, wherein when the one or more programs are executed by the processor, the processor implements the above-mentioned load balancing method.

[0019] In the technical solutions provided by some embodiments of the present disclosure, when the indicator utilization rate of a node reaches a critical value, two nodes can be clustered into a new node to provide services to the outside by performing node clustering on the load cluster, thereby achieving the effect of node complementarity, improving the utilization rate of the cluster, solving the problem of cluster resource load imbalance, reducing cluster node search and query delays, and improving the performance of the entire cluster.

[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 A flow chart of a load balancing method according to an exemplary embodiment of the present disclosure is schematically shown;

[0023] Figure 2 A schematic diagram of the structure of a load cluster according to an exemplary embodiment of the present disclosure is shown;

[0024] Figure 3 A schematic diagram of a structure for clustering nodes in a cluster according to an exemplary embodiment of the present disclosure is schematically shown;

[0025] Figure 4 A flow chart schematically shows the steps of a load balancing method according to an exemplary embodiment of the present disclosure;

[0026] Figure 5 A block diagram of a load balancing device according to an exemplary embodiment of the present disclosure is schematically shown;

[0027] Figure 6 A module diagram of an electronic device according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0028] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0029] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0030] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation. In addition, all the terms "first" and "second" below are only for the purpose of distinction and should not be used as limitations of the present disclosure.

[0031] Elasticsearch (ES) is a distributed, highly scalable, and highly real-time search and data analysis engine. It can easily enable large amounts of data to be searched, analyzed, and explored. Taking full advantage of the horizontal scalability of Elasticsearch can make data more valuable in a production environment. The implementation principle of Elasticsearch is mainly divided into the following steps. First, the user submits the data to the Elasticsearch database, and then the corresponding sentence is segmented through the word segmentation controller, and its weight and word segmentation results are stored in the data. When the user searches for data, the results are ranked and scored according to the weight, and then the returned results are presented to the user.

[0032] ElasticSearch cluster is a distributed system. Except for cluster status management, all other requests can be sent to any node in the cluster. This node can find out which nodes to forward to and communicate with these nodes directly. Therefore, from the perspective of network architecture and service configuration, the configuration required to build a cluster is extremely simple. Through cluster technology, relatively high benefits in performance, reliability, and flexibility can be obtained at a relatively low cost. Its task scheduling is the core technology in the cluster system.

[0033] A cluster is composed of one or more nodes that hold the entire data together. It shards the data of a single index to multiple different distributed physical machines for storage. Each shard can have multiple copies. When a node or a shard is damaged or lost, it can be restored from the copy. This can achieve high availability, fault tolerance, etc., and provide indexing and search functions together. By distributing copies to multiple servers, the query load capacity can be improved.

[0034] Load balancing clusters provide a more practical system for enterprise needs. Load balancing clusters allow the load to be distributed as evenly as possible among computer clusters. The load usually includes application processing load and network traffic load. Such a system is very suitable for providing services to a large number of users using the same set of applications. Each node can bear a certain processing load, and the processing load can be dynamically distributed among nodes to achieve load balancing. For network traffic load, when the network service program receives high inbound network traffic and cannot process it quickly, the network traffic will be sent to the network service program running on other nodes. At the same time, it can also be optimized according to the different available resources on each node or the special environment of the network. Like scientific computing clusters, load balancing clusters also distribute computing processing loads among multiple nodes. The biggest difference between them is the lack of a single parallel program running across nodes. In most cases, each node in a load balancing cluster is an independent system running separate software.

[0035] Due to the differences and uncertainties in the information processing capabilities of each node server, cluster resource load imbalance may occasionally occur. For example, when a large amount of data is written, the CPU (Central Processing Unit) and memory usage of some nodes may be too high, which will cause cluster node search and query delays and reduce the performance of the entire cluster. In order to balance the load of each node in the cluster and maintain the efficiency of cluster reading, it is necessary to consider the load balancing strategy.

[0036] In the existing technology, most of the ES cluster load balancing strategies adopt the threshold strategy. A threshold is set in advance based on the business scenario and cluster node configuration. When the load of a certain node exceeds this threshold, load adjustment is triggered. This technology takes time to set and update the threshold, increasing the cost of operation and maintenance.

[0037] The exemplary embodiment of the present disclosure provides a load balancing method that is not dependent on thresholds and has high scalability. Figure 1 , schematically shows a flow chart of a load balancing method according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the load balancing method may include the following steps:

[0038] Step S110, determining the indicator usage rates of multiple nodes in the current load cluster;

[0039] Step S120: When the indicator usage rate of at least one node reaches a critical value, node clustering is performed on the load cluster until the indicator usage rates of all nodes in the load cluster are lower than the critical value.

[0040] The load balancing method provided in the exemplary embodiment of the present disclosure can cluster two nodes into a new node to provide services to the outside by performing node clustering on the load cluster when the indicator utilization rate of the node reaches a critical value, thereby achieving the effect of node complementarity, improving the utilization rate of the cluster, solving the problem of cluster resource load imbalance, reducing cluster node search and query delay, and improving the performance of the entire cluster.

[0041] The following is a detailed description of each step of the load balancing method provided by the exemplary embodiment of the present disclosure:

[0042] In step S110 , the indicator usage rates of multiple nodes in the current load cluster are determined.

[0043] In an exemplary embodiment of the present disclosure, the indicator usage may include one or more of CPU usage, memory usage, disk space usage, interface usage, and network traffic usage.

[0044] For a processor cluster, the utilization rates of the above-mentioned various indicators are shared by multiple nodes, but the sharing of each node is not equal, so there is a situation where some nodes have high indicator utilization rates and some nodes have low indicator utilization rates.

[0045] For example, refer to Figure 2 As shown in the figure, it is assumed that a cluster has 8 nodes at the beginning: Node A, Node B, Node C, Node D, Node E, Node F, Node G and Node H. Taking CPU usage and memory usage as an example, the CPU usage of Node A is 80% and the memory usage is 30%; the CPU usage of Node B is 65% and the memory usage is 30%; the CPU usage of Node C is 50% and the memory usage is 50%; the CPU usage of Node D is 40% and the memory usage is 70%; the CPU usage of Node E is 35% and the memory usage is 20%; the CPU usage of Node F is 20% and the memory usage is 60%; the CPU usage of Node G is 10% and the memory usage is 10%; the CPU usage of Node H is 5% and the memory usage is 20%. It can be seen that the CPU usage and memory usage of Node A-Node H are not exactly the same, and some nodes have higher CPU usage or memory usage.

[0046] In step S120 , when the indicator usage rate of at least one node reaches a critical value, node clustering is performed on the load cluster until the indicator usage rates of all nodes in the load cluster are lower than the critical value.

[0047] In an exemplary embodiment of the present disclosure, if the usage rate of a certain indicator of one or more nodes reaches a critical value, it is necessary to trigger the load balancing strategy of the exemplary embodiment of the present disclosure to perform node clustering on the load cluster.

[0048] Assuming that the critical value of CPU usage is 60% and the critical value of memory usage is also 60% for example, the CPU usage of the above-mentioned nodes A and B has reached the critical value, and the memory usage of nodes D and F has reached the critical value.

[0049] In an exemplary embodiment of the present disclosure, the critical value of the indicator usage rate can be set according to actual conditions, that is, the critical values ​​of CPU usage, memory usage, disk space usage, interface usage and network traffic usage can be set to different sizes according to actual conditions, and this exemplary embodiment does not make any special limitations on this.

[0050] In an exemplary embodiment of the present disclosure, the above-mentioned node clustering for the load cluster may specifically include: first, it is necessary to determine whether the total number of multiple nodes is less than the number of expansion trigger nodes. If it is not less than the number of expansion trigger nodes, that is, if not, calculate the similarity between any two nodes.

[0051] Assume that the number of expansion trigger nodes is 2. Figure 1 The cluster shown has 8 nodes initially, that is, the number of nodes in the cluster is greater than the number of expansion trigger nodes, and there is no need to expand the nodes in the cluster, and the similarity calculation between two nodes can be directly performed. Among them, the number of expansion trigger nodes can also take other values, and the exemplary embodiments of the present disclosure do not specifically limit this.

[0052] In practical applications, there are many methods for calculating similarity, such as Pearson algorithm, Manhattan distance algorithm, Euclidean distance algorithm, etc. The exemplary embodiment of the present disclosure uses Euclidean distance as an example to illustrate the similarity calculation between two nodes:

[0053] Assume that among the eight nodes above, the multi-dimensional indicator usage of each node is represented as: x: CPU usage, y: memory usage, etc. Now take the indicator usage of the two dimensions x and y as an example, and represent the indicator usage of the two dimensions with a two-dimensional vector. For example, the CPU usage of node A is 80%, and the memory usage is 30%, which is represented by the vector D. a (X a ,Y a )=(80,30); Similarly, the vectors of other nodes can be obtained as follows:

[0054] D b (X b ,Y b )=(65,30),D c(X c ,Y c )=(50,50),D d (X d ,Y d )=(40,70),D e (X e ,Y e )=(35,20),D f (X f Y f )=(20,60),D g (X g ,Y g )=(10,10),D h (X h ,Y h )=(5,20).

[0055] Next, the distance between two node vectors can be calculated using the Euclidean distance algorithm, referring to formula (1):

[0056]

[0057] In order to facilitate the comparison of similarity between nodes, the Euclidean distance calculated by formula (1) can be reduced to (0, 1], and the similarity is obtained as shown in formula (2):

[0058]

[0059] The larger the value of the similarity sim(a,b), the smaller the distance d(a,b) between the two nodes. In other words, the closer the distance between the two nodes, the greater their similarity.

[0060] After obtaining the similarity between two nodes, the two nodes in the load cluster can be clustered into a new node according to the similarity. That is, the total amount of indicators corresponding to the two nodes is superimposed. If it is clustering node A and node B, then the number of CPU cores of node A and the number of CPU cores of node B are superimposed, and the memory size of node A and the memory size of node B are superimposed.

[0061] In an exemplary embodiment of the present disclosure, if the number of nodes in the current load cluster is greater than 2, then the calculated multiple similarities are compared, and the two nodes with the lowest similarity are clustered into a new node, wherein the two nodes with the lowest similarity are more complementary. Table 1 exemplifies the results of similarity calculation for the above 8 nodes:

[0062] Table 1

[0063] Node A Node B Node C Node D Node E Node F Node G Node H Node A - - - - - - - - Node B 0.0625 - - - - - - - Node C 0.0270 0.0384 - - - - - - Node D 0.0173 0.0207 0.0428 - - - - - Node E 0.0212 0.0306 0.0289 0.0195 - - - - Node F 0.0147 0.0181 0.0306 0.0428 0.0228 - - - Node G 0.0135 0.0168 0.0173 0.0146 0.0358 0.0192 - - Node H 0.0130 0.0161 0.0181 0.0161 0.0322 0.0228 0.0821 -

[0064] As can be seen from Table 1, among the 28 similarities calculated, the similarity between node A and node H is the smallest. Therefore, node A and node H can be clustered into a new node. At this time, the number of CPU cores of the new node is the sum of the number of CPU cores of node A and the number of CPU cores of node H, and the memory size of the new node is the sum of the memory size of node A and the memory size of node B.

[0065] In the exemplary embodiment of the present disclosure, after clustering two nodes in a load cluster, it is necessary to recalculate and confirm the indicator usage rates of multiple nodes in the current load cluster. In the process of determining the indicator usage rate of the new node, it is necessary to determine it based on the total indicator amount and indicator usage rate of the two nodes being clustered.

[0066] For example, the calculation formula for the indicator usage rate of the new node formed by clustering nodes A and H is as follows:

[0067]

[0068]

[0069] Assuming that the number of CPU cores of node A is equal to that of node H, and the memory size of node A is equal to that of node H, then the calculated CPU usage of the new node is 42.5%, and the memory usage of the new node is 25%.

[0070] It can be seen that the new load cluster consisting of the new node and Node B, Node C, Node D, Node E, Node F, and Node G, a total of 7 nodes, becomes the current load cluster. In the current load cluster, there are still indicators whose usage rates have reached the critical value. Therefore, it is necessary to continue to perform node clustering on the load cluster until the indicator usage rates of all nodes in the clustered new load cluster are lower than the critical value. Figure 3 The schematic diagram of the structure of clustering the node A-node H listed above is shown. Figure 3 In the example, after nodes A and H are clustered with new nodes, they are clustered with node D, and then with node E. In addition, nodes C and F are clustered, and nodes B and G are clustered, and finally they are clustered into one cluster. At this time, if there is no new node to expand, the clustering ends.

[0071] In actual applications, there may be a situation where after the nodes in the load cluster have been clustered multiple times, there are still nodes whose indicator usage rate reaches the critical value. In this case, it can be determined whether the total number of multiple nodes in the current load cluster is less than the number of expansion trigger nodes. If so, that is, less than the number of expansion trigger nodes, the current load cluster process is expanded by adding a node. The added node is a brand new unused node. Then, the similarity of the newly added node and the nodes after multiple clustering is calculated to determine the two nodes with the lowest similarity. These two nodes are clustered until the indicator usage rate of all nodes in the new load cluster after clustering is lower than the critical value.

[0072] In practical applications, since the indicator usage rate of the newly added node is 0, after clustering with the nodes with an indicator usage rate greater than 60%, new nodes with an indicator usage rate less than the critical value will inevitably be obtained, thereby achieving the purpose of reducing the indicator usage rate of the nodes in the current load cluster through clustering. In turn, the overall utilization of resources can be improved.

[0073] The load balancing method provided in the exemplary embodiment of the present disclosure can expand the indicators of the nodes, not limited to the indicator range listed above, which helps to integrate more suitable complementary nodes and further improve the overall utilization of resources.

[0074] The following will refer to Figure 4 The steps of the load balancing method according to the exemplary embodiment of the present disclosure are described as follows:

[0075] In step S401, determine the indicator usage rate of multiple nodes in the current load cluster, referred to as determining the indicator usage rate; in step S402, enter judgment condition 1 to determine whether the indicator usage rate of a node reaches the critical value; if the indicator usage rate of at least one node reaches the critical value, enter step S403 to perform node clustering on the load cluster; in step S404, enter judgment condition 2 to determine whether the total number of multiple nodes is less than the number of expansion trigger nodes; if not, that is, it is greater than the number of expansion trigger nodes, enter step S405 to calculate the similarity between any two nodes, referred to as calculating the similarity, and enter step S406, according to the similarity, cluster the two nodes into a new node, referred to as clustering to obtain a new node, and transfer to step S401. If yes, that is, it is less than the number of expansion trigger nodes, enter step S407 to expand the current load cluster to add nodes, referred to as node expansion, and transfer to step S405, and end when the indicator usage rates of all nodes are lower than the critical value.

[0076] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0077] Furthermore, this exemplary embodiment also provides a load balancing device, wherein the device embodiment part may inherit the relevant description in the method embodiment, so that the device embodiment can obtain the support of the relevant specific description in the method embodiment.

[0078] Figure 5 The block diagram of the load balancing device according to the exemplary embodiment of the present disclosure is schematically shown. Figure 5 According to an exemplary embodiment of the present disclosure, a load balancing device 500 may include: an indicator usage rate determination module 510 and a node clustering module 520 .

[0079] Specifically, the indicator utilization rate determination module 510 can be used to determine the indicator utilization rates of multiple nodes in the current load cluster; the node clustering module 520 can be used to perform node clustering on the load cluster when the indicator utilization rate of at least one node reaches a critical value until the indicator utilization rates of all nodes in the load cluster are lower than the critical value.

[0080] In an exemplary embodiment of the present disclosure, the node clustering module 520 can be used to determine whether the total number of multiple nodes is less than the number of expansion trigger nodes; if not, calculate the similarity between any two nodes; based on the similarity, cluster the two nodes in the load cluster into a new node, and then proceed to determine the indicator usage rate of multiple nodes in the current load cluster; if yes, expand the current load cluster to add nodes, and proceed to calculate the similarity between any two nodes.

[0081] In an exemplary embodiment of the present disclosure, the node clustering module 520 may be used to cluster two nodes with the lowest similarity into a new node.

[0082] In an exemplary embodiment of the present disclosure, the node clustering module 520 may be used to calculate the Euclidean distance between any two nodes based on the indicator usage rate, and determine the similarity according to the Euclidean distance.

[0083] In an exemplary embodiment of the present disclosure, the node clustering module 520 may be used to determine the Euclidean distance reduced to (0, 1] as the similarity.

[0084] In an exemplary embodiment of the present disclosure, the indicator usage rate determination module 510 may be used to determine the indicator usage rate of the new node according to the total amount of indicators and the indicator usage rates of the two nodes to be clustered.

[0085] In an exemplary embodiment of the present disclosure, the above-mentioned indicator usage rate includes: one or more of: CPU usage rate, memory usage rate, disk space usage rate, interface usage rate and network traffic usage rate.

[0086] Since the functional modules of the load balancing device in the embodiment of the present disclosure are the same as those in the above method implementation, they will not be described in detail here.

[0087] Through the description of the above implementation, it is easy for those skilled in the art to understand that the exemplary implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0088] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0089] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0090] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0091] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0092] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present invention is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0093] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), and a display unit 640.

[0094] The storage unit 620 stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 Step S110 shown in the figure, determining the indicator usage rate of multiple nodes in the current load cluster; step S120, when the indicator usage rate of at least one node reaches a critical value, performing node clustering on the load cluster until the indicator usage rates of all nodes in the load cluster are lower than the critical value.

[0095] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0096] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0097] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0098] The electronic device 600 may also communicate with one or more external devices 670 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0099] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0100] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0101] The program product for implementing the above method according to an embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0102] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0103] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0104] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0105] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0106] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0107] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered merely as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

[0108] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A load balancing method, characterized in that: include: Determine the metric usage of multiple nodes in the current load cluster; When the indicator usage rate of at least one of the nodes reaches a critical value, performing node clustering on the load cluster until the indicator usage rates of all nodes in the load cluster are lower than the critical value; The step of performing node clustering on the load cluster until the indicator usage rates of all nodes in the load cluster are lower than the critical value includes: If the total number of the plurality of nodes is not less than the number of expansion triggering nodes, the similarity between any two of the nodes is calculated, and based on the similarity, the two nodes in the load cluster are clustered and combined into a new node, and then transferred to the step of determining the indicator usage rate of the plurality of nodes in the current load cluster; The step of calculating the similarity between any two of the nodes and clustering the two nodes in the load cluster into a new node according to the similarity includes: The similarity is calculated based on the indicator usage rate of any two of the nodes, wherein two nodes with low similarity have strong complementarity; The two nodes with the lowest similarity are clustered and combined into one new node.

2. The method according to claim 1, characterized in that Performing node clustering on the load cluster also includes: If the total number of the multiple nodes is less than the number of expansion trigger nodes, the current load cluster is expanded to add nodes, and the process of calculating the similarity between any two of the nodes is started.

3. The method according to claim 1 or 2, characterized in that: The calculating the similarity based on the indicator usage rate of any two nodes comprises: The Euclidean distance between any two of the nodes based on the indicator usage rate is calculated, and the similarity is determined according to the Euclidean distance.

4. The method according to claim 3, characterized in that Determining the similarity according to the Euclidean distance includes: The Euclidean distance reduced to (0, 1] is determined as the similarity.

5. The method according to claim 1 or 2, characterized in that: Determine the usage of metrics for multiple nodes in the current load cluster including: The indicator usage rate of the new node is determined according to the total indicator amount and indicator usage rate of the two nodes being clustered.

6. The method according to claim 1, characterized in that The indicator usage rate includes: one or more of: CPU usage rate, memory usage rate, disk space usage rate, interface usage rate and network traffic usage rate.

7. A load balancing device, characterized in that: include: The indicator usage rate determination module is used to determine the indicator usage rates of multiple nodes in the current load cluster; A node clustering module, configured to perform node clustering on the load cluster when the indicator usage rate of at least one of the nodes reaches a critical value, until the indicator usage rates of all nodes in the load cluster are lower than the critical value; The step of performing node clustering on the load cluster until the indicator usage rates of all nodes in the load cluster are lower than the critical value includes: If the total number of the plurality of nodes is not less than the number of expansion triggering nodes, the similarity between any two of the nodes is calculated, and based on the similarity, the two nodes in the load cluster are clustered and combined into a new node, and then transferred to the step of determining the indicator usage rate of the plurality of nodes in the current load cluster; The similarity between any two nodes is calculated, and based on the similarity, two nodes in the load cluster are clustered into a new node, including: The similarity is calculated based on the indicator usage rate of any two of the nodes, wherein two nodes with low similarity have strong complementarity; The two nodes with the lowest similarity are clustered and combined into one new node.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the load balancing method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: include: processor; A memory, used to store one or more programs, when the one or more programs are executed by the processor, enables the processor to implement the load balancing method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Cloud computing high-availability cluster resource management method

    CN108600149A