Resource allocation method and device, equipment and medium

By obtaining virtual machine status information and using the population particle algorithm to optimize resource allocation, the problem of inefficient resource utilization caused by frequent migration of virtual machines is solved, stable and efficient resource allocation is achieved, and the resource utilization and reliability of the cloud computing system are improved.

CN118708355APending Publication Date: 2024-09-27INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410860613.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

In a latency-sensitive virtualization platform deployed, frequent virtual machine migration caused by the distributed resource scheduler increases virtual machine lags and migration failures, and cannot effectively utilize resources, resulting in performance degradation.

Method used

By obtaining the machine status information of the virtual machine, filtering the set of virtual machines to be allocated resources, and using the population particle algorithm to iteratively update the location matrix of the virtual machine resources, and combining the fitness function to optimize resource allocation to ensure that the resources do not exceed the preset value. Efficient use within the scope.

Benefits of technology

It reduces the resource overhead of frequent migration between virtual machines, improves resource utilization and system reliability, ensures the high availability of host resources, adapts to the needs of different application scenarios, and has strong scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708355A
    Figure CN118708355A
Patent Text Reader

Abstract

The invention discloses a resource allocation method and device, equipment and a medium, and belongs to the technical field of resource management, and the method comprises the steps: determining a virtual machine set to be subjected to resource allocation; in response to the fact that each resource proportion of the virtual machine to be subjected to resource allocation is smaller than a product of a resource proportion of a resource corresponding to the physical machine and a first preset value, iteratively updating a position matrix of the resources of the virtual machine through a population particle algorithm to determine each resource allocation condition of the virtual machine; optimizing and updating each resource allocation condition of the virtual machine through a fitness function, and determining each resource target allocation condition of the virtual machine; and carrying out resource allocation on each virtual machine in the virtual machine set to be subjected to resource allocation according to the allocation condition of each resource target of the virtual machine. The resource overhead of frequent migration of the virtual machine among different physical machines is reduced, and the purpose of stably and efficiently utilizing resources is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of resource management technology, and in particular to a resource allocation method, device, equipment and medium. Background Art

[0002] VMware's Distributed Resource Scheduler (DRS) is a resource management feature designed to help administrators in VMware vSphere virtualization environments automate resource allocation and load balancing to prevent host overload. The distributed resource scheduler can monitor the resource utilization of physical machines and automatically migrate virtual machines to other hosts based on load conditions to avoid host resource bottlenecks and performance degradation. It achieves load balancing by migrating virtual machines from an overloaded host to another host with sufficient computing resources, while ensuring the normal operation of virtual machines.

[0003] The principle of distributed resource scheduling is to ensure that the load of each virtual machine is normal and that each virtual machine can access appropriate resources at any time to balance the load of each host. If the resources obtained by each virtual machine in the cluster meet its own requirements and there is no resource contention, then the distributed resource scheduler will not trigger the migration action. Even if the resource utilization is checked at the host level and the central processing unit (CPU) and memory have exceeded the alarm threshold, the migration action will not be triggered.

[0004] However, some virtualization platforms that are deployed with latency sensitivity experience business delays. The main reason is that resource overhead occurs when performing migration actions. Generally, the distributed resource scheduler is set to semi-automatic. Setting the highest priority will provide the most even load balancing, but this will lead to frequent migrations, which will not provide any performance advantages for the virtual machines. Instead, it will increase the freeze of the virtual machines and the failure of virtual machine migration. Summary of the invention

[0005] In order to overcome the above technical defects, the purpose of the present application is to provide a resource allocation method, device, equipment and medium, the method comprising: obtaining the machine status information of each virtual machine under any physical machine; filtering a number of virtual machines according to the machine status information of each virtual machine to determine the set of virtual machines to be allocated resources; obtaining the resource proportion information of any virtual machine to be allocated resources; in response to the resource proportions of the virtual machines to be allocated resources being less than the product of the resource proportions of the corresponding resources of the physical machine and the first preset value, iteratively updating the position matrix of the virtual machine resources through the population particle algorithm to determine the resource allocation of the virtual machine; optimizing and updating the resource allocation of the virtual machine through the fitness function to determine the resource target allocation of the virtual machine; and allocating resources to each virtual machine in the set of virtual machines to be allocated resources according to the resource target allocation of the virtual machine. The present application reduces the resource overhead of frequent migration of virtual machines between different physical machines, and achieves the purpose of stable and efficient resource utilization.

[0006] The specific technical solutions provided by the embodiments of this application are as follows:

[0007] In a first aspect, the present application provides a resource allocation method, the method being applied to a resource allocation system, the system comprising a plurality of physical machines, each of which comprises a plurality of virtual machines, the method comprising:

[0008] Get the machine status information of each virtual machine under any physical machine;

[0009] Filtering a plurality of virtual machines according to the machine status information of each virtual machine to determine a set of virtual machines to be allocated resources;

[0010] Obtain the resource ratio information of any virtual machine to be allocated resources;

[0011] In response to the fact that the resource proportions of the virtual machines to be allocated are all less than the product of the resource proportions of the corresponding resources of the physical machine and a first preset value, iteratively updating the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine;

[0012] Optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine;

[0013] Resources are allocated to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0014] In one embodiment, filtering a plurality of virtual machines according to the machine state information of each virtual machine to determine a set of virtual machines to be allocated resources includes:

[0015] Obtaining the machine state of each virtual machine, wherein the machine state of the virtual machine includes a power-on state, a power-off state, and a sleep state;

[0016] Filter and delete virtual machines whose machine status is a shutdown state;

[0017] The remaining virtual machine set is used as the virtual machine set to which resources are to be allocated.

[0018] In one embodiment, the iterative updating of the position matrix of the virtual machine resources by the population particle algorithm to determine the allocation of each resource of the virtual machine includes:

[0019] Obtaining a position matrix of the virtual machine resources, wherein the position is the allocation status of each resource of the virtual machine;

[0020] The location matrix of the virtual machine resources is iteratively updated using the location update formula:

[0021] The iterative updating of the position matrix of the virtual machine resources by using the position update formula includes:

[0022] Get the position of the next iteration of the virtual machine The location of the virtual machine at the current iteration Optimal location for virtual machines in , the global optimal position b of all virtual machines in the physical machine gn , the current number of iterations a, the total number of iterations A, a virtual machine i in the physical machine, the type dimension n of virtual resources; obtain random numbers C, C1, C2, and the decision probability γ, where the decision probability

