Method and device for predicting CPU utilization rate and computer equipment

By combining continuous and periodic data models, using weighted values to comprehensively predict CPU utilization, the problem of low prediction accuracy of a single model is solved, and higher prediction accuracy and system resource management efficiency are achieved.

CN120353676APending Publication Date: 2025-07-22BEIJING URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510430327.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

In the prior art, the use of a single model to predict CPU utilization has the problem of low prediction accuracy.

Method used

By obtaining the continuous operation data before the current moment and the periodic operation data at the periodic repetition moment, combining the continuous data model and the periodic data model, the weighted value is used to comprehensively determine the predicted value of CPU utilization.

Benefits of technology

It improves the prediction accuracy of CPU utilization, can more accurately predict future CPU load conditions, ensure effective allocation of system resources and avoid performance degradation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353676A_ABST
    Figure CN120353676A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for predicting the CPU utilization rate and computer equipment, and the method comprises the steps: obtaining continuous operation data of a continuous time period before the current moment, and determining a first prediction candidate value of the CPU utilization rate at the next moment according to the continuous operation data; acquiring periodic operation data of a moment periodically repeated with the current moment, and determining a second prediction candidate value of the CPU utilization rate at the next moment according to the periodic operation data; and determining a predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value and a weighted value, the weighted value being used for indicating a ratio of the first predicted candidate value to the second predicted candidate value. Through the CPU utilization rate prediction method and device, the problem that the prediction accuracy is low when a single model is adopted to predict the CPU utilization rate in the prior art is solved, and the effect of improving the CPU utilization rate prediction accuracy is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technologies, and in particular, to a method, apparatus, and computer device for predicting CPU utilization rate. Background Art

[0002] By predicting the CPU utilization rate, computing resources can be more effectively planned and allocated, which helps to ensure that the system does not experience performance degradation due to resource overload, and at the same time avoids resource waste, thereby achieving a balance between cost - effectiveness and system efficiency. Accurate prediction of CPU utilization rate can help system administrators or performance management tools take measures before high - load situations occur, such as increasing processing power or optimizing running tasks and processes, which helps to maintain the performance standards of applications and services.

[0003] Early CPU utilization rate prediction was mainly based on simple linear models and historical averages, aiming to make basic predictions of system load to support preliminary capacity planning and management. With the development of technology, more complex statistical models such as ARIMA (Autoregressive Integrated Moving Average model) and seasonal models began to be applied. These models can better capture trends and periodicities in time - series data. With the rapid development of artificial intelligence and machine learning technologies, deep - learning models such as Long Short - Term Memory network (LSTM), Convolutional Neural Network (CNN), and Temporal Convolutional Network (TCN) were introduced into the prediction of CPU utilization rate. These models are capable of handling more complex patterns and longer dependencies. However, these technical means all use a single model to predict the CPU utilization rate, and single - model prediction has certain limitations, which will lead to a relatively low accuracy in predicting the CPU utilization rate.

[0004] Currently, for the problem of relatively low prediction accuracy in predicting the CPU utilization rate using a single model in related technologies, no effective solution has been proposed. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, computer device, and computer - readable storage medium for predicting CPU utilization rate to at least solve the problem of relatively low prediction accuracy in predicting the CPU utilization rate using a single model in related technologies.

[0006] To achieve the above - mentioned purpose, the technical solution adopted in this application is as follows:

[0007] In a first aspect, an embodiment of this application provides a method for predicting CPU utilization rate, including:

[0008] Obtaining continuous operation data for a continuous time period before the current moment, and determining a first predicted candidate value of the CPU utilization rate at the next moment according to the continuous operation data;

[0009] Obtain the periodic operation data at the periodic repetition moments of the current moment, and determine a second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data;

[0010] Determine a predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value, where the weighting value is used to indicate the proportion of the first predicted candidate value and the second predicted candidate value.

[0011] In some embodiments, after determining the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value, the method further includes:

[0012] Obtain the actual value of the CPU utilization rate at the next moment;

[0013] Adjust the weighting value by using the actual value and the predicted value.

[0014] In some embodiments, the determining the first predicted candidate value of the CPU utilization rate at the next moment according to the continuous operation data includes: determining the first predicted candidate value of the CPU utilization rate at the next moment according to the continuous operation data by using a continuous data model;

[0015] The determining the second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data includes: determining the second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data by using a periodic data model.

[0016] In some embodiments, after obtaining the actual value of the CPU utilization rate at the next moment, the method further includes:

[0017] Adjust the parameters of the continuous data model and the periodic data model by using the actual value and the predicted value.

[0018] In some embodiments, before obtaining the continuous operation data in the continuous time period before the current moment, the method further includes:

[0019] Obtain the weighting value by any one of the following methods:

