Energy coordination-oriented virtual machine dynamic migration method

By constructing an energy management module and a virtual machine dynamic migration module, and combining grid electricity prices and data center needs, the charging and discharging of uninterruptible power supplies (UPS) and virtual machine migration are optimized, solving the problem of independent scheduling between the UPS system and virtual machines, and improving the energy and resource utilization efficiency of the data center.

CN121349600BActive Publication Date: 2026-03-24GUIZHOU UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, uninterruptible power supply systems and virtual machine scheduling are independent and fail to be optimized together, resulting in low energy utilization efficiency in data centers and an inability to adjust charging and discharging strategies according to electricity price fluctuations, thus increasing operating costs.

Method used

An energy management module and a virtual machine dynamic migration module are constructed. Combining grid electricity prices and data center energy demands, the Q-learning algorithm is used to optimize virtual machine allocation, finely control the charging and discharging of uninterruptible power supplies, and reasonably adjust virtual machine migration strategies.

Benefits of technology

It enables dynamic adjustment of charging and discharging strategies based on electricity prices, reducing data center electricity costs, improving energy efficiency and resource utilization, and ensuring the stability of energy supply for critical businesses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121349600B_ABST
    Figure CN121349600B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of virtual machine migration, and particularly relates to a virtual machine dynamic migration method for energy coordination, comprising the following steps: S1, constructing an energy management module and a virtual machine dynamic migration module, and respectively initializing parameters of the energy management module and the virtual machine dynamic migration module; S2, performing energy management analysis on the energy management module after parameter initialization; S3, repeatedly executing step S2 until a first preset execution termination condition is met, then stopping executing step S2, and outputting updated energy demand parameters; S4, performing virtual machine migration analysis on the virtual machine dynamic migration module after parameter initialization; and S5, repeatedly executing step S4 until a second preset execution termination condition is met, then stopping executing step S4, and outputting a virtual machine migration result. The present application can dynamically adjust the virtual machine migration strategy according to the energy state and the power grid price, and significantly improves the energy utilization efficiency of the data center.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of virtual machine migration, and particularly relates to an energy coordination-oriented virtual machine dynamic migration method. BACKGROUND

[0002] With the rapid iteration of artificial intelligence technology, the breakthroughs represented by deep learning and large models are promoting the intelligent transformation of various industries. These cutting-edge AI applications all rely on the computing resources provided by data centers. As the demand for computing power for AI model training, inference and other tasks grows exponentially, the computing pressure faced by data centers is also increasing. To this end, effective virtual machine scheduling algorithms are needed to allocate computing power. However, traditional data centers generally use static virtual machine scheduling strategies, focusing only on task efficiency and ignoring energy consumption, and have problems such as low resource utilization, high service level agreement violation rate, etc., resulting in high service costs for AI computing applications and limiting their widespread development. Virtual machine scheduling mainly targets the computing power resources of data centers, allocating computing tasks through effective algorithms to solve the computing pressure problem caused by the growth of AI task computing power demand. The uninterruptible power supply system is a device that provides emergency power support for data centers. The functions of the two are relatively independent. The uninterruptible power supply system of the data center is single-function, focusing only on passive defense, i.e., as an emergency backup power supply, and has not been coordinated with the management of computing power resources involved in virtual machine scheduling. This single-function mode makes the uninterruptible power supply system unable to play a more important role in the overall operation of the data center, and lacks correlation with the goal of efficient resource utilization pursued by virtual machine scheduling, limiting the overall efficiency improvement of the data center.

[0003] Traditional uninterruptible power supply (UPS) only serves as an emergency backup power supply, forming a "data island" with the data center energy system. Electricity arbitrage usually refers to charging at low electricity prices and discharging at peak times to reduce costs. However, traditional UPSs are single-function and not effectively integrated with the energy system, so they cannot adjust the charging and discharging strategy according to electricity price fluctuations. For example, during the low electricity price period, there is no use of excess power to charge the battery to store energy; and during the peak electricity price period, it still relies on external high-priced power supply instead of using stored energy, thus missing the opportunity to reduce electricity costs through reasonable charging and discharging and achieving electricity arbitrage, increasing the operating cost of the data center. Data island refers to the fact that traditional UPS only serves as an emergency backup power supply and lacks effective connection and information exchange with the data center energy system, and the functions are independent of each other. Traditional UPS only serves as an emergency backup power supply and is disconnected from the energy system, and cannot adjust operation according to electricity price information. During the low electricity price period, the electricity price is low, which is a good time to charge and store energy, but traditional UPSs are single-function and do not perform charging operations. When the electricity price is high, the traditional UPS still needs to obtain high-priced electricity from the external power grid to meet the data center's demand, or even if there is electricity, it is not used reasonably. This situation of not charging during the low peak period and relying on high-priced electricity or not reasonably discharging during the peak period makes it impossible for the data center to reduce electricity costs through reasonable charging and discharging of the UPS system, missing the opportunity for electricity arbitrage, resulting in an increase in annual operating costs. Furthermore, the battery is in a floating charge state for a long time, with low average utilization rate but still continuously generating charging and discharging losses, and thus cannot reasonably plan virtual machine migration according to energy status such as the remaining power of the UPS, charging progress, etc., nor can it adjust the virtual machine migration strategy in real time according to the dynamic changes in the electricity price of the power grid.

[0004] Chinese Patent Publication No. CN115292000A discloses a virtual machine dynamic migration method, device and electronic equipment. The method includes determining the type of the virtual machine to be migrated on the source host, storing the data structure corresponding to the interrupt controller that meets the conditions in response to the type being consistent with the preset type, adding the data structure to the migration transmission data of the virtual machine to be migrated, and migrating the virtual machine to be migrated from the source host to the target host based on the migration transmission data. Although this scheme can migrate the migration transmission data from the source host to the target host and achieve hardware-based transparent virtual machine migration, it lacks consideration of the coordination of UPS charging and discharging and virtual machine migration, and cannot dynamically adjust the virtual machine migration strategy according to the energy status and electricity price of the power grid, thereby reducing the energy utilization efficiency of the data center. SUMMARY

