CN111324422B - Multi-target virtual machine deployment method, device, equipment and storage medium - Google Patents

Multi-target virtual machine deployment method, device, equipment and storage medium Download PDF

Info

Publication number
CN111324422B
CN111324422B CN202010114159.1A CN202010114159A CN111324422B CN 111324422 B CN111324422 B CN 111324422B CN 202010114159 A CN202010114159 A CN 202010114159A CN 111324422 B CN111324422 B CN 111324422B
Authority
CN
China
Prior art keywords
genetic
population
chromosome
virtual machine
physical host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010114159.1A
Other languages
Chinese (zh)
Other versions
CN111324422A (en
Inventor
张小庆
柏元江
安春林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Polytechnic University
Original Assignee
Wuhan Polytechnic University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Polytechnic University filed Critical Wuhan Polytechnic University
Priority to CN202010114159.1A priority Critical patent/CN111324422B/en
Publication of CN111324422A publication Critical patent/CN111324422A/en
Application granted granted Critical
Publication of CN111324422B publication Critical patent/CN111324422B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Physiology (AREA)
  • Genetics & Genomics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present invention relates to the field of cloud computing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for deploying a multi-target virtual machine. The method comprises the following steps: acquiring a virtual machine set and a physical host set to be deployed, taking the number of virtual machines corresponding to the virtual machine set as the coding length of chromosome individuals, and establishing a genetic population comprising a plurality of chromosome individuals; carrying out fitness calculation on each chromosome individual in the genetic population; detecting a current genetic generation of the genetic population; when the current genetic generation is equal to the preset genetic generation, taking the chromosome individual with the maximum current fitness value as a target chromosome individual, and decoding the target chromosome individual to obtain a virtual machine deployment optimal solution; and deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set according to the optimal solution of virtual machine deployment. By the method, the deployment of the multi-target virtual machine is balanced and optimized under the constraint conditions of the resource utilization rate and the energy consumption, and the efficiency and the effect of the deployment of the virtual machine are improved.

Description

Multi-target virtual machine deployment method, device, equipment and storage medium
Technical Field
The present invention relates to the field of cloud computing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for deploying a multi-target virtual machine.
Background
The demand scale of cloud services is rapidly increasing. To meet the increasing demands of users, more and more servers are deployed into data centers. Safe operation of the data center requires more cooling settings to maintain the data center ambient temperature within safe temperatures, which results in more energy consumption and carbon dioxide emissions. The utilization cost of physical resources (including central processing units (CPUs, central processing unit), memory and storage) in the data center is about 15% of the operation cost of the whole data center, but the energy consumption cost is about 45% of the total operation cost. Therefore, the above-mentioned resource utilization and energy consumption factors are key factors for searching the energy-efficient resource allocation of the data center, and are very important for reducing the operation cost of the data center and making the data center in a color-free manner. Another important factor affecting data centers is the low utilization of physical hosts. Research has shown that an idle physical host still consumes more than half of the full power consumption. To improve the resource utilization of a host, multiple virtual machines may be deployed on a host using virtualization techniques. The problem of request allocation of the user executing the application to the virtual machine is a joint optimization problem at the moment, and modeling can be performed according to the thought of the boxing problem, namely, the boxing problem of boxes with variable multi-dimension sizes, wherein the virtual machine can be regarded as an article at the moment, and the physical host can be regarded as a box. The deployment problem of virtual machines on hosts is an NP-hard problem (NP-problem, non-deterministic polynomial problem) due to the heterogeneity of requests of virtual machines on different dimensional resources, as well as the heterogeneity provided by the host's own resources.
Under heterogeneous cloud data center conditions, the problem of resource utilization rate and energy consumption must be synchronously considered in achieving efficient deployment of virtual machines, and synchronous energy consumption reduction cannot be ensured while resource waste is reduced. Therefore, the resource utilization and energy consumption problems in the virtual machine deployment problem must be considered in balance.
Disclosure of Invention
The invention mainly aims to provide a multi-target virtual machine deployment method, device, equipment and storage medium, aiming at realizing the technical problem of balanced and optimized multi-target virtual machine deployment.
In order to achieve the above object, the present invention provides a multi-target virtual machine deployment method, which includes:
acquiring a virtual machine set and a physical host set to be deployed, taking the number of virtual machines corresponding to the virtual machine set as the coding length of chromosome individuals, and establishing a genetic population comprising a plurality of chromosome individuals;
performing fitness calculation on each chromosome individual in the genetic population;
detecting a current genetic generation of the genetic population;
when the current genetic generation is equal to the preset genetic generation, taking a chromosome individual with the maximum current fitness value as a target chromosome individual, and decoding the target chromosome individual to obtain a virtual machine deployment optimal solution;
And deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set according to the optimal solution of the virtual machine deployment.
Preferably, the step of obtaining a set of virtual machines to be deployed and a set of physical hosts, taking the number of virtual machines corresponding to the set of virtual machines as the coding length of a chromosome individual, and establishing a genetic population including a plurality of chromosome individuals specifically includes:
acquiring the number of physical hosts corresponding to the physical host set and the number of virtual machines corresponding to the virtual machine set;
deploying virtual machines in the virtual machine set into physical hosts of the physical host set as decoding of chromosome individuals;
setting the number of the chromosomes according to a preset population scale by taking the number of the virtual machines as the coding length of the chromosome individuals;
respectively taking two groups contained in each chromosome individual as a virtual machine group and a physical host group;
setting a gene value range in the virtual machine group according to the number of virtual machines, and setting the gene value range in the physical host group according to the number of physical hosts;
and establishing a genetic population according to the chromosome individual number, the coding length and the gene value range.
Preferably, the step of establishing a genetic population according to the chromosome number, the coding length and the gene value range specifically includes:
establishing an unassigned genetic population according to the chromosome individual number and the coding length;
dividing the unassigned genetic population into a first population, a second population and a third population according to preset genetic population dividing conditions;
assigning a value to the first population according to the minimum power consumption condition based on the gene value range, assigning a value to the second population according to the maximum resource utilization condition based on the gene value range, and randomly assigning a value to the third population based on the gene value range;
and constructing a genetic population according to each assigned genetic population.
Preferably, after the step of detecting the current genetic generation of the genetic population, the method further comprises:
when the current genetic generation is smaller than the preset genetic generation, generating a genetic population of the next generation according to a preset genetic algorithm;
adding one to the current genetic generation and returning to the step of performing fitness calculation on each of the chromosomal individuals in the genetic population.
Preferably, the step of generating the genetic population of the next generation according to the preset genetic algorithm when the current genetic generation is smaller than the preset genetic generation specifically includes:
Reserving the chromosome individual with the maximum current fitness value to the genetic population of the next generation;
calculating relative fitness of the residual chromosome individuals in the current genetic population, and carrying out genetic selection on the residual chromosome individuals according to a relative fitness calculation result and a roulette strategy;
the chromosomal individuals obtained by genetic selection are retained to the genetic population of the next generation to generate the genetic population of the next generation.
Preferably, after the step of retaining the chromosomal individuals obtained by genetic selection to the genetic population of the next generation to generate the genetic population of the next generation, the method further comprises:
obtaining chromosome individuals remained after genetic selection according to a preset proportion, and carrying out genetic crossing on the obtained chromosome individuals; wherein, the chromosome individual before the genetic crossover is a parent chromosome, and the chromosome individual after the genetic crossover is a offspring chromosome;
carrying out fitness calculation on the offspring chromosomes to obtain fitness values;
when the fitness value of the offspring chromosome is larger than that of the parent chromosome, reserving the offspring chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation;
And when the fitness value of the offspring chromosome is smaller than or equal to that of the parent chromosome, reserving the parent chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation.
Preferably, after the step of retaining the chromosomal individuals obtained by genetic selection to the genetic population of the next generation to generate the genetic population of the next generation, the method further comprises:
obtaining chromosome individuals remained after genetic selection according to a preset proportion, and carrying out genetic variation on the obtained chromosome individuals; wherein, the chromosome individual before genetic variation is a parent chromosome, and the chromosome individual after genetic variation is a offspring chromosome;
carrying out fitness calculation on the offspring chromosomes to obtain fitness values;
when the fitness value of the offspring chromosome is larger than that of the parent chromosome, reserving the offspring chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation;
and when the fitness value of the offspring chromosome is smaller than or equal to that of the parent chromosome, reserving the parent chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation.
In addition, in order to achieve the above object, the present invention also proposes a multi-target virtual machine deployment apparatus, the apparatus comprising: the system comprises a model building module, a fitness computing module, an optimal solution acquisition module and a deployment module, wherein,
the model building module is used for obtaining a virtual machine set and a physical host set to be deployed, taking the number of virtual machines corresponding to the virtual machine set as the coding length of chromosome individuals, and building a genetic population comprising a plurality of chromosome individuals;
the fitness calculation module is used for calculating fitness of each chromosome individual in the genetic population; also for detecting a current genetic generation of the genetic population;
the optimal solution obtaining module is used for taking a chromosome individual with the maximum current fitness value as a target chromosome individual when the current genetic generation is equal to the preset genetic generation, and decoding the target chromosome individual to obtain a virtual machine deployment optimal solution;
the deployment module is used for deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set according to the optimal solution of the virtual machine deployment.
In addition, to achieve the above object, the present invention also proposes an electronic device including: a memory, a processor, and a multi-target virtual machine deployment program stored on the memory and executable on the processor, the multi-target virtual machine deployment program configured to implement the steps of the multi-target virtual machine deployment method as described above.
In addition, in order to achieve the above object, the present invention also proposes a storage medium having stored thereon a multi-target virtual machine deployment program which, when executed by a processor, implements the steps of the multi-target virtual machine deployment method as described above.
The method comprises the steps of establishing a genetic population comprising a plurality of chromosome individuals by acquiring a virtual machine set to be deployed and a physical host set, and taking the number of virtual machines corresponding to the virtual machine set as the coding length of the chromosome individuals; performing fitness calculation on each chromosome individual in the genetic population; detecting a current genetic generation of the genetic population; when the current genetic generation is equal to the preset genetic generation, taking a chromosome individual with the maximum current fitness value as a target chromosome individual, and decoding the target chromosome individual to obtain a virtual machine deployment optimal solution; and deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set according to the optimal solution of the virtual machine deployment. Under the condition that the resource utilization rate and the energy consumption of the physical host are both constrained, the physical host and the physical host are synchronously and uniformly optimized to form multi-target uniform optimization of virtual machine deployment, and the efficiency and the effect of virtual machine deployment are improved.
Drawings
FIG. 1 is a schematic diagram of an electronic device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for deploying a multi-target virtual machine according to a first embodiment of the present invention;
FIG. 3 is a diagram illustrating chromosome coding according to a first embodiment of the multi-target virtual machine deployment method of the present invention;
FIG. 4 is a flowchart of a second embodiment of a multi-target virtual machine deployment method according to the present invention;
FIG. 5 is a schematic diagram of a single chromosome crossover operation according to a second embodiment of the multi-target virtual machine deployment method of the present invention;
FIG. 6 is a diagram illustrating a double-chromosome crossover operation according to a second embodiment of the multi-target virtual machine deployment method of the present invention;
FIG. 7 is a diagram illustrating genetic variation of a second embodiment of the multi-objective virtual machine deployment method of the present invention;
FIG. 8 is a block diagram illustrating a first embodiment of a multi-target virtual machine deployment apparatus according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device in a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in fig. 1 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a multi-target virtual machine deployment program may be included in the memory 1005 as one storage medium.
In the electronic device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention may be provided in the electronic device, where the electronic device invokes the multi-target virtual machine deployment program stored in the memory 1005 through the processor 1001, and executes the multi-target virtual machine deployment method provided by the embodiment of the present invention.
The embodiment of the invention provides a multi-target virtual machine deployment method, and referring to fig. 2, fig. 2 is a flow chart of a first embodiment of the multi-target virtual machine deployment method.
In this embodiment, the method for deploying the multi-target virtual machine includes the following steps:
step S10: and acquiring a virtual machine set and a physical host set to be deployed, taking the number of virtual machines corresponding to the virtual machine set as the coding length of chromosome individuals, and establishing a genetic population comprising a plurality of chromosome individuals.
It should be noted that, except for the cooling system, the main source of energy consumption in the data center is the CPU. The single CPU power saving technique is most commonly used with dynamic voltage/frequency scaling (DVFS, dynamic voltage and frequency scaling). The technology mainly considers two states of the CPU: idle state and load state. In an idle state (i.e., without any execution load), internal components of the CPU may be converted into a shutdown mode, thereby reducing the clock frequency of the CPU, and the CPU may operate at a minimum operating frequency, thereby saving energy. In the load state, the energy consumption of the CPU depends on the amount of load performed on the CPU and the utilization of the CPU. Therefore, CPU power saving based on DVFS technique can enable CPU to operate in two clock frequency modes (i.e. maximum frequency f max And a minimum frequency f min ) And (5) switching down to run. In the virtual machine deployment problem of this embodiment, let P, assuming that all physical hosts are configured with DVFS modules j Representing a physical host h j The specific formula is:
P j =(P j,max -P j,idle )×u+P j,idle
wherein P is j,max Representing a physical host h j Maximum power consumption of (1), i.e. power consumption when the physical host is fully loaded, P j,idle Representing a physical host h j I.e. the power consumption in the idle condition of the physical host, which is typically 70% of the full power consumption, u denotes the physical host h j CPU utilization of (c). If the CPU utilization is 0, the physical host can be turned off, and the power consumption is 0. Comprehensively considering CPU resources (measured by the average execution speed of fixed-point instructions with a single word length per million instructions per second (MIPS, million Instructions Per Second)), memory resources RAM and storage STOR, and a host h j Resource utilization u of (2) j,d The definition is as follows:
where d represents a resource type, and may include a MIPS resource, a memory resource RAM, and a storage resource STOR of the CPU. r is (r) i,d Representing virtual machine v i Request amount for resource type d, c j,d Indicating host h j Overall capability on resource type d, x i,j Representing the deployment factor as a binary parameter.
Assume that n virtual machines to be deployed exist in a cloud computing environment, and the n virtual machines are expressed as a virtual machine set V= { V 1 ,v 2 ,...,v n There are m available physical hosts, denoted as the physical host set h= { H 1 ,h 2 ,...,h m }. The goal of the deployment of virtual machines is to minimize physical host power consumption and maximize resource utilization, therefore, the power consumption minimum condition is expressed as the following formula:
the maximum resource utilization condition is expressed as the following formula:
it follows that the two goals are conflicting goals, power consumption needs to be minimized, and resource utilization needs to be maximized. The Euclidean distance of the two objective functions is considered, and is uniformly expressed as a minimized objective function, and the corresponding formula is as follows:
the corresponding constraint conditions are as follows: the constraint condition of the number of the processing units indicates that the number of the processing units requested by the virtual machine cannot exceed the total number of the processing units of the host, and the corresponding formula is as follows:
r i,PE ×x i,j ≤c j,PE ,j=1,2,...,m
the MIPS number constraint indicates that the number of MIPS requested by the virtual machine cannot exceed the MIPS capability of the host, and the corresponding formula is as follows:
the memory constraint condition indicates that the memory amount requested by the virtual machine cannot exceed the memory capacity of the host, and the corresponding formula is as follows:
the storage constraint condition indicates that the storage requested by the virtual machine cannot exceed the storage capacity of the host, and the corresponding formula is as follows:
wherein r is i,PE Representing virtual machine v i The number of processing units requested, c j,PE Indicating host h j Provided processing sheetNumber of elements, r i,MIPS Representing virtual machine v i Number of MIPS requested, c j,MIPS Indicating host h j Number of MIPS provided, r i,RAM Representing virtual machine v i The amount of memory requested, c j,RAM Indicating host h j The amount of memory provided, r i,STOR Representing virtual machine v i Number of requested stores, c j,STOR Indicating host h j The amount of storage provided.
The step S10 specifically includes: acquiring the number of physical hosts corresponding to the physical host set and the number of virtual machines corresponding to the virtual machine set; and deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set as decoding of chromosome individuals. And setting the number of the chromosomes according to a preset population scale by taking the number of the virtual machines as the coding length of the chromosome individuals. And respectively taking two groups contained in each chromosome individual as a virtual machine group and a physical host group. And setting a gene value range in the virtual machine group according to the number of the virtual machines, and setting the gene value range in the physical host group according to the number of the physical hosts.
It should be noted that two groups represent chromosomes in the virtual machine deployment problem: virtual machine group VMlist and physical host group Hostlist. The VMlist group is used for representing the serial numbers of the virtual machines to be deployed, the genes on the group are represented by integer real values between 1 and n, n is the number of the virtual machines, and the coding length of a chromosome individual is also n; the Hostlist group is used for representing host serial numbers of the corresponding virtual machines, and the gene value range on the group is integer real values ranging from 1 to m. And coding according to the subordinate relation of the virtual machine, wherein the gene position represents the serial number of the virtual machine, and the gene value represents the host computer for deploying the virtual machine. The length of the chromosome in the code is fixed, namely the same number as the virtual machines to be deployed, so that the chromosome individual evolution can be carried out by adopting a standard genetic operator.
Referring to fig. 3, a chromosome coding diagram of a first embodiment of the multi-target virtual machine deployment method of fig. 3 is shown, where one chromosome represents a virtual machine deployment scheme.The chromosome coding indicates that 8 virtual machines to be deployed exist, and the virtual machines are deployed on 5 physical hosts, wherein the virtual machines v 1 、v 5 Deployed at host h 4 On virtual machine v 2 、v 4 Deployed at host h 1 On virtual machine v 3 、v 7 Deployed at host h 2 On virtual machine v 6 Deployed at host h 3 On virtual machine v 8 Deployed at host h 5 And (3) upper part.
The step of establishing a genetic population according to the chromosome number of individuals, the coding length and the gene value range specifically comprises the following steps: establishing an unassigned genetic population according to the chromosome individual number and the coding length; dividing the unassigned genetic population into a first population, a second population and a third population according to preset genetic population dividing conditions; assigning a value to the first population according to the minimum power consumption condition based on the gene value range, assigning a value to the second population according to the maximum resource utilization condition based on the gene value range, and randomly assigning a value to the third population based on the gene value range; and constructing a genetic population according to each assigned genetic population.
It should be noted that the diversity of the initial genetic population greatly affects the performance of the genetic algorithm, and the conventional genetic algorithm generates the initial genetic population in a random manner. In order to improve the initial quality of the chromosome and the evolution convergence rate of the chromosome individual, taking a formula corresponding to the minimum power consumption condition as a single objective function, namely taking the minimum power consumption as a target, and generating a virtual machine deployment scheme with the size of one fifth of the genetic population as a part of the initial genetic population; and then taking a formula corresponding to the maximum condition of resource utilization as a single objective function, namely taking the maximum resource utilization as a target, and generating a virtual machine deployment scheme with the size of one fifth of the genetic population as a part of the initial genetic population. The remaining three fifths of the genetic population is generated in a randomized manner. The sub-optimal deployment scheme of the two single targets can effectively improve the speed of chromosome evolution and guide chromosome individuals to evolve in an optimal solution.
It is easy to understand that the genetic population is divided into one fifth, one fifth and three fifths in this embodiment, and the genetic population may be scaled according to the actual requirement of the deployment scheme in the specific implementation, which is not limited in this embodiment.
It should be noted that the step of generating a virtual machine deployment scenario with minimized power consumption is accomplished in an improved descending order best-fit heuristic based on power consumption. The specific method comprises the following steps: all virtual machines are arranged in descending order according to CPU utilization requests; each virtual machine is deployed in turn onto the host that produces the highest energy efficiency (minimum objective function value). Therefore, the host with higher energy efficiency can be preferentially selected, and the isomerism of host resources is fully utilized.
It should be noted that, the step of generating the virtual machine deployment scenario with maximized resource utilization is performed by a heuristic method that is optimally adapted in descending order based on resource utilization. The specific method comprises the following steps: all virtual machines are arranged in descending order according to CPU utilization requests; each virtual machine is deployed in turn onto the host that yields the highest resource utilization (the largest objective function value). Therefore, the host with higher occupation utilization rate can be preferentially selected, and the idle host is closed, so that the power consumption is saved.
Step S20: and carrying out fitness calculation on each chromosome individual in the genetic population.
The smaller the objective function value is, the greater the fitness of the chromosome individual is according to the objective function corresponding to the deployment of the virtual machine. Therefore, the fitness function of the virtual machine deployment solution represented by the individual chromosome position can be set, and the corresponding formula is as follows:
If the resulting deployment solution fails to meet a constraint (at least one constraint adjustment), its fitness may be set to 0. Thus, in evaluating the quality of a virtual machine deployment solution represented by an individual chromosome, the final fitness function may be defined as:
it is easy to understand that the larger the fitness value corresponding to a chromosome individual is, the more excellent the virtual machine deployment scheme represented by the chromosome individual is.
Step S30: detecting a current genetic generation of the genetic population.
Step S40: and when the current genetic generation is equal to the preset genetic generation, taking the chromosome individual with the largest current fitness value as a target chromosome individual, and decoding the target chromosome individual to obtain the optimal solution of virtual machine deployment.
It is easy to understand that the predetermined genetic generation is the maximum genetic generation number GEN of the genetic population max Step S40 is for performing genetic termination judgment. If the current genetic generation reaches the maximum genetic generation, outputting the chromosome with the highest fitness as a final target chromosome individual, and decoding the final target chromosome individual into the maximum genetic generation number, namely a final virtual machine deployment scheme.
Step S50: and deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set according to the optimal solution of the virtual machine deployment.
It is easy to understand that after the optimal solution of the virtual machine deployment is obtained, the virtual machine deployment can be performed according to the optimal solution, so as to realize reasonable application of physical host resources and energy consumption.
According to the embodiment of the invention, through the method, under the condition that the resource utilization rate and the energy consumption of the physical host are both constrained, the physical host and the physical host are synchronously and uniformly optimized, so that the multi-target uniform optimization of virtual machine deployment is formed, and the efficiency and the effect of virtual machine deployment are improved.
Referring to fig. 3, fig. 3 is a flowchart of a second embodiment of a multi-target virtual machine deployment method according to the present invention. Based on the above-mentioned first embodiment, the multi-target virtual machine deployment method of the present embodiment further includes, after the step S40:
step S401: and when the current genetic generation is smaller than the preset genetic generation, generating a genetic population of the next generation according to a preset genetic algorithm.
The genetic algorithm includes: genetic selection, genetic crossover and genetic variation.
The step S401 specifically includes: reserving the chromosome individual with the maximum current fitness value to the genetic population of the next generation; calculating relative fitness of the residual chromosome individuals in the current genetic population, and carrying out genetic selection on the residual chromosome individuals according to a relative fitness calculation result and a roulette strategy; the chromosomal individuals obtained by genetic selection are retained to the genetic population of the next generation to generate the genetic population of the next generation.
It should be noted that, the genetic selection provides the driving force of the genetic algorithm, if the driving force is too large, the offspring is easy to mature early, and the searching process is over-fast; if the driving force is too small, the genetic process cannot converge rapidly. The common method is that breadth search is carried out in the early stage and then depth search is carried out in the later stage. The goal of genetic selection is to direct genetic searches into the solution space that optimizes the objective function and satisfies constraints. The embodiment adopts a roulette strategy, and the selection probability of each chromosome individual is determined according to the corresponding proportion of fitness values of the chromosome individuals.
The genetic selection procedure was as follows: the fitness function calculates fitness of chromosome individuals of the genetic population, chromosome individuals with the maximum fitness are directly reserved to the genetic population of the next generation, other chromosome individuals calculate the relative fitness, the fitness is used as the selection probability of the chromosome individuals, and the calculation mode of the relative fitness is as follows:
wherein the molecule fitness (k) represents fitness of chromosome k, and N represents genetic population size.
The selection of individuals on the chromosome is based on roulette strategy. Specifically, the discs were divided into N-1 parts according to the size of the P (k) value (chromosomes with the greatest fitness have been directly retained to the next generation). Obviously, the larger the P (k) value, the larger the sector area it occupies in the disk, and the greater the likelihood that the pointer will select the individual chromosome when the disk is rotated.
It should be noted that the above genetic selection method uses both proportional selection and optimal preservation strategies. The optimal preservation strategy can ensure that the chromosome individual with high fitness is directly preserved to the next generation, and the chromosome individual with highest fitness is prevented from suffering loss due to participation in genetic crossover and mutation. The proportion selection strategy can ensure that other chromosome individuals have the opportunity to be selected so as to ensure genetic population diversity.
After the step of reserving the chromosomal individuals obtained by genetic selection to the genetic population of the next generation to generate the genetic population of the next generation, the method further comprises: obtaining chromosome individuals remained after genetic selection according to a preset proportion, and carrying out genetic crossing on the obtained chromosome individuals; wherein, the chromosome individual before the genetic crossover is a parent chromosome, and the chromosome individual after the genetic crossover is a offspring chromosome. And carrying out fitness calculation on the offspring chromosomes to obtain fitness values.
It is easy to understand that the fitness calculation is performed according to the fitness function in the first embodiment, and will not be described in detail here.
And when the fitness value of the offspring chromosome is larger than that of the parent chromosome, reserving the offspring chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation. And when the fitness value of the offspring chromosome is smaller than or equal to that of the parent chromosome, reserving the parent chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation.
It should be noted that genetic crossover can improve the search performance of the algorithm. This example incorporates two genetic crossover operations, single-dye crossover and double-chromosome crossover.
Further, the genetic crossover process of the single chromosome is as follows: for the selected father chromosome P1 needing crossing, two crossing positions i and j are randomly selected on the chromosome, and the gene values indicated by i and j are exchanged to generate a child chromosome C1. Referring to fig. 5, fig. 5 is a schematic diagram illustrating a single chromosome crossing operation according to a second embodiment of the multi-target virtual machine deployment method of the present invention. The selected intersection i=3, j=6 in this embodiment.
Further, the genetic crossover process of the double chromosomes is as follows: for the selected two father chromosomes P1 and P2 needing to be crossed, randomly selecting two crossing points i and j on the two chromosomes, and exchanging the chromosome gene values of i to j in the two father chromosomes to generate two child chromosomes C1 and C2. Referring to fig. 6, fig. 6 is a schematic diagram of a double-chromosome crossover operation according to a second embodiment of the multi-target virtual machine deployment method of the present invention, where the selected crossover point i=3, j=6.
It will be readily appreciated that in order to perform a genetic crossover operation, it is necessary to determine whether the two parent chromosomes to be selected are crossover operated, the decision being determined by the crossover probability. In principle, the greater the crossover probability, the better the chromosomal individual diversity. However, a larger crossover probability also loses part of the better gene; too small crossover probability is not beneficial to generating new chromosome individuals, and reduces optimizing speed. Generally, for genetic processes, the evolution process can be divided into an initial state, a sub-mature state, a positive mature state, and a mature state. The crossover probability should be adaptively adjusted according to the different states of the genetic population, and should not be fixed. When the genetic population has more inferior chromosome individuals with low fitness, the crossover probability should be increased in the initial state; if the span between chromosome individual fitness of the genetic population is too large, the cross probability should be increased between the sub-mature state and the positive mature state; if the genetic population chromosome individuals are more perfect chromosome individuals with better fitness, the crossover probability should be reduced in the mature state. Based on this consideration, the following adaptive crossover probability adjustment formula is designed:
Wherein alpha represents a crossing factor, alpha takes a value interval of (0, 1), represents a random value between (0, 1), prob crossover (k) The crossover probability of chromosome k is represented.
Where fitness (k) represents fitness of chromosome k, and fitness (k, r) represents fitness of a chromosome where fitness is closest to chromosome k.
The decision process for whether to perform a chromosomal crossover operation is as follows: two parent chromosomes are selected using a genetic selection strategy based on a roulette strategy. Generating a random value between (0, 1) for each parent chromosome, if the random value is less than the crossover probability of the parent chromosome, the chromosome can perform a genetic crossover operation; otherwise, not executing.
After the step of reserving the chromosomal individuals obtained by genetic selection to the genetic population of the next generation to generate the genetic population of the next generation, the method further comprises: obtaining chromosome individuals remained after genetic selection according to a preset proportion, and carrying out genetic variation on the obtained chromosome individuals; wherein, the chromosome individual before genetic variation is a parent chromosome, and the chromosome individual after genetic variation is a offspring chromosome; and carrying out fitness calculation on the offspring chromosomes to obtain fitness values.
It is easy to understand that the fitness calculation is performed according to the fitness function in the first embodiment, and will not be described in detail here.
When the fitness value of the offspring chromosome is larger than that of the parent chromosome, reserving the offspring chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation; and when the fitness value of the offspring chromosome is smaller than or equal to that of the parent chromosome, reserving the parent chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation.
In order to ensure diversity of genetic population, avoiding the solving process from being in local optimum, genetic variation is needed to further expand the search space. The genetic variation process of the chromosome is as follows: for the selected father chromosome P1 needing mutation, two mutation points i and j are randomly selected on the chromosome, chromosome gene values of i and j in the father chromosome are burst, and a child chromosome C1 is generated. Referring to fig. 7, fig. 7 is a schematic diagram of genetic variation of a second embodiment of the multi-objective virtual machine deployment method according to the present invention, where the variation points i=2, j=7 are selected in this embodiment.
Further, based on the same considerations as the genetic crossover operation, the following adaptive mutation probability adjustment formula is also designed:
wherein, beta represents a variation factor, the beta value interval is (0, 1), the beta value interval is a random generation value, fitness (k) represents the fitness of chromosome k, fitness (max) represents the maximum fitness in the current genetic population, prob mutation (k) The probability of variation of chromosome k is represented.
Further, the decision process of whether to perform the chromosomal mutation operation is as follows: a parent chromosome is selected using a genetic selection strategy based on a roulette strategy. Generating a random value between (0, 1) for the parent chromosome, and if the random value is less than the mutation probability of the parent chromosome, the chromosome can execute genetic mutation operation; otherwise, not executing.
Step S402: adding one to the current genetic generation; and returns to step S20.
It will be readily appreciated that after all of the above steps have been completed, the genetic population of the next generation is generated, i.e., one genetic action is completed, and the number of current genetic generations is incremented by one. Returning to the step S20 to carry out fitness calculation again, and continuing genetic behavior when the current genetic generation does not reach the maximum genetic generation so as to acquire an optimal deployment scheme.
According to the method, the virtual machine deployment scheme is optimized through various genetic algorithms, the scheme of deploying the optimized virtual machine to the physical host machine, which is more balanced in resource utilization rate and energy consumption, is obtained, and the efficiency and effect of deploying the virtual machine are improved.
Referring to fig. 8, fig. 8 is a block diagram illustrating a configuration of a first embodiment of a multi-target virtual machine deployment apparatus according to the present invention.
The multi-target virtual machine deployment apparatus includes: the system comprises a model building module 10, an adaptability computing module 20, an optimal solution obtaining module 30 and a deployment module 40.
It is easy to understand that this embodiment is based on a virtual machine deployment model corresponding to the first embodiment of the multi-target virtual machine deployment method of the present invention.
The model building module 10 is configured to obtain a set of virtual machines and a set of physical hosts to be deployed, and build a genetic population including a plurality of chromosome individuals by using the number of virtual machines corresponding to the set of virtual machines as the coding length of the chromosome individuals.
The model building module 10 is specifically configured to obtain a physical host number corresponding to the physical host set and a virtual machine number corresponding to the virtual machine set; and deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set as decoding of chromosome individuals. And setting the number of the chromosomes according to a preset population scale by taking the number of the virtual machines as the coding length of the chromosome individuals. And respectively taking two groups contained in each chromosome individual as a virtual machine group and a physical host group. And setting a gene value range in the virtual machine group according to the number of the virtual machines, and setting the gene value range in the physical host group according to the number of the physical hosts.
It should be noted that two groups represent chromosomes in the virtual machine deployment problem: virtual machine group VMlist and physical host group Hostlist. The VMlist group is used for representing the serial numbers of the virtual machines to be deployed, the genes on the group are represented by integer real values between 1 and n, n is the number of the virtual machines, and the coding length of a chromosome individual is also n; the Hostlist group is used for representing host serial numbers of the corresponding virtual machines, and the gene value range on the group is integer real values ranging from 1 to m. And coding according to the subordinate relation of the virtual machine, wherein the gene position represents the serial number of the virtual machine, and the gene value represents the host computer for deploying the virtual machine. The length of the chromosome in the code is fixed, namely the same number as the virtual machines to be deployed, so that the chromosome individual evolution can be carried out by adopting a standard genetic operator.
The step of establishing a genetic population according to the chromosome number of individuals, the coding length and the gene value range specifically comprises the following steps: establishing an unassigned genetic population according to the chromosome individual number and the coding length; dividing the unassigned genetic population into a first population, a second population and a third population according to preset genetic population dividing conditions; assigning a value to the first population according to the minimum power consumption condition based on the gene value range, assigning a value to the second population according to the maximum resource utilization condition based on the gene value range, and randomly assigning a value to the third population based on the gene value range; and constructing a genetic population according to each assigned genetic population.
It should be noted that the diversity of the initial genetic population greatly affects the performance of the genetic algorithm, and the conventional genetic algorithm generates the initial genetic population in a random manner. In order to improve the initial quality of the chromosome and the evolution convergence rate of the chromosome individual, taking a formula corresponding to the minimum power consumption condition as a single objective function, namely taking the minimum power consumption as a target, and generating a virtual machine deployment scheme with the size of one fifth of the genetic population as a part of the initial genetic population; and then taking a formula corresponding to the maximum condition of resource utilization as a single objective function, namely taking the maximum resource utilization as a target, and generating a virtual machine deployment scheme with the size of one fifth of the genetic population as a part of the initial genetic population. The remaining three fifths of the genetic population is generated in a randomized manner. The sub-optimal deployment scheme of the two single targets can effectively improve the speed of chromosome evolution and guide chromosome individuals to evolve in an optimal solution.
It is easy to understand that the genetic population is divided into one fifth, one fifth and three fifths in this embodiment, and the genetic population may be scaled according to the actual requirement of the deployment scheme in the specific implementation, which is not limited in this embodiment.
It should be noted that the step of generating a virtual machine deployment scenario with minimized power consumption is accomplished in an improved descending order best-fit heuristic based on power consumption. The specific method comprises the following steps: all virtual machines are arranged in descending order according to CPU utilization requests; each virtual machine is deployed in turn onto the host that produces the highest energy efficiency (minimum objective function value). Therefore, the host with higher energy efficiency can be preferentially selected, and the isomerism of host resources is fully utilized.
It should be noted that, the step of generating the virtual machine deployment scenario with maximized resource utilization is performed by a heuristic method that is optimally adapted in descending order based on resource utilization. The specific method comprises the following steps: all virtual machines are arranged in descending order according to CPU utilization requests; each virtual machine is deployed in turn onto the host that yields the highest resource utilization (the largest objective function value). Therefore, the host with higher occupation utilization rate can be preferentially selected, and the idle host is closed, so that the power consumption is saved.
The fitness calculating module 20 is configured to perform fitness calculation on each of the chromosome individuals in the genetic population; and also for detecting the current genetic generation of said genetic population.
The smaller the objective function value is, the greater the fitness of the chromosome individual is according to the objective function corresponding to the deployment of the virtual machine. Therefore, the fitness function of the virtual machine deployment solution represented by the individual chromosome position can be set, and the corresponding formula is as follows:
If the resulting deployment solution fails to meet a constraint (at least one constraint adjustment), its fitness may be set to 0. Thus, in evaluating the quality of a virtual machine deployment solution represented by an individual chromosome, the final fitness function may be defined as:
it is easy to understand that the larger the fitness value corresponding to a chromosome individual is, the more excellent the virtual machine deployment scheme represented by the chromosome individual is.
The optimal solution obtaining module 30 is configured to decode a target chromosome individual with the largest current fitness value as the target chromosome individual when the current genetic generation is equal to a preset genetic generation, so as to obtain a virtual machine deployment optimal solution.
It is easy to understand that the predetermined genetic generation is the maximum genetic generation number GEN of the genetic population max The optimal solution obtaining module 30 is configured to perform genetic termination judgment. If the current genetic generation reaches the maximum genetic generation, outputting the chromosome with the highest fitness as a final target chromosome individual, and decoding the final target chromosome individual into the maximum genetic generation number, namely a final virtual machine deployment scheme.
The deployment module 40 is configured to deploy the virtual machines in the virtual machine set to physical hosts in the physical host set according to the optimal solution for virtual machine deployment.
It is easy to understand that after the optimal solution of the virtual machine deployment is obtained, the virtual machine deployment can be performed according to the optimal solution, so as to realize reasonable application of physical host resources and energy consumption.
According to the embodiment of the invention, through the device, under the condition that the resource utilization rate and the energy consumption of the physical host are both constrained, the physical host and the physical host are synchronously and uniformly optimized, so that the multi-target uniform optimization of virtual machine deployment is formed, and the efficiency and the effect of virtual machine deployment are improved.
It should be understood that the foregoing is illustrative only and is not limiting, and that in specific applications, those skilled in the art may set the invention as desired, and the invention is not limited thereto.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
In addition, technical details not described in detail in this embodiment may refer to the multi-target virtual machine deployment method provided in any embodiment of the present invention, which is not described herein.
Furthermore, it should be noted that, in this embodiment, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read Only Memory)/RAM, magnetic disk, optical disk) and including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (6)

