CPU occupancy prediction method and system based on neural network

By clustering the CPU occupancy sequence and training an LSTM model, and combining the importance and consistency values ​​of the IMF components, the misjudgment problem in CPU occupancy prediction was solved, achieving higher accuracy in prediction.

CN121900980AInactive Publication Date: 2026-04-21SHENZHEN FRIENDCOM TECH DEV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN FRIENDCOM TECH DEV
Filing Date
2026-03-24
Publication Date
2026-04-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing CPU utilization prediction methods are prone to misjudging similar operating modes, resulting in inaccurate predictions and an inability to accurately identify truly homogeneous operating states.

Method used

By clustering the CPU occupancy sequence, training the LSTM model corresponding to each cluster, and calculating the fusion residual vector, key features are extracted using 1D-CNN and EMD decomposition. Combined with the importance and consistency values ​​of the IMF components, a comprehensive prediction value is generated.

Benefits of technology

It improves the accuracy of CPU utilization prediction, enabling higher prediction accuracy under various operating conditions, and enhances the deep understanding of system operating status and intelligent reasoning capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121900980A_ABST
    Figure CN121900980A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing, in particular to a CPU occupancy prediction method and system based on a neural network, and the method comprises the steps: obtaining a target sequence of the CPU occupancy of a target electric energy meter, dividing the target sequence into a plurality of first windows and a current window containing a current moment according to a preset window length, clustering the first window to obtain a plurality of clusters; training an LSTM (Long Short Term Memory) model corresponding to each cluster; and calculating a fusion residual vector between the current window and each cluster, inputting the current window and the fusion residual vector between the current window and each cluster into the trained LSTM model, outputting a predicted value of the CPU occupancy at the next moment, and fusing predicted values output by all the LSTM models to obtain a comprehensive predicted value. According to the method, the most suitable model can be called for reasoning according to the mode to which the current state belongs or approaches, so that the prediction system can realize higher prediction precision under various typical working conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing. In particular, it relates to a method and system for predicting CPU utilization based on neural networks. Background Technology

[0002] With the deepening of smart grid construction, the software systems of electricity meters are becoming increasingly complex. Their CPUs (Central Processing Units), as the core processors, have limited processing power. Under high load scenarios, excessively high CPU utilization can lead to serious problems such as data transmission interruptions and metering delays, directly affecting the real-time performance and accuracy of grid dispatching, and potentially even triggering risks in the power supply chain. Therefore, accurately predicting the CPU utilization of electricity meters, providing early warnings of potential overload risks, and assisting the grid dispatch center in optimizing the allocation of power resources have significant engineering implications and practical value.

[0003] Currently, traditional CPU utilization prediction methods typically only calculate the macroscopic morphological similarity (such as Euclidean distance) of CPU utilization sequences across different time windows when identifying similar operating patterns. However, as a macroscopic aggregation indicator, the similarity in CPU sequences may correspond to completely different internal software task execution logic. Ignoring the measurement of the similarity in the system's internal dynamic behavior can easily lead to pattern misjudgment and fail to accurately identify truly homogeneous operating states.

[0004] Therefore, existing CPU utilization prediction methods are prone to misjudging patterns, leading to inaccurate predictions. Summary of the Invention

[0005] To address the technical problem of inaccurate predictions due to the existence of easily misjudged patterns in the aforementioned CPU utilization prediction methods, this invention provides solutions in the following aspects.

