Method, device and equipment for determining computational node

By dividing the load units in the cloud computing cluster into the same load class and adopting a multi-optimization target planning model, the complexity of load balancing problems in the cloud computing cluster is solved, and the load balancing efficiency and system performance are improved.

CN119829288APending Publication Date: 2025-04-15ZHEJIANG UNIV +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411908815.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In cloud computing clusters, the existing technology is difficult to effectively solve the load balancing problem, especially in large-scale and high-complex load distribution scenarios, resulting in waste of resources and poor performance.

Method used

By dividing load units with similar resource requirements into the same load class and adopting a multi-optimization target planning model, we determine the number of load units allocated by each load class in each computing node, and optimize the load migration cost, node load balancing and calculation node cost.

Benefits of technology

It improves load balancing efficiency, reduces the amount and difficulty of solving the planning model, improves the solution efficiency, and ensures the better performance and resource configuration of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829288A_ABST
    Figure CN119829288A_ABST
Patent Text Reader

Abstract

The invention provides a method, a device and equipment for determining a computing node. According to the scheme, the method comprises the steps that firstly, a load unit set is divided into at least two load classes according to the resource demand quantity of each load unit in the load unit set to be distributed, and the range of the resource demand quantity of the load units contained in the same load class is smaller than or equal to a preset resource quantity threshold value; then, a planning model of multiple optimization targets is adopted, the load unit distribution number of each load class at each computing node is determined, and the multiple optimization targets comprise a first optimization target for load migration cost, a second optimization target for node load balance degree and a third optimization target for computing node cost; and then, according to the distribution number of the load units, determining computing nodes for bearing each load unit in the load unit set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of load balancing, and in particular to a method for determining a computing node. The present application also relates to an apparatus and device for determining a computing node. Background Art

[0002] In cloud computing clusters, resource integration and load balancing directly affect the performance and availability of the system. Reasonable load balancing strategies, continuous detection, and timely tuning can improve the overall performance of the system and avoid resource waste, which is the basis for achieving high-performance clusters. In actual cloud computing cluster environments, the situation is often very complicated. Physical container expansion and contraction is the basic capability to achieve dynamic load balancing in cloud computing clusters. It ensures that the system always maintains better performance and resource utilization efficiency under different load conditions by accurately adjusting the supply of computing resources.

[0003] Load balancing not only needs to consider the cost of physical containers, but also needs to consider resource occupancy, load migration costs and other goals at the same time, in order to ensure high reliability of services while controlling costs. The system faces large-scale and highly complex load distribution problems. The cluster contains many physical containers and loads. The scheduling decision space is high-dimensional, and there are many factors that affect the system load (for example, CPU occupancy, memory capacity, disk capacity, etc.). The capacity specifications and performance of each container are different. In order to achieve better performance and resource allocation of the system, it is necessary to comprehensively consider these multi-dimensional factors and solve the load balancing problem quickly and accurately. Summary of the invention

[0004] In view of this, embodiments of the present application provide methods, devices and equipment for determining computing nodes to improve load balancing efficiency.

[0005] According to a first aspect of an embodiment of the present application, a method for determining a computing node is provided, including:

[0006] According to the resource demand of each load unit in the load unit set to be allocated, the load unit set is divided into at least two load classes; the range of the resource demand of the load units included in the same load class is less than or equal to a preset resource threshold;

[0007] A planning model with multiple optimization objectives is used to determine the number of load units allocated to each computing node for each load class; the multiple optimization objectives include a first optimization objective for load migration cost, a second optimization objective for node load balancing, and a third optimization objective for computing node cost;

[0008] According to the allocated number of load units, a computing node that carries each load unit in the load unit set is determined.

[0009] According to a second aspect of an embodiment of the present application, a device for determining a computing node is provided, including:

[0010] A load classification module, configured to divide the load unit set into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated; the range of the resource demand of the load units included in the same load class is less than or equal to a preset resource threshold;

[0011] A planning and solving module, for determining the number of load units to be allocated to each computing node for each load class by using a planning model with multiple optimization objectives; the multiple optimization objectives include a first optimization objective for load migration cost, a second optimization objective for node load balancing, and a third optimization objective for computing node cost;

[0012] The load distribution module is used to determine the computing node that carries each load unit in the load unit set according to the allocated number of the load units.

[0013] According to a third aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the method for determining computing nodes when executing the computer instructions.

[0014] An embodiment of the present specification can achieve at least the following beneficial effects: when dealing with load balancing problems, by dividing load units with similar resource requirements into the same load class, unified decisions can be made based on the class when solving the subsequent planning model, thereby reducing the amount of data when solving the subsequent planning model, reducing the difficulty of solving the model, and improving the efficiency of solving the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0016] Figure 1 A flowchart of a method for determining a computing node provided in an embodiment of this specification;

[0017] Figure 2 A schematic diagram of an execution process of a load balancing task in an actual application scenario provided in an embodiment of this specification;

[0018] Figure 3 The embodiments of this specification provide corresponding to Figure 1A schematic diagram of a structure of a device for determining a computing node;

[0019] Figure 4 The embodiments of this specification provide corresponding to Figure 1 A structural diagram of a device for determining a computing node. DETAILED DESCRIPTION

[0020] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0021] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0022] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0023] First, the terms involved in one or more embodiments of the present application are explained.

[0024] Load balancing: The purpose of load balancing is to ensure that the workload is evenly distributed among all nodes in the cluster, and to avoid the situation where some nodes are overloaded while other nodes are idle by properly configuring and managing all available resources in the cluster (such as CPU, memory, storage, and network bandwidth, etc.). Load balancing can improve the overall performance and reliability of the system and achieve efficient data access and processing.

[0025] Load classification: Load classification refers to classifying loads according to their specifications (i.e., the resource requirements of the loads), grouping loads with similar specifications into the same category, reducing the scale of load types and accelerating the solution of load balancing solutions.

[0026] The packing problem is a classic combinatorial optimization problem that requires putting a group of items into as few containers (or boxes) as possible. The goal is to minimize the number of containers used, each with a certain capacity, while ensuring that the total weight or volume of the items packed into each container does not exceed the capacity of the container.

[0027] Heuristic Algorithms: Heuristic algorithms are a class of strategies or methods used to solve complex problems that are difficult to find optimal solutions to in a reasonable amount of time using traditional algorithms. Heuristic algorithms are not guaranteed to find the optimal solution, but they can usually find an acceptable approximation to the solution in a relatively short amount of time.

[0028] Integer programming: refers to a mathematical programming problem in which the variables (all or part) in the planning are restricted to integers. Mixed integer programming: some variables can take continuous values, while other variables need to take integer values.

[0029] In the related art, in order to ensure the quality and speed of the solution in the process of solving the load balancing problem, a common method is to model it as an operations research optimization model and use the solver to solve it efficiently and accurately. If the cost of computing resources, the overall load occupancy rate and the load migration cost target are considered, combined with the hard constraint of ensuring that each node does not exceed its processing capacity, the load balancing problem can be modeled as a mixed integer linear programming problem.

[0030] In the related art, the objective function of the planning model constructed is in the form of:

[0031]

[0032] The constraints of the planning model are as follows:

[0033]

[0034]

[0035]

[0036]

[0037]

[0038]

[0039]

[0040] Where i represents the load number; the set Represents a collection of loads;

[0041] j represents the number of the computing node; the set represents the set of running nodes before load balancing; set A represents the set of newly added nodes after load balancing; j i Indicates the node where load i is located before load balancing;

[0042] t represents the label of the resource dimension; set Represents a collection of resource dimensions;

[0043] x represents the number of load distributions in the computing nodes; x i,j represents the final load distribution, that is, whether load i is placed in computing node j; x i,j represents the final load-node distribution, when load i is located at node j, x i,j =1, otherwise x i,j =0;

[0044] α represents the weight of a single load migration cost;

[0045] y represents the maximum occupancy rate of resources in all computing nodes; y t Indicates the maximum occupancy rate of resource t in all computing nodes;

[0046] w represents the weight of load balancing; w t The weight representing the load balancing degree of resource t;

[0047] z represents the usage plan of the computing node; j Indicates whether computing node j is used;

[0048] p represents the cost weight of the computing node; p j represents the cost weight of computing node j;

[0049] α, w t and p j The values ​​of are all [0,1] and are set as hyperparameters before running the solution.

[0050] The first term in the objective function represents the estimated load migration cost. More specifically, for each load i, for all nodes except the node j where it is currently located, i,j If load i is not migrated, remove the x of the node where it is located. i,j The sum is 0; if load i is migrated, there must be a j such that x i,j = 1. In the first term of the objective function, the summation term is the count of the migration load multiplied by the single migration cost coefficient α, which is the total migration cost target.

[0051] The second term in the objective function represents the node load balance. Specifically, y represents the maximum occupancy rate of the resource. The computing node will bear some load during operation. For each resource, the occupancy rate of the load consumed in the computing node can be calculated, y t It represents the maximum occupancy rate of resource t in all nodes. When the total load is fixed, the more balanced the load of the computing node is, the smaller the parameter is, and the better the target is. For fixed nodes and loads (that is, each load and node must be used), the maximum occupancy rate can reflect the overall utilization efficiency of the computing nodes, that is, the more balanced, the lower the maximum occupancy rate; when planning whether the node is used, this item can also represent the overall utilization rate of the computing nodes. In order to ensure that the newly added load does not affect the normal operation of the service before the next load balancing optimization, the utilization rate of the computing nodes cannot be too high, and a balance needs to be made with the computing node cost. For example, there are 5 computing nodes involved, and for resource t (for example, CPU resources), the occupancy rates in the 5 computing nodes are 70%, 60%, 30%, 40%, and 50% respectively. Then, y t The value of is the largest of the above five occupancy rates, namely 70%.

[0052] The third term in the objective function represents the cost of the computing node. Specifically, z represents the usage plan of the computing node, z j Indicates whether computing node j is used, multiplied by the cost weight p of each computing node j j , which is the overall goal of calculating node cost.

[0053] Formula (1) is the constraint condition for the number of new nodes, where A new Indicates the number threshold of newly added nodes;

[0054] Formula (2) is the load balancing constraint condition, where: Indicates the maximum occupancy threshold of resource t in all computing nodes;

[0055] Formula (3) is the load limit constraint of the computing node, which means that the load carried by each computing node cannot exceed its specification limit (that is, the resource capacity specification limit). For resource t and node j, the left formula represents the total load of the node, and the right formula represents the resource capacity specification limit of the computing node, u i and c j They represent the load specifications and the resource capacity specifications of the computing nodes respectively;

[0056] Formula (4) and (5) are load constraints. Formula (4) indicates that each load must be carried by one node. Formula (5) indicates that x i,j The value of is 0 or 1;

[0057] Formula (6) and Formula (7) are the computational node constraints, where I represents the set The size of; Formula (6) indicates that each node cannot carry any load when not in use, I represents the load number, when the node is not in use z j is 0, the left formula indicates the total load borne by node j, and the right formula indicates whether node j can bear the load.

