A method, apparatus, device, and storage medium for deploying virtual machines in a data center.

CN115827155BActive Publication Date: 2026-08-14HAINAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-23
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0002]随着云计算的不断发展,应用场景的不断丰富,为了提供足够的运算能力,使得数据中心的规模迅速扩张,与此同时,也越发突显出数据中心存在的能耗高、资源利用率低等问题,因此,如何合理、高效地调度云计算的资源从而实现向用户弹性地提供计算服务是提高云计算系统性能的关键

Benefits of technology

[0016]This invention provides a method for deploying virtual machines in a data center. Considering that concentrating virtual machines on a small number of servers, i.e., minimizing the number of servers deploying virtual machines, can reduce server power consumption, but overly concentrated virtual machine deployment can create local hotspots in the data center, increasing the energy consumption of the cooling system, this application can select virtual machine deployment locations from all servers in the data center when generating a set of virtual machine deployment locations. If the generated random number is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center, a virtual machine deployment location is selected from all servers in the data center. Conversely, if the real-time generated random number is not greater than this ratio, a virtual machine deployment location is selected from the activated servers. This forms a selection logic that "primarily selects deployment locations from activated servers while also considering inactive servers," reducing the number of servers deploying virtual machines while avoiding the generation of local hotspots, thereby reducing data center power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115827155B_ABST
    Figure CN115827155B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and storage medium for deploying virtual machines in a data center, belonging to the field of virtual machine deployment, and is used for deploying virtual machines on servers in a data center. When generating a set of virtual machine deployment locations, this application can select virtual machine deployment locations from all servers in the data center if the generated random number is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center; otherwise, it selects virtual machine deployment locations from the activated servers if the real-time generated random number is not greater than this ratio. This forms a selection logic that "primarily selects deployment locations from activated servers while also considering inactive servers," reducing the number of servers used to deploy virtual machines and avoiding the generation of local hotspots, thereby reducing data center power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtual machine deployment, and in particular to a virtual machine deployment method for a data center. This invention also relates to a virtual machine deployment apparatus, device, and computer-readable storage medium for a data center. Background Technology

[0002] With the continuous development of cloud computing and the increasing variety of application scenarios, data centers are rapidly expanding in order to provide sufficient computing power. At the same time, the problems of high energy consumption and low resource utilization in data centers are becoming increasingly prominent. Therefore, how to rationally and efficiently allocate cloud computing resources to provide computing services to users elastically is the key to improving the performance of cloud computing systems.

[0003] A data center consists of multiple nodes and servers under each node. Data computing services can be provided by deploying virtual machines on the servers. The way virtual machines are deployed on the servers in the data center is strongly correlated with the energy consumption of the data center. There is a lack of a mature virtual machine deployment method in the existing technology, which leads to high energy consumption in the data center and increases costs.

[0004] Therefore, how to provide a solution to the above-mentioned technical problems is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this invention is to provide a virtual machine deployment method for data centers, which can form a selection logic that "primarily selects deployment sites from activated servers while also considering inactive servers," thereby reducing the number of servers for deploying virtual machines and avoiding the generation of local hotspots, thus reducing data center power consumption. Another purpose of this invention is to provide a virtual machine deployment apparatus, device, and computer-readable storage medium for data centers, which can form a selection logic that "primarily selects deployment sites from activated servers while also considering inactive servers," thereby reducing the number of servers for deploying virtual machines and avoiding the generation of local hotspots, thus reducing data center power consumption.

[0006] To address the aforementioned technical problems, this invention provides a method for deploying virtual machines in a data center, comprising: Generate a random decimal number greater than zero and less than 1; When the random decimal is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center, one of the servers in the data center is selected as the virtual machine deployment location and added to the virtual machine deployment location set. When the random decimal is not greater than the ratio, one of the currently active servers in the data center is selected as the virtual machine deployment location and added to the set of virtual machine deployment locations. Determine whether the number of times the virtual machine deployment location has been added to the set of virtual machine deployment locations has reached a preset number; If the condition is not met, proceed with the step of generating a random decimal greater than zero and less than 1; If this is achieved, then virtual machines will be deployed according to the current set of virtual machine deployment locations. The activated server is a server with virtual machines deployed. The remaining computing resources and activation status of the virtual machine deployment location are updated as the virtual machine deployment location is selected.

