Method and apparatus for predicting utilization rate of central processing unit, and electronic device

Through the method of combining decomposition and deep learning models, the mutation point change pattern of CPU usage data is captured, which solves the problem of low prediction accuracy in the existing technology and achieves more accurate CPU usage prediction.

WO2024174884A1PCT designated stage expired Publication Date: 2024-08-29ZTE CORP
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/076211
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-22
Filing Date
2024-02-06
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

Existing CPU usage prediction methods only consider time characteristics and fail to effectively capture the change patterns of data mutation points, resulting in low prediction accuracy.

Method used

By obtaining the initial time series, decompose it into intermediate time series at different frequency scales, input them into the pre-trained deep learning model for prediction, and extract temporal features to predict CPU usage. This method combines wavelet decomposition and deep learning models, especially the LSTM model, to capture the mutation point changes in CPU usage.

Benefits of technology

The accuracy of CPU usage prediction is improved, especially in the prediction of data mutation points, which significantly improves the accuracy of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024076211_29082024_PF_FP_ABST
    Figure CN2024076211_29082024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to a method and apparatus for predicting a utilization rate of a central processing unit, and an electronic device. The method comprises: acquiring an initial time sequence, wherein the initial time sequence comprises a time sequence corresponding to a utilization rate of a central processing unit and a time sequence corresponding to a parameter factor related to the utilization rate of the central processing unit; decomposing the initial time sequence to obtain intermediate time sequences corresponding to different frequency scales; and inputting the intermediate time sequences into a pre-trained deep learning model for prediction, so as to obtain a predicted value of the utilization rate of the central processing unit, wherein the pre-trained deep learning model is used for extracting time features of the intermediate time sequences, and predicting the utilization rate of the central processing unit according to the extracted time features.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device and electronic device for predicting CPU usage rate

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application No. 202310191225.9 filed on February 22, 2023, the contents of which are incorporated herein by reference in their entirety. Technical Field

[0003] The present application relates to the field of deep learning technology, and in particular to a method, device, and electronic device for predicting the usage rate of a central processing unit. Background Art

[0004] The device's central processing unit (CPU) is primarily used to execute various instructions within the device's system. CPU usage is a measure of CPU load, with its value representing the severity of the CPU load. When the CPU is overloaded, it can cause system applications to freeze, or even the system to freeze. When the system issues an alert regarding CPU usage, it indicates that the system is overloaded and unable to operate normally. Therefore, an alert must be issued before the CPU becomes overloaded, allowing system operators to check the system in advance, identify anomalies, and avoid system unavailability.

[0005] However, the existing CPU usage prediction method only considers the time characteristics of CPU usage data, but does not consider the change law of CPU usage data mutation points, which leads to the problem of low prediction accuracy of the existing CPU usage prediction method at CPU usage data mutation points.

[0006] Summary of the Invention

[0007] In a first aspect, an embodiment of the present application provides a method for predicting the usage rate of a central processing unit, the method comprising: obtaining an initial time series, wherein the initial time series includes a time series corresponding to the usage rate of the central processing unit and a time series corresponding to a parameter factor related to the usage rate of the central processing unit; decomposing the initial time series to obtain intermediate time series corresponding to different frequency scales; inputting the intermediate time series into a pre-trained deep learning model for prediction to obtain a predicted value of the usage rate of the central processing unit; wherein the pre-trained deep learning model is used to extract the time features of the intermediate time series, and predict the usage rate of the central processing unit based on the extracted time features.

[0008] In a second aspect, an embodiment of the present application also provides a training method for a prediction model of central processing unit usage, the method comprising: obtaining a sample time series, wherein the sample time series comprises a sample sequence corresponding to the central processing unit usage and a sample sequence corresponding to a parameter factor related to the central processing unit usage, wherein the sample sequence corresponding to the central processing unit usage is used to characterize the true value of the central processing unit usage corresponding to each sampling point; decomposing the sample time series to obtain training sample sequences corresponding to different frequency scales; inputting the training sample sequence into a model to be trained for iterative training to obtain a deep learning model; wherein the deep learning model is used to predict the central processing unit usage, and the model to be trained is used to extract the time features of the training sample sequence, and predict the central processing unit usage based on the extracted time features.

[0009] In a third aspect, an embodiment of the present application further provides a device for predicting the usage rate of a central processing unit, the device comprising: a first acquisition module, configured to acquire an initial time series, wherein the initial time series comprises a time series corresponding to the usage rate of the central processing unit and a time series corresponding to a parameter factor related to the usage rate of the central processing unit; a first decomposition module, configured to decompose the initial time series to obtain intermediate time series corresponding to different frequency scales; a prediction module, configured to input the intermediate time series into a pre-trained deep learning model for prediction to obtain a predicted value of the usage rate of the central processing unit; wherein the pre-trained deep learning model is used to extract the time features of the intermediate time series, and predict the usage rate of the central processing unit based on the extracted time features.

[0010] In a fourth aspect, an embodiment of the present application further provides a training device for a prediction model of central processing unit usage, the device comprising: a second acquisition module, configured to acquire a sample time series, wherein the sample time series comprises a sample sequence corresponding to the usage rate of the central processing unit and a sample sequence corresponding to a parameter factor related to the usage rate of the central processing unit, wherein the sample sequence corresponding to the usage rate of the central processing unit is used to characterize the true value of the usage rate of the central processing unit corresponding to each sampling point; a second decomposition module, configured to decompose the sample time series to obtain training sample sequences corresponding to different frequency scales; a training module, configured to input the training sample sequence into a model to be trained for iterative training to obtain a deep learning model; wherein the deep learning model is used to predict the usage rate of the central processing unit, and the model to be trained is used to extract the time features of the training sample sequence, and predict the usage rate of the central processing unit based on the extracted time features.

