Virtual machine and host machine matching method and device, equipment, storage medium and program product

By obtaining the energy consumption and utilization of virtual machines and host machines, and using the particle swarm optimization algorithm to determine the matching relationship, the problem of poor resource utilization in the existing technology is solved, and efficient resource allocation is achieved to avoid waste.

CN120762884APending Publication Date: 2025-10-10CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510824225.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

The method of randomly determining a host machine from multiple host machines to build a virtual machine in the prior art cannot maximize resource utilization, resulting in resource waste.

Method used

By obtaining the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of the virtual machine, combined with the utilization rate of the host machine and the utilization rate of the smart network card, the particle swarm optimization algorithm is used to determine the matching relationship between the virtual machine and the host machine to achieve optimal resource allocation.

Benefits of technology

It maximizes resource utilization, avoids resource waste, and improves the efficiency of resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120762884A_ABST
    Figure CN120762884A_ABST
Patent Text Reader

Abstract

The invention relates to a matching method and device of a virtual machine and a host machine, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring CPU (Central Processing Unit) energy consumption, memory energy consumption, disk energy consumption and network energy consumption of a plurality of to-be-created virtual machines, and determining load energy consumption of the plurality of virtual machines according to the CPU energy consumption, the memory energy consumption, the disk energy consumption and the network energy consumption; obtaining a first utilization rate of a plurality of host machines used for creating the plurality of virtual machines and a second utilization rate of intelligent network cards of the plurality of host machines, and determining a comprehensive utilization rate of the plurality of host machines according to the first utilization rate and the second utilization rate; and according to the load energy consumption of the plurality of virtual machines and the comprehensive utilization rate of the plurality of host machines, determining a matching relationship between the plurality of virtual machines and the plurality of host machines. By adopting the method, the resource utilization rate can be maximized, and the problem of resource waste can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for matching a virtual machine and a host machine. Background Art

[0002] SmartNICs integrate processor and network functions to perform diverse computing tasks within network traffic, effectively reducing the host CPU load and significantly improving network performance and efficiency. With these advantages, SmartNICs have become a key component of data center networks and are widely used in host and virtual machine instances, helping to achieve higher network throughput, lower latency, and enhanced security.

[0003] In the prior art, a host machine is mostly randomly determined from multiple host machines to be used for building a virtual machine.

[0004] However, this method of randomly selecting a host machine to build a virtual machine cannot maximize resource utilization and has the problem of resource waste. Summary of the Invention

[0005] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for matching virtual machines and host machines that can maximize resource utilization and thus avoid resource waste problems in response to the above technical problems.

[0006] In a first aspect, the present application provides a method for matching a virtual machine and a host machine, comprising:

[0007] Obtaining CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption of multiple virtual machines to be created, and determining load energy consumption of the multiple virtual machines based on the CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption;

[0008] Obtaining first utilization rates of multiple host machines used to create the multiple virtual machines and second utilization rates of smart network cards of the multiple host machines, and determining a comprehensive utilization rate of the multiple host machines based on the first utilization rate and the second utilization rate;

[0009] A matching relationship between the multiple virtual machines and the multiple host machines is determined according to the load energy consumption of the multiple virtual machines and the comprehensive utilization rate of the multiple host machines.

[0010] In one embodiment, obtaining the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of multiple virtual machines to be created includes: obtaining a first CPU utilization, a first memory utilization, a first disk utilization and a network utilization of the multiple virtual machines; determining the CPU energy consumption of the multiple virtual machines based on the CPU static power consumption, the CPU dynamic power consumption and the first CPU utilization of the multiple virtual machines; determining the memory energy consumption of the multiple virtual machines based on the memory static power consumption, the memory dynamic power consumption and the first memory utilization of the multiple virtual machines; determining the disk energy consumption of the multiple virtual machines based on the disk static power consumption, the disk dynamic power consumption and the first disk utilization of the multiple virtual machines; and determining the network energy consumption of the multiple virtual machines based on the network static power consumption, the network dynamic power consumption and the network utilization of the multiple virtual machines.

[0011] In one embodiment, obtaining the first CPU utilization, first memory utilization, first disk utilization and network utilization of the multiple virtual machines includes: obtaining the CPU monitoring time and CPU idle time of the multiple virtual machines, and determining the first CPU utilization of the multiple virtual machines based on the CPU monitoring time and the CPU idle time; obtaining the total memory, free memory, buffer memory and cache memory of the multiple virtual machines, and determining the first memory utilization of the multiple virtual machines based on the total memory, the free memory, the buffer memory and the cache memory; obtaining the number of disk storage allocation units, the used disk storage and the total disk storage of the multiple virtual machines, and determining the first disk utilization of the multiple virtual machines based on the number of disk storage allocation units, the used disk storage and the total disk storage; obtaining the number of data bits transmitted by the multiple virtual machines during the monitoring time period, the network bandwidth and the monitoring time interval, and determining the network utilization of the multiple virtual machines based on the number of data bits, the network bandwidth and the monitoring time interval.

[0012] In one embodiment, obtaining the first utilization of multiple host machines used to create the multiple virtual machines includes: obtaining the second CPU utilization, the second disk utilization, and the second memory utilization of the multiple host machines; determining the first weight value corresponding to the second CPU utilization, the second weight value corresponding to the second disk utilization, and the third weight value corresponding to the second memory utilization based on the entropy weight method; determining the first utilization of the multiple host machines based on the first weight value, the second weight value, the third weight value, the second CPU utilization, the second disk utilization, and the second memory utilization.

[0013] In one embodiment, the matching relationship between the multiple virtual machines and the multiple host machines is determined based on the load energy consumption of the multiple virtual machines and the comprehensive utilization rate of the multiple host machines, including: sorting the multiple virtual machines in descending order based on the load energy consumption of the multiple virtual machines to obtain serial number information of the multiple virtual machines; sorting the multiple host machines in ascending order based on the comprehensive utilization rate of the multiple host machines to obtain serial number information of the multiple host machines; matching the virtual machines and host machines with the same serial numbers indicated by the serial number information according to the serial number information of the multiple virtual machines and the serial number information of the multiple host machines to determine the matching relationship between the multiple virtual machines and the multiple host machines.