[0007] Preferably, selecting one server from all servers in the data center as the virtual machine deployment location and adding it to the virtual machine deployment location set specifically involves: Randomly select one server from all servers in the data center; Determine whether the remaining computing resources of the selected server meet the resource constraints of the virtual machine; If the conditions are met, the selected server will be added to the virtual machine deployment site set. The specific steps of selecting one of the currently active servers in the data center as the virtual machine deployment location and adding it to the virtual machine deployment location set are as follows: Randomly select a server from the currently active servers in the data center; Determine whether the remaining computing resources of the selected server meet the resource constraints of the virtual machine; If the conditions are met, the selected server will be added to the virtual machine deployment site set as the virtual machine deployment site.

[0008] Preferably, the step of deploying virtual machines based on the current set of virtual machine deployment locations specifically involves: The current set of virtual machine deployment locations is used as the initial entity for the heuristic algorithm; Determine whether the current initial number of individuals has reached the preset initial number of individuals; If the condition is not met, then proceed with the step of generating a random decimal that is greater than zero and less than 1. If this is achieved, then based on the heuristic algorithm and the preset number of initial individuals, the deployment location scheme for the preset number of virtual machines is determined.

[0009] Preferably, the step of determining the deployment location scheme for the preset number of virtual machines based on the heuristic algorithm and the preset initial number of individuals specifically involves: Select two from all the initial individuals described; Based on the two selected initial individuals, a sub-gene population containing multiple sub-gene individuals is generated through gene crossover, gene mutation, and gene repair operations of a genetic algorithm. The server numbers on each gene segment of the offspring gene individual with the highest fitness value are used as the deployment location scheme for the preset number of virtual machines; The selected server will then be added to the virtual machine deployment location set as follows: Record the selected server number on the blank gene fragment of the current initial individual; The number of gene fragments in the initial individual and the offspring gene individuals is the preset number.

[0010] Preferably, selecting two from all the initial individuals specifically means: Select the two initial individuals with the highest fitness values ​​from all the initial individuals.

[0011] Preferably, selecting the two initial individuals with the highest fitness values ​​from all the initial individuals specifically involves: The fitness values ​​of all the initial individuals are calculated using a preset fitness function; Select the two initial individuals with the highest fitness values ​​from all the initial individuals described; The preset fitness function is: ; in, The fitness value is denoted by m, which represents the preset quantity, and q represents the total number of currently activated servers in the data center. For the i-th virtual machine, For the j-th activated server, Let be the amount of computing resources required by the i-th virtual machine. This represents the amount of computing resources available for the j-th activated server.

[0012] Preferably, the process of generating a sub-generation population containing multiple sub-generation individuals based on the selected two initial individuals through gene crossover, gene mutation, and gene repair operations using a genetic algorithm specifically involves: The two initial individuals selected are used as gene individuals to be operated on; Based on the individual gene to be operated on, two offspring gene individuals are generated through gene crossover, gene mutation, and gene repair operations using a genetic algorithm. Determine whether the number of offspring individuals reaches the preset number of offspring individuals; If this is not achieved, the two newly generated offspring gene individuals are taken as gene individuals to be operated on, and the step of generating two offspring gene individuals based on the gene individuals to be operated on through gene crossover, gene mutation, and gene repair operations of the genetic algorithm is executed. If this is achieved, then all the current offspring gene individuals will be considered as the offspring gene population.