1. A method for deploying a multi-target virtual machine, the method comprising:
acquiring a virtual machine set and a physical host set to be deployed, taking the number of virtual machines corresponding to the virtual machine set as the coding length of chromosome individuals, and establishing a genetic population comprising a plurality of chromosome individuals;
performing fitness calculation on each chromosome individual in the genetic population;
detecting a current genetic generation of the genetic population;
when the current genetic generation is equal to the preset genetic generation, taking a chromosome individual with the maximum current fitness value as a target chromosome individual, and decoding the target chromosome individual to obtain a virtual machine deployment optimal solution;
deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set according to the optimal solution of the virtual machine deployment;
The method for obtaining the virtual machine set and the physical host set to be deployed includes the steps of taking the number of virtual machines corresponding to the virtual machine set as the coding length of chromosome individuals, and establishing a genetic population containing a plurality of chromosome individuals, wherein the method comprises the following steps:
acquiring the number of physical hosts corresponding to the physical host set and the number of virtual machines corresponding to the virtual machine set;
deploying virtual machines in the virtual machine set into physical hosts of the physical host set as decoding of chromosome individuals, wherein a DVFS module is deployed in each physical host;
setting the number of the chromosomes according to a preset population scale by taking the number of the virtual machines as the coding length of the chromosome individuals;
respectively taking two groups contained in each chromosome individual as a virtual machine group and a physical host group;
setting a gene value range in the virtual machine group according to the number of virtual machines, and setting the gene value range in the physical host group according to the number of physical hosts;
establishing a genetic population according to the chromosome individual number, the coding length and the gene value range;
wherein the establishment of the genetic population according to the chromosome number of individuals, the coding length and the gene value range comprises the following steps:
Establishing an unassigned genetic population according to the chromosome individual number and the coding length;
dividing the unassigned genetic population into a first population, a second population and a third population according to preset genetic population dividing conditions;
assigning a value to the first population according to the minimum power consumption condition based on the gene value range, assigning a value to the second population according to the maximum resource utilization condition based on the gene value range, and randomly assigning a value to the third population based on the gene value range;
constructing a genetic population according to the assigned first population, the assigned second population and the assigned third population, wherein the composition ratio of the first population, the second population and the third population in the genetic population is 1:1:3;
the assignment of the first population based on the gene value range according to the minimum power consumption condition, the assignment of the second population based on the gene value range according to the maximum resource utilization condition, and the assignment of the third population based on the gene value range at random comprise:
taking a formula corresponding to the minimum power consumption condition as a single objective function to generate a virtual machine deployment scheme with a fifth genetic population scale;
Taking a formula corresponding to the maximum condition of resource utilization as a single objective function to generate a virtual machine deployment scheme with a fifth genetic population scale;
generating a virtual machine deployment scheme of three-fifths genetic population scale in a randomization mode;
the virtual machine deployment scheme for generating a fifth genetic population scale by taking a formula corresponding to the minimum power consumption condition as a single objective function comprises the following steps:
arranging the virtual machines in descending order according to the corresponding CPU utilization requests;
sequentially deploying the virtual machines to a physical host with the minimum calculated value of a formula corresponding to the minimum power consumption condition according to the arrangement result;
the formula corresponding to the minimum power consumption condition is as follows:
wherein m is the number of physical hosts,power consumption for the j-th physical host;
the virtual machine deployment scheme for generating a fifth genetic population scale by taking a formula corresponding to a maximum resource utilization condition as a single objective function comprises the following steps:
arranging the virtual machines in descending order according to the corresponding CPU utilization requests;
sequentially deploying the virtual machines to a physical host with the minimum calculated value of a formula corresponding to the maximum resource utilization condition according to the arrangement result;
The formula corresponding to the maximum resource utilization condition is as follows:
in the method, in the process of the invention,the resource utilization rate of the jth physical host;
the formula of the fitness calculation is as follows:
where fitness is the fitness value,maximum power consumption for the physical host; the constraint condition includesProcessing unit number constraint, MIPS number constraint, memory size constraint, and storage size constraint:
the calculation formula of the power consumption of the physical host is as follows:
in the method, in the process of the invention,u is the CPU utilization rate of the physical host for the minimum power consumption of the physical host;
wherein, after detecting the current genetic generation of the genetic population, further comprises:
when the current genetic generation is smaller than the preset genetic generation, generating a genetic population of the next generation according to a preset genetic algorithm;
adding one to the current genetic generation, and returning to the step of performing fitness calculation on each of the chromosome individuals in the genetic population;
wherein when the current genetic generation is smaller than a preset genetic generation, generating a genetic population of the next generation according to a preset genetic algorithm, including:
reserving the chromosome individual with the maximum current fitness value to the genetic population of the next generation;
Calculating relative fitness of the residual chromosome individuals in the current genetic population, and carrying out genetic selection on the residual chromosome individuals according to a relative fitness calculation result and a roulette strategy;
the chromosomal individuals obtained by genetic selection are retained to the genetic population of the next generation to generate the genetic population of the next generation.
2. The multi-target virtual machine deployment method of claim 1, wherein after the step of reserving the chromosomal individuals obtained by genetic selection to the genetic population of the next generation to generate the genetic population of the next generation, further comprising:
obtaining chromosome individuals remained after genetic selection according to a preset proportion, and carrying out genetic crossing on the obtained chromosome individuals; wherein, the chromosome individual before the genetic crossover is a parent chromosome, and the chromosome individual after the genetic crossover is a offspring chromosome;
carrying out fitness calculation on the offspring chromosomes to obtain fitness values;
when the fitness value of the offspring chromosome is larger than that of the parent chromosome, reserving the offspring chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation;
And when the fitness value of the offspring chromosome is smaller than or equal to that of the parent chromosome, reserving the parent chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation.
3. The multi-target virtual machine deployment method of claim 2, wherein after the step of reserving the chromosomal individuals obtained by genetic selection to the genetic population of the next generation to generate the genetic population of the next generation, further comprising:
obtaining chromosome individuals remained after genetic selection according to a preset proportion, and carrying out genetic variation on the obtained chromosome individuals; wherein, the chromosome individual before genetic variation is a parent chromosome, and the chromosome individual after genetic variation is a offspring chromosome;
carrying out fitness calculation on the offspring chromosomes to obtain fitness values;
when the fitness value of the offspring chromosome is larger than that of the parent chromosome, reserving the offspring chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation;
and when the fitness value of the offspring chromosome is smaller than or equal to that of the parent chromosome, reserving the parent chromosome to the genetic population of the next generation so as to generate the genetic population of the next generation.
4. A multi-target virtual machine deployment apparatus, the apparatus comprising: the system comprises a model building module, a fitness computing module, an optimal solution acquisition module and a deployment module, wherein,
the model building module is used for obtaining a virtual machine set and a physical host set to be deployed, taking the number of virtual machines corresponding to the virtual machine set as the coding length of chromosome individuals, and building a genetic population comprising a plurality of chromosome individuals;
the fitness calculation module is used for calculating fitness of each chromosome individual in the genetic population; also for detecting a current genetic generation of the genetic population;
the optimal solution obtaining module is used for taking a chromosome individual with the maximum current fitness value as a target chromosome individual when the current genetic generation is equal to the preset genetic generation, and decoding the target chromosome individual to obtain a virtual machine deployment optimal solution;
the deployment module is used for deploying the virtual machines in the virtual machine set into the physical hosts of the physical host set according to the optimal solution of the virtual machine deployment;
the model building module is further configured to obtain a physical host number corresponding to the physical host set and a virtual machine number corresponding to the virtual machine set; deploying virtual machines in the virtual machine set into physical hosts of the physical host set as decoding of chromosome individuals, wherein a DVFS module is deployed in each physical host; setting the number of the chromosomes according to a preset population scale by taking the number of the virtual machines as the coding length of the chromosome individuals; respectively taking two groups contained in each chromosome individual as a virtual machine group and a physical host group; setting a gene value range in the virtual machine group according to the number of virtual machines, and setting the gene value range in the physical host group according to the number of physical hosts; establishing a genetic population according to the chromosome individual number, the coding length and the gene value range;
The model building module is also used for building an unassigned genetic population according to the chromosome individual number and the coding length; dividing the unassigned genetic population into a first population, a second population and a third population according to preset genetic population dividing conditions; assigning a value to the first population according to the minimum power consumption condition based on the gene value range, assigning a value to the second population according to the maximum resource utilization condition based on the gene value range, and randomly assigning a value to the third population based on the gene value range; constructing a genetic population according to the assigned first population, the assigned second population and the assigned third population, wherein the composition ratio of the first population, the second population and the third population in the genetic population is 1:1:3;
the model building module is further used for generating a virtual machine deployment scheme of a fifth genetic population scale by taking a formula corresponding to the minimum power consumption condition as a single objective function; taking a formula corresponding to the maximum condition of resource utilization as a single objective function to generate a virtual machine deployment scheme with a fifth genetic population scale; generating a virtual machine deployment scheme of three-fifths genetic population scale in a randomization mode;
The model building module is further used for arranging the virtual machines in descending order according to the corresponding CPU utilization requests; sequentially deploying the virtual machines to a physical host with the minimum calculated value of a formula corresponding to the minimum power consumption condition according to the arrangement result; the formula corresponding to the minimum power consumption condition is as follows:
wherein m is the number of physical hosts,power consumption for the j-th physical host;
the model building module is further used for arranging the virtual machines in descending order according to the corresponding CPU utilization requests; sequentially deploying the virtual machines to a physical host with the minimum calculated value of a formula corresponding to the maximum resource utilization condition according to the arrangement result; the formula corresponding to the maximum resource utilization condition is as follows:
in the method, in the process of the invention,the resource utilization rate of the jth physical host;
the formula of the fitness calculation is as follows:
where fitness is the fitness value,maximum power consumption for the physical host; the constraint conditions comprise a processing unit quantity constraint condition, a MIPS quantity constraint condition, a memory quantity constraint condition and a memory quantity constraint condition:
the calculation formula of the power consumption of the physical host is as follows:
in the method, in the process of the invention, U is the CPU utilization rate of the physical host for the minimum power consumption of the physical host;
the optimal solution obtaining module is further configured to generate a genetic population of a next generation according to a preset genetic algorithm when the current genetic generation is smaller than a preset genetic generation; adding one to the current genetic generation, and returning to the step of performing fitness calculation on each of the chromosome individuals in the genetic population;
the optimal solution acquisition module is also used for reserving the chromosome individual with the maximum current fitness value to the genetic population of the next generation; calculating relative fitness of the residual chromosome individuals in the current genetic population, and carrying out genetic selection on the residual chromosome individuals according to a relative fitness calculation result and a roulette strategy; the chromosomal individuals obtained by genetic selection are retained to the genetic population of the next generation to generate the genetic population of the next generation.
5. An electronic device, the electronic device comprising: a memory, a processor, and a multi-target virtual machine deployment program stored on the memory and executable on the processor, the multi-target virtual machine deployment program configured to implement the steps of the multi-target virtual machine deployment method of any one of claims 1 to 3.
6. A storage medium having stored thereon a multi-target virtual machine deployment program which, when executed by a processor, implements the steps of the multi-target virtual machine deployment method of any of claims 1 to 3.
CN202010114159.1A 2020-02-24 2020-02-24 Multi-target virtual machine deployment method, device, equipment and storage medium Active CN111324422B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010114159.1A CN111324422B (en) 2020-02-24 2020-02-24 Multi-target virtual machine deployment method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010114159.1A CN111324422B (en) 2020-02-24 2020-02-24 Multi-target virtual machine deployment method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111324422A CN111324422A (en) 2020-06-23
CN111324422B true CN111324422B (en) 2024-04-16