[0058] In the related technology, after the load balancing problem is modeled as above, the solver can be used to solve it and obtain an accurate solution, but as the node and load scale increase, the solution time will increase accordingly. In large-scale distributed cloud computing clusters, the efficiency of the load balancing algorithm is crucial because the system needs to quickly process a large number of nodes and tasks in a dynamically changing environment. An efficient load balancing solution must be able to make optimal decisions for a large number of distributed resources within a limited time, ensure real-time response to cluster state changes, and maintain the overall performance and reliability of the system. When the scale increases to a certain extent, the solution time will be difficult to meet the needs of solving the load balancing problem. And in the step of solving the migration path, the migration path may be unsolvable due to insufficient capacity of the node resources planned to be used, resulting in failure of load balancing in the scheduling process.

[0059] In order to address the defects in the prior art, in the embodiments of this specification, in order to improve the solution efficiency and cope with large-scale load balancing problems, a variable dimension reduction strategy is proposed, which significantly reduces the number of decision variables by classifying load units with similar characteristics.

[0060] Based on the solution of the embodiment of this specification, the decision granularity of the planning and solving process is adjusted, from the fine decision for each independent load unit to the overall allocation decision for each type of load. Specifically, a two-stage solution method is adopted. In the first stage, the optimized mixed integer linear programming model with load class as the decision granularity is solved to obtain the overall allocation plan for each type of load (that is, the number of each type of load allocated to each node is obtained); the second stage: based on the results of the first stage, fine-grained load unit allocation is performed through, for example, a greedy algorithm, and finally an accurate placement plan for each specific load unit is obtained.

[0061] The embodiments of this specification provide a method for determining a computing node. The present application also relates to an apparatus for determining a computing node, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.

[0062] Figure 1 A flowchart of a method for determining a computing node provided in an embodiment of this specification.

[0063] From the program perspective, the execution subject of the process can be a program installed on an application server or an application terminal. It can be understood that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities.

[0064] like Figure 1 As shown, the process may include the following steps:

[0065] Step 102: Divide the load unit set into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated; the range of the resource demand of the load units included in the same load class is less than or equal to a preset resource threshold.

[0066] In a load balancing scenario, the object of load balancing, i.e., the load unit, may specifically include computing tasks, data requests, and other types of business processing requests, etc., and may include any transaction that requires resource coordination and allocation.

[0067] In actual application, for each load unit, there may be at least one resource requirement in a resource dimension. In actual application, the resource requirement type may include at least one of CPU resources, memory resources, storage resources, and GPU resources, but may not be limited thereto.

[0068] In the embodiments of the present specification, in order to address the problem of long time and low efficiency in the planning and solving process of large-scale load balancing problems, a variable dimension reduction strategy is proposed. Specifically, the load units to be processed can be divided into at least two load categories according to similar characteristics in terms of resource requirements, thereby reducing the number of decision variables in the planning and solving process to improve the solving efficiency.

[0069] In the process of classifying load units, the standard can be that the range of resource requirements of load units contained in the same load class is less than or equal to the preset resource threshold. Among them, the range of the set, also known as the range error or the full range (Range), is a statistic used in statistics to represent the difference between the maximum and minimum values ​​in a set of data. The range is a simple method to measure the degree of discreteness of data, reflecting the fluctuation range of values ​​in the data set. The larger the range, the more dispersed the distribution of the data; the smaller the range, the more concentrated the distribution of the data. In the embodiments of the present specification, by controlling the range of the load class, the distribution of resource requirements of each load unit in the load class obtained after classification can be made relatively concentrated, so as to reduce the difficulty of subsequent processing when making precise allocations based on the preliminary planning results, and improve the overall load balancing effect and efficiency of the scheme.

[0070] Step 104: Use a planning model with multiple optimization objectives to determine the number of load units allocated to each load class at each computing node; the multiple optimization objectives include a first optimization objective for load migration cost, a second optimization objective for node load balancing, and a third optimization objective for computing node cost.

[0071] In the embodiments of the present specification, a multi-objective planning model can be adopted, and specifically, the optimization goals can be to minimize the load migration cost, maximize the node load balance, and minimize the computing node cost, and the objective function can be constructed with the number of migrations of the classified load in the computing nodes, the maximum occupancy rate of resources in all computing nodes, and the usage plan of the computing nodes as decision variables.

[0072] Specifically, the number of variables used in calculating the load migration cost is not the number of loads, but the number of classified load classes. Therefore, the calculation of the load migration cost in the objective function of the multi-objective programming model can be calculated based on the number of migrations of the classified loads in the computing nodes. Based on this method, while still having the ability to solve the problem of increasing or decreasing cluster computing nodes, the scale of variables is greatly reduced and the utilization efficiency of variables is improved.

[0073] Step 106: Determine a computing node that carries each load unit in the load unit set according to the allocated number of load units.

[0074] In practical applications, when the computing node that carries each load unit in the load unit set is determined, the load distribution results of all the load units in the load unit set to be processed are obtained.

[0075] For example, for the load unit set {a, b, c, d, e} and computing nodes A and B, assume that, in step 102, according to the resource demand of each load unit in the load unit set {a, b, c, d, e}, the load unit set {a, b, c, d, e} is divided into two load classes {a, b, c} and {d, e}, and a, b and c are recorded as class p, and d and e are recorded as class q; then, in step 104, by constructing a planning model and solving it, the distribution quantity of class p and class q loads on nodes A and B can be determined, assuming that 2 class p and 1 class q are planned to node A, and 1 class p and 1 class q are planned to node B; then, in step 106, the specific distribution position of each load unit can be further determined based on the planning result of the load class in the previous step, assuming that a and c in class p and d in class q can be allocated to node A, and b in class p and e in class q can be allocated to node B.

[0076] It should be understood that in the methods described in one or more embodiments of this specification, the order of some steps can be adjusted according to actual needs, or some steps can be omitted.

[0077] Figure 1 The method in , when dealing with load balancing problems, divides load units with similar resource requirements into the same load class, so that when solving the subsequent planning model, unified decisions can be made based on the class, which reduces the amount of data in solving the subsequent planning model, reduces the difficulty of solving, and improves the efficiency of solving.

[0078] based on Figure 1 The present specification also provides some improved implementation methods of the method, which are described below.

[0079] In at least some embodiments of the present specification, a specific scheme for classifying load units based on resource requirements of the load units is provided.

[0080] Optionally, when load balancing is performed on the load units to be allocated, only one resource dimension of each load unit may be considered, for example, only one resource among CPU resources, GPU resources, memory resources, storage resources, network bandwidth resources, etc. may be considered. That is, each load unit may have one resource dimension. According to the resource demand of each load unit in the load unit set for the resource dimension, the load units are classified to obtain a classification result; the classification result includes at least two classifications.

[0081] In practical applications, it is usually necessary to consider multiple resource dimensions. In this case, first, each dimension (such as CPU, memory, storage, etc.) can be analyzed independently, and in each dimension, classification can be performed by, for example, using adaptive thresholds and recursive binary clustering methods; then, comprehensive classification can be performed in combination with each dimension, achieving efficient classification of multi-dimensional loads and significantly reducing the complexity of subsequent optimization problems.

[0082] Optionally, when load balancing is performed on the load units to be allocated, at least two resource dimensions of each load unit may be considered, for example, two or more resources such as CPU resources, GPU resources, memory resources, storage resources, network bandwidth resources, etc. may be considered. In this regard, the embodiments of this specification provide a load balancing solution for situations where at least two resource dimensions need to be considered, and further provide a classification solution for situations where at least two resource dimensions need to be considered for load balancing.

[0083] Specifically, dividing the load unit set into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated may include: first, with respect to a target resource dimension in at least two resource dimensions, the load units in the load unit set may be classified according to the target resource demand of each load unit in the load unit set for the target resource dimension, so as to obtain a target pre-classification result corresponding to the target resource dimension; the target pre-classification result includes at least two pre-classifications; the range of the target resource demand of the load units included in the same pre-classification is less than or equal to the target resource threshold corresponding to the target resource dimension; and then, based on the target pre-classification results corresponding to at least some of the resource dimensions in the at least two resource dimensions, the load units belonging to the same pre-classification in the target pre-classification results corresponding to at least some of the resource dimensions may be divided into the same load class.

[0084] The following description is made by taking the example that each load unit has two resource dimensions. First, the load units in the load unit set may be classified according to the first resource demand of the first resource dimension of the at least two resource dimensions, to obtain a first pre-classification result corresponding to the first resource dimension, wherein the first pre-classification result includes at least two first pre-classifications, and the range of the first resource demand of the load units included in the same first pre-classification is less than or equal to a first preset resource threshold; and the load units in the load unit set may be classified according to the second resource demand of the second resource dimension of the at least two resource dimensions, to obtain a second pre-classification result corresponding to the second resource dimension, wherein the second pre-classification result includes at least two second pre-classifications, and the range of the second resource demand of the load units included in the same second pre-classification is less than or equal to a second preset resource threshold; thereafter, the load units belonging to the same first pre-classification and the same second pre-classification may be classified into the same load class based on the first pre-classification result and the second pre-classification result. In other words, the load units classified into the same pre-classification in both the first resource dimension and the second resource dimension may be determined as belonging to one load class based on the first pre-classification result and the second pre-classification result.

[0085] Similarly, when it is necessary to consider three or more resource dimensions of each load unit, you can refer to the above example in which each load unit has two resource dimensions, first determine the pre-classification results under each resource dimension, and then classify the load units that belong to the same pre-classification in each classification result into the same load class.

[0086] In addition, in actual application, in order to save computing resource consumption in the load balancing process and improve the load balancing effect, when the actual operation of each load unit requires the use of the first number of resource dimensions, the load class can be divided based on the pre-classification results corresponding to the second number of resource dimensions, wherein the first number is an integer greater than or equal to 2, and the second number is a positive integer less than or equal to the first number. Optionally, the load class can be divided only with reference to the key dimensions in the multiple resource dimensions. In practice, it can be determined which of the multiple resource dimensions are key dimensions according to actual needs. For example, for some resource dimensions, if the demand of each load unit is low, then it can be used as a non-key dimension and not as a reference for classification. For example, if each load unit includes 3 resource dimensions, pre-classification can be performed for 2 of the resource dimensions, and the load class can be comprehensively determined according to the pre-classification results of the 2 resource dimensions. For another example, if each load unit includes 3 resource dimensions, pre-classification can be performed for each of the resource dimensions, and the load class can be comprehensively determined according to the pre-classification results of the 3 resource dimensions.

[0087] In at least some embodiments of the present specification, specific technical means are further provided for classifying based on the resource demand of each load unit in the load unit set.

[0088] Specifically, dividing the load unit set into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated may include: using a preset clustering algorithm, performing clustering analysis on each load unit according to the resource demand of each load unit in the load unit set, and dividing each load unit into a preset number of load classes.

[0089] Furthermore, if each load unit has at least two resource dimensions, then for the target resource dimension among the at least two resource dimensions: a preset clustering algorithm can be used to perform clustering analysis on each load unit according to the target resource demand of each load unit in the load unit set for the target resource dimension, and each load unit can be divided into a preset number of pre-classifications on the target resource dimension.

