Physical machine control method and device, equipment, storage medium and program product

By monitoring the resource information of physical machines and virtual machines in real time on the cloud computing platform, dynamically adjusting power modes and migrating virtual machines, the problem of high power consumption of physical machines is solved, and more efficient energy utilization and service quality assurance is achieved.

CN120353331APending Publication Date: 2025-07-22CHINA UNIONPAY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510397843.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-31
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The prior art shuts down or switches to low-power mode only when there is no virtual machine running on a physical machine, resulting in high power consumption and lag, making it difficult to balance energy consumption and service quality.

Method used

Obtain the power mode of the physical machine and the resource request information of the virtual machine through preset periods, switch the power mode in time, and migrate the virtual machine when necessary to optimize resource utilization, and dynamically adjust the power mode and migration strategy using reinforcement learning and heuristic algorithms.

Benefits of technology

It realizes the rationality and timeliness of the power mode of the physical machine, reduces the power consumption of the physical machine, and improves the energy utilization efficiency and service quality of the data center.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353331A_ABST
    Figure CN120353331A_ABST
Patent Text Reader

Abstract

The invention discloses a physical machine control method and device, equipment, a storage medium and a program product. The method comprises the following steps: according to a preset period, acquiring a first power mode of a physical machine and resource request information of a virtual machine deployed on the physical machine; under the condition that the resource request information is larger than a first preset threshold value, the first power mode is switched to a second power mode, and the power consumption of the second power mode is higher than that of the first power mode; under the condition that the resource request information is smaller than a second preset threshold value, the first power mode is switched to a third power mode, the power consumption of the third power mode is lower than that of the first power mode, and the second preset threshold value is smaller than the first preset threshold value. According to the control method of the physical machine, the reasonability and timeliness of power mode conversion can be ensured, and the power consumption of the physical machine is further reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of cloud computing, and particularly relates to a control method, device, equipment, storage medium and program product for a physical machine. Background Art

[0002] With the development of big data technology, the huge energy consumption of data centers will cause environmental problems such as high carbon emissions, and increase the operating costs of cloud computing data centers. Therefore, it is crucial to improve the energy utilization efficiency of data centers and thus reduce the power demand of data centers.

[0003] Currently, usually when there is no virtual machine running on a physical machine, the physical machine is shut down or switched to a low-power mode to reduce the power consumption of the physical machine, thereby improving the energy utilization efficiency of the data center. However, shutting down or switching the physical machine to a low-power mode only when there is no virtual machine running on the physical machine has hysteresis, resulting in still relatively high power consumption of the physical machine. Summary of the Invention

[0004] Embodiments of this application provide a control method, device, equipment, computer-readable storage medium and computer program product for a physical machine, which can ensure the reasonableness and timeliness of power mode conversion, and thus reduce the power consumption of the physical machine.

[0005] In a first aspect, embodiments of this application provide a control method for a physical machine, and the method includes:

[0006] Obtain the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine at a preset period;

[0007] When the resource request information is greater than a first preset threshold, switch the first power mode to a second power mode, and the power consumption of the second power mode is higher than that of the first power mode;

[0008] When the resource request information is less than a second preset threshold, switch the first power mode to a third power mode, and the power consumption of the third power mode is lower than that of the first power mode, and the second preset threshold is less than the first preset threshold.

[0009] In a possible implementation, after switching the first power mode to the third power mode, the method further includes:

[0010] Determine at least some of the virtual machines deployed on the physical machine as target virtual machines;

[0011] Migrate the target virtual machine to the first physical machine, where the first physical machine is the physical machine with the lowest resource usage information among multiple second physical machines, and the power consumption of the power mode of the second physical machine is higher than that of the first power mode.

[0012] In a possible implementation, determining at least some of the virtual machines deployed on the physical machine as target virtual machines includes:

[0013] Obtain the task identifiers respectively corresponding to multiple virtual machines deployed on the physical machine;

[0014] When at least two virtual machines have the same service identifier, determine the at least two virtual machines with the same service identifier as the first virtual machine;

[0015] Determine the virtual machines other than the first virtual machine among the multiple virtual machines deployed on the physical machine as the target virtual machines.

[0016] In a possible implementation, the method further includes:

[0017] Obtain the resource capacity of the physical machine;

[0018] When the resource capacity is less than the resource request information, based on the first power mode, determine the target virtual machine that needs to be migrated among the virtual machines deployed on the physical machine;

[0019] Migrate the target virtual machine to the first physical machine, where the first physical machine is the physical machine with the lowest resource usage information among multiple second physical machines, and the power consumption of the power mode of the second physical machine is higher than that of the first power mode.

[0020] In a possible implementation, based on the first power mode, determining the target virtual machine that needs to be migrated among the virtual machines deployed on the physical machine includes:

[0021] When the first power mode is the sleep mode or the non-interrupt sleep mode, determine all the virtual machines deployed on the physical machine as the target virtual machines.

[0022] In a possible implementation, based on the first power mode, determining the target virtual machine that needs to be migrated among the virtual machines deployed on the physical machine includes:

[0023] When the first power mode is the active mode, obtain the resource requirement information respectively corresponding to each virtual machine deployed on the physical machine;