[0020] Set the weighting value;

[0021] Adjust the weighting value according to the performance parameters of the continuous data model and the periodic data model;

[0022] Adjust the weighting value according to the CPU utilization rate prediction errors of the continuous data model and the periodic data model.

[0023] In some of these embodiments, determining the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value includes:

[0024] Inputting the first predicted candidate value determined by the continuous data model and the second predicted candidate value determined by the periodic data model into a pre-trained meta-model, and outputting the predicted value.

[0025] In some of these embodiments, after determining the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value, the method further includes:

[0026] When at least one of the following situations is detected, outputting an alarm prompt message:

[0027] The system operation parameters exceed the target threshold, where the system operation parameters include the predicted value;

[0028] There is an abnormality in the log information;

[0029] The process status is abnormal.

[0030] In a second aspect, an embodiment of the present application provides an apparatus for predicting CPU utilization rate, including:

[0031] A first acquisition unit, configured to acquire continuous operation data for a continuous time period before the current moment, and determine a first predicted candidate value of the CPU utilization rate at the next moment according to the continuous operation data;

[0032] A second acquisition unit, configured to acquire periodic operation data at a periodic repetition moment of the current moment, and determine a second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data;

[0033] A determination unit, configured to determine a predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value, where the weighting value is used to indicate the proportion of the first predicted candidate value and the second predicted candidate value.

[0034] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the method for predicting CPU utilization rate as described in the first aspect above is implemented.

[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method for predicting CPU utilization rate as described in the first aspect above is implemented.

[0036] The present application adopts the above technical solutions. Compared with the prior art, the method for predicting CPU utilization provided by the embodiments of the present application obtains continuous operation data for a continuous time period before the current moment, and determines a first prediction candidate value of the CPU utilization at the next moment according to the continuous operation data; obtains periodic operation data at a moment that periodically repeats with the current moment, and determines a second prediction candidate value of the CPU utilization at the next moment according to the periodic operation data; determines a predicted value of the CPU utilization at the next moment according to the first prediction candidate value, the second prediction candidate value, and a weighting value, where the weighting value is used to indicate the proportion of the first prediction candidate value and the second prediction candidate value, solving the problem of relatively low prediction accuracy in predicting CPU utilization using a single model in the related art, and achieving the effect of improving the prediction accuracy of CPU utilization.

[0037] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more concise and understandable. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0039] Figure 1 is a block diagram of the structure of a mobile terminal according to an embodiment of the present application;

[0040] Figure 2 is a flowchart of a method for predicting CPU utilization according to an embodiment of the present application;

[0041] Figure 3 is a flowchart of a method for predicting CPU utilization according to a preferred embodiment of the present application;

[0042] Figure 4 is a block diagram of the structure of a device for predicting CPU utilization according to an embodiment of the present application;

[0043] Figure 5 is a schematic hardware structure diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] In order to make the objectives, technical solutions and advantages of this application clearer and more understandable, the following describes and explains this application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application. Based on the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of this application.

[0045] Obviously, the accompanying drawings in the following description are only some examples or embodiments of this application. For those of ordinary skill in the art, without creative efforts, this application can also be applied to other similar scenarios based on these drawings. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in this application, some design, manufacturing or production changes based on the technical content disclosed in this application are only conventional technical means and should not be understood as the content disclosed in this application being insufficient.

[0046] Referring to "embodiment" in this application means that the specific features, structures or characteristics described in combination with the embodiment can be included in at least one embodiment of this application. The appearance of this phrase in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those of ordinary skill in the art explicitly and implicitly understand that the embodiments described in this application can be combined with other embodiments without conflict.

[0047] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the ordinary meanings understood by those with ordinary skills in the technical field to which this application belongs. The words such as "a", "one", "a kind of", "the" and the like involved in this application do not indicate a quantity limitation and may represent a singular or plural number. The terms "including", "comprising", "having" and any variations thereof involved in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or units, but may further include unlisted steps or units, or may further include other steps or units inherent to these processes, methods, products or devices. The words such as "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" involved in this application means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, "A and / or B" may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the front and back associated objects. The terms "first", "second", "third" and the like involved in this application are only used to distinguish similar objects and do not represent a specific order for the objects.

[0048] This embodiment provides a mobile terminal. Figure 1 It is a structural block diagram of a mobile terminal according to an embodiment of the present application. As Figure 1 shown, the mobile terminal includes: a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a wireless fidelity (WiFi) module 170, a processor 180, and a power supply 190 and other components. Those skilled in the art can understand that Figure 1 the mobile terminal structure shown in does not constitute a limitation on the mobile terminal and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0049] The following combines Figure 1 to specifically introduce each component of the mobile terminal:

[0050] The RF circuit 110 can be used for receiving and transmitting information or signals during communication. Specifically, after receiving the downlink information from the base station, it is sent to the processor 180 for processing. Additionally, the data designed for uplink is sent to the base station. Generally, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 110 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0051] The memory 120 can be used to store software programs and modules. The processor 180 executes various functional applications and data processing of the mobile terminal by running the software programs and modules stored in the memory 120. The memory 120 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile terminal (such as audio data, a phone book, etc.). In addition, the memory 120 can include high-speed random access memory and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0052] The input unit 130 can be used to receive input numeric or character information, and generate key signal inputs related to the user settings and function control of the mobile terminal. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132. The touch panel 131, also known as a touch screen, can collect touch operations of the user thereon or nearby (such as operations of the user using any suitable object or accessory such as a finger, a stylus, etc. on or near the touch panel 131), and drive corresponding connection devices according to a preset program. Optionally, the touch panel 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 180, and can receive and execute the commands sent by the processor 180. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel 131. In addition to the touch panel 131, the input unit 130 may further include other input devices 132. Specifically, the other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0053] The display unit 140 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile terminal. The display unit 140 may include a display panel 141. Optionally, the display panel 141 can be configured in the form of a liquid crystal display (LCD for short), an organic light-emitting diode (OLED for short), etc. Further, the touch panel 131 can cover the display panel 141. When the touch panel 131 detects a touch operation thereon or nearby, it transmits it to the processor 180 to determine the type of touch event. Subsequently, the processor 180 provides corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 1 the touch panel 131 and the display panel 141 are implemented as two independent components to realize the input and input functions of the mobile terminal, in some embodiments, the touch panel 131 and the display panel 141 can be integrated to realize the input and output functions of the mobile terminal.

[0054] The mobile terminal may further include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 141 and / or the backlight when the mobile terminal is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used in applications for identifying the posture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the mobile terminal can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be elaborated here.

[0055] The speaker 161 and the microphone 162 in the audio circuit 160 can provide an audio interface between the user and the mobile terminal. The audio circuit 160 can transmit the electrical signal converted from the received audio data to the speaker 161, and the speaker 161 converts it into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and then converted into audio data. After the audio data is output to the processor 180 for processing, it is sent through the RF circuit 110 to, for example, another mobile terminal, or the audio data is output to the memory 120 for further processing.

[0056] WiFi belongs to short - range wireless transmission technology. The mobile terminal can help users send and receive emails, browse the web, and access streaming media through the WiFi module 170, which provides users with wireless broadband Internet access. Although Figure 1 the WiFi module 170 is shown, it can be understood that it does not belong to an essential component of the mobile terminal and can be completely omitted or replaced with other short - range wireless transmission modules, such as Zigbee module, or WAPI module, etc., within the scope of not changing the essence of the invention as needed.

[0057] The processor 180 is the control center of the mobile terminal, connecting various parts of the entire mobile terminal through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the mobile terminal and processes data, thereby monitoring the mobile terminal as a whole. Optionally, the processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above - mentioned modem processor may not be integrated into the processor 180 either.

[0058] The mobile terminal further includes a power source 190 (such as a battery) for supplying power to each component. Preferably, the power source can be logically connected to the processor 180 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system.

[0059] Although not shown, the mobile terminal may further include a camera, a Bluetooth module, etc., which will not be elaborated here.

[0060] In this embodiment, the processor 180 is configured to:

[0061] Obtain continuous operation data for a continuous time period before the current moment, and determine a first prediction candidate value of the CPU utilization rate at the next moment according to the continuous operation data;

[0062] Obtain periodic operation data for a periodic repetition moment of the current moment, and determine a second prediction candidate value of the CPU utilization rate at the next moment according to the periodic operation data;

[0063] Determine a predicted value of the CPU utilization rate at the next moment according to the first prediction candidate value, the second prediction candidate value, and a weighting value, where the weighting value is used to indicate the proportion of the first prediction candidate value and the second prediction candidate value.

[0064] In some embodiments, the processor 180 is further configured to:

[0065] After determining the predicted value of the CPU utilization rate at the next moment according to the first prediction candidate value, the second prediction candidate value, and the weighting value, obtain the actual value of the CPU utilization rate at the next moment;

[0066] Adjust the weighting value by using the actual value and the predicted value.

[0067] In some embodiments, the processor 180 is further configured to:

[0068] According to the continuous operation data, use a continuous data model to determine the first prediction candidate value of the CPU utilization rate at the next moment;

[0069] According to the periodic operation data, use a periodic data model to determine the second prediction candidate value of the CPU utilization rate at the next moment.

[0070] In some embodiments, the processor 180 is further configured to:

[0071] After obtaining the actual value of the CPU utilization rate at the next moment, adjust the parameters of the continuous data model and the periodic data model by using the actual value and the predicted value.

[0072] In some of these embodiments, the processor 180 is further configured to:

[0073] Before obtaining the continuous operation data of consecutive time periods before the current moment, obtain the weighted value by any one of the following methods:

[0074] Set the weighted value;

[0075] Adjust the weighted value according to the performance parameters of the continuous data model and the periodic data model;

[0076] Adjust the weighted value according to the CPU utilization prediction error of the continuous data model and the periodic data model.

[0077] In some of these embodiments, the processor 180 is further configured to:

[0078] Input the first prediction candidate value determined by the continuous data model and the second prediction candidate value determined by the periodic data model into a pre-trained meta-model, and output the prediction value.

[0079] In some of these embodiments, the processor 180 is further configured to:

[0080] After determining the predicted value of the CPU utilization at the next moment according to the first prediction candidate value, the second prediction candidate value, and the weighted value, when detecting at least one of the following situations, output an alarm prompt message:

[0081] The system operation parameter exceeds the target threshold, where the system operation parameter includes the predicted value;

[0082] There is an abnormality in the log information;

[0083] The process status is abnormal.

[0084] This embodiment provides a method for predicting CPU utilization. Figure 2 It is a flowchart of the method for predicting CPU utilization according to the embodiments of the present application, as Figure 2 shown, and this process includes the following steps:

[0085] Step S201, obtain the continuous operation data of consecutive time periods before the current moment, and determine the first prediction candidate value of the CPU utilization at the next moment according to the continuous operation data;

[0086] Step S202, obtain the periodic operation data of the periodic repetition moment of the current moment, and determine the second prediction candidate value of the CPU utilization at the next moment according to the periodic operation data;

[0087] Step S203: Determine the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value, where the weighting value is used to indicate the proportion of the first predicted candidate value and the second predicted candidate value.

[0088] During the operation of the system, the present application can sample at a predetermined frequency and store the sampled system operation data in a predetermined format. The sampled system operation data can include two parts, namely continuous operation data and periodic operation data. Among them, the continuous operation data refers to the system operation data in a continuous time period, such as from 9 am to 6 pm on Monday; the periodic operation data refers to the system operation data with periodic repeated moments, such as 9 am every Monday. When predicting the CPU utilization rate based on the sampled system operation data, the present application takes into account the continuous operation data and the periodic operation data, and comprehensively considering the system operation data in different time dimensions can improve the prediction accuracy of the CPU utilization rate.

[0089] To predict the CPU utilization rate at the next moment, the embodiment of the present application uses step S201 to obtain the continuous operation data in a continuous time period before the current moment, and determines the first predicted candidate value of the CPU utilization rate at the next moment according to the continuous operation data, and uses step S202 to obtain the periodic operation data at the periodic repeated moment of the current moment, and determines the second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data, and then determines the final predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value and the second predicted candidate value.

[0090] Optionally, the step S201 of determining the first predicted candidate value of the CPU utilization rate at the next moment according to the continuous operation data includes: determining the first predicted candidate value of the CPU utilization rate at the next moment according to the continuous operation data by using a continuous data model.

[0091] Optionally, the step S202 of determining the second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data includes: determining the second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data by using a periodic data model.

[0092] It should be noted that for the continuous operation data, the prediction of the CPU utilization rate can use continuous data models, such as ARIMA (Autoregressive Integrated Moving Average Model), Random Forest, Gradient Boosting Machine (GBM), Support Vector Machine (SVM), LSTM (Long Short-Term Memory Network), GRU (Gated Recurrent Unit), etc. For the periodic operation data, the prediction of the CPU utilization rate can use periodic data models, such as SARIMA (Seasonal Autoregressive Integrated Moving Average Model), Kalman Filter, etc.

[0093] This application uses a continuous data model and a periodic data model to predict CPU utilization. These model algorithms can be trained based on a large amount of data sets to improve the model prediction accuracy, and then achieve the effect of improving the CPU utilization prediction accuracy. This application does not specifically limit the training method and process of the model algorithms.

[0094] After obtaining the first prediction candidate value and the second prediction candidate value, this application can determine the predicted value of the CPU utilization at the next moment through step S203 according to the first prediction candidate value, the second prediction candidate value, and the weighting value, where the weighting value is used to indicate the proportion of the first prediction candidate value and the second prediction candidate value.

[0095] In some embodiments, before or during the collection of system operation data, this application can obtain the weighting value according to the actual situation.

[0096] Optionally, this application can obtain the weighting value through any one of the following methods:

[0097] Set the weighting value;

[0098] Adjust the weighting value according to the performance parameters of the continuous data model and the periodic data model;

