Method and device for dynamically optimizing server energy efficiency according to workload and medium
By conducting historical data pre -processing and model training on the workload of the server, predicting the secondary index smoothing algorithm, dynamically optimizing the energy efficiency of the server, solving the problem that the traditional energy efficiency management technology cannot be detailed, and realized efficient energy and optimizing resource utilization.
Patent Information
- Application Number
- CN202411397583.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-21
AI Technical Summary
Traditional server energy efficiency management technology cannot achieve refined control, resulting in insufficient resources affecting system performance at high loads, and inability to effectively reduce frequency at low loads, resulting in energy waste.
By obtaining historical work load data, pre -processing and model training, using the second index flat -slip algorithm for time sequence prediction, dynamically optimizing the energy efficiency of the server to cope with changes in the workload.
It achieves real-time monitoring and flexible adjustment, improves energy efficiency and resource utilization efficiency, reduces unnecessary energy consumption, and enhances the stability and adaptability of the system.
Smart Images

Figure CN119336499A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method, device and medium for dynamically optimizing server energy efficiency according to workload. Background Art
[0002] With the rapid development of cloud computing and big data, the energy consumption problem of data centers is becoming increasingly serious. Traditional server workload and CPU frequency adjustment methods usually rely on fixed thresholds or manual intervention, but this static management method is often unable to flexibly respond to changes in actual workloads and cannot adjust workloads or CPU frequencies in time to meet the needs of peak and trough periods.
[0003] Due to the lack of intelligence and real-time response capabilities, traditional methods may lead to insufficient server resources in the face of sudden high loads, thus affecting system performance; and under low load conditions, they fail to effectively reduce the frequency, resulting in unnecessary energy waste. Therefore, the existing server energy efficiency management technology cannot achieve refined control, which seriously restricts the energy efficiency improvement and resource utilization efficiency of data center operations. Summary of the invention
[0004] The technical problem to be solved by the present invention is to address the above-mentioned deficiencies in the prior art and propose a method, device and medium for dynamically optimizing server energy efficiency according to workload. The method can effectively improve the operational energy efficiency and resource utilization efficiency of data center servers.
[0005] In a first aspect, the present invention provides a method for dynamically optimizing server energy efficiency according to workload, the method comprising the following steps:
[0006] Step S1: Obtain historical workload data of a preset period;
[0007] Step S2: preprocessing the historical workload data of the preset period to obtain model training data; and training the time series prediction model according to the model training data to obtain a target model;
[0008] Step S3: predicting the workload of the target period according to the target model to obtain predicted workload data of the target period;
[0009] Step S4: dynamically optimizing the server energy efficiency of the target period according to the predicted workload data of the target period.
[0010] Further, the workload data is obtained by monitoring the CPU power of the server;
[0011] The server CPU power is calculated according to the following formula (1):
[0012] P=C*V 2 *f (1)
[0013] Where P represents the server CPU power;
[0014] C represents the CPU working capacitance;
[0015] V represents the CPU operating voltage;
[0016] f represents the CPU frequency.
[0017] Furthermore, the time series prediction model is a quadratic exponential smoothing algorithm model;
[0018] In step S2, the time series prediction model is trained according to the model training data to obtain a target model, specifically:
[0019] Step S21: dividing the preset period into m equal sub-periods; m is a natural number greater than 3; and obtaining a sub-period monitoring value;
[0020] Step S22: training the quadratic exponential smoothing algorithm model according to the sub-period monitoring value to obtain a target model;
[0021] The target model includes the first exponential mean prediction value S of the t-th sub-period t , and the trend factors of the t-th sub-period;
[0022] The predicted value S of the first exponential mean value of the t-th sub-period t The calculation formula is as follows:
[0023] S t =α*Y t +(1-α)*(S t-1 +b t-1 ) (2)
[0024] in,
[0025] α is the horizontal smoothing coefficient, 0≤α≤1;
[0026] Y t is the monitoring value of the t-th sub-period;
[0027] b t-1 is the trend factor of the t-1 sub-period;
[0028] S t-1 is the predicted value of the exponential mean value of the t-1th sub-period;
[0029] The calculation formula of the trend factor of the t-th sub-period is as follows:
[0030] bt =β*(S t -S t-1 )+(1-β)*b t-1 (3)
[0031] in,
[0032] β is the trend smoothing coefficient, 0≤β≤1.
[0033] Furthermore, the method further comprises: optimizing the target model;
[0034] The optimization of the target model specifically includes the following steps:
[0035] Step S221: predicting the sub-period according to the target model to obtain a sub-period prediction value;
[0036] Step S222: Calculate the mean absolute percentage error according to the sub-period prediction value and the sub-period monitoring value;
[0037] The calculation formula of the mean absolute percentage error MAPE is as follows:
[0038]
[0039] in,
[0040] is the predicted value of the ith sub-period;
[0041] y i is the detection value of the i-th sub-period;
[0042] Step S223: According to the mean absolute percentage error, determine whether the trend smoothing coefficient needs to be updated:
[0043] If the mean absolute percentage error is within a preset error threshold range, it is determined not to update the trend smoothing coefficient, otherwise the trend smoothing coefficient is updated;
[0044] The updating formula of the trend smoothing coefficient is as follows:
[0045] β new =β old -(β old -0.1)*MAPE (5)
[0046] in,
[0047] β new is the updated trend smoothing coefficient;
[0048] β old is the trend smoothing coefficient before updating.
[0049] Furthermore, the step S4 specifically includes the following steps:
[0050] Obtaining a workload change trend according to the predicted workload data of the target period;
[0051] Dynamically optimize server energy efficiency during the target period based on workload trends:
[0052] If the workload trend is increasing, the server energy efficiency of the target period will be increased; if the workload trend is decreasing, the server energy efficiency of the target period will be decreased; if the workload trend remains unchanged, the server energy efficiency of the target period will not be adjusted.
[0053] In a second aspect, the present invention provides a device for dynamically optimizing server energy efficiency according to workload, the device comprising:
[0054] An acquisition unit, used for acquiring historical workload data of a preset period;
[0055] A processing unit connected to the acquisition unit, configured to pre-process the historical workload data of the preset period to obtain model training data; and to train the time series prediction model according to the model training data to obtain a target model;
[0056] A prediction unit, connected to the processing unit, configured to predict the workload of the target period according to the target model to obtain predicted workload data of the target period;
[0057] The adjustment unit is connected to the prediction unit and is used to dynamically optimize the server energy efficiency of the target period according to the predicted workload data of the target period.
[0058] Furthermore, the processing unit includes:
[0059] A processing module, connected to the acquisition unit, configured to divide the preset period into m equal sub-periods; m is a natural number greater than 3; and configured to acquire a sub-period monitoring value;
[0060] A training module, connected to the processing module, for training a quadratic exponential smoothing algorithm model according to the sub-period monitoring value to obtain a target model;
[0061] The target model includes the predicted value S of the first exponential mean value of the t-th sub-period t , and the trend factors of the t-th sub-period;
[0062] The training module stores the predicted value S of the first exponential mean value of the t-th sub-periodt The calculation formula is as follows:
[0063] S t =α*Y t +(1-α)*(S t-1 +b t-1 )
[0064] in,
[0065] α is the horizontal smoothing coefficient, 0≤α≤1;
[0066] Y t is the monitoring value of the t-th sub-period;
[0067] b t-1 is the trend factor of the t-1 sub-period;
[0068] S t-1 is the predicted value of the exponential mean value of the t-1th sub-period;
[0069] The training module also stores a calculation formula for the trend factor of the t-th sub-period, which is as follows:
[0070] b t =β*(S t -S t-1 )+(1-β)*b t-1
[0071] in,
[0072] β is the trend smoothing coefficient, 0≤β≤1.
[0073] Furthermore, the processing unit further includes:
[0074] An optimization module, connected to the training module, for optimizing the target model;
[0075] The optimization module specifically includes:
[0076] A prediction submodule, connected to the training module, for predicting the subcycle according to the target model to obtain a subcycle prediction value;
[0077] A calculation submodule, connected to the prediction submodule, for calculating a mean absolute percentage error based on the sub-period prediction value and the sub-period monitoring value;
[0078] The calculation submodule stores the calculation formula of the mean absolute percentage error MAPE, which is as follows:
[0079]
[0080] in,
[0081] is the predicted value of the ith sub-period;
[0082] y i is the detection value of the i-th sub-period;
[0083] A determination submodule, connected to the calculation submodule, for determining whether the trend smoothing coefficient needs to be updated according to the mean absolute percentage error;
[0084] An updating submodule, connected to the determining submodule, and configured to update the trend smoothing coefficient when the determining submodule determines that the mean absolute percentage error is not within a preset error threshold range;
[0085] The updating submodule stores the following updating formula of the trend smoothing coefficient:
[0086] β new =β old -(β old -0.1)*MAPE
[0087] in,
[0088] β new is the updated trend smoothing coefficient;
[0089] β old is the trend smoothing coefficient before updating.
[0090] Furthermore, the adjustment unit includes: an acquisition module and an adjustment module.
[0091] The acquisition module is used to obtain a workload change trend according to the predicted workload data of the target period;
[0092] An adjustment module, connected to the acquisition module, for dynamically optimizing the server energy efficiency of a target period according to a change trend of the workload;
[0093] The adjustment module comprises:
[0094] The first adjustment submodule is used to increase the server energy efficiency of the target period when the workload change trend is increasing;
[0095] The second adjustment submodule is used to adjust the server energy efficiency of the target period downward when the workload change trend is decreasing;
[0096] If the workload change trend remains unchanged, the adjustment unit does not adjust the server energy efficiency of the target period.
[0097] In a third aspect, the present invention provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for dynamically optimizing server energy efficiency according to workload as described in the first aspect.
[0098] The present invention can effectively improve the operational energy efficiency and resource utilization efficiency of data center servers. The specific effective effects are as follows:
[0099] 1. Real-time monitoring and flexible adjustment:
[0100] The present invention enables the system to quickly respond to changes, dynamically adjust the CPU frequency, improve energy efficiency, and avoid resource waste by monitoring the load status of the server in real time.
[0101] 2. Accurate load prediction:
[0102] The present invention adopts a quadratic exponential smoothing algorithm for load forecasting, which can effectively capture data trends, reduce forecasting errors, and improve the ability to accurately predict future workloads, thereby optimizing resource allocation.
[0103] 3. Optimize energy efficiency and reduce power consumption:
[0104] The present invention can provide sufficient resource support under high load and effectively reduce the frequency under low load by adjusting the CPU frequency in real time, thereby reducing unnecessary energy consumption and achieving the purpose of improving energy efficiency.
[0105] 4. Continuous self-optimization:
[0106] The present invention can continuously improve the accuracy of the prediction model by learning the optimization model, and automatically optimize parameters and algorithms by analyzing the differences between historical monitoring data and prediction data. This self-learning ability improves the adaptability and intelligence of the system.
[0107] 5. Improve resource utilization:
[0108] The present invention adopts a dynamic optimization method, which can ensure the efficient use of server resources, avoid the waste caused by static resource configuration, and further improve the utilization efficiency of resources by fine management of different workloads.
[0109] 6. Enhance system stability:
[0110] The present invention can reduce the pressure of the server under high load conditions by frequency adjustment, while avoiding system overload, thereby improving the stability and reliability of the server system. BRIEF DESCRIPTION OF THE DRAWINGS
[0111] Figure 1 A schematic diagram of a process for dynamically optimizing server energy efficiency according to workload in an embodiment of the present invention;
[0112] Figure 2 A schematic diagram of a method for dynamically optimizing server energy efficiency according to workload in an embodiment of the present invention;
[0113] Figure 3 A schematic diagram of a device for dynamically optimizing server energy efficiency according to workload in an embodiment of the present invention;
[0114] Among them, the figure numbers are: 10, acquisition unit, 20, processing unit, 30, prediction unit, 40, adjustment unit. DETAILED DESCRIPTION
[0115] In order to enable those skilled in the art to better understand the technical solution of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0116] It should be understood that the specific embodiments and drawings described herein are only used to explain the present invention rather than to limit the present invention.
[0117] It can be understood that, in the absence of conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other.
[0118] It can be understood that, for the convenience of description, the drawings of the present invention only show the parts related to the present invention, while the parts irrelevant to the present invention are not shown in the drawings.
[0119] It can be understood that each unit and module involved in the embodiments of the present invention may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.
[0120] It can be understood that, without conflict, the functions and steps marked in the flowcharts and block diagrams of the present invention may occur in an order different from that marked in the drawings.
[0121] It is understood that the flowcharts and block diagrams of the present invention illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present invention. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or may be implemented by a combination of hardware and computer instructions.
[0122] It can be understood that the units and modules involved in the embodiments of the present invention can be implemented by software or hardware. For example, the units and modules can be located in a processor.
[0123] Embodiment 1:
[0124] like Figure 1 and Figure 2 As shown, this embodiment provides a method for dynamically optimizing server energy efficiency according to workload, and the method includes the following steps:
[0125] Step S1: Obtain historical workload data of a preset period.
[0126] In this implementation, workload data are obtained by monitoring server CPU power;
[0127] The server CPU power is calculated according to the following formula:
[0128] P=C*V 2 *f
[0129] Where P represents the server CPU power;
[0130] C represents the CPU working capacitance; the CPU working capacitance affects the energy required by the CPU to process data;
[0131] V represents the CPU operating voltage. The voltage value of the CPU operating voltage usually varies within a certain range. The higher the voltage, the higher the power consumption may be.
[0132] f represents the CPU frequency; the CPU's operating frequency, that is, the number of cycles that can be executed per second. Generally, the higher the frequency, the more computing tasks the CPU can complete per second, so the power consumption will also increase.
[0133] Step S2: pre-processing the historical workload data of the preset period to obtain model training data; and training the time series prediction model according to the model training data to obtain a target model.
[0134] Specifically, the time series prediction model is a quadratic exponential smoothing algorithm model. In addition to the quadratic exponential smoothing algorithm model, there are many other time series prediction models to choose from, including autoregressive model (AR), moving average model (MA), autoregressive moving average model (ARMA), autoregressive integrated moving average model (ARIMA), seasonal autoregressive integrated moving average model (SARIMA), seasonal decomposition (STL), long short-term memory network (LSTM), Facebook Prophet, structural time series model (STS) and Earnest model, etc. These models have their own characteristics and are suitable for different types of time series data and prediction needs.
[0135] In step S2, the time series prediction model is trained according to the model training data to obtain a target model, specifically:
[0136] Step S21: dividing the preset period into m equal sub-periods; m is a natural number greater than 3; and obtaining a sub-period monitoring value;
[0137] Step S22: training the quadratic exponential smoothing algorithm model according to the sub-period monitoring value to obtain a target model;
[0138] The target model includes the first exponential mean prediction value S of the t-th sub-period t , and the trend factors of the t-th sub-period;
[0139] The predicted value S of the first exponential mean value of the t-th sub-period t The calculation formula is as follows:
[0140] S t =α*Y t +(1-α)*(S t-1 +b t-1 )
[0141] in,
[0142] α is the horizontal smoothing coefficient, 0≤α≤1;
[0143] Y t is the monitoring value of the t-th sub-period;
[0144] b t-1 is the trend factor of the t-1 sub-period;
[0145] S t-1 is the predicted value of the exponential mean value of the t-1th sub-period;
[0146] The calculation formula of the trend factor of the t-th sub-period is as follows:
[0147] b t =β*(S t -S t-1 )+(1-β)*b t-1
[0148] in,
[0149] β is the trend smoothing coefficient, 0≤β≤1.
[0150] As a specific implementation, the method further comprises the steps of: optimizing the target model;
[0151] The optimization of the target model specifically includes the following steps:
[0152] Step S221: predicting the sub-period according to the target model to obtain a sub-period prediction value;
[0153] Step S222: Calculate the mean absolute percentage error according to the sub-period prediction value and the sub-period monitoring value;
[0154] The calculation formula of the mean absolute percentage error MAPE is as follows:
[0155]
[0156] in,
[0157] is the predicted value of the ith sub-period;
[0158] y i is the detection value of the i-th sub-period;
[0159] Step S223: According to the mean absolute percentage error, determine whether the trend smoothing coefficient needs to be updated:
[0160] If the mean absolute percentage error is within a preset error threshold range, it is determined not to update the trend smoothing coefficient, otherwise the trend smoothing coefficient is updated;
[0161] The updating formula of the trend smoothing coefficient is as follows:
[0162] β new =β old -(β old -0.1)*MAPE
[0163] in,
[0164] β new is the updated trend smoothing coefficient;
[0165] β old is the trend smoothing coefficient before updating.
[0166] In addition to the mean absolute percentage error (MAPE), there are many other methods to evaluate the accuracy of a forecasting model, including mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), relative absolute error (RAE), coefficient of determination (R 2 ), logarithmic error, and weighted absolute percentage error (WAPE). These methods have their own characteristics, are suitable for different prediction scenarios and data characteristics, and can provide comprehensive model evaluation.
[0167] Step S3: predicting the workload of the target period according to the target model to obtain predicted workload data of the target period.
[0168] Step S4: dynamically optimizing the server energy efficiency of the target period according to the predicted workload data of the target period.
[0169] As a specific implementation, step S4 specifically includes the following steps:
[0170] Obtaining a workload change trend according to the predicted workload data of the target period;
[0171] Dynamically optimize server energy efficiency during the target period based on workload trends:
[0172] If the workload trend is increasing, the server energy efficiency of the target period will be increased; if the workload trend is decreasing, the server energy efficiency of the target period will be decreased; if the workload trend remains unchanged, the server energy efficiency of the target period will not be adjusted.
[0173] The specific usage scenarios of this embodiment include the following aspects:
[0174] (1) Data Center Management
[0175] In data centers, servers usually carry a large number of computing tasks. By real-time monitoring and predicting workload trends, managers can optimize the operating status of servers and allocate resources reasonably, thereby improving overall energy efficiency and reducing energy consumption.
[0176] (2) Cloud computing environment
[0177] In cloud services, the types and intensities of processed loads vary. This implementation process can help cloud service providers intelligently adjust resources during high and low load periods, ensuring that customers can still get stable services during peak demand while reducing energy consumption of idle resources.
[0178] (3) High Performance Computing (HPC)
[0179] In a high-performance computing environment, efficient use of the CPU is crucial. By monitoring the CPU frequency and load status, the execution mode of computing tasks can be adjusted in real time to ensure that computing resources run in the best state and improve computing efficiency.
[0180] (4) Edge computing
[0181] In edge computing scenarios, real-time monitoring of the load and energy consumption of each server can effectively improve data processing efficiency and reduce unnecessary delays. At the same time, predicting future workload trends can help with dynamic resource scheduling and optimize energy consumption management of edge devices.
[0182] The following is a specific implementation process of this embodiment for a clearer description. Figure 1 As shown, it specifically includes the following 4 steps:
[0183] Step 1: Load Monitoring
[0184] First, the server load status needs to be monitored in real time, because there is a direct and significant relationship between the CPU frequency and its energy consumption. According to the formula P = CV 2 f, power consumption P is positively correlated with capacitance C, the square of operating voltage V, and CPU frequency f. Among them, capacitance C and operating voltage V are fixed values determined by the external environment, so power consumption can only be adjusted by adjusting CPU frequency f. Therefore, real-time monitoring of the server's CPU frequency is crucial to accurately understand the server's workload information.
[0185] Step 2: Load Analysis and Forecasting Module
[0186] Based on the data collected in the last hour, the data with large fluctuations are first cleaned, and the prediction analysis module predicts the workload trend in the next hour based on the cleaned data. This embodiment uses a quadratic exponential smoothing algorithm to predict the workload trend in the next hour.
[0187] The Double Exponential Smoothing algorithm, also known as Brown's Linear Exponential Smoothing algorithm, is a time series forecasting technique that is suitable for data with trends but no seasonality, and is consistent with the data trend of CPU frequency. The Double Exponential Smoothing algorithm predicts data by applying exponential smoothing twice, once to smooth the data itself and the other to smooth the trend, so that the trend of the data can be captured and predicted. Double exponential smoothing has two smoothing factors, usually marked as α and β, where α controls the degree of smoothing of the current observation and β controls the degree of smoothing of the trend. Therefore, it is necessary to continuously adjust the β value, that is, adjust the degree of smoothing of the trend, to optimize the forecast results. The mathematical expression of the algorithm is as follows:
[0188] Initialization phase:
[0189] The 60 digits of CPU frequency data within the last hour are recorded as follows
[0190] {23.45,25.67,31.78,21.42,38.54,22.99,33.01,34.72,26.53,28.95,30.08,20.56,27.11,39.23,24.89,26.34,35.43,37.56,21.67,29.88,32.09,36.10,22.33,25.44,33.55,27.66,31.77,23.88,29.99,38.10,
[0191] 27.34,33.56,22.81,39.07,21.48,35.23,24.69,28.12,30.77,26.02,37.58,23.33,29.84,34.45,25.90,32.11,20.56,36.72,27.93,31.28,24.41,28.65,33.89,22.14,30.37,25.62,29.06,34.31,26.55,32.80}
[0192] S0 = 23.45 (first data point);
[0193] b0=0 (initial trend is 0);
[0194] Iteration Phase
[0195] First exponential smoothing: S t =α*y t +(1-α)*(S t-1 +b t-1 )
[0196] According to the following discussion, α = 0.2
[0197] S1=α*y1+(1-α)*(S0+b0)=0.2*25.67+(1-0.2)*(23.45+0)
[0198] =0.2*25.67+0.8*23.45=5.134+18.76=23.894
[0199] S2=α*y2+(1-α)*(S1+b1)=0.2*31.78+(1-0.2)*(23.894+0.0888)
[0200] =0.2*31.78+0.8*23.9828=6.356+19.18624=25.54224
[0201] S3=α*y3+(1-α)*(S2+b2)=0.2*21.42+(1-0.2)*
[0202] (25.54224+0.400688)
[0203] =0.2*21.42+0.8*25.942928=4.284+20.7543424=25.0383424 .....
[0205] Double exponential smoothing (trend smoothing):
[0206] b t =β*(S t -S t-1 )+(1-β)*b t-1
[0207] According to the following discussion, the initial value of β is 0.2
[0208] b1=β*(S1-S0)+(1-β)*b0=
[0209] 0.2*(23.894-23.45)+(1-0.2)·0=0.2*0.444=0.0888
[0210] b2=β*(S2-S1)+(1-β)*b1=0.2*(25.54224-23.894)+(1-0.2)*0.0888
[0211] =0.2*1.64824+0.8*0.0888=0.329648+0.07104=0.400688
[0212] b3=β*(S3-S2)+(1-β)*b2
[0213] =0.2*(25.0383424-25.54224)+(1-0.2)*0.400688
[0214] =0.2*(-0.5038976)+0.8*0.400688
[0215] =-0.10077952+0.3205504=0.21977088
[0216] Prediction stage:
[0217] For the predicted value at time t+1, use: F t+1 =S t +b t
[0218] For the predicted value at time t+m, you can use: F t+m =S t +m*b t
[0219] F1=S0+b0=23.45+0=23.45
[0220] F2=S1+b1=23.894+0.0888=23.9828
[0221] F3=S2+b2=25.54224+0.400688=25.942928
[0222] in:
[0223] y t is the actual observed value at time t.
[0224] S t is a smoothed value at time t.
[0225] b t is the trend estimate at time t.
[0226] 60 predicted values are
[0227] {23.45,23.9828,25.942928,25.25811328,28.6655369728,28.054454448128,29.767810250465292,31.678582482316504,31.363256968504817,31.498466278715274,31.775895075735026,29.64520231032143,29.149240005577695,31.5797005615596,30.388480983882744,29.563566082385947,30.95629151789307,32.760620205583045,30.582458347511707,30.453830527154164,30.85837504978197,32.19367566589293,30.113369132145987,28.884189139862592,29.709477580441373,29.109729229686742,29.558341379895566,28.112097444866805,28.252218399049124,30.380226426433016,29.809023791282808,30.74610073151133,29.028318254433692,31.307759542594237,29.220202191418903,30.540548222821876,29.254803119031386,28.866814911237736,29.16255174855331,28.323439148463635,30.33441150245335,28.81301292554699,28.93897354700002,30.182183102282444,29.295463422417086,29.94066914162812,27.771606951331822,29.62629292104151,29.2841899799676,29.760340027909766,28.55324646514711,28.439441756331107,29.614420319025058,27.905426356419216,28.282814132077775,27.528211787321514,27.673801440023645,29.105721104584404,28.59702799204964,29.608192382339833};.
[0228] α and β are smoothing factors between 0 and 1, and appropriate values need to be selected to optimize the prediction performance.
[0229] After two smoothing steps, b1~~~bt1~~~bn are the predicted values of the load in the next hour.
[0230] In the Double Exponential Smoothing method, α and β are two key parameters that control the weight of the level (i.e., current value) and the smoothing trend, respectively. The selection of these two parameters directly affects the model's response speed to new data and the accuracy of prediction. Ideally, we hope to find the α and β values that minimize the prediction error by minimizing the prediction error. Generally speaking, the initial values of α and β can be tried from 0.1 to 0.3. We first select 0.2 as the initial value of α and β.
[0231] Step 3: Frequency Adjustment
[0232] The frequency adjustment strategy is determined based on the CPU frequency value predicted by the load analysis and prediction module in the next hour. If it is predicted that the CPU frequency value will increase in the future, the server's operating frequency will be dynamically increased; if it is predicted that the CPU frequency value will decrease in the future, the server's operating frequency will be dynamically decreased. According to the formula P = CV 2 f, it can be seen that by reducing the frequency, the power can be reduced, thereby reducing energy consumption and heat dissipation.
[0233] Step 4: Learn to Optimize
[0234] The learning optimization module compares the monitoring data with the forecast data by using the mean absolute percentage error, and continuously optimizes the internal recommendation algorithm and model. Mean absolute percentage error is a common way to evaluate the accuracy of forecasts. MAPE gives the size of the forecast error in the form of a percentage, making the results easier to understand and interpret. All comparisons using the mean absolute percentage error method are very suitable.
[0235] The mean absolute percentage error is calculated as follows:
[0236] For a data set containing n samples, assume that the true value of each sample is yi, and the corresponding predicted value is Then the calculation formula of MAPE is:
[0237]
[0238] The calculated MAPE is 14.0926611272%.
[0239] If the average absolute percentage error (MAPE) is relatively large, it means that the β value does not capture the changing characteristics of the data well, which proves that the initial value of β is inappropriate and the β value needs to be adjusted. Since β controls the degree of smoothing of the trend, it is necessary to reduce the β value accordingly to reduce the fluctuation trend of the predicted value and make the data more consistent. We need to appropriately reduce the β value of the load analysis and prediction module to make the predicted value closer to the actual value.
[0240] The specific adjustment method of β value is as follows: the degree of β value reduction is determined according to the obtained MAPE, the reduction of β value is (old β value - 0.1) * MAPE, and the new β value is: old β value - (old β value - 0.1) * MAPE; until the MAPE value is less than 1%, it is considered that the appropriate β value has been found. The initial value of β can be tried from 0.1 to 0.3, so 0.1 is the minimum value of β value.
[0241] For example, the initial β value is 0.2, and the obtained MAPE is 14.0926611272%.
[0242] According to the formula old beta value - (old beta value - 0.1) * MAPE,
[0243] The new β value is: 0.2-(0.2-0.1)*14.0926611272%=0.1859073388728
[0245] The new beta value changes to 0.1859.
[0246] Based on this new β value, the new MAPE is recalculated and the new MAPE result is about 4.47%. This new MAPE is lower than 14.09% (initial MAPE), which shows that the prediction effect obtained by adjusting the β value has improved.
[0247] This embodiment enables the system to respond quickly to changes and dynamically adjust the CPU frequency by real-time monitoring of the server's load status, thereby effectively improving energy efficiency and avoiding resource waste. At the same time, the use of a quadratic exponential smoothing algorithm for load prediction helps to effectively capture data trends and reduce prediction errors, thereby enhancing the ability to accurately predict future workloads and further optimizing resource allocation. During high-load periods, this embodiment can provide sufficient resource support, and during low-load periods, effectively reduce the CPU frequency, reduce unnecessary energy consumption, and achieve significant energy efficiency improvements. In addition, this embodiment has a continuous self-optimization capability, can continuously improve the accuracy of predictions through learning optimization models, and automatically optimize parameters and algorithms based on the differences between historical monitoring data and predicted data, thereby enhancing overall adaptability and intelligence. Such a dynamic optimization method ensures efficient use of server resources, avoids waste caused by static resource configuration, and further improves resource utilization efficiency through fine management of different workloads. Finally, real-time adjustment of frequency reduces the pressure on the server under high-load scenarios, effectively avoids system overload, and thus improves the stability and reliability of the server system.
[0248] Embodiment 2:
[0249] like Figure 3 As shown, this embodiment provides a device for dynamically optimizing server energy efficiency according to workload, the device comprising:
[0250] An acquisition unit 10, configured to acquire historical workload data of a preset period;
[0251] The processing unit 20 is connected to the acquisition unit 10, and is used to pre-process the historical workload data of the preset period to obtain model training data; and to train the time series prediction model according to the model training data to obtain a target model;
[0252] The prediction unit 30 is connected to the processing unit 20 and is used to predict the workload of the target period according to the target model to obtain the predicted workload data of the target period;
[0253] The adjustment unit 40 is connected to the prediction unit 30, and is used to dynamically optimize the server energy efficiency of the target period according to the predicted workload data of the target period.
[0254] As a specific implementation, the processing unit 20 includes:
[0255] A processing module, connected to the acquisition unit, configured to divide the preset period into m equal sub-periods; m is a natural number greater than 3; and configured to acquire a sub-period monitoring value;
[0256] A training module, connected to the processing module, for training a quadratic exponential smoothing algorithm model according to the sub-period monitoring value to obtain a target model;
[0257] The target model includes the predicted value S of the first exponential mean value of the t-th sub-period t , and the trend factors of the t-th sub-period;
[0258] The training module stores the predicted value S of the first exponential mean value of the t-th sub-period t The calculation formula is as follows:
[0259] S t =α*Y t +(1-α)*(S t-1 +b t-1 )
[0260] in,
[0261] α is the horizontal smoothing coefficient, 0≤α≤1;
[0262] Y t is the monitoring value of the t-th sub-period;
[0263] b t-1 is the trend factor of the t-1 sub-period;
[0264] S t-1 is the predicted value of the exponential mean value of the t-1th sub-period;
[0265] The training module also stores a calculation formula for the trend factor of the t-th sub-period, which is as follows:
[0266] b t =β*(S t -S t-1 )+(1-β)*b t-1
[0267] in,
[0268] β is the trend smoothing coefficient, 0≤β≤1.
[0269] As a more specific implementation, the processing unit 20 further includes:
[0270] An optimization module, connected to the training module, for optimizing the target model;
[0271] The optimization module specifically includes:
[0272] A prediction submodule, connected to the training module, for predicting the subcycle according to the target model to obtain a subcycle prediction value;
[0273] A calculation submodule, connected to the prediction submodule, for calculating a mean absolute percentage error based on the sub-period prediction value and the sub-period monitoring value;
[0274] The calculation submodule stores the calculation formula of the mean absolute percentage error MAPE, which is as follows:
[0275]
[0276] in,
[0277] is the predicted value of the ith sub-period;
[0278] y i is the detection value of the i-th sub-period;
[0279] A determination submodule, connected to the calculation submodule, for determining whether the trend smoothing coefficient needs to be updated according to the mean absolute percentage error;
[0280] An updating submodule, connected to the determining submodule, and configured to update the trend smoothing coefficient when the determining submodule determines that the mean absolute percentage error is not within a preset error threshold range;
[0281] The updating submodule stores the following updating formula of the trend smoothing coefficient:
[0282] β new =β old -(β old -0.1)*MAPE
[0283] in,
[0284] β new is the updated trend smoothing coefficient;
[0285] β old is the trend smoothing coefficient before updating.
[0286] As a specific implementation, the adjustment unit 40 includes:
[0287] Get modules and adjust modules,
[0288] The acquisition module is used to obtain a workload change trend according to the predicted workload data of the target period;
[0289] An adjustment module, connected to the acquisition module, for dynamically optimizing the server energy efficiency of a target period according to a change trend of the workload;
[0290] The adjustment module comprises:
[0291] The first adjustment submodule is used to increase the server energy efficiency of the target period when the workload change trend is increasing;
[0292] The second adjustment submodule is used to adjust the server energy efficiency of the target period downward when the workload change trend is decreasing;
[0293] If the workload change trend remains unchanged, the adjustment unit does not adjust the server energy efficiency of the target period.
[0294] The device in this embodiment can execute the method in embodiment 1.
[0295] Embodiment 3:
[0296] This embodiment provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for dynamically optimizing server energy efficiency according to workload described in Embodiment 1 is implemented.
[0297] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A method for dynamically optimizing server energy efficiency according to workload, characterized in that: The method comprises the following steps: Step S1: Obtain historical workload data of a preset period; Step S2: preprocessing the historical workload data of the preset period to obtain model training data; and training the time series prediction model according to the model training data to obtain a target model; Step S3: predicting the workload of the target period according to the target model to obtain predicted workload data of the target period; Step S4: dynamically optimizing the server energy efficiency of the target period according to the predicted workload data of the target period.
2. The method for dynamically optimizing server energy efficiency according to workload according to claim 1, characterized in that: The workload data is obtained by monitoring the server CPU power; The server CPU power is calculated according to the following formula (1): P=C*V 2 *f (1) Where P represents the server CPU power; C represents the CPU working capacitance; V represents the CPU operating voltage; f represents the CPU frequency.
3. The method for dynamically optimizing server energy efficiency according to workload according to claim 1, characterized in that: The time series prediction model is a quadratic exponential smoothing algorithm model; In step S2, the time series prediction model is trained according to the model training data to obtain a target model, specifically: Step S21: dividing the preset period into m equal sub-periods; m is a natural number greater than 3; and obtaining a sub-period monitoring value; Step S22: training the quadratic exponential smoothing algorithm model according to the sub-period monitoring value to obtain a target model; The target model includes the first exponential mean prediction value S of the t-th sub-period t , and the trend factors of the t-th sub-period; The predicted value S of the first exponential mean value of the t-th sub-period t The calculation formula is as follows: S t =α*Y t +(1-a)*(S t-1 +b t-1 ) (2) in, α is the horizontal smoothing coefficient, 0≤α≤1; Y t is the monitoring value of the t-th sub-period; b t-1 is the trend factor of the t-1 sub-period; S t-1 is the predicted value of the exponential mean value of the t-1th sub-period; The calculation formula of the trend factor of the t-th sub-period is as follows: b t =β*(S t -S t-1 )+(1-b)*b t-1 (3) in, β is the trend smoothing coefficient, 0≤β≤1.
4. The method for dynamically optimizing server energy efficiency according to workload according to claim 3, characterized in that: The method further comprises: optimizing the target model; The optimization of the target model specifically includes the following steps: Step S221: predicting the sub-period according to the target model to obtain a sub-period prediction value; Step S222: Calculate the mean absolute percentage error according to the sub-period prediction value and the sub-period monitoring value; The calculation formula of the mean absolute percentage error MAPE is as follows: in, is the predicted value of the ith sub-period; y i is the detection value of the i-th sub-period; Step S223: According to the mean absolute percentage error, determine whether the trend smoothing coefficient needs to be updated: If the mean absolute percentage error is within a preset error threshold range, it is determined not to update the trend smoothing coefficient, otherwise the trend smoothing coefficient is updated; The updating formula of the trend smoothing coefficient is as follows: b new =b old -(b old -0.1)*MAPE (5) in, β new is the updated trend smoothing coefficient; β old is the trend smoothing coefficient before updating.
5. The method for dynamically optimizing server energy efficiency according to workload according to any one of claims 1 to 4, characterized in that: The step S4 specifically includes the following steps: Obtaining a workload change trend according to the predicted workload data of the target period; Dynamically optimize server energy efficiency during the target period based on workload trends: If the workload trend is increasing, the server energy efficiency of the target period will be increased; if the workload trend is decreasing, the server energy efficiency of the target period will be decreased; if the workload trend remains unchanged, the server energy efficiency of the target period will not be adjusted.
6. A device for dynamically optimizing server energy efficiency according to workload, characterized in that: The device comprises: An acquisition unit, used for acquiring historical workload data of a preset period; A processing unit connected to the acquisition unit, configured to pre-process the historical workload data of the preset period to obtain model training data; and to train the time series prediction model according to the model training data to obtain a target model; A prediction unit, connected to the processing unit, configured to predict the workload of the target period according to the target model to obtain predicted workload data of the target period; The adjustment unit is connected to the prediction unit and is used to dynamically optimize the server energy efficiency of the target period according to the predicted workload data of the target period.
7. The device for dynamically optimizing server energy efficiency according to workload according to claim 6, characterized in that: The processing unit comprises: A processing module, connected to the acquisition unit, configured to divide the preset period into m equal sub-periods; m is a natural number greater than 3; and configured to acquire a sub-period monitoring value; A training module, connected to the processing module, for training a quadratic exponential smoothing algorithm model according to the sub-period monitoring value to obtain a target model; The target model includes the predicted value S of the first exponential mean value of the t-th sub-period t , and the trend factors of the t-th sub-period; The training module stores the predicted value S of the first exponential mean value of the t-th sub-period t The calculation formula is as follows: S t =α*Y t +(1-a)*(S t-1 +b t-1 ) in, α is the horizontal smoothing coefficient, 0≤α≤1; Y t is the monitoring value of the t-th sub-period; b t-1 is the trend factor of the t-1 sub-period; S t-1 is the predicted value of the exponential mean value of the t-1th sub-period; The training module also stores a calculation formula for the trend factor of the t-th sub-period, which is as follows: b t =β*(S t -S t-1 )+(1-b)*b t-1 in, β is the trend smoothing coefficient, 0≤β≤1.
8. The device for dynamically optimizing server energy efficiency according to workload according to claim 7, characterized in that: The processing unit also includes: An optimization module, connected to the training module, for optimizing the target model; The optimization module specifically includes: A prediction submodule, connected to the training module, for predicting the subcycle according to the target model to obtain a subcycle prediction value; A calculation submodule, connected to the prediction submodule, for calculating a mean absolute percentage error based on the sub-period prediction value and the sub-period monitoring value; The calculation submodule stores the calculation formula of the mean absolute percentage error MAPE, which is as follows: in, is the predicted value of the ith sub-period; y i is the detection value of the i-th sub-period; A determination submodule, connected to the calculation submodule, for determining whether the trend smoothing coefficient needs to be updated according to the mean absolute percentage error; An updating submodule, connected to the determining submodule, for updating the trend smoothing coefficient when the determining submodule determines that the mean absolute percentage error is not within a preset error threshold range; The updating submodule stores the following updating formula of the trend smoothing coefficient: b new =b old -(b old -0.1)*MAPE in, β new is the updated trend smoothing coefficient; β old is the trend smoothing coefficient before updating.
9. The device for dynamically optimizing server energy efficiency according to workload according to any one of claims 6 to 8, characterized in that: The adjustment unit includes: an acquisition module and an adjustment module. The acquisition module is used to obtain a workload change trend according to the predicted workload data of the target period; An adjustment module, connected to the acquisition module, for dynamically optimizing the server energy efficiency of a target period according to a change trend of the workload; The adjustment module comprises: The first adjustment submodule is used to increase the server energy efficiency of the target period when the workload change trend is increasing; The second adjustment submodule is used to adjust the server energy efficiency of the target period downward when the workload change trend is decreasing; If the workload change trend remains unchanged, the adjustment unit does not adjust the server energy efficiency of the target period.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for dynamically optimizing server energy efficiency according to workload as described in any one of claims 1 to 5 is implemented.