[0024] When the sum of the resource requirement information of at least one virtual machine is greater than or equal to a target difference, determine the at least one virtual machine as the target virtual machine, where the target difference is the difference between the resource capacity of the physical machine and the resource request information of the virtual machines deployed on the physical machine.

[0025] In a possible implementation, after migrating the target virtual machine to the first physical machine, the method further includes:

[0026] Obtain the number of virtual machines and the resource utilization rate of the physical machine;

[0027] Based on the number of virtual machines and the resource utilization rate, update the first power mode of the physical machine.

[0028] In a possible implementation, after updating the first power mode of the physical machine, the method further includes:

[0029] When the first power mode switches from the active mode to the sleep mode or the non-interrupt sleep mode, determine all the virtual machines deployed on the physical machine as the target virtual machines.

[0030] In a second aspect, an embodiment of the present application provides a control device for a physical machine, and the device includes:

[0031] A first acquisition module, configured to acquire the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine at a preset period;

[0032] A first switching module, configured to switch the first power mode to a second power mode when the resource request information is greater than a first preset threshold, where the power consumption of the second power mode is higher than that of the first power mode;

[0033] A second switching module, configured to switch the first power mode to a third power mode when the resource request information is less than a second preset threshold, where the power consumption of the third power mode is lower than that of the first power mode, and the second preset threshold is less than the first preset threshold.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, and the device includes: a processor and a memory storing computer program instructions;

[0035] When the processor executes the computer program instructions, the method in any possible implementation method in the first aspect is implemented.

[0036] Fourthly, embodiments of the present application provide a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the methods in any possible implementation method in the above first aspect are implemented.

[0037] Fifthly, embodiments of the present application provide a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the methods in any possible implementation method in the above first aspect.

[0038] In the embodiments of the present application, by following a preset period and based on the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine, the power mode of the physical machine is updated in a timely manner. That is, when the resource request information of the virtual machine is greater than a first preset threshold, the first power mode is switched to a second power mode with higher power consumption, and when the resource request information of the virtual machine is less than a second preset threshold, the first power mode is switched to a third power mode with the lowest power consumption, which can ensure the rationality and timeliness of the power mode conversion, and further reduce the power consumption of the physical machine. Description of the Drawings

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced below. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0040] Figure 1 is a schematic flowchart of a control method for a physical machine provided by an embodiment of the present application;

[0041] Figure 2 is a schematic flowchart of another control method for a physical machine provided by an embodiment of the present application;

[0042] Figure 3 is a schematic diagram of a control method for a physical machine provided by an embodiment of the present application;

[0043] Figure 4 is a schematic structural diagram of a control device for a physical machine provided by an embodiment of the present application;

[0044] Figure 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed Embodiments

[0045] Aspects and exemplary embodiments of the present application will be described in detail below. To make the objectives, technical solutions and advantages of the present application more clear and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.

[0046] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the said element.

[0047] In addition, the acquisition, storage, use, processing, etc. of data in the technical solution of the present application all comply with the relevant provisions of national laws and regulations.

[0048] As described in the background art section, currently, the physical machine is usually shut down or switched to a low-power mode when there is no virtual machine running on the physical machine, so as to reduce the power consumption of the physical machine, and thus improve the energy utilization efficiency of the data center. However, shutting down or switching the physical machine to the low-power mode only when there is no virtual machine running on the physical machine has a lag, resulting in a still relatively high power consumption of the physical machine.

[0049] In addition, virtual machine consolidation technology refers to a technology that deploys as many virtual machines as possible on a physical machine to improve the energy utilization efficiency of a virtualized data center. Currently, the virtual machine consolidation method usually migrates virtual machines out when the physical machine is overloaded, and assumes that the host will be shut down or switched to a low-power mode when there is no load, so as to quickly wake up when there is a new load. However, the mode conversion overhead and virtual machine migration cost are usually ignored, making it difficult to accurately evaluate the overhead to formulate an energy-efficient optimization strategy. In terms of service quality guarantee, the performance anomaly detection of the data center is completed by continuously monitoring and analyzing system logs in real time. However, the increase in the scale of the server cluster makes the scale of the metric data that needs to be collected and analyzed huge, making it difficult to automatically detect and isolate servers with serious performance anomaly fluctuations.

[0050] Since the prior art does not fully consider the latency and power consumption costs brought about by virtual machine migration and host power consumption mode conversion, it is impossible to balance energy consumption and service quality to achieve the optimization goal of overall efficiency. Among them, the service quality is the Quality of Service (QoS) mentioned in the Service Level Agreement (SLA). In fact, due to the dynamic fluctuations of virtual machine loads and the latency overhead of migration and power mode conversion, unreasonable dynamic consolidation strategies will instead reduce the service quality and even increase the overall energy consumption.

[0051] Thus, to solve the problems of the prior art, embodiments of the present application provide a control method, device, equipment, computer-readable storage medium, and computer program product for a physical machine. Among them, the control method for the physical machine can be applied to a cloud computing scenario.

[0052] First, the control method for the physical machine provided by the embodiments of the present application will be introduced below.