[0013] To address the aforementioned technical problems, the present invention also provides a virtual machine deployment apparatus for a data center, comprising: The generation module is used to generate random decimals that are greater than zero and less than 1. The first selection module is used to select one of the servers in the data center as a virtual machine deployment location and add it to the virtual machine deployment location set when the random decimal number is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center. The second selection module is used to select one of the currently activated servers in the data center as a virtual machine deployment location and add it to the set of virtual machine deployment locations when the random decimal number is not greater than the ratio. The judgment module is used to determine whether the number of times the virtual machine deployment location is added to the virtual machine deployment location set has reached a preset number. If it has not reached the preset number, the generation module is triggered; if it has reached the preset number, the action module is triggered. The action module is used to deploy virtual machines according to the current set of virtual machine deployment locations; The activated server is a server with virtual machines deployed. The remaining computing resources and activation status of the virtual machine deployment location are updated as the virtual machine deployment location is selected.

[0014] To address the aforementioned technical problems, the present invention also provides a virtual machine deployment device for a data center, comprising: Memory, used to store computer programs; A processor is used to implement the steps of the virtual machine deployment method in the data center as described above when executing the computer program.

[0015] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the virtual machine deployment method for the data center as described above.

[0016] This invention provides a method for deploying virtual machines in a data center. Considering that concentrating virtual machines on a small number of servers, i.e., minimizing the number of servers deploying virtual machines, can reduce server power consumption, but overly concentrated virtual machine deployment can create local hotspots in the data center, increasing the energy consumption of the cooling system, this application can select virtual machine deployment locations from all servers in the data center when generating a set of virtual machine deployment locations. If the generated random number is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center, a virtual machine deployment location is selected from all servers in the data center. Conversely, if the real-time generated random number is not greater than this ratio, a virtual machine deployment location is selected from the activated servers. This forms a selection logic that "primarily selects deployment locations from activated servers while also considering inactive servers," reducing the number of servers deploying virtual machines while avoiding the generation of local hotspots, thereby reducing data center power consumption.

[0017] The present invention also provides a virtual machine deployment apparatus, device and computer-readable storage medium for a data center, which has the same beneficial effects as the virtual machine deployment method for the data center described above. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a virtual machine deployment method in a data center provided by the present invention; Figure 2 A flowchart illustrating another method for deploying virtual machines in a data center provided by the present invention; Figure 3 A schematic diagram of the structure of a virtual machine deployment device in a data center provided by the present invention; Figure 4 This is a schematic diagram of the structure of a virtual machine deployment device in a data center provided by the present invention. Detailed Implementation

[0020] The core of this invention is to provide a virtual machine deployment method for data centers, which can form a selection logic that "primarily selects deployment sites from activated servers while also considering inactive servers," reducing the number of servers for deploying virtual machines and avoiding the generation of local hotspots, thereby reducing data center power consumption. Another core aspect of this invention is to provide a virtual machine deployment apparatus, device, and computer-readable storage medium for data centers, which can form a selection logic that "primarily selects deployment sites from activated servers while also considering inactive servers," reducing the number of servers for deploying virtual machines and avoiding the generation of local hotspots, thereby reducing data center power consumption.

