Deployment method, device and equipment of virtual machine and computer readable storage medium

文档序号:7313 发布日期:2021-09-17 浏览:123次 中文

1. A deployment method of a virtual machine is characterized by comprising the following steps:

setting an affinity function and a constraint condition, and taking the affinity function and the constraint condition as antigens;

setting a mapping relation between a virtual machine and a physical host, and taking the mapping relation as an antibody;

calculating the affinity of the antibody to the antigen;

selecting the antibody with the highest affinity from the antibodies;

evolving the antibody with the highest affinity and immunizing the antibody with the highest affinity until the affinity of the evolved antibody and the antigen converges;

deploying the virtual machine according to the mapping relation corresponding to the antibody when the affinity converges;

evolving the antibody comprises:

adjusting the crossing rate and the variation rate according to a preset fuzzy subset;

and evolving the antibody according to the adjusted cross rate and the adjusted variation rate.

2. The deployment method of claim 1, wherein setting the mapping relationship between the virtual machine and the physical host comprises:

and setting mapping relations between the virtual machines and the physical hosts, wherein the number of the mapping relations is a preset number, and the mapping relations meet the condition that the physical hosts do not have resource over-allocation under the mapping relations.

3. The deployment method of claim 1 wherein the calculating the affinity of the antibody to the antigen comprises:

calculating the utilization rate of the target resource of the physical host under the mapping relation corresponding to the antibody;

obtaining the load of the physical host according to the utilization rate of the target resource;

calculating the mean value of the loads of the physical hosts, and calculating the Euclidean distance between the loads of the physical hosts and the mean value;

and taking the inverse of the Euclidean distance to obtain the affinity of the antibody and the antigen.

4. The deployment method of claim 3 wherein the target resource comprises: CPU, internal memory and hard disk.

5. The deployment method according to claim 3, wherein the constraint condition is that the utilization rate of the target resource of the physical host is within a preset interval.

6. The deployment method of claim 1, wherein vaccinating the antibody comprises:

mutating the antibody to obtain a new antibody, and calculating the difference of the affinity of the new antibody and the antibody;

obtaining the probability of replacing the antibody by the new antibody according to the affinity difference and the annealing factor;

replacing the antibody with the new antibody according to the probability.

7. The deployment method of claim 6, wherein the deriving the probability that the new antibody replaces the antibody based on the affinity difference and an annealing factor comprises:

according to the formulaObtaining the probability that the new antibody replaces the antibody;

where Tg represents the annealing factor, ∇ L represents the difference in affinity, and P represents the probability of replacement of the antibody by the new antibody.

8. An apparatus for deploying a virtual machine, comprising:

the first setting module is used for setting an affinity function and a constraint condition and taking the affinity function and the constraint condition as antigens;

the second setting module is used for setting the mapping relation between the virtual machine and the physical host, and taking the mapping relation as an antibody;

a calculation module for calculating the affinity of the antibody to the antigen;

a selection module for selecting the antibody with the highest affinity from the antibodies;

the evolution and immunization module is used for evolving the antibody with the highest affinity and performing vaccination on the antibody with the highest affinity until the affinity of the antibody and the antigen after evolution is converged;

the deployment module is used for deploying the virtual machine according to the mapping relation corresponding to the antibody when the affinity converges;

evolving the antibody comprises:

adjusting the crossing rate and the variation rate according to a preset fuzzy subset;

and evolving the antibody according to the adjusted cross rate and the adjusted variation rate.

9. A deployment apparatus of a virtual machine, comprising:

a memory for storing a computer program;

a processor for implementing the steps of the deployment method of a virtual machine according to any one of claims 1 to 7 when executing said computer program.

10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the deployment method of virtual machines according to any one of claims 1 to 7.

Background

The cloud data center widely uses a virtualization technology to realize the allocation of resources of a single physical host to a plurality of virtual machines, so that the resource utilization rate is improved, and the operation and maintenance cost is reduced. How to reasonably, uniformly and massively deploy virtual machines becomes an important task in the operation and maintenance process of the cloud computing platform. Currently, the method for determining the optimal allocation strategy for deploying virtual machines in batches on a physical host mainly is a judgment method based on a resource threshold and a partial heuristic intelligent algorithm. Although the methods can determine one or more allocation strategies for deploying virtual machines to the physical host in batches, the methods cannot guarantee reasonable utilization and load balance of resources in the cloud computing platform.