[0005] To this end, the present application provides an energy collaborative oriented virtual machine dynamic migration method to overcome the problem that the prior art lacks consideration of the cooperation between the charging and discharging of the uninterruptible power supply and the virtual machine migration, cannot dynamically adjust the virtual machine migration strategy according to the energy state and the power grid price, and reduces the energy utilization efficiency of the data center.

[0006] To achieve the above-mentioned purpose, the present application provides an energy collaborative oriented virtual machine dynamic migration method, comprising the following steps:

[0007] S1, constructing an energy management module and a virtual machine dynamic migration module, and respectively initializing parameters of the energy management module and the virtual machine dynamic migration module to obtain the parameter initialized energy management module and the parameter initialized virtual machine dynamic migration module;

[0008] S2, performing energy management analysis on the parameter initialized energy management module, comprising:

[0009] determining whether to enable the discharging function of the uninterruptible power supply based on the power grid price level and the total energy demand of the data center, and outputting a discharging state identifier;

[0010] if the discharging state identifier is in the enabled state, then during the discharging of the uninterruptible power supply, determining whether to terminate the discharging function of the uninterruptible power supply according to a preset discharging termination condition, if yes, then terminating the discharging function of the uninterruptible power supply and outputting a discharging termination signal, if no, then skipping;

[0011] reacquiring the power grid price level and the total energy demand of the data center, and determining whether to enable the charging function of the uninterruptible power supply according to a preset charging condition, if yes, then charging the uninterruptible power supply, if no, then skipping;

[0012] S3, repeatedly executing step S2 until a first preset execution termination condition is met, then stopping executing step S2 and outputting updated energy demand parameters;

[0013] S4, performing virtual machine migration analysis on the parameter initialized virtual machine dynamic migration module, comprising:

[0014] in the parameter initialized virtual machine dynamic migration module, obtaining a virtual machine list and a physical server list in combination with the updated energy demand parameters;

[0015] taking the virtual machines in the virtual machine list as a state space, and taking the physical servers in the physical server list as an action set, inputting the state space and the action set into a Q learning algorithm to construct a Q table, and optimizing a virtual machine allocation sequence through iterative calculation of Q values, and outputting a final virtual machine allocation sequence;

[0016] according to - the greedy strategy simulates the allocation process of the virtual machines in the final virtual machine allocation sequence to the physical servers, to obtain a simulation allocation result;

[0017] a virtual machine to-be-allocated list is obtained based on the grouping result of the physical servers and a preset adaptation principle, and the virtual machines in the virtual machine to-be-allocated list are re-allocated to the target physical servers;

[0018] S5, repeating the step S4 until a second preset execution termination condition is met, stopping the step S4, and outputting a virtual machine migration result.

[0019] Compared with the prior art, the application has the beneficial effects that:

[0020] In the parameter-initialized energy management module, it can be judged whether to enable the discharge function of the uninterruptible power supply based on the grid electricity price level and the total energy demand of the data center, and once the preset discharge termination condition is met during the discharge of the uninterruptible power supply, a discharge termination signal is output in time, realizing fine control of the discharge process of the uninterruptible power supply, avoiding damage to the battery life caused by excessive discharge, and at the same time ensuring that the energy of the uninterruptible power supply can be fully utilized at critical moments, judging whether to enable the charging function of the uninterruptible power supply according to the preset charging condition, and flexibly adjusting the charging and discharging strategy of the uninterruptible power supply according to the fluctuation of the grid electricity price and the actual energy demand of the data center, charging at the electricity price trough and discharging at the peak, thereby effectively reducing the electricity cost of the data center and improving the overall energy utilization efficiency.

[0021] In the parameter-initialized virtual machine dynamic migration module, the virtual machine migration environment is initialized in combination with the updated energy demand parameters, the virtual machine list and the physical server list are obtained, the virtual machines in the virtual machine list are taken as the state space, and the physical servers in the physical server list are taken as the action set, the state space and the action set are input into the Q learning algorithm to construct a Q table and calculate the Q value through iteration, and the final virtual machine allocation sequence is output, when the energy state is tight, the virtual machines can be migrated to the physical servers with higher energy utilization efficiency through the optimized virtual machine allocation sequence, avoiding running in the high energy consumption state, thereby reducing energy waste, for example, when the grid electricity price is high and the total energy demand of the data center is large, the virtual machines of part of non-critical businesses can be migrated to the physical servers with lower energy consumption, the energy supply of critical businesses is preferentially guaranteed, the energy resources and computing resources are reasonably allocated, and the overall resource utilization efficiency and operation stability of the data center are improved; the physical servers are analyzed according to the CPU utilization rate of the physical servers, and a more reasonable virtual machine to-be-allocated sequence is formulated in combination with the preset adaptation principle and the final virtual machine allocation sequence, so that the virtual machine migration process is closely related to the real-time state of the physical servers, the change of the server state can be timely adapted, and the stability of the data center system is enhanced.

[0022] Further, in the S2, judging whether to enable the discharging function of the uninterruptible power supply comprises:

[0023] Step A1, obtaining in the energy management module after parameter initialization the grid electricity price level at the moment , the total amount of energy stored by the uninterruptible power supply at the moment and the total energy required by the data center at moment ;

[0024] Step A2, determining the discharging function condition of the uninterruptible power supply according to the grid electricity price level at the moment , the total amount of energy stored by the uninterruptible power supply at the moment and the total energy required by the data center at moment , the mathematical expression of the discharging function condition is:

[0025] ; in the formula, represents the minimum energy required by the uninterruptible power supply as a backup power supply function, represents the energy required under peak load, represents the moment the grid is at a high electricity price level.

[0026] In this scheme, by obtaining in the energy management module after parameter initialization the grid electricity price level at the moment, the total energy requirement of the data center and the total amount of energy stored by the uninterruptible power supply, the discharging function condition of the uninterruptible power supply is determined according to this, and the total amount of energy stored by the uninterruptible power supply, the minimum energy required for backup, the energy required for peak load and the high electricity price level of the grid are comprehensively considered. Whether to enable the discharging function can be more accurately and scientifically judged, energy utilization can be optimized, and electricity cost can be reduced.

[0027] Further, in the S2, the preset discharging termination condition comprises a first preset discharging termination condition and a second preset discharging termination condition, and when any one of the first preset discharging termination condition and the second preset discharging termination condition is met, it is judged whether to terminate the discharging function of the uninterruptible power supply. The mathematical expression of the first preset discharging termination condition is: , and the second preset discharging termination condition is: , in the formula, represents the moment the grid is at a low electricity price level.