[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a virtual machine deployment method in a data center provided by the present invention. The virtual machine deployment method in the data center includes: S101: Generate a random decimal number greater than zero and less than 1; Specifically, considering the technical problems mentioned above, and also considering that minimizing the number of servers where virtual machines are deployed can reduce server power consumption, while excessively concentrated deployment of virtual machines can create local hotspots in the data center, thereby increasing the energy consumption of the cooling system, it is necessary to avoid excessively concentrated deployment of virtual machines to prevent the formation of local hotspots during the server deployment process, in addition to selecting servers from the activated servers for virtual machine deployment. Therefore, this invention aims to select virtual machine deployment locations one by one by comparing the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center with a random decimal in the range of 0-1. Therefore, in this embodiment of the invention, a random decimal greater than zero and less than 1 can be generated first and used as the data basis for subsequent steps.

[0023] S102: When a random decimal number is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center, select one of the servers in the data center as the virtual machine deployment location and add it to the virtual machine deployment location set. Specifically, considering that the variable in "the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center" is the remaining computing resources of the activated servers, and the remaining computing resources of the activated servers are updated due to the influence of "being selected as the virtual machine deployment site", that is, when an activated server is selected as the virtual machine deployment site, the ratio will decrease accordingly, and when an inactive server is selected as the virtual machine deployment site, the ratio will increase accordingly (due to the activation of a new server). Due to the randomness of random decimals, the smaller the ratio, the greater the probability that the random decimal is greater than the ratio, and the larger the ratio, the smaller the probability that the random decimal is less than or greater than the ratio. This embodiment of the invention can trigger subsequent steps through this comparison result, thereby selecting the virtual machine deployment site.

[0024] S103: When the random decimal is not greater than the ratio, select one of the currently active servers in the data center as the virtual machine deployment location and add it to the virtual machine deployment location set. Specifically, when this ratio is large, it indicates that the computing resources in the activated servers are sufficient (i.e., the load is low and the heat generation is low). In this case, the probability of a random decimal being greater than this ratio (selecting a virtual machine deployment location from all servers) is small, while the probability of it not being greater than this ratio (selecting a virtual machine deployment location from activated servers) is large. Therefore, the virtual machine deployment location is likely to be selected from the activated servers, resulting in a more concentrated distribution of virtual machines. Conversely, when this ratio is small, it indicates that the computing resources in the activated servers are insufficient (i.e., the activated servers are under high load and generate a lot of heat). It is not suitable to continue deploying virtual machines on the activated servers. In this case, the probability of a random decimal being greater than this ratio (selecting a virtual machine deployment location from all servers) is large, while the probability of it not being greater than this ratio (selecting a virtual machine deployment location from activated servers) is small. Therefore, the virtual machine deployment location is likely to be selected from all servers, thus avoiding excessive workload on the activated servers and the formation of local hotspots, thereby reducing the energy consumption of the data center cooling system.

[0025] It is worth mentioning that after selecting a virtual machine deployment location, the remaining computing resources of the selected virtual machine deployment location need to be reduced according to the corresponding virtual machine to be deployed. Furthermore, assuming that the selected virtual machine deployment location was not activated before, its activation status should also be switched to activated after it is selected as a virtual machine deployment location, so as to facilitate the accurate calculation of the above "ratio" in the future.

[0026] S104: Determine whether the number of times the virtual machine deployment sites in the virtual machine deployment site set has been added has reached the preset number. If not, execute S101; if so, execute S105. Specifically, the preset number is the number of virtual machines to be deployed this time. Each selection process described above is the process of determining the deployment location of a virtual machine. Therefore, it is only necessary to select a preset number of virtual machine deployment locations (which can be selected repeatedly). Thus, in this embodiment of the invention, it is determined whether the number of times the virtual machine deployment locations in the set of virtual machine deployment locations has been added has reached the preset number. The subsequent actions can be triggered by the determination result.

[0027] S105: Deploy virtual machines based on the current virtual machine deployment location set; Among them, the activated server is the server with virtual machine deployment. The remaining computing resources and activation status of the virtual machine deployment location are updated as it is selected as the virtual machine deployment location.

[0028] Specifically, once a preset number of virtual machine deployment locations are available, virtual machines can be deployed based on the current set of virtual machine deployment locations.

[0029] In this invention, the data center can be of various types, such as a heterogeneous data center. A heterogeneous data center may purchase servers of different generations or even from different manufacturers. A data center that uses virtualization technology to provide services on demand may also have virtual machines with various configurations.

[0030] This invention provides a method for deploying virtual machines in a data center. Considering that concentrating virtual machines on a small number of servers, i.e., minimizing the number of servers deploying virtual machines, can reduce server power consumption, but overly concentrated virtual machine deployment can create local hotspots in the data center, increasing the energy consumption of the cooling system, this application can select virtual machine deployment locations from all servers in the data center when generating a set of virtual machine deployment locations. If the generated random number is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center, a virtual machine deployment location is selected from all servers in the data center. Conversely, if the real-time generated random number is not greater than this ratio, a virtual machine deployment location is selected from the activated servers. This forms a selection logic that "primarily selects deployment locations from activated servers while also considering inactive servers," reducing the number of servers deploying virtual machines while avoiding the generation of local hotspots, thereby reducing data center power consumption.

[0031] Based on the above embodiments: As a preferred embodiment, selecting one server from all servers in the data center as the virtual machine deployment location and adding it to the virtual machine deployment location set specifically involves: Randomly select one server from all servers in the data center; Determine whether the remaining computing resources of the selected server meet the resource constraints of the virtual machine; If the conditions are met, the selected server will be added to the virtual machine deployment site set. Select one of the currently active servers in the data center as the virtual machine deployment location and add it to the virtual machine deployment location set. Specifically: Randomly select a server from the currently active servers in the data center; Determine whether the remaining computing resources of the selected server meet the resource constraints of the virtual machine; If the conditions are met, the selected server will be added to the virtual machine deployment site set as the virtual machine deployment site.

[0032] Specifically, in order to improve the degree of automation and selection efficiency, the server is selected randomly in this embodiment of the invention. In this case, the remaining computing resources of the selected server may not meet the resource constraints of the virtual machine. Therefore, after selecting a server, it can be determined whether the remaining computing resources of the selected server meet the resource constraints of the virtual machine. Only if they meet the constraints will the server be added to the virtual machine deployment set. Otherwise, the process of randomly selecting a server will be returned.

[0033] Resource constraints can be of various types, but they generally refer to the various indicators of computing resources required by the virtual machine.

[0034] Of course, in addition to this specific method, the process of selecting a server can also be of other specific types, and this embodiment of the invention does not limit it here.

[0035] As a preferred embodiment, deploying virtual machines based on the current virtual machine deployment location set specifically involves: The current set of virtual machine deployment locations is used as the initial entities for the heuristic algorithm; Determine whether the current initial number of individuals has reached the preset initial number of individuals; If this is not achieved, proceed to the step of generating a random decimal greater than zero and less than 1; If this is achieved, then based on the heuristic algorithm and the preset number of initial individuals, the deployment location scheme for the preset number of virtual machines is determined.

[0036] Specifically, considering that the stability of randomly selected virtual machine deployment locations is relatively weak, they may be too scattered, resulting in too many servers being started, thus increasing server energy consumption, or they may be too concentrated, forming local hotspots and increasing cooling system energy consumption. Therefore, in this embodiment of the invention, the current virtual machine deployment location set can be used as the initial individual of the heuristic algorithm. Then, based on the heuristic algorithm and a preset number of initial individuals, a preset number of virtual machine deployment location schemes are determined through automatic optimization. This can further ensure the reliability of the final deployment location scheme and further reduce energy consumption.

[0037] The initial number of individuals can be set independently, and this embodiment of the invention does not limit it.

[0038] For a better explanation of the embodiments of the present invention, please refer to Figure 2 , Figure 2 The flowchart illustrates another method for deploying virtual machines in a data center provided by the present invention. As a preferred embodiment, the deployment scheme for a preset number of virtual machines is determined based on a heuristic algorithm and a preset number of initial individuals as follows: S201: Select two from all initial individuals; Based on two selected initial individuals, a sub-gene population containing multiple sub-gene individuals is generated through gene crossover, gene mutation, and gene repair operations using a genetic algorithm. The server numbers on each gene segment of the offspring gene individual with the highest fitness value are used as the deployment location scheme for a preset number of virtual machines. The selected server will then be added to the virtual machine deployment location set as follows: Record the selected server number on the blank gene fragment of the current initial individual; The number of gene fragments in the initial individual and the offspring gene individuals is a preset number.

[0039] Specifically, considering the advantages of genetic algorithms such as strong applicability, high accuracy and fast speed, this embodiment of the invention uses a genetic algorithm to automatically optimize the deployment scheme of virtual machines. It can obtain the offspring gene population based on the initial individuals through gene crossover, gene mutation and gene repair operations, and use the server number on each gene segment of the offspring gene individual with the highest fitness value as the deployment scheme of a preset number of virtual machines.

[0040] Of course, in addition to this algorithm, heuristic algorithms can be of many other types, and the embodiments of this invention are not limited here.

[0041] As a preferred embodiment, two individuals are selected from all initial individuals: Select the two initial individuals with the highest fitness values ​​from all initial individuals.

[0042] Specifically, in order to improve the reliability of the initial individuals, in this embodiment of the invention, the two initial individuals with the highest fitness values ​​can be selected from all the initial individuals.

[0043] Of course, in addition to this specific method, two initial individuals can be selected from all initial individuals in other ways, and this embodiment of the invention does not limit the specific methods.

[0044] As a preferred embodiment, selecting the two initial individuals with the highest fitness values ​​from all initial individuals specifically involves: The fitness values ​​of all initial individuals are calculated using a preset fitness function; Select the two initial individuals with the highest fitness values ​​from all initial individuals; The preset fitness function is: ; in, Here, m represents the fitness value, q represents the preset quantity, and q represents the total number of currently activated servers in the data center. For the i-th virtual machine, For the j-th activated server, Let be the amount of computing resources required by the i-th virtual machine. This represents the amount of computing resources available for the j-th activated server.

[0045] Specifically, considering that the virtual machine deployment set generated in this embodiment of the invention has already avoided excessive concentration of virtual machine deployment, the fitness function can only consider whether the virtual machine deployment is sufficiently concentrated. The fitness value actually represents the ratio of the amount of computing resources required by the virtual machine to the amount of computing resources of the activated server. This ratio can be used to evaluate whether the virtual machine deployment is sufficiently concentrated. The larger the ratio, the fewer the number of activated servers, indicating that the virtual machine deployment is more concentrated. The reliability of the virtual machine deployment scheme can be well evaluated through the above-mentioned preset fitness function.

[0046] Of course, in addition to this specific form, the preset fitness function can also be of other specific types, and the embodiments of the present invention are not limited here.

[0047] As a preferred embodiment, based on two selected initial individuals, a sub-generation population containing multiple sub-generation individuals is generated through gene crossover, gene mutation, and gene repair operations using a genetic algorithm. S202: Select two initial individuals as individuals to be manipulated for the gene; Based on the individual gene to be operated on, two offspring gene individuals are generated through gene crossover, gene mutation, and gene repair operations using a genetic algorithm. S207: Determine whether the number of offspring genetic individuals has reached the preset number of offspring individuals; S208: If not achieved, the two newly generated offspring gene individuals are taken as the gene individuals to be operated on and the steps of generating two offspring gene individuals based on the gene individuals to be operated on are performed through gene crossover, gene mutation and gene repair operations of the genetic algorithm. S209: If achieved, all current offspring gene individuals will be considered as the offspring gene population.

[0048] Specifically, based on the individual gene to be operated on, two offspring gene individuals are generated through gene crossover, gene mutation, and gene repair operations using a genetic algorithm, including: S203: Perform crossover operation on individuals with genes to be manipulated; Specifically, the crossover operation can be implemented using a single-point crossover method. First, a random integer is generated within the gene length range as the cut point, and then the gene segments after the cut point are swapped.

[0049] S204: Determine if the mutation probability has been reached. If yes, proceed to S205; otherwise, proceed to S206. S205: Perform mutation operations on the individual whose gene is to be manipulated; Specifically, mutation operations refer to replacing the gene values ​​at certain loci with other alleles at that locus.

[0050] S206: Perform a repair operation on the individual gene to be operated on to obtain two offspring gene individuals.

[0051] Specifically, the repair operation refers to the process where, after crossover and / or mutation operations, the resulting new gene does not meet the server's resource constraints. In this case, the virtual machine that exceeds the server's allocable resources needs to be allocated to a server that meets the conditions. The allocation method can be to select a server by comparing the random decimal with the ratio, etc. The embodiments of the present invention are not limited here.

[0052] Specifically, when the genetic algorithm obtains the offspring gene population based on two initial individuals, it needs to perform iterative calculations. The termination condition of the iteration can be of various types. For example, it can be limited by the "preset number of offspring individuals" in the embodiment of the present invention, which can limit the individuals in the offspring gene population.

[0053] Of course, in addition to this method, the iteration termination condition can also be of other types, such as setting the number of iterations to terminate, etc., which are not limited in this embodiment of the invention.

[0054] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a virtual machine deployment device for a data center provided by the present invention. The virtual machine deployment device for the data center includes: The generation module 31 is used to generate random decimals that are greater than zero and less than 1; The first selection module 32 is used to select one of the servers in the data center as the virtual machine deployment location and add it to the virtual machine deployment location set when the random decimal number is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center. The second selection module 33 is used to select one of the currently active servers in the data center as the virtual machine deployment location and add it to the virtual machine deployment location set when the random decimal is not greater than the ratio. The judgment module is used to determine whether the number of times the virtual machine deployment sites in the virtual machine deployment site set has been added has reached the preset number 34. If it has not reached the preset number, the generation module 31 is triggered; if it has reached the preset number, the action module 35 is triggered. Action module 35 is used to deploy virtual machines based on the current virtual machine deployment location set; Among them, the activated server is the server with virtual machine deployment. The remaining computing resources and activation status of the virtual machine deployment location are updated as it is selected as the virtual machine deployment location.

[0055] For a description of the virtual machine deployment apparatus for the data center provided in this embodiment of the invention, please refer to the aforementioned embodiment of the virtual machine deployment method for the data center. This embodiment of the invention will not be repeated here.

[0056] Please refer to Figure 4 , Figure 4 This invention provides a schematic diagram of the structure of a virtual machine deployment device for a data center, which includes: Memory 41 is used to store computer programs; The processor 42 is used to execute computer programs to implement the steps of the virtual machine deployment method in the data center as described in the foregoing embodiments.

[0057] For a description of the virtual machine deployment device for the data center provided in this embodiment of the invention, please refer to the aforementioned embodiment of the virtual machine deployment method for the data center. This embodiment of the invention will not be repeated here.

[0058] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the virtual machine deployment method in the data center as described in the foregoing embodiments.

[0059] For a description of the computer-readable storage medium provided in the embodiments of the present invention, please refer to the aforementioned embodiments of the virtual machine deployment method in the data center. The embodiments of the present invention will not be repeated here.

[0060] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section. It should also be noted that in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0061] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for deploying virtual machines in a data center, characterized in that, include: Generate a random decimal number greater than zero and less than 1; When the random decimal is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center, one of the servers in the data center is selected as the virtual machine deployment location and added to the virtual machine deployment location set. When the random decimal is not greater than the ratio, one of the currently active servers in the data center is selected as the virtual machine deployment location and added to the set of virtual machine deployment locations. Determine whether the number of times the virtual machine deployment location has been added to the set of virtual machine deployment locations has reached a preset number; If the condition is not met, proceed with the step of generating a random decimal greater than zero and less than 1; If this is achieved, then virtual machines will be deployed according to the current set of virtual machine deployment locations. The activated server is a server with virtual machines deployed. The remaining computing resources and activation status of the virtual machine deployment location are updated as the virtual machine deployment location is selected.