Family

ID=71172866

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010114159.1A Active CN111324422B (en) 2020-02-24 2020-02-24 Multi-target virtual machine deployment method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111324422B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433807A (en) * 2020-10-19 2021-03-02 暨南大学 Airflow perception type virtual machine scheduling method oriented to data center global energy consumption optimization
CN114461332B (en) * 2020-11-09 2024-05-28 上海大学 Virtual machine deployment method based on application characteristics
CN112463291B (en) * 2020-11-12 2023-01-10 苏州浪潮智能科技有限公司 Virtual machine deployment method, device, equipment and readable storage medium
CN112464309B (en) * 2020-11-24 2024-04-30 中天众达智慧城市科技有限公司 Equipment arrangement method for smart city data center
CN113726462A (en) * 2021-07-30 2021-11-30 浪潮电子信息产业股份有限公司 PCIe virtual channel selection method, device, system and medium
CN114546637A (en) * 2022-01-16 2022-05-27 华东师范大学 Virtual machine distribution method with limited types

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013150490A1 (en) * 2012-04-05 2013-10-10 Telefonaktiebolaget Lm Ericsson (Publ) Method and device to optimise placement of virtual machines with use of multiple parameters
CN104811491A (en) * 2015-04-17 2015-07-29 华南理工大学 Cloud computing resource scheduling method based on genetic algorithm
CN105740051A (en) * 2016-01-27 2016-07-06 北京工业大学 Cloud computing resource scheduling realization method based on improved genetic algorithm
CN105843689A (en) * 2016-04-12 2016-08-10 合肥工业大学 Virtual machine deployment method and system
CN106293936A (en) * 2016-07-29 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of determination method and device of the locally optimal solution of physical host virtual memory
CN108897600A (en) * 2018-06-14 2018-11-27 郑州云海信息技术有限公司 A kind of virtual machine placement method under cloud computing environment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102711266B (en) * 2012-05-17 2014-08-13 北京邮电大学 Scheduling and resource allocation joint optimization method based on genetic algorithm

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013150490A1 (en) * 2012-04-05 2013-10-10 Telefonaktiebolaget Lm Ericsson (Publ) Method and device to optimise placement of virtual machines with use of multiple parameters
CN104811491A (en) * 2015-04-17 2015-07-29 华南理工大学 Cloud computing resource scheduling method based on genetic algorithm
CN105740051A (en) * 2016-01-27 2016-07-06 北京工业大学 Cloud computing resource scheduling realization method based on improved genetic algorithm
CN105843689A (en) * 2016-04-12 2016-08-10 合肥工业大学 Virtual machine deployment method and system
CN106293936A (en) * 2016-07-29 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of determination method and device of the locally optimal solution of physical host virtual memory
CN108897600A (en) * 2018-06-14 2018-11-27 郑州云海信息技术有限公司 A kind of virtual machine placement method under cloud computing environment