[0053] Figure 1 The flowchart of a control method for a physical machine provided by an embodiment of the present application is shown. The control method for the physical machine can be executed by a control system of a physical machine in a cloud computing platform. Among them, the control system of the physical machine can include an information monitoring module, a power mode conversion module, a virtual machine migration module, and a control module. Among them, the information monitoring module can be used to obtain information such as the power mode of the physical machine, the resource capacity, and the resource request information of the virtual machines deployed on the physical machine at a preset period, and send the above information to the control module. The control module can be used to determine a power mode conversion strategy and a virtual machine migration strategy based on information such as the power mode of the physical machine, the resource capacity, and the resource request information of the virtual machines deployed on the physical machine, send the power mode conversion strategy to the power mode conversion module to enable the power mode conversion module to execute the power mode conversion strategy, and send the virtual machine migration strategy to the virtual machine migration module to enable the virtual machine migration module to execute the virtual machine migration strategy.

[0054] As Figure 1 shown, the control method for a physical machine provided by an embodiment of the present application includes the following steps:

[0055] S110. Obtain the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine at a preset period;

[0056] S120. In the case where the resource request information is greater than a first preset threshold, switch the first power mode to a second power mode, and the power consumption of the second power mode is higher than that of the first power mode;

[0057] S130. When the resource request information is less than the second preset threshold, switch the first power mode to the third power mode, where the power consumption of the third power mode is lower than that of the first power mode, and the second preset threshold is less than the first preset threshold.

[0058] In the embodiments of the present application, by following a preset period and based on the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine, the power mode of the physical machine is updated in a timely manner. That is, when the resource request information of the virtual machine is greater than the first preset threshold, the first power mode is switched to the second power mode with higher power consumption, and when the resource request information of the virtual machine is less than the second preset threshold, the first power mode is switched to the third power mode with the lowest power consumption, which can ensure the rationality and timeliness of the power mode conversion, and thus reduce the power consumption of the physical machine.

[0059] The specific implementation manners of the above steps are introduced below.

[0060] In some embodiments, in S110, the first power mode can be any one of multiple power modes. Different power modes can correspond to different power consumptions. The multiple power modes can include, for example, an active mode, a sleep mode, a non-interrupt sleep mode, etc. Among them, the power consumption of the active mode can be higher than that of the sleep mode and the non-interrupt sleep mode. The power consumption of the non-interrupt sleep mode can be higher than that of the sleep mode.

[0061] As an example, the power mode of the physical machine can be determined jointly based on the resource utilization rate of the physical machine and the number of virtual machines deployed on the physical machine. Among them, the resource utilization rate can include at least one of CPU utilization rate, memory utilization rate, network utilization rate, and disk utilization rate.

[0062] Taking the resource utilization rate as an example of CPU utilization rate, if the CPU utilization rate is denoted as cpu and the order of magnitude of the number of virtual machines deployed on the physical machine is nvm, then the state of the physical machine can be denoted as (cpu, nvm). Generally, the range of CPU utilization rate is [0, 100]%. By performing discrete mapping on the CPU utilization rate, a range (0, U1] can be obtained. Among them, the value of U1 is 1 - 10. 1 - 10 respectively correspond to CPU utilization rates of 0 - 10%, 11% - 20%, 21% - 30%, 31% - 40%, 41% - 50%, 51% - 60%, 61% - 70%, 71% - 80%, 81% - 90%, 91% - 100%. In addition, considering the situation of distinguishing physical machines with the same CPU utilization rate but different numbers of running virtual machines, if NVM > 3, it is denoted as nvm = 1, otherwise nvm = 0. In this way, 20 states of the physical machine can be obtained. Based on the above 20 states, the initial power mode of the physical machine can be determined. For example, if the state of the physical machine is (cpu1, nvm1), and the value of cpu1 is 1 - 10 and the value of nvm1 is 0, the initial power mode can be determined as the sleep mode. If the state of the physical machine is (cpu2, nvm2), and the value of cpu2 is 1 - 5 and the value of nvm2 is 1, the initial power mode can be determined as the non-interrupt sleep mode. If the state of the physical machine is (cpu3, nvm3), and the value of cpu3 is 5 - 10 and the value of nvm3 is 1, the initial power mode can be determined as the active mode.

[0063] In addition, the resource request information of the virtual machine can be used to request and obtain the resource information of the physical machine. Among them, the resource information of the physical machine can include at least one of resources such as CPU, memory, disk, and network.

[0064] As an example, the control system of the physical machine can obtain the latest power mode (i.e., the first power mode) of the physical machine, the latest resource request information of the virtual machines deployed on the physical machine, and update the power mode of the physical machine based on the first power mode and the resource request information every preset period. Among them, the first power mode can include the initial power mode.

[0065] In some embodiments, in S120, the first preset threshold can be pre-set and used to determine the resource request threshold for whether to update the power mode of the physical machine. If the resource request information is greater than the first preset threshold, it can be determined that the virtual machine is requesting more resource information from the physical machine, and thus the first power mode of the physical machine can be switched to the second power mode with higher power consumption to match the resources requested by the virtual machine.

[0066] As an example, if the first power mode is the sleep mode, then when the resource request information is greater than the first preset threshold, the sleep mode can be switched to the non-interrupt sleep mode or the active mode.

[0067] As another example, if the first power mode is a non-interrupt sleep mode, when the resource request information is greater than the first preset threshold, the non-interrupt sleep mode can be switched to an active mode.