[0028] In the scheme, the preset termination discharge condition is determined to contain two types, and any one satisfies the trigger judgment, which is beneficial to flexibly control the uninterrupted power supply discharge and provides a basis for accurate judgment of termination discharge.

[0029] Further, in the S2, the mathematical expression of the preset charging condition is: .

[0030] In the scheme, the preset charging condition is set, which can judge whether to charge the uninterrupted power supply based on accurate conditions, so that the charging operation is more scientific and reasonable, blind charging is avoided, and the energy management efficiency is effectively improved.

[0031] Further, in the S4, the state space and action set are input into the Q learning algorithm to construct the Q table, and the iteration calculation of the Q value is used to optimize the virtual machine allocation sequence, including:

[0032] Step B1, defining the state space The action set is for the list of virtual machines to be allocated. The list of physical servers in the active state.

[0033] Step B2, initializing the Q table, and defining the Q value as 0 or 1.

[0034] Step B3, the mathematical expression for iteration calculation of the Q value is:

[0035] , wherein represents the state , the Q value of the action , the state at time , the state at time , the action at time , the learning rate when the algorithm converges , the discount factor , the reward value obtained by the agent when selecting the action in the state , all possible actions in the state , the maximum Q value in all possible actions in the state .

[0036] ​​​​​​In the scheme, by defining the state space as the list of virtual machines to be allocated, the action set as the list of activated physical servers in S4, and giving the detailed mathematical expression of iterative calculation of Q value, the value of action taken in different states can be quantified more accurately, so that the Q learning algorithm can more scientifically construct the Q table, iteratively update the Q value, and optimize the virtual machine allocation strategy.

[0037] Further, in the S4, according to The simulation of the allocation process of the virtual machines in the final virtual machine allocation sequence to the physical servers by the greedy strategy comprises:

[0038] Step C1, with a probability randomly selecting a physical server as the first action;

[0039] Step C2, with a probability selecting the physical server with the maximum current Q value as the second action;

[0040] Step C3, according to the selected action, simulating the allocation of the virtual machines in the final virtual machine allocation sequence to the physical servers, calculating the total energy consumption of the physical servers and the execution cost of the virtual machines, and updating the reward value and the Q value.

[0041] In the scheme, by adopting The greedy strategy is used to select the action, with a probability randomly selecting a physical server as the first action, and with a probability selecting the physical server with the maximum current Q value as the second action, using the existing experience, combining the two to simulate the allocation of the virtual machines, calculating the total energy consumption of the physical servers and the execution cost of the virtual machines, and updating the reward value and the Q value, the exploration and utilization can be balanced, the optimal virtual machine allocation scheme can be found more efficiently, and the allocation cost can be reduced.

[0042] Further, in the S4, the list of virtual machines to be allocated is obtained according to the grouping result of the physical servers and the preset adaptation principle.

[0043] Step D1, according to the preset upper limit of CPU utilization rate threshold and lower limit of CPU utilization rate threshold of the physical servers, the physical servers are divided into overload group, underload group and normal group, and the grouping result is obtained;

[0044] Step D2, according to the preset adaptation principle, the grouping result and the optimized virtual machine allocation sequence are matched and analyzed to obtain a matching analysis result;

[0045] Step D3, based on the matching analysis result, the migration corresponding relationship of the virtual machines between the physical servers is determined, and the list of virtual machines to be allocated is obtained according to the migration corresponding relationship.

[0046] In the scheme, the physical server groups are divided according to the upper and lower thresholds of the CPU utilization rate, the server load state can be accurately distinguished, the grouping result is matched with the optimized virtual machine allocation sequence according to the preset adaptation principle, and then the migration corresponding relationship is determined to obtain the virtual machine to-be-allocated list, so that the virtual machine to-be-allocated list is more targeted, the server load can be effectively balanced, and the resource utilization efficiency and system stability are improved.

[0047] Further, the step D2 comprises:

[0048] Step D21, analyze the preset adaptation principle, determine the virtual machine allocation adaptation conditions corresponding to the overload group, the underload group and the normal group respectively, and form an adaptation rule set;

[0049] Step D22, input the grouping result and the optimized virtual machine allocation sequence into the adaptation rule set, and match the grouping and the virtual machine item by item to obtain an initial matching result;

[0050] Step D23, according to the preset priority rule, the conflict items in the initial matching result are de-duplicated to determine the unique matching relationship, and a matching analysis result is formed.

[0051] In the scheme, the adaptation rule set is formed by analyzing the preset adaptation principle, the adaptation conditions of different server groups and virtual machine allocation can be clearly defined, the grouping and the allocation sequence are input into the set and matched item by item, the adaptation condition can be accurately found out, and then the preset priority rule is used to process the conflict items to determine the unique matching relationship, so that the problems of matching confusion and conflict difficult to solve in the prior art are effectively avoided, and the rationality of virtual machine allocation and server load matching is improved. BRIEF DESCRIPTION OF DRAWINGS

[0052] Figure 1 It is a flowchart of a virtual machine dynamic migration method for energy coordination of an embodiment of the present application.

[0053] Figure 2 It is a flowchart of the implementation of the energy management module and the implementation of the virtual machine dynamic migration module in the embodiment of the present application. DETAILED DESCRIPTION

[0054] The following will be further described in detail through specific embodiments:

[0055] As shown in the figure, it is a flowchart of a virtual machine dynamic migration method for energy coordination of an embodiment of the present application, comprising the following steps: Figure 1

[0056] S1, an energy management module and a virtual machine dynamic migration module are constructed, and the energy management module and the virtual machine dynamic migration module are respectively parameterized to obtain the parameterized energy management module and the parameterized virtual machine dynamic migration module.​

[0057] S2, performing energy management analysis on the energy management module initialized with parameters, comprising:

[0058] determining whether to enable the discharging function of the uninterruptible power supply based on the grid electricity price level and the total energy demand of the data center, and outputting a discharging state identifier;

[0059] If the discharging state identifier is in the enabled state, during the discharging of the uninterruptible power supply, it is determined whether to terminate the discharging function of the uninterruptible power supply according to the preset termination condition, if yes, the discharging function of the uninterruptible power supply is terminated, and a discharging termination signal is output, if no, it is skipped;