Non-Patent Citations (11)

* Cited by examiner, † Cited by third party
Title
基于动态调整阈值的虚拟机迁移算法;赵春等;计算机应用;20170910;第2547-2550页 *
基于多目标优化的虚拟机资源调度问题研究;杨媛;中国优秀硕士学位论文全文数据库信息科技辑;20200115;第7-35页 *
基于多目标蚁群优化的虚拟机放置算法;黎海雪;计算机与数字工程;20181231;第2445-2449页 *
宋杰著.大数据处理平台能耗优化方法的研究.东北大学出版社,2016,第21-24页. *
寿涌毅.项目调度的数学模型与启发式算法.浙江大学出版社,2019,第112-115页. *
文静等.基于改进的遗传算法的虚拟机部署研究.广西大学学报: 自然科学版.2014,第1291-1299页. *
王宏生等.人工智能及其应用.国防工业出版社,2009,第155-158页. *
胡苗苗.基于改进遗传算法的虚拟机初始化部署算法研究.中国优秀硕士学位论文全文数据库信息科技辑.2019,第12-24页. *
董浩等.基于多种群遗传算法的虚拟机优化部署研究.控制工程.2020,第335-341页. *
郭力争.云计算资源管理与调度优化方法.中国矿业大学出版社,2017,第99-106页. *
面向绿色云计算的能耗优化策略研究;孙蒙;中国优秀硕士学位论文全文数据库信息科技辑;20180215;第2-26页 *