[0099] Adjust the weighting value according to the CPU utilization prediction errors of the continuous data model and the periodic data model.

[0100] It should be noted that the above method of setting the weighting value is a fixed weighting scheme, and the weights of different models are fixed in advance. Usually, based on historical data and the performance of the model, the initial weights of each model can be set. The advantage of this method is simple implementation and is suitable for scenarios where data characteristics are stable and there are no obvious changes; the disadvantage is that the model weights cannot be dynamically adjusted, with poor flexibility and inability to adapt to the dynamic changes of data characteristics.

[0101] The above method of adjusting the weighting value according to the performance parameters of the continuous data model and the periodic data model is a dynamic weighting scheme, and the weights of different models are dynamically adjusted with the real-time change of the prediction performance. The model with good performance will be given a greater weight in the current time period. The advantage of this method is dynamic weight adjustment and the ability to adapt to the changes of data characteristics; the disadvantage is complex implementation, especially the need for real-time evaluation and adjustment of weights.

[0102] The method of adjusting the weighted value according to the CPU utilization prediction errors of the continuous data model and the periodic data model is based on an error weighting scheme, which performs inverse weighting on the prediction errors of each model, and the model with a smaller error obtains a larger weight. The advantage of this method is that it can adjust the weight immediately according to the actual performance of the model; the disadvantage is that it requires real-time error calculation, which increases the complexity.

[0103] In the embodiments of the present application, the weighted value can be obtained in advance by selecting any one of the above according to actual needs, and then the predicted value of the CPU utilization at the next moment can be determined by combining the first predicted candidate value and the second predicted candidate value.

[0104] As an alternative embodiment, step S203 of determining the predicted value of the CPU utilization at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighted value may further include:

[0105] Input the first predicted candidate value determined by the continuous data model and the second predicted candidate value determined by the periodic data model into a pre-trained meta-model, and output the predicted value.

[0106] This alternative embodiment can adopt a model fusion scheme, such as algorithms like averaging method (arithmetic average, geometric average, weighted average), Stacking, Blending, etc., and use a meta-learner to learn how to weight the outputs of multiple models to obtain the final prediction result. The advantage of this method is that it can capture the non-linear relationships of different models more complexly and often improve the prediction accuracy; the disadvantage is that more data is required to train the meta-learner, and the training process is relatively complex, which is suitable for scenarios with more historical data.

[0107] It should be noted that taking the Stacking method in model fusion as an example, its principle is as follows: First, train multiple different models, and then use the outputs of the previously trained individual models (base learners) as inputs to train a model (meta-learner) to obtain a final output. The embodiments of the present application can perform fusion calculation on the obtained predicted candidate values through the following steps to obtain the final predicted value:

[0108] 1. Divide the training data set into multiple subsets, usually two or more.

[0109] 2. For each subset, use different base models for training and prediction to obtain the prediction results of each base model.

[0110] 3. Combine these prediction results as new features to form a new training data set.

[0111] 4. Use this new training data set to train a meta-model.

[0112] 5. Use the trained meta-model to predict the test data.

[0113] In the embodiment of the present application, by using the trained meta-model to determine the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value and the second predicted candidate value, the effect of improving the accuracy of the CPU utilization rate can be achieved.

[0114] As an optional embodiment, after determining the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value in step S203, the method further includes:

[0115] Obtain the actual value of the CPU utilization rate at the next moment;

[0116] Use the actual value and the predicted value to adjust the weighting value.

[0117] After predicting the CPU utilization rate at the next moment through the model prediction algorithm in the embodiment of the present application, when the next moment arrives, the above weighting value can be corrected by the actually detected actual value to achieve the effect of improving the applicability of the weighting value and improving the prediction accuracy of the CPU utilization rate at the future moment. Optionally, using the actual value and the predicted value to adjust the weighting value may include: obtaining the difference between the actual value and the predicted value, and if the difference is higher than the preset value, adjusting the weighting value. Here, the adjustment may include adjusting the respective proportions of the first predicted candidate value and the second predicted candidate value, but the sum of the proportions of the first predicted candidate value and the second predicted candidate value is 1.

[0118] Optionally, after obtaining the actual value of the CPU utilization rate at the next moment, the method may further include: using the actual value and the predicted value to adjust the parameters of the continuous data model and the periodic data model. Correcting the parameters of the continuous data model and the periodic data model by using the actual value of the CPU utilization rate at the next moment can improve the prediction performance of the continuous data model and the periodic data model, so that the accuracy of the first predicted candidate value and the second predicted candidate value can be improved, and further the purpose of improving the accuracy of the predicted value of the CPU utilization rate at the next moment can be achieved.

[0119] As an optional embodiment, after determining the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value, the method further includes:

[0120] When at least one of the following situations is detected, output an alarm prompt message:

[0121] The system operation parameters exceed the target threshold, where the system operation parameters include the predicted value;

[0122] There are abnormalities in the log information;

[0123] The process status is abnormal.

[0124] The embodiments of the present application can also set an early warning mechanism. When any of the above abnormal situations is detected, an alarm prompt message can be output. The abnormal situations in the embodiments of the present application can include but are not limited to system metrics such as memory usage, disk I / O, and network traffic exceeding the threshold; there are abnormalities in system logs, application logs, and process status; the current CPU usage exceeds the highest demand recorded in the benchmark test, etc. If relevant abnormal situations are detected, there may be configuration errors or application anomalies. At this time, it is necessary to check whether there are system failures (such as memory leaks, infinite loops, etc.), which can ensure the safe and reliable operation performance of the system.

[0125] The embodiments of the present application will be described and illustrated below through preferred embodiments.

[0126] Figure 3 It is a flowchart of a method for predicting CPU utilization according to a preferred embodiment of the present application. As Figure 3 shown, the method may include:

[0127] Step S301, perform system operation data sampling;

[0128] Step S302, store the system operation data in the database;

[0129] Step S303, retrieve the specified continuous time data from the database, extract the feature values, and input them into the continuous data model for calculation to obtain the first prediction candidate value;

[0130] Step S304, retrieve the data of the specified number of days and the same time period from the database, extract the feature values, and input them into the periodic data model for calculation to obtain the second prediction candidate value;

[0131] Step S305, extract the weighted value used in this time period;

[0132] Step S306, perform weighted calculation on the first prediction candidate value and the second prediction candidate value to obtain the predicted value;

[0133] Step S307, detect whether the system is abnormal; if abnormal, execute step S308; if not abnormal, execute step S309;

[0134] Step S308, start alarm;

[0135] Step S309, determine whether the error between the true value and the predicted value is too large; if so, execute step S310;

[0136] Step S310, adjust the weighting value according to the true value and the predicted value.

[0137] The preferred embodiment can adopt a sampling module, a calculation module, a detection module, a regression module, and an alarm module to implement the above method for predicting CPU utilization. Among them, the sampling module samples the system operation data at a predetermined frequency and stores the collected data in the database in a predetermined format. The task of the calculation module is to obtain the sampling data, combine it with historical data, and calculate the future CPU utilization through an algorithm model. The function of the detection module is to read the system log, determine whether there is an abnormality in the current system, whether the system data exceeds the threshold, and if an abnormality occurs, trigger an alarm to notify the user of the current system status. The regression module is used to correct the parameters of the algorithm model. When the system reaches the moment of predicting the CPU utilization, the system will collect the true CPU utilization of the current system, and then correct the parameters of the algorithm model by comparing the true CPU utilization and the predicted CPU utilization. The alarm module is used to prompt the user that the current system is abnormal or the predicted CPU utilization is higher than the set threshold.

[0138] Specifically, the calculation module will adopt an algorithm model to predict the CPU utilization. The algorithm model covers two parts, and the two parts will use different data dimensions to calculate their respective predicted candidate values. The predicted candidate values will finally be weighted to obtain the final predicted value. One part is a continuous data model, which is used to reflect the relationship of the CPU in a continuous time series. The CPU utilization is predicted by the continuous sampling data within a certain time period backward from the current time. Algorithms such as ARIMA (Autoregressive Integrated Moving Average Model), Random Forest, Gradient Boosting Machine (GBM), Support Vector Machine (SVM), LSTM (Long Short-Term Memory Network), and GRU (Gated Recurrent Unit) can be used; the other part is a periodic data model, which is used to reflect the specific user activities of the system in the same time period. The algorithms in this part assume that the historical data has a repeated pattern or trend at the same time. The CPU utilization is predicted by the sampling data in the same time period of the past specified number of days. Algorithms such as SARIMA (Seasonal Autoregressive Integrated Moving Average Model) and Kalman Filter can be used. After obtaining the predicted candidate values of the above two parts, a weighting value is needed to comprehensively calculate a final predicted value, and this weighting value is not a fixed value. The preferred embodiment sets several weighting values according to a predetermined period in units of days. This weighting value reflects the ratio of the two parts, that is, it reflects whether the CPU utilization is closer to the prediction of the continuous data model or the periodic data model during this time period. The corresponding weighting value of each time period will be used to finally calculate the predicted CPU utilization. Finally, when the true CPU utilization is sampled, the true CPU utilization data will be combined with the predicted value and the predicted candidate value to correct this weighting value.