[0023] When the random number C is less than the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources;

[0024] When the random number C is greater than or equal to the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources;

[0025] When the number of iterations reaches the first threshold, the iteration is stopped and the two-dimensional matrix R of the virtual machine resource allocation is output. i ,q i ), where p i is the virtual machine resource reliability of the current physical machine, qi The current allocation of each resource in the virtual machine.

[0026] In one embodiment, the method further comprises:

[0027] Obtaining a speed matrix of the virtual machine resources, wherein the speed is a change direction of each resource of the virtual machine;

[0028] Iteratively updating the speed matrix of the virtual machine resources by using a speed update formula;

[0029] The iterative updating of the speed matrix of the virtual machine resources by using the speed update formula includes:

[0030] Get the speed variable of the next iteration of the virtual machine The speed variable v of the virtual machine at the current iteration in a, parameter w, virtual machine learning factors Z1, Z2, the best position of the virtual machine at the current iteration b in a, the global best position of all virtual machines in the physical machine at the current iteration b gn a;

[0031] The velocity update formula is: The speed matrix of the virtual machine resources is iteratively updated.

[0032] In one embodiment, optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine includes:

[0033] Get the virtual machine resource reliability p of the current physical machine i , the current proportion of each resource in the virtual machine q i , number of virtual machines num, reliability RES, system duration T;

[0034] Through the fitness function Calculating the fitness function value of the virtual machine;

[0035] Updating the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine;

[0036] The updating of the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine includes:

[0037] When the fitness function value of the current iteration of the virtual machine is greater than the fitness function value corresponding to the historical best position of the virtual machine, the fitness function value of the virtual machine is updated;

[0038] When the fitness function value of the current iteration of the virtual machine group is greater than the fitness function value corresponding to the historical best position of the virtual machine group, the fitness function value of the virtual machine group is updated;

[0039] The virtual machine fitness function value and the virtual machine group fitness function value corresponding to the highest proportion distribution of each virtual resource are determined as the resource target distribution of each virtual machine.

[0040] In one embodiment, the method comprises:

[0041] In response to the fact that a proportion of one resource of the virtual machine to be allocated resources is greater than or equal to a product of a proportion of the resource corresponding to the resource of the physical machine and a first preset value, the resource corresponding to the virtual machine is migrated to another physical machine.

[0042] In one embodiment, the method further comprises:

[0043] Iteratively updating the position matrix of the virtual machine resources by combining a population particle algorithm, a genetic algorithm and a simulated annealing algorithm to determine the allocation of each resource of the virtual machine;

[0044] The speed update formula is optimized by adjusting the virtual machine learning factor, and the proportion distribution of each resource of the virtual machine obtained in each iteration is updated.

[0045] In a second aspect, the present application further provides a resource allocation device, the device comprising:

[0046] The acquisition module is used to obtain the machine status information of each virtual machine under any physical machine and the resource ratio information of any virtual machine to be allocated resources;

[0047] A filtering module, used to filter a plurality of virtual machines according to the machine status information of each virtual machine, and determine a set of virtual machines to be allocated resources;

[0048] A determination module, configured to iteratively update the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine in response to the resource ratio of each virtual machine to be allocated being less than the product of the resource ratio of the corresponding resource of the physical machine and a first preset value;

[0049] An optimization module, used to optimize and update the resource allocation of the virtual machine through a fitness function to determine the target allocation of the resources of the virtual machine;

[0050] The allocation module is used to allocate resources to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0051] In a third aspect, a resource allocation device is also provided, including:

[0052] one or more processors;

[0053] A storage device for storing one or more programs;

[0054] When the one or more programs are executed by the one or more processors, the one or more processors implement the resource allocation method as described in any one of the first aspects.

[0055] In a fourth aspect, the present application further provides a computer device, the device comprising:

[0056] A memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the resource allocation method as described in any one of the first aspects.

[0057] In a fifth aspect, the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any resource allocation method described in the first aspect.

[0058] In a sixth aspect, the present application further provides a computer storage medium, the medium comprising:

[0059] A computer program is stored thereon, and when the computer program is executed by a processor, the steps of any resource allocation method described in the first aspect are implemented.

[0060] Compared with the prior art, the method described in the technical solution provided in the embodiment of the present application includes: obtaining the machine status information of each virtual machine under any physical machine; filtering a number of virtual machines according to the machine status information of each virtual machine to determine the set of virtual machines to be allocated resources; obtaining the resource proportion information of any virtual machine to be allocated resources; in response to the resource proportions of the virtual machines to be allocated resources being less than the product of the resource proportions of the corresponding resources of the physical machine and the first preset value, iteratively updating the position matrix of the virtual machine resources through the population particle algorithm to determine the resource allocation of each virtual machine; optimizing and updating the resource allocation of each virtual machine through the fitness function to determine the resource target allocation of each virtual machine; and allocating resources to each virtual machine in the set of virtual machines to be allocated resources according to the resource target allocation of each virtual machine. The present application reduces the resource overhead of frequent migration of virtual machines between different physical machines, and achieves the purpose of stable and efficient resource utilization.

[0061] The technical solution provided in the embodiment of the present application can optimize the resource allocation and virtual machine scheduling strategy when the resources do not exceed the set range, reduce the impact of frequent migration of the distributed resource scheduler, find the optimal solution through the resource calculation module, and balance the virtual machine resources in each physical machine, thereby achieving the effect of improving the resource utilization and system reliability benefits of the cloud computing system.

[0062] The technical solution provided in the embodiment of the present application makes full use of computing resources so that the virtual machines on each host can run efficiently. Through intelligent and dynamic resource scheduling, resource waste is reduced to ensure the high availability of host resources. At the same time, the fitness function can be defined according to the performance indicators of the system to meet the needs of different application scenarios. The technical solution has strong scalability and can adapt to changes in the scale of the cloud platform and dynamic changes in virtual machine resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0064] Figure 1 A first flow chart of the resource allocation method provided in Embodiment 1 of the present application;

[0065] Figure 2 A second flow chart of the resource allocation method provided in Embodiment 2 of the present application;

[0066] Figure 3 A specific flow chart of the resource allocation method provided in Example 2 of the present application;

[0067] Figure 4 A structural diagram of a resource allocation device provided in Embodiment 3 of the present application;