[0090] Furthermore, the preset clustering algorithm may specifically include a K-means algorithm. The core idea of ​​K-means clustering is to obtain clusters that are as compact and separated as possible by repeatedly adjusting the positions of cluster centers and continuously optimizing the compactness within the cluster. Specifically, the K-means algorithm will try to divide the data set into K clusters so that the sum of the distances from each data point to the center of the cluster to which it belongs is minimized. The "distance" here can be measured using the Euclidean distance.

[0091] Furthermore, the preset number may specifically include two or more, for example, may be two.

[0092] In at least some embodiments of the present specification, in order to make the classification result of the load units more reasonable, a standard for whether the load units need to be classified may be further set.

[0093] Specifically, the use of a preset clustering algorithm to cluster the load units according to the resource requirements of the load units in the load unit set, and before dividing the load units into a preset number of load classes, may also include: calculating the range of the resource requirements of the load units in the load unit set; judging whether the range is greater than or equal to a preset range threshold, and obtaining a range judgment result. Accordingly, the use of a preset clustering algorithm to cluster the load units according to the resource requirements of the load units in the load unit set, and dividing the load units into a preset number of load classes, may specifically include: if the range judgment result indicates that the range is greater than or equal to the preset range threshold, then using a preset clustering algorithm to cluster the load units according to the resource requirements of the load units in the load unit set, and dividing the load units into a preset number of load classes.

[0094] Further, if each load unit has at least two resource dimensions, then: the use of a preset clustering algorithm, according to the target resource demand of each load unit in the load unit set for the target resource dimension, clustering analysis of each load unit, before dividing each load unit into a preset number of pre-classifications on the target resource dimension, may also include: for the target resource dimension in the at least two resource dimensions, calculating the target range of the target resource demand of each load unit in the load unit set for the target resource dimension; judging whether the target range is greater than or equal to the target range threshold of the target resource dimension. Accordingly, the use of a preset clustering algorithm, according to the target resource demand of each load unit in the load unit set for the target resource dimension, clustering analysis of each load unit, and dividing each load unit into a preset number of pre-classifications on the target resource dimension, may specifically include: if the target range is greater than or equal to the target range threshold of the target resource dimension, clustering analysis of the load units in the load unit set, and dividing each load unit into a preset number of pre-classifications on the target resource dimension.

[0095] To facilitate understanding of the method of classifying load cells, an example is given below.

[0096] As an example, assuming that each load unit in the set of load units to be allocated only considers the resource dimension of memory resources, the set of load units to be allocated is {a, b, c, d, e}, that is, it includes five load units a, b, c, d, and e.

[0097] Assuming that the memory resource requirements of load units a, b, c, d, and e are 10MB, 15MB, 20MB, 50MB, and 60MB respectively, then we can first calculate the range of the memory resource requirement set {10MB, 15MB, 20MB, 50MB, 60MB} corresponding to the load unit set {a, b, c, d, e} to be allocated, that is, the range is 60MB-10MB=50MB.

[0098] Assume that the preset extreme value threshold of memory resources is 15MB. Since 50MB>15MB, a preset clustering algorithm such as k-means algorithm can be used to perform clustering analysis on {a, b, c, d, e}. Assume that the preset number for classification is 2, and the classification results are {a, b, c} and {d, e}.

[0099] Furthermore, it is possible to continue analyzing whether the range of the resource demand of each load unit in the obtained classification meets the threshold condition for continuing the clustering analysis, that is, whether it is greater than or equal to the preset range threshold. If so, continue to execute the preset clustering algorithm for further classification until the range of the resource demand of each load unit in the obtained classification no longer meets the threshold condition for continuing the clustering analysis, that is, it is less than the preset range threshold.

[0100] Using the above example, we can analyze whether the range of the memory resource demand set {10MB, 15MB, 20MB} corresponding to {a, b, c} meets the preset threshold condition. Specifically, the range is 20MB-10MB=10MB, 10MB<15MB, and no further cluster analysis is required. In addition, we can analyze whether the range of the memory resource demand set {50MB, 60MB} corresponding to {d, e} meets the preset threshold condition. Specifically, the range is 60MB-50MB=10MB, 10MB<15MB, and no further cluster analysis is required.

[0101] In actual application, based on the solution of the embodiment of this specification, in each resource dimension, it can be determined whether the range of the resource quantity set reaches the preset range threshold; if not, no classification is required; if reached, cluster analysis is performed for classification, and each category in the classification result is recursively analyzed until the range of the resource quantity set corresponding to each category obtained by classification does not reach the preset range threshold. After that, the loads belonging to the same classification in all dimensions can be classified into the same load class.

[0102] In at least some embodiments of the present specification, a method for determining a preset range threshold is further provided.

[0103] Specifically, the preset range threshold may be determined based on the resource capacity of each computing node. When multiple resource dimensions are included, the target range threshold corresponding to the target resource dimension may be determined based on the resource capacity of each computing node for the target resource dimension. Before determining whether the range is greater than or equal to the preset range threshold, the method may further include: determining the preset range threshold based on the resource capacity of each computing node.

[0104] Furthermore, the preset range threshold may be determined based on the first characteristic capacity of the computing nodes as a whole; the first characteristic capacity is determined based on the resource capacity of each computing node for the target resource dimension. When multiple resource dimensions are included, the target range threshold corresponding to the target resource dimension, the preset range threshold is determined based on the first characteristic capacity of each computing node as a whole for the target resource dimension; the first characteristic capacity is determined based on the resource capacity of each computing node for the target resource dimension. Before determining whether the range is greater than or equal to the preset range threshold, it may also include: calculating the first characteristic capacity of each computing node as a whole based on the resource capacity of each computing node; and determining the preset range threshold based on the first characteristic capacity.

[0105] Furthermore, before determining whether the range is greater than or equal to a preset range threshold, it may also include: obtaining the resource capacity of each of the computing nodes; based on the resource capacity of each of the computing nodes, calculating the first characteristic capacity of the computing nodes as a whole; based on the first characteristic capacity, determining the preset range threshold corresponding to the computing nodes as a whole.

[0106] In actual application, when multiple resource dimensions are involved, the method for determining the target range threshold corresponding to the target resource dimension may include: obtaining the target resource capacity of each computing node for the target resource dimension; based on the respective target resource capacities, calculating the first characteristic capacity of each computing node as a whole; based on the first characteristic capacity, calculating the preset range threshold corresponding to each computing node as a whole.

[0107] Optionally, the first characteristic capacity of each computing node as a whole may specifically include the average capacity value of the resource capacity of each computing node. Alternatively, the first characteristic capacity of each computing node as a whole may specifically include the minimum capacity value, median capacity value, etc. of the resource capacity of each computing node.

[0108] Furthermore, based on the first characteristic capacity, determining the preset extreme value threshold value corresponding to the entire computing node may specifically include: multiplying the first characteristic capacity by a preset ratio to obtain a preset extreme value threshold value. The preset ratio may be set to, for example, 10%, 15%, 20%, etc., and is not limited to these numerical examples. It is understandable that the smaller the preset ratio is set, the more classifications are obtained and the more accurate the load balancing result is, but the resource consumption is relatively large and the efficiency is relatively low. The larger the preset ratio is set, the fewer classifications are obtained, the smaller the resource consumption of the load balancing resource process is, and the higher the efficiency is. In actual application, the aforementioned preset ratio can be set according to actual business needs.

[0109] As an example, assuming that for the memory resource dimension, the average capacity of each computing node is 100 MB, and the preset ratio is 15%, then the calculated preset extreme value threshold for the memory resource dimension is 15 MB (100M×15%=15 MB).

[0110] In at least some embodiments of the present specification, a specific solution is provided for determining the number of load units to be allocated to each computing node for each load class using a multi-objective linear programming model.

[0111] Specifically, the planning model using multiple optimization objectives determines the number of load units allocated to each load class at each computing node, which may specifically include: obtaining planning parameter information; the planning parameter information includes load parameter information of each load unit to be allocated and node parameter information of each computing node to be planned; based on the planning parameter information, constructing a multi-objective planning model with minimum load migration cost, maximum node load balancing and minimum computing node cost as optimization objectives; solving the multi-objective planning model to obtain the number of load units allocated to each load class at each computing node.

[0112] For each load class, the characteristic demand of the load class, or the characteristic demand of each load unit in the load class, can be calculated according to the resource demand corresponding to each load unit in the load class.

[0113] The load parameter information of the load class to be allocated may specifically include the quantity information of the load class to be allocated, the quantity of load units contained in each load class to be allocated, and the resource demand information, etc. The node parameter information of each computing node to be planned may specifically include the quantity of each computing node to be planned and the resource capacity information, etc. Furthermore, the planning parameter information may also include the resource dimension information of the load unit and the computing node.

[0114] In at least some embodiments of the present specification, a method for determining characteristic demand quantities of load units in a load class is further provided for use in subsequent scale model solving.

[0115] Specifically, the acquiring of planning parameter information may specifically include: for any load class, calculating a characteristic value of a resource demand of each load unit included in the any load class as a characteristic demand of the load unit included in the any load class.

[0116] Optionally, the determining of the characteristic value of the resource demand of each load unit contained in any load class may specifically include calculating the average value of the resource demand of each load unit contained in any load class. Alternatively, the determining of the characteristic value of the resource demand of each load unit contained in any load class may specifically include determining the median value of the resource demand of each load unit contained in any load class, but is not limited thereto and may also be other characteristic values.

[0117] When two or more resource dimensions are considered, for a target resource dimension among the two or more resource dimensions: for any load class, a characteristic value of the resource demand of each load unit contained in any load class for the target resource dimension can be determined as the characteristic demand of the load unit contained in any load class for the target resource dimension.

[0118] In at least some embodiments of the present specification, a specific objective function of the multi-objective programming model is further provided.

[0119] Specifically, the objective function of the multi-objective programming model can be:

[0120]

[0121] Where i represents the load class; the set Represents a collection of load classes;

[0122] j represents a computing node; set represents the set of running nodes before planning; set A represents the set of newly added nodes after planning;

[0123] t represents the resource dimension; collection Represents a collection of resource dimensions;

[0124] x represents the number of loads distributed in the computing nodes after classification; xt represents the number of migrations of loads in the computing nodes after classification; xt i,j ≥|x i,j -x′ i,j |, where x i,jrepresents the number of load class i in computing node j after planning; x′ i,j represents the number of load class i in node j before planning; xt i,j represents the number of migrations of load class i in computing node j;

[0125] α represents the weight of a single load migration cost;

[0126] y represents the maximum occupancy rate of resources in all computing nodes; y t Indicates the maximum occupancy rate of resource t in all computing nodes;

[0127] w represents the weight of load balancing; w t The weight representing the load balancing degree of resource t;

[0128] z represents the usage plan of the computing node; j Indicates whether computing node j is used;

[0129] p represents the cost weight of the computing node; p j represents the cost weight of computing node j;

[0130] α, w t and p j The values ​​of are all [0,1] and are set as hyperparameters before running the solution.

[0131] The first term in this objective function represents the estimated load migration cost. More specifically, for each load class i, for all nodes j, the number of migrations xt of load class i in node j is calculated i,j Sum. In the first term of the objective function, the summation term is the estimated count of the migration load, multiplied by the single migration cost coefficient α, which is the total migration cost target.