[0139] The purpose of the detection module is to detect whether there are faults in the system, so as to determine whether an alarm needs to be prompted. The detection means include but are not limited to whether system metrics such as memory usage, disk I / O, and network traffic exceed thresholds; checking system logs, application logs, and process status to determine whether there are abnormal statuses; and performing performance benchmark tests to determine the CPU requirements of the application under ideal and high-pressure conditions. If the current CPU usage exceeds the highest requirement recorded in the benchmark test, there may be a configuration error or application anomaly, and it is necessary to check whether there is a system fault (such as memory leak, infinite loop, etc.).

[0140] The purpose of the regression module is to, after the time scale predicted by the CPU arrives, sample the actual running parameters and compare the predicted CPU utilization rate, so as to correct the weighted value of the algorithm model applied to this time period. By adjusting the weighted value, the CPU utilization rate can be more accurately calculated when predicting the CPU utilization rate of this time period next time.

[0141] The alarm module is used to prompt alarms, such as whether the data exceeds the threshold and whether the system is abnormal.

[0142] This application uses multiple models from multiple perspectives for weighted prediction, and then uses the real value to correct the weighted value, so as to improve the accuracy of predicting the CPU utilization rate.

[0143] It should be noted that the steps shown in the above process or the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0144] This embodiment provides a device for predicting the CPU utilization rate. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0145] Figure 4 is a structural block diagram of a device for predicting the CPU utilization rate according to an embodiment of the present application, as Figure 4 shown, the device includes:

[0146] A first acquisition unit 41, configured to acquire continuous operation data for a continuous time period before the current moment, and determine a first prediction candidate value of the CPU utilization rate at the next moment according to the continuous operation data;

[0147] A second acquisition unit 42, configured to acquire periodic operation data at a moment that periodically repeats with the current moment, and determine a second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data;

[0148] A determination unit 43, configured to determine a predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and a weighting value, where the weighting value is used to indicate the proportion of the first predicted candidate value and the second predicted candidate value.

[0149] In some embodiments, the apparatus further includes:

[0150] A third acquisition unit, configured to acquire an actual value of the CPU utilization rate at the next moment after determining the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value;

[0151] A first adjustment unit, configured to adjust the weighting value by using the actual value and the predicted value.

[0152] In some embodiments, the first acquisition unit 41 includes: a first determination module, configured to determine the first predicted candidate value of the CPU utilization rate at the next moment according to the continuous operation data by using a continuous data model;

[0153] The second acquisition unit 42 includes: a second determination module, configured to determine the second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data by using a periodic data model.

[0154] In some embodiments, the apparatus further includes:

[0155] A second adjustment unit, configured to adjust parameters of the continuous data model and the periodic data model by using the actual value and the predicted value after acquiring the actual value of the CPU utilization rate at the next moment.

[0156] In some embodiments, the apparatus further includes:

[0157] A fourth acquisition unit, configured to acquire the weighting value by any one of the following methods before acquiring the continuous operation data of a continuous time period before the current moment:

[0158] Set the weighting value;

[0159] Adjust the weighting value according to performance parameters of the continuous data model and the periodic data model;

[0160] Adjust the weighting value according to CPU utilization rate prediction errors of the continuous data model and the periodic data model.

[0161] In some of these embodiments, the determining unit 43 includes:

[0162] An input module, configured to input the first predicted candidate value determined by the continuous data model and the second predicted candidate value determined by the periodic data model into a pre-trained meta-model, and output the predicted value.

[0163] In some of these embodiments, the apparatus further includes:

[0164] An output unit, configured to, after determining the predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and the weighting value, output an alarm prompt message when at least one of the following situations is detected:

[0165] The system operation parameter exceeds the target threshold, where the system operation parameter includes the predicted value;

[0166] The log information is abnormal;

[0167] The process status is abnormal.

[0168] It should be noted that the above-mentioned each module may be a functional module or a program module, and may be implemented either by software or by hardware. For the modules implemented by hardware, the above-mentioned each module may be located in the same processor; or the above-mentioned each module may also be located in different processors in any combined form.

[0169] The embodiment provides a computer device. The method for predicting the CPU utilization rate in combination with the embodiments of the present application can be implemented by the computer device. Figure 5 It is a schematic diagram of the hardware structure of the computer device according to the embodiment of the present application.

[0170] The computer device may include a processor 51 and a memory 52 storing computer program instructions.

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

[0172] Among them, the memory 52 may include a mass storage for data or instructions. By way of example and not limitation, the memory 52 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 52 may include removable or non-removable (or fixed) media. In appropriate cases, the memory 52 may be internal or external to the data processing device. In a particular embodiment, the memory 52 is a non-volatile memory. In a particular embodiment, the memory 52 includes a read-only memory (ROM) and a random access memory (RAM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these. In appropriate cases, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM may be a fast page mode dynamic random access memory (FPMDRAM), an extended date out dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0173] The memory 52 can be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 51.