[0068] Figure 5 The exemplary system provided for Embodiment 7 of the present application can be used to implement the various embodiments described in the present application. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0070] It should be noted that, unless the context clearly requires otherwise, words such as “include”, “including” and similar words throughout the specification and claims should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is “including but not limited to”.

[0071] Furthermore, in the description of the present application, unless otherwise specified, “plurality” means two or more.

[0072] The virtual machine refers to a complete computer system that runs in a completely isolated environment and has complete hardware system functions through software simulation; the work that can be completed in a physical computer can be realized in a virtual machine; when a virtual machine is created in a computer, each virtual machine has independent virtual resources and operating system, and the virtual machine can be operated like a physical machine. There are many types of virtual machine resources in the network computing environment, including: CPU, memory, network and disk. Each resource has its own specific limitations and usage cost model, so factors such as the computing power and usage cost of the virtual machine must be taken into account. When planning a virtual machine, it is necessary to avoid poor performance of applications in the virtual machine due to unreasonable allocation of resources.

[0073] Embodiment 1

[0074] The present application embodiment provides a resource allocation method, such as Figure 1 As shown, the method is applied to a resource allocation system, the system includes several physical machines, each physical machine includes several virtual machines, and the method includes:

[0075] Get the machine status information of each virtual machine under any physical machine;

[0076] Filtering a plurality of virtual machines according to the machine status information of each virtual machine to determine a set of virtual machines to be allocated resources;

[0077] Obtain the resource ratio information of any virtual machine to be allocated resources;

[0078] In response to the fact that the resource proportions of the virtual machines to be allocated are all less than the product of the resource proportions of the corresponding resources of the physical machine and a first preset value, iteratively updating the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine;

[0079] Optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine;

[0080] Resources are allocated to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0081] Specifically, the present application obtains machine status information of the physical machine and the virtual machine to prepare for subsequent operations;

[0082] Prioritize the machine status of virtual machines and discard virtual machines that do not require resource allocation;

[0083] When conditions are met, the resource reallocation is performed through the population particle algorithm calculation optimization to obtain the resource allocation results of the optimal virtual machine resources with maximum resource utilization;

[0084] The resource allocation results of the virtual machine resources are transmitted back to the resource pool, and the virtual machine resources are reallocated according to the resource allocation results of the virtual machine resources.

[0085] Repeat the above steps until all virtual machine resources on the host are balanced.

[0086] The present application proposes a resource allocation method, which uses an information acquisition module, a virtual machine status priority arrangement module, a resource calculation module, and a result transmission module to iteratively calculate the allocation situation through the position speed matrix of the virtual machine resources to dynamically reallocate the resources of the virtual machine. In unnecessary situations, it reduces the resource overhead of frequent migration of virtual machines between different physical machines, thereby achieving the purpose of stable and efficient resource utilization.

[0087] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0088] This application reduces the resource overhead of frequent migration of virtual machines between different physical machines, thereby achieving the goal of stable and efficient resource utilization.

[0089] The technical solution provided in the embodiment of the present application can optimize the resource allocation and virtual machine scheduling strategy when the resources do not exceed the set range, reduce the impact of frequent migration of the distributed resource scheduler, find the optimal solution through the resource calculation module, and balance the virtual machine resources in each physical machine, thereby achieving the effect of improving the resource utilization and system reliability benefits of the cloud computing system.

[0090] The technical solution provided in the embodiment of the present application makes full use of computing resources so that the virtual machines on each host can run efficiently. Through intelligent and dynamic resource scheduling, resource waste is reduced to ensure the high availability of host resources. At the same time, the fitness function can be defined according to the performance indicators of the system to meet the needs of different application scenarios. The technical solution has strong scalability and can adapt to changes in the scale of the cloud platform and dynamic changes in virtual machine resources.

[0091] Embodiment 2

[0092] The present application embodiment provides a resource allocation method, such as Figure 2 As shown, the method is applied to a resource allocation system, the system includes several physical machines, each physical machine includes several virtual machines, and the method includes:

[0093] Step S01, obtaining machine status information of each virtual machine under any physical machine;

[0094] A plurality of virtual machines are filtered according to the machine status information of each virtual machine to determine a set of virtual machines to be allocated resources.

[0095] Specifically, we first need to collect the resource allocation of the existing virtual machines under each physical machine ESXi system, such as the number of CPU cores, memory size, and hard disk space usage, and form a resource pool list as shown in Table 1 below:

[0096] Table 1

[0097]

[0098] Here, the machine states of the virtual machines are prioritized, and virtual machines that do not require resource allocation are discarded, so that the virtual machines on each host can run efficiently, increasing the efficiency of virtual machine resource allocation.

[0099] Step S01 also includes:

[0100] Step S011, obtaining the machine state of each virtual machine, wherein the machine state of the virtual machine includes a power-on state, a power-off state, and a sleep state;

[0101] Filter and delete virtual machines whose machine status is a shutdown state;

[0102] The remaining virtual machine set is used as the virtual machine set to which resources are to be allocated.

[0103] Specifically, the status of each virtual machine is recorded, the priority of the virtual machine in the powered-on state is set to 0, the priority of the virtual machine in the dormant state is set to 1, and the priority of the virtual machine in the powered-off state is set to 2. The priority is 0>1>2. Here, resource scheduling and allocation are only performed for virtual machines that are not powered-off, so the virtual machine with a priority of 2 is discarded and deleted. By default, virtual machines in the powered-off state do not need to reallocate resources.

[0104] Step S02, obtaining the resource ratio information of any virtual machine to be allocated resources;

[0105] In response to the fact that the resource proportions of the virtual machines to be allocated are all less than the product of the resource proportions of the corresponding resources of the physical machine and a first preset value, the position matrix of the virtual machine resources is iteratively updated by a population particle algorithm to determine the resource allocation status of the virtual machines.

[0106] Specifically, in the generated virtual resource pool list, the existing virtual machine resources are dynamically monitored and recorded in real time based on the limited virtual resource range as a constraint condition; if the various resources of the virtual machine do not exceed 70% of the current host resources, the distributed resource scheduling program operation is not executed, and the position matrix of the virtual machine resources is iteratively updated through the population particle algorithm to determine the allocation of each resource of the virtual machine.

[0107] Wherein, the first preset value is 70%.