[0060] The grid electricity price level and the total energy demand of the data center are reacquired, and it is determined whether to enable the charging function of the uninterruptible power supply according to the preset charging condition, if yes, the uninterruptible power supply is charged, if no, it is skipped;

[0061] S3, repeating step S2 until the first preset execution termination condition is met, stopping step S2, and outputting the updated energy demand parameter;

[0062] S4, performing virtual machine migration analysis on the virtual machine dynamic migration module initialized with parameters, comprising:

[0063] In the virtual machine dynamic migration module initialized with parameters, the virtual machine list and the physical server list are obtained in combination with the updated energy demand parameter;

[0064] The virtual machines in the virtual machine list are taken as a state space, and the physical servers in the physical server list are taken as an action set, the state space and the action set are input into a Q learning algorithm to construct a Q table, and the virtual machine allocation sequence is optimized through iterative calculation of Q value, and the final virtual machine allocation sequence is output;

[0065] According to - The greedy strategy simulates the allocation process of the virtual machines in the final virtual machine allocation sequence to the physical servers to obtain a simulation allocation result;

[0066] Based on the grouping result of the physical servers and the preset adaptation principle, a virtual machine to-be-allocated list is obtained, and the virtual machines in the virtual machine to-be-allocated list are re-allocated to the target physical servers;

[0067] S5, repeating step S4 until the second preset execution termination condition is met, stopping step S4, and outputting the virtual machine migration result.

[0068] Specifically, in S2, determining whether to enable the discharging function of the uninterruptible power supply comprises:

[0069] Step A1, obtaining in the energy management module after parameter initialization the grid electricity price level at the moment 、 the total amount of energy stored by the uninterruptible power supply at the moment and the total energy required by the data center at the moment is ;

[0070] Step A2, determining the discharge function condition of the uninterruptible power supply according to the grid electricity price level at the moment 、 the total amount of energy stored by the uninterruptible power supply at the moment and the total energy required by the data center at the moment is The mathematical expression of the discharge function condition is:

[0071] ; In the formula, represents the minimum energy required by the uninterruptible power supply as a backup power supply function, represents the energy required under peak load, represents the moment the grid is at a high electricity price level.

[0072] Specifically, in S2, the preset termination discharge condition includes a first preset termination discharge condition and a second preset termination discharge condition, and the first preset termination discharge condition and the second preset termination discharge condition satisfy any one condition to determine whether to terminate the discharge function of the uninterruptible power supply. The mathematical expression of the first preset termination discharge condition is: , and the second preset termination discharge condition is: , in which represents the moment the grid is at a low electricity price level.

[0073] Specifically, in S2, the preset charging condition is constructed according to the reacquired grid electricity price level and the total energy requirement of the data center. The mathematical expression of the preset charging condition is: .

[0074] Specifically, in S4, the state space and the action set are input into the Q learning algorithm to construct a Q table, and the iteration calculation of the Q value optimizes the virtual machine allocation sequence, which includes:

[0075] Step B1, defining the state space as the list of virtual machines to be allocated, and the action set as the list of physical servers in the active state;

[0076] Step B2, initialize the Q table and define the Q value as 0 or 1;

[0077] Step B3, the mathematical expression for iterative calculation of the Q value is:

[0078] , wherein, represents the state under the action of the Q value, represents the state at the moment, represents the state at the moment, represents the action at the moment, represents the learning rate when the algorithm converges, represents the discount factor, represents the reward value obtained by the agent when selecting an action in the state , represents all possible actions in the state , represents the maximum Q value among all possible actions in the state .

[0079] In this embodiment, the learning rate when the algorithm converges takes a value in the interval (0, 1], because guarantees parameter update, avoids oscillation divergence, and generally takes a value of 0.1-0.3. The discount factor takes a value in the interval [0, 1), and the reinforcement learning standard setting is: only considers immediate rewards, considers long-term returns. Taking 0.9 balances “current income” and “future potential”, which is the classic configuration of Q learning.

[0080] Specifically, in S4, the allocation process of the virtual machine to the physical server in the final virtual machine allocation sequence is simulated according to - the greedy strategy, which includes:

[0081] Step C1, randomly select a physical server as the first action with a probability ;

[0082] Step C2, select the physical server with the maximum current Q value as the second action with a probability ;

[0083] Step C3: Based on the selected action, simulate allocating virtual machines from the final virtual machine allocation sequence to physical servers, calculate the total energy consumption of the physical servers and the execution cost of the virtual machines, and update the reward value and Q value.

[0084] In step C1, a parameter is set in the Q-learning algorithm. (0 < <1), representing the probability of randomly selecting an action. A random value between 0 and 1, `rand`, is generated each time an action needs to be selected (i.e., selecting a target physical server to allocate a virtual machine). Purely greedy (prone to getting trapped in local optima). Purely random (no learning). The initial value of 0.2+ and the decay strategy are standard practices in the industry (such as OpenAI Spinning Up). The value range of rand is (0, 1), which is the standard random number generation interval. It has no special physical meaning and is only used for probability comparison.

[0085] If rand < If a server is randomly selected from all available physical servers, it will be chosen as the first action. This random selection helps the algorithm explore more possibilities in the early stages and avoid getting trapped in local optima. For example, with 10 physical servers, the system will randomly select one from these 10, regardless of the server's current Q-value.

[0086] In step C2, when rand is greater than or equal to When the time comes, the process proceeds to select the physical server with the highest current Q-value as the second action. First, the Q-values ​​of all physical servers corresponding to the current state (including virtual machine resource requirements, physical server resource status, etc.) are retrieved from the Q-table. Then, these Q-values ​​are compared, and the physical server with the highest Q-value is selected as the second action. This step makes the optimal choice based on current knowledge (i.e., the information in the Q-table) to maximize the long-term reward. For example, if calculations show that physical server A has the highest Q-value in the current state, then physical server A is selected as the second action.

[0087] In step C3, after selecting the first and second actions, the process of allocating virtual machines under these two actions is simulated. The cost corresponding to each action is calculated; in this embodiment, the cost includes factors such as resource consumption, migration time, and impact on business operations. A reward value is calculated based on the cost. The reward value should reflect the merits of the action; for example, the lower the cost, the higher the reward value. Then, the Q-value is updated using the update formula of the Q-learning algorithm. By continuously updating the Q-value, the algorithm can gradually learn the strategy of selecting the optimal action under different states.