[0174] The processor 51 reads and executes the computer program instructions stored in the memory 52 to implement any one of the methods for predicting CPU utilization in the above embodiments.

[0175] In some of the embodiments, the computer device may further include a communication interface 53 and a bus 50. Among them, as Figure 5 shown, the processor 51, the memory 52, and the communication interface 53 are connected through the bus 50 and complete communication with each other.

[0176] The communication interface 53 is used to implement communication between the modules, devices, units, and / or devices in the embodiments of the present application. The communication interface 53 can also implement data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.

[0177] The bus 50 includes hardware, software, or both, and couples components of a computer device to each other. The bus 50 includes at least one of the following, without limitation: Data Bus, Address Bus, Control Bus, Expansion Bus, Local Bus. By way of example and not limitation, the bus 50 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable bus or a combination of two or more of these. Where appropriate, the bus 50 may include one or more buses. Although the embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.

[0178] In addition, in combination with the method for predicting CPU utilization in the above embodiments, the embodiments of the present application can be implemented by providing a computer-readable storage medium. Computer program instructions are stored on the computer-readable storage medium; when the computer program instructions are executed by a processor, any one of the methods for predicting CPU utilization in the above embodiments is implemented.

[0179] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0180] The embodiments described above only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several variations and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.

Claims

1. A method for predicting CPU utilization, characterized in that Including: Obtain the continuous operation data of a continuous time period before the current moment, and determine a first prediction candidate value of the CPU utilization rate at the next moment according to the continuous operation data; Obtain the periodic operation data of the periodic repetition moment of the current moment, and determine a second prediction candidate value of the CPU utilization rate at the next moment according to the periodic operation data; Determine a predicted value of the CPU utilization rate at the next moment according to the first prediction candidate value, the second prediction candidate value, and a weighting value, where the weighting value is used to indicate the proportion of the first prediction candidate value and the second prediction candidate value.

2. The method according to claim 1, wherein After determining the predicted value of the CPU utilization rate at the next moment according to the first prediction candidate value, the second prediction candidate value, and the weighting value, the method further includes: Obtain the actual value of the CPU utilization rate at the next moment; Adjust the weighting value by using the actual value and the predicted value.

3. The method according to claim 2, wherein Determining the first prediction candidate value of the CPU utilization rate at the next moment according to the continuous operation data includes: according to the continuous operation data, using a continuous data model to determine the first prediction candidate value of the CPU utilization rate at the next moment; Determining the second prediction candidate value of the CPU utilization rate at the next moment according to the periodic operation data includes: according to the periodic operation data, using a periodic data model to determine the second prediction candidate value of the CPU utilization rate at the next moment.

4. The method according to claim 3, characterized in that, After obtaining the actual value of the CPU utilization rate at the next moment, the method further includes: Adjust the parameters of the continuous data model and the periodic data model by using the actual value and the predicted value.

5. The method according to claim 3 or 4, characterized in that, Before obtaining the continuous operation data of the continuous time period before the current moment, the method further includes: Obtain the weighting value by any one of the following methods: Set the weighting value; Adjust the weighting value according to the performance parameters of the continuous data model and the periodic data model; Adjust the weighting value according to the CPU utilization rate prediction errors of the continuous data model and the periodic data model.

6. The method according to claim 3 or 4, characterized in that, Determining the predicted value of the CPU utilization rate at the next moment according to the first prediction candidate value, the second prediction candidate value, and the weighting value includes: Input the first prediction candidate value determined by the continuous data model and the second prediction candidate value determined by the periodic data model into a pre-trained meta-model, and output the predicted value.

7. The method according to any one of claims 1 to 4, characterized in that After determining the predicted value of the CPU utilization rate at the next moment according to the first prediction candidate value, the second prediction candidate value, and the weighting value, the method further includes: When at least one of the following situations is detected, output an alarm prompt message: The system operation parameters exceed the target threshold, where the system operation parameters include the predicted value; There is an abnormality in the log information; The process status is abnormal.

8. A device for predicting CPU utilization, characterized in that, Including: A first obtaining unit, configured to obtain the continuous operation data of a continuous time period before the current moment, and determine a first prediction candidate value of the CPU utilization rate at the next moment according to the continuous operation data; A second acquisition unit, configured to acquire periodic operation data at a periodic repetition moment of the current moment, and determine a second predicted candidate value of the CPU utilization rate at the next moment according to the periodic operation data; A determination unit, configured to determine a predicted value of the CPU utilization rate at the next moment according to the first predicted candidate value, the second predicted candidate value, and a weighting value, where the weighting value is used to indicate the proportion of the first predicted candidate value and the second predicted candidate value.

9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.