2. The virtual machine deployment method in a data center according to claim 1, characterized in that, The specific steps of selecting one server from all servers in the data center as the virtual machine deployment location and adding it to the virtual machine deployment location set are as follows: Randomly select one server from all servers in the data center; Determine whether the remaining computing resources of the selected server meet the resource constraints of the virtual machine; If the conditions are met, the selected server will be added to the virtual machine deployment site set. The specific steps of selecting one of the currently active servers in the data center as the virtual machine deployment location and adding it to the virtual machine deployment location set are as follows: Randomly select a server from the currently active servers in the data center; Determine whether the remaining computing resources of the selected server meet the resource constraints of the virtual machine; If the conditions are met, the selected server will be added to the virtual machine deployment site set as the virtual machine deployment site.

3. The virtual machine deployment method in the data center according to claim 2, characterized in that, The specific steps of deploying virtual machines based on the current virtual machine deployment location set are as follows: The current set of virtual machine deployment locations is used as the initial entity for the heuristic algorithm; Determine whether the current initial number of individuals has reached the preset initial number of individuals; If the condition is not met, then proceed with the step of generating a random decimal that is greater than zero and less than 1. If this is achieved, then based on the heuristic algorithm and the preset number of initial individuals, the deployment location scheme for the preset number of virtual machines is determined.