Therefore, providing a scheme for deploying virtual machines in batches that enables optimal load balancing among physical hosts has become an urgent technical problem to be solved by those skilled in the art.

Disclosure of Invention

The application aims to provide a deployment method of virtual machines, which can realize rapid batch deployment of the virtual machines and achieve optimal load balance among physical hosts. Another object of the present application is to provide a deployment apparatus, a device and a computer-readable storage medium for a virtual machine, all of which have the above technical effects.

In order to solve the above technical problem, the present application provides a deployment method of a virtual machine, including:

setting an affinity function and a constraint condition, and taking the affinity function and the constraint condition as antigens;

setting a mapping relation between a virtual machine and a physical host, and taking the mapping relation as an antibody;

calculating the affinity of the antibody to the antigen;

selecting the antibody with the highest affinity from the antibodies;

evolving the antibody with the highest affinity and immunizing the antibody with the highest affinity until the affinity of the evolved antibody and the antigen converges;

deploying the virtual machine according to the mapping relation corresponding to the antibody when the affinity converges;

evolving the antibody comprises:

adjusting the crossing rate and the variation rate according to a preset fuzzy subset;

and evolving the antibody according to the adjusted cross rate and the adjusted variation rate.

Optionally, setting a mapping relationship between the virtual machine and the physical host includes:

and setting mapping relations between the virtual machines and the physical hosts, wherein the number of the mapping relations is a preset number, and the mapping relations meet the condition that the physical hosts do not have resource over-allocation under the mapping relations.

Optionally, said calculating the affinity of said antibody to said antigen comprises:

calculating the utilization rate of the target resource of the physical host under the mapping relation corresponding to the antibody;

obtaining the load of the physical host according to the utilization rate of the target resource;

calculating the mean value of the loads of the physical hosts, and calculating the Euclidean distance between the loads of the physical hosts and the mean value;

and taking the inverse of the Euclidean distance to obtain the affinity of the antibody and the antigen.

Optionally, the target resource includes: CPU, internal memory and hard disk.

Optionally, the constraint condition is that the utilization rate of the target resource of the physical host is in a preset interval.

Optionally, vaccinating the antibody comprises:

mutating the antibody to obtain a new antibody, and calculating the difference of the affinity of the new antibody and the antibody;

obtaining the probability of replacing the antibody by the new antibody according to the affinity difference and the annealing factor;

replacing the antibody with the new antibody according to the probability.

Optionally, the obtaining the probability that the new antibody replaces the antibody according to the affinity difference and the annealing factor includes:

according to the formulaObtaining the probability that the new antibody replaces the antibody;

where Tg represents the annealing factor, ∇ L represents the difference in affinity, and P represents the probability of replacement of the antibody by the new antibody.

In order to solve the above technical problem, the present application further provides a deployment apparatus of a virtual machine, including:

the first setting module is used for setting an affinity function and a constraint condition and taking the affinity function and the constraint condition as antigens;

the second setting module is used for setting the mapping relation between the virtual machine and the physical host, and taking the mapping relation as an antibody;

a calculation module for calculating the affinity of the antibody to the antigen;

a selection module for selecting the antibody with the highest affinity from the antibodies;

the evolution and immunization module is used for evolving the antibody with the highest affinity and performing vaccination on the antibody with the highest affinity until the affinity of the antibody and the antigen after evolution is converged;

the deployment module is used for deploying the virtual machine according to the mapping relation corresponding to the antibody when the affinity converges;

evolving the antibody comprises:

adjusting the crossing rate and the variation rate according to a preset fuzzy subset;

and evolving the antibody according to the adjusted cross rate and the adjusted variation rate.

In order to solve the above technical problem, the present application further provides a deployment device of a virtual machine, including:

a memory for storing a computer program;

a processor for implementing the steps of the deployment method of the virtual machine as described in any one of the above when the computer program is executed.

In order to solve the above technical problem, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the deployment method of the virtual machine according to any one of the above items.

The deployment method of the virtual machine provided by the application comprises the following steps: setting an affinity function and a constraint condition, and taking the affinity function and the constraint condition as antigens; setting a mapping relation between a virtual machine and a physical host, and taking the mapping relation as an antibody; calculating the affinity of the antibody to the antigen; selecting the antibody with the highest affinity from the antibodies; evolving the antibody with the highest affinity and immunizing the antibody with the highest affinity until the affinity of the evolved antibody and the antigen converges; deploying the virtual machine according to the mapping relation corresponding to the antibody when the affinity converges; evolving the antibody comprises: adjusting the crossing rate and the variation rate according to a preset fuzzy subset; and evolving the antibody according to the adjusted cross rate and the adjusted variation rate.