[0108] It is understandable that the re-determined resource allocation results of the virtual machine resources are transmitted back to the initial virtual pool, and the resources are re-allocated to the virtual machines to be allocated resources to balance the distribution of virtual machine resources under the current physical machine.

[0109] Step S02 also includes:

[0110] Step S021, obtaining a position matrix of the virtual machine resources, wherein the position is the allocation of each resource of the virtual machine;

[0111] The location matrix of the virtual machine resources is iteratively updated using the location update formula:

[0112] The iterative updating of the position matrix of the virtual machine resources by using the position update formula includes:

[0113] Get the position of the next iteration of the virtual machine The location of the virtual machine at the current iteration Optimal location for virtual machines in , the global optimal position b of all virtual machines in the physical machine gn , the current number of iterations a, the total number of iterations A, a virtual machine i in the physical machine, the type dimension n of virtual resources; obtain random numbers C, C1, C2, and the decision probability γ, where the decision probability

[0114] When the random number C is less than the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources;

[0115] When the random number C is greater than or equal to the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources;

[0116] When the number of iterations reaches the first threshold, the iteration is stopped and the two-dimensional matrix R of the virtual machine resource allocation is output. i ,q i ), where p i is the virtual machine resource reliability of the current physical machine, q i The current allocation of each resource in the virtual machine.

[0117] Specifically, first, the individual population is initialized, the position matrix of the virtual machine resource is obtained, and the speed matrix of the virtual machine resource is obtained (initialized as an all-zero matrix). Here, the individual population represents a physical machine (each physical machine has multiple virtual machines, that is, each individual population has multiple individuals); each individual represents a virtual machine;

[0118] The position indicates the allocation of various resources of the virtual machine, and the speed indicates the change direction of various resources of the virtual machine.

[0119] Start iterative update, and stop when the termination condition is reached. There are generally two termination conditions: one is reaching the set number of iterations, and the other is that an acceptable solution has been obtained. This application is set to terminate in the first case;

[0120] Among them, the first threshold is 100-200 times.

[0121] The output solution after iteration is in the form of a two-dimensional matrix R of the virtual machine resource allocation situation = (p i ,q i ), the rows of the matrix represent the individual size (set by yourself), and the total number of columns is twice the number of resource types, where p i is the virtual machine resource reliability of the current physical machine, q i The current distribution of each virtual resource in the virtual machine.

[0122] Determine the number of resource allocations q i If the constraints are met, the particle swarm matrix will be updated to the position matrix.

[0123] Step S022, obtaining a speed matrix of the virtual machine resources, wherein the speed is a change direction of each resource of the virtual machine;

[0124] Iteratively updating the speed matrix of the virtual machine resources by using a speed update formula;

[0125] The iterative updating of the speed matrix of the virtual machine resources by using the speed update formula includes:

[0126] Get the speed variable of the next iteration of the virtual machine The speed variable v of the virtual machine at the current iteration in a, parameter w, virtual machine learning factors Z1, Z2, the best position of the virtual machine at the current iteration b in a, the global best position of all virtual machines in the physical machine at the current iteration b gn a;

[0127] The velocity update formula is: The speed matrix of the virtual machine resources is iteratively updated.

[0128] Specifically, the speed represents the direction of change of each resource. The position matrix and the speed matrix are updated according to the position update formula and the speed update formula. Theoretically, each virtual machine will move closer to its own historical best position and the group's best position, and the individuals that meet the constraints will be updated to the population matrix. The updated individual positions will be converted into new virtual machine resource allocation situations to achieve the optimal virtual machine resource allocation result.

[0129] Step S03: optimizing and updating the resource allocation conditions of the virtual machine through a fitness function to determine the target resource allocation conditions of the virtual machine.

[0130] Step S03 also includes:

[0131] Step S031, obtaining the virtual machine resource reliability p of the current physical machine i , the current proportion of each resource in the virtual machine q i , number of virtual machines num, reliability RES, system duration T;

[0132] Through the fitness function Calculating the fitness function value of the virtual machine;

[0133] Updating the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine;

[0134] The updating of the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine includes:

[0135] When the fitness function value of the current iteration of the virtual machine is greater than the fitness function value corresponding to the historical best position of the virtual machine, the fitness function value of the virtual machine is updated;

[0136] When the fitness function value of the current iteration of the virtual machine group is greater than the fitness function value corresponding to the historical best position of the virtual machine group, the fitness function value of the virtual machine group is updated;

[0137] The virtual machine fitness function value and the virtual machine group fitness function value corresponding to the highest proportion distribution of each virtual resource are determined as the resource target distribution of each virtual machine.

[0138] Specifically, a reliability fitness function is set here to evaluate the quality of the virtual machine. The fitness function is a function used to evaluate the performance of each individual (virtual machine) in the overall solution. The choice of fitness function is closely related to the problem being solved. Generally, a function related to the problem needs to be designed to evaluate the performance of each solution. The present application can initialize the fitness function value of each individual as a full zero matrix, and use the reliability of virtual machine resources as a fitness function to evaluate the individual.

[0139] Update the fitness function value: the purpose is to update the individual fitness function value obtained in each iteration and the fitness function value of the virtual machine group;

[0140] During the iteration process, the fitness function value of the current iteration of the virtual machine is compared with the fitness function value corresponding to the historical best position of the virtual machine. When the fitness function value of the current iteration of the virtual machine is greater than the fitness function value corresponding to the historical best position of the virtual machine, the fitness function value of the virtual machine is updated; when the fitness function value of the current iteration of the virtual machine group is greater than the fitness function value corresponding to the historical best position of the virtual machine group, the fitness function value of the virtual machine group is updated;

[0141] Finally, the virtual machine fitness function value and the virtual machine group fitness function value corresponding to the highest proportion of virtual resources are determined as the resource target allocation of the virtual machine. Here, the state where the virtual machine fitness function value is the highest is also the state where the virtual machine group fitness function value is the highest.

[0142] Step S04: Allocate resources to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0143] Step S05 , in response to the fact that the proportion of one resource of the virtual machine to be allocated is greater than or equal to the product of the proportion of the resource corresponding to the resource of the physical machine and a first preset value, migrating the resource corresponding to the virtual machine to other physical machines.

[0144] Specifically, the resource proportions allocated to the virtual machines under the current host in the resource table are checked. When the proportion of a certain resource exceeds 70% of the current physical machine resource proportion, the distributed resource scheduler operation is performed normally.