[0006] In the first aspect, a CPU occupancy prediction method based on a neural network includes: The target sequence of CPU occupancy of the target energy meter is obtained. The target sequence is divided into multiple first windows and a current window containing the current time according to the preset window length. The first windows are clustered to obtain multiple clusters. Train the LSTM model corresponding to each cluster; Calculate the fusion residual vector between the current window and each cluster, input the current window and the fusion residual vector between the current window and each cluster into the trained LSTM model, output the predicted value of CPU utilization at the next time step, and fuse the predicted values ​​output by all LSTM models to obtain the comprehensive predicted value. The training of the LSTM model corresponding to each cluster includes: dividing the target sequence into multiple second windows according to a preset window length; inputting a single second window into a pre-trained 1D-CNN model and outputting the predicted CPU occupancy rate of the second window at the next time step; calculating the difference between the measured and predicted CPU occupancy rates of the target energy meter to form a residual sequence; performing EMD decomposition on the residual sequence to obtain multiple IMF components; calculating the importance value of the IMF components based on the total energy, spectrum, and mutual information between the IMF components and the residual sequence; calculating the consistency value between the first window and each cluster based on the importance value, the first window, and each IMF component; calculating the fusion residual vector between the first window and each cluster based on the importance value, the consistency value, the first window, and each IMF component; and for each cluster, using each first window within the cluster and the fusion residual vector between the first window and each cluster as input to train the LSTM model.

[0007] Preferably, the training process of the 1D-CNN model includes: selecting energy meters of the same region and model as the target energy meter as historical energy meters, and obtaining historical sequences of CPU occupancy of historical energy meters; dividing the historical sequence into multiple historical windows according to a preset historical window length; inputting the historical sequence segment of CPU occupancy of a single historical window, outputting the predicted value of CPU occupancy at the next moment of the historical window, and using mean squared error as the loss function to train the 1D-CNN model.

[0008] Preferably, the method for clustering the first window includes: calculating the Euclidean distance between two first windows as the first distance; calculating the Euclidean distance between IMF segments of the same IMF component corresponding to two first windows as the second distance, and summing the second distances corresponding to all IMF components to obtain the third distance; calculating the sum of the first distance and the third distance to obtain the comprehensive distance; and performing K-Means clustering on all first windows based on the comprehensive distance to obtain multiple clusters.

[0009] Preferably, the method for calculating the importance value includes: calculating the sum of the squares of the amplitudes of a single IMF component at all time points to obtain the total energy of the IMF component; calculating the average value of all frequency amplitudes based on the spectrum of the IMF component, taking the ratio of each frequency amplitude to the average value as the relative amplitude to obtain the relative amplitude sequence of the IMF component, and calculating the reciprocal of the standard deviation of the relative amplitude sequence; calculating the mutual information value between the IMF component and the residual sequence; calculating the ratio of the total energy of the IMF component to the reciprocal, and taking the product of the ratio and the mutual information value as the importance value.

[0010] Preferably, the method for calculating the consistency value between the first window and each cluster includes: selecting any first window as the target window; for a single first window within a single cluster, calculating the Euclidean distance between the target window and the first window; for a single IMF component, calculating the DTW distance between the target window and the IMF segment of the first window on the IMF component; multiplying the DTW distance by the importance value of the IMF component as the first product; calculating the sum of the first products corresponding to all IMF components; and multiplying the sum by the aforementioned Euclidean distance as the second product; summing the second products corresponding to each first window within the cluster; and performing negative correlation normalization on the obtained sum to obtain the consistency value.

[0011] Preferably, the method for calculating the fusion residual vector between the first window and each cluster includes: selecting any moment of the target window as the target point; for a single IMF component, obtaining the amplitude of the IMF component at the target point; for a single cluster, calculating the weighted historical reference value of the IMF component in the cluster; calculating the average of the weighted historical reference value and the aforementioned amplitude as the first average value; calculating the ratio of the importance value of the IMF component to the average of the importance values ​​of all IMF components; multiplying the ratio by the first average value to obtain the third product; summing the third products corresponding to all IMF components to obtain the fusion residual value of the target point; and forming the fusion residual vector from the fusion residual values ​​of all target points.