[0068] In addition, if the first power mode is an active mode, when the resource request information is greater than the first preset threshold, that is, the resource utilization rate of the physical machine can reach a higher level, so the active mode can be maintained without switching.

[0069] In some embodiments, in S130, the second preset threshold can be pre-set and used to determine whether the resource request threshold for updating the physical machine power mode is required. The second preset threshold can be less than the first preset threshold. If the resource request information is less than the second preset threshold, it can be determined that there is no virtual machine running and waiting to receive requests on the physical machine, that is, the virtual machine is in a sleep state. Therefore, the first power mode of the physical machine can be switched to a third power mode with lower power consumption to reduce the power consumption of the physical machine. The third power mode can specifically be the power mode with the lowest power consumption among multiple power modes. The third power mode can be, for example, a sleep mode.

[0070] As an example, if the first power mode is an active mode or a non-interrupt sleep mode, when the resource request information is less than the second preset threshold, the active mode or the non-interrupt sleep mode can be switched to a sleep mode.

[0071] When the physical machine is in a sleep mode and the virtual machine is in a sleep state, in order to further reduce the power consumption of the physical machine, in some embodiments, after the above S130, the method may further include:

[0072] Determine at least some of the virtual machines deployed on the physical machine as target virtual machines;

[0073] Migrate the target virtual machines to a first physical machine, where the first physical machine is the physical machine with the lowest resource usage information among multiple second physical machines, and the power consumption of the power mode of the second physical machine is higher than that of the first power mode.

[0074] Here, the first physical machine can be the migration destination of the target virtual machine. Embodiments of this application can determine the migration destination in the following manner: 1) Obtain multiple second physical machines with the power mode being the fourth power mode, where the power consumption of the fourth power mode is higher than that of the first power mode, and specifically, the fourth power mode can be the power mode with the highest power consumption among multiple power modes. If the first power mode is the active mode and there is no power mode with a higher power consumption than the active mode, then the fourth power mode can be the active mode. 2) Obtain the resource usage information corresponding to each of the multiple second physical machines, and the resource usage information can include CPU utilization and the number of virtual machines. 3) Among the multiple second physical machines, determine the physical machine with the lowest resource usage information as the first physical machine. And, among CPU utilization and the number of virtual machines, preferentially select the second physical machine with a smaller CPU utilization as the first physical machine.

[0075] That is to say, embodiments of this application select the migration destination based on the principle of having the most idle resources, which can avoid SLA conflicts after virtual machine migration (that is, the first physical machine becomes overloaded after virtual machine migration).

[0076] In addition, the target virtual machine can be all the virtual machines deployed on the physical machine or a part of the virtual machines, which is not limited herein.

[0077] Embodiments of this application can release the physical machine resources and further reduce the power consumption of the physical machine by migrating at least some of the virtual machines deployed on the physical machine when the physical machine is in the sleep mode and the virtual machines are in the sleep state.

[0078] Based on this, in order to further improve the energy utilization efficiency of the data center, in some embodiments, determining at least some of the virtual machines deployed on the physical machine as the target virtual machine can specifically include:

[0079] Obtain the task identifiers corresponding to each of the multiple virtual machines deployed on the physical machine;

[0080] When at least two virtual machines have the same service identifier, determine the at least two virtual machines with the same service identifier as the first virtual machine;

[0081] Determine the virtual machines other than the first virtual machine among the multiple virtual machines deployed on the physical machine as the target virtual machine.

[0082] Here, virtual machines can be used to execute big data processing tasks. The same big data processing task can be executed distributively by multiple virtual machines. In addition, a task identifier can be used to uniquely identify a task. The same big data processing task can correspond to the same task identifier. Therefore, if multiple virtual machines have the same service identifier, it can be determined that the multiple virtual machines jointly execute a big data processing task. If multiple virtual machines jointly execute a big data processing task, the multiple virtual machines may request resources from the physical machine simultaneously.

[0083] Thus, if the above-mentioned multiple virtual machines are in the same physical machine and the physical machine is in the sleep mode, the physical machine can be awakened when the above-mentioned multiple virtual machines jointly request resources, so as to ensure that the physical machine and the multiple virtual machines deployed thereon can be in the active state or the sleep state simultaneously, thereby reducing the number of virtual machine migrations and further improving the energy utilization efficiency of the data center.

[0084] On this basis, in order to ensure the rationality of the power mode and further reduce the power consumption of the physical machine, in some embodiments, after migrating the target virtual machine to the first physical machine, the method may further include:

[0085] Obtain the number of virtual machines and the resource utilization rate of the physical machine;

[0086] Update the first power mode of the physical machine based on the number of virtual machines and the resource utilization rate.

[0087] Here, after migrating the target virtual machine to the first physical machine, the number of virtual machines (nvm) and the resource utilization rate (cpu) of the physical machine will be updated accordingly. As described above, if the physical machine status is (cpu1, nvm1), and the value of cpu1 is 1 - 10 and the value of nvm1 is 0, the initial power mode can be determined as the sleep mode. If the physical machine status is (cpu2, nvm2), and the value of cpu2 is 1 - 5 and the value of nvm2 is 1, the initial power mode can be determined as the non-interrupt sleep mode. If the physical machine status is (cpu3, nvm3), and the value of cpu3 is 5 - 10 and the value of nvm3 is 1, the initial power mode can be determined as the active mode. Similarly, if the updated physical machine status satisfies (cpu1, nvm1), the first power mode can be updated to the sleep mode. If the updated physical machine status satisfies (cpu2, nvm2), the first power mode can be updated to the non-interrupt sleep mode. If the updated physical machine status satisfies (cpu3, nvm3), the first power mode can be updated to the active mode.