[0014] In one embodiment, the method further includes: determining the resource utilization of the multiple host machines after allocating the multiple virtual machines to the multiple host machines according to the matching relationship; and adjusting the matching relationship when the resource utilization is less than or equal to a preset resource utilization threshold.

[0015] In a second aspect, the present application further provides a device for matching a virtual machine and a host machine, comprising:

[0016] A first acquisition module is used to obtain CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of multiple virtual machines to be created, and determine the load energy consumption of the multiple virtual machines based on the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption;

[0017] a second acquisition module, configured to acquire first utilization rates of a plurality of host machines used to create the plurality of virtual machines, and second utilization rates of smart network cards of the plurality of host machines, and determine a comprehensive utilization rate of the plurality of host machines based on the first utilization rate and the second utilization rate;

[0018] The determination module is configured to determine a matching relationship between the multiple virtual machines and the multiple host machines according to the load energy consumption of the multiple virtual machines and the comprehensive utilization rates of the multiple host machines.

[0019] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in any embodiment of the first aspect are implemented.

[0020] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any embodiment of the first aspect above.

[0021] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method described in any embodiment of the first aspect above.

[0022] The above-mentioned virtual machine and host matching method, device, computer equipment, computer-readable storage medium and computer program product first obtain the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of the multiple virtual machines to be created, and determine the load energy consumption of the multiple virtual machines based on the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption, then obtain the first utilization rate of the multiple host machines used to create the multiple virtual machines, and the second utilization rate of the smart network card of the multiple host machines, and determine the comprehensive utilization rate of the multiple host machines based on the first utilization rate and the second utilization rate, and then determine the matching relationship between the multiple virtual machines and the multiple host machines based on the load energy consumption of the multiple virtual machines and the comprehensive utilization rate of the multiple host machines. The virtual machine and host matching method provided in the present application determines the matching relationship between the two based on the load energy consumption of multiple virtual machines and the comprehensive utilization rate of multiple host machines. Compared with the random matching in the prior art, it can maximize resource utilization and avoid the occurrence of resource waste problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0024] Figure 1 1 is a flow chart of a method for matching a virtual machine and a host machine in one embodiment;

[0025] Figure 2 A flowchart of a method for obtaining CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption of multiple virtual machines to be created in one embodiment;

[0026] Figure 3 A flowchart of a method for obtaining first CPU utilization, first memory utilization, first disk utilization, and network utilization of multiple virtual machines in one embodiment;

[0027] Figure 4 A flowchart of a method for obtaining first utilization rates of multiple host machines for creating multiple virtual machines in one embodiment is provided;

[0028] Figure 5 A flowchart of a method for determining a matching relationship between multiple virtual machines and multiple host machines in one embodiment is provided;

[0029] Figure 6 a schematic diagram of matching relationship in one embodiment;

[0030] Figure 7 a schematic diagram of the flow of the method of adjusting matching relationship in one embodiment;

[0031] Figure 8 a schematic diagram of the flow of the method of matching virtual machine and host in another embodiment;

[0032] Figure 9 a structural block diagram of the matching device of virtual machine and host in one embodiment;

[0033] Figure 10 an internal structure diagram of computer equipment in one embodiment;

[0034] Figure 11 an internal structure diagram of computer equipment in another embodiment. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not to limit the present application.

[0036] The intelligent network card integrates the processor and network functions, can perform diversified computing tasks in network traffic, effectively reduces the load of the host CPU, and significantly improves the network performance and efficiency. With these advantages, the intelligent network card has become a key component of the data center network and is widely used in host and virtual machine instances to help achieve higher network throughput, lower latency and better security.

[0037] In the prior art, a host is usually randomly determined from multiple hosts for building a virtual machine.

[0038] However, this method of randomly selecting a host to build a virtual machine cannot maximize resource utilization and has the problem of resource waste.

[0039] Therefore, the present application provides a method of matching virtual machines and hosts, which determines the matching relationship between the two according to the load energy consumption of multiple virtual machines and the comprehensive utilization rate of multiple hosts. Compared with the random matching in the prior art, the present application can maximize resource utilization and avoid resource waste.

[0040] The matching method of virtual machines and hosts provided by the present application can be executed by a computer device, which can be a terminal or a server.

[0041] In an exemplary embodiment, Figure 1 As shown, a method for matching a virtual machine and a host machine is provided, the method comprising the following steps:

[0042] Step 101: Obtain CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption of multiple virtual machines to be created, and determine load energy consumption of the multiple virtual machines based on the CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption.

[0043] A virtual machine (VM) is a technology that simulates an independent operating system environment on a physical computer. Using virtualization technology, a VM can run multiple virtual instances on the same physical computer, each of which can run an operating system and applications like a separate computer.

[0044] The CPU (Central Processing Unit) is the core computing unit of a computer system, responsible for processing instructions, executing calculations, and controlling data flows. CPU energy consumption refers to the amount of electrical power consumed by the CPU while a virtual machine is running.

[0045] Memory is a storage device in a computer system used to temporarily store data and program instructions. The CPU can directly read and write data in memory. Memory energy consumption refers to the energy consumed by the memory occupied by virtual machines.

[0046] Disks are hardware devices used to permanently store data in computer systems. Disk energy consumption refers to the energy consumed by disks used by virtual machines.

[0047] Network energy consumption refers to the energy consumed by a virtual machine when transmitting data through a virtual network interface. Load energy consumption refers to the total energy consumption of a virtual machine under a specific workload.

[0048] In some exemplary embodiments, the computer device may first obtain CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption of multiple virtual machines to be created.

[0049] Furthermore, after obtaining the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of multiple virtual machines to be created, the computer device can determine the load energy consumption of the multiple virtual machines based on the CPU energy consumption, the memory energy consumption, disk energy consumption and network energy consumption.