[0088] Specifically, in S4, the list of virtual machines to be allocated is obtained according to the grouping result of the physical servers and a preset adaptation principle, which includes:

[0089] Step D1, according to the preset upper limit of CPU utilization threshold and lower limit of CPU utilization threshold of the physical server, the physical server is divided into overload group, underload group and normal group, and the grouping result is obtained;

[0090] Step D2, according to the preset adaptation principle, the grouping result and the optimized virtual machine allocation sequence are matched and analyzed, and the matching analysis result is obtained;

[0091] Step D3, based on the matching analysis result, the migration corresponding relationship of the virtual machine between the physical servers is determined, and the list of virtual machines to be allocated is obtained according to the migration corresponding relationship.

[0092] Step D2 includes:

[0093] Step D21, analyze the preset adaptation principle, and determine the virtual machine allocation adaptation conditions corresponding to the overload group, the underload group and the normal group respectively, and form an adaptation rule set;

[0094] Step D22, input the grouping result and the optimized virtual machine allocation sequence into the adaptation rule set, and match the groups and the virtual machines one by one to obtain the initial matching result;

[0095] Step D23, according to the preset priority rule, the conflict items existing in the initial matching result are processed to determine the unique matching relationship, and the matching analysis result is formed.

[0096] In this embodiment, the determination of the preset upper limit of CPU utilization threshold and lower limit of CPU utilization threshold of the physical server needs to consider multiple factors. The determination of the preset upper limit of CPU utilization threshold of the physical server needs to consider the server hardware performance, heat dissipation capacity, etc. If the hardware performance is strong and the heat dissipation is good, a higher upper limit can be set to ensure that the server can still run stably under high load. However, a high upper limit will increase the risk of hardware wear and tear, and the performance and service life need to be balanced. The setting of the preset lower limit of CPU utilization threshold of the physical server is based on the resource utilization efficiency. If it is too low, the resources will be wasted. The running situation of the server under different loads can be analyzed by statistical data, the relationship between performance and load can be analyzed, and the reasonable range can be determined according to the requirements of response time and throughput of the business. At the same time, referring to the industry standards and the configuration experience of similar servers, after multiple tests and adjustments, the upper limit of CPU utilization threshold and the lower limit of CPU utilization threshold suitable for the business scene are finally determined.

[0097] The determination of the preset adaptation principle is based on business needs, and the requirements of different businesses on server performance are clear, such as high-performance servers for key businesses and high resource stability requirements. Secondly, the resource demand characteristics of virtual machines are considered, including CPU, memory and other resource occupation. Combined with the performance status of the physical server grouping (overload, underload, normal group), the matching rules are formulated. For example, the overload group should try to reduce the allocation of new virtual machines, and preferentially migrate virtual machines with high resource demand; the underload group can appropriately allocate virtual machines with moderate or high resource demand to improve resource utilization; the normal group allocates virtual machines according to normal business demand. At the same time, the affinity and anti-affinity requirements of virtual machines are considered to ensure that the matching principle can meet the business continuity and efficient use of resources.

[0098] The determination of the preset priority rule is from the perspective of business importance, and the allocation and migration of virtual machines corresponding to key businesses have higher priority to ensure their stable operation. Resource demand urgency is also an important factor, and virtual machines that urgently need resources to complete tasks are given priority. From the perspective of server performance, servers with severe underload are given priority to allocate virtual machines to quickly balance resources. In addition, the migration cost of virtual machines is considered, including migration time, impact on business, etc., and virtual machines with low migration cost are given priority. According to historical operation data, virtual machines or server-related operations that frequently appear resource problems are given lower priority. By considering these factors, priority order is set for different situations to ensure that when conflicts occur, a unique matching relationship can be quickly and reasonably determined.

[0099] The division of physical servers into overload groups, underload groups and normal groups includes: dividing physical server groups according to the preset CPU utilization threshold upper limit and CPU utilization threshold lower limit. Real-time collection of CPU utilization data of each physical server is compared with the threshold. If the CPU utilization of the server is continuously higher than the threshold CPU utilization threshold upper limit, it indicates that the load is too high, and the server may face performance degradation, response delay and other problems, and the server is divided into the overload group. If the CPU utilization is continuously lower than the CPU utilization threshold lower limit, it means that the server resources are not fully utilized, and there is idle situation, such servers are classified as underload group. While the CPU utilization is between the threshold upper limit and the CPU utilization threshold lower limit, the server is in a relatively stable state, and the resource utilization is reasonable, then it is divided into the normal group. Through this division, the load status of each server can be clearly understood, providing a basis for subsequent virtual machine allocation and migration. For the overload group, virtual machine migration is selected to make the CPU utilization of the physical server lower than the CPU utilization threshold upper limit; for the underload group, all virtual machines in it are migrated and the physical server is hibernated to save energy. Then the virtual machines that need to be migrated are added to the virtual machine allocation list.

[0100] The matching analysis of the grouping result and the optimized virtual machine allocation sequence according to the preset adaptation principle comprises: firstly, the preset adaptation principle is analyzed to determine the virtual machine allocation adaptation conditions corresponding to the overload group, the underload group and the normal group respectively, and a set of adaptation rules is formed. For example, the overload group adaptation rule can be that no new virtual machine is allocated, and the virtual machine with high resource occupation is preferentially migrated out; the underload group adaptation rule is that the virtual machine with moderate or high resource demand can be allocated to improve resource utilization; and the normal group is allocated according to the conventional business demand to ensure stable operation of the business. The grouping result and the optimized virtual machine allocation sequence are input into the set of adaptation rules, and are compared item by item. It is checked whether the resource demand and business attribute of each virtual machine meet the adaptation conditions of the physical server group. If yes, it is marked as matching, and if not, the mismatch reason is recorded, and finally an initial matching result is obtained, which reflects the preliminary adaptation of the grouping and the virtual machine allocation.