Therefore, the deployment method of the virtual machine provided by the application is based on an artificial immune algorithm, abstracts the problem of deploying the virtual machines in batches into an optimization problem for determining the mapping relationship between the virtual machines and the physical host, takes the physical host reaching the most balanced load as an optimization target, and obtains the optimal solution of the mapping relationship by setting and transforming the mapping relationship between the virtual machines and the physical host, so as to obtain the optimal deployment mode of the virtual machine. By the deployment method, the virtual machines can be rapidly deployed in batches, meanwhile, the optimal load balance among the physical hosts can be achieved, and the cloud computing platform can operate in a state of better load balance and better resource utilization rate after deployment is completed. Meanwhile, the deployment method introduces a fuzzy reasoning theory into the artificial immunization process, and realizes the intelligent self-adaptive determination of the crossing rate and the variation rate of the immunization process.

The deployment device, the equipment and the computer-readable storage medium of the virtual machine have the technical effects.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the prior art and the embodiments are briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.

Fig. 1 is a schematic flowchart of a deployment method of a virtual machine according to an embodiment of the present application;

FIG. 2 is a schematic diagram of a membership function provided in an embodiment of the present application;

FIG. 3 is a schematic diagram of another membership function provided in an embodiment of the present application;

fig. 4 is a schematic diagram of a deployment apparatus of a virtual machine according to an embodiment of the present disclosure;

fig. 5 is a schematic diagram of a deployment device of a virtual machine according to an embodiment of the present application.

Detailed Description

The core of the application is to provide a deployment method of virtual machines, which can realize rapid batch deployment of the virtual machines and achieve optimal load balance among physical hosts. Another core of the present application is to provide a deployment apparatus, a device and a computer-readable storage medium for a virtual machine, all having the above technical effects.

In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for deploying a virtual machine according to an embodiment of the present application, and referring to fig. 1, the method mainly includes:

s101: setting an affinity function and a constraint condition, and taking the affinity function and the constraint condition as antigens;

s102: setting a mapping relation between a virtual machine and a physical host, and taking the mapping relation as an antibody;

specifically, the problem of deploying virtual machines in batches is abstracted to the problem of determining the mapping relation between the virtual machines and the physical host based on an artificial immune algorithm, so that an antigen and an antibody are firstly set. Antigens include affinity functions and constraints. The mapping relation between the antibody, namely the virtual machine and the physical host. Setting an initial mapping relation between the plurality of virtual machines and the plurality of physical hosts, namely setting an initial antibody group. And then determining the optimal mapping relation by executing the subsequent steps. The optimal mapping relation means that when the physical hosts deploy the virtual machines according to the mapping relation, optimal load balance can be achieved among the physical hosts.

The mapping relationship between the virtual machine and the physical host can be abstracted into a coded antibody. The structure of an antibody is a chain consisting of an array of various amino acids. The position number of the amino acid is used for representing the number of the virtual machine to be deployed, and the types of the amino acid at each position represent different physical hosts. Therefore, an antibody represents a virtual machine deployment scheme, i.e. a mapping relationship between a virtual machine and a physical host. Assuming that a certain cloud computing platform initially has M physical hosts and N virtual machines need to be deployed on the physical hosts, the obtained antibody adopting the above coding method is:

indicating that the Nth virtual machine is mapped in the NthA physical host.

In a specific embodiment, the manner of setting the mapping relationship between the virtual machine and the physical host is as follows: and setting mapping relations between the virtual machines and the physical hosts, wherein the number of the mapping relations is a preset number, and the mapping relations meet the condition that the physical hosts do not have resource over-allocation under the mapping relations.

Specifically, the N virtual machines are deployed on the M physical hosts to share M without considering the resource limitationNA deployment approach, namely MNThe mapping relation is MNA seed antibody. But the resources of the physical host are limited and have an optimal usage. Thus, first, a Random function in the Java language can be used to select [1, M ] for each position of the antibody in turn]Obtaining initial antibody groups by using the integers, namely obtaining initial mapping relations. And then judging whether the physical host under the mapping relations has the resource over-matching condition or not, and eliminating the mapping relations with the resource over-matching, namely eliminating invalid antibodies from the antibody group. Meanwhile, if the number of the mapping relationships is too large, the convergence speed is too low, and if the number of the mapping relationships is too small, the optimal solution cannot be obtained. For example, the preset number may be 30.