[0050] Specifically, the load energy consumption of any virtual machine among the multiple virtual machines can be expressed as , the CPU energy consumption can be expressed as , the memory energy consumption can be expressed as , the disk energy consumption can be expressed as The network energy consumption can be represented as Then .

[0051] In step 102, the computer device obtains a first utilization rate of a plurality of host machines for creating the plurality of virtual machines and a second utilization rate of intelligent network cards of the plurality of host machines, and determines a comprehensive utilization rate of the plurality of host machines according to the first utilization rate and the second utilization rate.

[0052] A host machine (PM, Physical Machine) refers to a physical computer for hosting and running virtualization software and its virtual machines. The host machine can provide hardware resources to the virtual machines, allowing multiple virtual machines to share the resources. The host machine can run a virtualization platform to implement virtualization functions and manage the creation, configuration, and running of virtual machines.

[0053] The first utilization rate of the host machine refers to the utilization rate of the physical resources of the host machine itself.

[0054] An intelligent network card (DPU, Data Processing Unit) refers to a device that integrates a processor and network functions to offload network processing tasks of the host machine and reduce CPU load.

[0055] The second utilization rate of the intelligent network card refers to the resource utilization rate of the intelligent network card on the host machine.

[0056] In some exemplary embodiments, the computer device can obtain a first utilization rate of a plurality of host machines for creating the plurality of virtual machines and a second utilization rate of intelligent network cards of the plurality of host machines.

[0057] Further, after obtaining the first utilization rate of the plurality of host machines for creating the plurality of virtual machines and the second utilization rate of the intelligent network cards of the plurality of host machines, the computer device can determine a comprehensive utilization rate of the plurality of host machines according to the first utilization rate and the second utilization rate.

[0058] Specifically, the computer device can directly determine the comprehensive utilization rate of the plurality of host machines according to the first utilization rate and the second utilization rate.

[0059] The computer device can also first determine a weight value corresponding to the first utilization rate and a weight value corresponding to the second utilization rate, and then determine the comprehensive utilization rate of the plurality of host machines according to the weight value corresponding to the first utilization rate, the weight value corresponding to the second utilization rate, the first utilization rate, and the second utilization rate.

[0060] In step 103, the computer device determines a matching relationship between the plurality of virtual machines and the plurality of host machines according to the load energy consumption of the plurality of virtual machines and the comprehensive utilization rate of the plurality of host machines.

[0061] The matching relationship is used to indicate which virtual machine among the multiple virtual machines each host machine is used to create.

[0062] In some exemplary embodiments, after obtaining the load energy consumption of multiple virtual machines and the comprehensive utilization rate of multiple host machines, the computer device can determine the matching relationship between the multiple virtual machines and the multiple host machines based on the load energy consumption of the multiple virtual machines and the comprehensive utilization rate of the multiple host machines.

[0063] Specifically, the computer device can determine the matching relationship between the multiple virtual machines and the multiple host machines based on the load energy consumption of the multiple virtual machines and the comprehensive utilization rate of the multiple host machines based on the particle swarm optimization algorithm. This particle swarm optimization algorithm simulates the group behavior of a flock of birds to find the optimal solution. The algorithm can use recursive sorting To achieve this, iterate the task allocation of each task on all virtual machines. In the worst case, , where n is the number of virtual machines.

[0064] For example, the multiple virtual machines include virtual machine A1, virtual machine A2, virtual machine A3, virtual machine A4 and virtual machine A5, and the multiple host machines include host machine B1, host machine B2, host machine B3, host machine B4 and host machine B5. The matching relationship can be shown in Table 1.

[0065] Table 1

[0066]

[0067] The above-mentioned method for matching virtual machines and host machines first obtains the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of the multiple virtual machines to be created, and determines the load energy consumption of the multiple virtual machines based on the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption, then obtains the first utilization of the multiple host machines used to create the multiple virtual machines, and the second utilization of the smart network cards of the multiple host machines, and determines the comprehensive utilization of the multiple host machines based on the first utilization and the second utilization, and then determines the matching relationship between the multiple virtual machines and the multiple host machines based on the load energy consumption of the multiple virtual machines and the comprehensive utilization of the multiple host machines. The method for matching virtual machines and host machines provided in the present application determines the matching relationship between the two based on the load energy consumption of multiple virtual machines and the comprehensive utilization of multiple host machines. Compared with the random matching in the prior art, it can maximize resource utilization and avoid the occurrence of resource waste problems.

[0068] In an exemplary embodiment, Figure 2 As shown, obtaining the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of multiple virtual machines to be created includes the following steps:

[0069] Step 201: Obtain a first CPU utilization, a first memory utilization, a first disk utilization, and a network utilization of the multiple virtual machines.

[0070] The first CPU utilization of a virtual machine depends on the workload it is running. For example, if the first CPU utilization of a virtual machine is 0.8, it means that it uses 80% of the CPU.

[0071] A virtual machine's network utilization is a dimensionless metric that typically represents the number of network packets, the rate of network traffic, or other measures of network activity. For example, an increase in network load causes the virtual machine to require more resources to process data, thereby increasing the virtual machine's dynamic power consumption.

[0072] In some exemplary embodiments, the computer device may first obtain a first CPU utilization, a first memory utilization, a first disk utilization, and a network utilization of the plurality of virtual machines.

[0073] Step 202: Determine the CPU energy consumption of the multiple virtual machines according to the CPU static power consumption, CPU dynamic power consumption, and the first CPU utilization of the multiple virtual machines.

[0074] CPU static power consumption refers to the basic power consumption of the CPU when it is idle or in low load state.

[0075] CPU dynamic power consumption refers to the additional power consumption that the CPU consumes as the workload increases.

[0076] In some exemplary embodiments, after obtaining the first CPU utilization rates of the multiple virtual machines, the computer device may further obtain the CPU static power consumption and the CPU dynamic power consumption of the multiple virtual machines.

[0077] Furthermore, after obtaining the CPU static power consumption and CPU dynamic power consumption of the multiple virtual machines, the computer device may determine the CPU energy consumption of the multiple virtual machines according to the CPU static power consumption, CPU dynamic power consumption and the first CPU utilization of the multiple virtual machines.