[0012] Preferably, the method for calculating the weighted historical reference value includes: for a single first window in a single cluster, calculating the ratio of the consistency value between the target window and the first window to the comprehensive distance between the target window and the first window, as the weight; for a single IMF component, obtaining the amplitude of the IMF component of the first window at the target point, calculating the product of the amplitude and the weight to obtain the fourth product; and summing the fourth products corresponding to all first windows in the cluster to obtain the weighted historical reference value of the single IMF component in the cluster.

[0013] Preferably, the method for obtaining the comprehensive prediction value includes: for a single cluster, calculating the consistency value between the current window and the cluster, multiplying the consistency value by the prediction value output by the LSTM model corresponding to the cluster to obtain the fifth product; summing the fifth products corresponding to all clusters to obtain the comprehensive prediction value.

[0014] Secondly, a CPU occupancy prediction system based on a neural network includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the aforementioned CPU occupancy prediction method based on a neural network is implemented.

[0015] The present invention has the following effects: 1. This invention identifies different operating modes by clustering the first window and trains a dedicated LSTM model. During prediction, the system can call the most suitable model for inference based on the mode to which the current state belongs or is close to, avoiding the averaging and accuracy loss caused by a single model learning all modes. This enables the prediction system to achieve higher prediction accuracy under various typical working conditions.

[0016] 2. In both the training and prediction phases, this invention calculates the fusion residual vector between the window and each cluster for each window. The fusion residual vector integrates the current information with the collective experience of similar historical patterns through a specific algorithm. It is no longer a static data point, but a dynamic feature embedded with rich historical operating context. This allows the LSTM prediction model to not only see the current data, but also perceive whether the current state is typical and reasonable in similar historical situations, providing the model with a decision reference system. This context awareness capability is not available in traditional static input methods, fundamentally enhancing the model's deep understanding of the system's operating state and its intelligent reasoning ability. Attached Figure Description

[0017] Figure 1 This is a flowchart of steps S1-S3 in a CPU occupancy prediction method based on a neural network according to an embodiment of the present invention.

[0018] Figure 2 This is a schematic diagram of steps S20-S23 in a CPU occupancy prediction method based on a neural network according to an embodiment of the present invention. Detailed Implementation

[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0020] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0021] Reference Figure 1 A CPU occupancy prediction method based on neural networks includes steps S1-S3, as detailed below: S1: Obtain the target sequence of CPU occupancy of the target energy meter, divide the target sequence into multiple first windows and the current window containing the current time according to the preset window length, and cluster the first windows to obtain multiple clusters.

[0022] Before clustering the first window, it is necessary to use a 1D-CNN (One-Dimensional Convolutional Neural Network) model to learn the general variation of historical CPU utilization in order to generate key features (residuals and IMF components) for cluster analysis.

[0023] The training process of the 1D-CNN model includes: In a cluster of electricity meters of the same model and location as the target electricity meter, one electricity meter is randomly selected as a historical electricity meter. The CPU internal registers of the historical electricity meter are read to collect the complete CPU occupancy from the start to the end of operation, forming a historical sequence of CPU occupancy. The historical sequence is then subjected to a Fourier transform to obtain its spectrum. The fundamental frequency is extracted, and its reciprocal is used as the historical window length. Based on this historical window length, the historical sequence is divided into sliding windows with a step size of 1, resulting in multiple historical windows. Historical windows shorter than the required length are filled using linear interpolation. Each historical window is used as a training sample to train the 1D-CNN model. The input is a historical sequence segment of CPU occupancy for a single historical window, and the output is a predicted value of the CPU occupancy at the next moment of that historical window. The mean squared error is used as the loss function to obtain the trained 1D-CNN model.

[0024] By reading the CPU internal registers of the target energy meter, the CPU utilization rate of the target energy meter from the start of device operation to the current moment is collected, forming a target sequence of CPU utilization. A Fourier transform is performed on the target sequence to obtain its spectrum. The fundamental frequency is extracted, and the reciprocal of the fundamental frequency is used as a preset window length. Based on this window length, the target sequence is divided into multiple second windows with a sliding window step size of 1. The target sequence segment of CPU utilization from a single second window is input into a trained 1D-CNN model, which outputs the predicted value of CPU utilization for the next time step of the second window.