S103: calculating the affinity of the antibody to the antigen;

specifically, the present application abstracts the deployment problem of virtual machines to determine an optimal solution problem with constraints. And determining an affinity function and a constraint condition in advance, and calculating the affinity of each antibody according to the affinity function under the constraint condition on the basis of setting the mapping relationship between the virtual machine and the physical host, so as to obtain the load balance value of the physical host under each mapping relationship. The load balancing value reflects the load balancing condition among the physical hosts under a certain mapping relation.

In a specific embodiment, said calculating the affinity of said antibody to said antigen comprises:

calculating the utilization rate of the target resource of the physical host under the mapping relation corresponding to the antibody;

obtaining the load of the physical host according to the utilization rate of the target resource;

calculating the mean value of the loads of the physical hosts, and calculating the Euclidean distance between the loads of the physical hosts and the mean value;

and taking the inverse of the Euclidean distance to obtain the affinity of the antibody and the antigen.

Wherein the target resource comprises: CPU, internal memory and hard disk.

Specifically, because the optimal way to deploy virtual machines in batches is to achieve the optimal balance of loads among the physical hosts after the deployment is completed, the embodiment focuses on the CPU, the memory, and the hard disk of the physical host, and the load of the physical host is defined as follows:

(1)

wherein d is 3, thenWhich are used for respectively representing the CPU, the memory and the hard disk of the physical host M. Us denotes the usage of s resources. For example, when s takes the value 1, U1Indicating the utilization of the CPU of the physical host M.

For each mapping relationship between the virtual machine and the physical host, the utilization rate of each resource of each physical host in the mapping relationship can be obtained correspondingly, and then the load of each physical host in the mapping relationship can be obtained according to the above formula.Representing the load of the physical host M.

Load balancing between physical hosts is measured using euclidean distance as shown below:

(2)

wherein the content of the first and second substances,is the average of the load of each physical host.

The affinity function is:(3)

for each mapping relationship, after the load of each physical host is obtained based on the formula (1), the load balance value of the physical host under the mapping relationship can be further obtained based on the formulas (2) and (3), that is, the affinity of the antibody is obtained.

Further, the constraint condition may be that the usage rate of the target resource of the physical host is in a preset interval. For example, the preset interval is [0,0.9 ]]Then the constraint condition is

S104: selecting the antibody with the highest affinity from the antibodies;

specifically, after the load balance value of the physical host under each mapping relation is calculated, the antibody with the highest affinity can be selected from the antibody by adopting a strategy of combining elite selection and roulette selection, and the antibody is stored in the memory unit library.

S105: evolving the antibody with the highest affinity and immunizing the antibody with the highest affinity until the affinity of the evolved antibody and the antigen converges;

s106: and deploying a virtual machine according to the mapping relation corresponding to the antibody when the affinity converges.

Specifically, evolving the antibody means that a mapping relation is transformed, and after each evolution and immunization, the affinity of the antibody is calculated until the affinity of the antibody is converged, so that the mapping relation corresponding to the antibody when the affinity is converged is used as a final mapping relation, the final mapping relation is packaged into parameters in a Json format, then a script for automatically deploying the virtual machines uses the parameters in the Json format to distribute tasks to each physical host, so that each physical host sequentially creates and deploys the distributed virtual machines, and finally the batch deployment of the virtual machines is rapidly completed.

Wherein, in a specific embodiment, the manner of evolving the antibody is:

adjusting the crossing rate and the variation rate according to a preset fuzzy subset;

and evolving the antibody according to the adjusted cross rate and the adjusted change rate.

In particular, in the artificial immunization algorithm, the crossing rate in the immunization process is generallyAnd rate of variationIs fixed and unchangeable. Thus, although the model of the artificial immune algorithm is relatively simple, the difference between the two values can seriously affect the whole immune process, for example, the great variability and the great leap of the crossover rate can influence the stability of the antibody evolution. Smaller variation and crossover rates do not mimic the diversity of the immunization process well. Therefore, the present embodiment adopts an adaptive method to determine the crossover rate and the variation rate in the immune process. Meanwhile, in consideration of the dynamics and uncertainty of the immune process, the fuzzy reasoning theory is introduced into the artificial immune process, and the cross rate and the variation rate of the immune process are intelligently and adaptively determined.