[0088] By updating the power mode of the physical machine based on the migration situation of the virtual machines in the embodiments of the present application, the rationality of the power mode can be ensured, and further the power consumption of the physical machine can be reduced.

[0089] To further improve the energy utilization efficiency of the data center, as another implementation manner of this application, this application also provides another implementation manner of the control method for the physical machine. For details, refer to the following embodiments.

[0090] Please refer to Figure 2 , the control method for the physical machine provided by the embodiments of this application may further include steps S210 - S240.

[0091] S210, obtain the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine according to a preset period.

[0092] For the relevant description of S210 in the embodiments of this application, refer to the relevant description of S110 above, and details are not elaborated here.

[0093] S220, obtain the resource capacity of the physical machine.

[0094] The resource capacity of the physical machine may be the total amount of resources that the physical machine has. The resources that the physical machine has may include CPU, memory, disk, network resources, etc.

[0095] In the embodiments of this application, step S210 may be located before step S220 or after step S220, and this is not limited here.

[0096] S230, in the case where the resource capacity is less than the resource request information, determine the target virtual machine to be migrated among the virtual machines deployed on the physical machine based on the first power mode.

[0097] If the resource capacity is less than the resource request information, it can be determined that the physical machine is overloaded, and then at least some of the virtual machines deployed on the physical machine can be migrated out to reduce the physical machine load. In the embodiments of this application, the target virtual machine to be migrated can be determined among the virtual machines deployed on the physical machine based on the first power mode.

[0098] To release the physical machine resources and reduce the physical machine power consumption, in some embodiments, determining the target virtual machine to be migrated among the virtual machines deployed on the physical machine based on the first power mode may specifically include:

[0099] In the case where the first power mode is the sleep mode or the non - interrupt sleep mode, all the virtual machines deployed on the physical machine are determined as the target virtual machines.

[0100] In the embodiments of this application, by migrating out all the virtual machines when the physical machine is overloaded and in the sleep mode or the non - interrupt sleep mode, the physical machine resources can be released and the physical machine power consumption can be reduced.

[0101] To ensure the normal operation of the physical machine, in some embodiments, determining the target virtual machine to be migrated among the virtual machines deployed on the physical machine based on the first power mode may specifically include:

[0102] When the first power mode is the active mode, obtaining the resource requirement information corresponding to each virtual machine physically deployed;

[0103] When the sum of the resource requirement information of at least one virtual machine is greater than or equal to the target difference, determining the at least one virtual machine as the target virtual machine, where the target difference is the difference between the resource capacity of the physical machine and the resource request information of the virtual machines deployed on the physical machine.

[0104] Here, the purpose of migrating the target virtual machine is to alleviate the overload phenomenon of the physical machine. Therefore, the method of determining the target virtual machine can be: first obtain the resource request information corresponding to each of the multiple virtual machines deployed on the physical machine, then randomly determine at least one second virtual machine among the multiple virtual machines. If the sum of the resource request information of the at least one second virtual machine is greater than or equal to the target difference, then determine the at least one second virtual machine as the at least one target virtual machine. If the sum of the resource request information of the at least one second virtual machine is less than the target difference, then randomly determine at least one second virtual machine again, and repeat the above steps until the sum of the resource request information of the at least one second virtual machine is greater than or equal to the target difference.

[0105] To reduce the number of migrated virtual machines and further reduce the power consumption of the physical machine, in some embodiments, the at least one second virtual machine may be determined in descending order of the resource request information until the sum of the resource request information of the at least one second virtual machine is greater than or equal to the target difference, and the at least one second virtual machine is determined as the at least one target virtual machine.

[0106] By migrating some virtual machines when the physical machine is overloaded and in the active mode, the embodiments of the present application can ensure the normal operation of the physical machine so that the physical machine is not overloaded.

[0107] S240, migrating the target virtual machine to the first physical machine, where the first physical machine is the physical machine with the lowest resource usage information among multiple second physical machines, and the power consumption of the power mode of the second physical machine is higher than that of the first power mode.

[0108] The specific method of migrating the target virtual machine to the first physical machine in the embodiments of the present application can refer to the relevant descriptions of the embodiments shown above Figure 1 and will not be elaborated here too much.

[0109] In the embodiments of the present application, by determining the migration strategy of virtual machines based on the first power mode when the physical machine is overloaded, the rationality of virtual machine migration can be ensured, the number of virtual machine migrations can be reduced, and the energy utilization efficiency of the data center can be further improved.

[0110] Based on this, in order to ensure the rationality of the power mode and thus reduce the power consumption of the physical machine, in some embodiments, after the above S240, the method may further include:

[0111] Obtain the number of virtual machines and the resource utilization rate of the physical machine;

[0112] Update the first power mode of the physical machine based on the number of virtual machines and the resource utilization rate.