[0101] The migration corresponding relationship of the virtual machine between the physical servers is determined, and a virtual machine migration scheme is obtained according to the migration corresponding relationship, which comprises: determining the migration corresponding relationship based on the matching analysis result. For the virtual machine to be migrated in the overload group, according to the resource status and adaptation rules of the underload group and the normal group, a physical server that can meet the resource demand and meet the business requirements is found as the migration target. The affinity and anti-affinity of the virtual machine are considered to ensure that the virtual machine can run normally after migration and does not affect other virtual machines. At the same time, the migration cost is also considered, and the scheme with short migration path and small business impact is preferentially selected. After determining the migration corresponding relationship, a detailed migration scheme is developed. It includes migration time arrangement, selection of business low peak period to reduce impact, clear migration steps such as data backup first and then migration operation, and emergency plan to deal with possible faults in the migration process to ensure smooth migration.

[0102] The adaptation conditions of the virtual machine allocation corresponding to the overload group, the underload group and the normal group are determined to form a set of adaptation rules, which comprises: the adaptation conditions of the virtual machine allocation of each group need to consider multiple factors. For the overload group, since its load is already high, the adaptation condition should focus on reducing the load. For example, no new virtual machine is allocated to avoid further increasing the burden; and the virtual machine with high resource occupation and relatively low performance requirement is preferentially migrated out to release resources. The underload group has idle resources, and the adaptation condition can be set as the virtual machine with moderate or high resource demand to be allocated to improve resource utilization; at the same time, the business correlation is considered, and the related business virtual machines are allocated together for easy management and cooperation. The normal group allocates virtual machines according to the conventional business demand to ensure stable operation of the business. Combined with the business characteristics, server performance and virtual machine resource demand, these adaptation conditions are sorted into clear and explicit rules to form a set of adaptation rules, which provides a basis for subsequent matching analysis.

[0103] When matching the group and the virtual machine item by item, the grouping result and the optimized virtual machine allocation sequence information are obtained first. For each physical server group (overloaded group, underloaded group, normal group), the servers in the group are checked in turn according to the formed adaptation rule set. For each server, the server is compared with the virtual machine in the virtual machine allocation sequence. It is checked whether the resource requirements (such as CPU, memory, etc.) of the virtual machine are within the range allowed by the server group adaptation rules, while considering whether the business attribute of the virtual machine is consistent with the business positioning of the server group. For example, if the server group is a critical business group, the virtual machine should also belong to the critical business. If all the conditions of the virtual machine meet the server group adaptation rules, it is marked as matching; if one of them does not meet, the reason for not matching is recorded. Through such detailed comparison item by item, the adaptability of the group and the virtual machine is comprehensively analyzed, and the initial matching result is obtained.

[0104] The conflict items in the initial matching result are processed according to the preset priority rules, including: when the initial matching result has conflict items, the conflict items are removed according to the preset priority rules. First, the specific situation of the conflict items is sorted out to determine which virtual machines and physical servers are involved. According to the preset business importance priority, if the conflict involves a critical business virtual machine, the matching relationship of the critical business virtual machine is prioritized, and the matching of other non-critical business virtual machines is adjusted. Considering the urgency of resource requirements, virtual machines with urgent resource requirements are prioritized for processing, and the matching is adjusted to meet their requirements. From the perspective of server performance, if the conflict causes the underloaded group to be unable to effectively utilize resources, the underloaded group-related conflict is prioritized to be solved to ensure reasonable allocation of resources. At the same time, combined with the migration cost, a low-cost matching scheme is selected. According to these priority rules, the conflict items are weighed and adjusted to remove duplicate or unreasonable matching, determine the unique matching relationship, and form the final matching analysis result that meets the business requirements and resource utilization requirements.

[0105] The migration target selection process includes:

[0106] From the overloaded group, select virtual machines for migration according to priority (such as response time sensitivity, migration overhead, etc.), until the server utilization rate is reduced to below the upper limit of the CPU utilization rate threshold.

[0107] For the underloaded group server, migrate all virtual machines thereon and trigger the server hibernation mechanism (shutdown or enter low-power mode) to reduce static power consumption.

[0108] Use the Q-learning algorithm to select the optimal target server for the virtual machine to be migrated (which can consider energy consumption, execution cost, SLA guarantee, etc.).

[0109] For example, Figure 2As shown, it is the flow diagram of the energy management module and the virtual machine dynamic migration module in the embodiment of the present application. The first step: system initialization: (1) system component initialization, setting the energy management module and the virtual machine dynamic migration module. (2) Parameter initialization is performed on the modules respectively.

[0110] The second step: energy management module implementation: (1) Determine whether to enable the discharge function of the uninterruptible power supply. (2) Determine whether to disable the discharge function of the uninterruptible power supply. (3) Determine whether to charge the uninterruptible power supply.

[0111] The third step: virtual machine dynamic migration module implementation: (1) Initialize the virtual machine migration environment. (2) Use the Q learning algorithm in reinforcement learning to optimize the virtual machine allocation sequence by taking the virtual machine and the physical server as the state space and the action set respectively. (3) According to the CPU utilization of the physical server, the physical server is divided into an overload group, an underload group and a normal group, and the virtual machine to be migrated is added to the virtual machine to be allocated list based on the grouping strategy and the best adaptation principle. (4) Reallocate the virtual machine in the virtual machine to be allocated list to the target physical server to complete the dynamic integration of virtual machine resources. - Greedy strategy selects action, simulates the allocation of virtual machine to physical server, calculates energy consumption and execution cost, and updates reward value and Q value; (4) According to the CPU utilization of the physical server, the physical server is divided into an overload group, an underload group and a normal group, and the virtual machine to be migrated is added to the virtual machine to be allocated list based on the grouping strategy and the best adaptation principle. (5) Reallocate the virtual machine in the virtual machine to be allocated list to the target physical server to complete the dynamic integration of virtual machine resources.

[0112] The fourth step: The module iteration execution system repeatedly executes the second step and the third step until the first preset execution termination condition meets the requirements and the second preset execution termination condition meets the requirements.

[0113] Specifically, the first preset execution termination condition includes a first preset iteration number, or a first optimization target obtained according to the first total energy consumption of the physical server and the first execution cost of the virtual machine, and the second preset execution termination condition includes a second preset iteration number, or a second optimization target obtained according to the second total energy consumption of the physical server and the second execution cost of the virtual machine.