[0132] The second term in the objective function represents the node load balance. Specifically, y represents the maximum occupancy rate of the resource. The computing node will bear some load during operation. For each resource, the occupancy rate of the load consumed in the computing node can be calculated, y tIt represents the maximum occupancy rate of resource t in all nodes. When the total load is fixed, the more balanced the load of the computing node is, the smaller the parameter is, and the better the target is. For fixed nodes and loads (that is, each load and node must be used), the maximum occupancy rate can reflect the overall utilization efficiency of the computing node, that is, the more balanced, the lower the maximum occupancy rate; when planning whether the node is used, this item can also represent the overall utilization rate of the computing node. In order to ensure that the newly added load does not affect the normal operation of the service before the next load balancing optimization, the utilization rate of the computing node cannot be too high, and a balance needs to be made with the computing node cost. For example, there are 5 computing nodes involved, and for resource t (for example, CPU resources), the occupancy rates in the 5 computing nodes are 70%, 60%, 30%, 40%, and 50% respectively. Then, y t The value of is the largest of the above five occupancy rates, namely 70%.

[0133] The third term in the objective function represents the cost of the computing node. Specifically, z represents the usage plan of the computing node, z j Indicates whether computing node j is used, multiplied by the cost weight p of each computing node j j , which is the overall goal of calculating node cost.

[0134] Furthermore, the constraints of the multi-objective planning model include constraints on the number of newly added nodes, constraints on node load balance, constraints on node load limit, constraints on load bearing, and constraints on node usage.

[0135] Furthermore, the constraints of the planning model can be as follows:

[0136]

[0137]

[0138]

[0139]

[0140]

[0141]

[0142]

[0143]

[0144] in,

[0145] Formula (1) represents the constraint on the number of newly added nodes; where A new Indicates the threshold for the number of newly added nodes, which can be set as a hyperparameter before solving.

[0146] Formula (2) represents the node load balancing constraint; where, represents the maximum occupancy rate threshold of resource t in all computing nodes; in the embodiment of this specification, Set it to a value lower than 100%, for example, 80%, to allow for disaster recovery.

[0147] Formula (3) represents the node load limit constraint; where, The characteristic demand (e.g., mean) of the classified load; represents the characteristic demand of load class i for resource t; c represents the resource capacity of the computing node; c j,t represents the resource capacity of computing node j with respect to resource t; for resource t and computing node i, represents the total load borne by the computing nodes, y t c j,t Indicates the capacity limit of the computing node.

[0148] Formula (4) indicates that the load is constrained by the load; where I i represents the number of loads belonging to load class i after load classification; Formula (4) indicates that for load class i, all computing nodes need to carry at least I i A load.

[0149] Formula (5) also indicates that the load is constrained by the load; Represents a non-negative integer; represents the number of load class i in computing node j.

[0150] Formula (6) represents the node usage constraint; where I represents the set Size, collection Represents a collection of payloads.

[0151] Formula (7) also expresses the node usage constraint; where z j The value can be 0 or 1.

[0152] Formula (8) represents the load migration quantity constraint; in this constraint inequality, the left formula is the estimated number of migrations of load class i in computing node j; the right formula is the difference in the number of load class i in computing node j before and after planning. For computing node j, the number of migrations of load class i cannot be less than the difference in the number of load class i in computing node j before and after planning. In practical applications, if for computing node j, load class i only migrates out, or only migrates in, then xt i,j can be equal to |x i,j -x′ i,j |; If for computing node j, load class i has both outgoing and incoming migrations, then xt i,j Can be greater than |xi,j -x′ i,j |.

[0153] In practical application, first, the characteristic value (for example, average value) of the resource demand of the load unit in each type of load in each resource dimension can be calculated as the characteristic demand of the load class. Continuing with the above example, take a single resource dimension and 5 load units to be allocated as an example. For the load units {a, b, c, d, e} to be allocated, when they are divided into two categories {a, b, c} and {d, e}, the load units in the first category {a, b, c} can be recorded as p, and the load units in the second category {d, e} can be recorded as q. As an example, if the characteristic demand for resources of the classified load is calculated by averaging, then the characteristic demand of the classified load unit p (i.e., a, b or c) can be calculated as the average of {10MB, 15MB, 20MB}, which is 15MB; similarly, the characteristic demand of the classified load unit q (i.e., d or e) can be calculated as the average of {50MB, 60MB}, which is 55MB.

[0154] Then, a mixed integer linear programming model can be constructed and solved to obtain the number of loads of each type in each computing node. Continuing with the above example, it is assumed that before planning and solving, 5 load units are located on three computing nodes A, B, and C, and load units a, b, c, d, and e are located on A, B, C, A, and B in sequence, and the resource capacity of computing nodes A, B, and C is 100MB. Further, by constructing and solving a mixed integer linear programming model based on the number of load unit classes, the characteristic demand of the load unit class, the number of load units contained in each load unit class, the number of computing nodes, the resource capacity of each computing node, the distribution of the classified load units in the computing nodes, and other information, the result after planning can be, for example, computing node A carries 2 load classes p and 1 load class q, computing node B carries 1 load class p and 1 load class q, and computing node C is vacant.

[0155] Based on the method of first classifying and then solving the plan in the embodiment of this specification, the number of variables is reduced from the number of loads to the number of load types after classification. Specifically, x i,j The number of variables is the number of loads times the number of nodes, and xt i,j The number of variables is the number of load types multiplied by the number of nodes. When the number of loads and the number of nodes are both large, the scale of variables can be greatly reduced and the utilization efficiency of variables can be improved. In addition, the decision space of variables has also changed. The planning and solving method of the embodiment of this specification is intuitively equivalent to making a unified decision for a type of load. The decision granularity becomes larger, which also reduces the difficulty of decision-making to a certain extent, further improving the decision efficiency and result accuracy.

[0156] In at least some embodiments of the present specification, a two-stage solution method for load balancing is proposed. In the first stage, the optimized mixed integer linear programming model is solved to obtain the overall distribution plan for each type of load, that is, the distribution quantity of each type of load in each computing node is obtained. In the second stage, based on the results of the first stage, fine-grained unit allocation is performed through, for example, a greedy algorithm, and finally an accurate placement plan for each specific load unit is obtained. That is, by solving the planning model, the distribution quantity of each type of load on each computing node can be obtained. On this basis, it is also necessary to further determine the computing node to which each load unit is assigned based on the distribution quantity in the second stage. In at least some embodiments of the present specification, a specific scheme for determining the computing node to which each load unit is assigned is further provided.

[0157] In practical applications, the process of accurately distributing a single load unit can be regarded as a packing problem. In at least some embodiments of the present specification, heuristic algorithms can be used to solve the packing problem. Heuristic algorithms are a type of strategy or method used to solve complex problems that are difficult to find optimal solutions to in a reasonable time using traditional algorithms. Heuristic algorithms do not guarantee the optimal solution, but can usually find an acceptable approximate solution in a relatively short time. There are many types of heuristic algorithms, including but not limited to First Fit, Next Fit, First Fit Decreasing, reconciliation, greedy algorithm, simulated annealing, genetic algorithm, taboo search algorithm, etc.

[0158] Specifically, determining the computing node that carries each load unit in the load unit set based on the allocated number of load units may include: first, determining the sorting result of each load unit based on the resource demand of each load unit in the load unit set; wherein, in at least one resource dimension, the resource demand of the first load unit in the sorting result is not less than the resource demand of the second load unit; and then, using the allocated number of load units of each load class in each computing node as a constraint, determining the computing nodes that carry each load unit in the sorting result in sequence in the order in which the first load unit precedes the second load unit.

[0159] In actual applications, the load balancing process usually involves multiple resource dimensions. When considering multiple resource dimensions, in order to facilitate sorting, the resource requirements of the load unit in each resource dimension can be normalized first, and then the load units can be sorted based on the normalized resource requirements of each resource dimension.

[0160] Furthermore, determining the ranking result of each load unit according to the resource demand of each load unit in the load unit set may include: for any resource dimension among at least two resource dimensions, calculating the second characteristic capacity of each computing node for any resource dimension according to the resource capacity of each computing node for the any resource dimension; using the second characteristic capacity for the any resource dimension, normalizing the resource demand of each load unit in the load unit set for the any resource dimension to obtain a normalized value of the demand of each load unit for the any resource dimension; determining the characteristic normalized value of each load unit according to the normalized value of the demand of each load unit in each resource dimension among the at least two resource dimensions; and determining the ranking result of each load unit according to the characteristic normalized value of each load unit.

[0161] Optionally, the second characteristic capacity of each computing node as a whole may specifically include the average capacity value of the resource capacity of each computing node. Alternatively, the second characteristic capacity of each computing node as a whole may specifically include the total capacity value, median capacity value, etc. of the resource capacity of each computing node. In at least some embodiments of this specification, the second characteristic capacity may be the same as or different from the first characteristic capacity.

[0162] Furthermore, the embodiments of this specification provide a specific solution for determining the characteristic normalized value of each load unit for sorting based on the normalized value of the demand of each load unit in multiple dimensions.

[0163] Optionally, determining the characteristic normalized value of each load unit according to the normalized demand value of each load unit in each resource dimension among the at least two resource dimensions may specifically include: for any load unit, determining the maximum of the corresponding normalized demand values ​​in each resource dimension among the at least two resource dimensions as the characteristic normalized value of the any load unit.

[0164] Optionally, determining the characteristic normalized value of each load unit according to the normalized demand value of each load unit in each resource dimension of the at least two resource dimensions may specifically include: for any load unit, calculating the norm of the corresponding normalized demand value in each resource dimension of the at least two resource dimensions as the characteristic normalized value of any load unit.

[0165] In addition, optionally, for any load unit, the mean or other characteristic value of the normalized value of the demand corresponding to each resource dimension in at least two resource dimensions may be calculated as the characteristic normalized value.

[0166] Furthermore, after obtaining the characteristic normalized value of each load unit, the characteristic normalized value may be sorted in descending order to obtain a sorting result of each load unit.

[0167] For ease of understanding, a specific method for determining the ranking results of the load units is now described with examples. Assume that the set of load units to be allocated includes load units a, b, c, d, and e, and the plannable computing nodes include A, B, and C, and the ranking is performed considering two resource dimensions.

[0168] Assume that the resource demand of the first resource dimension (for example, memory resources) of load units a, b, c, d, e is 10MB, 15MB, 20MB, 50MB, 60MB respectively, and the resource capacity of the first resource dimension of each computing node A, B and C is 100MB, 100MB, 100MB respectively. Therefore, the second characteristic capacity of each computing node A, B and C can be calculated first. Assuming that 100MB is obtained by averaging, the second characteristic capacity can be used to normalize the resource demand of the first resource dimension of each load unit a, b, c, d, e to obtain the normalized demand values ​​of each load unit a, b, c, d, e as 0.1, 0.15, 0.2, 0.5, 0.6 respectively.