[0113] Here, after migrating the target virtual machine to the first physical machine, the number of virtual machines (nvm) and the resource utilization rate (cpu) of the physical machine will be updated accordingly. As described above, if the physical machine state is (cpu1, nvm1), and the value of cpu1 is 1 - 10 and the value of nvm1 is 0, the initial power mode can be determined as the sleep mode. If the physical machine state is (cpu2, nvm2), and the value of cpu2 is 1 - 5 and the value of nvm2 is 1, the initial power mode can be determined as the non - interrupt sleep mode. If the physical machine state is (cpu3, nvm3), and the value of cpu3 is 5 - 10 and the value of nvm3 is 1, the initial power mode can be determined as the active mode. Similarly, if the updated physical machine state satisfies (cpu1, nvm1), the first power mode can be updated to the sleep mode. If the updated physical machine state satisfies (cpu2, nvm2), the first power mode can be updated to the non - interrupt sleep mode. If the updated physical machine state satisfies (cpu3, nvm3), the first power mode can be updated to the active mode.

[0114] In the embodiments of the present application, by updating the power mode of the physical machine based on the migration situation of virtual machines, the rationality of the power mode can be ensured, and thus the power consumption of the physical machine can be reduced.

[0115] Based on this, in order to release the resources of the physical machine and reduce the power consumption of the physical machine, in some embodiments, after the above update of the first power mode of the physical machine, the method may further include:

[0116] When the first power mode switches from the active mode to the sleep mode or the non - interrupt sleep mode, determine all the virtual machines deployed on the physical machine as the target virtual machines.

[0117] In the embodiments of the present application, by migrating out all the virtual machines when the physical machine switches from the active mode to the sleep mode or the non - interrupt sleep mode, the resources of the physical machine can be released and the power consumption of the physical machine can be reduced.

[0118] Based on the above embodiments, a schematic diagram of a control method for a physical machine provided by an embodiment of the present application can be as Figure 3 shown.

[0119] In Figure 3 , the actions may include migrating virtual machines and switching power modes, and the benefits may be the change results of the number of virtual machines and resource utilization rate brought about after the virtual machine migration. That is, the present application can repeatedly execute the following steps: obtaining the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine according to a preset period; determining whether to update the power mode of the physical machine and whether to migrate virtual machines based on the first power mode and the resource request information; after migrating the virtual machines, obtaining the latest number of virtual machines and resource utilization rate, and determining whether to update the power mode based on the latest number of virtual machines and resource utilization rate.

[0120] The present application comprehensively considers the power modes of each physical machine in the data center and the resource demand changes and SLA conflicts brought about by virtual machine migration. By constructing technical solutions in aspects such as host power mode selection, status, actions, and status optimization, and virtual machine migration control, some virtual machines are selected to be migrated from the original physical machine to the first physical machine, which can overall improve the resource utilization efficiency, and at the same time reduce the number of virtual machine migrations and host power mode conversions to reduce the overhead generated by power and latency.

[0121] Specifically, the power mode of the physical machine is controlled by an agent deployed on each physical machine, and interacts and feeds back iteratively with the environment based on the reinforcement learning (Q-Learning, QL) algorithm. A two-level monitoring model is adopted. One is to monitor the power mode of the physical machine, and combine the physical machine resource utilization rate and the number of virtual machines to dynamically make decisions to achieve the conversion between the three modes of the physical machine; the other is based on the centralized heuristic algorithm to synchronously monitor the SLA (requirements for different resources such as CPU, memory, disk, etc.) conflicts between virtual machines and physical machines, weigh energy savings, reduce SLA conflicts to select a suitable physical machine power mode, and when the resource demand is greater than the resource supply, weigh the cost / loss of the required resource scheduling, and use two sub-steps of exploration and execution to make an optimal execution selection.

[0122] The agent on each physical machine can continuously learn to select and adjust actions, that is, dynamically make decisions on whether to migrate virtual machines and the first physical machine to which to migrate according to indicators such as the selected physical machine power mode, calculating the virtual machine migration overhead, and the overload status.

[0123] The QL algorithm can be composed of three parts: state, action, and reward. By deploying multiple agents distributively on each physical machine, and through the feedback mechanism of executing actions and obtaining rewards, it selects the best power mode (i.e., active mode, sleep mode, or non-interruptible sleep mode) for each physical machine at runtime, and interacts with the environment in a trial-and-error manner to receive rewards.

[0124] In summary, this application combines distributed multi-agent power mode selection based on reinforcement learning and a centralized migration strategy based on heuristic exploration, and proposes a physical machine control method for an energy-efficient cloud data center. First, it uses distributed multi-agents based on reinforcement learning technology, and selects the best power mode for each physical machine at runtime through the feedback mechanism of executing actions and obtaining rewards. Second, based on a centralized heuristic algorithm, it comprehensively analyzes and dynamically migrates virtual machines according to multi-dimensional metrics such as physical machine power mode, migration overhead, and quality of service.

[0125] In this application, a large-scale cloud computing data center can save energy consumption while ensuring service quality, reduce the number of virtual machine migrations, and reduce the energy consumption of physical machines, finding an effective balance between energy conservation and quality (i.e., the best balance between physical machine utilization and resource provision), thereby improving the energy utilization efficiency of the data center.

[0126] Based on the physical machine control method provided in the above embodiments, correspondingly, this application also provides a specific implementation manner of the physical machine control device. Please refer to the following embodiments.