Specifically, use ofRepresenting the average affinity of the antibody of the g-th generation with the antigen, the difference of the average affinity of the antibodies of two consecutive generations can be used to represent the evolutionary effect of the antibody, namely:

(ii) a If it isIt means that the antibody is gradually developed toward a stronger immune effect, and it is suitable to increase the crossover rate and the mutation rate appropriately if the cross-over rate and the mutation rate are increasedIt represents the degradation of the antibody by generations, which may be caused by an excessively large cross-over rate and variation rate, and it is considered to appropriately reduce the cross-over rate and variation rate.

This embodiment uses nb (negative big), ns (negative small), ze (zero), ps (positive small), pb (positive big), and may define five fuzzy subsets on the domain ∇ l (g), with membership functions as shown in fig. 2.

At the same time, defineAndhas a variation value ofAndwhere NH (negative huge), NB (negative big), NS (negative small), ZE (zero), PS (positive small), PB (positive big) and PH (positive huge) are used to indicate "negative big", "negative small", "constant", "positive small", "positive big" and "positive big", it is also possible to define ∇ L (g) universe as seven fuzzy subsets, the membership functions of which are shown in FIG. 3,. Thus, the fuzzy inference rule in this embodiment can be as shown in table 1:

TABLE 1

It is understood that specific values of NB, NS, etc. may be set differently, and the present application is not limited thereto.

In a specific embodiment, the antibody is immunized by:

mutating the antibody to obtain a new antibody, and calculating the difference of the affinity of the new antibody and the antibody;

obtaining the probability of replacing the antibody by the new antibody according to the affinity difference and the annealing factor;

replacing the antibody with the new antibody according to the probability.

In particular, the present example utilizes simulated annealing to optimize the vaccination process. For each generation of antibody, the optimal antibody is selected from the candidate antibodies and the antibodies are immunized. The vaccination is to generate a new antibody N when a small-scale position exchange occurs on the chain in the antibody A, calculate the affinities (i.e. load balance values) of the two antibodies respectively as L (A) and L (N), the difference between the two is ∇ L, and determine the probability P of the antibody N replacing the antibody A according to Metropolis standard, as shown in the following formula:

(4)

wherein Tg represents an annealing factor and is a predetermined constant value. If ∇ L is greater than or equal to 0, then the memory cell is refreshed with antibody N instead of antibody A; if ∇ L <0, then the memory cell is updated with antibody N instead of antibody A with a probability of P, e.g., P is 1/3 and the probability of antibody N instead of antibody A is 1/3.

The fuzzy logic is introduced into the immune process, so that the cross rate and the variation rate can be dynamically adjusted. The introduction of simulated annealing and dynamic adjustment of the cross rate and the mutation rate can not only ensure the rapid convergence of the whole immune process, but also ensure the final obtaining of the optimal antibody, namely the optimal deployment scheme, and can effectively improve the efficiency and the performance.

After multiple times of vaccination, the affinity of the final antibody is converged, that is, the load balance value of the final physical host is converged, which indicates that even if the mapping relationship is changed again, the load balance value of the physical host does not have large difference, and the mapping relationship at this time is optimal. And (3) when the immunity is terminated, the antibody in the memory unit library is the optimal antibody, and the final mapping relation can be obtained by reversely encoding the antibody.

In summary, the deployment method of the virtual machine provided by the application is based on the artificial immune algorithm, abstracts the problem of deploying the virtual machines in batches into the optimization problem of determining the mapping relationship between the virtual machines and the physical host, takes the physical host achieving the most balanced load as the optimization target, and obtains the optimal solution of the mapping relationship by setting and transforming the mapping relationship between the virtual machines and the physical host, so as to obtain the optimal deployment mode of the virtual machine. By the deployment method, the virtual machines can be rapidly deployed in batches, meanwhile, the optimal load balance among the physical hosts can be achieved, and the cloud computing platform can operate in a state of better load balance and better resource utilization rate after deployment is completed.

The application also provides a deployment device of the virtual machine, and the device described below can be referred to with the method described above correspondingly. Referring to fig. 4, fig. 4 is a schematic diagram of a deployment apparatus of a virtual machine according to an embodiment of the present application, and referring to fig. 4, the deployment apparatus includes:

a first setting module 10, configured to set an affinity function and a constraint condition, and use the affinity function and the constraint condition as an antigen;