[0145] Among them, the distributed resource scheduler is a resource management function. Based on the dynamic monitoring of the resource load of the resource pool, it reasonably triggers the uniform allocation rules, and ultimately achieves the purpose of redistributing virtual machine resources among physical servers in the resource pool. It automatically helps migrate virtual machine resources through hot migration to achieve the load balancing of resources such as CPU and memory in the physical machine cluster.

[0146] Step S06, iteratively updating the position matrix of the virtual machine resources by combining a population particle algorithm, a genetic algorithm and a simulated annealing algorithm to determine the allocation of each resource of the virtual machine;

[0147] By adjusting the virtual machine learning factor, the speed update formula is optimized, and the proportion distribution of each resource of the virtual machine obtained in each iteration is updated.

[0148] Specifically, this application also has some challenges and limitations, such as the setting of algorithm parameters, the definition of fitness function, and the convergence speed of the algorithm. It cannot obtain the optimal solution, but can only find an acceptable optimization solution. There are also defects such as premature convergence and local optimization, which need further research and improvement. When the host scale is expanded, the resource scheduling system will be more complicated.

[0149] Here, a hybrid algorithm can be combined with other optimization techniques, for example, a population particle algorithm, a genetic algorithm and a simulated annealing algorithm are combined to iteratively update the position matrix of the virtual machine resources to determine the resource allocation of each virtual machine resource, so as to achieve better results.

[0150] At the same time, through dynamic parameter adjustment: by adjusting the virtual machine learning factor, the speed update formula is optimized, the proportion distribution of each virtual resource of the virtual machine obtained in each iteration is updated, or by adjusting the number of population particles (the number of rows and columns of the two-dimensional matrix) to improve the convergence of the algorithm.

[0151] The capabilities of modern multi-core processors can also be used to parallelize the population particle algorithm of the present application, thereby increasing its calculation speed.

[0152] like Figure 3As shown, the technical solution of the present application proposes a method for resource allocation, which obtains the machine status information of each virtual machine under any physical machine; filters a number of virtual machines according to the machine status information of each virtual machine to determine the set of virtual machines to be allocated resources; obtains the resource ratio information of any virtual machine to be allocated resources; in response to the resource ratios of the virtual machines to be allocated resources being less than the product of the resource ratios of the corresponding resources of the physical machine and the first preset value, iteratively updates the position matrix of the virtual machine resources through the population particle algorithm to determine the resource allocation of each virtual machine; optimizes and updates the resource allocation of each virtual machine through the fitness function to determine the resource target allocation of each virtual machine; and allocates resources to each virtual machine in the set of virtual machines to be allocated resources according to the resource target allocation of each virtual machine. The present application reduces the resource overhead of frequent migration of virtual machines between different physical machines, and achieves the purpose of stable and efficient resource utilization.

[0153] In addition, the virtual machine resources are allocated by genetic algorithm to determine the resource allocation of the virtual machine resources, including:

[0154] Encode the allocation scheme of virtual machines to physical hosts as chromosomes;

[0155] Randomly generate the initial population (physical machines);

[0156] According to the fitness function value, individuals (virtual machines) are selected for reproduction, simulating the genetic recombination process of organisms, randomly selecting parts of the chromosomes of two parent individuals for exchange to generate new offspring;

[0157] Modify certain genes of offspring chromosomes according to preset probabilities;

[0158] The fitness of the newly generated offspring population is evaluated through the fitness function, and selection, crossover and mutation operations are performed again according to the evaluation results to form a new generation of population;

[0159] Repeat the above steps until the preset number of iterations is reached;

[0160] The individual with the highest fitness function value is selected from the population after multiple generations of evolution and decoded into the actual resource allocation strategy.

[0161] The optimal virtual machine allocation scheme is applied to the actual cloud computing environment, and the effect is monitored. If necessary, fine-tuning is performed according to the actual operation situation. Through this series of steps, the genetic algorithm can automatically explore a large number of possible virtual machine allocation strategies and gradually approach the optimal solution, thereby effectively managing and optimizing virtual machine resources.

[0162] The resource allocation method provided in the embodiment of the present application may be further improved and optimized without departing from the technical solution of the present application, and these improvements and optimizations should also be regarded as within the scope of protection of the present application.

[0163] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0164] This application reduces the resource overhead of frequent migration of virtual machines between different physical machines, thereby achieving the goal of stable and efficient resource utilization.

[0165] The technical solution provided in the embodiment of the present application can optimize the resource allocation and virtual machine scheduling strategy when the resources do not exceed the set range, reduce the impact of frequent migration of the distributed resource scheduler, find the optimal solution through the resource calculation module, and balance the virtual machine resources in each physical machine, thereby achieving the effect of improving the resource utilization and system reliability benefits of the cloud computing system.

[0166] The technical solution provided in the embodiment of the present application makes full use of computing resources so that the virtual machines on each host can run efficiently. Through intelligent and dynamic resource scheduling, resource waste is reduced to ensure the high availability of host resources. At the same time, the fitness function can be defined according to the performance indicators of the system to meet the needs of different application scenarios. The technical solution has strong scalability and can adapt to changes in the scale of the cloud platform and dynamic changes in virtual machine resources.

[0167] Embodiment 3

[0168] The present application provides a resource allocation device, such as Figure 4 As shown, the device includes an acquisition module, a filtering module, a determination module, an optimization module, an allocation module, and a migration module.

[0169] In this embodiment, the acquisition module is used to obtain the machine status information of each virtual machine under any physical machine and the resource proportion information of any virtual machine to be allocated resources;

[0170] A filtering module, used to filter a plurality of virtual machines according to the machine status information of each virtual machine, and determine a set of virtual machines to be allocated resources;

[0171] A determination module, configured to iteratively update the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine in response to the resource ratio of each virtual machine to be allocated being less than the product of the resource ratio of the corresponding resource of the physical machine and a first preset value;

[0172] An optimization module, used to optimize and update the resource allocation of the virtual machine through a fitness function to determine the target allocation of the resources of the virtual machine;

[0173] The allocation module is used to allocate resources to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0174] In one of the embodiments, the filtering module is used to obtain the machine state of each virtual machine, wherein the machine state of the virtual machine includes a power-on state, a power-off state, and a sleep state;

[0175] Filter and delete virtual machines whose machine status is a shutdown state;