[0114] In this embodiment, the first preset iteration number is usually determined based on the complexity of the energy management module and the size of the simulation scenario. If the energy management involves many variables, such as price fluctuations at different times, coordination of multiple energy devices, etc., the complexity is high, and a large number of iteration numbers are required to fully analyze the effect of the energy management strategy. At this time, the first preset iteration number is set to be large. On the contrary, if the scenario is simple and the number of variables is small, fewer iterations can cover various situations, and the number is small. At the same time, combined with historical data and experimental test, the stability of the energy management index under different iteration numbers is observed, and when the index tends to be stable, the corresponding number can be used as a reasonable reference to determine the first preset iteration number.

[0115] The second preset number of iterations is primarily determined based on the characteristics of the virtual machine dynamic migration module. The number of virtual machines, the physical server architecture, and the complexity of the migration rules are key factors. When the number of virtual machines is large, the physical server architecture is complex, and the migration rules are diverse, a larger number of iterations is needed to ensure the Q-learning algorithm fully converges and finds a better virtual machine allocation sequence. In this case, the second preset number of iterations will be set higher. Furthermore, by conducting multiple experiments in simulation environments of different scales and complexities, the change in virtual machine migration performance with the number of iterations is analyzed. When the migration performance no longer significantly improves, the corresponding number of iterations can serve as an important basis for determining the second preset number of iterations.

[0116] use To indicate time Time The CPU utilization of each physical server is then measured in time periods. The total energy consumption of a physical server is represented by the integral of the internal power consumption function. ,Right now In the formula, Indicates time Time CPU utilization of each physical server The power consumption function.

[0117] Meanwhile, the execution cost of the virtual machines allocated on each server Represented as: ; In the formula, This represents the i-th virtual machine. , Indicates time The CPU utilization of the i-th virtual machine. This represents the computational workload of the i-th virtual machine. This represents the execution cost of the i-th virtual machine. This represents the resource quantity of the i-th virtual machine. Indicates the first One physical server, , Indicates time Time CPU utilization of each physical server Indicates the first The computing performance of a physical server Indicates the first The amount of resources per physical server Indicates that the i-th virtual machine is in the i-th position. Resource efficiency on a physical server This represents the computational workload weight of the i-th virtual machine;

[0118] In the case of only considering the physical server computing resource consumption power, the power consumption model thereof can be derived, and the mathematical expression thereof is: ; P id represents the power of the physical server in idle state, P max represents the power of the physical server in maximum utilization state, C represents the CPU utilization rate of the physical server, a represents the power consumption curve shape parameter, f represents the power consumption function of the CPU utilization rate of the physical server;

[0119] According to the power consumption model, the total energy consumption of the physical server and the execution cost of the virtual machine are minimized in the real-time environment, ; wherein, P represents the set of physical servers.

[0120] The calculation of the total energy consumption of the physical server and the execution cost of the virtual machine can be respectively used to determine a first optimization target obtained according to the first total energy consumption of the physical server and the first execution cost of the virtual machine, and a second optimization target obtained according to the second total energy consumption of the physical server and the second execution cost of the virtual machine.

[0121] According to the above content, experimental analysis is carried out:

[0122] In order to verify the effectiveness of the application in energy collaborative optimization, systematic experiments are carried out in the constructed simulation environment. The simulation platform is built based on Python, simulates the running process of the data center in the time-of-use electricity price scene, and compares the performance differences of the traditional static scheduling (Baseline), the energy optimization scheduling (Energy-only) and the joint optimization method (Proposed) proposed by the application in the aspects of energy cost, resource utilization and SLA guarantee. The simulation parameter settings are shown in Table 1, covering physical servers, virtual machines, uninterruptible power supply (UPS) systems and core parameters of reinforcement learning algorithms. All parameters are reasonably set by referring to the configuration of typical small and medium-sized data centers.

[0123] Table 1 Simulation experiment basic parameter configuration table

[0124]

[0125] Three groups of comparative experiments are designed:

[0126] Baseline: static VM allocation + UPS only emergency backup; Energy-only: enable UPS intelligent charging and discharging + static VM allocation; Proposed: joint optimization method (UPS + Q learning dynamic migration) of the application.

[0127] The performance indicators evaluated include: total energy cost (yuan); average server utilization (%); SLA violation times (response timeout > 200 ms); UPS system utilization (%).

[0128] In actual system deployment, the state space should be designed to include the current resource utilization of each physical server, the resource demand characteristics of the virtual machines to be migrated, and other information. In this simulation, the calculation is simplified.

[0129] The simulation runs for 24 hours, with one decision cycle per hour. After 500 rounds of training, the performance is evaluated. The experimental results are shown in Table 2.

[0130] Table 2 Comparison of performance of 24-hour simulation experiment

[0131]

[0132] Compared with Baseline, the joint optimization method of the present application reduces the energy cost by 32.6%. This is mainly due to the replacement of high-priced grid power purchase by UPS discharge during peak periods, and the reduction of static power consumption by server hibernation. The average server utilization is increased by 58.6%, verifying the effectiveness of Q-learning dynamic migration in load balancing. The number of SLA violations is reduced from 18 to 3, indicating that dynamic migration not only does not sacrifice service quality, but also improves system stability by avoiding overload. The UPS system utilization is increased from 0% to 52.3%, realizing the functional transformation from "backup device" to "active energy asset".

[0133] The above is only an embodiment of the present application, and the common knowledge of specific structures and characteristics in the scheme is not described in detail. The person skilled in the art knows all the ordinary technical knowledge in the field of the present application before the filing date or the priority date, can know all the prior art in this field, and has the ability to apply conventional experimental means before that date. The person skilled in the art can improve and implement the present scheme based on their own ability under the guidance of the present application. Some typical known structures or known methods should not be an obstacle for the person skilled in the art to implement the present application. It should be noted that for those skilled in the art, without departing from the structure of the present application, a number of modifications and improvements can be made, which should be considered as the protection scope of the present application. These will not affect the effectiveness and practicality of the present application. The protection scope of the present application should be subject to the content of its claims, and the specific implementation mode and the like in the specification can be used to explain the content of the claims.

Claims