[0078] Specifically, the CPU energy consumption of the virtual machine can be expressed as , the CPU static power consumption can be expressed as , the CPU dynamic power consumption can be expressed as , the first CPU utilization can be expressed as ,but .

[0079] Step 203: Determine the memory energy consumption of the multiple virtual machines according to the memory static power consumption, memory dynamic power consumption, and the first memory utilization of the multiple virtual machines.

[0080] Memory static power consumption refers to the basic power consumption of memory in idle state.

[0081] Memory dynamic power consumption refers to the incremental dynamic power consumption that increases as the access frequency increases when the memory is in an active state.

[0082] In some exemplary embodiments, after obtaining the first memory utilization of the multiple virtual machines, the computer device may further obtain the memory static power consumption and the memory dynamic power consumption of the multiple virtual machines.

[0083] Furthermore, after obtaining the memory static power consumption and memory dynamic power consumption of the multiple virtual machines, the computer device can determine the memory energy consumption of the multiple virtual machines based on the memory static power consumption, memory dynamic power consumption and the first memory utilization of the multiple virtual machines.

[0084] Specifically, the memory energy consumption of the virtual machine can be expressed as , the static power consumption of the memory can be expressed as , the memory dynamic power consumption can be expressed as , the first memory utilization can be expressed as ,but .

[0085] Step 204 : Determine the disk energy consumption of the multiple virtual machines according to the disk static power consumption, disk dynamic power consumption, and the first disk utilization of the multiple virtual machines.

[0086] Disk static power consumption refers to the basic power consumption of the disk in idle state.

[0087] Disk dynamic power consumption refers to the incremental dynamic power consumption that increases as the access frequency increases when the disk is in active state.

[0088] In some exemplary embodiments, after obtaining the first disk utilization of the multiple virtual machines, the computer device may further obtain the disk static power consumption and the disk dynamic power consumption of the multiple virtual machines.

[0089] Furthermore, after obtaining the disk static power consumption and disk dynamic power consumption of the multiple virtual machines, the computer device can determine the disk energy consumption of the multiple virtual machines according to the disk static power consumption, disk dynamic power consumption and the first disk utilization.

[0090] Specifically, the disk energy consumption of a virtual machine can be expressed as , the static power consumption of the disk can be expressed as , the dynamic power consumption of the disk can be expressed as , the first disk utilization can be expressed as ,but .

[0091] Step 205: Determine the network energy consumption of the multiple virtual machines according to the network static power consumption, the network dynamic power consumption, and the network utilization of the multiple virtual machines.

[0092] Network static power consumption refers to the energy consumed by virtual machines when they are idle or lightly loaded.

[0093] Network dynamic power consumption refers to the additional power consumption when a virtual machine processes a unit of network load.

[0094] In some exemplary embodiments, after obtaining the network utilization rates of the multiple virtual machines, the computer device may further obtain the network static power consumption and the network dynamic power consumption of the multiple virtual machines.

[0095] Furthermore, after obtaining the network static power consumption and network dynamic power consumption of the multiple virtual machines, the computer device may determine the network energy consumption of the multiple virtual machines according to the network static power consumption, network dynamic power consumption and the network utilization of the multiple virtual machines.

[0096] Specifically, it can be expressed as , the network static power consumption can be expressed as , the dynamic power consumption of the network can be expressed as , the network utilization can be expressed as ,but .

[0097] In an exemplary embodiment, Figure 3 As shown, obtaining the first CPU utilization, the first memory utilization, the first disk utilization, and the network utilization of the multiple virtual machines includes the following steps:

[0098] Step 301: Obtain CPU monitoring durations and CPU idle durations of the multiple virtual machines, and determine first CPU utilizations of the multiple virtual machines based on the CPU monitoring durations and the CPU idle durations.

[0099] The CPU monitoring duration refers to the total length of time the VM's CPU performance is monitored. The CPU idle duration refers to the total amount of time the VM's CPU is idle during the monitoring process.

[0100] In some exemplary embodiments, the computer device may first obtain CPU monitoring durations and CPU idle durations of multiple virtual machines.

[0101] Furthermore, after obtaining the CPU monitoring durations and CPU idle durations of the multiple virtual machines, the computer device may determine first CPU utilizations of the multiple virtual machines according to the CPU monitoring durations and the CPU idle durations.

[0102] Specifically, the first CPU utilization can be expressed as ,but .

[0103] Step 302: Obtain the total memory amount, free memory amount, buffer memory amount and cache memory amount of the multiple virtual machines, and determine the first memory utilization of the multiple virtual machines based on the total memory amount, the free memory amount, the buffer memory amount and the cache memory amount.

[0104] In some exemplary embodiments, the computer device may first obtain the total amount of memory, the amount of free memory, the amount of buffer memory, and the amount of cache memory of the multiple virtual machines.

[0105] Furthermore, after obtaining the total memory amount, free memory amount, buffer memory amount and cache memory amount of multiple virtual machines, the computer device can determine the first memory utilization of the multiple virtual machines based on the total memory amount, the free memory amount, the buffer memory amount and the cache memory amount.

[0106] Specifically, the first memory utilization can be expressed as , the total amount of memory can be expressed as , the amount of free memory can be expressed as , the amount of buffer memory can be expressed as , the amount of cache memory can be expressed as ,but .

[0107] Step 303: Obtain the number of disk storage allocation units, the used disk storage, and the total disk storage of the multiple virtual machines, and determine the first disk utilization of the multiple virtual machines based on the number of disk storage allocation units, the used disk storage, and the total disk storage.

[0108] In some exemplary embodiments, the computer device may first obtain the number of disk storage allocation units, the used disk storage capacity, and the total disk storage capacity of the multiple virtual machines.

[0109] Furthermore, after obtaining the number of disk storage allocation units, the used disk storage and the total disk storage of the multiple virtual machines, the computer device can determine the first disk utilization of the multiple virtual machines based on the number of disk storage allocation units, the used disk storage and the total disk storage.