[0025] The measured CPU utilization rate of the target energy meter is obtained, and the difference between the measured CPU utilization rate and the predicted CPU utilization rate at the corresponding time is calculated as the residual value, thus obtaining the residual sequence of the target energy meter. EMD (Empirical Mode Decomposition) is performed on the residual sequence to obtain several IMF (Intrinsic Mode Function) components and residual terms.

[0026] The target sequence is divided into multiple non-overlapping, time-continuous first windows and a current window containing the current time, all with the same window length. Each IMF component is further divided into multiple non-overlapping, time-continuous IMF segments, also with the same window length. Each first window corresponds to an IMF segment for each IMF component within a given time period. K-Means clustering is used to cluster the first windows. The specific clustering process is as follows: The Euclidean distance between two first windows is calculated as the first distance; the Euclidean distance between IMF segments of the same IMF component corresponding to two first windows is calculated as the second distance, and the second distances for all IMF components are summed to obtain the third distance; the sum of the first and third distances is calculated to obtain the comprehensive distance between two first windows; K-Means clustering is then performed on all first windows based on the comprehensive distance between them, resulting in multiple clusters. The number of clusters can be determined using conventional techniques (such as the elbow rule).

[0027] By preprocessing with 1D-CNN, the input (residual sequence) to EMD decomposition has been stripped of strong background trends, allowing the decomposed IMF components to more purely and directly reflect the deviation of the current state from historical general patterns, i.e., the abnormal or specific behavioral patterns of the system. Based on this, clustering and consistency value calculations based on IMF components can more accurately identify operating patterns that are essentially similar in internal dynamic behavior, avoiding misjudgments caused solely by accidental similarity in macroscopic load curves.

[0028] S2: Train the LSTM model corresponding to each cluster.

[0029] Step S2 includes steps S20-S23, as follows: S20: Calculate the importance value of each IMF component based on the total energy of the IMF component, the spectrum of the IMF component, and the mutual information value between the IMF component and the residual sequence.

[0030] The method for calculating the importance value of each IMF component includes: for a single IMF component, calculating the square of its amplitude at each time point, and summing the squares of the amplitudes at all time points to obtain the total energy of the IMF component; performing a Fourier transform on the IMF component to obtain its spectrum, calculating the average value of all frequency amplitudes based on the spectrum, and using the ratio of each frequency amplitude to the aforementioned average value as the relative amplitude to obtain the relative amplitude sequence of the IMF component, and calculating the reciprocal of the standard deviation of the relative amplitude sequence; calculating the mutual information value between the IMF component and the residual sequence, the calculation process of which is existing technology and will not be elaborated further; calculating the ratio of the total energy of the IMF component to the aforementioned reciprocal, and multiplying this ratio by the mutual information value as the importance value of the IMF component. The specific formula is as follows: In the formula, Indicates the first The importance value of each IMF component; Indicates the first The total energy of each IMF component; Indicates the first The reciprocal of the standard deviation of the amplitude sequence of each IMF component; Indicates the first The mutual information value between each IMF component and the residual sequence.

[0031] Reflecting the overall oscillation intensity of this IMF component, The larger the value, the more active the IMF component is in the signal and the higher the energy it contributes; therefore, its importance value should be greater. This reflects the degree of concentration of the energy distribution of the IMF component in the frequency domain. A larger value means a smaller standard deviation of the relative amplitude sequence, indicating a more uniform and dispersed energy distribution in the frequency domain. This is typically a characteristic of broadband noise. The larger the value, the more likely the component is to be noise, and the smaller its importance value should be. This reflects the information correlation between the IMF component and the residual sequence, i.e., the amount of information they share. The larger the value, the closer the fluctuation pattern of the IMF component is to the abnormal behavior of the system as a whole, and the more likely it is to be a key signal reflecting the core dynamics of the system. Therefore, its importance value should be greater.