1. A method for dynamic migration of virtual machines oriented towards energy coordination, characterized in that: Includes the following steps: S1. Construct the energy management module and the virtual machine dynamic migration module, and initialize the parameters of the energy management module and the virtual machine dynamic migration module respectively to obtain the parameter-initialized energy management module and the parameter-initialized virtual machine dynamic migration module. S2. Perform energy management analysis on the energy management module after parameter initialization, including: Determine whether to enable the uninterruptible power supply's discharge function based on the grid electricity price level and the total energy demand of the data center, and output the discharge status indicator. If the discharge status is enabled, during the uninterruptible power supply (UPS) discharge period, it is determined whether to terminate the UPS discharge function according to the preset termination discharge conditions. If yes, the UPS discharge function is terminated and a discharge termination signal is output; otherwise, it is skipped. Reacquire the grid electricity price level and the total energy demand of the data center, and determine whether to enable the charging function of the uninterruptible power supply based on the preset charging conditions. If yes, charge the uninterruptible power supply; otherwise, skip the process. S3. Repeat step S2 until the first preset execution termination condition is met, then stop executing step S2 and output the updated energy demand parameters. S4. Perform virtual machine migration analysis on the virtual machine dynamic migration module after parameter initialization, including: In the virtual machine dynamic migration module after parameter initialization, the list of virtual machines and the list of physical servers are obtained by combining the updated energy demand parameters. The virtual machines in the virtual machine list are used as the state space, and the physical servers in the physical server list are used as the action set. The state space and action set are input into the Q-learning algorithm to construct the Q table, and the virtual machine allocation sequence is optimized by iteratively calculating the Q value, and the final virtual machine allocation sequence is output. according to - The greedy strategy simulates the allocation process of virtual machines to physical servers in the final virtual machine allocation sequence to obtain the simulated allocation result; Based on the grouping results of the physical servers and the preset adaptation principles, a list of virtual machines to be assigned is obtained, and the virtual machines in the list of virtual machines to be assigned are reassigned to the target physical servers; S5. Repeat step S4 until the second preset execution termination condition is met, then stop executing step S4 and output the virtual machine migration result. In S2, determining whether to enable the uninterruptible power supply's discharge function includes: Step A1: Obtain the parameters in the energy management module after parameter initialization. Real-time grid electricity price level , The total amount of energy stored by an uninterruptible power supply And in Total energy required by a data center at any time ; Step A2, according to Real-time grid electricity price level , The total amount of energy stored by an uninterruptible power supply and in Total energy required by a data center at any time The conditions for activating the discharge function of the uninterruptible power supply are determined, and the mathematical expression for the discharge function conditions is as follows: In the formula, Indicates uninterruptible power supply The minimum energy required for backup power function. This indicates the energy required under peak load. express The power grid is currently experiencing high electricity prices.

2. The method for dynamic migration of virtual machines oriented towards energy coordination according to claim 1, characterized in that: In S2, the preset discharge termination conditions include a first preset discharge termination condition and a second preset discharge termination condition. The discharge function of the uninterruptible power supply is terminated when either the first or second preset discharge termination condition is met. The mathematical expression for the first preset discharge termination condition is: The second preset discharge termination condition is: In the formula, express The power grid is currently experiencing low electricity prices.

3. The method for dynamic migration of virtual machines oriented towards energy coordination according to claim 2, characterized in that: In step S2, the mathematical expression for the preset charging condition is: .

4. The method for dynamic migration of virtual machines oriented towards energy coordination according to claim 1, characterized in that: In step S4, the state space and action set are input into the Q-learning algorithm to construct the Q-table, and the virtual machine allocation sequence is optimized by iteratively calculating the Q-value, including: Step B1: Define the state space For the list of virtual machines to be assigned, the action set A list of active physical servers; Step B2: Initialize the Q table and define the Q value as 0 or 1; Step B3, the mathematical expression for iteratively calculating the Q value is: In the formula, Representing state Take action below Q value, express The state at any given moment, express The state at any given moment, express Actions at any moment The learning rate represents the rate at which the algorithm converges. Indicates the discount factor. Indicates the agent's state The reward value obtained when selecting an action. Indicates the state All possible actions, Indicates the state Below, all possible actions The largest Q value.

5. The method for dynamic migration of virtual machines oriented towards energy coordination according to claim 1, characterized in that: In S4, according to - The greedy strategy simulates the allocation process of virtual machines to physical servers in the final virtual machine allocation sequence, including: Step C1, with probability Randomly select a physical server as the first action; Step C2, with probability Select the physical server with the highest current Q value as the second action; Step C3: Based on the selected action, simulate allocating virtual machines from the final virtual machine allocation sequence to physical servers, calculate the total energy consumption of the physical servers and the execution cost of the virtual machines, and update the reward value and Q value.

6. The method for dynamic migration of virtual machines oriented towards energy coordination according to claim 1, characterized in that: In step S4, the virtual machine allocation list obtained based on the physical server grouping results and preset adaptation principles includes: Step D1: Based on the preset upper limit and lower limit of CPU utilization threshold for physical servers, divide the physical servers into overloaded, underloaded and normal groups to obtain the grouping results. Step D2: Perform a matching analysis on the grouping results and the optimized virtual machine allocation sequence according to the preset adaptation principle to obtain the matching analysis results; Step D3: Based on the matching analysis results, determine the migration correspondence of virtual machines among various physical servers, and obtain the list of virtual machines to be allocated according to the migration correspondence.

7. The method for dynamic migration of virtual machines oriented towards energy coordination according to claim 6, characterized in that: Step D2 includes: Step D21: Analyze the preset adaptation principles, clarify the virtual machine allocation adaptation conditions corresponding to the overload group, underload group, and normal group, and form an adaptation rule set; Step D22: Input the grouping results and the optimized virtual machine allocation sequence into the adaptation rule set, and match the groups and virtual machines item by item to obtain the initial matching results; Step D23: According to the preset priority rules, deduplication is performed on the conflicting items in the initial matching results to determine the unique matching relationship and form the matching analysis result.

Citation Information

Patent Citations

  • Virtual machine dynamic migration method and device and electronic equipment

    CN115292000A

  • Virtual machine migration method based on dynamic integration and multi-target cuckoo algorithm

    CN114928542A

  • Data center energy-saving control method and control system based on intelligent self-adaptive migration of virtual machine

    CN115934250A