[0127] As Figure 4 shown, the physical machine control device 400 provided in the embodiments of this application includes the following modules:

[0128] The first acquisition module 410 is used to acquire the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine at a preset period.

[0129] The first switching module 420 is used to switch the first power mode to the second power mode when the resource request information is greater than the first preset threshold, and the power consumption of the second power mode is higher than that of the first power mode.

[0130] The second switching module 430 is used to switch the first power mode to the third power mode when the resource request information is less than the second preset threshold, and the power consumption of the third power mode is lower than that of the first power mode, and the second preset threshold is less than the first preset threshold.

[0131] The following is a detailed description of the above physical machine control device 400, which is specifically as follows:

[0132] In some of the embodiments, the physical machine control device 400 may further include:

[0133] A first determination module, configured to determine at least some of the virtual machines deployed on a physical machine as target virtual machines after switching the first power mode to the third power mode;

[0134] A first migration module, configured to migrate the target virtual machines to a first physical machine, where the first physical machine is the physical machine with the lowest resource usage information among multiple second physical machines, and the power consumption of the power mode of the second physical machines is higher than that of the first power mode.

[0135] In some embodiments, the first determination module may specifically include:

[0136] A first acquisition sub-module, configured to acquire task identifiers respectively corresponding to multiple virtual machines deployed on the physical machine;

[0137] A first determination sub-module, configured to determine at least two virtual machines with the same service identifier as first virtual machines when at least two virtual machines have the same service identifier;

[0138] A second determination sub-module, configured to determine the virtual machines other than the first virtual machines among the multiple virtual machines deployed on the physical machine as target virtual machines.

[0139] In some embodiments, the control device 400 of the physical machine may further include:

[0140] A second acquisition module, configured to acquire the resource capacity of the physical machine;

[0141] A second determination module, configured to determine target virtual machines to be migrated among the virtual machines deployed on the physical machine based on the first power mode when the resource capacity is less than the resource request information;

[0142] A second migration module, configured to migrate the target virtual machines to a first physical machine, where the first physical machine is the physical machine with the lowest resource usage information among multiple second physical machines, and the power consumption of the power mode of the second physical machines is higher than that of the first power mode.

[0143] In some embodiments, the second determination module may specifically include:

[0144] A third determination sub-module, configured to determine all the virtual machines deployed on the physical machine as target virtual machines when the first power mode is a sleep mode or a non-interrupt sleep mode.

[0145] In some embodiments, the second determination module may specifically include:

[0146] A second acquisition sub-module, configured to acquire resource requirement information respectively corresponding to each virtual machine deployed physically;

[0147] A fourth determination sub-module, configured to determine at least one virtual machine as a target virtual machine when the sum of the resource requirement information of at least one virtual machine is greater than or equal to a target difference, where the target difference is the difference between the resource capacity of a physical machine and the resource request information of the virtual machines deployed on the physical machine.

[0148] In some embodiments, the control device 400 of the physical machine may further include:

[0149] A third acquisition module, configured to acquire the number of virtual machines and the resource utilization rate of the physical machine after migrating the target virtual machine to the first physical machine;

[0150] An update module, configured to update the first power mode of the physical machine based on the number of virtual machines and the resource utilization rate.

[0151] In some embodiments, the control device 400 of the physical machine may further include:

[0152] A third determination module, configured to determine all the virtual machines deployed on the physical machine as target virtual machines after updating the first power mode of the physical machine when the first power mode switches from an active mode to a sleep mode or a non-interrupt sleep mode.

[0153] In the embodiments of the present application, by updating the power mode of the physical machine in a timely manner according to a preset period based on the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine, that is, switching the first power mode to a second power mode with higher power consumption when the resource request information of the virtual machines is greater than a first preset threshold, and switching the first power mode to a third power mode with the lowest power consumption when the resource request information of the virtual machines is less than a second preset threshold, the rationality and timeliness of the power mode conversion can be ensured, and thus the power consumption of the physical machine can be reduced.

[0154] Based on the physical machine control method provided in the above embodiments, the embodiments of the present application also provide a specific implementation manner of an electronic device. Figure 5 FIG. shows a schematic diagram of an electronic device 500 provided in the embodiments of the present application.

[0155] The electronic device 500 may include a processor 510 and a memory 520 storing computer program instructions.

[0156] Specifically, the above processor 510 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0157] The memory 520 may include a mass storage for data or instructions. By way of example and not limitation, the memory 520 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 520 may include removable or non-removable (or fixed) media. Where appropriate, the memory 520 may be internal or external to the electronic device 500. In a particular embodiment, the memory 520 is a non-volatile solid-state memory.

[0158] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method of the first aspect of the present application.

[0159] The processor 510 reads and executes the computer program instructions stored in the memory 520 to implement the control method of any one of the physical machines in the above embodiments.

[0160] In one example, the electronic device 500 may further include a communication interface 530 and a bus 540. Among them, as Figure 5 shown, the processor 510, the memory 520, and the communication interface 530 are connected via the bus 540 and complete communication with each other.

[0161] The communication interface 530 is mainly used to implement communication between the various modules, devices, units, and / or devices in the embodiments of the present application.

[0162] The bus 540 includes hardware, software, or both, and couples the components of the electronic device together. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, the bus 540 may include one or more buses. Although embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.