[0032] After obtaining the importance value of each IMF component, all IMF components are sorted in descending order of importance value, and the cumulative importance value is calculated. The number of IMF components whose cumulative importance value reaches 90% of the total importance value is retained for subsequent analysis. For ease of understanding, an example is provided: For instance, there are a total of 5 IMF components: The importance values ​​of the five IMF components are arranged in descending order as follows: ; ; ; ; The process of calculating the cumulative importance value is as follows: the first cumulative importance value is... The first cumulative importance value is The third cumulative importance value is The fourth cumulative importance value is The fifth cumulative importance value is That is, the total importance value 90% of the total importance value is Find the first one that is greater than or equal to The cumulative importance value, i.e., the fourth cumulative importance value, is then retained. .

[0033] It retains the main components that explain 90% of the information, automatically filters out components that contribute very little (these components are likely noise or irrelevant details), reduces the computational load of subsequent steps, and maintains prediction accuracy.

[0034] S21: Calculate the consistency value between each first window and each cluster based on the importance value, the first window, and the IMF segments of the first window on each IMF component.

[0035] Select any first window as the target window and calculate the consistency value between the target window and a single cluster: For a single first window within the cluster, calculate the Euclidean distance between the target window and the first window; for a single IMF component, calculate the DTW (Dynamic Time Warping) distance between the target window and the IMF segment of the first window on that IMF component. Multiply the DTW distance by the importance value of the IMF component as the first product. Calculate the sum of the first products corresponding to all IMF components, and multiply this sum by the aforementioned Euclidean distance as the second product. Add the second products corresponding to each first window within the cluster, and perform negative correlation normalization on the resulting sum to obtain the consistency value between the target window and the cluster. This can be expressed by the following formula: In the formula, Indicates the target window and the first The degree of consistency between clusters; Indicates the first The total number of first windows within each cluster; Indicates the target window and the first Within the cluster, the th Euclidean distance between the first windows; This represents the total number of IMF components, specifically the total number of IMF components retained in step S20 by calculating the cumulative importance value. Indicates the first The importance value of each IMF component; Indicates the target window and the first Within the cluster, the th The first window in DTW distance between IMF segments on each IMF component; Represented by natural numbers An exponential function with base 1.

[0036] The larger the value, the less similar the two IMF segments are in waveform shape, meaning the greater the difference in their internal dynamic behavior. Therefore, the consistency value should be reduced. The importance value of the IMF components should be used to... By weighting, it is ensured that the more important the component, the greater its DTW distance contributes to the overall difference; The larger the value, the less similar the target window and the first window within the cluster are at the macroscopic load level, therefore the consistency value should be reduced.

[0037] Similarly, the consistency value between any first window as the target window and all clusters can be obtained. Traditional methods typically only calculate the macroscopic morphological distance (such as Euclidean distance) of CPU utilization sequences, ignoring the dynamic details of internal task scheduling, and easily misclassifying windows that are similar in appearance but different in essence as the same pattern. This method introduces a microscopic dynamic similarity measure based on the DTW distance of IMF components, and combines it with the importance weight of the components for weighting, ensuring that only when two windows are highly similar in overall load level and internal task execution mode will they be judged to have high consistency, significantly improving the accuracy of pattern recognition.

[0038] S22: Calculate the fusion residual vector between each first window and each cluster based on the importance value, consistency value, first window, and IMF segments of the first window on each IMF component.

[0039] Select any first window as the target window, and any moment within the target window as the target point. For a single IMF component, obtain the amplitude of the IMF component at the target point. For a single cluster, calculate the weighted historical reference value of the IMF component in that cluster. Calculate the average of the weighted historical reference value and the aforementioned amplitude, using this as the first average value. Calculate the ratio of the importance value of the IMF component to the average of the importance values ​​of all IMF components. Multiply this ratio by the first average value to obtain the third product. Add the third products corresponding to all IMF components to obtain the fusion residual value between the target window and the single cluster at the target point. The fusion residual values ​​of all target points form a fusion residual vector.