a second setting module 20, configured to set a mapping relationship between the virtual machine and the physical host, and use the mapping relationship as an antibody;

a calculation module 30 for calculating the affinity of the antibody to the antigen;

a selecting module 40 for selecting the antibody with the highest affinity from the antibodies;

an evolution and immunization module 50, configured to evolve the antibody with the highest affinity and immunize the antibody with the highest affinity until the affinity of the antibody with the antigen converges after the evolution;

a deployment module 60, configured to deploy the virtual machine according to the mapping relationship corresponding to the antibody when the affinity converges.

On the basis of the foregoing embodiment, optionally, the second setting module 20 is specifically configured to:

and setting mapping relations between the virtual machines and the physical hosts, wherein the number of the mapping relations is a preset number, and the mapping relations meet the condition that the physical hosts do not have resource over-allocation under the mapping relations.

On the basis of the foregoing embodiment, optionally, the calculating module 30 is specifically configured to:

calculating the utilization rate of the target resource of the physical host under the mapping relation corresponding to the antibody;

obtaining the load of the physical host according to the utilization rate of the target resource;

calculating the mean value of the loads of the physical hosts, and calculating the Euclidean distance between the loads of the physical hosts and the mean value;

and taking the inverse of the Euclidean distance to obtain the affinity of the antibody and the antigen.

On the basis of the foregoing embodiment, optionally, the target resource includes: CPU, internal memory and hard disk.

On the basis of the foregoing embodiment, optionally, the constraint condition is that the usage rate of the target resource of the physical host is in a preset interval.

On the basis of the above embodiment, optionally, the evolution and immunization module 50 is specifically configured to:

adjusting the crossing rate and the variation rate according to a preset fuzzy subset;

and evolving the antibody according to the adjusted cross rate and the adjusted change rate.

On the basis of the above embodiment, optionally, the evolution and immunization module 50 is specifically configured to:

mutating the antibody to obtain a new antibody, and calculating the difference of the affinity of the new antibody and the antibody;

obtaining the probability of replacing the antibody by the new antibody according to the affinity difference and the annealing factor;

replacing the antibody with the new antibody according to the probability.

The deployment device of the virtual machine provided by the application is based on an artificial immune algorithm, abstracts the problem of deploying the virtual machines in batches into an optimization problem for determining the mapping relation between the virtual machines and the physical host, takes the physical host reaching the most balanced load as an optimization target, and obtains the optimal solution of the mapping relation by setting and transforming the mapping relation between the virtual machines and the physical host, so as to obtain the optimal deployment mode of the virtual machines. By the deployment method, the virtual machines can be rapidly deployed in batches, meanwhile, the optimal load balance among the physical hosts can be achieved, and the cloud computing platform can operate in a state of better load balance and better resource utilization rate after deployment is completed.

The present application also provides a deployment apparatus of a virtual machine, which is shown with reference to fig. 5 and includes a memory 1 and a processor 2.

A memory 1 for storing a computer program;

a processor 2 for executing a computer program to implement the steps of:

setting an affinity function and a constraint condition, and taking the affinity function and the constraint condition as antigens; setting a mapping relation between a virtual machine and a physical host, and taking the mapping relation as an antibody; calculating the affinity of the antibody to the antigen; selecting the antibody with the highest affinity from the antibodies; evolving the antibody with the highest affinity and immunizing the antibody with the highest affinity until the affinity of the evolved antibody and the antigen converges; and deploying the virtual machine according to the mapping relation corresponding to the antibody when the affinity converges.

For the introduction of the device provided in the present application, please refer to the above method embodiment, which is not described herein again.

The present application further provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of:

setting an affinity function and a constraint condition, and taking the affinity function and the constraint condition as antigens; setting a mapping relation between a virtual machine and a physical host, and taking the mapping relation as an antibody; calculating the affinity of the antibody to the antigen; selecting the antibody with the highest affinity from the antibodies; evolving the antibody with the highest affinity and immunizing the antibody with the highest affinity until the affinity of the evolved antibody and the antigen converges; and deploying the virtual machine according to the mapping relation corresponding to the antibody when the affinity converges.

The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

For the introduction of the computer-readable storage medium provided in the present application, please refer to the above method embodiments, which are not described herein again.

The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed by the embodiments correspond to the method disclosed by the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.

Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

The deployment method, device, apparatus, and computer-readable storage medium of the virtual machine provided in the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种模型训练的任务协同处理方法、装置与系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!