[0110] Specifically, the first disk utilization can be expressed as , the number of disk storage allocation units can be expressed as , the amount of storage used by the disk can be expressed as The total amount of disk storage can be expressed as ,but .

[0111] Step 304: Obtain the number of data bits transmitted by the multiple virtual machines during the monitoring period, the network bandwidth, and the monitoring time interval, and determine the network utilization of the multiple virtual machines based on the number of data bits, the network bandwidth, and the monitoring time interval.

[0112] The number of data bits transmitted during the monitoring period refers to the number of data bits transmitted by the virtual machine over the network during a specific time interval during the monitoring period.

[0113] In some exemplary embodiments, the computer device may obtain the number of data bits transmitted by the multiple virtual machines during the monitoring period, the network bandwidth, and the monitoring time interval.

[0114] Furthermore, after obtaining the number of data bits transmitted by the multiple virtual machines during the monitoring period, the network bandwidth, and the monitoring time interval, the computer device can determine the network utilization of the multiple virtual machines based on the number of data bits, the network bandwidth, and the monitoring time interval.

[0115] Specifically, the network utilization of the virtual machine can be expressed as , the number of bits can be expressed as , the network bandwidth can be expressed as , the monitoring time interval can be expressed as ,but .

[0116] In an exemplary embodiment, Figure 4 As shown, obtaining the first utilization of the plurality of host machines used to create the plurality of virtual machines includes the following steps:

[0117] Step 401: Obtain a second CPU utilization, a second disk utilization, and a second memory utilization of the multiple host machines.

[0118] In some exemplary embodiments, the computer device may obtain the second CPU utilization of the multiple host machines.

[0119] Specifically, the computer device may collect idle statistics based on the System Activity Reporter to obtain an average value of the CPU utilization of the host machine, and determine the average value as the second CPU utilization.

[0120] Furthermore, the computer device may also obtain a second disk utilization rate. Specifically, the second disk utilization rate may be determined in the same manner as the first disk utilization rate.

[0121] Furthermore, the computer device may also obtain the second memory utilization rate. Specifically, the second memory utilization rate may be determined in the same manner as the first memory utilization rate.

[0122] Step 402: Determine a first weight value corresponding to the second CPU utilization, a second weight value corresponding to the second disk utilization, and a third weight value corresponding to the second memory utilization based on an entropy weight method.

[0123] The entropy weight method is a method for determining the weight of an indicator based on the degree of dispersion of the data itself. The greater the degree of dispersion, that is, the smaller the information entropy, the more information the indicator provides and the greater the weight.

[0124] In some exemplary embodiments, after obtaining the second CPU utilization, second disk utilization, and second memory utilization of the multiple host machines, the computer device can determine a first weight value corresponding to the second CPU utilization, a second weight value corresponding to the second disk utilization, and a third weight value corresponding to the second memory utilization based on an entropy weight method.