[0176] The remaining virtual machine set is used as the virtual machine set to which resources are to be allocated.

[0177] In one of the embodiments, the determination module is used to obtain a position matrix of the virtual machine resources, wherein the position is the allocation of each resource of the virtual machine;

[0178] The location matrix of the virtual machine resources is iteratively updated using the location update formula:

[0179] The iterative updating of the position matrix of the virtual machine resources by using the position update formula includes:

[0180] Get the position of the next iteration of the virtual machine The location of the virtual machine at the current iteration Optimal location for virtual machines in , the global optimal position b of all virtual machines in the physical machine gn , the current number of iterations a, the total number of iterations A, a virtual machine i in the physical machine, the type dimension n of virtual resources; obtain random numbers C, C1, C2, and the decision probability γ, where the decision

[0181] When the random number C is less than the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources;

[0182] When the random number C is greater than or equal to the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources;

[0183] When the number of iterations reaches the first threshold, the iteration is stopped and the two-dimensional matrix R of the virtual machine resource allocation is output. i ,q i ), where p i is the virtual machine resource reliability of the current physical machine, q i The current allocation of each resource in the virtual machine.

[0184] In one of the embodiments, the determination module is used to obtain a speed matrix of the virtual machine resources, wherein the speed is a change direction of each resource of the virtual machine;

[0185] Iteratively updating the speed matrix of the virtual machine resources by using a speed update formula;

[0186] The iterative updating of the speed matrix of the virtual machine resources by using the speed update formula includes:

[0187] Get the speed variable of the next iteration of the virtual machine The speed variable v of the virtual machine at the current iteration in a, parameter w, virtual machine learning factors Z1, Z2, the best position of the virtual machine at the current iteration b in a, the global best position of all virtual machines in the physical machine at the current iteration b gn a;

[0188] The velocity update formula is: The speed matrix of the virtual machine resources is iteratively updated.

[0189] In one embodiment, the optimization module is used to obtain the virtual machine resource reliability p of the current physical machine. i , the current proportion of each resource in the virtual machine q i , number of virtual machines num, reliability RES, system duration T;

[0190] Through the fitness function Calculating the fitness function value of the virtual machine;

[0191] Updating the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine;

[0192] The updating of the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine includes:

[0193] When the fitness function value of the current iteration of the virtual machine is greater than the fitness function value corresponding to the historical best position of the virtual machine, the fitness function value of the virtual machine is updated;

[0194] When the fitness function value of the current iteration of the virtual machine group is greater than the fitness function value corresponding to the historical best position of the virtual machine group, the fitness function value of the virtual machine group is updated;

[0195] The virtual machine fitness function value and the virtual machine group fitness function value corresponding to the highest proportion distribution of each virtual resource are determined as the resource target distribution of each virtual machine.

[0196] In one of the embodiments, the migration module is used to migrate the corresponding resource of the virtual machine to other physical machines in response to the resource ratio of one of the resources of the virtual machine to be allocated being greater than or equal to the product of the resource ratio of the physical machine corresponding to the resource and a first preset value.

[0197] In one embodiment, the optimization module is further used to iteratively update the position matrix of the virtual machine resources by combining a population particle algorithm, a genetic algorithm and a simulated annealing algorithm to determine the allocation of each resource of the virtual machine;

[0198] By adjusting the virtual machine learning factor, the speed update formula is optimized, and the proportion distribution of each resource of the virtual machine obtained in each iteration is updated.

[0199] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0200] This application reduces the resource overhead of frequent migration of virtual machines between different physical machines, thereby achieving the goal of stable and efficient resource utilization.

[0201] The technical solution provided in the embodiment of the present application can optimize the resource allocation and virtual machine scheduling strategy when the resources do not exceed the set range, reduce the impact of frequent migration of the distributed resource scheduler, find the optimal solution through the resource calculation module, and balance the virtual machine resources in each physical machine, thereby achieving the effect of improving the resource utilization and system reliability benefits of the cloud computing system.

[0202] The technical solution provided in the embodiment of the present application makes full use of computing resources so that the virtual machines on each host can run efficiently. Through intelligent and dynamic resource scheduling, resource waste is reduced to ensure the high availability of host resources. At the same time, the fitness function can be defined according to the performance indicators of the system to meet the needs of different application scenarios. The technical solution has strong scalability and can adapt to changes in the scale of the cloud platform and dynamic changes in virtual machine resources.

[0203] Embodiment 4

[0204] The present invention also provides a resource allocation device, comprising:

[0205] one or more processors;

[0206] A storage device for storing one or more programs;

[0207] When the one or more programs are executed by the one or more processors, the one or more processors execute the following resource allocation method:

[0208] Get the machine status information of each virtual machine under any physical machine;

[0209] Filtering a plurality of virtual machines according to the machine status information of each virtual machine to determine a set of virtual machines to be allocated resources;

[0210] Obtain the resource ratio information of any virtual machine to be allocated resources;

[0211] In response to the fact that the resource proportions of the virtual machines to be allocated are all less than the product of the resource proportions of the corresponding resources of the physical machine and a first preset value, iteratively updating the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine;

[0212] Optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine;

[0213] Resources are allocated to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0214] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0215] This application reduces the resource overhead of frequent migration of virtual machines between different physical machines, thereby achieving the goal of stable and efficient resource utilization.

[0216] The technical solution provided in the embodiment of the present application can optimize the resource allocation and virtual machine scheduling strategy when the resources do not exceed the set range, reduce the impact of frequent migration of the distributed resource scheduler, find the optimal solution through the resource calculation module, and balance the virtual machine resources in each physical machine, thereby achieving the effect of improving the resource utilization and system reliability benefits of the cloud computing system.

[0217] Embodiment 5

[0218] The present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following resource allocation method can be executed:

[0219] Get the machine status information of each virtual machine under any physical machine;

[0220] Filtering a plurality of virtual machines according to the machine status information of each virtual machine to determine a set of virtual machines to be allocated resources;

[0221] Obtain the resource ratio information of any virtual machine to be allocated resources;

[0222] In response to the fact that the resource proportions of the virtual machines to be allocated are all less than the product of the resource proportions of the corresponding resources of the physical machine and a first preset value, iteratively updating the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine;

[0223] Optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine;