[0040] The method for calculating the weighted historical reference value of the IMF component in a single cluster includes: for a single first window in a single cluster, obtaining the consistency value between the target window and the first window and the comprehensive distance between the target window and the first window (the same method as calculating the comprehensive distance between two first windows during clustering in step S1), calculating the ratio of the aforementioned consistency value to the comprehensive distance as the weight; aligning the target window and the first window end to end, for a single IMF component, obtaining the amplitude of the IMF component of the first window at the target point, calculating the product of the amplitude and the weight to obtain the fourth product; summing the fourth products corresponding to all first windows in the cluster to obtain the weighted historical reference value of the single IMF component in the cluster.

[0041] The formula for calculating the fusion residual value between the target window and a single cluster at the target point is as follows: In the formula, Indicates the target window and the first Clusters at the target point The fusion residual value; This represents the total number of all IMF components, i.e., the total number of IMF components retained in step S20 by calculating the cumulative importance value; Indicates the first The importance value of each IMF component; This represents the average importance value of all IMF components; This indicates that the target window is at the target point. The first The amplitude of each IMF component; Indicates the first The IMF component in the first The weighted historical reference value of each cluster.

[0042] Reflects the first The relative importance of each IMF component This indicates that the importance of this IMF component is higher than the average level of all IMF components. It is a key signal that can better characterize the dynamics of the system. Therefore, it has a higher weight and makes a greater contribution in the calculation of the fused residual value. If the value is less than the average level of all IMF components, then the contribution of that IMF component is reduced accordingly.

[0043] In the formula, Indicates the first The IMF component in the first Weighted historical reference values ​​for each cluster; Indicates the first The total number of first windows in each cluster; Indicates the target window and the first The consistency value of each cluster; Indicates the target window and the first The first cluster of the cluster The combined distance of the first window; Indicates the first The first cluster of the cluster The first window at the target point The first The amplitude of each IMF component.