[0169] Assume again that the resource demands of the second resource dimension (for example, CPU resources) of load units a, b, c, d, e are 30C, 15C, 40C, 50C, 20C respectively, and the resource capacities of the first resource dimension of each computing node A, B and C are 50C, 100C, 150C respectively. Thus, the second characteristic capacity of each computing node A, B and C can be calculated first. Assuming that 100C is obtained by averaging, the second characteristic capacity can be used to normalize the resource demands of the second resource dimension of each load unit a, b, c, d, e, so as to obtain the normalized demands of each load unit a, b, c, d, e of 0.3, 0.15, 0.4, 0.5, 0.2 respectively.

[0170] As described above, after obtaining the normalized value of the demand of each load unit under each resource dimension, the characteristic normalized value of each load unit can be determined, and then the ranking result of the load units can be determined based on the characteristic normalized value of each load unit.

[0171] In the above example, for each load unit a, b, c, d, e, the normalized demand values ​​of the first resource dimension are 0.1, 0.15, 0.2, 0.5, 0.6, respectively, and the normalized demand values ​​of the second resource dimension are 0.3, 0.15, 0.4, 0.5, 0.2, respectively. Optionally, for any load unit, the relatively largest value can be obtained from the normalized demand values ​​corresponding to multiple resource dimensions to determine the overall characteristic normalized value. In this case, the characteristic normalized values ​​corresponding to each load unit a, b, c, d, e can be obtained as 0.3 (the larger of 0.1 and 0.3), 0.15, 0.4 (the larger of 0.2 and 0.4), 0.5, 0.6 (the larger of 0.6 and 0.2).

[0172] Then, the characteristic normalized values ​​can be sorted in descending order to obtain e, d, c, a, and b. Therefore, when each load unit is accurately allocated later, it can be allocated in the order of e, d, c, a, and b.

[0173] It should be noted that the numerical values ​​given in the above examples are for the convenience of calculation and explanation, and do not constitute a limitation on the application scenarios of the technical solutions of this specification. In actual application, they may vary depending on actual business conditions.

[0174] In at least some embodiments of the present specification, a specific solution is further provided for sequentially determining computing nodes that carry each load unit according to the sorting results of each load unit in the set of load units to be allocated.

[0175] Specifically, taking the number of load units allocated to each load class on each computing node as a constraint, and determining the computing nodes that carry the load units in sequence in the order in which the first load unit precedes the second load unit in the sorting result, may include: for the first load unit in the sorting result, determining the target load class to which the first load unit belongs; and determining the computing node that carries the first load unit based on the number of load units allocated to the target load class on each computing node.

[0176] In at least some embodiments of the present specification, when the allocation results of each load unit to be allocated are determined based on the planning results, in order to reduce the migration cost, if the planning results obtained by solving the planning model indicate that the computing node where the load unit to be allocated is currently located has a load class to which the load unit to be allocated belongs planned, the load unit can be moved as little as possible.

[0177] Specifically, the determining the computing node that carries the first load unit according to the number of load units allocated to the target load class on each computing node may include: determining at least one target computing node to be allocated the target load class according to the number of load units allocated to the target load class on each computing node; judging whether the at least one target computing node includes the computing node where the first load unit is currently located, and obtaining a migration judgment result; if the migration judgment result indicates that the at least one target computing node includes the computing node where the first load unit is currently located, determining the computing node where the first load unit is currently located as the computing node that carries the first load unit. If the migration judgment result indicates that the at least one target computing node does not include the computing node where the first load unit is currently located, selecting a computing node that carries the first load unit from the at least one target computing node.

[0178] In actual application, in the process of allocating each load unit in sequence according to the sorting results, there may be a situation where all load units cannot be allocated to the planned computing nodes according to the solution results of the planning model. This is because: linear planning is a rough placement of classified loads, and the differences in resource requirements between different load units in the same load class will be ignored during the rough placement. In actual application, due to the differences in resource requirements between different load units in the same load class, there may be a situation where the resource requirements of the load roughly placed on a node are larger than the characteristic requirements of the corresponding load class (for example, the resource requirements of the loads contained in a load class are 4, 4, 5, 6, and 6 respectively, and the characteristic requirement of the load class is 5, but in the greedy placement process, two loads with a resource requirement of 6 are placed on the same node). The resources used by the node exceed the ideal resource consumption, which may lead to the inability to carry the corresponding load according to the planned solution. In this case, you can first try to place the corresponding load on other nodes in the plan. If other nodes in the plan cannot place the corresponding load, you can use other nodes outside the plan to place the corresponding load.

[0179] Further, determining the computing node that carries the first load unit according to the number of load units allocated to the target load class in each computing node may specifically include: determining at least one target computing node to be allocated the target load class according to the number of load units allocated to the target load class in each computing node; judging whether the remaining resource capacity of any target computing node in the at least one target computing node is sufficient to carry the first load unit, and obtaining a bearing judgment result. If the bearing judgment result indicates that the remaining resource capacity of any target computing node in the at least one target computing node is sufficient to carry the first load unit, then determining the any target computing node as the computing node that carries the first load unit. If the bearing judgment result indicates that the remaining resource capacity of each target computing node in the at least one target computing node is not sufficient to carry the first load unit, then determining the computing node that carries the first load unit from at least one non-planned node of the target load class; the non-planned node is used to indicate a computing node that is not planned to carry the target load class according to the solution result of the planning model.

[0180] Specifically, the target computing node may include at least one target computing node. When more than one target computing node is included, an attempt may be made to place the first load unit in any of the at least one target computing node, and in each placement attempt, it is necessary to determine whether the remaining resource capacity of any of the target computing nodes is sufficient to carry the first load unit.

[0181] In actual application, for any target computing node, if the first load unit is the first load unit placed in any target computing node, then the remaining resource capacity may be the resource capacity of any target computing node; if the first load unit is not the first load unit placed in any target computing node, that is, other load units have already been placed in any target computing node, then the remaining resource capacity may be the remaining resource capacity after deducting the resource capacity occupied by the other placed load units from the resource capacity of any target computing node.

[0182] Furthermore, an embodiment of the present specification provides a specific method for determining a computing node that carries the first load unit from at least one non-planned node of the target load class.

[0183] Specifically, determining the computing node that carries the first load unit from at least one non-planned node of the target load class may include: for any non-planned node of the target load class, obtaining a preset resource state vector of the non-planned node; the preset resource state vector is used to reflect the distribution of each load class in the any non-planned node obtained by solving the planning model; calculating the current resource state vector of any non-planned node; the current resource state vector is used to reflect the distribution of each load class in the any non-planned node if the first load unit is allocated to the any non-planned node; calculating the norm of the difference vector between the preset resource state vector of any non-planned node and the current resource state vector; based on the norm of the difference vector corresponding to each non-planned node of the target load class, determining the computing node that carries the first load unit from the various non-planned nodes; wherein the norm corresponding to the determined computing node that carries the first load unit is less than or equal to the norm of other computing nodes in the various non-planned nodes.

[0184] Furthermore, the number of elements in the preset resource state vector of any non-planning node (i.e., the dimension of the preset resource state vector) is equal to the number of load units planned to any non-planning node by solving the planning model. Each element in the preset resource state vector of any non-planning node is used to represent the characteristic demand of each load class planned to any non-planning node by solving the planning model.

[0185] Furthermore, the number of elements in the current resource state vector of any non-planned node (i.e., the dimension of the current resource state vector) is the estimated number of load units in any non-planned node if the first load unit is allocated to the any non-planned node. Each element in the current resource state vector of any non-planned node is used to represent the characteristic demand of each load class allocated to any non-planned node if the first load unit is allocated to the any non-planned node.

[0186] Furthermore, determining the computing node that carries the first load unit from at least one non-planned node of the target load class specifically includes: judging whether there is a non-planned node with remaining resource capacity that can carry the first load unit in the at least one non-planned node; if so, further determining the computing node that carries the first load unit from the non-planned nodes that can carry the first load unit.

[0187] In actual application, there is also a situation where all the computing nodes including the planned nodes and the unplanned nodes cannot carry the first load unit. In this case, a computing node with the lowest node computing cost can be selected from the spare computing nodes as the computing node carrying the first load unit.

[0188] To facilitate understanding, a specific method for accurately allocating load units according to the sorting results is now described with examples.

[0189] Using the above example, the load units {a, b, c, d, e} to be allocated are divided into two categories: {a, b, c} (recorded as p category) and {d, e} (recorded as q category). Before planning, the distribution of load units on nodes is {a, d} on A, {b, e} on B, and {c} on C; after planning, the distribution of load units on nodes is {q, p, p} on A, {q, p} on B, and C is vacant.

[0190] On this basis, heuristic algorithms such as greedy algorithms can be used to perform fine-grained unit allocation. First, the load units {a, b, c, d, e} can be sorted according to their respective resource requirements. For the sake of convenience, it is assumed that only one resource dimension is considered, and the resource requirements of load units a, b, c, d, and e are 10MB, 15MB, 20MB, 50MB, and 60MB respectively. Then, load units a, b, c, d, and e can be sorted in descending order according to resource requirements, and the sorting results of each load unit are e, d, c, b, and a.

[0191] Next, the load units e, d, c, b, and a can be accurately placed in sequence. It is known that the resource capacity of node A and node B is 100MB.

[0192] First, place load unit e. Since load unit e belongs to class q, according to the planned load unit allocation quantity, class q can be placed on node A or node B. Load unit e was originally located at node B, and the current remaining resource capacity of node B (100MB) can carry load unit e (60MB). Then, according to the solution of the embodiment of this specification, load unit e can be allocated to node B.

[0193] Then, load unit d is placed. Since load unit d belongs to class q, according to the planned load unit allocation quantity and the previous placement situation, class q can be placed on node A, and the remaining resource capacity of the current node A (100MB) can carry load unit d (50MB). Then, according to the solution of the embodiment of this specification, load unit d can be allocated to node A.

[0194] Then, load unit c is placed. Since load unit c belongs to class p, according to the planned load unit allocation quantity and the previous placement situation, the class p can be placed at node A or node B. Load unit c was originally located at node C, and the current remaining resource capacity of node A (50MB) and load unit c was originally located at node C, then, according to the solution of the embodiment of this specification, load unit c can be allocated to node A with more remaining resource capacity.

[0195] Then, place load unit b. Since load unit b belongs to class p, according to the planned load unit allocation quantity and the previous placement situation, the class p can be placed at node A or node B. Load unit b was originally located at node B, and the current remaining resource capacity of node B (40MB) can carry load unit b (15MB). Then, according to the solution of the embodiment of this specification, load unit b can be allocated to node B.

[0196] Then, load unit a is placed. Since load unit a belongs to class p, according to the planned load unit allocation quantity and the previous placement situation, the class p can be placed on node A, and the remaining resource capacity (30MB) of the current node A can carry load unit a (10MB). Then, according to the solution of the embodiment of this specification, load unit a can be allocated to node A.

[0197] Through the above allocation process, it can be obtained that the distribution of each load unit on the node is A carrying {d, c, a}, and B carrying {e, b}.

[0198] Based on at least some of the above embodiments, through a heuristic algorithm such as greedy allocation, the specific bearing nodes of each load unit can be determined on the basis of planning and solving. In practical applications, considering that the solution obtained by greedy allocation is an approximate solution, for example, the actual load amount allocated to the computing node may be larger than the estimated load amount, or there may be a situation where there are remaining load units that need to be processed, etc. In these cases, the greedy allocation result may not reach the local optimum.