[0125] Specifically, for each indicator U i , which includes multiple n sample data, that is, U i ={U i1 , U i2 , U i3 ,...,U in Computer equipment can be Each sample data in this indicator is standardized and can be The value proportion of this indicator is calculated.

[0126] Furthermore, for each indicator Ui, the computer device can Calculate its information entropy, the formula is the normalization coefficient, ensuring that the value of information entropy is between [0, 1]. The more uniform the distribution, the greater the information entropy; conversely, when a When it approaches 1 and the others approach 0, the smaller the information entropy is, the smaller the information entropy is, which means that the indicator data has a large degree of dispersion and provides more effective information.

[0127] Furthermore, after determining the information entropy of each indicator, the computer device can determine the weight of each indicator. , , where k is the number of indicators. Finally, the computer device can also normalize the weights of each indicator so that the sum of the weights is 1.

[0128] Step 403: Determine the first utilization of the multiple host machines according to the first weight value, the second weight value, the third weight value, the second CPU utilization, the second disk utilization, and the second memory utilization.

[0129] In some exemplary embodiments, after the computer device determines the first weight value corresponding to the second CPU utilization, the second weight value corresponding to the second disk utilization, and the third weight value corresponding to the second memory utilization based on the entropy weight method, it can determine the first utilization of the multiple host machines based on the first weight value, the second weight value, the third weight value, the second CPU utilization, the second disk utilization, and the second memory utilization.

[0130] Specifically, the first weight value can be expressed as , the second weight value can be expressed as , the third weight value can be expressed as , the second CPU utilization can be expressed as , the second disk utilization can be expressed as , the second memory utilization can be expressed as , the first utilization can be expressed as ,but .

[0131] In an optional embodiment of the present application, determining the comprehensive utilization of the plurality of host machines according to the first utilization and the second utilization includes:

[0132] Based on the entropy weight method, a fourth weight value corresponding to the first utilization rate and a fifth weight value corresponding to the second utilization rate are determined; and a comprehensive utilization rate of multiple host machines is determined according to the first utilization rate, the second utilization rate, the fourth weight value and the fifth weight value.

[0133] In some exemplary embodiments, the first utilization rate can be expressed as , the second utilization rate can be expressed as , the fourth weight value can be expressed as , the fifth weight value can be expressed as , the comprehensive utilization rate can be expressed as ,but .

[0134] In addition to the entropy weight method, the fourth weight value corresponding to the first utilization rate and the fifth weight value corresponding to the second utilization rate can also be determined according to actual needs. For example, according to the business scenario, if the business scenario is network-based, such as large-scale network data transmission, network service provision, etc., you can choose If the business scenario is an enhanced virtual machine with high requirements for memory, CPU, and disk, you can choose Too big.

[0135] In an exemplary embodiment, Figure 5As shown, the matching relationship of the plurality of virtual machines and the plurality of host computers is determined according to the load energy consumption of the plurality of virtual machines and the comprehensive utilization rate of the plurality of host computers, and includes the following steps:

[0136] In step 501, the plurality of virtual machines are sorted in descending order according to the load energy consumption of the plurality of virtual machines to obtain sequence number information of the plurality of virtual machines.

[0137] In some exemplary embodiments, after obtaining the load energy consumption of the plurality of virtual machines, the computer device can sort the plurality of virtual machines in descending order according to the load energy consumption of the plurality of virtual machines to obtain sequence number information of the plurality of virtual machines.

[0138] Specifically, assuming that the plurality of virtual machines include A1, A2, A3, A4, and A5, and the plurality of virtual machines correspond to load energy consumption X1, X2, X3, X4, and X5, the plurality of virtual machines are sorted in descending order according to the load energy consumption, and the sorting result is A2, A4, A1, A5, and A3. Therefore, the sequence number information of virtual machine A1 is 3, the sequence number information of virtual machine A2 is 1, the sequence number information of virtual machine A3 is 5, the sequence number information of virtual machine A4 is 2, and the sequence number information of virtual machine A5 is 4.

[0139] In step 502, the plurality of host computers are sorted in ascending order according to the comprehensive utilization rate of the plurality of host computers to obtain sequence number information of the plurality of host computers.

[0140] In some exemplary embodiments, after obtaining the comprehensive utilization rate of the plurality of host computers, the computer device can sort the plurality of host computers in ascending order according to the comprehensive utilization rate of the plurality of host computers to obtain sequence number information of the plurality of host computers.

[0141] Specifically, assuming that the plurality of host computers include B1, B2, B3, B4, and B5, and the plurality of virtual machines correspond to comprehensive utilization rate Y1, Y2, Y3, Y4, and Y5, the plurality of host computers are sorted in ascending order according to the comprehensive utilization rate, and the sorting result is B1, B3, B4, B2, and B5. Therefore, the sequence number information of host computer B1 is 1, the sequence number information of host computer B2 is 4, the sequence number information of host computer B3 is 2, the sequence number information of host computer B4 is 3, and the sequence number information of host computer B5 is 5.

[0142] In step 503, the virtual machines and the host computers with the same sequence number indicated by the sequence number information are matched according to the sequence number information of the plurality of virtual machines and the sequence number information of the plurality of host computers to determine the matching relationship of the plurality of virtual machines and the plurality of host computers.

[0143] In some exemplary embodiments, after obtaining the serial number information of the multiple virtual machines and the serial number information of the multiple host machines, the computer device can match the virtual machines and host machines with the same serial numbers indicated by the serial number information based on the serial number information of the multiple virtual machines and the serial number information of the multiple host machines to determine the matching relationship between the multiple virtual machines and the multiple host machines.

[0144] Specifically, if the serial number information of the virtual machine A2 is the same as the serial number indicated by the serial number information of the host machine B1, it can be determined that the virtual machine A2 and the host machine B1 match; if the serial number information of the virtual machine A4 is the same as the serial number indicated by the serial number information of the host machine B3, it can be determined that the virtual machine A4 and the host machine B3 match; if the serial number information of the virtual machine A1 is the same as the serial number indicated by the serial number information of the host machine B4, it can be determined that the virtual machine A1 and the host machine B4 match; if the serial number information of the virtual machine A5 is the same as the serial number indicated by the serial number information of the host machine B2, it can be determined that the virtual machine A5 and the host machine B2 match; if the serial number information of the virtual machine A3 is the same as the serial number indicated by the serial number information of the host machine B5, it can be determined that the virtual machine A3 and the host machine B5 match.

[0145] like Figure 6 As shown, this matching method is to allocate lightweight virtual machines to hosts with high comprehensive utilization rates, and allocate heavy-load virtual machines to hosts with low comprehensive utilization rates, so as to maximize resource utilization and avoid resource waste.

[0146] In an exemplary embodiment, Figure 7 As shown, the method further includes the following steps:

[0147] Step 701: Determine resource utilization rates of the multiple host machines after the multiple virtual machines are allocated to the multiple host machines according to the matching relationship.

[0148] In an exemplary embodiment, after obtaining the matching relationship between the multiple virtual machines and the multiple host machines, the computer device may determine resource utilization rates of the multiple host machines after allocating the multiple virtual machines to the multiple host machines according to the matching relationship.

[0149] Specifically, the computer device may simulate a scenario in which the multiple virtual machines are allocated to corresponding host machines according to the matching relationship, and determine resource utilization rates of the multiple host machines after the simulation.

[0150] Step 702: When the resource utilization is less than or equal to a preset resource utilization threshold, adjust the matching relationship.

[0151] Optionally, the preset resource utilization threshold may be pre-set by a technician based on actual needs, and may be 80%.

[0152] In some exemplary embodiments, after determining the resource utilization of the multiple host machines after allocating the multiple virtual machines to the multiple host machines according to the matching relationship, the computer device may obtain a preset resource utilization threshold.

[0153] Furthermore, after obtaining the preset resource utilization threshold, the computer device may determine whether the resource utilization of the multiple host machines is less than or equal to the preset resource utilization threshold.

[0154] If the resource utilization is less than or equal to the preset resource utilization threshold, the matching relationship is adjusted, that is, the virtual machine corresponding to the host machine to be adjusted whose resource utilization is less than or equal to the preset resource utilization threshold is determined as the virtual machine to be adjusted, and the virtual machine to be adjusted is allocated to a new host machine whose comprehensive utilization is higher than the host machine to be adjusted to determine a new matching relationship. After determining the new matching relationship, continue to execute this step until the resource utilization of the host machine is greater than the preset resource utilization threshold.

[0155] For example, the matching relationship indicates that virtual machine A2 matches host machine B4. The computer device simulates the scenario of allocating virtual machine A2 to host machine B4, and obtains the resource utilization of host machine B4 after allocating virtual machine A2 to host machine B4. If the resource utilization is less than the preset resource utilization threshold, the virtual machine can be allocated to host machine B2 whose comprehensive utilization is slightly greater than that of host machine B4 to determine a new matching relationship.

[0156] In an exemplary embodiment, Figure 8 As shown, another method for matching a virtual machine and a host machine is provided, the method comprising the following steps:

[0157] Step 801: Obtain CPU monitoring duration and CPU idle duration of multiple virtual machines, and determine first CPU utilization of the multiple virtual machines based on the CPU monitoring duration and CPU idle duration; obtain the total memory, free memory, buffer memory, and cache memory of the multiple virtual machines, and determine first memory utilization of the multiple virtual machines based on the total memory, free memory, buffer memory, and cache memory; obtain the number of disk storage allocation units, used disk storage, and total disk storage of the multiple virtual machines, and determine first disk utilization of the multiple virtual machines based on the number of disk storage allocation units, used disk storage, and total disk storage; obtain the number of data bits transmitted by the multiple virtual machines during the monitoring time period, the network bandwidth, and the monitoring time interval, and determine network utilization of the multiple virtual machines based on the number of data bits, the network bandwidth, and the monitoring time interval;

[0158] Step 802: Determine CPU energy consumption of the multiple virtual machines based on CPU static power consumption, CPU dynamic power consumption, and a first CPU utilization rate of the multiple virtual machines; determine memory energy consumption of the multiple virtual machines based on memory static power consumption, memory dynamic power consumption, and a first memory utilization rate of the multiple virtual machines; determine disk energy consumption of the multiple virtual machines based on disk static power consumption, disk dynamic power consumption, and a first disk utilization rate of the multiple virtual machines; determine network energy consumption of the multiple virtual machines based on network static power consumption, network dynamic power consumption, and network utilization rates of the multiple virtual machines; and determine load energy consumption of the multiple virtual machines based on CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption.

[0159] Step 803: Obtain the second CPU utilization, the second disk utilization, and the second memory utilization of the multiple host machines; determine a first weight value corresponding to the second CPU utilization, a second weight value corresponding to the second disk utilization, and a third weight value corresponding to the second memory utilization based on the entropy weight method; determine the first utilization of the multiple host machines according to the first weight value, the second weight value, the third weight value, the second CPU utilization, the second disk utilization, and the second memory utilization; obtain the second utilization of the smart network cards of the multiple host machines, and determine the comprehensive utilization of the multiple host machines according to the first utilization and the second utilization;

[0160] Step 804: Sort the multiple virtual machines in descending order based on the load energy consumption of the multiple virtual machines to obtain sequence number information of the multiple virtual machines; sort the multiple host machines in ascending order based on the comprehensive utilization rates of the multiple host machines to obtain sequence number information of the multiple host machines; and match the virtual machines and host machines having the same sequence number indicated by the sequence information based on the sequence number information of the multiple virtual machines and the sequence number information of the multiple host machines to determine a matching relationship between the multiple virtual machines and the multiple host machines.

[0161] Step 805: Determine resource utilization of the multiple host machines after allocating the multiple virtual machines to the multiple host machines according to the matching relationship; if the resource utilization is less than or equal to a preset resource utilization threshold, adjust the matching relationship.

[0162] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0163] Based on the same inventive concept, embodiments of the present application also provide a device for matching a seed virtual machine with a host machine, for implementing the aforementioned method for matching a seed virtual machine with a host machine. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more embodiments of the device for matching a seed virtual machine with a host machine provided below can be found in the aforementioned method for matching a seed virtual machine with a host machine, and will not be further elaborated here.