4. The virtual machine deployment method in a data center according to claim 3, characterized in that, The specific steps for determining the deployment location scheme of the preset number of virtual machines based on the heuristic algorithm and the preset initial number of individuals are as follows: Select two from all the initial individuals described; Based on the two selected initial individuals, a sub-gene population containing multiple sub-gene individuals is generated through gene crossover, gene mutation, and gene repair operations of a genetic algorithm. The server numbers on each gene segment of the offspring gene individual with the highest fitness value are used as the deployment location scheme for the preset number of virtual machines; The selected server will then be added to the virtual machine deployment location set as follows: Record the selected server number on the blank gene fragment of the current initial individual; The number of gene fragments in the initial individual and the offspring gene individuals is the preset number.

5. The virtual machine deployment method in a data center according to claim 4, characterized in that, The selection of two from all the initial individuals specifically refers to: Select the two initial individuals with the highest fitness values ​​from all the initial individuals.

6. The virtual machine deployment method in a data center according to claim 5, characterized in that, The specific steps of selecting the two initial individuals with the highest fitness values ​​from all the initial individuals are as follows: The fitness values ​​of all the initial individuals are calculated using a preset fitness function; Select the two initial individuals with the highest fitness values ​​from all the initial individuals described; The preset fitness function is: ; in, The fitness value is denoted by m, which represents the preset quantity, and q represents the total number of currently activated servers in the data center. For the i-th virtual machine, For the j-th activated server, Let be the amount of computing resources required by the i-th virtual machine. This represents the amount of computing resources available for the j-th activated server.

