Data center resource allocation method, device, equipment and computer program product
By constructing a target knowledge graph and a multi-objective genetic algorithm, the data center resource allocation is adaptively adjusted, solving the problems of insufficient resource utilization efficiency and flexibility in the existing technology, and achieving global optimization and efficient utilization of data center resources.
Patent Information
- Application Number
- CN202410500470.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2024-10-18
AI Technical Summary
Existing data center resource management and optimization methods are difficult to cope with dynamic changes in resource demand, resulting in insufficient resource utilization efficiency and flexibility. They also lack consideration of the connections and constraints between resources, making it difficult to achieve global optimization.
By acquiring data center performance monitoring data and multiple objective functions, we construct a target knowledge graph and use multi-objective genetic algorithms to adaptively adjust the resource allocation plan to meet changing resource needs, improve the flexibility of resource allocation, and improve resource allocation. In the process, the relationships and constraints of multiple resources are taken into account.
It achieves global optimization of data center resources, improves resource utilization efficiency and flexibility, and can dynamically adjust resource allocation to meet diverse needs and avoid resource conflicts and waste.
Smart Images

Figure CN118796447A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of data center resource management and optimization, and in particular, to a data center resource allocation method, apparatus, device, and computer program product. Background Art
[0002] Data center resources generally refer to various equipment, facilities, and technical resources used to support data center operations and data processing. These resources include but are not limited to servers, storage devices, network devices, etc. The following methods can be used to manage and optimize data center resources: manual planning and static allocation. Manual planning means that data center administrators manage and optimize data center resources through manual planning. This method requires administrators to have rich experience and knowledge, and it takes a lot of time and effort to plan and manage; static allocation means that data center administrators allocate resources to various applications based on static rules and planning to meet their needs.
[0003] Related solutions usually manage and optimize data center resources based on traditional rules and experience, which makes it difficult to cope with the ever-fluctuating resource demands, and the utilization efficiency and flexibility of data center resources are insufficient. Summary of the invention
[0004] The embodiments of the present application provide a data center resource allocation method, apparatus, device, and computer program product to at least solve the problem of insufficient utilization efficiency and flexibility of data center resources in related solutions.
[0005] In order to solve the above technical problems, this application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a data center resource allocation method, comprising: obtaining performance monitoring data of a data center and multiple objective functions to be optimized; determining an initial resource allocation scheme for each application of the data center based on the performance monitoring data and the multiple objective functions, and constructing an initialization population with each resource allocation scheme as an individual; determining a fitness function based on the multiple objective functions; determining the fitness value of each individual in the initialization population based on the fitness function and the resource dependency relationship between each application and resource equipment in a pre-constructed target knowledge graph; updating and iterating the individuals in the initialization population based on the fitness value of each individual in the initial population and a preset individual selection strategy until a preset termination condition is met, and determining the target resource allocation scheme for each application.
[0007] In a second aspect, an embodiment of the present application provides a data center resource allocation device, comprising: an information acquisition module, used to acquire performance monitoring data of the data center and multiple objective functions to be optimized; a population construction module, used to determine the initial resource allocation scheme of each application of the data center based on the performance monitoring data and the multiple objective functions, and to construct an initialized population with each resource allocation scheme as an individual; a function determination module, used to determine the fitness function based on the multiple objective functions; a fitness value determination module, used to determine the fitness value of each individual in the initialized population based on the fitness function and the resource dependency relationship between each application and resource equipment in a pre-constructed target knowledge graph; a scheme determination module, used to update and iterate the individuals in the initialized population based on the fitness value of each individual in the initial population and a preset individual selection strategy until a preset termination condition is met, and determine the target resource allocation scheme for each application.
[0008] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect above are implemented.
[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the method described in the first aspect above.
[0011] In an embodiment of the present application, the performance monitoring data of the data center and multiple objective functions to be optimized are obtained; the initial resource allocation scheme of each application in the data center is determined according to the performance monitoring data and the multiple objective functions, and each resource allocation scheme is used as an individual to construct an initialization population; the fitness function is determined according to the multiple objective functions; the fitness value of each individual in the initialization population is determined according to the fitness function and the resource dependency relationship between each application and resource equipment in the pre-constructed target knowledge graph; the individuals in the initialization population are updated and iterated according to the fitness value of each individual in the initial population and the preset individual selection strategy until the preset termination condition is met, and the target resource allocation scheme of each application is determined. In this way, the initial resource allocation scheme of each application in the data center is determined according to the performance monitoring data and the multiple objective functions, and the initial resource allocation scheme is adaptively adjusted based on the multiple objective functions, which can meet the ever-changing resource requirements and improve the flexibility of resource allocation in the data center. At the same time, in the process of adjusting the resource allocation scheme, the association and constraints of multiple resources are taken into account based on the target knowledge graph, which can achieve global optimization of data center resources and improve the utilization efficiency of data center resources.
[0012] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0014] Figure 1 A schematic diagram of a process flow of a data center resource allocation method provided in an embodiment of the present application is shown;
[0015] Figure 2 An example diagram of a resource knowledge graph in a single server provided in an embodiment of the present application is shown;
[0016] Figure 3 An example diagram of a cross-server resource knowledge graph provided by an embodiment of the present application is shown;
[0017] Figure 4 A schematic diagram of a process for resource optimization based on a multi-objective genetic algorithm provided in an embodiment of the present application is shown;
[0018] Figure 5 A schematic diagram showing the structure of a data center resource allocation device provided in an embodiment of the present application is shown;
[0019] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0020] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0021] Currently, the following methods can be used to manage and optimize data center resources:
[0022] (I) Manual planning: Data center administrators manage and optimize data center resources through manual planning. This method requires administrators to have rich experience and knowledge, and also takes a lot of time and effort to plan and manage.
[0023] (ii) Static allocation: Data center administrators allocate resources to various applications to meet their needs. This approach is usually based on static requirements and planning, lacking adaptability and flexibility to dynamic changes.
[0024] (III) Single resource optimization: Traditional optimization methods often consider the optimization of a single resource, such as CPU, storage, and network.
[0025] Existing data center resource management and optimization methods are usually based on static demand and planning, lacking adaptability and flexibility to dynamic changes. This method cannot meet the needs of modern data centers for efficiency and flexibility, and is difficult to cope with fluctuating resource demands when the scale of data centers changes dynamically with business fluctuations.
[0026] In addition, there are also methods of using genetic algorithms to optimize data center resources in related technologies, but these methods only optimize a single goal without considering the connections and constraints between resources. When various resources are mutually constrained, it is difficult to achieve global optimization of data center resources, and the utilization efficiency of data center resources is low.
[0027] In response to the above-mentioned problems in the management and optimization of data center resources, an embodiment of the present application provides a data center resource allocation method, which determines the initial resource allocation plan for each application in the data center based on performance monitoring data and multiple objective functions, and adaptively adjusts the initial resource allocation plan based on multiple objective functions to meet the ever-changing resource requirements and improve the flexibility of data center resource allocation.
[0028] Figure 1A flow chart of a data center resource allocation method provided in an embodiment of the present application is shown. The execution subject of the method may be a terminal device or a server, wherein the terminal device may be a device such as a personal computer, or a mobile terminal device such as a mobile phone or a tablet computer, and the terminal device may be a terminal device used by a user. The server may be an independent server, or a server cluster composed of multiple servers, and the server may be a background server for a certain business, or a background server for a certain platform or application (such as an automated management system, monitoring and analysis tools, etc.). In the embodiment of the present application, the execution subject is taken as an example to illustrate. For the case of a terminal device, it can be processed according to the following related content, which will not be repeated here. As shown in the figure, the method 100 may include the following steps:
[0029] S101: Obtain performance monitoring data of a data center and multiple objective functions to be optimized.
[0030] Among them, performance monitoring data includes CPU, memory, network load, number of virtual machines, distribution, resource usage, storage device capacity and other data; multiple objective functions to be optimized are used to reflect the diverse needs and goals of the data center, including maximizing CPU resource utilization, minimizing virtual machine latency, minimizing storage access latency, maximizing server resource utilization, etc.
[0031] In the specific implementation, in order to realize the intelligent management and optimization of data center resources, it is necessary to collect the usage of various hardware resources, including key performance indicators such as CPU, memory, and power consumption. By monitoring and collecting this data, we can have a deep understanding of the usage ratio of each resource in the data center, thereby providing data support for resource optimization and dynamic adjustment. In order to collect this data, various monitoring tools and software can be used, namely CPU monitoring tools, memory monitoring tools, storage monitoring tools, energy consumption monitoring tools, etc. Through these tools, the usage, ratio and other performance monitoring data of various hardware resources can be monitored in real time, so that the usage and dependency between different resources can be determined through performance monitoring data, and more accurate and meaningful data analysis results can be obtained by processing and analyzing the collected data.
[0032] In a possible implementation, before obtaining the performance monitoring data of the data center and the multiple objective functions to be optimized in S101, the process further includes:
[0033] Obtain performance requirement information of each application; determine resource devices that have resource dependencies with the performance requirement information of each application based on the resource information of the data center; generate the target knowledge graph based on the performance requirement information of each application and the resource devices that have resource dependencies with the performance requirement information.
[0034] Among them, performance requirement information includes CPU resources, GPU resources, network resources, container resources, storage resources, memory resources, etc.; resource devices include servers, storage devices, network devices, etc.; resource dependencies refer to the interdependence and mutual influence relationship between various resources in a system, including need, allocation to, running on, connection, storage, etc.
[0035] In the embodiments of the present application, Figure 2 As shown in the figure, the performance requirement information of each application is obtained to generate a resource knowledge graph within a single server. Taking the CPU resources required by the application as an example, the following triples are used to represent the dependency and constraint relationship between resources:
[0036] (Application, Requirement, CPU Resources)
[0037] (CPU resources, allocated to, virtual machines)
[0038] (virtual machine, running on, server)
[0039] (Server, Connection, Storage Device)
[0040] (storage device, storage, data)
[0041] In these triple descriptions, the subject is a resource in a data center, such as "application", "CPU resources", "virtual machine", "server", and "storage device", which represents an entity. The predicate is different relationships, such as "need", "assigned to", "running on", "connected", and "stored", which represent different dependencies between resources. The object is also a resource in a data center, which represents the relationship with the subject, such as "CPU resources", "virtual machine", "server", "storage device", and "data".
[0042] These triples express that the application needs CPU resources, the CPU resources are allocated to the virtual machine, the virtual machine runs on the server, the server is connected to the storage device to store data, and so on. In actual use, each subject, predicate, and object will store the specific size of the resource, for example:
[0043] -Memory resources are 32GB DDR4, bandwidth is 2400MHz
[0044] - Hard disk resource is 2TB SAS, rotation speed is 7200rpm
[0045] - The virtual machine has 2 CPU cores and 8GB of memory
[0046] -The server is a Dell PowerEdge R740 with 2 Intel Xeon Gold 6240 processors, each CPU has 18 cores, the main frequency is 2.6GHz, the memory size is 64GB, and the hard disk capacity is 4TB.
[0047] Data centers usually contain a complex system of a large number of hardware and software resources, including servers, storage devices, network devices, etc. Figure 3 As shown in Figure 1, in a data center, the relationships between these resources are complex. For example, virtual machines may be called from one server to another, and storage devices may be shared by multiple servers. These relationships are very important for the management and allocation of data center resources.
[0048] Therefore, a target knowledge graph is generated based on the performance requirement information of each application and the resource devices that have resource dependencies with the performance requirement information. The target knowledge graph can be used to represent the resource dependencies of applications, the network topology between servers, the connection relationship between storage devices, the mapping relationship between virtual machines and physical servers, etc. The construction of a knowledge graph enables the management and allocation of data center resources to take into account the relationship between resources. If resource management and allocation are performed without a clear representation of resource relationships, it may lead to resource conflicts, resource waste and other problems. For example, if multiple virtual machines have been deployed on a physical server, but the administrator is not clear about the resource competition relationship between these virtual machines, it may cause the performance of some virtual machines to decline, thereby affecting the operating efficiency of the entire data center. In addition, if the relationship between data center resources is not clear, it will also affect the definition of multi-objective functions and the optimization of multi-objective genetic algorithms.
[0049] Through the above methods, the constructed target knowledge graph can provide a clear representation of resource relationships, helping administrators to better manage and allocate data center resources. At the same time, the knowledge graph also provides a basis for the definition of multi-objective functions and the optimization of multi-objective genetic algorithms in subsequent steps, making resource management and allocation more efficient and accurate, and achieving more comprehensive and global optimization measures.
[0050] S102: Determine an initial resource allocation plan for each application program in the data center according to the performance monitoring data and the multiple objective functions, and construct an initialization population by taking each resource allocation plan as an individual.
[0051] In an exemplary embodiment, the performance monitoring data of the existing virtual server is as follows:
[0052] -CPU: 10 cores
[0053] -Memory: 64GB
[0054] - Storage: 200GB
[0055] There is a resource dependency relationship between application A, application B and virtual servers. According to multiple objective functions including maximizing CPU resource utilization and minimizing storage access latency, the optimization variables of each application in the data center are determined to be CPU resource usage and storage device usage. According to performance monitoring data and multiple objective functions, the initial resource allocation plan for each application in the data center can be application A: 4 cores, 16GB memory; application B: 6 cores, 48GB memory; or application A: 6 cores, 48GB memory; application B: 4 cores, 16GB memory. Each resource allocation plan is taken as an individual to construct an initialization population.
[0056] S103: Determine a fitness function according to the multiple objective functions.
[0057] In a specific implementation, the fitness function may be determined based on multiple objective functions. For example, the weighted sum of multiple objective functions may be determined as the fitness function. Alternatively, multiple objective functions may be processed and the fitness function may be determined based on the processed objective functions.
[0058] In a possible implementation, the above S103, determining the fitness function according to the multiple objective functions, includes:
[0059] The multiple objective functions are normalized to obtain multiple normalized objective functions; and the multiple normalized objective functions are weightedly summed to obtain the fitness function.
[0060] An example of multiple objective functions is as follows:
[0061] Maximize CPU resource utilization: Applications need to use CPU resources to run. Therefore, maximizing CPU resource utilization can improve CPU efficiency and reduce resource waste. By optimizing CPU resource allocation and load balancing, CPU resources can be used to the maximum extent.
[0062] Minimize VM latency: VMs, as the operating environment for applications, require CPU and storage resources. Therefore, minimizing VM latency is an important objective function. By optimizing VM allocation and load balancing, VM latency can be reduced and application operating efficiency can be improved.
[0063] Minimize storage access latency: Storage devices need to be connected to servers to provide data storage services. Therefore, minimizing storage access latency is also an important objective function. By optimizing the allocation and load balancing of storage devices, storage access latency can be reduced and data access efficiency can be improved.
[0064] Maximize server resource utilization: Virtual machines need to run on servers. Therefore, maximizing server resource utilization is also an important objective function. By optimizing the allocation and load balancing of server resources, server resources can be utilized to the maximum extent.
[0065] Normalize multiple objective functions to the interval [0,1], representing CPU resource utilization, virtual machine latency, storage access latency, and server resource utilization, and combine them into a fitness function so that they can be used in the update iteration process of individuals in the initial population. The purpose of the fitness function is to evaluate each individual to determine their fitness in the group. Specifically, for the above four objective functions, they can be combined into a fitness function through the following steps:
[0066] Step a1: Normalize each objective function and convert them to the interval [0,1], which can be achieved by the following formula:
[0067] normalized_value=(original_value-min_value) / (max_value-min_value)
[0068] Among them, original_value is the value of the original objective function, min_value and max_value are the minimum and maximum values of the objective function in the current population, respectively. normalized_value is the normalized value.
[0069] Step a2: For each individual, add their normalized objective function values to get their fitness value fitness. This can be achieved by the following formula:
[0070] fitness=w1*normalized_value1+w2*normalized_value2+w3*normalized_value3+w4*normalized_value4;
[0071] Among them, w1, w2, w3 and w4 are weights used to adjust the relative importance of each objective function, and their sum should be 1; normalized_value1, normalized_value2, normalized_value3, normalized_value4 represent the normalized objective function values corresponding to each objective function respectively.
[0072] For each individual, the higher the fitness value, the higher their fitness in the group. Therefore, in the genetic algorithm, individuals with high fitness values are selected as parents so that their excellent characteristics can be passed on to the next generation.
[0073] S104: Determine the fitness value of each individual in the initialized population according to the fitness function and the resource dependency relationship between each application and resource device in the pre-constructed target knowledge graph.
[0074] In a specific implementation, the fitness value of each individual in the initialization population is determined according to the fitness function determined in S103 above and the resource dependency relationship between each application and resource device in the target knowledge graph. Here, the objective function is to obtain the variables of its related resources through the target knowledge graph, and then set the objective function through these variables. For example, application A uses CPU, virtual machine, and storage. The variables corresponding to these resources include CPU resource utilization, virtual machine delay, storage utilization, etc. These variables can set the corresponding objective functions, such as maximizing CPU resource utilization, minimizing virtual machine delay, maximizing storage utilization, etc.
[0075] In this way, the fitness value of each individual in the initialized population can be determined. At the same time, the association and constraint relationship between multiple resources are considered in the process of determining the fitness value, which is conducive to obtaining the global optimal target resource allocation plan.
[0076] S105: According to the fitness value of each individual in the initial population and a preset individual selection strategy, the individuals in the initialization population are updated and iterated until a preset termination condition is met, and a target resource allocation scheme for each application is determined.
[0077] The preset termination condition may be that the number of iterations reaches a preset threshold, or that the fitness values of individuals in the population no longer change significantly.
[0078] In a specific implementation, individuals with high fitness can be selected according to the fitness function to generate the next generation population, and the individuals in the initialized population are updated and iterated until the preset termination condition is met to determine the target resource allocation plan for each application.
[0079] In a possible implementation, the above S105, according to the fitness value of each individual in the initial population and the preset individual selection strategy, updates and iterates the individuals in the initial population until a preset termination condition is met, and determines the target resource allocation scheme for each application, including:
[0080] According to a preset individual selection strategy, a predetermined number of individuals are selected from the individuals of the initial population as parents of the next generation population;
[0081] Perform crossover and mutation operations on the selected parents to generate new individuals;
[0082] The next generation population is determined based on the generated new individuals, the fitness value of each individual in the next generation population is determined using the fitness function, and the individuals in the next generation population are selected again according to the individual selection strategy until a preset termination condition is met, thereby determining the target resource allocation plan for each application.
[0083] In the embodiment of the present application, a tournament selection method can be used to select individuals, randomly select several individuals from the current population, and select the individual with the highest fitness to generate the next generation population. The specific steps of the algorithm are as follows:
[0084] Step b1: Randomly select k individuals, where k is the size of the tournament.
[0085] Step b2: Select the individual with the highest fitness from the k individuals as the winner of the tournament.
[0086] Repeat steps b1 and b2 until a sufficient number of individuals are selected to generate the next generation of population. In tournament selection, the size of k determines the selection pressure, that is, the larger k is, the smaller the selection pressure is, and more individuals have the opportunity to participate in the generation of the next generation; and the smaller k is, the greater the selection pressure is, and it is easier to select individuals with high fitness.
[0087] Then, the selected parent generation is subjected to crossover and mutation operations to generate new individuals. Crossover: Perform crossover operations on selected individuals to generate new offspring. For example, single-point crossover or multi-point crossover can be used to perform crossover operations on virtual machines and servers. Mutation: Perform mutation operations on selected individuals to generate new offspring. For example, mutation operations can be used to reallocate virtual machines and servers in a data center.
[0088] The next generation population is determined based on the generated new individuals, the fitness value of each individual in the next generation population is determined using the fitness function, and the individuals in the next generation population are selected again according to the individual selection strategy until a preset termination condition is met, thereby determining the target resource allocation plan for each application.
[0089] In order to maintain the diversity of individuals and ensure the global optimal solution, the above-mentioned individual selection strategy according to the preset individual selection strategy selects a predetermined number of individuals from the individuals of the initial population as the parents of the next generation population, including:
[0090] According to the fitness value of each individual in the initialization population, the individuals in the initialization population are divided into a plurality of non-dominated layers; for each of the non-dominated layers, a predetermined number of individuals in the non-dominated layer are selected as parents of the next generation population.
[0091] In an embodiment of the present application, the Pareto front can be used to resolve the trade-off between multiple objectives so that a set of relatively balanced solutions can be found, which is used to describe the set of all non-dominated solutions. The so-called non-dominated solution means that under multiple objective functions, no other solution can achieve better results at the same time. In other words, the solutions on the Pareto front can be regarded as a set of relatively excellent solutions, which are relatively balanced under multiple objective functions and have no obvious advantages and disadvantages. In a multi-objective genetic algorithm, a set of relatively balanced solutions can be found by generating the Pareto front to meet the diverse needs and goals of the data center. Specifically, the Pareto front can be generated by the following steps:
[0092] Step c1: Initialize the population and evaluate each individual to obtain their fitness values.
[0093] Step c2: According to the fitness value, all individuals are divided into different non-dominated layers, where the first layer contains all non-dominated solutions, the second layer contains all solutions that are slightly worse than the first layer solutions, and so on.
[0094] Step c3: For each layer, select a portion of individuals as the next generation population. The specific selection algorithm can be adopted according to the actual situation, such as tournament selection.
[0095] Step c4: Repeat the above steps c2 and c3 until a sufficient number of solutions are generated or the specified number of iterations is reached.
[0096] Through the above steps, a set of relatively balanced solutions can be generated. They perform well under multiple objective functions and have no obvious advantages or disadvantages. Such solutions are highly feasible and operational and can meet the diverse needs and goals of data centers.
[0097] In addition, in multi-objective genetic algorithms, it is also necessary to consider how to maintain the diversity of the solution set to avoid all solutions being concentrated in a certain area. Specifically, a diversity maintenance mechanism can be used to increase the probability of crossover and mutation, introduce random strategies, or use different selection strategies to maintain the diversity of the solution set. After multiple rounds of iterations, the optimal solution of the population and the corresponding target fitness function value can be obtained.
[0098] The above-mentioned dividing the individuals in the initialization population into a plurality of non-dominated layers according to the fitness value of each individual in the initialization population includes:
[0099] The individuals in the initialization population are sorted in descending order of fitness values, and individuals with the same fitness values are divided into a non-dominated layer to obtain multiple non-dominated layers.
[0100] In an exemplary embodiment, individuals can be sorted according to the size of the fitness value. Individuals with the same fitness value are divided into one layer, and the number of layers is determined according to the number of individual fitness values. For example, there are 5 individuals, and their fitness values are 1, 0.9, 0.9, 0.8, and 0.7 respectively. Then they are divided into 4 layers, the first layer is 1, the second layer is 0.9, 0.9, the third layer is 0.8, and the fourth layer is 0.7, thereby obtaining multiple non-dominated layers.
[0101] In the specific implementation, Figure 4 As shown, the data center resource allocation method may include the following steps:
[0102] Step 401: define multiple objective functions, namely, maximizing CPU resource utilization, minimizing virtual machine latency, minimizing storage access latency, and maximizing server resource utilization;
[0103] Step 402: Determine variables: In the genetic algorithm, determine the variables that need to be optimized. The variables that need to be optimized in the data center include CPU resource usage, the number of virtual machines turned on, the number of servers turned on, storage device usage, etc.;
[0104] Step 403: Initialize the population: randomly generate a set of initial solutions as the initial population, that is, the CPU resource usage, the number of virtual machines turned on, the number of servers turned on, and the storage device usage rate can be randomly allocated in the data center.
[0105] Step 404: using the tournament selection method to select a predetermined number of individuals from the individuals of the initialized population as the parents of the next generation population; performing crossover and mutation operations on the selected parents to generate new individuals;
[0106] Step 405: Use the Pareto front to resolve the trade-off relationship between multiple objectives so as to find a set of relatively balanced solutions, thereby obtaining a target resource allocation solution for each application.
[0107] The embodiment of the present application provides a data center resource allocation method, which obtains the performance monitoring data of the data center and multiple objective functions to be optimized; determines the initial resource allocation scheme of each application in the data center according to the performance monitoring data and multiple objective functions, and constructs an initialization population by taking each resource allocation scheme as an individual; determines the fitness function according to the multiple objective functions; determines the fitness value of each individual in the initialization population according to the fitness function and the resource dependency relationship between each application and resource equipment in the pre-constructed target knowledge graph; updates and iterates the individuals in the initialization population according to the fitness value of each individual in the initial population and the preset individual selection strategy until the preset termination condition is met, and determines the target resource allocation scheme of each application. In this way, the initial resource allocation scheme of each application in the data center is determined according to the performance monitoring data and multiple objective functions, and the initial resource allocation scheme is adaptively adjusted based on the multiple objective functions, which can meet the ever-changing resource requirements and improve the flexibility of resource allocation in the data center. At the same time, in the process of adjusting the resource allocation scheme, the association and constraints of multiple resources are taken into account based on the target knowledge graph, which can achieve global optimization of data center resources and improve the utilization efficiency of data center resources.
[0108] In an exemplary embodiment, taking application A and application B as examples, a genetic algorithm is used to search for optimization, and the resource dependency relationship between application A, application B and the server is obtained through the target knowledge graph. Based on the usage values of the hardware resources collected by monitoring, the existing resource parameter configuration is optimized to a better parameter configuration through a multi-objective genetic algorithm, and the corresponding objective function value is calculated. Among them, application A is a computing-intensive application that requires a large amount of CPU resources, while application B is a memory-intensive application that requires a large amount of memory resources. The resources of the existing virtual server are as follows:
[0109] -CPU: 10 cores
[0110] -Memory: 64GB
[0111] - Storage: 200GB
[0112] The historical artificial initial resource allocation strategy is:
[0113] - Application A: 4 cores, 16GB memory
[0114] - Application B: 6 cores, 48GB memory
[0115] In actual operation, the CPU utilization of application A is high, while the memory utilization is low; the memory utilization of application B is high, while the CPU utilization is low. Through long-term monitoring of the resource utilization of applications A and B, it is found that the existing artificial resource allocation is unreasonable, as shown below: CPU and memory utilization are either too high or too low:
[0116] The resource utilization before monitoring optimization is:
[0117] -CPU utilization of Application A: 80%
[0118] -Memory utilization of application A: 25%
[0119] - CPU utilization of Application B: 20%
[0120] -Memory utilization of application B: 75%
[0121] The resource quota of the virtual server is reallocated through a multi-objective genetic algorithm, so that the resource utilization of applications A and B is more reasonable while meeting the resource constraints of the programs themselves (the resource constraints of applications A and B themselves are 4 cores and 8GB, using the Pareto frontier constraint). After multiple rounds of selection, mutation and iteration, the optimal parameters are as follows:
[0122] Application A: 6 cores, 8GB memory
[0123] Application B: 4 cores, 56GB memory
[0124] By calculating and monitoring indicators, we can find that after resource reallocation, the calculation process is as follows:
[0125] The optimized resource utilization is calculated as follows:
[0126] -CPU utilization of Application A:
[0127] (old CPU core / new CPU core)*old CPU utilization=(4 cores / 6 cores)*80%=53.3%
[0128] -Memory utilization of application A:
[0129] (Old memory amount / New memory amount)*Old memory utilization=(16G / 8G)*25%=50%
[0130] -CPU utilization of Application B:
[0131] (Old CPU core / New CPU core)*Old CPU utilization=(6 cores / 4 cores)*20%=30%
[0132] -Memory utilization of application B:
[0133] (Old memory amount / New memory amount)*Old memory utilization=(48G / 56G)*75%=64.3%
[0134] Among them, the better objective function value obtained by calculation is as follows:
[0135] -Application A CPU resource utilization: reduced from 80% to 53.3%
[0136] -Application A memory resource utilization: increased from 25% to 50%
[0137] -Application B CPU resource utilization: reduced from 20% to 30%
[0138] -Application B memory resource utilization: reduced from 75% to 64.3%
[0139] By reallocating resources, the CPU and memory utilization of applications A and B are changed to about 50%, achieving the following effects: the CPU and memory resources of the entire virtual server are fully utilized, resource utilization is improved, and at the same time, the CPU and memory resources allocated to each application are also reasonably and effectively utilized, with balanced utilization. In actual operation, the CPU and memory utilization is maintained at a reasonable level of about 50%, which is neither too high nor too low. Too high utilization usually means that there are insufficient resources or limited application performance; while too low utilization means that there are idle resources and waste of resources. A utilization of about 50% means that resources can meet application requirements, application performance is achieved, and resources are fully utilized.
[0140] The above is a scenario that considers multi-resource optimization among multiple applications. In actual use, optimization will be performed on the application, container, virtual machine and other levels.
[0141] The ability of the target knowledge graph is to model and describe global resources. By modeling and describing the dependencies between data center resources, we can more accurately understand the relationships between resources and optimization solutions; the ability of the genetic algorithm is to achieve dynamic adjustment and allocation of resources through calculation and optimization. Through the modeling of global resources by the target knowledge graph and the calculation of the genetic algorithm, we can more accurately understand the relationships between resources and optimization solutions, and achieve dynamic adjustment and allocation of resources, thereby improving the efficiency and reliability of the data center and meeting the requirements of different business needs.
[0142] Figure 5 The structure diagram of the data center resource allocation device provided in the embodiment of the present application is shown. The data center resource allocation device can implement the following Figure 1 or Figure 4In the embodiment shown, all or part of the contents, the data center resource allocation device 500 includes:
[0143] An information acquisition module 510 is used to acquire performance monitoring data of a data center and multiple objective functions to be optimized;
[0144] A population construction module 520 is used to determine the initial resource allocation scheme of each application program of the data center according to the performance monitoring data and the multiple objective functions, and construct an initialization population by taking each resource allocation scheme as an individual;
[0145] A function determination module 530, configured to determine a fitness function according to the plurality of objective functions;
[0146] A fitness value determination module 540 is used to determine the fitness value of each individual in the initialization population according to the fitness function and the resource dependency relationship between each application and resource device in the pre-built target knowledge graph;
[0147] The scheme determination module 550 is used to update and iterate the individuals in the initialization population according to the fitness value of each individual in the initial population and the preset individual selection strategy until the preset termination condition is met, so as to determine the target resource allocation scheme for each application.
[0148] In a possible implementation, the data center resource allocation device 500 further includes:
[0149] A graph generation module is used to obtain the performance requirement information of each application; determine the resource equipment that has a resource dependency relationship with the performance requirement information of each application based on the resource information of the data center; and generate the target knowledge graph based on the performance requirement information of each application and the resource equipment that has a resource dependency relationship with the performance requirement information.
[0150] In a possible implementation, the function determination module 530 includes:
[0151] A normalization processing unit, used for normalizing the multiple objective functions to obtain multiple normalized objective functions;
[0152] The function acquisition unit is used to perform weighted summation on the multiple normalized objective functions to obtain the fitness function.
[0153] In a possible implementation, the solution determination module 550 includes:
[0154] A selection unit, configured to select a predetermined number of individuals from the individuals of the initialization population as parents of the next generation population according to a preset individual selection strategy;
[0155] An operation unit, used to perform crossover and mutation operations on the selected parent generation to generate new individuals;
[0156] A determination unit is used to determine the next generation population according to the generated new individuals, use the fitness function to determine the fitness value of each individual in the next generation population, select the individuals in the next generation population again according to the individual selection strategy until a preset termination condition is met, and determine the target resource allocation plan for each application.
[0157] The selection unit, when used to select a predetermined number of individuals from the individuals of the initialization population as parents of the next generation population according to a preset individual selection strategy, is specifically used to:
[0158] According to the fitness value of each individual in the initialization population, the individuals in the initialization population are divided into a plurality of non-dominated layers;
[0159] For each of the non-dominated layers, a predetermined number of individuals in the non-dominated layer are selected as parents of the next generation population.
[0160] The selection unit, when used to divide the individuals in the initialization population into a plurality of non-dominated layers according to the fitness value of each individual in the initialization population, is specifically used to:
[0161] The individuals in the initialization population are sorted in descending order of fitness values, and individuals with the same fitness values are divided into a non-dominated layer to obtain multiple non-dominated layers.
[0162] An embodiment of the present application provides a data center resource allocation device, including an information acquisition module, a population construction module, a function determination module, a fitness value determination module and a scheme determination module; the information acquisition module acquires performance monitoring data of the data center and multiple objective functions to be optimized; the population construction module determines the initial resource allocation scheme of each application of the data center according to the performance monitoring data and the multiple objective functions, and constructs an initialized population with each resource allocation scheme as an individual; the function determination module determines the fitness function according to the multiple objective functions; the fitness value determination module determines the fitness value of each individual in the initialized population according to the fitness function and the resource dependency relationship between each application and resource equipment in a pre-constructed target knowledge graph; the scheme determination module updates and iterates the individuals in the initialized population according to the fitness value of each individual in the initial population and a preset individual selection strategy until a preset termination condition is met, thereby determining the target resource allocation scheme for each application. In this way, the initial resource allocation plan for each application in the data center is determined based on performance monitoring data and multiple objective functions, and the initial resource allocation plan is adaptively adjusted based on multiple objective functions. This can meet the ever-changing resource requirements and improve the flexibility of resource allocation in the data center. At the same time, in the process of adjusting the resource allocation plan, the association and constraints of multiple resources are taken into account based on the target knowledge graph, which can achieve global optimization of data center resources and improve the utilization efficiency of data center resources.
[0163] Figure 6 The hardware structure diagram of the electronic device provided by the embodiment of the present application is shown. Referring to the figure, at the hardware level, the electronic device 600 includes a processor 610, and optionally, an internal bus 620, a network interface 630, and a memory 640. Among them, the memory 640 may include a memory 641, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory 642 (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services.
[0164] The processor 610, the network interface 630 and the memory may be connected to each other via an internal bus 620, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0165] The memory 640 stores programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions. The memory 640 may include a memory 641 and a non-volatile memory 642, and provide instructions and data to the processor 610.
[0166] The processor 610 reads the corresponding computer program from the non-volatile memory 642 into the memory and then runs it, forming a device for locating the target user at the logical level. The processor 610 executes the program stored in the memory and specifically performs: Figure 1 or Figure 4 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0167] The above application Figure 1 or Figure 4The method disclosed in the illustrated embodiment can be applied to the processor 610 or implemented by the processor 610. The processor 610 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 610. The above processor 610 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0168] The computer device can also execute the methods described in the foregoing method embodiments, and realize the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be repeated here.
[0169] Of course, in addition to software implementation methods, the electronic device of the present application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0170] The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device executes Figure 1 or Figure 4 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0171] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0172] Furthermore, an embodiment of the present application also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the following process is implemented: Figure 1 or Figure 4 The method disclosed in the illustrated embodiment realizes the functions and beneficial effects of each method described in the foregoing method embodiments, which will not be described in detail here.
[0173] The embodiments of the present application can be applied to various electronic device collaboration or interconnection scenarios, including: collaboration and interconnection between mobile phones and laptops / tablet computers; collaboration and interconnection between mobile terminals and smart TVs / displays; collaboration and interconnection between mobile phones or tablet computers and in-car entertainment systems; collaboration and interconnection between mobile terminals and smart conference systems, etc., so as to meet the needs of users in various scenarios such as smart homes, smart offices, and smart travel.
[0174] In short, the above is only a preferred embodiment of the present application and does not limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0175] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0176] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0177] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0178] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A data center resource allocation method, characterized in that: include: Obtain performance monitoring data of the data center and multiple objective functions to be optimized; Determine an initial resource allocation scheme for each application program of the data center according to the performance monitoring data and the multiple objective functions, and construct an initialization population by taking each resource allocation scheme as an individual; Determining a fitness function according to the multiple objective functions; Determine the fitness value of each individual in the initialized population according to the fitness function and the resource dependency relationship between each application and resource device in the pre-built target knowledge graph; According to the fitness value of each individual in the initial population and a preset individual selection strategy, the individuals in the initialization population are updated and iterated until a preset termination condition is met, and a target resource allocation scheme for each application is determined.
2. The method according to claim 1, characterized in that: Before obtaining the performance monitoring data of the data center and the multiple objective functions to be optimized, the method further includes: Obtain performance requirements information for each application; Determining resource devices having resource dependency relationships with performance requirement information of each application program based on resource information of the data center; The target knowledge graph is generated based on the performance requirement information of each application and the resource devices that have resource dependencies with the performance requirement information.
3. The method according to claim 1, characterized in that Determining the fitness function according to the multiple objective functions includes: Normalizing the multiple objective functions to obtain multiple normalized objective functions; The fitness function is obtained by performing weighted summation on the multiple normalized objective functions.
4. The method according to claim 1, characterized in that: The updating and iteration of the individuals in the initialization population according to the fitness value of each individual in the initial population and the preset individual selection strategy until the preset termination condition is met, and the target resource allocation scheme of each application is determined, including: According to a preset individual selection strategy, a predetermined number of individuals are selected from the individuals of the initial population as parents of the next generation population; Perform crossover and mutation operations on the selected parents to generate new individuals; The next generation population is determined based on the generated new individuals, the fitness value of each individual in the next generation population is determined using the fitness function, and the individuals in the next generation population are selected again according to the individual selection strategy until a preset termination condition is met, thereby determining the target resource allocation plan for each application.
5. The method according to claim 4, characterized in that The step of selecting a predetermined number of individuals from the individuals of the initial population as parents of the next generation population according to a preset individual selection strategy includes: According to the fitness value of each individual in the initialization population, the individuals in the initialization population are divided into a plurality of non-dominated layers; For each of the non-dominated layers, a predetermined number of individuals in the non-dominated layer are selected as parents of the next generation population.
6. The method according to claim 5, characterized in that The step of dividing the individuals in the initialization population into a plurality of non-dominated layers according to the fitness value of each individual in the initialization population comprises: The individuals in the initialization population are sorted in descending order of fitness values, and individuals with the same fitness values are divided into a non-dominated layer to obtain multiple non-dominated layers.
7. A data center resource allocation device, characterized in that: include: An information acquisition module is used to obtain performance monitoring data of the data center and multiple objective functions to be optimized; A population construction module, used to determine the initial resource allocation scheme of each application program of the data center according to the performance monitoring data and the multiple objective functions, and construct an initialization population by taking each resource allocation scheme as an individual; A function determination module, used to determine a fitness function according to the multiple objective functions; A fitness value determination module, used to determine the fitness value of each individual in the initialization population according to the fitness function and the resource dependency relationship between each application and resource device in the pre-built target knowledge graph; The scheme determination module is used to update and iterate the individuals in the initialization population according to the fitness value of each individual in the initial population and the preset individual selection strategy until the preset termination condition is met, so as to determine the target resource allocation scheme of each application program.
8. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer is caused to perform the steps of the method according to any one of claims 1 to 6.