[0164] In an exemplary embodiment, Figure 9 As shown, a matching device 900 for a virtual machine and a host machine is provided, comprising: a first acquisition module 901, a second acquisition module 902 and a determination module 903, wherein:

[0165] The first acquisition module 901 is used to obtain CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of multiple virtual machines to be created, and determine the load energy consumption of the multiple virtual machines based on the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption;

[0166] A second acquisition module 902 is configured to acquire first utilization rates of multiple host machines used to create the multiple virtual machines and second utilization rates of smart network cards of the multiple host machines, and determine a comprehensive utilization rate of the multiple host machines based on the first utilization rate and the second utilization rate;

[0167] The determination module 903 is configured to determine a matching relationship between the multiple virtual machines and the multiple host machines according to the load energy consumption of the multiple virtual machines and the comprehensive utilization rates of the multiple host machines.

[0168] In one embodiment, the first acquisition module 901 is specifically used to obtain the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of multiple virtual machines to be created, and determine the load energy consumption of the multiple virtual machines based on the CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption; obtain the first utilization of multiple host machines used to create the multiple virtual machines, and the second utilization of the smart network cards of the multiple host machines, and determine the comprehensive utilization of the multiple host machines based on the first utilization and the second utilization; determine the matching relationship between the multiple virtual machines and the multiple host machines based on the load energy consumption of the multiple virtual machines and the comprehensive utilization of the multiple host machines.

[0169] In one embodiment, the first acquisition module 901 is specifically used to obtain the CPU monitoring time and CPU idle time of the multiple virtual machines, and determine the first CPU utilization of the multiple virtual machines based on the CPU monitoring time and the CPU idle time; obtain the total memory, free memory, buffer memory and cache memory of the multiple virtual machines, and determine the first memory utilization of the multiple virtual machines based on the total memory, the free memory, the buffer memory and the cache memory; obtain the number of disk storage allocation units, the used disk storage and the total disk storage of the multiple virtual machines, and determine the first disk utilization of the multiple virtual machines based on the number of disk storage allocation units, the used disk storage and the total disk storage; obtain the number of data bits transmitted by the multiple virtual machines during the monitoring time period, the network bandwidth and the monitoring time interval, and determine the network utilization of the multiple virtual machines based on the number of data bits, the network bandwidth and the monitoring time interval.

[0170] In one embodiment, the second acquisition module 902 is specifically used to obtain the second CPU utilization, second disk utilization and second memory utilization of the multiple host machines; determine the first weight value corresponding to the second CPU utilization, the second weight value corresponding to the second disk utilization and the third weight value corresponding to the second memory utilization based on the entropy weight method; determine the first utilization of the multiple host machines according to the first weight value, the second weight value, the third weight value, the second CPU utilization, the second disk utilization and the second memory utilization.

[0171] In one embodiment, the determination module 903 is specifically used to sort the multiple virtual machines in descending order based on the load energy consumption of the multiple virtual machines to obtain serial number information of the multiple virtual machines; sort the multiple host machines in ascending order based on the comprehensive utilization rate of the multiple host machines to obtain serial number information of the multiple host machines; and match the virtual machines and host machines with the same serial numbers indicated by the serial number information according to the serial number information of the multiple virtual machines and the serial number information of the multiple host machines to determine the matching relationship between the multiple virtual machines and the multiple host machines.