[0199] In view of this, in the embodiments of this specification, the load distribution result obtained by greedy distribution is further optimized through local search optimization to improve the overall balance of the system.

[0200] Furthermore, the method may further include: determining at least one optimizable state under the current load distribution state; the current load distribution state is used to reflect the distribution of the load units to be distributed in the various computing nodes; any of the optimizable states is used to reflect the distribution of the load units to be distributed in the various computing nodes after any third load unit distributed to the first computing node is moved to the second computing node that can accommodate any third load unit; based on the distribution reflected by any of the at least one optimizable state, calculating a new load balancing degree corresponding to any of the optimizable states; if the new load balancing degree corresponding to any of the optimizable states is less than the original load balancing degree corresponding to the current load distribution state, moving any of the third load units to the second computing node to obtain an optimized load distribution result.

[0201] Furthermore, it is also possible to continue to determine whether the optimized current load distribution state has the possibility of further optimization, until no movement operation that can improve the system balance can be found.

[0202] The calculation of the original load balancing degree and the new load balancing degree may refer to the second sum item in the above planning model, which will not be described in detail here.

[0203] In practical applications, each possible movement of the load unit can be tried, and it can be determined whether each movement can make the node load balance better.

[0204] Using the above example, we can get the distribution result of distributing load units a, c, and d to computing node A, and distributing load units b and e to computing node B, which is recorded as A(a,c,d)+B(b,e). Then, for example, we can try to put load unit a on computing node B. Assuming that B can still accommodate a, we can calculate the first load balance degree under the condition of A(c,d)+B(a,b,e), and compare the first load balance degree with the original load balance degree of A(a,c,d)+B(b,e). If the first load balance degree is better than the original load balance degree, load unit a is moved to computing node B, otherwise it is not moved. For example, you can try to put load unit b into computing node A. Assuming that A can still accommodate b, you can calculate the second load balancing degree under the condition of A(a,b,c,d)+B(e), and compare the second load balancing degree with the original load balancing degree of A(a,c,d)+B(b,e). If the second load balancing degree is better than the original load balancing degree, you can move load unit b to computing node A, otherwise do not move it.

[0205] In actual application, each load unit (ie, each load unit in load units a, b, c, d, e in the above example) is tried, and the case with the smallest corresponding value of load balance among various cases is selected as the final load distribution case.

[0206] When all movement operations are infeasible or make the load balance value worse, it means that the local optimum is reached and the local search optimization step ends.

[0207] Based on at least some embodiments of the present specification, by adopting local search optimization, on the one hand, the quality of the solution can be further improved; on the other hand, the migration path can be kept with a solution. Specifically, if a migration path exists for the solution before local search optimization, the migration path of the new solution can be obtained according to each load movement step of the local search optimization.

[0208] It should be noted that in the embodiments of this specification, in the entire process of determining the computing nodes for carrying the load units to be allocated, the initial planning solution consumes relatively more computing resources, while the computing resources consumed in other stages are relatively less. The solution of the embodiments of this specification is to reduce the overall load balancing efficiency by increasing the granularity of the planning solution and reducing the difficulty of the planning solution; at the same time, it combines greedy allocation optimization and local search optimization to ensure that a better load balancing result is obtained.

[0209] The various technical features in the above embodiments can be combined arbitrarily as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, any combination of the various technical features in the above embodiments also falls within the scope of this specification.

[0210] According to the above description, Figure 2 A schematic diagram of the execution process of a load balancing task in an actual application scenario provided by an embodiment of this specification is shown.

[0211] like Figure 2 The variable dimension reduction algorithm shown in the embodiment for accelerating the solution of load balancing scheme on cloud computing cluster may include the following stages and steps.

[0212] First, in step 202, load parameter information is input. Specifically, the load parameter information may include the number of load units, the specifications of the load units (i.e., resource requirements), the number of computing nodes, the specifications of the computing nodes (i.e., resource capacity), the initial distribution state of the load units on the computing nodes, and the number restriction conditions for increasing the number of computing nodes.

[0213] In the first stage, load classification is to classify load units with similar resource demand characteristics to reduce the complexity of subsequent optimization problems.

[0214] Step 204: independently classify the load units to be allocated according to the demand of each resource dimension, wherein the resource dimension may include, for example, CPU resources, memory resources, storage resources, and the like.

[0215] Step 206, in each resource dimension, determine whether the range of the load set is greater than or equal to a preset range threshold; if not, classify the loads in the load set into one category; if so, execute step 208. The preset range threshold can be determined as a preset ratio (e.g., 10%) of the average resource capacity of all nodes in the resource dimension.

[0216] In step 208, a clustering algorithm such as the k-means algorithm is used to divide the load set into two parts. Then, the process returns to step 204 to recursively classify each part.

[0217] Step 210, after the recursive classification is completed, the loads belonging to the same category in all resource dimensions are divided into one load class.

[0218] The second stage is the initial planning solution: determining the preliminary allocation plan for each type of load.

[0219] Step 212, for each load class and each resource dimension, calculate the average resource demand of the load units in the load class as the characteristic demand of the load class in the corresponding resource dimension.

[0220] Step 214, construct and solve a mixed integer linear programming model to obtain the number of each load class to be allocated to each computing node.

[0221] The third stage is greedy allocation optimization: based on the initial planning results of the second stage, a single load unit is accurately allocated.

[0222] Step 216, sort the load units according to the resource requirements of each load unit to obtain a sorting result:

[0223] Specifically, the average capacity of the computing node can be used to normalize the resource requirements of each resource dimension of the load; then, optionally, the maximum normalized value of each load in each resource dimension can be calculated as the weight of the load; then, the loads can be sorted in descending order of weight. The sorting result is used to prioritize the loads with higher resource requirements that are ranked higher. In practical applications, other binning heuristic algorithms (such as First Fit, Best Fit, Next Fit, etc.) can also be referred to, and other methods such as the norm of the resource requirements of the load can be used for sorting.

[0224] Step 218: placing each load unit in sequence according to the sorting result.

[0225] Specifically, the load can be preferentially distributed to the computing nodes specified by the planning results; if the originally specified computing nodes cannot accommodate, the norm minimization principle can be used to select the computing nodes whose resource surplus status is closest to the expected value. The norm minimization principle means that the "distance" between the current resource state and the ideal state is minimized by minimizing the norm of the difference between the current resource state vector and the ideal resource state vector.

[0226] In addition, for the load units that cannot be placed on the nodes according to the initial planning solution results of the second stage, nodes that can minimize the calculation node cost are selected for placement.

[0227] The fourth stage, local search optimization: further optimize the load distribution and improve the overall balance of the system.

[0228] Step 220 , try to move a single load from the current computing node to other computing nodes to determine whether the system load balance can be improved. If so, execute step 222 ; otherwise, execute step 224 .

[0229] Step 222, performing a movement operation that can improve the system load balance to the greatest extent.

[0230] Step 220 and step 222 are repeatedly executed until no moving operation that can improve the system load balance is found.

[0231] Step 224: output the distribution status information of the load units to be allocated on the computing nodes after load balancing.

[0232] Based on the method of the embodiment of this specification, loads with similar specifications are classified into one category, and the solution process is accelerated by reducing the scale of the variables to be solved when solving the planning model, which greatly shortens the solution time; after obtaining the preliminary distribution plan for each type of load, the specific distribution of each computing node is quickly obtained through the heuristic algorithm. Among them, compared with direct placement (finding any feasible node and then loading it), the quality of the solution is greatly improved by using the heuristic algorithm, while the running time remains unchanged. Finally, adjustments are made through a small-scale local search to obtain the local optimal solution.

[0233] Compared with the related art of directly solving the specific distribution of each computing node, the method based on the embodiment of this specification greatly shortens the solution time while ensuring that the quality of the solution can be maintained within an acceptable range, and can solve larger-scale load balancing problems, and the solution time cost is greatly reduced. At the same time, controlling the margin of computing nodes can improve the success rate of load balancing in the scheduling process.

[0234] In the related art, in the step of solving the migration path, the migration path may have no solution due to insufficient capacity of the planned computing nodes, resulting in failure of load balancing in the scheduling process. This is because, during the migration process, a migration action is to migrate a load i from the original computing node j1 to the corresponding computing node j2. The complete migration process requires that each migration action be completed in sequence for the given migration action sequence. After each migration action is completed in the process, no computing node can exceed the specification limit. Although the final state meets the restrictions, there may not be a legal migration action sequence that can ensure that the specification limit is not exceeded after each migration action. Take a simple example. Computing node A contains load a, and computing node B contains load b. Both computing nodes are just fully loaded. If a and b are to be swapped, but computing nodes A and B do not have enough space to accommodate other loads, there is no legal migration action sequence, that is, the migration path has no solution.

[0235] Regarding the problem of no solution for the migration path, based on the solution of the embodiments of this specification, since the result of the planning solution is an approximate solution, compared with the precise solution in the related technology, in the greedy solution step, the principle of preferentially allocating the load to the original computing node is followed to plan the final distribution of the load, which minimizes the load that needs to be migrated and can greatly improve the solubility rate of the migration path.

[0236] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.

[0237] Figure 3 The embodiments of this specification provide corresponding to Figure 1 A structural diagram of a device for determining a computing node.

[0238] like Figure 3 As shown, the device may include:

[0239] The load classification module 302 is used to divide the load unit set into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated; the range of the resource demand of the load units included in the same load class is less than or equal to a preset resource threshold;

[0240] A planning and solving module 304 is used to determine the number of load units to be allocated to each computing node for each load class using a planning model with multiple optimization objectives, wherein the multiple optimization objectives include a first optimization objective for load migration cost, a second optimization objective for node load balancing, and a third optimization objective for computing node cost;

[0241] The load distribution module 306 is used to determine the computing node that carries each load unit in the load unit set according to the allocated number of load units.

[0242] based on Figure 3 The present specification also provides some specific implementation schemes of the method, which are described below.

[0243] Optionally, the load classification module 302 can be specifically used to: for a target resource dimension in at least two resource dimensions, classify each load unit in the load unit set according to the target resource demand of the target resource dimension to obtain a target pre-classification result corresponding to the target resource dimension; the target pre-classification result includes at least two pre-classifications; the range of the target resource demand of the load units included in the same pre-classification is less than or equal to the target resource threshold corresponding to the target resource dimension; based on the target pre-classification results corresponding to at least some of the resource dimensions in the at least two resource dimensions, the load units that belong to the same pre-classification in the target pre-classification results corresponding to at least some of the resource dimensions are classified into the same load class.

[0244] Optionally, the load classification module 302 may be specifically used to: adopt a preset clustering algorithm, perform clustering analysis on each load unit according to the resource demand of each load unit in the load unit set, and divide each load unit into a preset number of load classes.

[0245] Optionally, the device can also be used to calculate the range of resource requirements of each load unit in the load unit set; determine whether the range is greater than or equal to a preset range threshold, and obtain a range judgment result; the load classification module 302 is specifically used to: if the range judgment result indicates that the range is greater than or equal to a preset range threshold, then use a preset clustering algorithm to perform cluster analysis on each load unit according to the resource requirements of each load unit in the load unit set, and divide each load unit into a preset number of load classes.