7. The virtual machine deployment method in a data center according to any one of claims 4 to 6, characterized in that, The process of generating a sub-generation population containing multiple sub-generation individuals based on the selected two initial individuals through gene crossover, gene mutation, and gene repair operations using a genetic algorithm is as follows: The two initial individuals selected are used as gene individuals to be operated on; Based on the individual gene to be operated on, two offspring gene individuals are generated through gene crossover, gene mutation, and gene repair operations using a genetic algorithm. Determine whether the number of offspring individuals reaches the preset number of offspring individuals; If this is not achieved, the two newly generated offspring gene individuals are taken as gene individuals to be operated on, and the step of generating two offspring gene individuals based on the gene individuals to be operated on through gene crossover, gene mutation, and gene repair operations of the genetic algorithm is executed. If this is achieved, then all the current offspring gene individuals will be considered as the offspring gene population.

8. A virtual machine deployment device for a data center, characterized in that, include: The generation module is used to generate random decimals that are greater than zero and less than 1. The first selection module is used to select one of the servers in the data center as the virtual machine deployment location and add it to the virtual machine deployment location set when the random decimal number is greater than the ratio of the remaining computing resources of the activated servers in the data center to the total computing resources of the data center. The second selection module is used to select one of the currently activated servers in the data center as a virtual machine deployment location and add it to the set of virtual machine deployment locations when the random decimal number is not greater than the ratio. The judgment module is used to determine whether the number of times the virtual machine deployment location is added to the virtual machine deployment location set has reached a preset number. If it has not reached the preset number, the generation module is triggered; if it has reached the preset number, the action module is triggered. The action module is used to deploy virtual machines according to the current set of virtual machine deployment locations; The activated server is a server with virtual machines deployed. The remaining computing resources and activation status of the virtual machine deployment location are updated as the virtual machine deployment location is selected.

9. A virtual machine deployment device for a data center, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the virtual machine deployment method for the data center as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the virtual machine deployment method for the data center as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Mehtod and apparatus for machine learning

    KR102246091B1

  • Multi-criteria adaptive scheduling for a market-oriented hybrid cloud infrastructure

    WO2018015779A1