[0224] Resources are allocated to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0225] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0226] This application reduces the resource overhead of frequent migration of virtual machines between different physical machines, thereby achieving the goal of stable and efficient resource utilization.

[0227] The technical solution provided in the embodiment of the present application makes full use of computing resources so that the virtual machines on each host can run efficiently. Through intelligent and dynamic resource scheduling, resource waste is reduced to ensure the high availability of host resources. At the same time, the fitness function can be defined according to the performance indicators of the system to meet the needs of different application scenarios. The technical solution has strong scalability and can adapt to changes in the scale of the cloud platform and dynamic changes in virtual machine resources.

[0228] Embodiment 6

[0229] The present application also provides a computer program product, including a computer program, which can implement the following resource allocation method when executed by a processor:

[0230] Get the machine status information of each virtual machine under any physical machine;

[0231] Filtering a plurality of virtual machines according to the machine status information of each virtual machine to determine a set of virtual machines to be allocated resources;

[0232] Obtain the resource ratio information of any virtual machine to be allocated resources;

[0233] In response to the fact that the resource proportions of the virtual machines to be allocated are all less than the product of the resource proportions of the corresponding resources of the physical machine and a first preset value, iteratively updating the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine;

[0234] Optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine;

[0235] Resources are allocated to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0236] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0237] This application reduces the resource overhead of frequent migration of virtual machines between different physical machines, thereby achieving the goal of stable and efficient resource utilization.

[0238] The technical solution provided in the embodiment of the present application can optimize the resource allocation and virtual machine scheduling strategy when the resources do not exceed the set range, reduce the impact of frequent migration of the distributed resource scheduler, find the optimal solution through the resource calculation module, and balance the virtual machine resources in each physical machine, thereby achieving the effect of improving the resource utilization and system reliability benefits of the cloud computing system.

[0239] Embodiment 7

[0240] The present application provides a computer storage medium, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0241] Get the machine status information of each virtual machine under any physical machine;

[0242] Filtering a plurality of virtual machines according to the machine status information of each virtual machine to determine a set of virtual machines to be allocated resources;

[0243] Obtain the resource ratio information of any virtual machine to be allocated resources;

[0244] In response to the fact that the resource proportions of the virtual machines to be allocated are all less than the product of the resource proportions of the corresponding resources of the physical machine and a first preset value, iteratively updating the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine;

[0245] Optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine;

[0246] Resources are allocated to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

[0247] In one embodiment, filtering a plurality of virtual machines according to the machine state information of each virtual machine to determine a set of virtual machines to be allocated resources includes:

[0248] Obtaining the machine state of each virtual machine, wherein the machine state of the virtual machine includes a power-on state, a power-off state, and a sleep state;

[0249] Filter and delete virtual machines whose machine status is a shutdown state;

[0250] The remaining virtual machine set is used as the virtual machine set to which resources are to be allocated.

[0251] In one embodiment, the iterative updating of the position matrix of the virtual machine resources by the population particle algorithm to determine the allocation of each resource of the virtual machine includes:

[0252] Obtaining a position matrix of the virtual machine resources, wherein the position is the allocation status of each resource of the virtual machine;

[0253] The location matrix of the virtual machine resources is iteratively updated using the location update formula:

[0254] The iterative updating of the position matrix of the virtual machine resources by using the position update formula includes:

[0255] Get the position of the next iteration of the virtual machine The location of the virtual machine at the current iteration Optimal location for virtual machines in , the global optimal position b of all virtual machines in the physical machine gn , the current number of iterations a, the total number of iterations A, a virtual machine i in the physical machine, the type dimension n of virtual resources; obtain random numbers C, C1, C2, and the decision probability γ, where the decision probability

[0256] When the random number C is less than the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources;

[0257] When the random number C is greater than or equal to the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources;

[0258] When the number of iterations reaches the first threshold, the iteration is stopped and the two-dimensional matrix R of the virtual machine resource allocation is output. i ,q i ), where p i is the virtual machine resource reliability of the current physical machine, qi The current allocation of each resource in the virtual machine.

[0259] In one embodiment, the method further comprises:

[0260] Obtaining a speed matrix of the virtual machine resources, wherein the speed is a change direction of each resource of the virtual machine;

[0261] Iteratively updating the speed matrix of the virtual machine resources by using a speed update formula;

[0262] The iterative updating of the speed matrix of the virtual machine resources by using the speed update formula includes:

[0263] Get the speed variable of the next iteration of the virtual machine The speed variable v of the virtual machine at the current iteration in a, parameter w, virtual machine learning factors Z1, Z2, the best position of the virtual machine at the current iteration b in a, the global best position of all virtual machines in the physical machine at the current iteration b gn a;

[0264] The velocity update formula is: The speed matrix of the virtual machine resources is iteratively updated.

[0265] In one embodiment, optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine includes:

[0266] Get the virtual machine resource reliability p of the current physical machine i , the current proportion of each resource in the virtual machine q i , number of virtual machines num, reliability RES, system duration T;

[0267] Through the fitness function Calculating the fitness function value of the virtual machine;

[0268] Updating the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine;

[0269] The updating of the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine includes:

[0270] When the fitness function value of the current iteration of the virtual machine is greater than the fitness function value corresponding to the historical best position of the virtual machine, the fitness function value of the virtual machine is updated;

[0271] When the fitness function value of the current iteration of the virtual machine group is greater than the fitness function value corresponding to the historical best position of the virtual machine group, the fitness function value of the virtual machine group is updated;

[0272] The virtual machine fitness function value and the virtual machine group fitness function value corresponding to the highest proportion distribution of each virtual resource are determined as the resource target distribution of each virtual machine.

[0273] In one embodiment, the method comprises:

[0274] In response to the fact that a proportion of one resource of the virtual machine to be allocated resources is greater than or equal to a product of a proportion of the resource corresponding to the resource of the physical machine and a first preset value, the resource corresponding to the virtual machine is migrated to another physical machine.

[0275] In one embodiment, the method further comprises:

[0276] Iteratively updating the position matrix of the virtual machine resources by combining a population particle algorithm, a genetic algorithm and a simulated annealing algorithm to determine the allocation of each resource of the virtual machine;

[0277] The speed update formula is optimized by adjusting the virtual machine learning factor, and the proportion distribution of each resource of the virtual machine obtained in each iteration is updated.