[0011] In a fifth aspect, an embodiment of the present application further provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; the processor is configured to execute the programs stored on the memory, so that the processor implements the steps of the method for predicting the usage rate of the central processing unit described in any embodiment of the first aspect, or implements the steps of the method for training a prediction model for the usage rate of the central processing unit described in any embodiment of the second aspect.

[0012] In the sixth aspect, an embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor so that the processor implements the steps of the method for predicting the usage rate of the central processing unit described in any embodiment of the first aspect, or implements the steps of the method for training a prediction model for the usage rate of the central processing unit described in any embodiment of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0014] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0015] FIG1 is a flow chart of a method for predicting CPU usage according to an embodiment of the present application;

[0016] FIG2 is a schematic diagram of a target time series decomposition process provided in an embodiment of the present application;

[0017] FIG3 is a calculation flow chart of an LSTM model provided in an embodiment of the present application;

[0018] FIG4 is a flow chart of a method for training a prediction model for CPU usage provided in an embodiment of the present application;

[0019] FIG5 is a flow chart of another method for predicting CPU usage according to an embodiment of the present application;

[0020] FIG6 is a comparison diagram of the prediction results of directly using the LSTM model for prediction provided in an embodiment of the present application and the prediction results of using the model proposed in the present application for prediction;

[0021] FIG7 is a schematic diagram of the structure of a device for predicting the usage rate of a central processing unit provided by an embodiment of the present application;

[0022] FIG8 is a schematic diagram of the structure of a training device for a prediction model of CPU usage provided by an embodiment of the present application; and

[0023] FIG9 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0025] Referring to Figure 1 , which is a flow chart of a method for predicting the usage rate of a central processing unit provided in an embodiment of the present application, the method for predicting the usage rate of the central processing unit may include the following steps 101 to 103 .

[0026] In step 101, an initial time series is obtained, wherein the initial time series includes a time series corresponding to the usage rate of the central processing unit and a time series corresponding to a parameter factor related to the usage rate of the central processing unit.

[0027] Specifically, the above-mentioned initial time series may include a time series corresponding to the CPU usage rate and a time series corresponding to parameter factors related to the CPU usage rate. The time series corresponding to the CPU usage rate may refer to the total CPU usage rate of the device to be predicted collected at the current moment and within a period of time before the current moment; the time series corresponding to the parameter factors related to the CPU usage rate may refer to the CPU usage rate corresponding to each parameter factor collected at the current moment and within a period of time before the current moment. For example, assuming that the t corresponding to the current moment is 5, the initial time series includes the time series corresponding to the total CPU usage rate of the device to be predicted when t is 1, 2, 3, 4 and 5 respectively, and the time series corresponding to each parameter factor.

[0028] It should be noted that the device to be predicted here can be any device with a CPU. The time intervals between sampling points in the time series corresponding to the CPU usage rate and the time series corresponding to the parameter factors related to the CPU usage rate are the same. Specifically, the size of the time interval can be set according to the prediction requirements and is not specifically limited in the embodiments of this application. In an optional embodiment, sampling can be performed at minute-level time intervals, such as 1 minute, 10 minutes, 20 minutes, 30 minutes, etc.

[0029] In step 102, the initial time series is decomposed to obtain intermediate time series corresponding to different frequency scales.

[0030] Specifically, the decomposition method of the initial time series can be wavelet decomposition, empirical mode decomposition, etc., which is not specifically limited in the embodiment of the present application.

[0031] In this step, by decomposing the initial time series, we can obtain intermediate time series corresponding to different frequency scales, thereby obtaining more mutation point information of CPU usage-related data to solve the problem of uneven distribution of CPU usage-related data.

[0032] In step 103, the intermediate time series is input into a pre-trained deep learning model for prediction to obtain a predicted value of the CPU usage rate;

[0033] Among them, the pre-trained deep learning model is used to extract the time features of the intermediate time series and predict the CPU usage based on the extracted time features.