[0246] Optionally, the device can also be used to obtain the resource capacity of each of the computing nodes; based on the resource capacity of each of the computing nodes, calculate the first characteristic capacity of the computing nodes as a whole; based on the first characteristic capacity, determine the preset extreme value threshold corresponding to the computing nodes as a whole.

[0247] Optionally, the planning solution module 304 can be specifically used to: obtain planning parameter information; the planning parameter information includes load parameter information of each load unit to be allocated and node parameter information of each computing node to be planned; based on the planning parameter information, construct a multi-objective planning model with minimum load migration cost, maximum node load balancing and minimum computing node cost as optimization goals; solve the multi-objective planning model to obtain the number of load units allocated to each load class at each computing node.

[0248] Optionally, the acquiring of planning parameter information may specifically include: for any load class, calculating a characteristic value of a resource demand of each load unit included in the any load class as a characteristic demand of the load unit included in the any load class.

[0249] Optionally, the objective function of the multi-objective programming model may be:

[0250]

[0251] Where i represents the load class; the set Represents a collection of load classes;

[0252] j represents a computing node; set represents the set of running nodes before planning; set A represents the set of newly added nodes after planning;

[0253] t represents the resource dimension; collection Represents a collection of resource dimensions;

[0254] x represents the number of loads distributed in the computing nodes after classification; xt represents the number of migrations of loads in the computing nodes after classification; xt i,j ≥|x i,j -x′ i,j |, where x i,j represents the number of load class i in computing node j after planning; x′ i,j represents the number of load class i in node j before planning; xt i,j represents the number of migrations of load class i in computing node j;

[0255] α represents the weight of a single load migration cost;

[0256] y represents the maximum occupancy rate of resources in all computing nodes; y t Indicates the maximum occupancy rate of resource t in all computing nodes;

[0257] w represents the weight of load balancing; w t The weight representing the load balancing degree of resource t;

[0258] z represents the usage plan of the computing node; j Indicates whether computing node j is used;

[0259] p represents the cost weight of the computing node; p j represents the cost weight of computing node j.

[0260] Optionally, the constraints of the multi-objective planning model include a newly added node quantity constraint, a node load balance constraint, a node load limit constraint, a load bearing constraint and a node usage constraint.

[0261] Optionally, wherein

[0262] The number of newly added nodes is constrained as follows:

[0263]

[0264] Among them, A new Indicates the number threshold of newly added nodes;

[0265] The node load balancing constraints are:

[0266]

[0267] in, Indicates the maximum occupancy threshold of resource t in all computing nodes;

[0268] The node load limit constraints are:

[0269]

[0270] in, It represents the characteristic demand of the classified load; represents the characteristic demand of load class i for resource t; c represents the resource capacity of the computing node; c j,t represents the resource capacity of computing node j with respect to resource t; for resource t and computing node i, represents the total load borne by the computing nodes, y t c j,t Indicates the limit of computing node capacity;

[0271] The loads are borne by the following constraints:

[0272]

[0273] as well as,

[0274] Among them, I i It indicates the number of loads belonging to load class i after load classification; Indicates that for load class i, all computing nodes must carry at least I i load;

[0275] Represents a non-negative integer; represents the number of load class i in computing node j;

[0276] The constraints used by nodes include:

[0277] And z j ∈{0,1};

[0278] Among them, I represents the set Size, collection Represents a collection of payloads.

[0279] Optionally, the load distribution module 306 may specifically include: a sorting unit, used to determine the sorting results of the load units in the load unit set according to the resource demand of each load unit in the load unit set; wherein, in at least one resource dimension, the resource demand of the first load unit in the sorting result is not less than the resource demand of the second load unit; and an allocation unit, used to determine the computing nodes that carry the load units in sequence according to the order in which the first load unit precedes the second load unit in the sorting result, using the number of load units allocated to each load class in each computing node as a constraint.

[0280] Optionally, the sorting unit can be specifically used to: for any resource dimension among at least two resource dimensions, calculate the second characteristic capacity of each computing node for any resource dimension based on the resource capacity of each computing node for the any resource dimension; use the second characteristic capacity for the any resource dimension to normalize the resource demand of each load unit in the load unit set for the any resource dimension to obtain a normalized value of the demand of each load unit for the any resource dimension; determine the characteristic normalized value of each load unit according to the normalized value of the demand of each load unit in each resource dimension among the at least two resource dimensions; and determine the sorting result of each load unit according to the characteristic normalized value of each load unit.

[0281] Optionally, determining the characteristic normalized value of each load unit according to the normalized demand value of each load unit in each resource dimension among the at least two resource dimensions may specifically include: for any load unit, determining the maximum of the corresponding normalized demand values ​​in each resource dimension among the at least two resource dimensions as the characteristic normalized value of the any load unit.

[0282] Optionally, determining the characteristic normalized value of each load unit according to the normalized demand value of each load unit in each resource dimension of the at least two resource dimensions may specifically include: for any load unit, calculating the norm of the corresponding normalized demand value in each resource dimension of the at least two resource dimensions as the characteristic normalized value of any load unit.

[0283] Optionally, the allocation unit can be specifically used to: determine, for the first load unit in the sorting result, a target load class to which the first load unit belongs; and determine a computing node that carries the first load unit based on the number of load units allocated to the target load class on each computing node.

[0284] Optionally, determining the computing node that carries the first load unit according to the number of load units allocated to the target load class on each computing node may specifically include: determining at least one target computing node to which the target load class is to be allocated according to the number of load units allocated to the target load class on each computing node; determining whether the at least one target computing node includes the computing node where the first load unit is currently located, and obtaining a migration judgment result; if the migration judgment result indicates that the at least one target computing node includes the computing node where the first load unit is currently located, determining the currently located computing node as the computing node that carries the first load unit.

[0285] Optionally, determining the computing node that carries the first load unit based on the number of load units allocated to the target load class on each computing node may specifically include: determining at least one target computing node to which the target load class is to be allocated based on the number of load units allocated to the target load class on each computing node; judging whether the remaining resource capacity of any target computing node among the at least one target computing node is sufficient to carry the first load unit, and obtaining a carrying judgment result; if the carrying judgment result indicates that the remaining resource capacity of each target computing node among the at least one target computing node is not sufficient to carry the first load unit, determining the computing node that carries the first load unit from at least one non-planned node of the target load class; the non-planned node is used to indicate a computing node that is not planned to carry the target carrying class according to the solution result of the planning model.

[0286] Optionally, determining the computing node carrying the first load unit from at least one non-planned node of the target load class may specifically include: for any non-planned node of the target load class, obtaining a preset resource state vector of the non-planned node; the preset resource state vector is used to reflect the distribution of each load class in the any non-planned node obtained by solving the planning model; calculating the current resource state vector of any non-planned node; the current resource state vector is used to reflect the distribution of each load class in the any non-planned node if the first load unit is allocated to the any non-planned node; calculating the norm of the difference vector between the preset resource state vector of any non-planned node and the current resource state vector; based on the norm of the difference vector corresponding to each non-planned node of the target load class, determining the computing node carrying the first load unit from the various non-planned nodes; wherein the norm corresponding to the determined computing node carrying the first load unit is less than or equal to the norm of other computing nodes in the various non-planned nodes.

[0287] Optionally, the device is also used to: determine at least one optimizable state under the current load distribution state; the current load distribution state is used to reflect the distribution status of the load units to be allocated in the various computing nodes; any of the optimizable states is used to reflect the distribution status of the load units to be allocated in the various computing nodes after moving any third load unit allocated to the first computing node to a second computing node that can accommodate any third load unit; based on the distribution status reflected by any optimizable state in the at least one optimizable state, calculate the new load balance degree corresponding to any optimizable state; if the new load balance degree corresponding to any optimizable state is less than the original load balance degree corresponding to the current load distribution state, move any third load unit to the second computing node to obtain the optimized load distribution result.

[0288] Optionally, the type of resource requirement includes at least one of CPU resources, memory resources, storage resources, and GPU resources.

[0289] It is understood that the above modules refer to computer programs or program segments for executing one or more specific functions. In addition, the distinction between the above modules does not mean that the actual program codes must also be separated.

[0290] The above is a schematic scheme of a device for determining computing nodes of this embodiment. It should be noted that the technical scheme of the device for determining computing nodes and the technical scheme of the method for determining computing nodes described above belong to the same concept, and the details of the technical scheme of the device for determining computing nodes that are not described in detail can all be referred to the description of the technical scheme of the method for determining computing nodes described above.

[0291] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.

[0292] Figure 4 The embodiments of this specification provide corresponding to Figure 1 A schematic diagram of the structure of a device for determining a computing node. Figure 4 As shown, the device 400 may include:

[0293] at least one processor 410; and,

[0294] A memory 430 is communicatively connected to the at least one processor; wherein,

[0295] The memory 430 stores instructions 420 executable by the at least one processor 410. The instructions are executed by the at least one processor 410 to enable the at least one processor 410 to:

[0296] According to the resource demand of each load unit in the load unit set to be allocated, the load unit set is divided into at least two load classes; the range of the resource demand of the load units included in the same load class is less than or equal to a preset resource threshold;

[0297] A planning model with multiple optimization objectives is used to determine the number of load units allocated to each computing node for each load class; the multiple optimization objectives include a first optimization objective for load migration cost, a second optimization objective for node load balancing, and a third optimization objective for computing node cost;

[0298] According to the allocated number of load units, a computing node that carries each load unit in the load unit set is determined.

[0299] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the method for determining computing nodes described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be found in the description of the technical scheme of the method for determining computing nodes described above.

[0300] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the method for determining a computing node as described above.

[0301] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the method for determining the computing nodes described above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the method for determining the computing nodes described above.

[0302] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above method for determining a computing node when executed by a processor.

[0303] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical scheme of the method for determining computing nodes described above belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be found in the description of the technical scheme of the method for determining computing nodes described above.

[0304] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The devices, equipment and methods provided in the embodiments of this specification correspond to each other, so the devices and equipment also have beneficial technical effects similar to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding devices and equipment will not be repeated here.

[0305] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0306] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0307] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0308] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0309] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

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

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

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

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

[0314] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0315] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0316] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0317] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0318] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0319] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for determining a computing node, comprising: Dividing the load unit set into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated; The range of resource demand of load units included in the same load class is less than or equal to the preset resource threshold; A planning model with multiple optimization objectives is used to determine the number of load units to be allocated to each computing node for each load class; The multiple optimization objectives include a first optimization objective for load migration cost, a second optimization objective for node load balancing, and a third optimization objective for computing node cost; According to the allocated number of load units, a computing node that carries each load unit in the load unit set is determined.

2. The method according to claim 1, wherein the load unit set to be allocated is divided into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated, specifically comprising: For a target resource dimension in at least two resource dimensions, the load units in the load unit set are classified according to the target resource demand of the target resource dimension to obtain a target pre-classification result corresponding to the target resource dimension; the target pre-classification result includes at least two pre-classifications; the range of the target resource demand of the load units included in the same pre-classification is less than or equal to the target resource threshold corresponding to the target resource dimension; Based on the target pre-classification results corresponding to at least some of the at least two resource dimensions, load units that belong to the same pre-classification in the target pre-classification results corresponding to at least some of the resource dimensions are classified into the same load class.

