Method, apparatus and device for determining computing nodes
Patent Information
- Application Number
- CN202411908815.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2044-12-23
AI Technical Summary
在实际的云计算集群环境中,情况往往十分复杂
[0013] According to a third aspect of the present application, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the computer instructions to implement the steps of the method for determining a computing node.
Smart Images

Figure CN119829288B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of load balancing technology, and in particular to a method for determining computing nodes. This application also relates to apparatus and devices for determining computing nodes. Background Technology
[0002] In cloud computing clusters, resource consolidation and load balancing directly impact system performance and availability. Reasonable load balancing strategies, continuous monitoring, and timely optimization can improve overall system performance and avoid resource waste, forming the foundation for high-performance clusters. In real-world cloud computing cluster environments, the situation is often quite complex. Physical container scaling is a fundamental capability for achieving dynamic load balancing in cloud computing clusters. It ensures that the system maintains optimal performance and resource utilization efficiency under different load conditions by precisely adjusting the supply of computing resources.
[0003] Load balancing requires consideration not only of physical container costs but also of resource utilization, load migration costs, and other objectives to ensure high service reliability while controlling costs. The system faces a large-scale, highly complex load distribution problem. The cluster contains numerous physical containers and loads, resulting in a high-dimensional scheduling decision space. Furthermore, the factors influencing system load are multifaceted (e.g., CPU usage, memory capacity, disk capacity), and each container has different capacity specifications and performance. To achieve optimal system performance and resource allocation, it is necessary to comprehensively consider these multi-dimensional factors and quickly and accurately solve the load balancing problem. Summary of the Invention
[0004] In view of this, embodiments of this application provide a method, apparatus, and device for determining computing nodes to improve load balancing efficiency.
[0005] According to a first aspect of the embodiments of this application, a method for determining computing nodes is provided, comprising:
[0006] Based on the resource requirements of each load unit in the set of load units to be allocated, the set of load units is divided into at least two load classes; the range of resource requirements of load units in the same load class is less than or equal to a preset resource threshold.
[0007] A multi-optimization-objective planning model is adopted to determine the number of load units allocated to each load class on each computing node; the multi-optimization-objective includes 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] Based on the number of load units allocated, determine the computing nodes that carry each load unit in the set of load units.
[0009] According to a second aspect of the embodiments of this application, an apparatus for determining a computing node is provided, comprising:
[0010] The load classification module is used to divide the load unit set into at least two load classes according to the resource requirements of each load unit in the load unit set to be allocated; the range of resource requirements of load units contained in the same load class is less than or equal to a preset resource threshold.
[0011] The planning and solving module is used to determine the number of load units allocated to each load class on each computing node using a multi-optimization objective planning model; the multi-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 allocation module is used to determine the computing nodes that carry each load unit in the load unit set according to the number of load units allocated.
[0013] According to a third aspect of the present application, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the computer instructions to implement the steps of the method for determining a computing node.
[0014] One embodiment of this 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, it is possible to make unified decisions based on the class when solving the planning model in the future, thereby reducing the amount of data in the subsequent planning model solution, reducing the difficulty of the solution, and improving the solution efficiency. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 A flowchart illustrating a method for determining computing nodes provided in an embodiment of this specification;
[0017] Figure 2 This is a schematic diagram illustrating the execution flow of a load balancing task in a practical application scenario provided by an embodiment of this specification.
[0018] Figure 3 The embodiments provided in this specification correspond to Figure 1A schematic diagram of the structure of a device for determining computing nodes;
[0019] Figure 4 The embodiments provided in this specification correspond to Figure 1 A schematic diagram of the structure of a device for determining computing nodes. Detailed Implementation
[0020] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0021] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this 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 this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0023] First, the terms and concepts involved in one or more embodiments of this application will be explained.
[0024] Load balancing aims to ensure that workloads are evenly distributed across all nodes in a cluster. By properly configuring and managing all available resources in the cluster (such as CPU, memory, storage, and network bandwidth), it prevents some nodes from becoming overloaded while others remain idle. Load balancing improves overall system performance and reliability, enabling 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 load), grouping loads with similar specifications into the same category, reducing the scale of load types, and accelerating the solution of load balancing schemes.
[0026] The bin packing problem is a classic combinatorial optimization problem. The goal is to put a set of items into as few containers (or bins) as possible, with the objective of minimizing the number of containers used, each with a certain capacity, while ensuring that the total weight or volume of the items put 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 do not guarantee finding the optimal solution, but they can usually find an acceptable approximation solution in a relatively short time.
[0028] Integer programming: This refers to mathematical programming problems where all or some of the variables in the program are restricted to integers. Mixed integer programming: Some variables can take continuous values, while others need to take integer values.
[0029] In related technologies, to ensure both the quality and speed of the solution when solving the load balancing problem, a common approach is to model it as an operations research optimization model and use a solver for efficient and accurate solutions. Considering the cost of computing resources, overall load occupancy, and load migration costs, 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 related technologies, the objective function of the constructed planning model takes the following form:
[0031]
[0032] The constraints of this planning model are as follows:
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040] Where i represents the load label; set A set representing the load;
[0041] j represents the label of the compute node; set Let A represent the set of running nodes before load balancing; let A represent the set of newly added nodes after load balancing; j i This indicates the node where load i was located before load balancing;
[0042] t represents the label of the resource dimension; set A collection representing resource dimensions;
[0043] x represents the number of compute nodes where the load is distributed; x i,j This indicates the final load distribution, that is, whether load i is placed in compute node j; x i,j This represents the final load-node distribution, where x represents the load i when it is located at node j. i,j =1, otherwise x i,j =0;
[0044] α represents the weight of the cost of a single load migration;
[0045] y represents the maximum resource utilization across all computing nodes; t This represents the maximum utilization of resource t across all computing nodes;
[0046] w represents the weight of the load balancing degree; t The weight representing the load balancing degree of resource t;
[0047] z represents the usage plan for computing nodes; z j Indicates whether compute node j is used;
[0048] p represents the cost weight of the computing node; p j This 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 excluding its current node j, the cost for x... i,j Summation. If load i does not migrate, remove the x-axis of its node. i,j The sum is 0; if load i is migrated, then there must exist a j such that x i,j =1. In the first term of the objective function, the summation term is the count of migration loads multiplied by the single migration cost coefficient α, which is the total migration cost objective.
[0051] The second term in the objective function represents the node load balancing degree. Specifically, y represents the maximum resource utilization rate. Compute nodes bear some load during runtime, and the utilization rate of the load consumed by each resource in the compute node can be calculated. t This represents the maximum utilization rate of resource t across all nodes. With a fixed total load, the more balanced the load across the compute nodes, the lower this parameter, and the better the outcome. For a fixed number of nodes and loads (i.e., each load and node is used), the maximum utilization rate reflects the overall efficiency of compute node utilization; the more balanced the load, the lower the maximum utilization rate. When planning node usage, this parameter also represents the overall utilization rate of the compute nodes. To ensure that newly added loads do not affect the normal operation of the service before the next load balancing optimization, the utilization rate of compute nodes cannot be too high and needs to be balanced with the cost of the compute nodes. For example, involving 5 compute nodes, with resource t (e.g., CPU resources) and utilization rates of 70%, 60%, 30%, 40%, and 50% across the 5 compute nodes, then y t The value is the largest among the aforementioned five occupancy rates, namely 70%.
[0052] The third term in the objective function represents the cost of the computing nodes. Specifically, z represents the planned utilization of the computing nodes, z j This indicates whether compute node j is used, multiplied by the cost weight p of each compute node j. j That is, the overall goal of computing node cost.
[0053] Equation (1) is the constraint condition for limiting the number of new nodes, where A new This represents the threshold for the number of newly added nodes;
[0054] Equation (2) is the load balancing constraint, where, This represents the maximum utilization threshold of resource t across all computing nodes;
[0055] Equation (3) represents the load constraint for computing nodes, indicating that the load carried by each computing node cannot exceed its specification limit (i.e., the limit of resource capacity specification); for resource t and node j, the left side represents the total load of the nodes, and the right side represents the limit of the resource capacity specification of the computing nodes, u i and c j These represent the load specifications and the resource capacity specifications of the compute nodes, respectively.
[0056] Equations (4) and (5) are load constraints; Equation (4) indicates that each load must be borne by a node; Equation (5) indicates that x i,j The value can be 0 or 1;
[0057] Equations (6) and (7) are the constraints for computing nodes, where I represents the set The size; Equation (6) indicates that each node cannot bear any load when not in use, I represents the number of loads, and z is the number of loads when a node is not in use. j If the value is 0, the left side represents the total load carried by node j, and the right side represents whether node j can carry the load.
[0058] In related technologies, after modeling the load balancing problem as described above, a solver can be used to obtain an exact solution. However, as the scale of nodes and load increases, the solution time also increases. In large-scale distributed cloud computing clusters, the efficiency of load balancing algorithms is crucial because the system needs to rapidly process massive numbers of nodes and tasks in a dynamically changing environment. An efficient load balancing scheme must be able to make optimal decisions for a large number of distributed resources within a finite time, ensuring real-time response to changes in cluster status and maintaining the overall performance and reliability of the system. When the scale increases to a certain extent, the solution time will be insufficient to meet the requirements of solving the load balancing problem. Furthermore, in the step of solving the migration path, insufficient capacity of the planned node resources may lead to an unsolvable migration path, causing the load balancing to fail during the scheduling process.
[0059] To address the shortcomings of existing technologies, in the embodiments of this specification, a variable dimensionality reduction strategy is proposed to improve solution efficiency and address large-scale load balancing problems. This strategy significantly reduces the number of decision variables by classifying load units with similar characteristics.
[0060] Based on the embodiments of this specification, the decision granularity of the planning and solving process is adjusted, changing from fine-grained decision-making for each independent load unit to overall allocation decision-making 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 scheme for each type of load (i.e., to obtain the allocation quantity of each type of load in each node). In the second stage, based on the results of the first stage, fine-grained load unit allocation is performed through, for example, a greedy algorithm, to finally obtain the precise placement scheme for each specific load unit.
[0061] The embodiments of this specification provide a method for determining computing nodes. This application also relates to an apparatus for determining computing nodes, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.
[0062] Figure 1 This is a flowchart illustrating a method for determining computing nodes provided in an embodiment of this specification.
[0063] From a programming perspective, the entity executing the process can be a program hosted on an application server or application terminal. It can be understood that this method can be executed by any device, equipment, platform, or cluster of devices with computing and processing capabilities.
[0064] like Figure 1 As shown, the process may include the following steps:
[0065] Step 102: Based on the resource requirements of each load unit in the set of load units to be allocated, divide the set of load units into at least two load classes; the range of resource requirements of load units 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, namely the load unit, can specifically include computing tasks, data requests, and other types of business processing requests, and can include any transaction that requires resource coordination and allocation.
[0067] In practical applications, each load unit may have resource requirements in at least one resource dimension. These resource requirements may include at least one of CPU resources, memory resources, storage resources, and GPU resources, but are not limited to these.
[0068] In the embodiments of this specification, in order to address the problem that the planning and solving process of large-scale load balancing problems is too long and inefficient, a variable dimensionality reduction strategy is proposed. Specifically, the load units to be processed can be divided into at least two load classes according to their similarity in terms of resource demand. This reduces the number of decision variables in the planning and solving process, thereby improving the solution efficiency.
[0069] In classifying load units, a standard can be used where the range of resource requirements among load units within the same load class is less than or equal to a preset resource threshold. The range, also known as the range error or range, is a statistical measure used to represent the difference between the maximum and minimum values in a set of data. The range is a simple method to measure the dispersion of data, reflecting the fluctuation range of values in a dataset. A larger range indicates a more dispersed data distribution; a smaller range indicates a more concentrated data distribution. In the embodiments of this specification, by controlling the range of load classes, the distribution of resource requirements among load units in the classified load classes can be made relatively concentrated. This reduces the difficulty of subsequent processing for precise allocation based on preliminary planning results, improving the overall load balancing effect and efficiency of the solution.
[0070] Step 104: Using a multi-optimization-objective planning model, determine the number of load units allocated to each load class on each computing node; the multi-optimization-objective includes 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 this specification, a multi-objective programming model can be adopted. Specifically, the optimization objectives can be to minimize the load migration cost, maximize the node load balance, and minimize the computing node cost. The objective function can be constructed using the number of load migrations in computing nodes after classification, the maximum resource utilization rate in all computing nodes, and the computing node usage plan as decision variables.
[0072] Specifically, the number of variables used in calculating load migration costs is not the number of loads, but rather the number of load classes after classification. Therefore, the calculation of load migration costs in the objective function of the multi-objective programming model can be based on the number of classified loads migrated across computing nodes. Based on this method, while still possessing the ability to solve the problem of increasing or decreasing cluster computing nodes, the scale of variables is significantly reduced, and the efficiency of variable utilization is improved.
[0073] Step 106: Determine the computing nodes that will carry each load unit in the load unit set based on the number of load units allocated.
[0074] In practical applications, when the computing node that carries each load unit in the set of load units is determined, the load allocation result of all load units in the set of load units to be processed is obtained.
[0075] For example, given a load unit set {a, b, c, d, e} and computing nodes A and B, suppose that in step 102, based on the resource requirements 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 denoted as class p, and d and e are denoted as class q; then, in step 104, by constructing and solving a planning model, the number of loads of class p and class q allocated to nodes A and B can be determined. Suppose that 2 classes 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, based on the planning results of the load classes in the previous step, the specific allocation location of each load unit can be further determined. Suppose 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 may be adjusted according to actual needs, or some steps may be omitted.
[0077] Figure 1 The method described in the article, when dealing with load balancing problems, divides load units with similar resource requirements into the same load class. This allows for unified decision-making based on the class when solving the planning model, reducing the amount of data required for subsequent planning model solutions, lowering the difficulty of the solution, and improving the solution efficiency.
[0078] based on Figure 1 In addition to the method described herein, this specification also provides some improved implementation methods, which will be described below.
[0079] In at least some embodiments of this specification, specific schemes for classifying load units based on their resource requirements are provided.
[0080] Optionally, when load balancing the load units to be allocated, only one resource dimension of each load unit can be considered. For example, only one of the following resources can be considered: CPU resources, GPU resources, memory resources, storage resources, network bandwidth resources, etc. That is, each load unit can have one resource dimension. Based on the resource requirements of each load unit in the set for the resource dimension, the load units are classified to obtain a classification result; the classification result includes at least two categories.
[0081] In practical applications, multiple resource dimensions usually need to be considered. In this case, we can first analyze each dimension (such as CPU, memory, storage, etc.) independently, and classify it under each dimension by using methods such as adaptive thresholding and recursive binary clustering. Then, we can combine each dimension for comprehensive classification, which achieves efficient classification of multi-dimensional load and significantly reduces the complexity of subsequent optimization problems.
[0082] Optionally, when performing load balancing on the load units to be allocated, at least two resource dimensions of each load unit can be considered. For example, two or more of the following resources can be considered: CPU resources, GPU resources, memory resources, storage resources, and network bandwidth resources. In this regard, embodiments of this specification provide load balancing schemes for situations requiring consideration of at least two resource dimensions, and further provide classification schemes for load balancing when considering at least two resource dimensions.
[0083] Specifically, dividing the load unit set into at least two load classes based on the resource requirements of each load unit in the set of load units to be allocated may include: First, classifying each load unit according to the target resource requirements of each load unit in the set for the target resource dimension among the at least two resource dimensions, 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 requirements of the load units included in the same pre-classification is less than or equal to the target resource quantity threshold corresponding to the target resource dimension; then, based on the target pre-classification results corresponding to at least some of the 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 may be classified into the same load class.
[0084] The following explanation uses the example of each load unit having two resource dimensions. First, based on the first resource demand of each load unit in the load unit set for the first resource dimension among the at least two resource dimensions, the load units can be classified to obtain a first pre-classification result corresponding to the first resource dimension. The first pre-classification result includes at least two first pre-classifications, and the range of the first resource demand of load units included in the same first pre-classification is less than or equal to a first preset resource quantity threshold. Then, based on the second resource demand of each load unit in the load unit set for the second resource dimension among the at least two resource dimensions, the load units can be classified to obtain a second pre-classification result corresponding to the second resource dimension. The second pre-classification result includes at least two second pre-classifications, and the range of the second resource demand of load units included in the same second pre-classification is less than or equal to a second preset resource quantity threshold. Afterwards, based on the first pre-classification result and the second pre-classification result, load units belonging to the same first pre-classification and the same second pre-classification can be classified into the same load class. In other words, based on the first pre-classification result and the second pre-classification result, load units classified into the same pre-classification for both the first and second resource dimensions can be determined to belong to one load class.
[0085] Similarly, when it is necessary to consider three or more resource dimensions of each load unit, the example above for each load unit having two resource dimensions can be used as a reference. First, the pre-classification results under each resource dimension are determined, and then the load units that belong to the same pre-classification in the classification results are classified into the same load class.
[0086] Furthermore, in practical applications, to conserve computational resources and improve load balancing performance, when each load unit actually requires the first number of resource dimensions, load classes can be determined based on the pre-classification results of a second number of resource dimensions. Here, 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, load classes can be divided only by referring to the key dimensions among multiple resource dimensions. In practice, the key dimensions can be determined based on actual needs. For example, if the demand for certain resource dimensions is low across all load units, they can be considered non-key dimensions and not used as a reference for classification. For instance, if each load unit includes 3 resource dimensions, pre-classification can be performed on 2 of them, and the load class can be determined based on the combined results of these 2 pre-classifications. Similarly, if each load unit includes 3 resource dimensions, pre-classification can be performed on each of the 3 resource dimensions, and the load class can be determined based on the combined results of these 3 pre-classifications.
[0087] In at least some embodiments of this specification, specific technical means are further provided for classifying load units based on their resource requirements in a set of load units.
[0088] Specifically, dividing the load unit set into at least two load classes based on the resource requirements of each load unit in the load unit set to be allocated may include: using 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 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 in the load unit set according to the target resource demand of each load unit for the target resource dimension, and the load units can be divided into a preset number of pre-classifications on the target resource dimension.
[0090] Furthermore, the preset clustering algorithm may specifically include the K-means algorithm. The core idea of K-means clustering is to continuously optimize the density within clusters by repeatedly adjusting the positions of the cluster centers, thereby obtaining clusters that are as compact and separated as possible. Specifically, the K-means algorithm attempts to divide the dataset into K clusters such that the sum of the distances from each data point to the center of its cluster is minimized. Here, "distance" can be measured using Euclidean distance.
[0091] Furthermore, the preset quantity may specifically include two or more, for example, it may be two.
[0092] In at least some embodiments of this specification, in order to make the classification results of the load units more reasonable, a criterion for whether or not to classify the load units can be further set.
[0093] Specifically, before employing a preset clustering algorithm to perform cluster analysis on each load unit in the load unit set based on the resource requirements of each load unit, and dividing each load unit into a preset number of load classes, the step may further include: calculating the range of resource requirements of each load unit in the load unit set; determining whether the range is greater than or equal to a preset range threshold, and obtaining a range determination result. Correspondingly, the step of employing a preset clustering algorithm to perform cluster analysis on each load unit in the load unit set based on the resource requirements of each load unit, and dividing each load unit into a preset number of load classes, may specifically include: if the range determination result indicates that the range is greater than or equal to a preset range threshold, then employing the preset clustering algorithm to perform cluster analysis on each load unit in the load unit set based on the resource requirements of each load unit, and dividing each load unit into a preset number of load classes.
[0094] Further, if each load unit has at least two resource dimensions, then: before using a preset clustering algorithm to perform cluster analysis on each load unit in the load unit set according to the target resource demand of each load unit for the target resource dimension, and before dividing each load unit into a preset number of pre-classifications on the target resource dimension, the method may further include: for the target resource dimension among the at least two resource dimensions, calculating the target range of each load unit in the load unit set for the target resource dimension; and determining whether the target range is greater than or equal to the target range threshold of the target resource dimension. Correspondingly, the step of using a preset clustering algorithm to perform cluster analysis on each load unit in the load unit set according to the target resource demand of each load unit for the target resource dimension, 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, then performing cluster analysis on 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 for classifying load units, the following example illustrates the process.
[0096] As an example, suppose 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}, which includes five load units: a, b, c, d, and e.
[0097] Suppose 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 set of memory resource requirements {10MB, 15MB, 20MB, 50MB, 60MB} corresponding to the set of load units to be allocated {a, b, c, d, e}. That is, the range is 60MB - 10MB = 50MB.
[0098] Assuming the preset range threshold for memory resources is 15MB, then since 50MB > 15MB, a preset clustering algorithm such as k-means can be used to perform cluster analysis on {a, b, c, d, e}. Assume the preset number of clusters used for classification is 2, and the classification results are two classes: {a, b, c} and {d, e}.
[0099] Furthermore, it is possible to continue analyzing whether the range of resource demand of each load unit in the obtained classification meets the threshold condition for further clustering analysis, that is, whether it is greater than or equal to the preset range threshold. If so, the preset clustering algorithm is continued to perform further classification until the range of resource demand of each load unit in the obtained classification no longer meets the threshold condition for further clustering analysis, that is, it is less than the preset range threshold.
[0100] Continuing with the previous 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, and 10MB < 15MB, so no further cluster analysis is needed. Similarly, 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, and 10MB < 15MB, so no further cluster analysis is needed.
[0101] In practical applications, based on the solutions in the embodiments of this specification, for each resource dimension, it can first be determined whether the range of the resource quantity set reaches a preset range threshold; if it does not reach the threshold, no classification is required; if it does reach the threshold, cluster analysis is performed for classification, and recursive analysis is performed on each category in the classification results until the range of the resource quantity set corresponding to each category does not reach the preset range threshold. Afterwards, loads belonging to the same category in all dimensions can be grouped into the same load class.
[0102] In at least some embodiments of this specification, a method for determining a preset range threshold is further provided.
[0103] Specifically, the preset range threshold can 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 can 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 process may further include: determining the preset range threshold based on the resource capacity of each computing node.
[0104] Further, the preset range threshold can be determined based on the overall first feature capacity of each computing node; the first feature 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 is determined based on the overall first feature capacity of each computing node for the target resource dimension; the first feature 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, the process may further include: calculating the overall first feature capacity of each computing node based on the resource capacity of each computing node; and determining the preset range threshold based on the first feature capacity.
[0105] Furthermore, before determining whether the range is greater than or equal to a preset range threshold, the method may further include: obtaining the resource capacity of each computing node; calculating the first feature capacity of the entire computing node based on the resource capacity of each computing node; and determining the preset range threshold corresponding to the entire computing node based on the first feature capacity.
[0106] In practical applications, 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; calculating the first feature capacity of each computing node as a whole based on the respective target resource capacity; and calculating the preset range threshold corresponding to each computing node as a whole based on the first feature capacity.
[0107] Optionally, the overall first characteristic capacity of each computing node may specifically include the average capacity value of the resource capacity of each computing node. Alternatively, the overall first characteristic capacity of each computing node may further include the minimum capacity value, median capacity value, etc., of the resource capacity of each computing node.
[0108] Furthermore, determining the preset range threshold corresponding to each computing node as a whole based on the first feature capacity can specifically include: multiplying the first feature capacity by a preset ratio to obtain the preset range threshold. The preset ratio can be set to, for example, 10%, 15%, 20%, etc., and is not limited to these numerical examples. It is understood that the smaller the preset ratio is set, the more classifications are obtained, and the more accurate the load balancing result, but the resource consumption is relatively large and the efficiency is relatively low. Conversely, the larger the preset ratio is set, the fewer classifications are obtained, and the resource consumption of the load balancing process is smaller and the efficiency is higher. In practical applications, the aforementioned preset ratio can be set according to actual business needs.
[0109] As an example, assuming that the average capacity of each computing node is 100MB for the memory resource dimension, and the preset ratio is 15%, then the calculated preset range threshold for the memory resource dimension is 15MB (100M × 15% = 15MB).
[0110] In at least some embodiments of this specification, specific solutions are provided for determining the number of load units allocated to each load class on each computing node using a multi-objective linear programming model.
[0111] Specifically, the multi-objective planning model used to determine the number of load units allocated to each load class on each computing node may include: obtaining planning parameter information; the planning parameter information includes the load parameter information of each load unit to be allocated and the node parameter information of each computing node to be planned; constructing a multi-objective planning model based on the planning parameter information, with the optimization objectives of minimizing load migration cost, maximizing node load balancing, and minimizing computing node cost; and solving the multi-objective planning model to obtain the number of load units allocated to each load class on 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 based on the resource demand of each load unit in the load class.
[0113] The load parameter information for the load classes to be allocated may specifically include the number of load classes to be allocated, the number of load units contained in each load class, and resource requirements. The node parameter information for each computing node to be planned may specifically include the number of computing nodes to be planned and resource capacity information. Furthermore, the planning parameter information may also include resource dimension information for load units and computing nodes.
[0114] In at least some embodiments of this specification, a method for determining the characteristic requirements of load cells in a load class is further provided for use in subsequent scaling model solving.
[0115] Specifically, obtaining planning parameter information may include: for any load class, calculating the characteristic value of the resource demand of each load unit contained in the load class, as the characteristic demand of the load unit contained in the load class.
[0116] Optionally, determining the characteristic value of the resource requirement of each load unit included in any load class may specifically include calculating the average value of the resource requirement of each load unit included in any load class. Alternatively, determining the characteristic value of the resource requirement of each load unit included in any load class may specifically include determining the median value of the resource requirement of each load unit included in any load class; however, this is not limited to this and may also be other characteristic values.
[0117] When considering two or more resource dimensions, for the target resource dimension among the two or more resource dimensions: for any load class, the characteristic value of the resource requirement of each load unit contained in the load class for the target resource dimension can be determined as the characteristic requirement of the load unit contained in the load class for the target resource dimension.
[0118] In at least some embodiments of this specification, specific objective functions for multi-objective programming models are further provided.
[0119] Specifically, the objective function of the multi-objective programming model can be:
[0120]
[0121] Where i represents the load class; set Represents a collection of load classes;
[0122] j represents a compute node; set Set A represents the set of operational nodes before planning; set A represents the set of newly added nodes after planning.
[0123] t represents the resource dimension; set A collection representing resource dimensions;
[0124] x represents the number of compute nodes where the load is distributed after classification; xt represents the number of compute nodes that the load is migrated after classification; xt i,j ≥|x i,j -x′ i,j |, where x i,jThis represents the number of load class i in node j after planning; x′ i,j This represents the number of load class i in node j before planning; xt i,j This represents the number of migrations of load class i in compute node j;
[0125] α represents the weight of the cost of a single load migration;
[0126] y represents the maximum resource utilization across all computing nodes; t This represents the maximum utilization of resource t across all computing nodes;
[0127] w represents the weight of the load balancing degree; t The weight representing the load balancing degree of resource t;
[0128] z represents the usage plan for computing nodes; z j Indicates whether compute node j is used;
[0129] p represents the cost weight of the computing node; p j This 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 the objective function represents the estimated load migration cost. More specifically, for each load class i, for all nodes j, it represents the number of migrations xt from load class i to compute nodes j. i,j Summation. The first term in the objective function is a summation term, which is a count of the estimated migration load multiplied by the single migration cost coefficient α, i.e., the total migration cost objective.
[0132] The second term in the objective function represents the node load balancing degree. Specifically, y represents the maximum resource utilization rate. Compute nodes bear some load during runtime, and the utilization rate of the load consumed by each resource in the compute node can be calculated. tThis parameter represents the maximum utilization rate of resource t across all nodes. With a fixed total load, the more balanced the load across the compute nodes, the lower this parameter, and the better the outcome. For a fixed number of nodes and loads (i.e., each load and node is used), the maximum utilization rate reflects the overall efficiency of compute node utilization; the more balanced the load, the lower the maximum utilization rate. When planning node usage, this parameter also represents the overall utilization rate of the compute nodes. To ensure that newly added loads do not affect the normal operation of the service before the next load balancing optimization, the utilization rate of compute nodes cannot be too high and needs to be balanced with the cost of the compute nodes. For example, involving 5 compute nodes, with resource t (e.g., CPU resources) and utilization rates of 70%, 60%, 30%, 40%, and 50% across the 5 compute nodes, then y... t The value is the largest among the aforementioned five occupancy rates, namely 70%.
[0133] The third term in the objective function represents the cost of the computing nodes. Specifically, z represents the planned utilization of the computing nodes, z j This indicates whether compute node j is used, multiplied by the cost weight p of each compute node j. j That is, the overall goal of computing node cost.
[0134] Furthermore, the constraints of the multi-objective programming model include constraints on the number of new nodes, node load balancing, node load limits, load bearing, and node usage.
[0135] Furthermore, the constraints of this planning model can be as follows:
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144] in,
[0145] Equation (1) represents the constraint on the number of newly added nodes; where A new This represents the threshold for the number of new nodes and can be set as a hyperparameter before solving the problem.
[0146] Equation (2) represents the node load balancing constraint; where, This represents the maximum utilization threshold of resource t across all computing nodes; in the embodiments of this specification, it can be... Set it to a value below 100%, for example, 80%, to leave a margin for disaster recovery.
[0147] Equation (3) represents the node load limit constraint; where, This represents the characteristic demand for the classified load (e.g., the mean). c represents the characteristic demand of load class i for resource t; c represents the resource capacity of the compute node; c j,t This represents the resource capacity of compute node j with respect to resource t; for resource t and compute node i, y represents the total load carried by the computing nodes. t c j,t This indicates the capacity limit of the computing node.
[0148] Equation (4) indicates that the load is constrained; where, I i Equation (4) indicates the number of loads belonging to load class i after load classification; Equation (4) indicates that for load class i, at least I need to be carried by all computing nodes. i One load.
[0149] Equation (5) also indicates that the load is constrained; where, Represents a non-negative integer; This indicates the number of load class i in compute node j.
[0150] Equation (6) indicates that the node is subject to constraints; where I represents the set. Size, set Represents a set of loads.
[0151] Equation (7) also indicates that the node is subject to constraints; where z j The value can be either 0 or 1.
[0152] Equation (8) represents the load migration quantity constraint; in this constraint inequality, the left side is the estimated number of load class i migrations in compute node j; the right side is the difference in the number of load class i migrations in compute node j before and after planning. For compute node j, the number of load class i migrations cannot be less than the difference in the number of load class i migrations in compute node j before and after planning. In practical applications, if for compute node j, load class i only migrates out or only migrates in, then xt i,j It can be equal to |x i,j -x′ i,j If for compute node j, load class i has both migration out and migration in, then xt i,j It can be greater than |xi,j -x′ i,j |
[0153] In practical applications, firstly, the characteristic values (e.g., average values) of the resource requirements of load units in each load class across various resource dimensions can be calculated as the characteristic requirements of that load class. Continuing with the example above, let's take a single resource dimension and five load units to be allocated. For the load units to be allocated {a, b, c, d, e}, after being divided into two classes {a, b, c} and {d, e}, the load units in the first class {a, b, c} can be denoted as p, and the load units in the second class {d, e} as q. As an example, if the characteristic resource requirements of the classified loads are calculated by averaging, then the average characteristic requirement of the classified load unit p (i.e., a, b, or c) can be calculated as {10MB, 15MB, 20MB}, which is 15MB; similarly, the average characteristic requirement of the classified load unit q (i.e., d or e) can be calculated as {50MB, 60MB}, which is 55MB.
[0154] Then, a mixed-integer linear programming model can be constructed and solved to obtain the allocation quantity of each type of load across each computing node. Continuing with the example above, assume that before the planning solution, 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 respectively. The resource capacity of computing nodes A, B, and C is 100MB each. Further, by constructing and solving the mixed-integer linear programming model based on information such as the number of load unit classes, the characteristic requirements of load unit classes, the number of load units contained in each load unit class, the number of computing nodes, the resource capacity of each computing node, and the distribution of the classified load units on the computing nodes, the planning result 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 empty.
[0155] Based on the classification-then-planning solution method in the embodiments 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 load multiplied by the number of nodes, while xt i,j The number of variables is the number of load classes multiplied by the number of nodes. When both the number of load classes and the number of nodes are large, the size of the variables can be greatly reduced, and the utilization efficiency of the variables can be improved. In addition, the decision space of the variables has also changed. The planning and solving method in the embodiments of this specification is intuitively equivalent to making a unified decision on a class of loads. The decision granularity is increased, which reduces the decision difficulty to a certain extent and further improves the decision efficiency and the accuracy of the results.
[0156] In at least some embodiments of this specification, a two-stage solution method for load balancing is proposed. The first stage involves solving an optimized mixed-integer linear programming model to obtain the overall allocation scheme for each type of load, i.e., determining the number of loads of each type allocated to each computing node. The second stage, based on the results of the first stage, uses, for example, a greedy algorithm to perform fine-grained unit allocation, ultimately obtaining the precise placement scheme for each specific load unit. That is, by solving the programming model, the number of loads of each type allocated to each computing node can be determined. Based on this, the second stage further determines the computing node to which each load unit is allocated, according to this allocation number. In at least some embodiments of this specification, a specific scheme for determining the computing node to which each load unit is allocated is further provided.
[0157] In practical applications, the process of accurately allocating individual load units can be considered as a bin packing problem. In at least some embodiments of this specification, heuristic algorithms can be used to solve the bin packing problem. Heuristic algorithms are a class of strategies or methods for solving complex problems that are difficult to find optimal solutions in a reasonable time using traditional algorithms. Heuristic algorithms do not guarantee finding the optimal solution, but they 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, harmonic algorithms, greedy algorithms, simulated annealing, genetic algorithms, and tabu search algorithms.
[0158] Specifically, determining the computing nodes that carry each load unit in the load unit set based on the number of load units allocated may include: first, determining the sorting result of each load unit based on the resource requirements of each load unit in the load unit set; wherein, in at least one resource dimension, the resource requirements of the first load unit in the sorting result are not less than the resource requirements of the second load unit; then, using the number of load units allocated to each computing node for each load class as a constraint, and in accordance with the order in which the first load unit precedes the second load unit in the sorting result, determining the computing nodes that carry each load unit in sequence.
[0159] In practical 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 units 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] Further, determining the ranking result of each load unit based on the resource requirements of each load unit in the load unit set may include: for any one of at least two resource dimensions, calculating the second characteristic capacity of each computing node for the resource dimension based on the resource capacity of each computing node for the resource dimension; using the second characteristic capacity for the resource dimension, normalizing the resource requirements of each load unit in the load unit set for the resource dimension to obtain a normalized value of the requirement of each load unit for the resource dimension; determining the characteristic normalized value of each load unit based on the normalized value of the requirement of each load unit under each of the at least two resource dimensions; and determining the ranking result of each load unit based on the characteristic normalized value of each load unit.
[0161] Optionally, the overall second characteristic capacity of all computing nodes may specifically include the average capacity value of the resource capacity of each computing node. Alternatively, the overall second characteristic capacity of all computing nodes may further 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, embodiments of this specification provide a specific scheme for determining the characteristic normalized value of each load unit based on the demand normalized value of each load unit under multiple dimensions for sorting.
[0163] Optionally, determining the feature normalization value of each load unit based on the demand normalization value of each load unit under each of the at least two resource dimensions may specifically include: for any load unit, determining the largest of the corresponding demand normalization values under each of the at least two resource dimensions as the feature normalization value of that load unit.
[0164] Optionally, determining the feature normalization value of each load unit based on the demand normalization value of each load unit under each of the at least two resource dimensions may specifically include: for any load unit, calculating the norm of the corresponding demand normalization value under each of the at least two resource dimensions, and using it as the feature normalization value of the any load unit.
[0165] Alternatively, for any load unit, the mean or other characteristic values of the normalized demand values corresponding to each resource dimension in at least two resource dimensions can be calculated as characteristic normalization values.
[0166] Furthermore, after obtaining the characteristic normalized values of each load unit, they can be sorted in descending order according to the magnitude of the characteristic normalized values to obtain the sorting result of each load unit.
[0167] To facilitate understanding, the specific method for determining the sorting results of each load unit is explained below with examples. Assume that the set of load units to be allocated includes load units a, b, c, d, and e, and the planarable computing nodes include A, B, and C, and the sorting is performed considering two resource dimensions.
[0168] Suppose that the resource requirements of the first resource dimension (e.g., memory resources) of load units a, b, c, d, and e are 10MB, 15MB, 20MB, 50MB, and 60MB respectively, and the resource capacities of the first resource dimension of each computing node A, B, and C are 100MB, 100MB, and 100MB respectively. Therefore, the second characteristic capacity of each computing node A, B, and C can be calculated first. Assuming that the average value is 100MB, this second characteristic capacity can be used to normalize the resource requirements of the first resource dimension of each load unit a, b, c, d, and e, resulting in normalized values of 0.1, 0.15, 0.2, 0.5, and 0.6 for the requirements of each load unit a, b, c, d, and e.
[0169] Furthermore, assuming that the resource requirements of the second resource dimension (e.g., CPU resources) of load units a, b, c, d, and e are 30C, 15C, 40C, 50C, and 20C respectively, and the resource capacities of the first resource dimension of each computing node A, B, and C are 50C, 100C, and 150C respectively, then the second characteristic capacity of each computing node A, B, and C can be calculated first. Assuming that the average value is 100C, this second characteristic capacity can then be used to normalize the resource requirements of the second resource dimension of each load unit a, b, c, d, and e, so that the normalized values of the requirements of each load unit a, b, c, d, and e are 0.3, 0.15, 0.4, 0.5, and 0.2 respectively.
[0170] As shown 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 example above, for each load unit a, b, c, d, and e, the normalized values of the demand for the first resource dimension are 0.1, 0.15, 0.2, 0.5, and 0.6, respectively, and the normalized values of the demand for the second resource dimension are 0.3, 0.15, 0.4, 0.5, and 0.2, respectively. Optionally, for any load unit, the largest relative value can be obtained from the normalized values of the demand corresponding to multiple resource dimensions to determine the overall feature normalization value. In this case, the feature normalization values corresponding to each load unit a, b, c, d, and e can be 0.3 (the larger of 0.1 and 0.3), 0.15, 0.4 (the larger of 0.2 and 0.4), and 0.5, 0.6 (the larger of 0.6 and 0.2), respectively.
[0172] Furthermore, the characteristic normalization values can be sorted in descending order to obtain e, d, c, a, and b. Therefore, when accurately allocating each load unit subsequently, they can be allocated sequentially in the order of e, d, c, a, and b.
[0173] It should be noted that the values given in the above examples are for ease of calculation and explanation and do not constitute a limitation on the application scenarios of the technical solutions in this specification. In actual application, they may vary depending on the actual business situation.
[0174] In at least some embodiments of this specification, a specific scheme is further provided for determining the computing node that carries each load unit in turn based on the sorting result of each load unit in the set of load units to be allocated.
[0175] Specifically, the step of using the number of load units allocated to each load class on each computing node as a constraint, and sequentially determining the computing nodes that carry each load unit according to 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 according to the number of load units allocated to each computing node for the target load class.
[0176] In at least some embodiments of this specification, when determining the allocation result of each load unit to be allocated based on the planning result, in order to reduce migration costs, if the planning result obtained by solving the planning model indicates that the computing node where the load unit to be allocated is currently located has a planned load class to which the load unit to be allocated belongs, then the load unit can be moved as little as possible.
[0177] Specifically, determining the computing node to carry the first load unit based on the number of load units allocated to each computing node for the target load class may include: determining at least one target computing node to be allocated the target load class based on the number of load units allocated to each computing node for the target load class; determining whether the at least one target computing node contains the computing node where the first load unit is currently located, and obtaining a migration determination result; if the migration determination result indicates that the at least one target computing node contains the computing node where the first load unit is currently located, then the computing node where the first load unit is currently located is determined as the computing node to carry the first load unit. If the migration determination result indicates that the at least one target computing node does not contain the computing node where the first load unit is currently located, then the computing node to carry the first load unit is selected from the at least one target computing node.
[0178] In practical applications, during the process of allocating load units sequentially according to the sorting results, there may be situations where it is impossible to allocate all load units to the planned computing nodes according to the solution of the planning model. This is because linear programming performs a coarse placement of the classified loads. This coarse placement ignores the differences in resource requirements between different load units within the same load class. However, in practical applications, since the resource requirements of different load units within the same load class also vary, there may be cases where the resource requirements of loads coarsely placed on a certain node are too large relative to the characteristic requirements of the corresponding load class (for example, a load class contains loads with resource requirements of 4, 4, 5, 6, and 6 respectively, and the characteristic requirement of this load class is 5, but during the greedy placement process, two loads with a resource requirement of 6 are placed on the same node). The resources used by this node exceed the ideal resource consumption, potentially leading to an inability to support the corresponding load according to the planning solution. In this case, one can first try placing the corresponding load on other nodes within the plan. If other nodes within the plan also cannot place the corresponding load, then other nodes outside the plan can be used to place the corresponding load.
[0179] Further, determining the computing node to carry the first load unit based on the number of load units allocated to each computing node for the target load class can specifically include: determining at least one target computing node to be allocated the target load class based on the number of load units allocated to each computing node for the target load class; determining whether the remaining resource capacity of any one of the at least one target computing nodes is sufficient to carry the first load unit, and obtaining a carrying determination result. If the carrying determination result indicates that the remaining resource capacity of any one of the at least one target computing nodes is sufficient to carry the first load unit, then that one target computing node is determined as the computing node to carry the first load unit. If the carrying determination result indicates that the remaining resource capacity of none of the at least one target computing nodes is sufficient to carry the first load unit, then the computing node to carry the first load unit is determined from at least one non-planned node of the target load class; the non-planned node is used to indicate a computing node that was 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 there is more than one target computing node, the first load unit may be placed on any of the at least one target computing node. During each placement attempt, it is necessary to determine whether the remaining resource capacity of any target computing node is sufficient to support the first load unit.
[0181] In practical applications, for any target computing node, if the first load unit is the first load unit placed in the target computing node, then the remaining resource capacity can be the resource capacity of the target computing node; if the first load unit is not the first load unit placed in the target computing node, that is, other load units have already been placed in the target computing node, then the remaining resource capacity can be the remaining resource capacity after subtracting the resource capacity occupied by the other load units that have already been placed from the resource capacity of the target computing node.
[0182] Furthermore, embodiments of this specification provide a specific method for determining the computing node carrying the first load unit from at least one unplanned node of the target load class.
[0183] Specifically, determining the computing node carrying 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 non-planned node obtained by solving the planning model; calculating the current resource state vector of the non-planned node; the current resource state vector is used to reflect the distribution of each load class in the non-planned node if the first load unit is allocated to the non-planned node; calculating the norm of the difference vector between the preset resource state vector and the current resource state vector of the non-planned node; and determining the computing node carrying the first load unit from the non-planned nodes based on the norm of the difference vector corresponding to each non-planned node of the target load class; wherein the norm of the determined computing node carrying the first load unit is less than or equal to the norm of other computing nodes in the non-planned nodes.
[0184] Furthermore, the number of elements in the preset resource state vector of any non-planned node (i.e., the dimension of the preset resource state vector) is equal to the number of load units planned to the non-planned node by solving the planning model. Each element in the preset resource state vector of any non-planned node represents the characteristic demand of each load class planned to the non-planned 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) represents the estimated number of load units in any non-planned node if the first load unit is allocated to it. Each element in the current resource state vector of any non-planned node represents the characteristic demand of each load class allocated to that non-planned node if the first load unit is allocated to it.
[0186] Further, determining the computing node to carry the first load unit from at least one unplanned node of the target load class specifically includes: determining whether there are any unplanned nodes among the at least one unplanned nodes with remaining resource capacity to carry the first load unit; if so, further determining the computing node to carry the first load unit from the unplanned nodes that can carry the first load unit.
[0187] In practical applications, there may be situations where none of the computing nodes, including planned and unplanned nodes, can support the first load unit. In such cases, the computing node with the lowest cost from the backup computing nodes can be selected as the computing node to support the first load unit.
[0188] To facilitate understanding, the specific method for accurately allocating load units based on the sorting results will now be explained with examples.
[0189] Continuing with the example above, the load units {a, b, c, d, e} to be assigned are divided into two categories: {a, b, c} (denoted as class p) and {d, e} (denoted as class q). Before planning, the load units are distributed on the nodes as follows: A places {a, d}, B places {b, e}, and C places {c}. After planning, the load units are distributed on the nodes as follows: A places {q, p, p}, B places {q, p}, and C is left empty.
[0190] Based on this, heuristic algorithms such as greedy algorithms can be used for fine-grained unit allocation. First, the load units {a, b, c, d, e} can be sorted according to their respective resource requirements. For ease of explanation, assume 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, the load units a, b, c, d, and e can be sorted in descending order of resource requirements, resulting in the sorted order of e, d, c, b, a.
[0191] Next, the load cells e, d, c, b, and a can be precisely placed in sequence. It is known that the resource capacity of nodes A and B is 100MB each.
[0192] First, load unit e is placed. Since load unit e belongs to class q, according to the planned number of load units allocated, class q can be placed on node A or node B. Load unit e was originally located on node B, and the remaining resource capacity (100MB) of node B can support load unit e (60MB). Therefore, according to the scheme 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 number of load units and the previous placement, class q can be placed on node A. The remaining resource capacity (100MB) of node A can support load unit d (50MB). Therefore, according to the scheme 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 number of load units and the previous placement, class p can be placed on node A or node B. Load unit c was originally located on node C. The remaining resource capacity of node A is 50MB. According to the embodiment of this specification, load unit c can be allocated to node A, which has more remaining resource capacity.
[0195] Then, load unit b is placed. Since load unit b belongs to class p, according to the planned number of load units allocated and the previous placement, class p can be placed on node A or node B. Load unit b was originally located on node B, and the remaining resource capacity (40MB) of node B can support load unit b (15MB). Therefore, according to the scheme 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 number of load units allocated and the previous placement, class p can be placed on node A. And the remaining resource capacity (30MB) of node A can support load unit a (10MB). Therefore, according to the scheme of the embodiment of this specification, load unit a can be allocated to node A.
[0197] Through the above allocation process, the distribution of each load unit on the node can be obtained as follows: A carries {d, c, a}, and B carries {e, b}.
[0198] Based on at least some of the above embodiments, a heuristic algorithm such as greedy allocation can be used to determine the specific load-bearing nodes for each load unit based on the planning solution. In practical applications, considering that the solution obtained by greedy allocation is an approximate solution, for example, the actual load allocated to the computing node may be larger than the estimated load, or there may be remaining load units that need to be processed. In these cases, the greedy allocation result may not reach a local optimum.
[0199] Therefore, in the embodiments of this specification, the load allocation result obtained by the greedy allocation is further optimized through local search optimization to improve the overall balance of the system.
[0200] Further, after determining the computing nodes that carry each load unit according to the sorting result, based on the number of load units allocated to each computing node for each load class as a constraint, the method may further include: determining at least one optimizable state in the current load allocation state; the current load allocation state reflects the allocation of each load unit to be allocated to each computing node; any optimizable state reflects the allocation of each load unit to be allocated to each computing node after moving any third load unit allocated to the first computing node to a second computing node that can accommodate the third load unit; calculating the new load balancing degree corresponding to the at least one optimizable state based on the allocation reflected by any optimizable state; if the new load balancing degree corresponding to the at least one optimizable state is less than the original load balancing degree corresponding to the current load allocation state, then moving the third load unit to the second computing node to obtain the optimized load allocation result.
[0201] Furthermore, it is possible to continue to determine whether there is any possibility of further optimization of the current load distribution status after optimization, until no move 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 can be referred to the second summation term in the planning model above, and will not be repeated here.
[0203] In practical applications, you can try every possible movement of the load cell and determine whether each movement will improve the load balancing of the nodes.
[0204] Continuing with the example above, the allocation result of assigning load units a, c, and d to compute node A, and load units b and e to compute node B, is denoted as A(a,c,d)+B(b,e). Next, for example, we can try placing load unit a on compute node B. Assuming B can still accommodate a, we can calculate the first load balancing degree under the condition of A(c,d)+B(a,b,e), and compare it with the original load balancing degree of A(a,c,d)+B(b,e). If the first load balancing degree is better than the original load balancing degree, then load unit a is moved to compute node B; otherwise, it is not moved. For example, we can try placing load unit b into computing node A. Assuming that A can still accommodate b, we can calculate the second load balancing degree in the case 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, we can move load unit b to computing node A; otherwise, we do not move it.
[0205] In practical applications, each load unit (i.e., each of the load units a, b, c, d, and e in the example above) is tried, and the case with the smallest load balance value among all cases is selected as the final load distribution.
[0206] When all move operations are not feasible or worsen the load balancing value, it indicates that a local optimum has been reached, and the local search optimization step ends.
[0207] Based on at least some embodiments of this specification, by employing 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 so that a solution exists. 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 local search optimization.
[0208] It should be noted that, in the embodiments of this specification, during the entire process of determining the computing nodes used to carry the load units to be allocated, among the stages involved in multi-dimensional classification of load units, initial planning and solving, greedy allocation optimization, and local search optimization, the initial planning and solving consumes relatively more computing resources, while the other stages consume relatively less computing resources. The solution in the embodiments of this specification reduces the overall load balancing efficiency by increasing the granularity of the planning and solving and reducing the difficulty of the planning and solving; at the same time, it ensures a better load balancing result by combining greedy allocation optimization and local search optimization.
[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 have not been described one by one. Therefore, the arbitrary combination of various technical features in the above embodiments is also within the scope of this specification.
[0210] According to the above explanation, Figure 2 This diagram illustrates the execution flow of a load balancing task in a practical application scenario provided by an embodiment of this specification.
[0211] like Figure 2 The variable dimensionality reduction algorithm shown can be used to accelerate the solution of load balancing schemes on cloud computing clusters and may include the following stages and steps.
[0212] First, in step 202, input the load parameter information. 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 of load units on the computing nodes, and the limitations on the number of computing nodes that can be added.
[0213] The first stage is load classification: classifying load units with similar resource requirements to reduce the complexity of subsequent optimization problems.
[0214] Step 204: The load units to be allocated are independently categorized according to the demand of each resource dimension. Resource dimensions may include, for example, CPU resources, memory resources, and storage resources.
[0215] Step 206: On 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 yes, proceed to step 208. The preset range threshold can be determined as a preset ratio (e.g., 10%) of the average resource capacity of all nodes on that resource dimension.
[0216] Step 208: Using a clustering algorithm such as k-means, the load set is divided into two parts. Then, step 204 can be returned to recursively classify each part.
[0217] Step 210: After the recursive classification is completed, loads that belong to the same category across all resource dimensions are grouped into one load class.
[0218] The second stage is the initial planning solution: determining a preliminary allocation scheme for each type of load.
[0219] Step 212: For each load class and for each resource dimension, calculate the average resource requirement of the load units in the load class as the characteristic requirement of the load class in the corresponding resource dimension.
[0220] Step 214: Construct and solve the mixed-integer linear programming model to obtain the number of load classes allocated to each computing node.
[0221] The third stage is greedy allocation optimization: based on the initial planning results of the second stage, the individual load units are precisely allocated.
[0222] Step 216: Sort the load units according to their resource requirements to obtain the sorting results:
[0223] Specifically, the average capacity of the compute nodes can be used to normalize the resource requirements of the load across each resource dimension. Then, optionally, the maximum normalized value for each load across each resource dimension can be calculated as the weight of that load. Afterward, the loads can be sorted in descending order of weight. This sorting result is used to prioritize the allocation of loads with higher resource requirements that are ranked higher. In practical applications, other bin packing heuristics (such as First Fit, Best Fit, Next Fit, etc.) can also be referenced, using other methods such as the norm of the load's resource requirements for sorting.
[0224] Step 218: Place each load unit in sequence according to the sorting results.
[0225] Specifically, the load can be preferentially allocated to the computing nodes specified in the planning results; if the originally specified computing nodes cannot accommodate the load, the norm minimization principle can be used to select the computing node whose remaining resource status is closest to the expected value. The norm minimization principle refers to minimizing the norm of the difference between the current resource state vector and the ideal resource state vector, so as to minimize the "distance" between the current resource state and the ideal state.
[0226] In addition, for load units that could not be placed on nodes based on the initial planning solution results of the second phase, nodes that minimize the cost of computing nodes are selected for placement.
[0227] The fourth stage, local search optimization: further optimize load distribution and improve the overall system balance.
[0228] Step 220: Try moving a single load from the current compute node to another compute node to determine if it can improve the system load balance. If it can, proceed to step 222; otherwise, proceed to step 224.
[0229] Step 222: Perform a move operation that maximizes the improvement of system load balancing.
[0230] Repeat steps 220 and 222 until no move operation can be found that can improve the system load balancing.
[0231] Step 224: Output the distribution status information of the load units to be allocated on the computing nodes after load balancing.
[0232] The method based on the embodiments of this specification groups loads with similar specifications into one category, accelerating the solution process by reducing the scale of the variables to be solved in the planning model, thus greatly shortening the solution time. After obtaining the preliminary allocation schemes for each type of load, a heuristic algorithm is used to quickly obtain the specific distribution of each computing node. Compared with direct placement (loading any feasible node found), the heuristic algorithm significantly improves the quality of the solution while keeping the running time unchanged. Finally, adjustments are made through a small-scale local search to obtain a locally optimal solution.
[0233] Compared to directly solving for the specific distribution of each computing node in related technologies, the method based on the embodiments of this specification significantly shortens the solution time while ensuring that the quality of the solution remains within an acceptable range. It enables the solution of larger-scale load balancing problems and substantially reduces the time cost. Furthermore, controlling the redundancy of computing nodes improves the success rate of load balancing during the scheduling process.
[0234] In related technologies, during the process of solving migration paths, insufficient capacity of the planned computing nodes may lead to an unsolvable migration path, causing load balancing to fail during scheduling. This is because, during migration, a migration action moves a load i from its original computing node j1 to the corresponding computing node j2. The complete migration process requires completing each migration action sequentially for the given sequence, ensuring that no computing node exceeds its specification limits after each migration action. Although the final state meets the constraints, there may not be a valid sequence of migration actions that guarantees no exceedance of specification limits after each migration action. For example, consider a simple case where computing node A contains load a, and computing node B contains load b. Both computing nodes are at full capacity. If ab needs to be swapped, but neither computing node A nor B has enough space to accommodate other loads, then there is no valid sequence of migration actions, meaning the migration path is unsolvable.
[0235] For the problem of no solution for migration paths, the solution based on the embodiments of this specification, since the result of the planning and solving is an approximate solution, compared with the exact solution in related technologies, will follow the principle of prioritizing the allocation of load to the original computing nodes in the greedy solution step to plan the final load distribution, thereby minimizing the load that needs to be migrated and significantly improving the solution rate of migration paths.
[0236] Based on the same idea, embodiments of this specification also provide apparatus corresponding to the above methods.
[0237] Figure 3 The embodiments provided in this specification correspond to Figure 1 A schematic diagram of the structure of a device for determining computing nodes.
[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 requirements of each load unit in the load unit set to be allocated; the range of resource requirements of load units contained in the same load class is less than or equal to a preset resource threshold.
[0240] The planning and solving module 304 is used to determine the number of load units allocated to each load class on each computing node using a multi-optimization objective planning model; the multi-optimization objective includes 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 allocation module 306 is used to determine the computing node that carries each load unit in the load unit set according to the number of load units allocated.
[0242] based on Figure 3 The embodiments of this specification also provide 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 among at least two resource dimensions, classify each load unit in the load unit set according to the target resource demand of each load unit for the target resource dimension, and 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 quantity threshold corresponding to the target resource dimension; based on the target pre-classification results corresponding to at least some of the resource dimensions among the at least two resource dimensions, classify 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 into the same load class.
[0244] Optionally, the load classification module 302 can be specifically used to: 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.
[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 the 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 computing node; calculate the first characteristic capacity of the computing nodes as a whole based on the resource capacity of each computing node; and determine the preset range threshold corresponding to the computing nodes as a whole based on the first characteristic capacity.
[0247] Optionally, the planning and solving 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; construct a multi-objective planning model with the optimization objectives of minimizing load migration cost, maximizing node load balancing, and minimizing computing node cost based on the planning parameter information; and solve the multi-objective planning model to obtain the number of load units allocated to each load class on each computing node.
[0248] Optionally, obtaining planning parameter information may specifically include: for any load class, calculating the characteristic value of the resource demand of each load unit contained in the load class, as the characteristic demand of the load unit contained in the load class.
[0249] Optionally, the objective function of the multi-objective programming model can be:
[0250]
[0251] Where i represents the load class; set Represents a collection of load classes;
[0252] j represents a compute node; set Set A represents the set of operational nodes before planning; set A represents the set of newly added nodes after planning.
[0253] t represents the resource dimension; set A collection representing resource dimensions;
[0254] x represents the number of compute nodes where the load is distributed after classification; xt represents the number of compute nodes that the load is migrated after classification; xt i,j ≥|x i,j -x′ i,j |, where x i,j This represents the number of load class i in node j after planning; x′ i,j This represents the number of load class i in node j before planning; xt i,j This represents the number of migrations of load class i in compute node j;
[0255] α represents the weight of the cost of a single load migration;
[0256] y represents the maximum resource utilization across all computing nodes; t This represents the maximum utilization of resource t across all computing nodes;
[0257] w represents the weight of the load balancing degree; t The weight representing the load balancing degree of resource t;
[0258] z represents the usage plan for computing nodes; z j Indicates whether compute node j is used;
[0259] p represents the cost weight of the computing node; p j This represents the cost weight of computing node j.
[0260] Optionally, the constraints of the multi-objective programming model include constraints on the number of new nodes, node load balancing, node load limits, load being carried, and node usage.
[0261] Optionally, where,
[0262] The constraint on the number of new nodes is:
[0263]
[0264] Among them, A new This represents the threshold for the number of newly added nodes;
[0265] The node load balancing constraint is:
[0266]
[0267] in, This represents the maximum utilization threshold of resource t across all computing nodes;
[0268] The node load limit constraint is:
[0269]
[0270] in, This represents the characteristic demand for the load after classification. c represents the characteristic demand of load class i for resource t; c represents the resource capacity of the compute node; c j,t This represents the resource capacity of compute node j with respect to resource t; for resource t and compute node i, y represents the total load carried by the computing nodes. t c j,t This indicates the limitation on the capacity of the computing nodes;
[0271] The load bearing constraints include:
[0272]
[0273] as well as,
[0274] Among them, I i This represents the number of loads belonging to load class i after load classification; This means that for load class i, at least one compute node needs to carry load I. i One load;
[0275] Represents a non-negative integer; This indicates the number of load class i in compute node j;
[0276] The constraints used by the nodes include:
[0277] And z j ∈{0,1};
[0278] Where I represents the set Size, set Represents a set of loads.
[0279] Optionally, the load allocation module 306 may specifically include: a sorting unit, configured to determine the sorting result of each load unit according to the resource requirements of each load unit in the load unit set; wherein, in at least one resource dimension, the resource requirements of the first load unit in the sorting result are not less than the resource requirements of the second load unit; and an allocation unit, configured to determine the computing nodes that carry each load unit sequentially 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 computing node for each load class as a constraint.
[0280] Optionally, the sorting unit may specifically be used to: for any one of at least two resource dimensions, calculate the second characteristic capacity of each computing node for any one resource dimension based on the resource capacity of each computing node for that resource dimension; use the second characteristic capacity for that resource dimension to normalize the resource demand of each load unit in the load unit set for that resource dimension, to obtain the normalized demand value of each load unit for that resource dimension; determine the characteristic normalized value of each load unit based on the normalized demand value of each load unit under each of the at least two resource dimensions; and determine the sorting result of each load unit based on the characteristic normalized value of each load unit.
[0281] Optionally, determining the feature normalization value of each load unit based on the demand normalization value of each load unit under each of the at least two resource dimensions may specifically include: for any load unit, determining the largest of the corresponding demand normalization values under each of the at least two resource dimensions as the feature normalization value of that load unit.
[0282] Optionally, determining the feature normalization value of each load unit based on the demand normalization value of each load unit under each of the at least two resource dimensions may specifically include: for any load unit, calculating the norm of the corresponding demand normalization value under each of the at least two resource dimensions, and using it as the feature normalization value of the any load unit.
[0283] Optionally, the allocation unit may be specifically used to: determine the target load class to which the first load unit belongs for the first load unit in the sorting result; and determine the computing node that carries the first load unit based on the number of load units allocated to each computing node for the target load class.
[0284] Optionally, determining the computing node carrying the first load unit based on the number of load units allocated to each computing node for the target load class may specifically include: determining at least one target computing node to be allocated the target load class based on the number of load units allocated to each computing node for the target load class; determining whether the at least one target computing node contains the computing node where the first load unit is currently located, and obtaining a migration determination result; if the migration determination result indicates that the at least one target computing node contains the computing node where the first load unit is currently located, then determining the currently located computing node as the computing node carrying the first load unit.
[0285] Optionally, determining the computing node to carry the first load unit based on the number of load units allocated to each computing node for the target load class can specifically include: determining at least one target computing node to be allocated the target load class based on the number of load units allocated to each computing node for the target load class; determining whether the remaining resource capacity of any of the at least one target computing nodes is sufficient to carry the first load unit, and obtaining a carrying determination result; if the carrying determination result indicates that the remaining resource capacity of each of the at least one target computing nodes is insufficient to carry the first load unit, then determining the computing node to carry 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 has not been planned to carry the target load 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 non-planned node obtained by solving the planning model; calculating the current resource state vector of the non-planned node; the current resource state vector is used to reflect the distribution of each load class in the non-planned node if the first load unit is allocated to the non-planned node; calculating the norm of the difference vector between the preset resource state vector and the current resource state vector of the non-planned node; and determining the computing node carrying the first load unit from the non-planned nodes based on the norm of the difference vector corresponding to each non-planned node of the target load class; wherein the norm of the determined computing node carrying the first load unit is less than or equal to the norm of other computing nodes in the non-planned nodes.
[0287] Optionally, the apparatus is further configured to: determine at least one optimizable state under the current load allocation state; the current load allocation state is used to reflect the allocation of the load units to be allocated to each computing node; any of the optimizable states is used to reflect the allocation of the load units to be allocated to each computing node after moving any third load unit allocated to the first computing node to a second computing node that can accommodate the third load unit; calculate the new load balancing degree corresponding to the at least one optimizable state based on the allocation state reflected by the at least one optimizable state; if the new load balancing degree corresponding to the at least one optimizable state is less than the original load balancing degree corresponding to the current load allocation state, then move the third load unit to the second computing node to obtain an optimized load allocation 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 modules mentioned above refer to computer programs or program segments used to perform one or more specific functions. Furthermore, the distinction between these modules does not imply that the actual program code must also be separate.
[0290] The above is a schematic scheme of an apparatus for determining computing nodes according to this embodiment. It should be noted that the technical solution of this apparatus for determining computing nodes and the technical solution of the method for determining computing nodes described above belong to the same concept. For details not described in detail in the technical solution of the apparatus for determining computing nodes, please refer to the description of the technical solution of the method for determining computing nodes described above.
[0291] Based on the same idea, this specification also provides devices corresponding to the above methods in its embodiments.
[0292] Figure 4 The embodiments provided in this specification correspond to Figure 1 A schematic diagram of the structure of a device for determining computing nodes. (Example) Figure 4 As shown, device 400 may include:
[0293] At least one processor 410; and,
[0294] Memory 430 communicatively connected to the at least one processor; wherein,
[0295] The memory 430 stores instructions 420 that can be executed by the at least one processor 410, the instructions being executed by the at least one processor 410 to enable the at least one processor 410 to:
[0296] Based on the resource requirements of each load unit in the set of load units to be allocated, the set of load units is divided into at least two load classes; the range of resource requirements of load units in the same load class is less than or equal to a preset resource threshold.
[0297] A multi-optimization-objective planning model is adopted to determine the number of load units allocated to each load class on each computing node; the multi-optimization-objective includes 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] Based on the number of load units allocated, determine the computing nodes that carry each load unit in the set of load units.
[0299] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the method for determining computing nodes described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the method for determining computing nodes described above.
[0300] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the method for determining a computing node as described above.
[0301] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the method for determining computing nodes described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the method for determining computing nodes described above.
[0302] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method for determining a computing node described above.
[0303] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the method for determining computing nodes described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the method for determining computing nodes described above.
[0304] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the apparatus and device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The apparatus, device and method provided in the embodiments of this specification are corresponding to each other, and therefore the apparatus and device also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding apparatus and device will not be repeated here.
[0305] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential 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 either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, 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, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0307] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0308] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0309] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0310] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied 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] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0312] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0313] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function 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] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0316] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital character versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0317] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0318] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0319] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for determining computing nodes, comprising: Based on the resource requirements of each load unit in the set of load units to be allocated, and based on one or more resource dimensions of each load unit, the set of load units is divided into at least two load classes; the range of resource requirements of load units contained in the same load class is less than or equal to a preset resource threshold. A multi-optimization-objective planning model is used to determine the number of load units allocated to each load class on 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. The number of variables used in calculating the load migration cost is equal to the number of load classes; Based on the number of load units allocated, determine the computing nodes that carry each load unit in the set of load units.
2. The method as described in claim 1, wherein dividing the load unit set into at least two load classes based on one or more resource dimensions of each load unit according to the resource requirements of each load unit in the set of load units to be allocated, specifically includes: For a target resource dimension among at least two resource dimensions, each load unit in the load unit set is classified according to its target resource demand for the target resource dimension, resulting in 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 load units in the same pre-classification is less than or equal to the target resource quantity 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 as described in claim 1, wherein dividing the load unit set into at least two load classes based on one or more resource dimensions of each load unit according to the resource requirements of each load unit in the set of load units to be allocated, specifically includes: A preset clustering algorithm is used to perform cluster analysis on each load unit in the load unit set according to the resource requirements of each load unit, and to divide each load unit into a preset number of load classes.
4. The method as described in claim 3, further comprising, before employing 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 dividing each load unit into a preset number of load classes: Calculate the range of resource requirements for each load unit in the load unit set; Determine whether the range is greater than or equal to a preset range threshold to obtain the range determination result; The step involves employing a preset clustering algorithm to perform cluster analysis on each load unit in the load unit set based on the resource requirements of each load unit, dividing each load unit into a preset number of load classes. Specifically, this includes: If the range judgment result indicates that the range is greater than or equal to the preset range threshold, then a preset clustering algorithm is used 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.
5. The method as described in claim 4, further comprising, before determining whether the range is greater than or equal to a preset range threshold: Obtain the resource capacity of each computing node; Based on the resource capacity of each computing node, calculate the first characteristic capacity of the entire computing nodes. Based on the first feature capacity, a preset range threshold is determined for each computing node as a whole.
6. The method as described in claim 1, wherein the step of using a multi-optimization objective planning model to determine the number of load units allocated to each load class on each computing node specifically includes: Obtain planning parameter information; The planning parameter information includes the load parameter information of each load unit to be allocated and the node parameter information of each computing node to be planned. Based on the planning parameter information, a multi-objective planning model is constructed with the optimization objectives of minimizing load migration cost, maximizing node load balancing, and minimizing computing node cost. The multi-objective programming model is solved to obtain the number of load units allocated to each load class on each computing node.
7. The method as described in claim 6, wherein obtaining the planning parameter information specifically includes: For any load class, calculate the characteristic value of the resource requirement of each load unit contained in the load class, and use it as the characteristic requirement of the load unit contained 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; set Represents a collection of load classes; j represents a compute node; set Set A represents the set of operational nodes before planning; set A represents the set of newly added nodes after planning. t represents the resource dimension; set A collection representing resource dimensions; This indicates the number of computing nodes where the load is distributed after classification. This indicates the number of loads migrated across compute nodes after classification; ,in, This indicates the number of load class i in node j after planning; This indicates the number of load class i in node j before planning; This represents the number of migrations of load class i in compute node j; α represents the weight of the cost of a single load migration; This indicates the maximum resource utilization rate across all computing nodes; This represents the maximum utilization of resource t across all computing nodes; w represents the weight of the load balancing degree; The weight representing the load balancing degree of resource t; This indicates the usage plan for the computing nodes; Indicates whether compute node j is used; p represents the cost weight of the computing node; This represents the cost weight of computing node j.
9. The method of claim 8, wherein, The constraints of the multi-objective programming model include constraints on the number of new nodes, node load balancing, node load limits, load carrying, and node usage.
10. The method of claim 9, wherein, The constraint on the number of new nodes is: ; in, This represents the threshold for the number of newly added nodes; The node load balancing constraint is: , ; in, This represents the maximum utilization threshold of resource t across all computing nodes; The node load limit constraint is: , ; in, This represents the characteristic demand for the load after classification. c represents the characteristic demand of load class i for resource t; c represents the resource capacity of the computing node. This represents the resource capacity of compute node j with respect to resource t; for resource t and compute node i, This represents the total load carried by the computing nodes. This indicates the limitation on the capacity of the computing nodes; The load bearing constraints include: , ; as well as, , ; in, This represents the number of loads belonging to load class i after load classification; This indicates that for load class i, at least one compute node needs to carry... One load; Represents a non-negative integer; This indicates the number of load class i in compute node j; The constraints used by the nodes include: , and ; in, I Represents a set Size, set Represents a set of loads.
11. The method as described in claim 1, wherein determining the computing node that carries each load unit in the load unit set according to the number of load units allocated specifically includes: Based on the resource requirements of each load unit in the load unit set, the ranking result of each load unit is determined; wherein, in at least one resource dimension, the resource requirement of the first load unit in the ranking result is not less than the resource requirement of the second load unit. Using the number of load units allocated to each computing node for each load class as a constraint, the computing nodes that carry each load unit are determined sequentially according to the order in which the first load unit precedes the second load unit in the sorting result.
12. The method of claim 11, wherein determining the sorting result of each load unit based on the resource requirements of each load unit in the load unit set specifically includes: For any one of the at least two resource dimensions, calculate the second feature capacity of each computing node for any one resource dimension based on the resource capacity of each computing node for that resource dimension. Using the second characteristic capacity for any resource dimension, the resource requirement of each load unit in the load unit set for any resource dimension is normalized to obtain the normalized value of the requirement of each load unit for any resource dimension. Based on the normalized demand value of each load unit under each of the at least two resource dimensions, determine the feature normalization value of each load unit; The sorting result of each load unit is determined based on the characteristic normalization value of each load unit.
13. The method of claim 12, wherein determining the feature normalization value of each load unit based on the demand normalization value of each load unit under each of the at least two resource dimensions specifically includes: For any load unit, the largest of the normalized demand values corresponding to each of the at least two resource dimensions is determined as the feature normalized value of the load unit.
14. The method of claim 12, wherein determining the feature normalization value of each load unit based on the demand normalization value of each load unit under each of the at least two resource dimensions specifically includes: For any load unit, calculate the norm of the normalized demand value corresponding to each of the at least two resource dimensions, and use it as the feature normalized value of the load unit.
15. The method of claim 11, wherein the step of determining the computing nodes carrying each load unit 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 on each computing node as a constraint, specifically includes: For the first load unit in the sorting result, determine the target load class to which the first load unit belongs; The computing node that carries the first load unit is determined based on the number of load units allocated to each computing node for the target load class.
16. The method of claim 15, wherein determining the computing node carrying the first load unit based on the number of load units allocated to each computing node according to the target load class specifically includes: Based on the number of load units allocated to each computing node for the target load class, at least one target computing node to which the target load class is to be allocated is determined; Determine whether the at least one target computing node contains the computing node where the first load unit is currently located, and obtain the migration determination result; If the migration determination result indicates that the at least one target computing node contains the current computing node where the first load unit is located, then the current computing node is determined as the computing node carrying the first load unit.
17. The method of claim 15, wherein determining the computing node carrying the first load unit based on the number of load units allocated to each computing node for the target load class, specifically includes: Based on the number of load units allocated to each computing node for the target load class, at least one target computing node to which the target load class is to be allocated is determined; Determine whether the remaining resource capacity of any one of the at least one target computing nodes is sufficient to support the first load unit, and obtain the load capacity determination result; If the load determination result indicates that the remaining resource capacity of each of the at least one target computing nodes is insufficient to support the first load unit, then a computing node to support the first load unit is determined from at least one non-planned node of the target load class; the non-planned node is used to indicate a computing node that has not been planned to support the target load class according to the solution result of the planning model.
18. The method of 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 includes: For any non-planned node of the target load class, obtain the preset resource state vector of the non-planned node; The preset resource state vector is used to reflect the distribution of each load class obtained by solving the planning model in any non-planned node; Calculate 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 any non-planned node if the first load unit is allocated to any non-planned node. Calculate 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, the computing node carrying the first load unit is determined from each non-planned node; wherein, the norm of the determined computing node carrying the first load unit is less than or equal to the norm of other computing nodes among the non-planned nodes.
19. The method of claim 11, further comprising, after determining the computing nodes carrying each load unit in the order of the first load unit preceding the second load unit in the sorting result, using the number of load units allocated to each computing node for each load class as a constraint, the method further comprises: Identify at least one optimizable state under the current load distribution status; The current load allocation status is used to reflect the allocation of each load unit to be allocated on each computing node; any of the optimizable states are used to reflect the allocation of each load unit to be allocated on each computing node after moving any third load unit allocated to the first computing node to a second computing node that can accommodate the third load unit. Based on the allocation situation reflected by any of the at least one optimizable states, calculate the 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, then any third load unit is moved to the second computing node to obtain the optimized load distribution result.
20. The method of any one of claims 1 to 19, wherein the type of resource requirement includes at least one of CPU resources, memory resources, storage resources, and GPU resources.
21. An apparatus for determining a computing node, comprising: The load classification module is used to divide the load unit set into at least two load classes based on one or more resource dimensions of each load unit in the set of load units to be allocated, according to the resource requirements of each load unit; the range of resource requirements of load units contained in the same load class is less than or equal to a preset resource threshold. The planning and solving module is used to determine the number of load units allocated to each computing node for each load class using a multi-objective planning model. 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 number of variables used in calculating the load migration cost is equal to the number of load classes; The load allocation module is used to determine the computing nodes that carry each load unit in the load unit set according to the number of load units allocated.
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, which, when executed by the at least one processor, enable the at least one processor to: Based on the resource requirements of each load unit in the set of load units to be allocated, and based on one or more resource dimensions of each load unit, the set of load units is divided into at least two load classes; the range of resource requirements of load units contained in the same load class is less than or equal to a preset resource threshold. A multi-objective planning model is used to determine the number of load units allocated to each load class on each computing node. The multi-objective includes a first objective for load migration cost, a second objective for node load balancing, and a third objective for computing node cost. The number of variables used in calculating the load migration cost is equal to the number of load classes. Based on the number of load units allocated, determine the computing nodes that carry each load unit in the set of load units.
Citation Information
Patent Citations
Cloud data center-oriented computing task cross-region migration method and system
CN115718644A
Load balancing method and device, computer equipment and storage medium
CN116737373A