[0163] Exemplarily, the electronic device 500 may be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc.

[0164] The electronic device can execute the control method of the physical machine in the embodiments of the present application, so as to implement the control method of the physical machine described in combination with Figures 1 to 3 the described control method of the physical machine.

[0165] In addition, in combination with the control method of the physical machine in the above embodiments, embodiments of the present application can provide a computer-readable storage medium to implement. Computer program instructions are stored on the computer-readable storage medium; when the computer program instructions are executed by a processor, any one of the control methods of the physical machine in the above embodiments is implemented.

[0166] In combination with the control method of the physical machine in the above embodiments, embodiments of the present application can provide a computer program product to implement. When the instructions in the computer program product are executed by the processor of the electronic device, any one of the control methods of the physical machine in the above embodiments is implemented.

[0167] It should be clear that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present application.

[0168] The functional blocks shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present application are programs or code segments for performing the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via a data signal carried in a carrier wave. A "machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.

[0169] It should also be noted that in the exemplary embodiments mentioned in the present application, some methods or systems are described based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, can be different from the order in the embodiments, or several steps can be executed simultaneously.

[0170] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each block in the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each block in the block diagrams and / or flowcharts, and the combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0171] As described above, this is only the specific implementation manner of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein. It should be understood that the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application.

Claims

1. A control method for a physical machine, characterized in that, Including: Obtain the first power mode of the physical machine and the resource request information of the virtual machines deployed on the physical machine according to a preset period; When the resource request information is greater than a first preset threshold, switch the first power mode to a second power mode, where the power consumption of the second power mode is higher than that of the first power mode; When the resource request information is less than a second preset threshold, switch the first power mode to a third power mode, where the power consumption of the third power mode is lower than that of the first power mode, and the second preset threshold is less than the first preset threshold.

2. The method according to claim 1, wherein After switching the first power mode to the third power mode, the method further includes: Determine at least some of the virtual machines deployed on the physical machine as target virtual machines; Migrate the target virtual machines to a first physical machine, where the first physical machine is the physical machine with the lowest resource usage information among multiple second physical machines, and the power consumption of the power mode of the second physical machine is higher than that of the first power mode.

3. The method according to claim 2, wherein Determining at least some of the virtual machines deployed on the physical machine as target virtual machines includes: Obtain the task identifiers corresponding to the multiple virtual machines deployed on the physical machine respectively; When at least two virtual machines have the same service identifier, determine the at least two virtual machines with the same service identifier as the first virtual machines; Determine the virtual machines other than the first virtual machines among the multiple virtual machines deployed on the physical machine as the target virtual machines.

4. The method according to claim 1, wherein The method further includes: Obtain the resource capacity of the physical machine; When the resource capacity is less than the resource request information, based on the first power mode, determine the target virtual machines that need to be migrated among the virtual machines deployed on the physical machine; Migrate the target virtual machines to a first physical machine, where the first physical machine is the physical machine with the lowest resource usage information among multiple second physical machines, and the power consumption of the power mode of the second physical machine is higher than that of the first power mode.

5. The method according to claim 4, characterized in that, Based on the first power mode, determining the target virtual machines that need to be migrated among the virtual machines deployed on the physical machine includes: When the first power mode is the sleep mode or the non-interrupt sleep mode, determine all the virtual machines deployed on the physical machine as the target virtual machines.

6. The method according to claim 4, characterized in that Based on the first power mode, determining the target virtual machines that need to be migrated among the virtual machines deployed on the physical machine includes: When the first power mode is the active mode, obtain the resource requirement information corresponding to each virtual machine deployed on the physical machine respectively; When the sum of the resource requirement information of at least one virtual machine is greater than or equal to a target difference, determine the at least one virtual machine as the target virtual machine, where the target difference is the difference between the resource capacity of the physical machine and the resource request information of the virtual machines deployed on the physical machine.

7. The method according to claim 2 or 4, characterized in that, After migrating the target virtual machines to the first physical machine, the method further includes: Obtain the number of virtual machines and the resource utilization rate of the physical machine; Based on the number of virtual machines and the resource utilization rate, update the first power mode of the physical machine.

8. The method according to claim 7, wherein After updating the first power mode of the physical machine, the method further includes: When the first power mode switches from the active mode to the sleep mode or the non-interrupt sleep mode, determining all virtual machines deployed on the physical machine as the target virtual machines.

9. A control device for a physical machine, characterized in that, The device includes: A first acquisition module, configured to acquire the first power mode of the physical machine and resource request information of virtual machines deployed on the physical machine at a preset period; A first switching module, configured to switch the first power mode to a second power mode when the resource request information is greater than a first preset threshold, where the power consumption of the second power mode is higher than that of the first power mode; A second switching module, configured to switch the first power mode to a third power mode when the resource request information is less than a second preset threshold, where the power consumption of the third power mode is lower than that of the first power mode, and the second preset threshold is less than the first preset threshold.

10. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the control method of the physical machine according to any one of claims 1-8 is implemented.

11. A computer-readable storage medium, characterized in that, Computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are executed by the processor, the control method of the physical machine according to any one of claims 1-8 is implemented.

12. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device is caused to execute the control method of the physical machine according to any one of claims 1-8.