[0278] This application reduces the resource overhead of frequent migration of virtual machines between different physical machines, thereby achieving the goal of stable and efficient resource utilization.

[0279] Figure 5 An exemplary system provided for Embodiment 7 of the present application that can be used to implement various embodiments described in the present application;

[0280] like Figure 5 As shown, in some embodiments, the system can be used as any of the above-mentioned devices for resource allocation in each of the described embodiments. In some embodiments, the system may include one or more computer-readable media (e.g., system memory or NVM / storage device) having results and one or more processors (e.g., (one or more) processors) coupled to the one or more computer-readable media and configured to execute the results to implement the module to perform the actions described in this application.

[0281] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0282] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0283] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A resource allocation method, the method is applied to a resource allocation system, the system includes a plurality of physical machines, each physical machine includes a plurality of virtual machines, characterized in that: The method comprises: Get the machine status information of each virtual machine under any physical machine; Filtering a plurality of virtual machines according to the machine status information of each virtual machine to determine a set of virtual machines to be allocated resources; Obtain the resource ratio information of any virtual machine to be allocated resources; In response to the fact that the resource proportions of the virtual machines to be allocated are all less than the product of the resource proportions of the corresponding resources of the physical machine and a first preset value, iteratively updating the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine; Optimizing and updating the resource allocation of the virtual machine through a fitness function to determine the target resource allocation of the virtual machine; Resources are allocated to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

2. The resource allocation method according to claim 1, characterized in that: The filtering of a plurality of virtual machines according to the machine state information of each virtual machine to determine a set of virtual machines to be allocated resources includes: Obtaining the machine state of each virtual machine, wherein the machine state of the virtual machine includes a power-on state, a power-off state, and a sleep state; Filter and delete virtual machines whose machine status is a shutdown state; The remaining virtual machine set is used as the virtual machine set to which resources are to be allocated.

3. The resource allocation method according to claim 1, characterized in that: The iterative updating of the position matrix of the virtual machine resources by the population particle algorithm to determine the allocation of each resource of the virtual machine includes: Obtaining a position matrix of the virtual machine resources, wherein the position is the allocation status of each resource of the virtual machine; The location matrix of the virtual machine resources is iteratively updated using the location update formula: The iterative updating of the position matrix of the virtual machine resources by using the position update formula includes: Get the position of the next iteration of the virtual machine The location of the virtual machine at the current iteration Optimal location for virtual machines in , the global optimal position b of all virtual machines in the physical machine gn , the current number of iterations a, the total number of iterations A, a virtual machine i in the physical machine, the type dimension n of virtual resources; obtain random numbers C, C1, C2, and the decision probability γ, where the decision probability When the random number C is less than the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources; When the random number C is greater than or equal to the decision probability γ, the position update formula is used Iteratively updating the location matrix of the virtual machine resources; When the number of iterations reaches the first threshold, the iteration is stopped and the two-dimensional matrix R of the virtual machine resource allocation is output. i ,q i ), where p i is the virtual machine resource reliability of the current physical machine, q i The current allocation of each resource in the virtual machine.

4. The resource allocation method according to claim 3, characterized in that: The method further comprises: Obtaining a speed matrix of the virtual machine resources, wherein the speed is a change direction of each resource of the virtual machine; Iteratively updating the speed matrix of the virtual machine resources by using a speed update formula; The iterative updating of the speed matrix of the virtual machine resources by using the speed update formula includes: Get the speed variable of the next iteration of the virtual machine The speed variable v of the virtual machine at the current iteration in a, parameter w, virtual machine learning factors Z1, Z2, the best position of the virtual machine at the current iteration b in a, the global best position of all virtual machines in the physical machine at the current iteration b gn a; The velocity update formula is: The speed matrix of the virtual machine resources is iteratively updated.

5. The resource allocation method according to claim 3, characterized in that: The optimizing and updating the resource allocation of the virtual machine through the fitness function to determine the target allocation of the resources of the virtual machine includes: Get the virtual machine resource reliability p of the current physical machine i , the current proportion of each resource in the virtual machine q i , number of virtual machines num, reliability RES, system duration T; Through the fitness function Calculating the fitness function value of the virtual machine; Updating the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine; The updating of the fitness function value of the virtual machine by calculating and comparing the fitness function value of the virtual machine includes: When the fitness function value of the current iteration of the virtual machine is greater than the fitness function value corresponding to the historical best position of the virtual machine, the fitness function value of the virtual machine is updated; When the fitness function value of the current iteration of the virtual machine group is greater than the fitness function value corresponding to the historical best position of the virtual machine group, the fitness function value of the virtual machine group is updated; The virtual machine fitness function value and the virtual machine group fitness function value corresponding to the highest proportion distribution of each virtual resource are determined as the resource target distribution of each virtual machine.

6. The resource allocation method according to claim 1, characterized in that: The method comprises: In response to the fact that the proportion of one resource of the virtual machine to be allocated resources is greater than or equal to the product of the proportion of the resource corresponding to the resource of the physical machine and a first preset value, the resource corresponding to the virtual machine is migrated to another physical machine.

7. The resource allocation method according to claim 4, characterized in that: The method further comprises: Iteratively updating the position matrix of the virtual machine resources by combining a population particle algorithm, a genetic algorithm and a simulated annealing algorithm to determine the allocation of each resource of the virtual machine; The speed update formula is optimized by adjusting the virtual machine learning factor, and the proportion distribution of each resource of the virtual machine obtained in each iteration is updated.

8. A resource allocation device, characterized in that: The device comprises: The acquisition module is used to obtain the machine status information of each virtual machine under any physical machine and the resource ratio information of any virtual machine to be allocated resources; A filtering module, used to filter a plurality of virtual machines according to the machine status information of each virtual machine, and determine a set of virtual machines to be allocated resources; A determination module, configured to iteratively update the position matrix of the virtual machine resources by a population particle algorithm to determine the allocation of each resource of the virtual machine in response to the resource ratio of each virtual machine to be allocated being less than the product of the resource ratio of the corresponding resource of the physical machine and a first preset value; An optimization module, used to optimize and update the resource allocation of the virtual machine through a fitness function to determine the target allocation of the resources of the virtual machine; The allocation module is used to allocate resources to each virtual machine in the set of virtual machines to be allocated resources according to the target allocation status of each resource of the virtual machine.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the resource allocation method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the resource allocation method according to any one of claims 1 to 7 are implemented.