3. The method according to claim 1, wherein the load unit set to be allocated is divided into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated, specifically comprising: A preset clustering algorithm is used to perform clustering analysis on each load unit in the load unit set according to the resource demand of each load unit, and each load unit is divided into a preset number of load classes.

4. The method according to claim 3, wherein the method adopts a preset clustering algorithm to perform clustering analysis on each load unit in the load unit set according to the resource demand of each load unit, and before the load units are divided into a preset number of load classes, the method further comprises: Calculating the range of resource requirements of each load unit in the load unit set; Determine whether the range is greater than or equal to a preset range threshold, and obtain a range determination result; The adopting of a preset clustering algorithm to perform clustering analysis on each load unit in the load unit set according to the resource demand of each load unit and to divide each load unit into a preset number of load classes specifically includes: If the range judgment result indicates that the range is greater than or equal to the preset range threshold, a preset clustering algorithm is used to perform cluster analysis on each load unit in the load unit set according to the resource demand of each load unit, and divide each load unit into a preset number of load classes.

5. The method according to claim 4, before determining whether the range is greater than or equal to a preset range threshold, further comprising: Obtaining the resource capacity of each computing node; Calculating a first characteristic capacity of the computing nodes as a whole based on the resource capacity of each computing node; Based on the first characteristic capacity, a preset range threshold corresponding to each computing node as a whole is determined.

6. The method according to claim 1, wherein the planning model using multiple optimization objectives is used to determine the number of load units to be allocated to each computing node for each load class, specifically comprising: Get planning parameter information; The planning parameter information includes load parameter information of each load unit to be allocated and node parameter information of each computing node to be planned; According to the planning parameter information, a multi-objective planning model is constructed with the optimization objectives of minimizing the load migration cost, maximizing the node load balancing degree and minimizing the computing node cost; The multi-objective programming model is solved to obtain the number of load units allocated to each load class at each computing node.

7. The method according to claim 6, wherein obtaining planning parameter information specifically comprises: For any load class, characteristic values ​​of resource demands of the load units included in the load class are calculated as characteristic demands of the load units included in the load class.

8. The method of claim 6, wherein: The objective function of the multi-objective programming model is: Where i represents the load class; the set Represents a collection of load classes; j represents a computing node; set represents the set of running nodes before planning; set A represents the set of newly added nodes after planning; t represents the resource dimension; collection Represents a collection of resource dimensions; x represents the number of loads distributed in the computing nodes after classification; xt represents the number of migrations of loads in the computing nodes after classification; ti,j ≥|x i,j -x′ i,j |, where x i,j represents the number of load class i in computing node j after planning; x′ i,j represents the number of load class i in node j before planning; xt i,j represents the number of migrations of load class i in computing node j; α represents the weight of a single load migration cost; y represents the maximum occupancy rate of resources in all computing nodes; y t Indicates the maximum occupancy rate of resource t in all computing nodes; w represents the weight of load balancing; w t The weight representing the load balancing degree of resource t; z represents the usage plan of the computing node; j Indicates whether computing node j is used; p represents the cost weight of the computing node; p j represents the cost weight of computing node j.

9. The method of claim 8, wherein: The constraints of the multi-objective planning model include the constraint of the number of newly added nodes, the constraint of node load balance, the constraint of node load limit, the constraint of load bearing and the constraint of node usage.

10. The method of claim 9, wherein: The number of newly added nodes is constrained as follows: Among them, A new Indicates the number threshold of newly added nodes; The node load balancing constraints are: in, Indicates the maximum occupancy threshold of resource t in all computing nodes; The node load limit constraints are: in, It represents the characteristic demand of the classified load; represents the characteristic demand of load class i for resource t; c represents the resource capacity of the computing node; c j,t represents the resource capacity of computing node j with respect to resource t; for resource t and computing node i, represents the total load borne by the computing nodes, y t c j,t Indicates the limit of computing node capacity; The loads are borne by the following constraints: as well as, Among them, I i It indicates the number of loads belonging to load class i after load classification; Indicates that for load class i, all computing nodes must carry at least I i load; Represents a non-negative integer; represents the number of load class i in computing node j; The constraints used by nodes include: And z j ∈{0,1}; Among them, I represents the set Size, collection Represents a collection of payloads.

11. The method according to claim 1, wherein determining the computing node that carries each load unit in the load unit set according to the allocated number of load units specifically comprises: Determine the sorting result of each load unit according to the resource demand of each load unit in the load unit set; wherein, in at least one resource dimension, the resource demand of the first load unit in the sorting result is not less than the resource demand of the second load unit; The number of load units allocated to each load class on each computing node is used as a constraint, and the computing nodes that carry the load units are determined in sequence according to the order in which the first load unit precedes the second load unit in the sorting result.

12. The method according to claim 11, wherein determining the ranking result of each load unit according to the resource demand of each load unit in the load unit set specifically comprises: For any resource dimension of the at least two resource dimensions, calculating a second characteristic capacity of each computing node for the any resource dimension according to the resource capacity of each computing node for the any resource dimension; Using the second characteristic capacity for the any resource dimension, normalizing the resource demand of each load unit in the load unit set for the any resource dimension to obtain a normalized value of the demand of each load unit for the any resource dimension; Determining a characteristic normalized value of each load unit according to the normalized value of the demand of each load unit in each resource dimension of the at least two resource dimensions; The ranking results of the load units are determined according to the characteristic normalized values ​​of the load units.

13. The method according to claim 12, wherein determining the characteristic normalized value of each load unit according to the normalized value of the demand of each load unit in each resource dimension of the at least two resource dimensions specifically comprises: For any load unit, the maximum of the normalized values ​​of the demand quantities corresponding to each resource dimension in the at least two resource dimensions is determined as the characteristic normalized value of the any load unit.

14. The method according to claim 12, wherein determining the characteristic normalized value of each load unit according to the normalized value of the demand of each load unit in each resource dimension of the at least two resource dimensions specifically comprises: For any load unit, the norm of the normalized value of the demand quantity corresponding to each resource dimension in the at least two resource dimensions is calculated as the characteristic normalized value of the any load unit.

15. The method according to claim 11, wherein the number of load units allocated to each load class on each computing node is used as a constraint, and the computing nodes carrying each load unit are determined in sequence according to the order in which the first load unit precedes the second load unit in the sorting result, specifically comprising: For a first load unit in the sorting result, determining a target load class to which the first load unit belongs; The computing node that carries the first load unit is determined according to the number of load units allocated to each computing node of the target load class.

16. The method according to claim 15, wherein determining the computing node that carries the first load unit according to the number of load units allocated to each computing node of the target load class specifically comprises: Determine at least one target computing node to which the target load class is to be allocated according to the number of load units allocated to the target load class on each computing node; Determine whether the at least one target computing node includes the computing node where the first load unit is currently located, and obtain a migration determination result; If the migration judgment result indicates that the at least one target computing node includes the computing node where the first load unit is currently located, the computing node where the first load unit is currently located is determined as the computing node that carries the first load unit.

17. The method according to claim 15, determining the computing node that carries the first load unit according to the number of load units allocated to each computing node of the target load class, specifically comprising: Determine at least one target computing node to which the target load class is to be allocated according to the number of load units allocated to the target load class on each computing node; Determine whether the remaining resource capacity of any target computing node among the at least one target computing node is sufficient to carry the first load unit, and obtain a carrying determination result; If the load determination result indicates that the remaining resource capacity of each target computing node in the at least one target computing node is insufficient to carry the first load unit, determining a computing node that carries the first load unit from at least one non-planned node of the target load class; The non-planned node is used to represent a computing node that is not planned to carry the target bearing class according to the solution result of the planning model.

18. The method according to claim 17, wherein determining the computing node carrying the first load unit from at least one non-planned node of the target load class specifically comprises: For any non-planned node of the target load class, obtaining a preset resource state vector of the non-planned node; The preset resource state vector is used to reflect the distribution of each load class in any non-planned node obtained by solving the planning model; Calculating a current resource state vector of any non-planned node; the current resource state vector is used to reflect the distribution of each load class in any non-planned node if the first load unit is allocated to the any non-planned node; Calculating the norm of the difference vector between the preset resource state vector of any non-planned node and the current resource state vector; Based on the norm of the difference vector corresponding to each non-planned node of the target load class, a computing node that carries the first load unit is determined from the non-planned nodes; wherein the norm corresponding to the determined computing node that carries the first load unit is less than or equal to the norm of other computing nodes in the non-planned nodes.

19. The method of claim 11, wherein the number of load units allocated to each computing node of each load class is used as a constraint, and after sequentially determining the computing nodes carrying each load unit in the order in which the first load unit precedes the second load unit in the sorting result, further comprises: determining at least one optimizable state under the current load distribution state; The current load distribution state is used to reflect the distribution status of the load units to be distributed on the computing nodes; any of the optimizable states is used to reflect the distribution status of the load units to be distributed on the computing nodes after any third load unit distributed to the first computing node is moved to the second computing node that can accommodate any third load unit; Based on the allocation situation reflected by any optimizable state among the at least one optimizable state, calculating a new load balancing degree corresponding to the any optimizable state; If the new load balance degree corresponding to any optimizable state is smaller than the original load balance degree corresponding to the current load distribution state, any third load unit is moved to the second computing node to obtain an optimized load distribution result.

20. The method according to any one of claims 1 to 19, wherein the type of resource requirement comprises at least one of CPU resources, memory resources, storage resources, and GPU resources.

21. A device for determining a computing node, comprising: A load classification module, configured to divide the load unit set into at least two load classes according to the resource demand of each load unit in the load unit set to be allocated; the range of the resource demand of the load units included in the same load class is less than or equal to a preset resource threshold; A planning solver module is used to determine the number of load units to be allocated to each computing node for each load class using a planning model with multiple optimization objectives; The multiple optimization objectives include a first optimization objective for load migration cost, a second optimization objective for node load balancing, and a third optimization objective for computing node cost; The load distribution module is used to determine the computing node that carries each load unit in the load unit set according to the allocated number of the load units.

22. A device for determining a computing node, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: According to the resource demand of each load unit in the load unit set to be allocated, the load unit set is divided into at least two load classes; the range of the resource demand of the load units included in the same load class is less than or equal to a preset resource threshold; A planning model with multiple optimization objectives is used to determine the number of load units allocated to each computing node for each load class; the multiple optimization objectives include a first optimization objective for load migration cost, a second optimization objective for node load balancing, and a third optimization objective for computing node cost; According to the allocated number of load units, a computing node that carries each load unit in the load unit set is determined.

Citation Information

Patent Citations

  • Multi-tenant resource optimization scheduling method facing different types of loads

    CN106502792A

  • Cloud data center-oriented computing task cross-region migration method and system

    CN115718644A

  • Gateway routing system supporting multi-protocol conversion and service orchestration

    CN116319811A

  • Energy scheduling method, device and equipment of micro-grid and medium

    CN116488261A

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

    CN116737373A