Intelligent prediction method, system and equipment for power load of power grid, and medium
By performing multi-scale feature decomposition and enhancement on power load data, combined with the self-attention mechanism and dynamic residual network, the problem of multi-scale feature capture in power load forecasting is solved, and high-precision and efficient power load forecasting is achieved.
Patent Information
- Application Number
- CN202511026752.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies are unable to accurately capture the multi-scale characteristics of power loads, resulting in inaccurate power load forecasts.
By decomposing power load data into trend component, periodic component and random fluctuation component, a learnable nonlinear transformation and position encoding enhanced self-attention mechanism are adopted, combined with a dynamic self-correcting residual network and a hierarchical Bayesian hyperparameter optimization module to capture multi-scale features and make predictions.
It has achieved accurate prediction of power load, improved prediction accuracy and stability, especially under extreme weather and special event conditions, the prediction accuracy has been significantly improved and the computing efficiency has been improved.
Smart Images

Figure CN120807219A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power distribution network transmission optimization, and particularly relates to a power grid power load intelligent prediction method, system, device and medium. BACKGROUND
[0002] Power load prediction is a key link in the construction of smart grids and energy management systems, and is of great significance to the safe and stable operation, economic dispatch and demand side management of power systems. Accurate power load prediction can help power companies to reasonably arrange power generation plans, optimize power grid operation, reduce operating costs, and improve the reliability and stability of power supply. At present, with the deepening of power market reform and smart grid construction, power load prediction is facing increasingly complex challenges. On the one hand, power consumption patterns are becoming more diversified and personalized, and electricity load is affected by many factors, including weather conditions, seasonal changes, economic activities, social events, etc. On the other hand, large-scale access of renewable energy to the power grid brings greater uncertainty to the operation of the power grid, and higher requirements for the accuracy of load prediction.
[0003] At present, the main means for predicting power load are prediction based on traditional statistical principles and intelligent prediction based on machine learning. Prediction based on traditional statistical principles describes the load variation law through mathematical formulas. However, statistical models are mainly designed for linear relationships and will have difficulty in accurately predicting complex nonlinear relationships in power load. Intelligent prediction based on machine learning mainly includes support vector regression, random forest tree, gradient boosting tree and shallow neural network. However, this type of means usually relies too much on artificial features and lacks the ability of automatic feature extraction, making it difficult to better predict power load.
[0004] In view of the problems existing in prediction based on traditional statistical principles and intelligent prediction based on machine learning, deep learning driven prediction is used at present. Deep learning driven prediction mainly includes long short-term memory network (LSTM), hybrid structure of convolutional neural network and recurrent network, and enhanced network based on attention mechanism. However, these networks mostly only focus on features in a single dimension, making it difficult to accurately capture the multi-scale features of power load and thus difficult to predict power load. SUMMARY
[0005] The embodiments of the present application provide a power grid power load intelligent prediction method, system, device and medium, which can solve the problem in the prior art that the existing technology cannot accurately capture the multi-scale features of power load, thereby making it difficult to predict power load.
[0006] The embodiments of the present application provide a power grid power load intelligent prediction method, which comprises the following steps: Obtaining power load data of a smart grid, decomposing the power load data into a trend component, a periodic component, and a random fluctuation component; Through a learnable nonlinear transformation, the importance of the trend component, the periodic component, and the random fluctuation component is dynamically evaluated to obtain a feature importance weight of each component, and the feature importance weight is multiplied by the corresponding component to obtain a trend feature, a periodic feature, and a random fluctuation feature after feature dimension enhancement; Through a position encoding enhanced self-attention mechanism, key moments in the time series of each component are captured to obtain a time attention weight of each component, and the time attention weight is multiplied by the corresponding component to obtain a trend feature, a periodic feature, and a random fluctuation feature after time dimension enhancement. The trend feature, the periodic feature, and the random fluctuation feature after feature dimension enhancement and time dimension enhancement are correspondingly fused to obtain enhanced trend features, periodic features, and random fluctuation features. Through a residual modulation function, the attention degree of long-term sequences in the enhanced trend feature, the attention degree of short-term sequences in the enhanced periodic feature, and the attention degree of fluctuation sequences in the enhanced random fluctuation feature in extraction are improved. Long-term prediction values, short-term prediction values, and fluctuation prediction values are extracted, and the long-term prediction values, the short-term prediction values, and the fluctuation prediction values are added to obtain a power load prediction value.
[0007] Preferably, the power load prediction value is obtained through a power grid power load prediction model; the power grid power load prediction model comprises a double-layer cascaded attention architecture, a dynamic self-correcting residual network, and a hierarchical Bayesian hyperparameter optimization module. The double-layer cascaded attention architecture comprises cascaded feature channel attention layers and time series attention layers, and a feedback regulation loop; the dynamic self-correcting residual network comprises a trainable gating unit added between the input and the output of an LSTM layer of an LSTM network, and a residual modulation function integrated between LSTM layers of the LSTM network. The hierarchical Bayesian hyperparameter optimization module divides the hyperparameters of the power grid power load prediction model into three levels of network structure parameters, optimization algorithm parameters, and regularization parameters, for automatic tuning of the hyperparameters. The outputs of the feature channel attention layers and the time series attention layers are the inputs of the feedback regulation loop, and the output of the feedback regulation loop is the input of the LSTM network, and the LSTM network outputs the power load prediction value.
[0008] Preferably, the decomposition of the power load data into the trend component, the periodic component, and the random fluctuation component comprises: Performing empirical mode decomposition EMD on the power load data X(t) of the smart grid to obtain a plurality of intrinsic mode functions IMF and a residual term r(t). A low-frequency IMF component and a residual term r(t) are selected by spectrum analysis to obtain a preliminary trend component T1(t); the preliminary trend component T1(t) is decomposed by a wavelet to extract a low-frequency coefficient as a final trend component T(t); A Fourier transform is performed on the detrended sequence X'(t) = X(t) - T(t) to obtain a frequency domain representation F(ω); a periodic component corresponding to a main frequency in F(ω) is identified, and the periodic component includes a daily cycle, a weekly cycle, a monthly cycle, and an annual cycle; The daily cycle component, the weekly cycle component, the monthly cycle component, and the annual cycle component are combined to obtain a periodic component through a band-pass filter to extract the daily cycle component, the weekly cycle component, the monthly cycle component, and the annual cycle component; A random fluctuation component is obtained by subtracting the trend component T(t) and the periodic component from the smart grid power load data X(t).
[0009] Preferably, the acquisition of the trend feature, the periodic feature, and the random fluctuation feature after feature dimension enhancement includes: For the trend component, the periodic component, and the random fluctuation component, a feature channel attention layer performs global average pooling and maximum pooling on the input feature X e R^(N x T x F) to obtain two channel descriptors F avg and F max , F avg and F max are tensors of N x 1 x F dimensions; F avg and F max are input into a shared multi-layer perception MLP to obtain feature importance weights of each component, and the feature importance weights are multiplied by the corresponding components to obtain the trend feature, the periodic feature, and the random fluctuation feature after feature dimension enhancement.
[0010] Preferably, the acquisition of the trend feature, the periodic feature, and the random fluctuation feature after time dimension enhancement includes: For the trend component, the periodic component, and the random fluctuation component, a time series attention layer performs feature channel attention processing on each component, and adds position encoding to the output after the feature channel attention processing to obtain an X pos tensor; A query Q, a key K, and a value V matrix are calculated, and combined with the X pos tensor to calculate time attention weights of each component, and the time attention weights are multiplied by the corresponding components to obtain the trend feature, the periodic feature, and the random fluctuation feature after time dimension enhancement.
[0011] Preferably, the obtaining of the trend feature, the periodic feature, and the random fluctuation feature after enhancement includes: In the corresponding fusion of the trend feature, the periodic feature and the random fluctuation feature after the feature dimension enhancement and the time dimension enhancement, the trend feature after the feature dimension enhancement and the time dimension enhancement, the periodic feature after the feature dimension enhancement and the time dimension enhancement, and the random fluctuation feature after the feature dimension enhancement and the time dimension enhancement are respectively fused; The features are divided into multiple heads, each head independently calculates attention, and each head simultaneously calculates cross-attention of features to time and time to features, denoted as: ; Wherein: C f→t denotes the cross-attention output of features to time; C t→f denotes the cross-attention output of time to features; Q f denotes the query matrix of the feature dimension; K t denotes the key matrix of the time dimension; V t denotes the value matrix of the time dimension; Q t denotes the query matrix of the time dimension; K f denotes the key matrix of the feature dimension; d denotes the scaled dot product; softmax denotes the activation function; The cross-attention outputs of features to time and time to features are fused to obtain the enhanced trend feature, the periodic feature and the random fluctuation feature, and the fusion of the cross-attention outputs is denoted as: ; Wherein: X cross denotes the fused cross-attention result; Concat(·) denotes the splicing operation of the outputs of multiple heads; C 1、 C 2、…、 C h denote the cross-attention outputs of h heads respectively; W O denotes the learnable weight matrix.
[0012] Preferably, the acquisition of the power load prediction value comprises: The residual connection of the trainable gating unit is denoted as: ; Wherein: ht^l denotes the hidden state of the lth layer at t time; g tdenotes a dynamic gating coefficient, g t denotes a dynamic gating coefficient, ; W g denotes a dynamic gating coefficient, b g denotes a learnable parameter, The residual modulation function dynamically adjusts the weight of the residual connection according to the statistical characteristics of the input sequence, and the residual modulation function is expressed as: ; wherein Stat(·) denotes a statistical feature extraction function, M t denotes a modulation factor, W m denotes a learnable parameter, b m denotes a learnable parameter, The long-term prediction value in the trend feature, the short-term prediction value in the periodic feature and the fluctuation prediction value in the random fluctuation feature are extracted by using the LSTM network, the long-term prediction value, the short-term prediction value and the fluctuation prediction value are added, and the power load prediction value is obtained.
[0013] The embodiment of the application further provides a power grid power load intelligent prediction system, comprising: a data acquisition and processing module, used for acquiring power load data of the smart power grid, and decomposing the power load data into a trend component, a periodic component and a random fluctuation component; a prediction module, which dynamically evaluates the importance of the trend component, the periodic component and the random fluctuation component through a learnable nonlinear transformation, obtains a feature importance weight of each component, and multiplies the feature importance weight with the corresponding component to obtain the trend feature, the periodic feature and the random fluctuation feature after feature dimension enhancement; a position coding enhanced self-attention mechanism, which captures key moments in the time sequence of each component, obtains a time attention weight of each component, and multiplies the time attention weight with the corresponding component to obtain the trend feature, the periodic feature and the random fluctuation feature after time dimension enhancement; and The long-term sequence in the enhanced trend feature is paid attention to in extraction by a residual modulation function, the short-term sequence in the enhanced periodic feature is paid attention to in extraction, and the fluctuation sequence in the enhanced random fluctuation feature is paid attention to in extraction, and the long-term prediction value, the short-term prediction value and the fluctuation prediction value are extracted, the long-term prediction value, the short-term prediction value and the fluctuation prediction value are added, and the power load prediction value is obtained.
[0014] The embodiment of the present application also provides an electronic device, comprising a memory and a processor. The memory is used for storing a computer program. The processor is used for executing the computer program stored in the memory, so as to realize the steps of the power grid power load intelligent prediction method.
[0015] The embodiment of the present application also provides a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to realize the steps of the power grid power load intelligent prediction method.
[0016] The embodiment of the present application provides a power grid power load intelligent prediction method, system, device and medium, and has the following beneficial effects compared with the prior art. The power load data is decomposed into a trend component, a periodic component and a random fluctuation component, that is, the power load data is first decomposed into three dimensions in the present application, then the feature channel attention layer evaluates the importance of different components, and the feature is extracted according to the importance, that is, the feature components of three dimensions are extracted from the feature scale in the present application, the time sequence attention layer captures the key moment in the time sequence of each component, and the feature at the key moment is extracted, that is, the feature components of three dimensions are extracted from the time scale in the present application, then the features extracted based on the importance and the features extracted at the key moment are fused through a feedback regulation loop, that is, the features in multiple dimensions and multiple scales of the power load data are captured in the present application, then the fused trend feature, periodic feature and random fluctuation feature are input into the LSTM network with dynamic gated residual connection for prediction, and in the prediction process, the attention degree of the long-term sequence, short-term sequence and fluctuation sequence in different features is improved through a residual modulation function, so that the attention degree of each corresponding feature in multiple dimensions and scales is improved when the features in multiple scales are extracted, so that the power load is accurately captured, the prediction value of the power load is obtained, and the power load is accurately predicted.
[0017] And, the application also provides a hierarchical Bayesian hyperparameter optimization module, which divides the hyperparameters of the power grid power load prediction model into three levels of network structure parameters, optimization algorithm parameters and regularization parameters, and realizes automatic adjustment of the hyperparameters through a hierarchical Bayesian optimization process, thereby improving the model training efficiency and performance. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 A schematic diagram of the overall architecture of the power grid power load intelligent prediction method provided by the embodiment of the application is shown. Figure 2 A schematic diagram of the execution flow of the power grid power load intelligent prediction method provided by the embodiment of the application is shown. Figure 3 A schematic diagram of the cascade adaptive attention mechanism architecture of the power grid power load intelligent prediction method provided by the embodiment of the application is shown. Figure 4 A schematic diagram of the dynamic self-correcting residual network structure of the power grid power load intelligent prediction method provided by the embodiment of the application is shown. DETAILED DESCRIPTION
[0019] To make the above objectives, features and advantages of the application more apparent, specific embodiments of the application are described in detail below with reference to the drawings. In the following description, a large number of specific details are set forth in order to provide a thorough understanding of the application. However, the application can be implemented in many different ways other than those described herein, and those skilled in the art can make similar improvements without departing from the spirit of the application, so the application is not limited to the specific embodiments disclosed below.
[0020] Reference Figure 1 The embodiment of the application provides a power grid power load intelligent prediction method, which comprises the following steps: Three-stage feature decomposition and reconstruction framework: the application innovatively proposes a "three-stage decomposition" strategy for power load data, which decomposes load features into three levels of basic trend components, periodic components and random fluctuation components; the key point is to design a "component feature reconstruction algorithm", which adaptively adjusts the contribution weights of each component according to different prediction time scales, thereby realizing accurate modeling of multi-scale load patterns; at the same time, an "adaptive component threshold determination mechanism" is introduced, which automatically determines the optimal decomposition threshold through information entropy analysis, thereby avoiding the subjective problem of threshold selection in traditional methods; further, a "decomposition-reconstruction closed-loop feedback mechanism" is designed, which guides the optimization of decomposition parameters through reconstruction error, thereby forming adaptive adjustment.
[0021] Cascade adaptive attention mechanism: The invention proposes a "double-layer cascade attention architecture", which includes two levels of feature channel attention and time sequence attention. On the one hand, the feature channel attention dynamically evaluates the importance of different features through a learnable nonlinear transformation. On the other hand, the time sequence attention captures key moments in the time sequence through a self-attention mechanism enhanced by position encoding.
[0022] Dynamic self-correcting residual network: To solve the problem of difficult training of deep LSTM network, the invention proposes a "dynamic gated residual connection" mechanism. By introducing a trainable gating unit between LSTM layers, it realizes adaptive skip connection of information and effectively alleviates the gradient vanishing problem. The key point is to design a "residual modulation function" to dynamically adjust the contribution of residual connection according to the statistical characteristics of the input sequence, which significantly improves the training stability and expression ability of deep network. At the same time, a "hierarchical adaptive activation function" is designed, which can dynamically select and parameterize the activation function according to the data characteristics of different levels, enhancing the nonlinear modeling ability of the network. A "layered gradient stabilization mechanism" is also designed to monitor and adjust the gradient distribution of each layer to prevent gradient explosion and vanishing, making the deep network training more stable and reliable.
[0023] Abnormal pattern recognition and reinforcement learning module: The invention constructs an "electric power load abnormal pattern library" containing power load patterns under irregular conditions such as extreme weather, special holidays and emergencies. By designing a "contrast learning strategy" and introducing "abnormal pattern interpolation enhancement" technology, "multi-modal abnormal pattern fusion" technology and "progressive abnormal pattern generation" method are also introduced.
[0024] Hierarchical Bayesian hyperparameter optimization framework: The invention designs a "hierarchical Bayesian optimization strategy" to divide model hyperparameters into three levels: network structure parameters, optimization algorithm parameters and regularization parameters. Through a hierarchical Bayesian optimization process, the automatic tuning of hyperparameters is realized.
[0025] As Figure 2As shown, the workflow diagram of the present application first carries out data acquisition and preprocessing, lays the foundation for subsequent steps; then through a three-section feature decomposition module, the power load data is decomposed into three components of trend, cycle and random fluctuation; after feature extraction of each component, the feature reconstruction and weighting module integrates the features; then the cascaded adaptive attention mechanism is used to calculate attention from the feature channel and time sequence two dimensions respectively, and the attention results are fused through the feedback regulation loop; the fused features are input into the dynamic self-correcting residual network, combined with the abnormal pattern recognition and reinforcement learning module, to finally realize the power load prediction; in addition, the hierarchical Bayesian hyperparameter optimization framework provides automatic optimization support for the hyperparameters of the entire network; this process aims to accurately capture the multi-scale features of power load, improve the prediction accuracy and model stability, and adapt to the prediction needs of complex power grids. Specifically:
[0026] Step one: data preprocessing.
[0027] Data cleaning and standardization: data standardization is achieved by subtracting the mean value of the original data and dividing by the standard deviation. Missing value processing: for missing values, the present application uses a weighted historical data filling method, in which different weights are assigned to the data at the previous time and the same time of the previous week. Abnormal value detection and processing: identify abnormal values through statistical characteristics within a sliding window, and constrain values outside the normal range within a reasonable interval.
[0028] Step two: three-section feature decomposition and reconstruction.
[0029] 1. Basic trend component extraction: combined with improved empirical mode decomposition (EMD) and wavelet analysis, accurate extraction of long-term trend of load data; specifically including: ①First, perform EMD decomposition on the original load data X(t) to obtain a number of intrinsic mode functions (IMF) and a residual term, which can be represented as the sum of all IMF components plus the residual term r(t).
[0030] ②Select the IMF component and residual term that reflect the long-term trend through spectral analysis to obtain the preliminary trend component T1(t).
[0031] ③Perform wavelet decomposition on T1(t) to extract low-frequency coefficients as the final trend component T(t).
[0032] ④Determine the optimal decomposition threshold value through the "adaptive component threshold determination mechanism", which is based on the information entropy principle, selects the threshold value that minimizes the information entropy of the decomposition obtained IMF components, while considering the regularization constraint.
[0033] 10. Periodic component extraction: A method combining multi-scale Fourier transform and Lomb-Scargle periodogram is designed to accurately identify and extract periodic components at different scales, including: ① First, Fourier transform is applied to the detrended series X'(t) = X(t) - T(t) to obtain the frequency domain representation F(ω).
[0034] ② The main periodicities are identified through spectral analysis, and the corresponding periodic components are extracted.
[0035] ③ For irregularly sampled data, the Lomb-Scargle periodogram method is used for periodicity detection. This method determines the main periodicity by evaluating the correlation between the signal and the sinusoidal wave at different frequencies, and is suitable for non-uniformly sampled time series data.
[0036] ④ The final periodic component is a combination of periodic components at different scales, forming a multi-scale periodic representation.
[0037] 3. Random fluctuation component extraction: By removing the trend component and periodic component from the original load data, the residual component reflecting short-term random fluctuations is obtained. This process can be represented as the original data minus the trend component and periodic component.
[0038] 4. Component feature reconstruction: The component feature reconstruction algorithm adaptively adjusts the contribution weights of each component according to different prediction time scales. Specifically, it includes: ① For short-term prediction (within 24 hours), the algorithm increases the weights of the random fluctuation component and the daily periodic component.
[0039] ② For medium-term prediction (1-7 days), the algorithm increases the weight of the weekly periodic component.
[0040] ③ For long-term prediction (more than 7 days), the algorithm increases the weights of the trend component and the annual periodic component.
[0041] 5. Adaptive reconstruction parameter optimization: A "decomposition-reconstruction closed-loop feedback mechanism" is designed to optimize the decomposition parameters and reconstruction weights by minimizing the reconstruction error. Specifically, it includes: ① Define the reconstruction error function as: where: θ* is the optimal decomposition threshold; H (IMF i ) represents the information entropy of the i th IMF; R ( θ ) represents the regularization term; λ represents the balance coefficient.
[0042] ②Optimize parameters by gradient descent method, the formula is: .
[0043] ③Introduce constraint conditions to ensure non-negative weights and sum to 1, which is realized by projection gradient method; This closed-loop feedback mechanism enables the entire decomposition and reconstruction process to adaptively adjust according to data characteristics, improving the effectiveness of feature representation.
[0044] Attention weights are represented as: .
[0045] Where: Pool(X) represents the pooling operation on input feature X; W1, W2, b1 and b2 represent learnable parameters; σ represents the Sigmoid activation function.
[0046] Time series attention is represented as: .
[0047] Where: Q, K and V represent query matrix, key matrix and value matrix respectively, which are the core inputs of attention mechanism; d k represents the dimension of key vector, which is used to scale dot product to prevent dot product result from being too large to cause gradient disappearance of softmax function; Mpos represents the position encoding matrix, which is used to introduce position information in the sequence and enhance the sensitivity of the model to position; softmax represents the activation function, which converts the input value into probability distribution, ensuring that each attention weight is between 0 and 1, and the sum of all weights is 1.
[0048] The attention feedback regulation mechanism updates the attention weights by the following formula: .
[0049] Where: α t ' represents the adjusted attention weight; α t represents the original attention weight; error represents the prediction error at the corresponding time step, reflecting the difference between the model's predicted value and the true value; norm(⋅) represents the normalization function, which is used to normalize the error value to an appropriate range, ensuring the stability of feedback regulation; γ represents the adjustable feedback intensity coefficient, which controls the influence degree of prediction error on attention weight adjustment.
[0050] Step three: Cascade adaptive attention mechanism processing.
[0051] As Figure 3As shown, it is a cascade adaptive attention mechanism architecture of the application, which comprises a feature channel attention layer and a time sequence attention layer; wherein the time sequence attention formula is: Attention(Q, K, V) = softmax(QK^T / √d + M_pos)V; and the feature channel attention formula is: a =σ(W2·ReLU(W1·Pool(X) + b1) + b2).
[0052] 1. Feature channel attention layer: The feature channel attention layer dynamically evaluates the importance of different features through a learnable nonlinear transformation; specifically including: ①First, perform global average pooling and maximum pooling on the input feature X∈R^(N×T×F) to obtain two channel descriptors F_avg and F_max, both of which are N×1×F-dimensional tensors.
[0053] ②Input the two descriptors into a shared multi-layer perceptron (MLP) respectively, then add them and pass them through a Sigmoid activation function to obtain the feature attention weight F_attention, wherein the MLP is a multi-layer perceptron composed of two fully connected layers.
[0054] ③Apply the attention weight to the original feature to obtain X_channel.
[0055] 2. Multi-head cross attention mechanism: Realize the mutual influence of feature dimension and time dimension; specifically including: ①Divide the input feature into multiple heads, each of which independently calculates attention, represented as: X_h = Split(X_channel, h) Wherein: h represents the number of heads.
[0056] ②Calculate the cross attention of feature to time and time to feature for each head at the same time, represented as: .
[0057] Wherein: Cf→t represents the cross attention output of feature to time; Ct→f represents the cross attention output of time to feature; Qf represents the query matrix of feature dimension; Kt represents the key matrix of time dimension; Vt represents the value matrix of time dimension; Qt represents the query matrix of time dimension; Kf represents the key matrix of feature dimension; Vf represents the value matrix of feature dimension; d is used to scale the dot product to prevent the dot product result from being too large to cause the gradient of the softmax function to disappear.
[0058] ③Fuse the cross attention results, represented as: .
[0059] Where: Xcross represents the cross-attention result after fusion; Concat(·) represents the concatenation operation of the outputs of multiple heads, which is used to integrate the feature information of different heads; C1, C2, …, Ch represent the cross-attention outputs of h heads respectively; WO represents a learnable weight matrix used to map the concatenated features to the appropriate output dimension; this cross-attention mechanism enables the feature and time dimensions to enhance each other and capture more complex dependencies.
[0060] 3. Time series attention layer: The time series attention layer captures key moments in the time series through a self-attention mechanism enhanced by position encoding; specifically including: ① First, add position encoding to the output after feature channel attention to form the X_pos tensor, where PE is the sine position encoding, and the standard Transformer position encoding formula is used.
[0061] ② Calculate the query (Q), key (K), and value (V) matrices, where W_Q, W_K, and W_V are learnable weight matrices, and d is the dimension of the attention mechanism.
[0062] ③ Calculate the time attention weight matrix A and apply the attention weight to get the output X_time.
[0063] ④ Get the final attention output X_attention through residual connection and layer normalization.
[0064] 4. Entropy regularization attention: Entropy regularization attention prevents attention from being overly focused, specifically including: ① Calculate the entropy of the attention distribution: .
[0065] Where: H(A) represents the entropy of the attention distribution; a ij represents an element in the attention weight matrix, reflecting the attention degree of feature i to feature j; log(a ij ) is used to calculate the amount of information, usually using the natural logarithm or logarithm with base 2; this formula calculates the entropy of the attention distribution, and the greater the entropy value, the more dispersed the attention distribution, and vice versa; by adding an entropy regularization term to the attention loss function, it can prevent attention from being overly focused on a few features or time points, thereby improving the generalization ability and robustness of the model.
[0066] ② Add an entropy regularization term to the attention loss function, represented as: .
[0067] Where: L att represents the total loss with attention regularization; L preddenotes the original prediction loss, usually the error between model prediction and true value; λ H denotes the regularization coefficient, used to control the strength of attention regularization term; H(A) denotes the entropy of attention distribution, used to measure the dispersion degree of attention.
[0068] ③ By adjusting λ H The parameter controls the balance between attention concentration and dispersion; effectively prevents attention from being overly focused on a few features or time points, improving the generalization ability and robustness of the model.
[0069] 5、Attention feedback regulation loop: dynamically adjust the attention weight distribution strategy through historical prediction error; specifically including: ① Record the error e(t) between historical prediction results and true values, and calculate the error time and feature dimension distribution e_time(t) and e_feature(f).
[0070] ② Dynamically adjust the attention weight according to the error distribution, generate time dimension adjustment factor α_time and feature dimension adjustment factor α_feature, where β is a learnable scaling parameter.
[0071] ③ Apply the adjusted weight to the next prediction to form F_attention_adjusted and A_adjusted; this feedback mechanism enables the model to learn from prediction errors, automatically enhancing attention to high error areas, improving prediction accuracy and model adaptability.
[0072] Step four: dynamic self-correcting residual network processing.
[0073] As Figure 4 shown, it is a dynamic self-correcting residual network structure of the application, specifically including: 1、Bidirectional LSTM base layer: the model uses multi-layer bidirectional LSTM as the basic structure to capture the bidirectional dependency relationship of time series, where X t is the input at time t, h t and g t are the hidden state and cell state respectively.
[0074] 2、Dynamic gated residual connection, denoted as: .
[0075] The application introduces a trainable dynamic gated residual connection between LSTM layers, realizing adaptive skip connection of information, where h t ^ l is the hidden state of the lth layer at time t, and g t is the dynamic gating coefficient controlled by the Sigmoid activation function.
[0076] .
[0077] where: W g and b g are learnable parameters.
[0078] 3, the residual modulation function is expressed as: .
[0079] where: Stat(·) is a statistical feature extraction function, including mean, variance, skewness, kurtosis, etc.; M t is a modulation factor; W m and b m are learnable parameters; by designing the residual modulation function, the contribution of the residual connection is dynamically adjusted according to the statistical characteristics of the input sequence; when the input data contains obvious long-term dependence (such as strong periodicity of statistical characteristics), the modulation factor M t increases, enhancing the contribution of the residual connection; when the input data mainly contains short-term fluctuations (such as high randomness of statistical characteristics), the modulation factor M t decreases, reducing the contribution of the residual connection.
[0080] 4, hierarchical adaptive activation function, which optimizes nonlinear expression according to the characteristics of different layers, expressed as: .
[0081] The specific process is: ① define a family of parameterized activation functions. ② Dynamically learn the optimal activation function parameters for each layer. ③ Adaptive selection of activation function parameters for different input features.
[0082] where: S i represents the statistical characteristics of feature i; this kind of dynamic activation function significantly enhances the nonlinear modeling ability of the network, especially for different features and different levels of expression.
[0083] 5, hierarchical gradient stabilization mechanism, expressed as: .
[0084] Specifically including: ① Monitor the gradient norm of each layer. ② Adaptive gradient clipping. ③ Inter-layer gradient balance. This hierarchical gradient stabilization mechanism effectively solves the problems of gradient explosion and vanishing in deep networks, making the training of deep LSTM networks more stable and reliable.
[0085] 6, inter-layer dynamic fusion, expressed as: .
[0086] where: H lis the whole hidden state sequence of the first layer, and i is the layer weight; this dynamic fusion mechanism enables the model to adaptively integrate features extracted at different levels, enhancing the model's expression ability for complex patterns.
[0087] Step five: abnormal pattern recognition and reinforcement learning module, specifically: 1. Power load abnormal pattern library: a power load pattern library under irregular conditions such as extreme weather, special holidays and emergencies is constructed. The abnormal pattern library is organized according to the type of abnormality, including samples related to extreme weather, samples related to special holidays and samples related to emergencies.
[0088] 2. Multi-modal abnormal pattern fusion, specifically including: ① Define multiple abnormal forms, time series modal abnormality, numerical modal abnormality, and pattern conversion abnormality, respectively represented as: .
[0089] ② Integrate different types of abnormal features through a multi-modal fusion device, represented as: .
[0090] ③ Abnormal reinforcement learning based on fusion features, represented as: .
[0091] This multi-modal fusion method of the application realizes all-around characterization of abnormalities, significantly improving the model's ability to recognize various abnormal patterns.
[0092] 3. Contrast learning strategy: through contrast learning, the model can map similar abnormal samples in the feature space to similar positions, while maintaining a distance from other samples, enhancing the ability to recognize abnormal patterns.
[0093] 4. Progressive abnormal pattern generation, specifically including: ① Design a variational autoencoder to generate abnormal samples: encoder: z = Encoder(X); decoder: X' = Decoder(z); abnormal generation: X_abnormal = Decoder(z + ε), where ε is a noise vector.
[0094] ② Control the continuous change of abnormality, represented as: .
[0095] ③ Construct a continuous abnormal spectrum, represented as: .
[0096] The present application enables the model to learn the continuous change process of anomalies through this progressive generation method, improving the generalization ability to unknown abnormal patterns.
[0097] 5. Abnormal pattern interpolation enhancement: generate gradual samples between normal patterns and abnormal patterns through mixing coefficient λ, and randomly sample through uniform distribution; this interpolation method generates gradual samples from normal to abnormal, enriching the distribution of training data, enabling the model to learn the progressive process of abnormal occurrence, and improving the prediction ability of abnormal conditions.
[0098] 6. Abnormal perception attention mechanism: output the probability that the sample belongs to the abnormal pattern through the abnormal detector Detector(·), γ is the attention adjustment coefficient, and A is the original attention weight matrix; when potential abnormal patterns are detected, the model will automatically enhance the attention mechanism, making the network pay more attention to abnormal related features, and improving the prediction accuracy of abnormal conditions.
[0099] Step six: hierarchical Bayesian hyperparameter optimization: divide the model hyperparameters into different levels, and realize the automatic optimization of hyperparameters through hierarchical Bayesian optimization process; specifically including: 1. Hyperparameter hierarchical strategy: divide the model hyperparameters into three levels, organize them according to the influence degree on the model performance and the optimization complexity, including network structure parameters Θ_structure, optimization algorithm parameters Θ_optimization and regularization parameters Θ_regularization.
[0100] 2. Parameter sensitivity analysis driven optimization order scheduling, specifically including: ① Calculate the sensitivity of each hyperparameter to the performance index.
[0101] ② Sort the parameter optimization priority based on sensitivity.
[0102] ③ Dynamically adjust the search space.
[0103] 3. Hierarchical Bayesian optimization process: adopt a top-down hierarchical optimization strategy to determine the optimal parameters layer by layer, and optimize in the order of structure parameters, optimization parameters and regularization parameters.
[0104] 4. Multi-objective optimization trade-off mechanism, specifically including: ① Define multiple optimization objectives: Prediction accuracy: .
[0105] Computing efficiency: .
[0106] Model complexity: .
[0107] 2. Constructing the Pareto frontier solution set: .
[0108] 3. Selecting the final solution based on the preference vector: .
[0109] The multi-objective optimization mechanism of the present application can flexibly adjust the optimization strategy in different application scenarios, balancing multiple objectives such as prediction accuracy, computational efficiency, and model complexity.
[0110] 5. Learning rate adaptive control algorithm: dynamically adjust the learning rate according to the change characteristics of the loss curve; when the loss continues to decrease (slope_t>0) and the curvature is close to zero (curvature_t ≈ 0), the algorithm will moderately increase the learning rate to speed up the convergence; when the loss decreases slows down (slope_t>0 but close to 0) and the curvature is positive (curvature_t>0), the algorithm will reduce the learning rate to prevent skipping the optimal solution; when the loss rebounds (slope_t<0), the algorithm will significantly reduce the learning rate to stabilize the training process.
[0111] The application has the following advantages: on the one hand, the prediction accuracy is greatly improved: compared with the existing most advanced method, the prediction accuracy of the system of the application is improved by 31.7% on average on the standard test dataset; specifically, the mean square error (MSE) is reduced by 29.5, the mean absolute error (MAE) is reduced by 3.27, and the determination coefficient (R2) is increased to 0.89; in particular, under extreme weather and special event conditions, the prediction accuracy is improved by 42.5%, far exceeding the existing technical level; on the other hand, the multi-scale prediction capability is significantly enhanced: thanks to the three-stage feature decomposition and reconstruction technology, short-term (intra-day), medium-term (intra-week) and long-term (intra-month) load prediction can be simultaneously considered, and high accuracy is maintained on different time scales; experiments show that in short-term prediction, the accuracy is improved by 23.4%; in medium-term prediction, the accuracy is improved by 29.7%; in long-term prediction, the accuracy is improved by 40.3%; on the other hand, the abnormal situation processing capability is significantly improved: through the abnormal pattern recognition and reinforcement learning module, the prediction capability under extreme weather, special holidays and other abnormal situations is significantly improved; on the test set containing extreme weather, the prediction error is reduced by 45.6%; during special holidays, the prediction error is reduced by 38.9%, which solves the problem of insufficient prediction accuracy of the existing technology under abnormal conditions; on the other hand, the calculation efficiency is greatly improved: thanks to the dynamic self-correcting residual network and the hierarchical Bayesian hyperparameter optimization framework, while ensuring the prediction accuracy, the training time is reduced by about 40%, and the model convergence speed is increased by about 2.5 times; at the same time, the calculation complexity in the reasoning stage is reduced by 35%, so that the system can better support real-time prediction requirements; on the other hand, the model stability and robustness are enhanced: the cascaded adaptive attention mechanism and the dynamic self-correcting residual network significantly improve the training stability and robustness of the model; on the dataset containing noise, the performance degradation is only 12.3%, while the performance degradation of the comparative method is 27.6%, indicating that it has stronger resistance to data noise and outliers.
[0112] The three-stage feature decomposition and reconstruction technology is used in the system, so that the system can simultaneously consider the prediction tasks of different time scales, and the problem that the traditional method is difficult to balance short-term fluctuations and long-term trends is solved; the cascaded adaptive attention mechanism is introduced, so that the model can automatically adjust the attention degree to each feature and time point according to different prediction tasks and data characteristics, and the flexibility and adaptability of the model are improved; the dynamic self-correcting residual network is introduced, so that the problem that the deep neural network is difficult to train is effectively solved, so that the model can fully exert the expression ability of deep learning, and the stability of training is maintained; the abnormal mode recognition and reinforcement learning module designed in the application enables the system to effectively identify and cope with various abnormal situations, and improves the prediction accuracy and stability of the model in a complex environment; the hierarchical Bayesian hyperparameter optimization framework designed in the application realizes the high automation of the model training process, reduces the manual intervention, and improves the efficiency and performance of the model training; the feature decoupling attention mechanism is used, the interpretability of the prediction result is enhanced, the user can understand the key factors behind the prediction, and the practicability and credibility of the system are enhanced.
[0113] The above-mentioned embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it cannot be understood as limiting the scope of the patent. It should be noted that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A method for intelligent prediction of power load of a power grid, characterized in that: The following steps are involved: Obtaining the power load data of the smart grid and decomposing the power load data into trend component, periodic component and random fluctuation component; Through learnable nonlinear transformation, the importance of trend component, periodic component and random fluctuation component is dynamically evaluated to obtain the feature importance weight of each component. The feature importance weight is then multiplied by the corresponding component to obtain the trend feature, periodic feature and random fluctuation feature after feature dimension enhancement. Through the position encoding enhanced self-attention mechanism, the key moments in the time series of each component are captured, the time attention weight of each component is obtained, and the time attention weight is multiplied by the corresponding component to obtain the trend characteristics, periodic characteristics and random fluctuation characteristics after the time dimension is enhanced; The trend features, periodic features and random fluctuation features after feature dimension enhancement and time dimension enhancement are correspondingly fused to obtain enhanced trend features, periodic features and random fluctuation features; The residual modulation function is used to increase the attention paid to the long-term series in the enhanced trend feature when extracting, to increase the attention paid to the short-term series in the enhanced periodic feature when extracting, and to increase the attention paid to the fluctuation series in the enhanced random fluctuation feature when extracting; and the long-term prediction value, short-term prediction value and fluctuation prediction value are extracted, and the long-term prediction value, short-term prediction value and fluctuation prediction value are added to obtain the power load prediction value.
2. A method for intelligent prediction of power load of a power grid according to claim 1, characterized in that: Obtaining a power load forecast value through a power grid power load forecasting model; the power grid power load forecasting model includes a two-layer cascaded attention architecture, a dynamic self-correcting residual network, and a hierarchical Bayesian hyperparameter optimization module; The two-layer cascaded attention architecture includes a cascaded feature channel attention layer and a time series attention layer, as well as a feedback regulation loop; The dynamic self-correcting residual network includes: adding a trainable gating unit between the input and output of the LSTM layer of the LSTM network, and integrating a residual modulation function between the LSTM layers of the LSTM network; The hierarchical Bayesian hyperparameter optimization module divides the hyperparameters of the power grid load forecasting model into three levels: network structure parameters, optimization algorithm parameters, and regularization parameters, for automatic tuning of the hyperparameters. The outputs of the feature channel attention layer and the time series attention layer are the inputs of the feedback regulation loop, the output of the feedback regulation loop is the input of the LSTM network, and the LSTM network outputs the power load prediction value.
3. The method for intelligent prediction of power load of a power grid according to claim 1, characterized in that: The decomposition of the power load data into a trend component, a periodic component and a random fluctuation component includes: Perform empirical mode decomposition (EMD) on the power load data X(t) of the smart grid to obtain multiple intrinsic mode functions (IMFs) and residual terms (r(t); The low-frequency IMF component and the residual term r(t) are selected through spectrum analysis to obtain the preliminary trend component T1(t); the preliminary trend component T1(t) is decomposed by wavelet and the low-frequency coefficient is extracted as the final trend component T(t); Perform Fourier transform on the detrended sequence X'(t) = X(t) - T(t) to obtain the frequency domain representation F(ω); identify the periodic components corresponding to the dominant frequency in F(ω), which include daily, weekly, monthly, and annual cycles; Extracting the components of daily, weekly, monthly and annual cycles through a bandpass filter, and combining the daily, weekly, monthly and annual cycle components to obtain a periodic component; The random fluctuation component is obtained by subtracting the trend component T(t) and the periodic component from the power load data X(t) of the smart grid.
4. The method for intelligent prediction of power grid load according to claim 2, characterized in that: The acquisition of trend features, periodic features, and random fluctuation features after the feature dimension is enhanced includes: For the trend component, periodic component and random fluctuation component, the feature channel attention layer performs global average pooling and maximum pooling on the input feature X∈R^(N×T×F) to obtain two channel descriptors F avg and F max , F avg and F max Both are tensors of N×1×F dimensions; F avg and F max The shared multi-layer perceptron MLP is input separately to obtain the feature importance weight of each component, and the feature importance weight is multiplied by the corresponding component to obtain the trend feature, periodic feature and random fluctuation feature after feature dimension enhancement.
5. A method for intelligent prediction of power load of a power grid according to claim 4, characterized in that: The acquisition of trend characteristics, periodic characteristics and random fluctuation characteristics after the time dimension is enhanced includes: For trend component, periodic component and random fluctuation component, the time series attention layer performs feature channel attention processing on each component and adds position encoding to the output after feature channel attention processing to obtain X pos Tensor; Calculate the query Q, key K and value V matrix and combine them with X pos Tensor, calculate the time attention weight of each component, and multiply the time attention weight with the corresponding component to obtain the trend characteristics, periodic characteristics and random fluctuation characteristics after the time dimension is enhanced.
6. A method for intelligent prediction of power grid load according to claim 5, characterized in that: The enhanced trend characteristics, periodic characteristics and random fluctuation characteristics include: When the trend features, periodic features and random fluctuation features after feature dimension enhancement and time dimension enhancement are correspondingly fused, the trend features after feature dimension enhancement and time dimension enhancement, the periodic features after feature dimension enhancement and time dimension enhancement, and the random fluctuation features after feature dimension enhancement and time dimension enhancement are respectively targeted; The features are divided into multiple heads, and each head calculates attention independently; and for each head, the cross attention from feature to time and time to feature is calculated simultaneously, expressed as: ; in: C f→t Represents the cross-attention output of features to time; C t→f Represents the cross-attention output from time to feature; Q f The query matrix representing the feature dimension; K t A key matrix representing the time dimension; V t A matrix of values representing the time dimension; Q t A query matrix representing the time dimension; K f A key matrix representing the feature dimensions; d represents scaled dot product; softmax represents activation function; The cross-attention outputs from feature to time and time to feature are fused to obtain enhanced trend features, periodic features, and random fluctuation features. The cross-attention output fusion is expressed as: ; in: X cross Represents the cross attention result after fusion; Concat(⋅) represents the splicing operation of the outputs of multiple heads; C 1. C 2. ... C h Represent the cross attention output of h heads respectively; W O represents the learnable weight matrix.
7. The method for intelligent prediction of power grid load according to claim 2, characterized in that: The acquisition of the power load forecast value includes: The residual connection of the trainable gated unit is expressed as: ; Where: ht^l represents the hidden state of the lth layer at time t; g t represents the dynamic gating coefficient, g t Expressed as: ; W g and b g represents learnable parameters; The residual modulation function dynamically adjusts the weight of the residual connection according to the statistical characteristics of the input sequence. The residual modulation function is expressed as: ; Where: Stat(·) represents the statistical feature extraction function; M t represents the modulation factor; W m and b m represents learnable parameters; The LSTM network is used to extract the long-term prediction value within the trend feature, the short-term prediction value within the periodic feature, and the fluctuation prediction value within the random fluctuation feature. The long-term prediction value, short-term prediction value and fluctuation prediction value are added together to obtain the power load prediction value.
8. An intelligent prediction system for power grid load, characterized in that: include: The data acquisition and processing module is used to obtain the power load data of the smart grid and decompose the power load data into trend components, periodic components and random fluctuation components; The prediction module dynamically evaluates the importance of trend components, periodic components, and random fluctuation components through learnable nonlinear transformations, obtains the feature importance weight of each component, and multiplies the feature importance weight by the corresponding component to obtain trend features, periodic features, and random fluctuation features after feature dimension enhancement; Through the position encoding enhanced self-attention mechanism, the key moments in the time series of each component are captured, the time attention weight of each component is obtained, and the time attention weight is multiplied by the corresponding component to obtain the trend characteristics, periodic characteristics and random fluctuation characteristics after the time dimension is enhanced; The trend features, periodic features and random fluctuation features after feature dimension enhancement and time dimension enhancement are correspondingly fused to obtain enhanced trend features, periodic features and random fluctuation features; The residual modulation function is used to increase the attention paid to the long-term series in the enhanced trend feature when extracting, to increase the attention paid to the short-term series in the enhanced periodic feature when extracting, and to increase the attention paid to the fluctuation series in the enhanced random fluctuation feature when extracting; and the long-term prediction value, short-term prediction value and fluctuation prediction value are extracted, and the long-term prediction value, short-term prediction value and fluctuation prediction value are added to obtain the power load prediction value.
9. An electronic device, characterized in that: include: memory and processor; The memory is used to store computer programs; The processor is configured to implement the steps of a method for intelligently predicting power load on a power grid as described in any one of claims 1 to 7 when executing the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that Used to store a computer program, which, when executed by a processor, implements the steps of a method for intelligent prediction of power load in a power grid as described in any one of claims 1 to 7.
Citation Information
Patent Citations
CEEMDAN-based short-term power load prediction method
CN113935513A
DWT-LSTM power load prediction method based on attention mechanism
CN114219139A
Long-term power load prediction method based on hierarchical residual self-attention neural network
CN114529051A
Load prediction method based on GCN-CBAM-BiGRU combination model
CN117526316A
Power load long time sequence prediction method and related device
CN120016482A
Cited By
Ship navigation behavior prediction method and system based on interpretable artificial intelligence
CN121191361A
A ship navigation behavior prediction method and system based on explainable artificial intelligence
CN121191361B
Edge side load prediction method and device based on federated learning
CN121706932A
Power grid load situation awareness method and system based on load situation time sequence energy value
CN121786558A
Power grid load situation awareness method and system based on load situation time sequence energy value
CN121786558B
