CN110308993B - Cloud computing resource allocation method based on improved genetic algorithm - Google Patents
Cloud computing resource allocation method based on improved genetic algorithm Download PDFInfo
- Publication number
- CN110308993B CN110308993B CN201910566370.4A CN201910566370A CN110308993B CN 110308993 B CN110308993 B CN 110308993B CN 201910566370 A CN201910566370 A CN 201910566370A CN 110308993 B CN110308993 B CN 110308993B
- Authority
- CN
- China
- Prior art keywords
- physical machine
- physical
- machine
- machines
- virtual
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Software Systems (AREA)
- Biophysics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Physics & Mathematics (AREA)
- Molecular Biology (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Physiology (AREA)
- Computing Systems (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Genetics & Genomics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention belongs to the field of cloud computing resource allocation, and relates to a cloud computing resource allocation method based on an improved genetic algorithm. The method comprises the steps of firstly constructing a mathematical model of cloud resource allocation, and then designing an improved genetic algorithm to solve the mathematical model. The improvement of the genetic algorithm in the invention is the improvement of the generation and cross mutation method of the initial population. When the population is initialized, the virtual machines are divided into H groups by using a sub-adaptive algorithm, each group corresponds to one physical machine, and the effectiveness of the initial population is ensured. A gene evaluation function is introduced to evaluate the load condition of each physical machine, and cross and variation are performed based on the evaluation function, so that the high efficiency of the algorithm is ensured. And finally, obtaining a virtual machine allocation scheme with the minimum physical machine activation number and the maximum resource utilization rate through iteration. The invention ensures high resource utilization rate and load balance of each physical machine, thereby improving the utilization rate of cloud resources and reducing the energy consumption of the cloud data center.
Description
Technical Field
The invention belongs to the field of cloud computing resource allocation, and particularly relates to a cloud computing resource allocation method based on an improved genetic algorithm.
Background
In smart manufacturing, a large amount of production data is generated due to the application of advanced information technologies such as digital twin technology and cyber-physical systems. At this time, the traditional computing equipment can not meet the production requirements, and the cloud computing technology can be used for well solving the problem. However, cloud computing data centers have the disadvantages of low resource utilization and high energy consumption, and according to prediction, the annual power consumption of the american data center in 2020 is about 1400 hundred million KWH, and the huge power consumption is equivalent to the power generation amount of a 50-year large-scale thermal power plant which lasts for one year, and if the cost is reduced, about 130 hundred million dollars is consumed. This will greatly increase the use cost of the manufacturing enterprise. While the development of virtualization technology has enabled the allocation of one physical machine resource into multiple virtual machine resources. Resources such as calculation, storage and network of the data center can be reasonably distributed to the virtual machines through a virtualization technology, so that the purposes of reducing energy consumption of the data center, improving resource utilization rate and reasonably distributing the resources are achieved. Among the cloud resource allocation problems, the most critical problem is how to reasonably allocate virtual machines to minimize the number of physical machines occupied by the virtual machines and ensure that each physical machine is load-balanced as much as possible, as shown in fig. 1. The existing cloud resource allocation algorithm comprises traditional heuristic algorithms such as FFD (fringe field distribution), BFD (bidirectional Forwarding detection), WFD (weighted round-robin) and the like, and although the traditional heuristic algorithms are simple and easy to implement, the traditional heuristic algorithms are easy to fall into a local optimal solution, and a global optimal solution is difficult to obtain. With the emergence of the swarm intelligence algorithm, many researchers use the ant colony algorithm and the particle swarm algorithm to solve the problem of virtual machine placement, so that a good effect is achieved, but the defects of low convergence speed, easy falling into local optimum and the like still exist. In addition, for the dimension of the resource, the consideration of the current research is single, and the resource type mainly has one-dimensional or two-dimensional resource types, while the type of the cloud resource is multidimensional in the practical application process, and comprises a CPU, a memory, a bandwidth, a disk and the like. This makes most existing algorithms less suitable in reality. In order to solve the problems of unbalanced energy consumption of a cloud data center and load of resources inside a server and improve the applicability of the algorithm, the invention provides an improved genetic algorithm for a multi-dimensional cloud resource type.
Disclosure of Invention
The technical problem to be solved by the invention is the design of a cloud resource allocation method, namely an improved genetic algorithm. According to the method, a mathematical model of cloud resource allocation is constructed, and then an improved genetic algorithm is designed to solve the mathematical model. The improvement of the genetic algorithm in the invention is mainly the improvement of the generation and cross mutation method of the initial population, as shown in figure 2. The algorithm aims to reasonably distribute the virtual machines to minimize the number of occupied physical machines and ensure high resource utilization rate and load balance of each physical machine as much as possible. Therefore, the utilization rate of cloud resources is improved, and the energy consumption of the cloud data center is reduced.
In order to achieve the purpose, the technical scheme of the invention is as follows:
a cloud computing resource allocation method based on an improved genetic algorithm comprises the following steps:
first, model building
The existing M virtual machines need to be mapped onto N physical machines. The invention sets the total resource type and capability of the physical machine to be the same. The method comprises the following steps of dividing M virtual machines into H groups according to a first adaptation algorithm (FirstFit), wherein each group of virtual machines corresponds to one physical machine. And when the H is not equal to the N, activating or closing the physical machine. The method aims to minimize the number of physical machines occupied by the virtual machines and guarantee high resource utilization rate and load balance of each physical machine as far as possible. The following are the variables in the model and the meanings they represent:
1.1 multidimensional resource model
P: is a set of physical machines, P = { P = 1 ,p 2 ,…,p n N is the number of physical machines;
P i : denotes the ith physical machine, P i = {0,1}, which is a binary variable, and a value of 1 indicates that the physical machine i is activated, and a value of 0 indicates that the physical machine i is in a sleep state;
C i set of resource capacities provided by physical machines, C i ={c i,1 ,c i,2 ,…,c i,l I is more than or equal to 1 and less than or equal to n;
c i,l the capacity of the I type resource which can be provided by the physical machine i is shown, and only 4 types of resources of CPU, memory, bandwidth and disk are considered in the invention becauseThis/is at most 4.
V: for a set of virtual machines, V = { V = 1 ,v 2 ,…,v m M is the number of virtual machines;
V ij :V ij 1, a binary variable, which represents that virtual machine j is placed on physical machine i, and is not present when it is 0;
R j : set of resource sizes, R, requested by virtual machine j ={r j,1 ,r j,2 ,...,r j,l J is more than or equal to 1 and less than or equal to n;
r j,l representing the size of the type I resource requested by physical machine j;
u il : the utilization rate of the I type resources on the physical machine i (i is more than or equal to 1 and less than or equal to n);
u i : average utilization rate of resources on the physical machine i;
u is the comprehensive utilization rate of resources of the data center;
z is the total number of activated physical machines;
N i the load imbalance degree of the physical machine i;
n is the load imbalance degree of the data center;
equation 1:
equation 2:
equation 3:
equation 4:
1.2 load metric index
Equation 5:
equation 6:
1.3 evaluation function
Equation 10
Equation 11
Equation 10 defines the gene evaluation function.
Equation 11 defines a fitness function of the genetic algorithm.
The second step is that: solving model
The invention provides an improved genetic algorithm for solving the problem of cloud resource allocation. When the method is used for initializing the population, the virtual machines are divided into H groups by using a second adaptive algorithm (FirstFit), each group corresponds to one physical machine, and the effectiveness of the initial population is ensured. And a gene evaluation function is introduced to evaluate the load condition of each physical machine, and cross and variation are carried out on the basis of the evaluation function, so that the high efficiency of the algorithm is ensured. And finally, obtaining the virtual machine allocation scheme with the minimum physical machine activation number and the maximum resource utilization rate through iteration.
Step 1: problem coding
Firstly, 1 to M nonrepeating numbers are used for representing M virtual machines to be distributed, and N nonrepeating letters are used for representing N physical machines with the same resource capacity. The virtual machines are then divided into H groups, each group corresponding to a physical machine, using a first-time adaptation algorithm (FirstFit), as shown in fig. 3.
Step 1.1: an array is randomly generated containing integers that do not repeat from 1 to M. Each integer represents the label of a virtual machine, h =0 represents the position of the virtual machine arranged at the 0 th position in the array, T is an empty array for storing the physical machine for placing the virtual machine, and the integer i =1,1< = i < = N represents the label corresponding to the physical machine;
step 1.2: r j ={r j,1 ,r j,2 ,r j,3 ,r j,4 Denotes the resources requested by the virtual machine, r j,1 To r j,4 Respectively representing the sizes of a CPU, bandwidth, memory and a disk to be occupied by the virtual machine j;
step 1.3: according to a formula (1-3), dividing the virtual machines into H groups by using a first adaptive algorithm (FirstFit), wherein each group corresponds to one physical machine to obtain an effective solution T;
step 1.3.1: sequencing all the physical machines from small to large according to the residual resource capacity of the physical machines;
step 1.3.2: the priority of the sorted resources is from top to bottom: the CPU is sorted from small to large according to the residual capacity of the CPU, if the residual capacity of the CPU is the same, the CPU is sorted according to the residual capacity of the bandwidth, and the like.
Step 1.3.3: and selecting the h-th virtual machine to be placed according to the sequence, selecting the first physical machine meeting the resource requirement of the virtual machine for placement according to the formula (1-3) and the sequence of the physical machines, and activating a new physical machine when all activated physical machines cannot meet the requirement.
Step 1.3.4: letting h = h +1, when h is less than or equal to M-1, turning to step 1.3.3, otherwise, turning to step 1.3.5;
step 1.3.5: loading all physical machines T with virtual machines i And storing the data into an array T in sequence to obtain a valid solution.
Step 2: genetic algorithm solving
Step 2.1: initializing a population
The population initialization refers to that X unordered integer sequences from 1 to N are generated at one time in a genetic algorithm and represent X groups of virtual machines with different orders. The integer column is then divided into X valid solutions according to the encoding principle of step 1.
Step 2.2: crossing process
The invention redesigns the crossover operator, utilizes the gene evaluation function, ensures feasible solution and realizes each task in filial generationValidity of intersection of sets. Randomly selecting the initial solution T generated in step 2.1 1 And T 2 Randomly generating a random number between 0 and 1, and if the random number is less than the variation probability G, performing a crossover operation.
The specific process is as follows:
the cross operation consists of four processes of evaluation selection, exchange, deletion and re-addition.
Step 2.2.1: gene evaluation selection and exchange process;
step 2.2.1.1: randomly selecting two parents, T, in the current population X 1 And T 2 ;
Step 2.2.1.2: from T 1 And T 2 According to gene evaluation functionSelecting two genes with the highest fitness value, namely a physical machine T loaded with a virtual machine 1,i And T 2,j And then the positions of the two genes are swapped. As shown in fig. 4.
Step 2.2.2: deletion process
Step 2.2.2.1: will newly obtain T 1 And T 2 The gene in (1) is related to T 1,i And T 2,j The duplicate virtual machine is deleted. As shown in fig. 5.
Step 2.2.3: addition process
Step 2.2.3.1: the virtual machines missing due to gene exchange are sorted according to the original placement sequence in the physical machine to obtain L 1 And L 2 Two array sequences;
step 2.2.3.2: using formulasCan accommodate L by calculation 1 (y) wherein y is an integer, L 1 (y) is of L 1 The y-th element in the array sequence;
step 2.2.3.3: using a formulaCalculating L 1 (y) after placement on each physical machine, the fitness value of that physical machine, the placement L is selected 1 (y) the physical machine with the maximum post-fitness value is taken as L 1 (y) final placement position, as shown in FIG. 6;
step 2.2.3.4: let y = y +1, judge the size of y, if y is less than or equal to | L 2 If the value is-1, the step 2.2.3.2 is carried out, otherwise, the step 2.2.3.5 is carried out;
step 2.2.3.5: l is 2 Adding process and L of missing virtual machine 1 The same procedure is used for addition.
Step 2.2.3.6: obtaining two offspring T 'after the addition process' 1 、T' 2 And is prepared from T' 1 、T' 2 Putting back the original population;
step 2.2.4: repeating for 2.2.1-2.2.3 times for X times;
step 2.2.5: and outputting 2X crossed offspring.
Step 2.3 mutation Process
The mutation process of the invention is for local fine tuning, so the mutation operator adopted by the invention firstly calculates the fitness value of each gene according to the formula (1-11), and finds the gene with the minimum fitness value as a mutation object. And (3) canceling the physical machine corresponding to the gene with the minimum fitness value, reallocating the virtual machines on the physical machine according to a first adaptation algorithm, and if the virtual machines are left, reactivating a new virtual machine, specifically as shown in fig. 7.
Step 2.3.1: let an integer e =0;
step 2.3.2: randomly selecting one individual from 2X individuals;
step 2.3.3: randomly generating a random number between 0 and 1, if the random number is less than the variation probability W, turning to step 2.3.4, otherwise, turning to step 2.3.2 by letting e = e + 1;
step 2.3.4: calculating the fitness value of each physical machine loaded with the virtual machine in the row solution by using the gene evaluation function (1-10);
step 2.3.5: selecting the gene with the minimum fitness value as a variant gene, and canceling the corresponding physical machine; step 2.3.6: reallocating the virtual machines on the physical machine according to a first adaptation (FirstFit) algorithm, and reapplying for a new physical machine if remaining virtual machines exist;
step 2.3.7: judging the size of e, if e is less than or equal to 2X-1, turning to the step 2.3.2, otherwise, turning to the step 2.3.8;
step 2.3.8: and outputting 2X variant individuals after the variation.
Step 2.4: selection process
The selection process selects a portion of individuals as parents for the next iteration by the fitness value. The fitness value is used for evaluating the degree of the individual quality, and the larger the fitness value is, the better the individual is. The fitness value in the invention comprehensively considers the number of activated physical machines and the utilization condition of resources, and is calculated according to a fitness function (1-11), and the method comprises the following specific steps:
step 2.4.1: randomly selecting two individuals from 2X variant individuals, respectively calculating the fitness values of the two individuals, selecting the individual with higher fitness to enter the next generation, and putting the two individuals back into a population consisting of 2X;
step 2.4.2: repeating the step 2.4.1 for X times, namely selecting X new individuals from the 2X individuals to perform the next iteration.
Step 2.5: and repeating for k times from 2.2 to 2.4, wherein k represents the maximum iteration algebra, and recording the individual with the maximum fitness function F in the k iterations as the final output distribution scheme.
The invention has the beneficial effects that:
according to the method, a mathematical model of cloud resource allocation is constructed, and then an improved genetic algorithm is designed to solve the mathematical model. The improvement of the genetic algorithm in the invention is mainly the improvement of the formation and cross mutation method and the evaluation function of the initial population. The algorithm is beneficial to realizing reasonable allocation of the virtual machines to minimize the number of the physical machines occupied by the virtual machines, and ensuring high resource utilization rate and load balance of each physical machine as far as possible.
Drawings
Fig. 1 is a schematic diagram of cloud computing resource allocation.
Figure 2 algorithm flow chart.
FIG. 3 shows a genetic algorithm coding scheme.
The evaluation selection and exchange process in the crossover operator of fig. 4.
The deletion process in the crossover operator of fig. 5.
FIG. 6 Add-back procedure in crossover operator
FIG. 7 is a schematic diagram of a mutation operator.
Detailed Description
The invention will be further explained with reference to the drawings.
The method is characterized in that 500 physical machines form a data center, 10000MIPS CPUs, 50GB memories, 1TB memories and 10G bandwidths are set for performance testing of an algorithm, and the performance of all the physical machines is the same. The number M of the physical machines to be distributed is 100, and the physical machines respectively apply for four types of resources including a CPU, an internal memory, a bandwidth and a disk; there are four types of virtual machines each, and as shown in table 1, there are 25 virtual machines of each type.
TABLE 1 virtual machine parameter information Table
Step 1: problem coding
Firstly, 1 to 100 nonrepeating numbers are used for representing 100 virtual machines to be allocated, and N nonrepeating letters are used for representing N physical machines with the same resource capacity. The virtual machines are then divided into H groups, each group corresponding to a physical machine, using a first-time adaptation algorithm (FirstFit), as shown in fig. 3.
Step 1.1: an array containing integers not repeating from 1 to 100 is randomly generated. Each integer represents the label of a virtual machine, h =0 represents the position of the virtual machine arranged at the 0 th position in the array, T is an empty array for storing the physical machine for placing the virtual machine, and the integer i =1,1< = i < = N represents the label corresponding to the physical machine;
step 1.2: r is j ={r j,1 ,r j,2 ,r j,3 ,r j,4 Denotes the resources requested by the virtual machine, r j,1 To r j,4 Respectively representThe size of the CPU, bandwidth, memory and disk to be occupied by the virtual machine j;
step 1.3: according to a formula (1-3), dividing the virtual machines into H groups by using a first adaptive algorithm (FirstFit), wherein each group corresponds to one physical machine to obtain an effective solution T;
step 1.3.1: sequencing all the physical machines from small to large according to the residual resource capacity of the physical machines;
step 1.3.2: the priority of the sorted resources is from top to bottom: the CPU is sorted from small to large according to the residual capacity of the CPU, if the residual capacity of the CPU is the same, the CPU is sorted according to the residual capacity of the bandwidth, and the like.
Step 1.3.3: and selecting the h-th virtual machine to be placed according to the sequence, selecting the first physical machine meeting the resource requirement of the virtual machine for placement according to the formula (1-3) and the sequence of the physical machines, and activating a new physical machine when all activated physical machines cannot meet the requirement.
Step 1.3.4: letting h = h +1, when h is less than or equal to M-1, turning to step 1.3.3, otherwise, turning to step 1.3.5;
step 1.3.5: loading all physical machines T with virtual machines i And storing the data into an array T in sequence to obtain a valid solution.
And 2, step: genetic algorithm solving
Step 2.1: initializing a population
Population initialization refers to generating X unordered integer sequences from 1 to 100 at a time in the genetic algorithm, where X is 50 in this example, representing 50 sets of sequentially different virtual machines. The integer column is then divided into 50 valid solutions according to the encoding principle of step 1.
Step 2.2: crossing process
The invention redesigns a crossover operator, utilizes a gene evaluation function, ensures feasible solution and realizes the effectiveness of crossover of each task set in filial generation. Randomly select the initial solution T generated in step 2.1 1 And T 2 Randomly generating a random number between 0 and 1, and if the random number is less than the variation probability G, wherein G is 0.85, performing a crossover operation.
The specific process is as follows:
the crossover operator consists of four processes of evaluation selection, exchange, deletion and re-addition.
Step 2.2.1: gene evaluation selection and crossover processes;
step 2.2.1.1: randomly selecting two parents, T, in the current population X 1 And T 2 ;
Step 2.2.1.2: from T 1 And T 2 According to gene evaluation functionSelecting two genes with the highest fitness value, namely the physical machine T loaded with the virtual machine 1,i And T 2,j Then the positions of the two genes are swapped. As shown in fig. 4.
Step 2.2.2: deletion process
Step 2.2.2.1: will newly obtain T 1 And T 2 The gene in (1) is related to T 1,i And T 2,j The duplicate virtual machine is deleted. As shown in fig. 5.
Step 2.2.3: addition process
Step 2.2.3.1: the virtual machines missing due to gene exchange are sorted according to the original placement sequence in the physical machine to obtain L 1 And L 2 Two array sequences;
step 2.2.3.2: using formulasCompute containable L 1 (y) wherein y is an integer, L 1 (y) is of L 1 The y-th element in the array sequence;
step 2.2.3.3: using a formulaCalculating L 1 (y) after placement on each physical machine, the fitness value of that physical machine, selecting placement L 1 (y) the physical machine with the maximum post-fitness value is taken as L 1 (y) final placement position, as shown6 is shown in the specification;
step 2.2.3.4: let y = y +1, judge the size of y, if y is less than or equal to | L 2 If the value is-1, the step 2.2.3.2 is carried out, otherwise, the step 2.2.3.5 is carried out;
step 2.2.3.5: l is a radical of an alcohol 2 Adding process and L of missing virtual machine 1 The addition process of (a) is the same.
Step 2.2.3.6: obtaining two offspring T 'after the addition process' 1 、T' 2 And is prepared from T' 1 、T' 2 Putting back the original population;
step 2.2.4: repeating for 50 times 2.2.1-2.2.3;
step 2.2.5: and outputting 100 crossed offspring.
Step 2.3 mutation Process
The mutation process of the invention is for local fine tuning, so the mutation operator adopted by the invention calculates the fitness value of each gene according to the formula (1-11) and finds the gene with the minimum fitness value as a mutation object. Canceling the physical machine corresponding to the gene with the minimum fitness value, reallocating the virtual machines on the physical machine according to a first adaptation algorithm, and if the virtual machines are remained, reactivating a new virtual machine, specifically as shown in fig. 7.
Step 2.3.1: let an integer e =0;
step 2.3.2: randomly selecting one individual from 100 individuals;
step 2.3.3: randomly generating a random number between 0 and 1, if the random number is less than the variation probability W, wherein W =0.03, then going to step 2.3.4, otherwise, letting e = e +1, going to step 2.3.2;
step 2.3.4: calculating the fitness value of each physical machine loaded with the virtual machine in the line solution by using a gene evaluation function (1-10);
step 2.3.5: selecting the gene with the minimum fitness value as a variant gene, and canceling the corresponding physical machine; step 2.3.6: reallocating the virtual machines on the physical machine according to a first adaptation (FirstFit) algorithm, and reapplying for a new physical machine if remaining virtual machines exist;
step 2.3.7: judging the size of e, if e is less than or equal to 2X-1, turning to the step 2.3.2, otherwise, turning to the step 2.3.8;
step 2.3.8: and outputting 100 mutated individuals.
Step 2.4: selection process
The selection process selects a portion of the individuals as parents for the next iteration by the fitness value. The fitness value is used for evaluating the degree of the individual quality, and the larger the fitness value is, the better the individual is. The fitness value in the invention comprehensively considers the number of activated physical machines and the utilization condition of resources, and is calculated according to a fitness function (1-11), and the method comprises the following specific steps:
step 2.4.1: randomly selecting 2 individuals from 100 individuals subjected to the variation process, respectively calculating the fitness values of the two individuals, selecting the individual with higher fitness to enter the next generation, and putting the two individuals back into a population consisting of 100;
step 2.4.2: repeat step 2.4.1 for 50 times, i.e. select 50 new individuals out of 100 for the next iteration.
Step 2.5: repeat 2.2-2.4 times for k times, k represents the maximum iteration number, in this example k =100, and record the individual with the maximum fitness function fmax in 100 iterations as the final output allocation scheme.
Through calculation, 100 virtual machines with four different types are obtained, and through calculation distribution of the algorithm, the final result is as follows: and 25 physical machines are activated together, the comprehensive utilization rate of resources is 60%, and the advantages are obvious compared with the traditional FFD algorithm.
Claims (3)
1. A cloud computing resource allocation method based on an improved genetic algorithm is characterized by comprising the following steps:
first, a model is established
The existing M virtual machines need to be mapped to N physical machines; dividing M virtual machines into H groups according to a first-time adaptive algorithm, wherein each group of virtual machines corresponds to one physical machine; when H is not equal to N, activating or closing the physical machine; the following are the variables in the model and the meanings they represent:
1.1 multidimensional resource model
P: is a set of physical machines, P = { P = } 1 ,p 2 ,…,p n N is the number of physical machines;
P i : denotes the ith physical machine, P i =0, 1, which is a binary variable, and is 1, which means that the physical machine i is activated, and 0 means that the physical machine i is in a sleep state;
C i : set of resource capacities provided by physical machines, C i ={c i,1 ,c i,2 ,...,c i,l I is more than or equal to 1 and less than or equal to n;
c i,l : the capacity of the I type of resources provided by the physical machine i is represented, and only 4 types of resources including a CPU, a memory, a bandwidth and a disk are considered, so that the maximum I is 4;
v: for a set of virtual machines, V = { V = 1 ,v 2 ,…,v m M is the number of virtual machines;
V ij :V ij 1, a binary variable, which represents that virtual machine j is placed on physical machine i, and is not present when it is 0;
R j : resource size set, R, of virtual machine requests j ={r j,1 ,r j,2 ,...,r j,l J is more than or equal to 1 and less than or equal to n;
r j,l : representing the size of the l-type resource requested by physical machine j;
u il : the utilization rate of l types of resources on a physical machine i, wherein i is more than or equal to 1 and less than or equal to n;
u i : average utilization rate of resources on the physical machine i;
u: the comprehensive utilization rate of resources of the data center;
z: total number of physical machines activated;
N i : the load imbalance degree of the physical machine i;
n: load imbalance of the data center;
equation 1:
equation 2:
equation 3:
equation 4:
formulas 1 and 2 show that the cloud computing resource allocation algorithm maximizes the resource utilization rate for minimizing the number of activated physical machines, so as to achieve the purpose of reducing energy consumption;
equation 3 indicates that the physical machine allocated resources do not exceed its capacity limit;
formula 4 indicates that each virtual machine can only be placed on a unique physical machine;
1.2 load metric index
Equation 5:
equation 6:
formula 7 comprehensive utilization of data center resources:
equation 8 resource load imbalance for physical machine i:
formula 9 is the overall load imbalance of the cloud data center:
formula 5 represents the utilization rate of the l-type resource on the physical machine i;
formula 6 represents the average resource utilization rate of the resources on the physical machine i;
formula 7 represents the comprehensive utilization rate of the data center resources;
formula 8 defines the index of the internal resource load balancing measurement of a single physical machine;
formula 9 is used as a physical machine load balance measurement index of the data center;
1.3 evaluation function
Equation 10
Equation 11
Equation 10 defines a gene evaluation function;
formula 11 defines a fitness function of the genetic algorithm;
the second step is that: solving model
Step 1: problem coding
Firstly, 1 to M nonrepeating numbers are used for representing M virtual machines to be distributed, and N nonrepeating letters are used for representing N physical machines with the same resource capacity; then, dividing the virtual machines into H groups by using a first-time adaptive algorithm, wherein each group corresponds to one physical machine;
step 1.1: randomly generating an array containing integers which do not repeat from 1 to M; each integer represents the label of a virtual machine, h =0 represents the position of the virtual machine arranged at the 0 th position in the array, T is an empty array for storing the physical machine for placing the virtual machine, and the integer i =1,1< = i < = N represents the label corresponding to the physical machine;
step 1.2: r is j ={r j,1 ,r j,2 ,r j,3 ,r j,4 Denotes the resource requested by the virtual machine, r j,1 To r j,4 Respectively representing the sizes of a CPU, bandwidth, memory and a disk to be occupied by the virtual machine j;
step 1.3: according to a formula (1-3), dividing the virtual machines into H groups by using a first-time adaptive algorithm, wherein each group corresponds to one physical machine to obtain an effective solution T;
step 1.3.1: sequencing all the physical machines from small to large according to the residual resource capacity of the physical machines;
step 1.3.2: the priority of the sorted resources is from top to bottom: the CPU is sorted from small to large according to the residual capacity of the CPU, if the residual capacity of the CPU is the same, the CPU is sorted according to the residual capacity of the bandwidth, and the like;
step 1.3.3: sequentially selecting the h-th virtual machine to be placed, selecting the first physical machine meeting the resource requirement of the virtual machine for placement according to the sequence of the physical machines and the formula (1-3), and activating a new physical machine when all activated physical machines cannot meet the requirement;
step 1.3.4: making h = h +1, when h is less than or equal to M-1, turning to step 1.3.3, otherwise, turning to step 1.3.5;
step 1.3.5: loading all physical machines T with virtual machines i Storing the data into an array T in sequence to obtain an effective solution;
step 2: genetic algorithm solving
Step 2.1: initializing a population
The population initialization refers to that X unordered integer sequences from 1 to N are generated at one time in a genetic algorithm and represent X groups of virtual machines with different sequences; dividing the integer column into X effective solutions according to the encoding principle of the step 1;
step 2.2: crossing process
Randomly selecting the initial solution T generated in step 2.1 1 And T 2 Randomly generating a random number between 0 and 1, and if the random number is less than the variation probability G, performing cross operation;
step 2.3 mutation Process
The mutation operator is used for calculating the adaptability value of each gene according to a formula (1-11) and finding the gene with the minimum adaptability value as a mutation object;
step 2.3.1: let an integer e =0;
step 2.3.2: randomly selecting one individual from 2X individuals;
step 2.3.3: randomly generating a random number between 0 and 1, if the random number is less than the variation probability W, turning to step 2.3.4, otherwise, turning to step 2.3.2 by letting e = e + 1;
step 2.3.4: calculating the fitness value of each physical machine loaded with the virtual machine in the row solution by using the gene evaluation function (1-10);
step 2.3.5: selecting the gene with the minimum fitness value as a variant gene, and canceling the corresponding physical machine;
step 2.3.6: redistributing the virtual machines on the physical machine according to the first adaptive FirstFit algorithm, and reapplying a new physical machine if residual virtual machines exist;
step 2.3.7: judging the size of e, if e is less than or equal to 2X-1, turning to the step 2.3.2, otherwise, turning to the step 2.3.8;
step 2.3.8: outputting 2X variant individuals after the variation;
step 2.4: selection process
In the selection process, part of individuals are selected as parents of the next iteration through the fitness value; the fitness value is used for evaluating the degree of the individual, and the larger the fitness value is, the better the individual is;
step 2.5: and repeating the steps of 2.2 to 2.4 for k times, wherein k represents the maximum iteration algebra, and recording the individual with the maximum fitness function F in the k iterations as the final output distribution scheme.
2. The method for allocating cloud computing resources based on improved genetic algorithm as claimed in claim 1, wherein in step 2.2, the crossover operation is composed of four processes of evaluation selection, exchange, deletion and re-addition;
step 2.2.1: gene evaluation selection and crossover processes;
step 2.2.1.1: randomly selecting two parents, T, in the current population X 1 And T 2 ;
Step 2.2.1.2: from T 1 And T 2 According to gene evaluation functionSelecting two genes with the highest fitness value, namely a physical machine T loaded with a virtual machine 1,i And T 2,j Then exchanging the positions of the two genes;
step 2.2.2: deletion process
Step 2.2.2.1: will newly obtain T 1 And T 2 The gene in (1) is related to T 1,i And T 2,j Deleting repeated virtual machines;
step 2.2.3: addition process
Step 2.2.3.1: the virtual machines missing due to gene exchange are sorted according to the original placement sequence in the physical machine to obtain L 1 And L 2 Two array sequences;
step 2.2.3.2: using formulasCan accommodate L by calculation 1 (y) a physical machine, wherein y is an integer, L 1 (y) is of L 1 The y element in the array sequence;
step 2.2.3.3: using a formulaCalculating L 1 (y) after placement on each physical machine, the fitness value of that physical machine, the placement L is selected 1 (y) physics with maximum post-fitness valueMachine as L 1 (y) a final placement position;
step 2.2.3.4: let y = y +1, judge the size of y, if y is less than or equal to | L 2 If the value is-1, the step 2.2.3.2 is carried out, otherwise, the step 2.2.3.5 is carried out;
step 2.2.3.5: l is 2 Adding process and L of missing virtual machine 1 The adding process of (2) is the same;
step 2.2.3.6: obtaining two offspring T 'after the addition process' 1 、T' 2 And is prepared from T' 1 、T' 2 Putting back the original population;
step 2.2.4: repeating for 2.2.1-2.2.3 times for X times;
step 2.2.5: and outputting 2X crossed filial generations.
3. The method for allocating cloud computing resources based on the improved genetic algorithm as claimed in claim 1 or 2, wherein in the step 2.4, the selection process comprises the following specific steps:
step 2.4.1: randomly selecting two individuals from 2X variant individuals, respectively calculating the fitness values of the two individuals, selecting the individual with higher fitness to enter the next generation, and putting the two individuals back into a population consisting of 2X;
step 2.4.2: repeat step 2.4.1X times, i.e. select X new individuals from 2X individuals for the next iteration.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910566370.4A CN110308993B (en) | 2019-06-27 | 2019-06-27 | Cloud computing resource allocation method based on improved genetic algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910566370.4A CN110308993B (en) | 2019-06-27 | 2019-06-27 | Cloud computing resource allocation method based on improved genetic algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110308993A CN110308993A (en) | 2019-10-08 |
CN110308993B true CN110308993B (en) | 2022-12-13 |
Family
ID=68076816
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910566370.4A Active CN110308993B (en) | 2019-06-27 | 2019-06-27 | Cloud computing resource allocation method based on improved genetic algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110308993B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111488052B (en) * | 2020-04-16 | 2022-03-08 | 中国工商银行股份有限公司 | Container enabling method and device applied to physical machine cluster and computer system |
CN113094149B (en) * | 2021-03-12 | 2024-01-12 | 西安交通大学 | Data center virtual machine placement method, system, medium and equipment |
CN113595622B (en) * | 2021-09-29 | 2022-01-18 | 南京航空航天大学 | Digital twin-based cluster collaborative search virtual-real combined verification method |
CN116974744B (en) * | 2023-03-14 | 2024-05-17 | 福州创星通信息科技有限公司 | Interactive control system and interactive control method for shared space |
CN116991545B (en) * | 2023-09-28 | 2024-02-09 | 中航国际金网(北京)科技有限公司 | Virtual machine deployment position determining method and device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN106484512A (en) * | 2016-10-08 | 2017-03-08 | 电子科技大学 | The dispatching method of computing unit |
WO2018015779A1 (en) * | 2016-07-20 | 2018-01-25 | Worldline | Multi-criteria adaptive scheduling for a market-oriented hybrid cloud infrastructure |
CN108762892A (en) * | 2018-06-07 | 2018-11-06 | 北京仿真中心 | A kind of resource allocation method of cloud emulation collaborative simulation pattern |
CN108804227A (en) * | 2018-05-23 | 2018-11-13 | 大连理工大学 | The method of the unloading of computation-intensive task and best resource configuration based on mobile cloud computing |
CN108897600A (en) * | 2018-06-14 | 2018-11-27 | 郑州云海信息技术有限公司 | A kind of virtual machine placement method under cloud computing environment |
CN109447264A (en) * | 2018-09-17 | 2019-03-08 | 浙江工业大学 | Virtual machine under cloud computing environment based on VHAM-R model places genetic optimization method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8434088B2 (en) * | 2010-02-18 | 2013-04-30 | International Business Machines Corporation | Optimized capacity planning |
-
2019
- 2019-06-27 CN CN201910566370.4A patent/CN110308993B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
WO2018015779A1 (en) * | 2016-07-20 | 2018-01-25 | Worldline | Multi-criteria adaptive scheduling for a market-oriented hybrid cloud infrastructure |
CN106484512A (en) * | 2016-10-08 | 2017-03-08 | 电子科技大学 | The dispatching method of computing unit |
CN108804227A (en) * | 2018-05-23 | 2018-11-13 | 大连理工大学 | The method of the unloading of computation-intensive task and best resource configuration based on mobile cloud computing |
CN108762892A (en) * | 2018-06-07 | 2018-11-06 | 北京仿真中心 | A kind of resource allocation method of cloud emulation collaborative simulation pattern |
CN108897600A (en) * | 2018-06-14 | 2018-11-27 | 郑州云海信息技术有限公司 | A kind of virtual machine placement method under cloud computing environment |
CN109447264A (en) * | 2018-09-17 | 2019-03-08 | 浙江工业大学 | Virtual machine under cloud computing environment based on VHAM-R model places genetic optimization method |
Non-Patent Citations (4)
Title |
---|
A Virtual Machine Scheduling Strategy based on Grouping Genetic Algorithm in Cloud Environment;Gang Jin等;《Applied Mechanics and Materials》;20130903;第203-206页 * |
FUGE:A joint meta-heuristic approach to cloud job scheduling algorithm using fuzzy theory and a genetic method;Shojafar,M.等;《Cluster Computing》;20150115;第829-844页 * |
一种基于遗传算法的低能耗云计算数据中心资源调度策略;张艳璐;《中国优秀硕士学位论文全文数据库(电子期刊)》;20151015(第10期);第I137-7页 * |
基于改进遗传算法的虚拟机初始化部署算法研究;胡苗苗;《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》;20190315(第3期);第I137-15页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110308993A (en) | 2019-10-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110308993B (en) | Cloud computing resource allocation method based on improved genetic algorithm | |
Ponnambalam et al. | A multi-objective genetic algorithm for solving assembly line balancing problem | |
CN102063339B (en) | Resource load balancing method and equipment based on cloud computing system | |
CN104618269B (en) | Cloud system utilization rate maximum resource distribution method based on horsepower requirements | |
CN109522104B (en) | Method for optimizing scheduling of two target tasks of Iaas by using differential evolution algorithm | |
CN102985909B (en) | Object for good lattice provides the method and apparatus of the high scalability network storage | |
CN109447264B (en) | Virtual machine placement genetic optimization method based on VHAM-R model in cloud computing environment | |
CN103106253B (en) | A kind of data balancing method based on genetic algorithm in MapReduce computation model | |
CN107133091A (en) | The cloud workflow task dispatching method being classified based on top-down task | |
CN109840154A (en) | A kind of computation migration method that task based access control relies under mobile cloud environment | |
CN111176784B (en) | Virtual machine integration method based on extreme learning machine and ant colony system | |
CN107506145A (en) | A kind of physical store dispatching method and cloud main frame creation method | |
CN108418858A (en) | A kind of data copy laying method towards Geo-distributed cloud storages | |
CN106775987A (en) | A kind of dispatching method of virtual machine for improving resource efficiency safely in IaaS cloud | |
CN105681052A (en) | Energy-saving method for data center distributed file storage | |
CN104580518A (en) | Load balance control method used for storage system | |
CN106547854A (en) | Distributed file system storage optimization power-economizing method based on greedy glowworm swarm algorithm | |
Kaur et al. | Latency and network aware placement for cloud-native 5G/6G services | |
CN106453611A (en) | A method and apparatus for load balancing at a plurality of storage nodes | |
CN108846480A (en) | A kind of one-dimensional nesting method of more specifications and device based on genetic algorithm | |
Al Jadaan et al. | Enhancing data selection using genetic algorithm | |
Chen et al. | A cost minimization data allocation algorithm for dynamic datacenter resizing | |
CN110321208B (en) | Evolutionary computing method for solving cloud task scheduling | |
CN115981843A (en) | Task scheduling method and device in cloud-edge cooperative power system and computer equipment | |
CN108256694A (en) | Based on Fuzzy time sequence forecasting system, the method and device for repeating genetic algorithm |
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 |