[0034] Specifically, the above-mentioned deep learning model can adopt a long short-term memory neural network (Long Short-Term Memory, LSTM) model, a Transformer model (an autoregressive model proposed by Google's team in 2017) or a variant model based on the LSTM model, which is not specifically limited in the embodiments of the present application.

[0035] In this step, the intermediate time series can be input into a pre-trained deep learning model, and the time features of the intermediate time series can be extracted through the deep learning model, that is, the before and after correlation relationship of the CPU usage-related data on the time axis can be mined, and the CPU usage can be predicted based on the extracted time features.

[0036] In this embodiment, the initial time series can be decomposed to obtain intermediate time series corresponding to different frequency scales, thereby obtaining the mutation point variation pattern of the data related to the CPU usage rate. The decomposed intermediate time series is then input into a pre-trained deep learning model for prediction, thereby obtaining the time characteristics of the data related to the CPU usage rate, and predicting the CPU usage rate based on the obtained time characteristics. In other words, when predicting the CPU usage rate, not only the initial time series of the data related to the CPU usage rate is considered, but also the mutation point variation pattern of the data related to the CPU usage rate, thereby improving the accuracy of the prediction results.

[0037] Furthermore, the parameter factors include a first factor for characterizing the usage rate of the central processing unit required for process running, a second factor for characterizing the usage rate of the central processing unit required for the system to wait for input and output, and a third factor for characterizing the usage rate of the central processing unit required for the system to handle interrupts.

[0038] In the above step 102, decomposing the initial time series to obtain intermediate time series corresponding to different frequency scales includes: decomposing the time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series to obtain intermediate time series corresponding to different frequency scales.

[0039] In one embodiment, the parameter factors may include a first factor for characterizing the usage rate of the central processing unit required for the process to run, a second factor for characterizing the usage rate of the central processing unit required for the system to wait for input and output, and a third factor for characterizing the usage rate of the central processing unit required for the system to handle interrupts. In some embodiments, the first time series is the time series corresponding to the first factor, the second time series is the time series corresponding to the second factor, and the third time series is the time series corresponding to the third factor. That is to say, when decomposing the initial time series, the time series corresponding to the three parameter factors and the time series corresponding to the usage rate of the central processing unit can be decomposed separately to obtain intermediate time series corresponding to different frequency scales. For example, assuming that each time series in the initial time series is decomposed into 8 intermediate time series corresponding to different frequency scales, a total of 4*8 intermediate time series can be obtained, and thus these 4*8 intermediate time series can be used as inputs of the deep learning model, making the model prediction results more accurate.

[0040] In this embodiment, the usage rate of the central processing unit required for process running, the usage rate of the central processing unit required for the system to wait for input and output, the usage rate of the central processing unit required for the system to handle interrupts, and the total usage rate of the central processing unit of the system can be used as the basis for model prediction. Compared with the existing technology that usually only uses the total usage rate of the central processing unit of the system as the basis for model prediction, this embodiment introduces more variables that affect the CPU usage rate, which is conducive to exploring the usage characteristics of the system CPU resources, thereby improving the accuracy of the prediction.

[0041] Furthermore, before decomposing the time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series to obtain intermediate time series corresponding to different frequency scales, the method also includes: normalizing the time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series.

[0042] In some embodiments, the decomposing the time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series respectively to obtain intermediate time series corresponding to different frequency scales includes: decomposing the time series corresponding to the CPU usage rate after normalization, the first time series, the second time series, and the third time series respectively to obtain intermediate time series corresponding to different frequency scales.

[0043] In one embodiment, before decomposing the time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series to obtain intermediate time series corresponding to different frequency scales, the time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series need to be normalized. Specifically, the normalization process can be performed using the following formula:

[0044] Among them, X i Indicates x i The normalized value, x i represents the i-th value in the target time series, min(x) represents the minimum value in the target time series, max(x) represents the maximum value in the target time series, and the target time series is any time series among the time series corresponding to the normalized CPU usage, the first time series, the second time series, and the third time series.

[0045] In this embodiment, the time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series are first normalized, and then the normalized time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series are decomposed to obtain intermediate time series corresponding to different frequency scales. In this way, the CPU usage-related data after normalization are in the same distribution range, which is conducive to the model learning complex patterns in the data and shortening the prediction time of the model.

[0046] Furthermore, the time series corresponding to the normalized CPU usage rate, the first time series, the second time series, and the third time series are decomposed to obtain intermediate time series corresponding to different frequency scales, including:

[0047] Using the impulse response corresponding to the preset low-pass filter and the impulse response corresponding to the high-pass filter, convolution calculation is performed on the target time series respectively to decompose the low-frequency component and the high-frequency component corresponding to the first layer, wherein the target time series is any one of the time series corresponding to the normalized CPU usage rate, the first time series, the second time series, and the third time series;

[0048] Using the impulse response corresponding to the low-pass filter and the impulse response corresponding to the high-pass filter, respectively, convolution calculation is performed on each component of the low-frequency component and the high-frequency component corresponding to the first layer, decomposition is performed to obtain the low-frequency component and the high-frequency component corresponding to the second layer, and the low-frequency component and the high-frequency component corresponding to the second layer are used as the new low-frequency component and the high-frequency component corresponding to the first layer, and the steps of: using the impulse response corresponding to the low-pass filter and the impulse response corresponding to the high-pass filter, respectively, convolution calculation is performed on each component of the low-frequency component and the high-frequency component corresponding to the new first layer, decomposition is performed to obtain the new low-frequency component and the high-frequency component corresponding to the second layer;

[0049] When a preset condition is met, the convolution calculation is stopped, where the preset condition is that the maximum value of the absolute values ​​of all low-frequency components and all high-frequency components decomposed in the current layer is less than a preset multiple of the maximum value of the absolute value of the low-frequency component corresponding to the first layer.

[0050] In one embodiment, the time series corresponding to the normalized CPU usage rate, the first time series, the second time series, and the third time series can be decomposed to obtain intermediate time series corresponding to different frequency scales. Specifically, the target time series is first convolved using the impulse response corresponding to the preset low-pass filter and the impulse response corresponding to the high-pass filter, respectively, to obtain low-frequency components and high-frequency components corresponding to the first layer; then, the impulse response corresponding to the low-pass filter and the impulse response corresponding to the high-pass filter are convolved on each component of the low-frequency components and high-frequency components corresponding to the first layer, respectively, to obtain low-frequency components and high-frequency components corresponding to the second layer; then, the impulse response corresponding to the low-pass filter and the impulse response corresponding to the high-pass filter are convolved on each component of the low-frequency components and high-frequency components corresponding to the second layer, respectively, to obtain low-frequency components and high-frequency components corresponding to the third layer. This cycle is repeated until the preset conditions are met, and the decomposition stops.

[0051] For ease of understanding, the three-layer decomposition of the target time series is taken as an example. The decomposition process of the target time series is shown in Figure 2. Finally, the third layer can obtain 8 high and low frequency components after wavelet decomposition.

[0052] Specifically, the following formulas can be used to perform low-frequency decomposition and high-frequency decomposition operations on the target time series:

[0053] Among them, cL k,i represents the low-frequency component after the i-th decomposition of the k-th layer, cH k,i represents the high-frequency component after the i-th decomposition of the k-th layer, h L represents the impulse response corresponding to the low-pass filter, h h represents the impulse response corresponding to the high-pass filter, Represents the convolution operation; D represents the data to be decomposed. In the first decomposition, D represents the original target time series. In subsequent decompositions, D represents the high-frequency component or low-frequency component after the previous decomposition.

[0054] Stop decomposition when the k-th layer decomposition satisfies the following formula: max(abs(cH k,1 ), abs(cL k,1 )…abs(cH k,M / 2 ), abs(cL k,M / 2 ))<0.1* max(abs(cL 1,1 );

[0055] Among them, max(abs(cH k,1 ), abs(cL k,1 )…abs(cHk,M / 2 ), abs(cL k,M / 2 )) represents the maximum value of the absolute values ​​of all low-frequency components and all high-frequency components after the k-th layer decomposition, M = 2 k ,max(abs(cL 1,1 )) represents the maximum absolute value of the low-frequency component corresponding to the first layer.

[0056] In this embodiment, decomposing the initial time series addresses the mutability and uneven distribution of CPU usage data, reducing the difficulty of deep learning models in identifying patterns in CPU usage data at specific mutation points. Furthermore, wavelet decomposition can convert CPU usage data into frequency information at different frequency scales corresponding to the moment in time. This decomposition enriches the mutation point data with high-frequency information, alleviating the problem of low prediction accuracy in deep learning models caused by a lack of mutation point information.

[0057] Furthermore, the pre-trained deep learning model includes a hidden layer, wherein the hidden layer includes a forget gate, an input gate, and an output gate.

[0058] In the above step 103, the intermediate time series is input into the pre-trained deep learning model for prediction to obtain the predicted value of the CPU usage rate, including: inputting each sampling point of the intermediate time series into the hidden layer in chronological order; using the forget gate, input gate and output gate to calculate the value of each sampling point of the intermediate time series in sequence to extract the time feature of the intermediate time series; using the time feature to predict and output the predicted value of the CPU usage rate.

[0059] In one embodiment, the deep learning model is an LSTM model, which is a recursive neural network. The hidden layer neurons are periodically connected to capture the dynamic dependencies of the input time series. By introducing a forget gate, an input gate, and an output gate, it can store, learn, and express time series information within an arbitrarily long observation window. It can be used for tasks such as time series classification, prediction, and anomaly detection. The calculation flow chart of the LSTM model is shown in Figure 3. The following formula can be used for calculation: t =sigmoid(W f ·h t-1 +U f ·x t +b f ); (1) i t =sigmoid(W i ·h t-1 +U i ·x t +b i ); (2) TCt =tanh(W a ·h t-1 +U a ·x t +b c ); (3) C t =f t *C t-1 +i t *TC t ; (4) o t =sigmoid(W o ·h t-1 +U o ·x t +b o ); (5) h t =o t *tanh(C t ); (6)

[0060] Among them, W f 、U f 、b f 、W i 、U i 、b i 、W a 、U a 、b c 、W o 、U o 、b o , V and b y Both represent model parameters, h t-1 represents the memory information at time t-1, h t represents the memory information at time t, C t-1 represents the cell state at time t-1, C t represents the cell state at time t, x t represents the value at time t of any intermediate time series, Represents the predicted value of the model output, sigmoid and tanh represent different activation functions. t Indicates that the forget gate is based on the input information x t Calculate the forgetting ratio of memory information, i t and TC t Indicates that the input gate is based on the input information x t Process the input information at the current moment. The sigmoid activation function is mainly responsible for updating the memory information, and the tanh activation function is mainly used to create a new state vector C t And add it to the current state information. The above formulas (4) to (7) show that the memory information ht-1 and input information x t Determines the output result of the output gate.

[0061] In this embodiment, by introducing a forget gate, an input gate, and an output gate, the information of the time series can be stored, learned, and expressed within an arbitrarily long observation window, which helps the hidden layer capture the dynamic dependency of the intermediate time series of the input, that is, the temporal feature.

[0062] 4 , which is a flow chart of a method for training a prediction model for CPU usage provided by an embodiment of the present application. As shown in FIG4 , the method for training a prediction model for CPU usage may include the following steps 401 to 403 .

[0063] In step 401, a sample time series is obtained, wherein the sample time series includes a sample sequence corresponding to the utilization rate of the central processing unit and a sample sequence corresponding to a parameter factor related to the utilization rate of the central processing unit, wherein the sample sequence corresponding to the utilization rate of the central processing unit is used to represent the true value of the utilization rate of the central processing unit corresponding to each sampling point.

[0064] Specifically, the sample time series may include a sample series corresponding to the CPU usage rate and a sample series corresponding to parameter factors related to the CPU usage rate. The sample series corresponding to the CPU usage rate may refer to the total CPU usage rate of the device to be predicted, collected over a relatively long period of time; and the sample series corresponding to parameter factors related to the CPU usage rate may refer to the CPU usage rate corresponding to each parameter factor of the device to be predicted, collected over a relatively long period of time.

[0065] It should be noted that the training device for the prediction model of the CPU usage rate here can be any device, which can be the same device as the device to be predicted, or a different device from the device to be predicted, and the embodiments of the present application do not make specific limitations. As an optional implementation, in order not to affect the business performance of the device to be predicted itself, the prediction model training can be performed on other devices, and then the trained prediction model is deployed to the device to be predicted for prediction. The time intervals between the sampling points in the sample sequence corresponding to the CPU usage rate and the sample sequence corresponding to the parameter factors related to the CPU usage rate are the same, and need to be the same as the time intervals between the sampling points in the initial time series during the prediction stage.

[0066] In step 402, the sample time series is decomposed to obtain training sample sequences corresponding to different frequency scales.

[0067] Specifically, the sample time series may be decomposed by wavelet decomposition, empirical mode decomposition, or the like, which is not specifically limited in the embodiments of the present application.

[0068] In this step, by decomposing the sample time series, training sample sequences corresponding to different frequency scales can be obtained. The specific decomposition steps can be found in the decomposition steps of the initial time series during prediction, which will not be repeated here.

[0069] In step 403, the training sample sequence is input into the model to be trained for iterative training to obtain a deep learning model.

[0070] Among them, the deep learning model is used to predict the utilization rate of the central processing unit, and the model to be trained is used to extract the time features of the training sample sequence and predict the utilization rate of the central processing unit based on the extracted time features.

[0071] In this step, a training sample sequence can be input into the model to be trained. The model to be trained extracts the temporal features of the training sample sequence, and the CPU usage rate is predicted based on the extracted temporal features to obtain a predicted value. Specifically, the model to be trained includes a hidden layer, wherein the hidden layer includes a forget gate, an input gate, and an output gate. When the training sample sequence is input into the model to be trained for iterative training, each sampling point of the training sample sequence can be sequentially input into the hidden layer in chronological order. The forget gate, input gate, and output gate are used to calculate the values ​​of each sampling point in the training sample sequence, extract the temporal features of the training sample sequence, and thereby obtain a predicted value for the CPU usage rate at each sampling point. The model parameters of the model to be trained are then trained based on the error between the predicted value and the true value to obtain a deep learning model. In this embodiment, the sample time series can be decomposed to obtain training sample sequences corresponding to different frequency scales. The training sample sequences are then input into the model to be trained to obtain a deep learning model. This facilitates subsequent prediction of the CPU usage rate using the trained deep learning model, thereby improving the accuracy of the prediction results.

[0072] Furthermore, in the above step 403, the training sample sequence is input into the model to be trained for iterative training to obtain a deep learning model, which specifically includes: inputting the training sample sequence into the model to be trained for iterative training to obtain the predicted value of the training sample sequence at each sampling point; determining the evaluation result of the model to be trained based on the predicted value of the training sample sequence at each sampling point and the true value of the usage rate of the central processing unit corresponding to each sampling point; when the evaluation result indicates that the error value between the predicted value and the true value is greater than or equal to a preset threshold, updating the model parameters of the model to be trained based on the true value of the usage rate of the central processing unit corresponding to each sampling point, continuing to input the training sample sequence into the model to be trained for iterative training to obtain the predicted value of the training sample sequence at each sampling point, until the error value is less than the preset threshold, stopping the iterative training to obtain the deep learning model.

[0073] In one embodiment, when training a deep learning model, the training sample sequence can be input into the model to be trained for iterative training to obtain the predicted value of the training sample sequence at each sampling point. Then, based on the predicted value of the training sample sequence at each sampling point and the actual value of the CPU usage rate corresponding to each sampling point, the evaluation result of the model to be trained is determined. If the evaluation result indicates that the error value between the predicted value and the actual value is greater than or equal to a preset threshold, the training sample sequence is continuously input into the model to be trained for iterative training to obtain the predicted value of the training sample sequence at each sampling point. When the error value is less than the preset threshold, the iterative training is stopped to obtain the deep learning model. Specifically, the evaluation result of the model to be trained can be determined using the following formula:

[0074] Among them, Y t represents the true value at time t, represents the predicted value at time t, Ω Test Refers to all moments included in the training sample sequence, Y Test It represents the true value of all moments included in the training sample sequence, and Rse represents the relative square root error, that is, the evaluation result of the model to be trained.

[0075] Through the above method, the trained deep learning model can have a better learning effect, and can store, learn and express time series information within any long observation window, which is conducive to the hidden layer capturing the dynamic dependency of the input training sample sequence, that is, the temporal characteristics.

[0076] In one example, the CPU usage prediction method may specifically include model construction, model training, model deployment, and a CPU usage prediction process after model deployment. The specific process is shown in FIG5 .

[0077] In some embodiments, the model training phase includes the following steps:

[0078] 1. First, collect CPU usage data on the host (the device to be predicted, as described above). This includes CPU usage by running processes, CPU usage by the system waiting for I / O, CPU usage by system interrupts, and total system CPU usage. The data collection interval depends on the prediction requirements; typically, for CPU usage prediction, minute-level intervals are used.

[0079] 2. Normalize the collected data (i.e., the sample time series mentioned above). After normalization, the CPU usage-related data are in the same distribution range, which helps the model learn the complex patterns in the data and shortens the model training cycle.

[0080] 3. Divide the preprocessed data set into a training set and a test set. The ratio can be set arbitrarily according to the size of the collected data set. Use the training set (i.e., the training sample sequence mentioned above) to train the model to be trained.

[0081] 4. Wavelet decomposition is performed on the training data to address the mutability and uneven distribution of CPU usage data, reducing the difficulty of the prediction model in identifying patterns in CPU usage data at mutation points. Wavelet decomposition converts CPU usage data into frequency information at different frequency scales corresponding to the moment. This decomposition enriches the mutation point data with high-frequency information, alleviating the problem of low model prediction accuracy caused by a lack of mutation point information.

[0082] 5. Build an LSTM model. Use the TensorFlow deep learning framework to build and train the model according to the LSTM model calculation process in Figure 2. Furthermore, the relative square root error can be used as a prediction model evaluation metric.

[0083] 6. Deploy the trained deep learning model to the corresponding prediction machine (which can be the model to be trained or other devices other than the model to be trained).

[0084] In some embodiments, the model prediction phase may include the following steps:

[0085] 1. Collect prediction-related CPU usage data, similar to step 1 of the training process above. Note that the time interval must be consistent with the training dataset collection time.

[0086] 2. Normalize and preprocess the data related to the predicted CPU usage, similar to step 2 of the training process above.

[0087] 3. Perform multiple stationary wavelet transformations on the normalized preprocessed data, similar to step 4 of the previous training process.

[0088] 4. Input the CPU usage data after stationary wavelet transform into the deployed deep learning model to obtain the predicted value of CPU usage data.

[0089] In this embodiment, the wavelet transform and the LSTM model can be combined. This mining model exploits the characteristics of data mutations and extracts the temporal relationships and nonlinear characteristics of the CPU usage-related data. Figure 6 shows a comparison of the prediction results using the LSTM model directly and the prediction results using the model proposed in this application. The comparison shows that when the data changes gradually, the prediction results of the proposed prediction method and the LSTM model are similar, and both can accurately predict CPU usage. However, when the CPU usage data suddenly changes, the prediction accuracy of the proposed prediction method is much higher than that of the LSTM model.

[0090] 7, which is a schematic diagram of the structure of a CPU usage prediction device provided by an embodiment of the present application. As shown in FIG7, the CPU usage prediction device 700 may include the following modules.

[0091] The first acquisition module 701 is configured to acquire an initial time series, wherein the initial time series includes a time series corresponding to the CPU usage rate and a time series corresponding to a parameter factor related to the CPU usage rate.

[0092] The first decomposition module 702 is configured to decompose the initial time series to obtain intermediate time series corresponding to different frequency scales.

[0093] The prediction module 703 is configured to input the intermediate time series into a pre-trained deep learning model for prediction to obtain a predicted value of the CPU usage.

[0094] In some embodiments, a pre-trained deep learning model is used to extract time features of the intermediate time series and predict the CPU usage based on the extracted time features.

[0095] Furthermore, the parameter factors include a first factor for characterizing the usage rate of the central processing unit required for process running, a second factor for characterizing the usage rate of the central processing unit required for the system to wait for input and output, and a third factor for characterizing the usage rate of the central processing unit required for the system to handle interrupts.

[0096] The first decomposition module 702 includes: a decomposition submodule configured to decompose the time series corresponding to the CPU usage, the first time series, the second time series, and the third time series respectively to obtain intermediate time series corresponding to different frequency scales.

[0097] In some embodiments, the first time series is a time series corresponding to a first factor, the second time series is a time series corresponding to a second factor, and the third time series is a time series corresponding to a third factor.

[0098] Furthermore, the first decomposition module 702 further includes: a normalization processing submodule configured to perform normalization processing on the time series corresponding to the CPU usage rate, the first time series, the second time series, and the third time series respectively.

[0099] The decomposition submodule is further configured to decompose the time series corresponding to the normalized CPU usage rate, the first time series, the second time series, and the third time series respectively to obtain intermediate time series corresponding to different frequency scales.

[0100] Furthermore, the decomposition submodule includes:

[0101] The convolution calculation unit is used to use the impulse response corresponding to the preset low-pass filter and the impulse response corresponding to the high-pass filter to perform convolution calculations on the target initial time series respectively, and decompose them to obtain the low-frequency component and high-frequency component corresponding to the first layer, wherein the target initial time series is any time series among the time series corresponding to the normalized central processing unit usage rate, the first time series, the second time series and the third time series.

[0102] The processing unit is used to use the impulse response corresponding to the low-pass filter and the impulse response corresponding to the high-pass filter to perform convolution calculations on each component of the low-frequency component and the high-frequency component corresponding to the first layer, decompose the low-frequency component and the high-frequency component corresponding to the second layer, and use the low-frequency component and the high-frequency component corresponding to the second layer as the new low-frequency component and high-frequency component corresponding to the first layer, and repeat the steps of: using the impulse response corresponding to the low-pass filter and the impulse response corresponding to the high-pass filter to perform convolution calculations on each component of the low-frequency component and the high-frequency component corresponding to the new first layer, and decompose the low-frequency component and the high-frequency component corresponding to the new second layer.

[0103] A stopping unit is used to stop the convolution calculation when a preset condition is met, wherein the preset condition is that the maximum value of the absolute values ​​of all low-frequency components and all high-frequency components currently decomposed is less than a preset multiple of the maximum value of the absolute value of the low-frequency component corresponding to the first layer.

[0104] Furthermore, the pre-trained deep learning model includes a hidden layer, wherein the hidden layer includes a forget gate, an input gate, and an output gate.

[0105] The prediction module 703 includes:

[0106] The input submodule is configured to input each sampling point of the intermediate time series into the hidden layer in chronological order.

[0107] The extraction submodule is configured to use the forget gate, input gate and output gate respectively to calculate the value of each sampling point of the intermediate time series in sequence and extract the time features of the intermediate time series.

[0108] The prediction submodule is configured to use the time feature to predict and output a predicted value of the CPU usage.

[0109] It should be noted that the prediction device 700 can implement the steps of the method for predicting the usage rate of the central processing unit provided by any of the aforementioned method embodiments and can achieve the same technical effects, which will not be described in detail here.

[0110] Referring to Figure 8, Figure 8 is a schematic diagram of a structure of a training device for a prediction model of CPU usage provided by an embodiment of the present application. As shown in Figure 8, the training device 800 for a prediction model of CPU usage may include the following modules.

[0111] The second acquisition module 801 is configured to acquire a sample time series, wherein the sample time series includes a sample sequence corresponding to the CPU usage rate and a sample sequence corresponding to a parameter factor related to the CPU usage rate, wherein the sample sequence corresponding to the CPU usage rate is used to represent the true value of the CPU usage rate corresponding to each sampling point.

[0112] The second decomposition module 802 is configured to decompose the sample time series to obtain training sample sequences corresponding to different frequency scales.

[0113] The training module 803 is configured to input the training sample sequence into the model to be trained for iterative training to obtain a deep learning model.

[0114] Among them, the deep learning model is used to predict the utilization rate of the central processing unit, and the model to be trained is used to extract the time features of the training sample sequence and predict the utilization rate of the central processing unit based on the extracted time features.

[0115] Furthermore, the training module 803 includes:

[0116] The output submodule is configured to input the training sample sequence into the model to be trained for iterative training, and obtain the prediction value corresponding to each sampling point of the training sample sequence;

[0117] a determination submodule configured to determine an evaluation result of the to-be-trained model based on a predicted value corresponding to each sampling point of the training sample sequence and an actual value of a CPU usage rate corresponding to each sampling point;

[0118] The training submodule is configured to continue inputting the training sample sequence into the model to be trained for iterative training when the error value between the predicted value and the true value represented by the evaluation result is greater than or equal to a preset threshold, and obtain the predicted value corresponding to each sampling point of the training sample sequence. When the error value is less than the preset threshold, the iterative training is stopped to obtain a deep learning model.

[0119] It should be noted that the training device 800 can implement the steps of the training method for the prediction model of the central processing unit usage rate provided by any of the aforementioned method embodiments, and can achieve the same technical effects, which will not be described in detail here.

[0120] As shown in Figure 9, an embodiment of the present application also provides an electronic device, including a processor 911, a communication interface 912, a memory 913 and a communication bus 914, wherein the processor 911, the communication interface 912, and the memory 913 communicate with each other through the communication bus 914, and the memory 913 is used to store computer programs.

[0121] In one embodiment of the present application, the processor 911 executes the program stored in the memory 913 to implement the steps of the method for predicting the usage rate of the central processing unit provided by any of the aforementioned method embodiments, or implement the steps of the method for training a prediction model for the usage rate of the central processing unit provided by any of the aforementioned method embodiments.

[0122] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the steps of the method for predicting the usage rate of a central processing unit as provided in any of the aforementioned method embodiments, or implements the steps of the method for training a prediction model for the usage rate of a central processing unit as provided in any of the aforementioned method embodiments.

[0123] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0124] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not to be limited to the embodiments shown herein, but is to be construed in the broadest manner consistent with the principles and novel features claimed herein.

Claims

1. A method for predicting the usage rate of a central processing unit, wherein: The method comprises: Acquire an initial time series, wherein the initial time series includes a time series corresponding to the utilization rate of the central processing unit and a time series corresponding to a parameter factor related to the utilization rate of the central processing unit; Decomposing the initial time series to obtain intermediate time series corresponding to different frequency scales; Inputting the intermediate time series into a pre-trained deep learning model for prediction to obtain a predicted value of the utilization rate of the central processing unit; The pre-trained deep learning model is used to extract the time features of the intermediate time series and predict the usage rate of the central processing unit based on the extracted time features.

2. The method according to claim 1, wherein: The parameter factors include a first factor for characterizing the usage rate of the central processing unit required for process operation, a second factor for characterizing the usage rate of the central processing unit required for system waiting for input and output, and a third factor for characterizing the usage rate of the central processing unit required for system processing interrupts; Decomposing the initial time series to obtain intermediate time series corresponding to different frequency scales includes: The time series corresponding to the usage rate of the central processing unit, the first time series, the second time series and the third time series are decomposed respectively to obtain intermediate time series corresponding to different frequency scales, wherein the first time series is the time series corresponding to the first factor, the second time series is the time series corresponding to the second factor, and the third time series is the time series corresponding to the third factor.

3. The method according to claim 2, wherein: Before respectively decomposing the time series corresponding to the usage rate of the central processing unit, the first time series, the second time series and the third time series to obtain intermediate time series corresponding to different frequency scales, the method further includes: Normalizing the time series corresponding to the usage rate of the central processing unit, the first time series, the second time series, and the third time series respectively; The step of respectively decomposing the time series corresponding to the usage rate of the central processing unit, the first time series, the second time series and the third time series to obtain intermediate time series corresponding to different frequency scales includes: The time series corresponding to the usage rate of the CPU after normalization, the first time series, the second time series and the third time series are decomposed respectively to obtain intermediate time series corresponding to different frequency scales.

4. The method according to claim 3, wherein: The step of respectively decomposing the time series corresponding to the usage rate of the CPU after normalization, the first time series, the second time series, and the third time series to obtain intermediate time series corresponding to different frequency scales includes: Using the impulse response corresponding to the preset low-pass filter and the impulse response corresponding to the high-pass filter, convolution calculation is performed on the target time series respectively to decompose the low-frequency component and the high-frequency component corresponding to the first layer, wherein the target time series is any one of the time series corresponding to the usage rate of the central processing unit after normalization, the first time series, the second time series and the third time series; Using the impulse response corresponding to the low-pass filter and the impulse response corresponding to the high-pass filter, convolution calculation is performed on each component of the low-frequency component and the high-frequency component corresponding to the first layer, decomposition is performed to obtain the low-frequency component and the high-frequency component corresponding to the second layer, and the low-frequency component and the high-frequency component corresponding to the second layer are used as the new low-frequency component and the high-frequency component corresponding to the first layer, and the steps are repeated: using the impulse response corresponding to the low-pass filter and the impulse response corresponding to the high-pass filter, convolution calculation is performed on each component of the low-frequency component and the high-frequency component corresponding to the new first layer, decomposition is performed to obtain the new low-frequency component and the high-frequency component corresponding to the second layer; When a preset condition is met, the convolution calculation is stopped, wherein the preset condition is that the maximum value of the absolute values ​​of all low-frequency components and all high-frequency components decomposed in the current layer is less than a preset multiple of the maximum value of the absolute value of the low-frequency component corresponding to the first layer.

5. The method according to claim 1, wherein: The pre-trained deep learning model includes a hidden layer, wherein the hidden layer includes a forget gate, an input gate, and an output gate; The intermediate time series is input into a pre-trained deep learning model for Predicting, obtaining a predicted value of the utilization rate of the central processing unit, including: Inputting each sampling point of the intermediate time series into the hidden layer in chronological order; Using the forget gate, the input gate and the output gate respectively, the values ​​of each sampling point of the intermediate time series are calculated in sequence to extract the time features of the intermediate time series; The time feature is used to predict and output a predicted value of the usage rate of the central processing unit.

6. A method for training a prediction model for CPU usage, wherein: The method comprises: Acquire a sample time series, wherein the sample time series includes a sample series corresponding to the usage rate of the central processing unit and a sample series corresponding to a parameter factor related to the usage rate of the central processing unit, wherein the sample series corresponding to the usage rate of the central processing unit is used to represent a true value of the usage rate of the central processing unit corresponding to each sampling point; Decomposing the sample time series to obtain training sample sequences corresponding to different frequency scales; Inputting the training sample sequence into the model to be trained for iterative training to obtain a deep learning model; The deep learning model is used to predict the utilization rate of the central processing unit, and the model to be trained is used to extract the time features of the training sample sequence and predict the utilization rate of the central processing unit based on the extracted time features.

7. The method according to claim 6, wherein: The step of inputting the training sample sequence into the model to be trained for iterative training to obtain a deep learning model includes: Inputting the training sample sequence into the model to be trained for iterative training to obtain the prediction value corresponding to each sampling point of the training sample sequence; Determine the evaluation result of the model to be trained according to the predicted value corresponding to each sampling point of the training sample sequence and the actual value of the usage rate of the central processing unit corresponding to each sampling point; In response to the evaluation result indicating that the error value between the predicted value and the true value is greater than or equal to a preset threshold, the model parameters of the to-be-trained model are updated according to the true value of the usage rate of the central processing unit corresponding to each sampling point, and the training sample sequence is continuously updated. The training is input into the model to be trained for iterative training to obtain the prediction value corresponding to each sampling point of the training sample sequence. In response to the error value being less than the preset threshold, the iterative training is stopped to obtain the deep learning model.

8. A device for predicting the usage rate of a central processing unit, wherein: The device comprises: A first acquisition module is configured to acquire an initial time series, wherein the initial time series includes a time series corresponding to the usage rate of the central processing unit and a time series corresponding to a parameter factor related to the usage rate of the central processing unit; A first decomposition module is configured to decompose the initial time series to obtain intermediate time series corresponding to different frequency scales; A prediction module, configured to input the intermediate time series into a pre-trained deep learning model for prediction, to obtain a predicted value of the utilization rate of the central processing unit; The pre-trained deep learning model is used to extract the time features of the intermediate time series and predict the usage rate of the central processing unit based on the extracted time features.

9. A training device for a prediction model of CPU usage, wherein: The device comprises: A second acquisition module is configured to acquire a sample time series, wherein the sample time series includes a sample series corresponding to the usage rate of the central processing unit and a sample series corresponding to a parameter factor related to the usage rate of the central processing unit, wherein the sample series corresponding to the usage rate of the central processing unit is used to represent a true value of the usage rate of the central processing unit corresponding to each sampling point; A second decomposition module is configured to decompose the sample time series to obtain training sample sequences corresponding to different frequency scales; A training module is configured to input the training sample sequence into the model to be trained for iterative training to obtain a deep learning model; The deep learning model is used to predict the utilization rate of the central processing unit, and the model to be trained is used to extract the time features of the training sample sequence and predict the utilization rate of the central processing unit based on the extracted time features.

10. An electronic device, wherein: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is configured to store a computer program; A processor is configured to execute the program stored in the memory, so that the processor implements the method for predicting the usage rate of a central processing unit described in any one of claims 1-5, or implements the training method for predicting the usage rate of a central processing unit described in any one of claims 6-7.

11. A computer-readable storage medium having a computer program stored thereon, wherein: The computer program is executed by a processor, so that the processor implements the method for predicting the usage rate of a central processing unit described in any one of claims 1-5, or implements the method for training a prediction model for the usage rate of a central processing unit described in any one of claims 6-7.

Citation Information

Patent Citations

  • A Host Load Prediction Method Based on Multi-Sequence Combination

    CN103748993B

  • CPU utilization rate prediction method and system, medium and equipment

    CN111221706A

  • CPU utilization rate prediction method and device

    CN111338798A

  • CPU utilization rate monitoring method and device

    CN112559276A

  • CPU resource load condition prediction method based on LSTM

    CN113626177A