[0044] This reflects the relationship between the target window and the first cluster. The similarity of the first window, The larger the value, the more likely it is to be the first element in the target window. Clusters ( Under the premise of (large), with the first in the cluster The shapes of the first windows are highly similar ( (small), therefore, this first window provides a reference value for that IMF component. Higher credibility should be given greater weight, and its contribution to the fusion residual value is also greater.

[0045] The calculation of the fusion residual value is dominated by the key signal component. Weighted), and deeply integrated with highly similar historical experiences ( (Weighted), thus forming an enhanced feature that reflects the current state and is embedded in the historical context.

[0046] Similarly, the fusion residual vector between any first window and all clusters can be obtained when any first window is used as the target window. Traditional methods rely solely on isolated data sequences at the current time or window as input, lacking a historical reference system for judging the rationality of the current state. This method, however, uses the residual of the current state (…) ) and weighted, filtered residuals from similar historical patterns ( By fusing these features, enhanced features rich in historical operational context are generated, enabling the prediction model not only to acquire current information but also to perceive the performance of the current state in similar historical contexts, thereby conducting in-depth reasoning and greatly improving the model's ability to interpret operational states.

[0047] S23: For each cluster, use each first window within the cluster and the fusion residual vector between the first window and each cluster as input to train the LSTM model.

[0048] After obtaining the fusion residual vector between any first window as the target window and all clusters in step S22, for a single cluster, the single first window within that cluster and the fusion residual vector between that first window and each cluster are used as input, and the predicted CPU utilization of the first window at the next time step is used as output. The mean squared error is used as the loss function to train an LSTM (Long Short-Term Memory) model, thus obtaining the LSTM model corresponding to that cluster. Similarly, the LSTM model corresponding to each cluster can be obtained.

[0049] S3: Calculate the fusion residual vector between the current window and each cluster. Input the current window and the fusion residual vector between the current window and each cluster into the trained LSTM model, output the predicted value of CPU utilization at the next time step, and fuse the predicted values ​​output by all LSTM models to obtain the comprehensive predicted value.

[0050] The calculation method for the fusion residual vector between the current window and each cluster is the same as the calculation method for the fusion residual vector between the target window and each cluster, and will not be repeated here.

[0051] The sequence of CPU utilization corresponding to the current window and the fusion residual vector between the current window and each cluster are used as inputs to the LSTM model corresponding to each cluster. Each LSTM model outputs a predicted value of CPU utilization. The predicted values ​​output by all LSTM models are fused to obtain a comprehensive predicted value.

[0052] The method for obtaining the comprehensive predicted value includes: for a single cluster, calculating the consistency value between the current window and that cluster, multiplying the consistency value by the predicted value output by the LSTM model corresponding to that cluster to obtain the fifth product; summing the fifth products corresponding to all clusters to obtain the comprehensive predicted value. The specific formula is as follows: In the formula, This represents the overall forecast value; This represents the total number of clusters. Indicates the current window and the first The consistency value of each cluster; Indicates the first The predicted CPU utilization value output by the LSTM model corresponding to each cluster.

[0053] By training dedicated LSTM models for different operating modes (clusters), the system dynamically adjusts the decision weights of each model during prediction based on the degree of matching (consistency value) between the current window and each mode. When the current state clearly belongs to a certain mode, the output of the model corresponding to that mode dominates. When the state is between multiple modes, the prediction result is a reasonable fusion of the outputs of multiple models, enabling the prediction system to adaptively fit the current real-time operating situation of the equipment, thereby achieving high-precision prediction under various working conditions.

[0054] After obtaining predicted CPU utilization values ​​at multiple times, a prediction sequence is formed. Based on the prediction sequence, the load peak and trend for a future period can be predicted. Before the load peak arrives, resource preparation suggestions are sent to the management system to help optimize resource allocation.

[0055] This application also discloses a CPU occupancy prediction system based on a neural network. The system includes a processor and a memory. The memory stores computer program instructions. When the computer program instructions are executed by the processor, the CPU occupancy prediction method based on a neural network according to the above embodiments of the present invention is implemented.

[0056] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

[0057] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A CPU occupancy prediction method based on neural networks, characterized in that, include: Obtain the target sequence of CPU occupancy of the target energy meter, divide the target sequence into multiple first windows and a current window containing the current time, and cluster the first windows to obtain multiple clusters; Train the LSTM model corresponding to each cluster; Calculate the fusion residual vector between the current window and each cluster, input the current window and the fusion residual vector between the current window and each cluster into the trained LSTM model, output the predicted value of CPU utilization at the next time step, and fuse the predicted values ​​output by all LSTM models to obtain the comprehensive predicted value. The training of the LSTM model corresponding to each cluster includes: dividing the target sequence into multiple second windows through sliding partitioning; inputting the second windows into the trained 1D-CNN model and outputting the predicted CPU occupancy rate of the second window at the next time step; calculating the difference between the measured and predicted CPU occupancy rates of the target electricity meter to form a residual sequence; decomposing the residual sequence into multiple IMF components through EMD; calculating the importance value of the IMF components based on the total energy, spectrum, and mutual information between the IMF components and the residual sequence; calculating the consistency value between the first window and each cluster based on the importance value, the first window, and each IMF component; calculating the fusion residual vector between the first window and each cluster based on the importance value, the consistency value, the first window, and each IMF component; and for each cluster, using each first window within the cluster and the fusion residual vector between the first window and each cluster as input to train the LSTM model.

2. The CPU occupancy prediction method based on a neural network according to claim 1, characterized in that, The training process of the 1D-CNN model includes: selecting electricity meters of the same region and model as the target electricity meter as historical electricity meters, and obtaining historical sequences of CPU occupancy of historical electricity meters; dividing the historical sequence into multiple historical windows according to the preset historical window length; inputting the historical sequence segment of CPU occupancy of a single historical window, outputting the predicted value of CPU occupancy at the next moment of the historical window, using mean squared error as the loss function, and training the 1D-CNN model.

3. The CPU occupancy prediction method based on a neural network according to claim 1, characterized in that, The method for clustering the first window includes: calculating the Euclidean distance between two first windows as the first distance; calculating the Euclidean distance between the IMF segments of the same IMF component corresponding to the two first windows as the second distance, and summing the second distances corresponding to all IMF components to obtain the third distance; calculating the sum of the first distance and the third distance to obtain the comprehensive distance; and performing K-Means clustering on all first windows based on the comprehensive distance to obtain multiple clusters.

4. The CPU occupancy prediction method based on a neural network according to claim 1, characterized in that, The method for calculating the importance value includes: calculating the sum of the squares of the amplitudes of a single IMF component at all time points to obtain the total energy of the IMF component; calculating the average value of all frequency amplitudes based on the spectrum of the IMF component, taking the ratio of each frequency amplitude to the average value as the relative amplitude to obtain the relative amplitude sequence of the IMF component, and calculating the reciprocal of the standard deviation of the relative amplitude sequence; calculating the mutual information value between the IMF component and the residual sequence; calculating the ratio of the total energy of the IMF component to the reciprocal, and taking the product of the ratio and the mutual information value as the importance value.

5. The CPU occupancy prediction method based on a neural network according to claim 1, characterized in that, The method for calculating the consistency value between the first window and each cluster includes: selecting any first window as the target window; for a single first window within a single cluster, calculating the Euclidean distance between the target window and the first window; for a single IMF component, calculating the DTW distance between the target window and the IMF segment of the first window on the IMF component; multiplying the DTW distance by the importance value of the IMF component as the first product; calculating the sum of the first products corresponding to all IMF components; and multiplying the sum by the aforementioned Euclidean distance as the second product; summing the second products corresponding to each first window within the cluster; and performing negative correlation normalization on the obtained sum to obtain the consistency value.

6. The CPU occupancy prediction method based on a neural network according to claim 5, characterized in that, The calculation method for the fusion residual vector between the first window and each cluster includes: selecting any moment of the target window as the target point; for a single IMF component, obtaining the amplitude of the IMF component at the target point; for a single cluster, calculating the weighted historical reference value of the IMF component in the cluster; calculating the average of the weighted historical reference value and the aforementioned amplitude as the first average value; calculating the ratio of the importance value of the IMF component to the average of the importance values ​​of all IMF components; multiplying the ratio by the first average value to obtain the third product; summing the third products corresponding to all IMF components to obtain the fusion residual value of the target point; and forming the fusion residual vector from the fusion residual values ​​of all target points.

7. The CPU occupancy prediction method based on a neural network according to claim 6, characterized in that, The method for calculating the weighted historical reference value includes: for a single first window in a single cluster, calculating the ratio of the consistency value between the target window and the first window to the comprehensive distance between the target window and the first window, as the weight; for a single IMF component, obtaining the amplitude of the IMF component of the first window at the target point, calculating the product of the amplitude and the weight to obtain the fourth product; and summing the fourth products corresponding to all first windows in the cluster to obtain the weighted historical reference value of the single IMF component in the cluster.

8. The CPU occupancy prediction method based on a neural network according to claim 1, characterized in that, The method for obtaining the comprehensive prediction value includes: for a single cluster, calculating the consistency value between the current window and the cluster, multiplying the consistency value by the prediction value output by the LSTM model corresponding to the cluster to obtain the fifth product; summing the fifth products corresponding to all clusters to obtain the comprehensive prediction value.

9. A CPU occupancy prediction system based on neural networks, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the CPU occupancy prediction method based on a neural network according to any one of claims 1-8.