[0172] In one embodiment, the determination device 903 is also used to determine the resource utilization of the multiple host machines after the multiple virtual machines are allocated to the multiple host machines according to the matching relationship; when the resource utilization is less than or equal to the preset resource utilization threshold, the matching relationship is adjusted.

[0173] Each module in the aforementioned virtual machine and host machine matching device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0174] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for matching a virtual machine and a host machine is implemented.

[0175] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 11As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, a method for matching a virtual machine and a host machine is implemented.

[0176] Those skilled in the art will understand that Figure 10 and Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0177] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the method described in any one of the above embodiments when executing the computer program.

[0178] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0179] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the method described in any one of the above embodiments when executed by a processor.

[0180] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. 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. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0181] The technical features of the above embodiments can be combined arbitrarily. In order 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 application.

[0182] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for matching a virtual machine and a host machine, characterized in that: The method comprises: Obtaining CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption of multiple virtual machines to be created, and determining load energy consumption of the multiple virtual machines based on the CPU energy consumption, the memory energy consumption, the disk energy consumption, and the network energy consumption; Obtaining first utilization rates of multiple host machines used to create the multiple virtual machines and second utilization rates of smart network cards of the multiple host machines, and determining a comprehensive utilization rate of the multiple host machines based on the first utilization rate and the second utilization rate; According to the load energy consumption of the multiple virtual machines and the comprehensive utilization rate of the multiple host machines, a matching relationship between the multiple virtual machines and the multiple host machines is determined.

2. The method according to claim 1, characterized in that The obtaining of CPU energy consumption, memory energy consumption, disk energy consumption, and network energy consumption of the multiple virtual machines to be created includes: Obtaining first CPU utilization, first memory utilization, first disk utilization, and network utilization of the multiple virtual machines; Determine the CPU energy consumption of the multiple virtual machines according to the CPU static power consumption, CPU dynamic power consumption and the first CPU utilization of the multiple virtual machines; Determining memory energy consumption of the multiple virtual machines according to the memory static power consumption, memory dynamic power consumption, and the first memory utilization of the multiple virtual machines; Determine the disk energy consumption of the multiple virtual machines according to the disk static power consumption, disk dynamic power consumption and the first disk utilization of the multiple virtual machines; The network energy consumption of the multiple virtual machines is determined according to the network static power consumption, the network dynamic power consumption and the network utilization of the multiple virtual machines.

3. The method according to claim 2, characterized in that The obtaining of first CPU utilization, first memory utilization, first disk utilization, and network utilization of the multiple virtual machines includes: Obtaining CPU monitoring durations and CPU idle durations of the multiple virtual machines, and determining first CPU utilizations of the multiple virtual machines based on the CPU monitoring durations and the CPU idle durations; Obtaining a total memory amount, a free memory amount, a buffer memory amount, and a cache memory amount of the multiple virtual machines, and determining a first memory utilization rate of the multiple virtual machines based on the total memory amount, the free memory amount, the buffer memory amount, and the cache memory amount; Obtaining the number of disk storage allocation units, the used disk storage, and the total disk storage of the multiple virtual machines, and determining first disk utilizations of the multiple virtual machines based on the number of disk storage allocation units, the used disk storage, and the total disk storage; The number of data bits transmitted by the multiple virtual machines during a monitoring period, the network bandwidth, and the monitoring time interval are obtained, and network utilization rates of the multiple virtual machines are determined based on the number of data bits, the network bandwidth, and the monitoring time interval.

4. The method according to claim 1, wherein The obtaining of first utilization rates of the plurality of host machines used to create the plurality of virtual machines includes: Obtaining a second CPU utilization, a second disk utilization, and a second memory utilization of the multiple host machines; Determine, based on an entropy weight method, a first weight value corresponding to the second CPU utilization, a second weight value corresponding to the second disk utilization, and a third weight value corresponding to the second memory utilization; The first utilizations of the plurality of host machines are determined according to the first weight value, the second weight value, the third weight value, the second CPU utilization, the second disk utilization, and the second memory utilization.

5. The method according to claim 1, wherein The determining, based on the load energy consumption of the multiple virtual machines and the comprehensive utilization rates of the multiple host machines, a matching relationship between the multiple virtual machines and the multiple host machines includes: Sorting the multiple virtual machines in descending order based on the load energy consumption of the multiple virtual machines to obtain sequence number information of the multiple virtual machines; Sort the multiple host machines in ascending order based on comprehensive utilization rates of the multiple host machines to obtain sequence number information of the multiple host machines; According to the sequence number information of the multiple virtual machines and the sequence number information of the multiple host machines, the virtual machines and host machines having the same sequence number indicated by the sequence number information are matched to determine a matching relationship between the multiple virtual machines and the multiple host machines.

6. The method according to claim 1, characterized in that The method further comprises: Determining resource utilization rates of the multiple host machines after allocating the multiple virtual machines to the multiple host machines according to the matching relationship; When the resource utilization is less than or equal to a preset resource utilization threshold, the matching relationship is adjusted.

7. A device for matching a virtual machine and a host machine, characterized in that: The device comprises: A first acquisition module is used to obtain CPU energy consumption, memory energy consumption, disk energy consumption and network energy consumption of multiple virtual machines to be created, and determine the load energy consumption of the multiple virtual machines based on the CPU energy consumption, the memory energy consumption, the disk energy consumption and the network energy consumption; a second acquisition module, configured to acquire first utilization rates of a plurality of host machines used to create the plurality of virtual machines, and second utilization rates of smart network cards of the plurality of host machines, and determine a comprehensive utilization rate of the plurality of host machines based on the first utilization rate and the second utilization rate; The determining module is configured to determine a matching relationship between the multiple virtual machines and the multiple host machines according to the load energy consumption of the multiple virtual machines and the comprehensive utilization rate of the multiple host machines.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. 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 method according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.