Frequency modulation method and related device
By adjusting the frequency in real-time based on virtual machine production and destruction instructions in the target host of the cloud server, the problem of high energy consumption and frequency adjustment lag of cloud computing servers is solved, and efficient energy management and business support is achieved.
Patent Information
- Application Number
- CN202311162638.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2025-03-11
AI Technical Summary
Although cloud computing servers have high performance during operation, they also bring high energy consumption problems. The existing technology has lag when adjusting the processor voltage and frequency, which affects performance and cannot reduce power consumption in time.
By real-time perception of load based on virtual machine production instructions and destroy instructions in the target host of the cloud server, the working frequency is adjusted, so that the target host enters a sleep state when it is idle, reducing power consumption; when there is a task, it is adjusted to a performance state to ensure task processing requirements.
It realizes that the power consumption of the target host is timely reduced without affecting the implementation of the service, and starts up in time when the task is required, improving energy efficiency utilization.
Smart Images

Figure CN119597436A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a frequency modulation method and related devices. Background Art
[0002] In the operation process of cloud computing servers, while the server equipment has high operating speed and processing power, it also brings about the problem of high energy consumption. High energy consumption brings high electricity costs to the data center.
[0003] At present, the load of the processor in the server device can be monitored, and the voltage and frequency of the processor can be adjusted according to the load, so that when the processor needs to achieve high performance, the voltage and frequency can be increased to achieve sufficient performance, and when the processor does not need to achieve high performance, the voltage and frequency can be reduced to reduce power consumption, thereby achieving the purpose of balancing performance and energy saving. However, in this adjustment method, the adjustment of the voltage and frequency of the processor has a lag, which is easy to affect the performance of the processor. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a frequency modulation method and related devices, which adjust the frequency of the target host machine based on virtual machine production instructions and destruction instructions, and reduce the power consumption of the target host machine as much as possible without affecting business implementation.
[0005] The embodiments of the present application disclose the following technical solutions:
[0006] On the one hand, the present application provides a frequency modulation method, which is applied to a target host in a cloud server, and the method includes:
[0007] In response to a virtual machine destruction instruction for the target host machine, executing a destruction operation on the virtual machine corresponding to the virtual machine destruction instruction in the target host machine;
[0008] If it is determined that no virtual machine exists on the target host machine after the destruction operation, adjusting the operating frequency of the target host machine to put the target host machine into a dormant state;
[0009] In response to a virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, adjusting the operating frequency of the target host machine so that the target host machine enters a performance state;
[0010] The virtual machine production operation in the target host machine is performed according to the virtual machine production instruction.
[0011] On the other hand, the present application provides a frequency modulation device, which is applied to a target host in a cloud server, and the device includes:
[0012] a destroying unit, configured to, in response to a virtual machine destroying instruction for the target host machine, execute a destroying operation on the virtual machine corresponding to the virtual machine destroying instruction in the target host machine;
[0013] a frequency reduction unit, configured to adjust the operating frequency of the target host machine to put the target host machine into a dormant state if it is determined that no virtual machine exists on the target host machine after the destruction operation;
[0014] a frequency increase unit, configured to respond to a virtual machine production instruction for the target host machine, and if the target host machine is in a dormant state, adjust the operating frequency of the target host machine to make the target host machine enter a performance state;
[0015] The production unit is used to perform a production operation of the virtual machine in the target host machine according to the virtual machine production instruction.
[0016] In another aspect, the present application provides a computer device, the device comprising a processor and a memory:
[0017] The memory is used to store a computer program and transmit the computer program to the processor;
[0018] The processor is used to execute the frequency modulation method described in the above aspect according to the instructions in the computer program.
[0019] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the frequency modulation method described in the above aspect.
[0020] On the other hand, an embodiment of the present application provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the frequency modulation method.
[0021] It can be seen from the above technical solution that in response to the virtual machine destruction instruction for the target host machine, the target host machine in the cloud service can perform a destruction operation on the virtual machine corresponding to the virtual machine destruction instruction. If it is determined that there is no virtual machine in the target host machine after the destruction operation, it can be determined that the target host machine is idle. At this time, the working frequency of the target host machine can be adjusted to make the target host machine enter a dormant state. The dormant state has lower power consumption. Since the working state of the target host machine can be adjusted immediately after the destruction operation, the power consumption of the target host machine when idle can be reduced in time without affecting the realization of the business. In addition, in response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, it means that it is not enough to perform the virtual machine production operation. Therefore, the working frequency of the target host machine can be adjusted to make the target host machine enter a performance state. The performance state can meet the task processing requirements of the target host machine, and then the production operation of the virtual machine in the target host machine is performed according to the virtual machine production instruction. In this way, the state of the target host machine can be adjusted in time when the target host machine is required to produce a virtual machine, so that it can respond to tasks in time. In an embodiment of the present application, based on the virtual machine destruction instructions and the virtual machine production instructions, the load of the target host machine during the virtual machine production process can be perceived in real time, and the operating frequency of the target host machine can be adjusted based on this. The power consumption can be reduced in time when the target host machine is idle, and the target host machine can be started in time when there are tasks to be processed. The power consumption of the target host machine is reduced as much as possible without affecting the business implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 A schematic diagram of an application scenario of a frequency modulation method provided in an embodiment of the present application;
[0024] Figure 2 A flow chart of a frequency modulation method provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of the structure of a cloud server provided in an embodiment of the present application;
[0026] Figure 4 A schematic diagram of a frequency reduction process provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of a strategy center provided in an embodiment of the present application;
[0028] Figure 6 A schematic diagram of another frequency reduction process provided in an embodiment of the present application;
[0029] Figure 7 A process diagram of a periodic reconciliation mechanism provided in an embodiment of the present application;
[0030] Figure 8 A schematic diagram of a frequency upscaling process provided in an embodiment of the present application;
[0031] Fig. 9 A schematic diagram of another frequency upscaling process provided in an embodiment of the present application;
[0032] Fig.10 The energy consumption optimization benefits for different server architectures provided by the embodiments of the present application;
[0033] Fig.11 A structural block diagram of a frequency modulation device provided in an embodiment of the present application;
[0034] Fig.12 A structural diagram of a terminal device provided in an embodiment of the present application;
[0035] Fig.13 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0037] Currently, the load of the processor in the server device can be monitored, and the voltage and frequency of the processor can be adjusted according to the load. However, in this adjustment method, the voltage and frequency adjustment of the processor has a lag, which can easily affect the performance of the processor.
[0038] In order to solve the above technical problems, the present application provides a frequency modulation method and related devices, which can perceive the load of the target host machine during the virtual machine production process in real time based on the virtual machine destruction instructions and the virtual machine production instructions, and adjust the working frequency of the target host machine based on this. The power consumption can be reduced in time when the target host machine is idle, and the target host machine can be started in time when there are tasks to be processed, thereby reducing the power consumption of the target host machine as much as possible without affecting the business implementation.
[0039] The frequency modulation method provided in the embodiment of the present application can be implemented by a computer device, which can be a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The server can be connected to a terminal device, and the terminal device includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0040] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0041] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0042] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0043] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0044] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0045] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (ID, ID entity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0046] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disks), the physical storage space is pre-divided into stripes. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0047] In order to facilitate understanding of the technical solution provided by the present application, a frequency modulation method provided by an embodiment of the present application will be introduced below in combination with an actual application scenario.
[0048] Figure 1 A schematic diagram of an application scenario of a frequency modulation method provided in an embodiment of the present application is shown, wherein the scenario includes a server 10, which can be used to provide cloud computing services, also known as a cloud server, and the server 10 includes a target host machine.
[0049] In response to a virtual machine destruction instruction for the target host machine, the target host machine can perform a destruction operation on the virtual machine corresponding to the virtual machine destruction instruction. If it is determined that there is no virtual machine on the target host machine after the destruction operation, it can be determined that the target host machine is idle. At this time, the operating frequency of the target host machine can be adjusted to make the target host machine enter a sleep state. The sleep state has lower power consumption. Since the operating state of the target host machine can be adjusted immediately after the destruction operation, the power consumption of the target host machine when idle can be reduced in time without affecting the implementation of the business.
[0050] In addition, in response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, it means that it is not sufficient to perform virtual machine production operations. Therefore, the operating frequency of the target host machine can be adjusted to make the target host machine enter a performance state. The performance state can meet the task processing requirements of the target host machine, and then the production operation of the virtual machine in the target host machine is performed according to the virtual machine production instruction. In this way, the state of the target host machine can be adjusted in time when the target host machine is required to produce a virtual machine, so that it can respond to tasks in time.
[0051] In an embodiment of the present application, based on the virtual machine destruction instructions and the virtual machine production instructions, the load of the target host machine during the virtual machine production process can be perceived in real time, and the operating frequency of the target host machine can be adjusted based on this. The power consumption can be reduced in time when the target host machine is idle, and the target host machine can be started in time when there are tasks to be processed. The power consumption of the target host machine is reduced as much as possible without affecting the business implementation.
[0052] Figure 2 A flowchart of a frequency modulation method provided in an embodiment of the present application. In this embodiment, a server is used as the aforementioned computer device for illustration. The server may include a target host machine. The frequency modulation method may include:
[0053] S101 , in response to a virtual machine destroy instruction for a target host machine, executing a destroy operation on a virtual machine corresponding to the virtual machine destroy instruction in the target host machine.
[0054] In the embodiment of the present application, the server can be used to provide cloud computing services, which can be called a cloud server. The host of the cloud server refers to the computer device that carries the cloud server, which can serve as the infrastructure of the virtual machine cloud platform. In the field of cloud computing, the host is a physical server that can support multiple virtual servers (i.e., virtual machines) at the same time through virtualization technology. The host provides computing, storage, and network resources, and provides an operating environment for virtual machines. The virtual machines can support independent operating systems as a platform for running applications. The cloud server can include a host, which can serve as a target host. The cloud server can also include multiple hosts, and one of the multiple hosts can serve as a target host.
[0055] During the operation of cloud servers, server devices have high operating speed and processing power, but also bring about high energy consumption problems. Taking the target host as a server device for illustration, the target host can include a processor, a storage device, and an input / output device. The processor is used to provide computing resources, the storage device is used to provide storage resources, and the input / output device is used to provide transmission resources and network resources, etc. The processor can be a central processing unit (CPU), etc., and the storage device can include memory and disk, etc. Among them, the storage device and the input / output device can be used as uncore devices.
[0056] Currently, the power consumption of servers can be reduced through the Dynamic Voltage and Frequency Scaling (DVFS) technology. Specifically, the load of the processor in the host machine can be monitored, and then the voltage and frequency of the processor can be adjusted according to the load, so that when the processor needs to achieve high performance, the voltage and frequency can be increased to achieve sufficient performance, and when the processor does not need to achieve high performance, the voltage and frequency can be reduced to reduce power consumption, thereby achieving the goal of balancing performance and energy saving. The technical architecture of this adjustment method is divided into three layers. The first layer is the user state, where the user provides the user state / system interface and supports the configuration of different strategies. The second layer is the kernel state, which can monitor the load of the processor and determine the voltage and frequency adjustment strategy, and drive the hardware interface of the hardware layer to adjust the frequency and voltage. The third layer is the hardware layer.
[0057] However, in this adjustment method, the voltage and frequency adjustment of the processor are based on the processing of the monitoring results of the processor load in the kernel state, which cannot predict and quickly perceive the changes in business peaks and lows, and the monitoring of the processor load is periodic. Therefore, the adjustment of the voltage and frequency of the processor is also step-type, and the frequency of the processor will only be adjusted accordingly when the load reaches the set threshold. Therefore, the adjustment of the voltage and frequency of the processor has a lag. From the perspective of energy saving, this lag adjustment cannot save energy in a timely and effective manner. From the perspective of business implementation, the untimely adjustment of voltage and frequency is likely to affect business implementation.
[0058] In addition, in the method of reducing server power consumption through dynamic power management (DPM) technology, whether to switch the host machine to a low power state is determined according to the idle time of the host machine. The power consumption of the host machine can be reduced by powering off some of the host machines. However, for scenarios with short idle periods of distributed resources on the cloud, powering on the host machine is highly experimental, and restoring power is not real-time, which will affect the real-time performance of the business system and have an impact on the business.
[0059] In an embodiment of the present application, the frequency adjustment strategy of the kernel state can be promoted to the user state, and the user state can be the first to perceive the virtual machine destruction instruction and the virtual machine production instruction, so as to timely and automatically adjust the frequency of the target host machine in the scenario of cloud computing production and destruction of virtual machines, thereby reducing the energy consumption of the cloud server. Specifically, the target host machine can obtain the virtual machine destruction instruction for the target host machine, and perform a destruction operation on the virtual machine corresponding to the instruction in the target host machine according to the virtual machine destruction instruction, wherein the virtual machine destruction instruction is used to instruct the target host machine to destroy a specific virtual machine. Specifically, the processor can perform a destruction operation on the virtual machine corresponding to the virtual machine destruction instruction according to the virtual machine destruction instruction, that is, destroy the virtual machine corresponding to the instruction.
[0060] The target host obtains the virtual machine destruction instruction and processes the virtual machine destruction instruction in the user state of the target host. Figure 3As shown, it is a structural diagram of a cloud server provided by an embodiment of the present application. The cloud server may also include a resource scheduling system. The resource scheduling system may be other hardware devices outside the target host machine, or may be a functional module integrated in the host machine. The resource scheduling system includes a resource scheduler for scheduling resources for each host machine including the target host machine, which may be used to generate virtual machine destruction instructions and virtual machine production instructions so that each host machine destroys and produces virtual machines according to these instructions, thereby managing the resources of the host machine. In other words, the target host machine may obtain the virtual machine destruction instruction for the target host machine from the resource scheduling system, so as to destroy the virtual machine according to the virtual machine destruction instruction.
[0061] S102: If it is determined that there is no virtual machine on the target host machine after the destruction operation, the operating frequency of the target host machine is adjusted to make the target host machine enter a dormant state.
[0062] In an embodiment of the present application, after the destruction of the virtual machine is completed, if it is determined that there is no virtual machine on the target host machine after the destruction operation, that is, the destroyed virtual machine is the last virtual machine of the target host machine, then the target host machine enters an idle state after the destruction operation. At this time, the target host machine is not required to perform task processing, so the operating frequency of the target host machine can be adjusted to make the target host machine enter a sleep state, which can timely reduce the power consumption of the target host machine without affecting the task processing of the target host machine.
[0063] refer to Figure 3 As shown, the user state of the target host machine may include a frequency scheduler. The frequency scheduler may be a functional module integrated in the production process of the virtual machine of the target host machine, and is used to adjust the operating frequency of the target host machine to ensure the normal operation of the virtual machine performance. The adjustment of the operating frequency of the target host machine may include frequency increase and frequency decrease. Specifically, if it is determined that there is no virtual machine on the target host machine after the destruction operation, the operating frequency of the target host machine can be adjusted through the frequency scheduler to put the target host machine into a sleep state.
[0064] refer to Figure 4 As shown, it is a schematic diagram of a frequency reduction process provided in an embodiment of the present application, and the frequency reduction process may include: S101, in response to a virtual machine destruction instruction for a target host machine, executing a destruction operation on the virtual machine corresponding to the virtual machine destruction instruction in the target host machine; S102 may be specifically S1021-S1022, in S1021, determining whether there is a virtual machine in the target host machine after the destruction operation, if not, it indicates that the target host machine is idle, and executing S1022 to adjust the operating frequency of the target host machine to put the target host machine into a sleep state.
[0065] Specifically, there are hardware devices in the dormant state in the target host machine in the dormant state. The hardware devices in the dormant state have low power consumption due to their low operating frequency and usually do not have normal working capabilities. Therefore, the target host machine in the dormant state has lower power consumption and lower task processing capabilities than the target host machine in the normal operating state. Of course, among the hardware devices in the target host machine in the dormant state, some hardware devices may be in the dormant state, or all hardware devices may be in the dormant state. All hardware devices being in the dormant state can minimize the power consumption of the target host machine.
[0066] In a specific implementation, the hardware devices of the target host machine include a processor, a storage device, and an input-output device. The target host machine enters a sleep state, which can be achieved by controlling at least one of the processor, storage device, and input-output device in the target host machine to enter a sleep state. During the operation of the target host machine, the processor consumes approximately 30% to 40% of the energy consumption, and the storage device consumes approximately 15% to 30% of the energy consumption. Therefore, controlling the target host machine to enter a sleep state can effectively reduce the power consumption of the target host machine.
[0067] refer to Figure 3 As shown, the kernel state of the target host machine can provide a processor frequency adjustment interface corresponding to the processor, a storage device frequency adjustment interface corresponding to the storage device, and an input-output frequency adjustment interface corresponding to the input-output device. When these interfaces are called by the user state, they can be used to adjust the operating frequency of the processor, storage device, and input-output device, wherein the processor frequency adjustment interface can be represented as cpu, multiple processor frequency adjustment interfaces are represented as cpus, and the storage device frequency adjustment interface and the input-output frequency adjustment interface are combined to represent an uncore device. The hardware layer of the target host machine can provide a processor interface, a storage device interface, and an input-output device interface, so that the processor, storage device, and input-output device of the hardware layer can control the processor, storage device, and input-output device according to the kernel state driver.
[0068] As a possible implementation method, if it is determined that there is no virtual machine on the target host machine after the destruction operation, the operating frequency of the processor can be adjusted to put the processor into a sleep state. At this time, the operating state of the processor can also be called a powersave mode. At this time, the operating frequency of the processor can be the lowest frequency it can achieve to minimize the power consumption of the processor.
[0069] Specifically, for processors belonging to different processor architectures, the sleep frequency of entering the sleep state may be different. Figure 3As shown, the user state of the target host machine may have a policy center, which may include a variety of frequency adjustment policies. The policy center is connected to the frequency scheduler to provide policy support for the frequency scheduler. The sleep frequency of the processor can be determined based on the policy center. Figure 5 As shown, a schematic diagram of a policy center provided in an embodiment of the present application, the policy center may include a processor architecture policy, and the processor architecture policy is used to indicate the adjustment policies corresponding to different processor architectures. Different processor architectures, such as Intel processors, AMD processors, etc., the adjustment policies may include sleep frequencies. Of course, some processor architectures do not support frequency modulation, and they do not have adjustment policies. Therefore, processors that do not support frequency modulation function can be filtered according to the processor architecture policy.
[0070] In specific implementation, the sleep frequency of the processor in the sleep state can be determined according to the processor architecture policy from the policy center and the processor architecture of the target host, and then the operating frequency of the processor can be adjusted according to the sleep frequency to put the processor into the sleep state. For example, for the first processor architecture, it corresponds to the first sleep frequency, then the operating frequency of the processor belonging to the first processor architecture can be adjusted to the first sleep frequency, so that it enters the sleep state; for the second processor architecture, it corresponds to the second sleep frequency, then the operating frequency of the processor belonging to the second processor architecture can be adjusted to the second sleep frequency, so that it enters the sleep state.
[0071] Specifically, for processors of different processor architectures, entering the sleep state can be achieved through different processor frequency adjustment interfaces, and the processor frequency adjustment interface can be indicated by the processor architecture policy, that is, the adjustment policy corresponding to different processor architectures can also include the processor frequency adjustment interface. Therefore, according to the processor architecture policy and the processor architecture of the target host machine, the processor frequency adjustment interface of the kernel state of the target host machine can be determined, and then the operating frequency of the processor is adjusted by calling the processor frequency adjustment interface to put the processor into the sleep state. After determining the sleep frequency, the processor frequency adjustment interface can be called according to the sleep frequency to adjust the operating frequency of the processor to put it into the sleep state.
[0072] As another possible implementation, if it is determined that there is no virtual machine on the target host machine after the destruction operation, the operating frequency of the storage device can be adjusted to put the storage device into a sleep state. At this time, the operating frequency of the storage device can be the lowest frequency it can achieve to minimize the power consumption of the storage device.
[0073] Specifically, the sleep frequency of the storage device in the sleep state can be determined, and the operating frequency of the storage device can be adjusted according to the sleep frequency to make the storage device enter the sleep state. The sleep frequency of the storage device in the sleep state can be preset. In the process of adjusting the operating frequency of the storage device, the operating frequency of the storage device can be adjusted by calling the storage device frequency adjustment interface corresponding to the storage device in the kernel state to make the storage device enter the sleep state.
[0074] As another possible implementation, if it is determined that there is no virtual machine on the target host machine after the destruction operation, the operating frequency of the input and output devices can be adjusted to put the input and output devices into a sleep state. At this time, the operating frequency of the input and output devices can be the lowest frequency that can be achieved to minimize the power consumption of the input and output devices.
[0075] Specifically, the sleep frequency of the input-output device in the sleep state can be determined, and the operating frequency of the input-output device can be adjusted according to the sleep frequency to make the input-output device enter the sleep state. The sleep frequency of the input-output device in the sleep state can be preset. In the process of adjusting the operating frequency of the input-output device, the operating frequency of the input-output device can be adjusted by calling the input-output device frequency adjustment interface corresponding to the input-output device in the kernel state to make it enter the sleep state.
[0076] As another possible implementation, if it is determined that there is no virtual machine on the target host machine after the destruction operation, the operating frequency of the processor, storage device, and input-output device of the target host machine can be adjusted to put the processor, storage device, and input-output device into a dormant state. Among them, the operating frequencies of the processor, storage device, and input-output device can be adjusted at the same time or in steps. In this way, when the target host machine is idle, the operating frequencies of the processor, storage device, and input-output device are adjusted to the lowest, so that the target host machine is in a dormant state with the lowest energy consumption, thereby reducing the operating power consumption of the target host machine when idle. In addition, the operating frequencies of the processor, storage device, and input-output device are all reduced, which minimizes the power consumption of the target host machine.
[0077] For example, refer to Figure 4 As shown, S1022 may include S102A, adjusting the operating frequency of the storage device and the input / output device to put the storage device and the input / output device into a sleep state; and S102B, adjusting the operating frequency of the processor to put the processor into a sleep state.
[0078] Specifically, the sleep frequency of the processor, storage device and input / output device in the sleep state can be determined, and the operating frequency of the processor, storage device and input / output device can be adjusted according to the determined sleep frequency to put the processor, storage device and input / output device into the sleep state.
[0079] In the process of adjusting the operating frequencies of the processor, storage device and input-output device, the operating frequencies of the processor, storage device and input-output device can be adjusted by calling the frequency adjustment interface of the kernel state, so that the processor, storage device and input-output device enter a sleep state. The frequency adjustment interface includes a processor frequency adjustment interface corresponding to the processor, a storage device frequency adjustment interface corresponding to the storage device and an input-output frequency adjustment interface corresponding to the input-output device, that is, the operating frequency of the processor can be adjusted by calling the processor frequency adjustment interface, the operating frequency of the storage device can be adjusted by calling the storage device frequency adjustment interface, and the operating frequency of the input-output device can be adjusted by calling the input-output frequency adjustment interface.
[0080] In addition, the operating frequencies of two of the processor, storage device, and input / output device may also be adjusted, which will not be described one by one with examples here.
[0081] If you are sure that the target host does not have any virtual machines after the destruction operation, refer to Figure 4 As shown, before S1022 adjusts the operating frequency of the target host machine, S102 may also include: S1023, locking the state adjustment operation of the target host machine to prevent the operating frequency of the target host machine from being adjusted according to other frequency adjustment instructions, and then executing S1022, that is, executing the operation of adjusting the operating frequency of the target host machine to make the target host machine enter a sleep state. In this way, the target host machine will not be disturbed by other frequency adjustment instructions when it needs to enter a sleep state, and can smoothly enter a sleep state, thereby avoiding parallel task conflicts in the operating frequency of the target host machine.
[0082] In the embodiment of the present application, before adjusting the operating frequency of the target host, it is also possible to determine that the target host belongs to the test list according to the sleep grayscale policy. When it is determined that the target host belongs to the policy list, the operating frequency of the target host is adjusted. In this way, at the beginning of the frequency adjustment policy launch, the minimum range of functional verification can be performed on the host covered by the technology to realize the recovery and release of the frequency adjustment function. The sleep grayscale policy can be obtained through the policy center, refer to Figure 5 As shown, the policy center may include a sleep grayscale policy so that the frequency scheduler can determine whether to adjust the operating frequency of the target host machine based on the sleep grayscale policy. In addition, the policy center may also include other policies, which may be user-defined policies used to instruct the frequency scheduler's adjustment logic during the frequency adjustment process.
[0083] In an embodiment of the present application, the number of virtual machines existing in the target host machine and the working status of the target host machine can also be obtained according to a preset period. If the number of virtual machines existing in the target host machine is zero, and the working status of the target host machine is a performance status, the target host machine is determined to be in an idle state, and the working frequency of the target host machine can be adjusted to make the target host machine enter a sleep state. In other words, a periodic reconciliation mechanism is added during the frequency adjustment process, and a triggering opportunity is added for the frequency reduction operation. As a fallback solution, when it is monitored that the number of virtual machines existing in the target host machine is zero, it is determined that the target host machine is idle, and the working frequency of the target host machine is adjusted.
[0084] refer to Figure 6 As shown, it is another schematic diagram of the frequency reduction process provided by the embodiment of the present application. Another triggering branch of the frequency reduction process may include: S105, according to the preset period, obtain the number of virtual machines existing in the target host machine and the working state of the target host machine. After S105, S106 may be executed to determine whether the number of virtual machines existing in the target host machine is zero. If so (that is, it is zero), S107 may be executed to determine whether the working state of the target host machine is a performance state. If so (that is, it is a performance state), S1022 may be executed. Of course, before S1022, S1023 may be executed first. The specific description of S1022 and S1023 refers to the previous description, which will not be repeated here.
[0085] refer to Figure 7 As shown, it is a process schematic diagram of a periodic reconciliation mechanism provided by an embodiment of the present application. In the periodic reconciliation mechanism, it is possible to periodically monitor whether there is a virtual machine on the target host machine and whether the target host machine is in a dormant state, thereby obtaining a variety of monitoring results. If there is no virtual machine on the target host machine and it is in a dormant state, no operation may be performed. If there is no virtual machine on the target host machine and it is in a performance state, the operating frequency of the target host machine may be reduced to put the target host machine into a dormant state. Reducing the operating frequency of the target host machine may include reducing the operating frequency of at least one of a processor, a storage device, and an input / output device in the target host machine.
[0086] S103, in response to a virtual machine production instruction for a target host machine, if the target host machine is in a sleep state, adjusting the operating frequency of the target host machine to make the target host machine enter a performance state.
[0087] In an embodiment of the present application, the target host machine can also obtain virtual machine production instructions for the target host machine. The virtual machine production instructions are used to instruct the target host machine to produce a virtual machine. At this time, if the target host machine is in a sleep state, the production of the virtual machine cannot be achieved. Therefore, the operating frequency of the target host machine can be adjusted to make the target host machine enter a performance state. In this way, the virtual machine production instructions can be responded to in a timely manner without affecting the task processing of the target host machine.
[0088] The target host obtains the virtual machine production instructions and processes the virtual machine production instructions in the user mode of the host machine. Figure 3 As shown, the user state of the target host machine may include a frequency scheduler, which is used to adjust the operating frequency of the target host machine to ensure the normal operation of the virtual machine performance. Specifically, in response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, the operating frequency of the target host machine is adjusted to make the target host machine enter a performance state. The target host machine can obtain the virtual machine production instruction for the target host machine from the resource scheduling system, so as to produce the virtual machine according to the virtual machine production instruction, and realize the scheduling of the target host machine by the resource scheduling system.
[0089] Among them, the resource scheduling system can determine the target host machine from multiple host machines and send a virtual production instruction to the target host machine, so that the target host machine that obtains the virtual machine production instruction can execute the virtual production instruction to realize the scheduling of the target host machine.
[0090] refer to Figure 8 As shown, it is a schematic diagram of a frequency increase process provided in an embodiment of the present application, and the frequency increase process includes S103 and S104, S103 can be specifically S1031~S1032. In S1031, in response to the virtual machine production instruction for the target host machine, it is determined whether the target host machine is in a sleep state. If so, S1032 is executed to adjust the operating frequency of the target host machine so that the target host machine enters a performance state. If not, S104 is executed.
[0091] Specifically, each hardware device in the target host machine in the performance state is in the performance state. The hardware devices in the performance state have high power consumption due to their high operating frequency and have their corresponding normal working capabilities. For example, the processor has data processing capabilities, the storage device has data storage capabilities, and the input and output devices have data storage capabilities. Therefore, the target host machine in the performance state has task processing capabilities and has high power consumption, and has business capabilities.
[0092] In specific implementation, the target host machine can enter the performance state by controlling at least one of the processor, storage device and input / output device in the target host machine to enter the performance state. It should be noted that the target host machine enters the performance state only when the processor, storage device and input / output device all enter the performance state. However, if at least one of the processor, storage device and input / output device is not adjusted to the sleep state, that is, it is always in the performance state, there is no need to adjust its working state. Controlling the target host machine to enter the performance state can enable the target host machine to process tasks with better performance and ensure the business capabilities of the target host machine.
[0093] As a possible implementation, corresponding to adjusting the operating frequency of the processor during the frequency reduction process, in response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the operating frequency of the processor is adjusted to make the processor enter a performance state. At this time, the operating frequency of the processor can be the highest frequency it can achieve to maximize the task processing requirements.
[0094] Specifically, for processors belonging to different processor architectures, the performance frequencies at which they enter the performance state may be different, and the policy center can determine the performance frequency of the processor. Figure 5 As shown, the processor architecture policy is used to indicate the adjustment strategy corresponding to different processor architectures, and the adjustment strategy may include performance frequency. In specific implementation, the performance frequency of the processor in the performance state can be determined based on the processor architecture policy from the policy center and the processor architecture of the target host machine, and then the operating frequency of the processor is adjusted according to the performance frequency to make the processor enter the performance state. For example, for the first processor architecture, which corresponds to the first performance frequency, the operating frequency of the processor belonging to the first processor architecture can be adjusted to the first performance frequency, so that it enters the performance state; for the second processor architecture, which corresponds to the second performance frequency, the operating frequency of the processor belonging to the second processor architecture can be adjusted to the second performance frequency, so that it enters the performance state.
[0095] Specifically, for processors of different processor architectures, entering the performance state can be achieved through different processor frequency adjustment interfaces. Therefore, the processor frequency adjustment interface of the kernel state of the target host can be determined according to the processor architecture policy and the processor architecture of the target host, and then the operating frequency of the processor can be adjusted by calling the processor frequency adjustment interface to make the processor enter the performance state. After determining the performance frequency, the processor frequency adjustment interface can be called according to the performance frequency to adjust the operating frequency of the processor to make it enter the performance state.
[0096] As another possible implementation, corresponding to adjusting the operating frequency of the storage device during the frequency reduction process, in response to the virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the operating frequency of the storage device can be adjusted to put the storage device into a performance state. At this time, the operating frequency of the storage device can be the highest frequency it can achieve to maximize the task processing requirements.
[0097] Specifically, the performance frequency of the storage device in the performance state can be determined, and the operating frequency of the storage device can be adjusted according to the performance frequency so that the storage device enters the performance state. The performance frequency of the storage device in the performance state can be preset. In the process of adjusting the operating frequency of the storage device, the operating frequency of the storage device can be adjusted by calling the storage device frequency adjustment interface corresponding to the storage device in the kernel state to make it enter the performance state.
[0098] As another possible implementation, corresponding to adjusting the operating frequency of the input and output devices during the frequency reduction process, in response to the virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the operating frequency of the input and output devices can be adjusted to make the input and output devices enter a performance state. At this time, the operating frequency of the input and output devices can be the highest frequency that can be achieved to meet the task processing requirements to the greatest extent.
[0099] Specifically, the performance frequency of the input / output device in the performance state can be determined, and the operating frequency of the input / output device can be adjusted according to the performance frequency so that the input / output device enters the performance state. The performance frequency of the input / output device in the performance state can be preset. In the process of adjusting the operating frequency of the input / output device, the operating frequency of the input / output device can be adjusted by calling the input / output device frequency adjustment interface corresponding to the input / output device in the kernel state so that the input / output device enters the performance state.
[0100] As another possible implementation, corresponding to adjusting the operating frequency of the processor, storage device, and input-output device of the target host machine during the frequency reduction process, in response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, the operating frequency of the processor, storage device, and input-output device of the target host machine can be adjusted to make the processor, storage device, and input-output device enter a performance state. Among them, the operating frequencies of the processor, storage device, and input-output device can be adjusted at the same time or in steps. In this way, when the target host machine has a task of producing a virtual machine but is not idle, the operating frequencies of the processor, storage device, and input-output device are adjusted to the highest, so that the target host machine is in the best performance state to meet the task processing requirements to the greatest extent.
[0101] For example, refer to Figure 8 As shown, S1032 may include, S103A, adjusting the operating frequency of the storage device and the input-output device to make the storage device and the input-output device enter the performance state; S103B, adjusting the operating frequency of the processor to make the processor enter the performance state.
[0102] Specifically, the performance frequency of the processor, storage device and input / output device in the sleep state can be determined, and the operating frequency of the processor, storage device and input / output device can be adjusted according to the determined performance frequency to make the processor, storage device and input / output device enter the performance state.
[0103] In the process of adjusting the operating frequencies of the processor, storage device and input-output device, the operating frequencies of the processor, storage device and input-output device can be adjusted by calling the frequency adjustment interface of the kernel state, so that the processor, storage device and input-output device enter the performance state. The frequency adjustment interface includes a processor frequency adjustment interface corresponding to the processor, a storage device frequency adjustment interface corresponding to the storage device and an input-output frequency adjustment interface corresponding to the input-output device, that is, the operating frequency of the processor can be adjusted by calling the processor frequency adjustment interface, the operating frequency of the storage device can be adjusted by calling the storage device frequency adjustment interface, and the operating frequency of the input-output device can be adjusted by calling the input-output frequency adjustment interface.
[0104] In addition, the operating frequencies of two of the processor, storage device, and input / output device may also be adjusted, which will not be described one by one with examples here.
[0105] In response to a virtual machine production instruction for a target host machine, if the target host machine is in a dormant state, refer to Figure 8 As shown, before adjusting the operating frequency of the target host machine, S103 may also include: S1033, locking the state adjustment operation of the target host machine to prevent the operating frequency of the target host machine from being adjusted according to other frequency adjustment instructions, and then executing S1032, that is, executing the operation of adjusting the operating frequency of the target host machine to make the target host machine enter the performance state, so that the target host machine will not be disturbed by other frequency adjustment instructions when it needs to enter the performance state, and can smoothly enter the performance state, avoiding parallel task conflicts in the operating frequency of the target host machine.
[0106] In the embodiment of the present application, the number of virtual machines existing in the target host machine and the working status of the target host machine can also be obtained according to a preset period. If the number of virtual machines existing in the target host machine is not zero, and the working status of the target host machine is a dormant state, the target host machine is determined to be in a non-idle state, and the working frequency of the target host machine can be adjusted to make the target host machine enter a performance state. In other words, a periodic reconciliation mechanism is added during the frequency adjustment process, and a triggering opportunity is added for the frequency increase operation. As a bottom-line solution, it is a guarantee mechanism to ensure that the target host machine is in a performance state when the virtual machine is running, avoid the impact of the target host machine being in a dormant state during the operation of the virtual machine on the performance of the virtual machine, ensure the stable and safe operation of the target host machine, and avoid affecting the realization of the business. This guarantee mechanism can determine that the target host machine is not idle when it is monitored that the number of virtual machines existing in the target host machine is not zero, thereby adjusting the working frequency of the target host machine.
[0107] refer to Fig. 9 As shown, it is another schematic diagram of the frequency increase process provided by the embodiment of the present application. Another triggering branch of the frequency increase process may include: S105, according to the preset cycle, obtain the number of virtual machines existing in the target host machine and the working state of the target host machine. After S105, S106 may be executed to determine whether the number of virtual machines existing in the target host machine is zero. If not (i.e., not zero), S108 may be executed to determine whether the working state of the target host machine is in a dormant state. If so (i.e., in a dormant state), S1032 may be executed. Of course, before S1032, S1033 may be executed first. The specific description of S1032 and S1033 refers to the previous description, which will not be repeated here.
[0108] refer to Figure 7 As shown, in the multiple monitoring results, if the target host machine has a virtual machine and is not in a dormant state, no operation may be performed, and if the target host machine has a virtual machine and is in a dormant state, the operating frequency of the target host machine may be increased to enable the target host machine to enter a performance state. Increasing the operating frequency of the target host machine may include increasing the operating frequency of at least one of a processor, a storage device, and an input / output device in the target host machine.
[0109] S104: Perform a production operation of the virtual machine in the target host machine according to the virtual machine production instruction.
[0110] After the target host enters the performance state, the target host has task processing capability, so the production operation of the virtual machine in the target host can be performed according to the virtual production instruction. Specifically, the production operation of the virtual machine in the target host can be performed by the processor according to the virtual machine production instruction.
[0111] The entire frequency adjustment process is integrated in the user-mode system, which can sense the load of virtual machine production in real time. The frequency scheduler is integrated in the production process of the virtual machine, so the frequency adjustment of the host machine by the frequency scheduler is also integrated into the life cycle management of the virtual machine, meeting the real-time requirements and ensuring that the performance of the virtual machine is not affected by energy saving. The entire automated frequency adjustment process is not perceived or affected by the business. In addition, hibernation processing can be performed in a timely manner, achieving the maximum energy saving effect, that is, achieving the maximum operation power consumption optimization effect. Through this solution, it is expected to reduce the idle power consumption of cloud servers by 35%.
[0112] refer to Fig.10 , is the energy consumption optimization benefit for different server architectures in the embodiment of the present application, wherein the horizontal axis is time, the vertical axis is the average power consumption saving, and the unit is watt (W). Different x86 server architectures may have different energy consumption optimization benefits. The first and second architectures can reduce the power consumption of a single device by about 150W, and the third and fourth architectures can save about 100W of power consumption.
[0113] Based on a frequency modulation method provided in an embodiment of the present application, an embodiment of the present application also provides a frequency modulation device, referring to Fig.11 , which is a structural block diagram of a frequency modulation device provided in an embodiment of the present application, the frequency modulation device is applied to a target host in a cloud server, and the frequency modulation device 1300 includes:
[0114] A destroying unit 1301 is configured to, in response to a virtual machine destroying instruction for the target host machine, execute a destroying operation on the virtual machine corresponding to the virtual machine destroying instruction in the target host machine;
[0115] The frequency reduction unit 1302 is configured to adjust the operating frequency of the target host machine to put the target host machine into a dormant state if it is determined that no virtual machine exists on the target host machine after the destruction operation;
[0116] The frequency increasing unit 1303 is used for responding to the virtual machine production instruction for the target host machine, and if the target host machine is in a dormant state, adjusting the operating frequency of the target host machine to make the target host machine enter a performance state;
[0117] The production unit 1304 is used to perform a production operation of the virtual machine in the target host machine according to the virtual machine production instruction.
[0118] Optionally, the target host machine includes a processor, and the frequency reduction unit 1302 includes:
[0119] a frequency reduction level 1 sub-unit, configured to adjust the operating frequency of the processor to put the processor into a dormant state if it is determined that no virtual machine exists on the target host machine after the destruction operation;
[0120] The frequency upscaling unit 1303 includes:
[0121] The frequency-upgrading level 1 sub-unit is used to respond to a virtual machine production instruction for the target host machine, and if the target host machine is in a dormant state, adjust the operating frequency of the processor to make the processor enter a performance state.
[0122] Optionally, the device further comprises:
[0123] A frequency determination unit, configured to determine a sleep frequency of the processor in a sleep state and a performance frequency in a performance state according to a processor architecture policy from a policy center and a processor architecture of the target host machine;
[0124] The frequency reduction first-level subunit comprises:
[0125] a frequency reduction secondary subunit, configured to adjust the operating frequency of the processor according to the sleep frequency to put the processor into a sleep state if it is determined that no virtual machine exists on the target host machine after the destruction operation;
[0126] The frequency upscaling first-level subunit comprises:
[0127] The frequency-upgrading secondary subunit is used to respond to a virtual machine production instruction for the target host machine, and if the target host machine is in a dormant state, adjust the operating frequency of the processor according to the performance frequency to put the processor into a performance state.
[0128] Optionally, the device further comprises:
[0129] An interface determination unit, configured to determine a processor frequency adjustment interface in a kernel state of the target host machine according to the processor architecture policy and the processor architecture of the target host machine;
[0130] The frequency reduction secondary subunit is specifically used for:
[0131] If it is determined that no virtual machine exists on the target host machine after the destruction operation, adjusting the operating frequency of the processor by calling the processor frequency adjustment interface according to the sleep frequency, so that the processor enters a sleep state;
[0132] The frequency up-conversion secondary subunit is specifically used for:
[0133] In response to a virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, the operating frequency of the processor is adjusted according to the performance frequency by calling the processor frequency adjustment interface, so that the processor enters a performance state.
[0134] Optionally, the frequency reduction first-level subunit includes:
[0135] a frequency reduction level 3 sub-unit, configured to adjust the operating frequencies of the processor, the storage device, and the input / output device to put the processor, the storage device, and the input / output device into a dormant state if it is determined that the target host machine does not have a virtual machine after the destruction operation;
[0136] The frequency upscaling first-level subunit comprises:
[0137] The frequency-upgrading level 3 sub-unit is used to respond to a virtual machine production instruction for the target host machine. If the target host machine is in a sleep state, the operating frequency of the processor, the storage device and the input / output device is adjusted to make the processor, the storage device and the input / output device enter a performance state.
[0138] Optionally, the frequency reduction three-stage subunit is specifically used for:
[0139] If it is determined that there is no virtual machine on the target host machine after the destruction operation, the operating frequencies of the processor, the storage device, and the input-output device are adjusted by calling a frequency adjustment interface in kernel state, so that the processor, the storage device, and the input-output device enter a dormant state, wherein the frequency adjustment interface includes a processor frequency adjustment interface corresponding to the processor, a storage device frequency adjustment interface corresponding to the storage device, and an input-output frequency adjustment interface corresponding to the input-output device;
[0140] The frequency upscaling three-stage subunit is specifically used for:
[0141] In response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the operating frequencies of the processor, the storage device, and the input / output device are adjusted by calling the frequency adjustment interface, so that the processor, the storage device, and the input / output device enter a performance state.
[0142] Optionally, the frequency reduction unit 1302 is specifically used for:
[0143] If it is determined that the target host machine does not have a virtual machine after the destruction operation, locking the state adjustment operation of the target host machine to prevent the operating frequency of the target host machine from being adjusted according to other frequency adjustment instructions, and adjusting the operating frequency of the target host machine to put the target host machine into a dormant state;
[0144] The frequency upscaling unit 1303 is specifically used for:
[0145] In response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the state adjustment operation of the target host machine is locked to prevent the operating frequency of the target host machine from being adjusted according to other frequency adjustment instructions, and the operating frequency of the target host machine is adjusted to make the target host machine enter a performance state.
[0146] Optionally, the device further comprises:
[0147] A monitoring unit, configured to obtain the number of virtual machines existing on the target host machine and the working status of the target host machine according to a preset period;
[0148] The frequency reduction unit 1302 is further configured to: if the number of virtual machines existing in the target host machine is zero and the working state of the target host machine is a performance state, adjust the working frequency of the target host machine to make the target host machine enter a dormant state;
[0149] The frequency increasing unit 1303 is further configured to: if the number of virtual machines existing in the target host machine is not zero and the working state of the target host machine is a sleep state, adjust the working frequency of the target host machine to make the target host machine enter a performance state.
[0150] Optionally, in response to the virtual machine destruction instruction for the target host machine, the device further includes:
[0151] A destruction instruction acquisition unit, configured to acquire a virtual machine destruction instruction for the target host machine from a resource scheduling system before executing a destruction operation on the virtual machine corresponding to the virtual machine destruction instruction in the target host machine;
[0152] The device also includes:
[0153] A production instruction acquisition unit is used to obtain the virtual machine production instruction for the target host machine from the resource scheduling system before adjusting the operating frequency of the target host machine to make the target host machine enter a performance state in response to the virtual machine production instruction for the target host machine, if the target host machine is in a sleep state.
[0154] Optionally, the resource scheduling system is used to determine the target host machine from multiple host machines, and send the virtual machine production instruction to the target host machine.
[0155] Optionally, the device further comprises:
[0156] A policy determination unit is used to determine that the target host machine belongs to a test list according to a sleep grayscale policy before adjusting the operating frequency of the target host machine to put the target host machine into a sleep state if it is determined that the target host machine does not have a virtual machine after the destruction operation.
[0157] It can be seen from the above technical solution that in response to the virtual machine destruction instruction for the target host machine, the target host machine can perform a destruction operation on the virtual machine corresponding to the virtual machine destruction instruction. If it is determined that there is no virtual machine in the target host machine after the destruction operation, it can be determined that the target host machine is idle. At this time, the operating frequency of the target host machine can be adjusted to make the target host machine enter a dormant state. The dormant state has lower power consumption. Since the working state of the target host machine can be adjusted immediately after the destruction operation, the power consumption of the target host machine when idle can be timely reduced without affecting the realization of the business. In addition, in response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, it means that it is not sufficient to perform virtual machine production operations. Therefore, the operating frequency of the target host machine can be adjusted to make the target host machine enter a performance state. The performance state can meet the task processing requirements of the target host machine, and then the production operation of the virtual machine in the target host machine is performed according to the virtual machine production instruction. In this way, the state of the target host machine can be adjusted in time when the target host machine is required to produce a virtual machine, so that it can respond to tasks in time. In an embodiment of the present application, based on the virtual machine destruction instructions and the virtual machine production instructions, the load of the target host machine during the virtual machine production process can be perceived in real time, and the operating frequency of the target host machine can be adjusted based on this. The power consumption can be reduced in time when the target host machine is idle, and the target host machine can be started in time when there are tasks to be processed. The power consumption of the target host machine is reduced as much as possible without affecting the business implementation.
[0158] The embodiment of the present application further provides a computer device, which is the computer device described above and may include a server, which may be connected to a terminal device, and the frequency modulation device described above may be configured in the computer device. The computer device is described below in conjunction with the accompanying drawings.
[0159] See also Fig.12 As shown, the embodiment of the present application provides a terminal device, taking the terminal device as a mobile phone as an example:
[0160] Fig.12 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present application. Fig.12The mobile phone includes: a radio frequency (RF) circuit 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a wireless fidelity (WiFi) module 1470, a processor 1480, and a power supply 1490. Those skilled in the art can understand that Fig.12 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0161] Combine the following Fig.12 A detailed introduction to the various components of the mobile phone:
[0162] The RF circuit 1410 may be used for receiving and sending signals during information transmission or communication or during a call. In particular, after receiving downlink information from a base station, the information is sent to the processor 1480 for processing. In addition, the uplink data is sent to the base station.
[0163] The memory 1420 can be used to store software programs and modules. The processor 1480 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1420. The memory 1420 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1420 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0164] The input unit 1430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the mobile phone. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432 .
[0165] The display unit 1440 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1440 may include a display panel 1441.
[0166] The mobile phone may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors.
[0167] The audio circuit 1460 , the speaker 1461 , and the microphone 1462 can provide an audio interface between the user and the mobile phone.
[0168] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 1470. It provides users with wireless broadband Internet access.
[0169] Processor 1480 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in memory 1420 and calling data stored in memory 1420.
[0170] The mobile phone also includes a power source 1490 (such as a battery) for supplying power to various components.
[0171] The present application also provides a server. Fig.13 As shown, Fig.13 The structural diagram of the server 1500 provided in the embodiment of the present application, the server 1500 may have relatively large differences due to different configurations or performances, and may include one or more processors 1522, such as central processing units (CPU), memory 1532, and one or more storage media 1530 (e.g., one or more mass storage devices) storing application programs 1542 or data 1544. Among them, the memory 1532 and the storage medium 1530 can be short-term storage or permanent storage. The program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the processor 1522 can be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the server 1500.
[0172] The server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558, and / or one or more operating systems 1541, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0173] The steps performed by the server in the above embodiment can be based on Fig.13 The server structure shown.
[0174] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method provided in the above embodiment.
[0175] The embodiments of the present application also provide a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method provided in the above embodiments.
[0176] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to the computer program, and the aforementioned computer program can be stored in a computer-readable storage medium. When the computer program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned computer-readable storage medium can be at least one of the following media: read-only memory (English: Read-only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store computer programs.
[0177] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0178] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Moreover, based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A frequency modulation method, characterized in that: Applied to a target host in a cloud server, the method comprises: In response to a virtual machine destruction instruction for the target host machine, executing a destruction operation on the virtual machine corresponding to the virtual machine destruction instruction in the target host machine; If it is determined that no virtual machine exists on the target host machine after the destruction operation, adjusting the operating frequency of the target host machine to put the target host machine into a dormant state; In response to a virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, adjusting the operating frequency of the target host machine so that the target host machine enters a performance state; The virtual machine production operation in the target host machine is performed according to the virtual machine production instruction.
2. The method according to claim 1, characterized in that The target host machine includes a processor, and if it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequency of the target host machine to put the target host machine into a dormant state includes: If it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequency of the processor to put the processor into a dormant state; In response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, adjusting the operating frequency of the target host machine to make the target host machine enter a performance state, includes: In response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the operating frequency of the processor is adjusted to enable the processor to enter a performance state.
3. The method according to claim 2, characterized in that The method further comprises: Determine a sleep frequency of the processor in a sleep state and a performance frequency of the processor in a performance state according to a processor architecture policy from a policy center and a processor architecture of the target host machine; If it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequency of the processor to put the processor into a dormant state includes: If it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequency of the processor according to the sleep frequency to put the processor into a sleep state; In response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, adjusting the operating frequency of the processor to make the processor enter a performance state, including: In response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the operating frequency of the processor is adjusted according to the performance frequency to enable the processor to enter a performance state.
4. The method according to claim 3, characterized in that The method further comprises: Determining a processor frequency adjustment interface in kernel state of the target host machine according to the processor architecture policy and the processor architecture of the target host machine; If it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequency of the processor according to the sleep frequency to put the processor into a sleep state includes: If it is determined that no virtual machine exists on the target host machine after the destruction operation, adjusting the operating frequency of the processor by calling the processor frequency adjustment interface according to the sleep frequency, so that the processor enters a sleep state; The step of responding to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, adjusting the operating frequency of the processor according to the performance frequency to make the processor enter a performance state includes: In response to a virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, the operating frequency of the processor is adjusted according to the performance frequency by calling the processor frequency adjustment interface, so that the processor enters a performance state.
5. The method according to claim 2, characterized in that: The target host machine further includes a storage device and an input / output device. If it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequency of the processor to put the processor into a dormant state includes: If it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequencies of the processor, the storage device, and the input / output device to put the processor, the storage device, and the input / output device into a dormant state; In response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, adjusting the operating frequency of the processor to make the processor enter a performance state, including: In response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the operating frequencies of the processor, the storage device, and the input / output device are adjusted to put the processor, the storage device, and the input / output device into a performance state.
6. The method according to claim 5, characterized in that If it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequencies of the processor, the storage device, and the input / output device to put the processor, the storage device, and the input / output device into a dormant state includes: If it is determined that there is no virtual machine on the target host machine after the destruction operation, the operating frequencies of the processor, the storage device, and the input-output device are adjusted by calling a frequency adjustment interface in kernel state, so that the processor, the storage device, and the input-output device enter a dormant state, wherein the frequency adjustment interface includes a processor frequency adjustment interface corresponding to the processor, a storage device frequency adjustment interface corresponding to the storage device, and an input-output frequency adjustment interface corresponding to the input-output device; In response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, adjusting the operating frequencies of the processor, the storage device, and the input / output device to make the processor, the storage device, and the input / output device enter a performance state, including: In response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the operating frequencies of the processor, the storage device, and the input / output device are adjusted by calling the frequency adjustment interface, so that the processor, the storage device, and the input / output device enter a performance state.
7. The method according to claim 1, characterized in that If it is determined that the target host machine does not have a virtual machine after the destruction operation, adjusting the operating frequency of the target host machine to put the target host machine into a dormant state includes: If it is determined that the target host machine does not have a virtual machine after the destruction operation, locking the state adjustment operation of the target host machine to prevent the operating frequency of the target host machine from being adjusted according to other frequency adjustment instructions, and adjusting the operating frequency of the target host machine to put the target host machine into a dormant state; In response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, adjusting the operating frequency of the target host machine to make the target host machine enter a performance state, includes: In response to a virtual machine production instruction for the target host machine, if the target host machine is in a sleep state, the state adjustment operation of the target host machine is locked to prevent the operating frequency of the target host machine from being adjusted according to other frequency adjustment instructions, and the operating frequency of the target host machine is adjusted to make the target host machine enter a performance state.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: According to a preset period, obtaining the number of virtual machines existing on the target host machine and the working status of the target host machine; If the number of virtual machines existing in the target host machine is zero, and the working state of the target host machine is a performance state, adjusting the working frequency of the target host machine to make the target host machine enter a dormant state; If the number of virtual machines existing in the target host machine is not zero, and the working state of the target host machine is a dormant state, the working frequency of the target host machine is adjusted to make the target host machine enter a performance state.
9. The method according to any one of claims 1 to 7, characterized in that: Before executing a destruction operation on a virtual machine corresponding to the virtual machine destruction instruction in the target host machine in response to the virtual machine destruction instruction for the target host machine, the method further includes: Obtaining a virtual machine destruction instruction for the target host machine from a resource scheduling system; In response to the virtual machine production instruction for the target host machine, if the target host machine is in a dormant state, before adjusting the operating frequency of the target host machine to make the target host machine enter a performance state, the method further includes: A virtual machine production instruction for the target host machine is obtained from a resource scheduling system.
10. The method according to claim 9, characterized in that The resource scheduling system is used to determine the target host machine from multiple host machines and send the virtual machine production instruction to the target host machine.
11. The method according to any one of claims 1 to 7, characterized in that: If it is determined that the target host machine does not have a virtual machine after the destruction operation, before adjusting the operating frequency of the target host machine to put the target host machine into a dormant state, the method further includes: According to the sleep grayscale strategy, it is determined that the target host belongs to the test list.
12. A frequency modulation device, characterized in that: Applied to a target host in a cloud server, the device comprises: a destroying unit, configured to, in response to a virtual machine destroying instruction for the target host machine, execute a destroying operation on the virtual machine corresponding to the virtual machine destroying instruction in the target host machine; a frequency reduction unit, configured to adjust the operating frequency of the target host machine to put the target host machine into a dormant state if it is determined that no virtual machine exists on the target host machine after the destruction operation; a frequency increase unit, configured to respond to a virtual machine production instruction for the target host machine, and if the target host machine is in a dormant state, adjust the operating frequency of the target host machine to make the target host machine enter a performance state; The production unit is used to perform a production operation of the virtual machine in the target host machine according to the virtual machine production instruction.
13. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute the frequency modulation method according to any one of claims 1 to 11 according to the instructions in the computer program.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the frequency modulation method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that When the method is run on a computer device, the computer device is enabled to execute the frequency modulation method described in any one of claims 1 to 11.
Citation Information
Patent Citations
Method and system for intelligently controlling virtual machine host
CN106445076A
Power control method for virtual machine and virtual computer system
US20090150896A1
Method and apparatus for reducing power consumption of virtual machine cluster
WO2020244300A1