Also Published As

Publication number Publication date
CN111324422A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
CN111324422B (en) Multi-target virtual machine deployment method, device, equipment and storage medium
CN111522666B (en) Cloud robot edge computing unloading model and unloading method thereof
Gao et al. Hierarchical multi-agent optimization for resource allocation in cloud computing
CN107491341A (en) A kind of virtual machine distribution method based on particle group optimizing
CN109600178A (en) The optimization method of energy consumption and time delay and minimum in a kind of edge calculations
CN109447264B (en) Virtual machine placement genetic optimization method based on VHAM-R model in cloud computing environment
CN111813506A (en) Resource sensing calculation migration method, device and medium based on particle swarm algorithm
CN112073452B (en) Mobile edge computing task allocation method with effective energy and limited resources
CN114741955A (en) Multi-objective optimization task scheduling method based on security cloud
CN104461739B (en) A kind of virtual machine batch dispositions method based on cloudsim platforms
CN111338765B (en) Virtual machine deployment method, device, equipment and storage medium based on cat swarm algorithm
Yousefipour et al. Improving the load balancing and dynamic placement of virtual machines in cloud computing using particle swarm optimization algorithm
CN111339713A (en) Optimal design method and system for wind power plant, electronic device and storage medium
CN112380016A (en) Cloud computing resource load balancing scheduling method based on improved genetic algorithm and application
CN114980216B (en) Dependency task unloading system and method based on mobile edge calculation
Zhang et al. A dynamic placement policy of virtual machine based on MOGA in cloud environment
CN108805463A (en) A kind of production scheduling method for supporting peak clipping type electricity needs to respond
CN111290853B (en) Cloud data center scheduling method based on self-adaptive improved genetic algorithm
CN106550036A (en) A kind of heuristic cloud computing resources distribution and dispatching method towards energy-conservation
CN113296893A (en) Cloud platform low-resource-loss virtual machine placement method based on hybrid sine and cosine particle swarm optimization algorithm
Liu et al. Task scheduling model of edge computing for AI flow computing in Internet of Things
Feng et al. A Novel Discrete Bi-objective Optimization Method for Virtual Machine Placement
Woldeyes et al. Joint Resource Placement and Service Replica Placement Scheme in Mobile Edge Computing
Ganesh et al. A hyper heuristics technique for data partitioning and scheduling to heterogeneous systems using genetic algorithm and improved particle swarm optimization
Li et al. A new multi-subpopulation co-evolutionary genetic algorithm for cloud resource scheduling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant