Power load prediction method and system

By combining trigonometric function encoding and variational mode decomposition with a BiLSTM-Transformer hybrid network, the problems of periodic feature extraction and feature fusion in power load forecasting are solved, achieving higher accuracy in power load forecasting.

CN121584557APending Publication Date: 2026-02-27HEFEI UNIV OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511824995.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing power load forecasting methods fail to effectively extract the periodic features of load sequences, resulting in low forecast accuracy. Furthermore, the feature fusion method of traditional hybrid models is prone to losing important features.

Method used

The time label of the power load sequence is encoded using trigonometric functions. Combined with variational mode decomposition of genetic algorithm and BiLSTM-Transformer hybrid network, the prediction accuracy is improved through transitional hybrid layer and improved loss function.

Benefits of technology

It significantly improves the accuracy of power load forecasting, better captures the periodic characteristics and temporal dependencies of the sequence, and enhances the robustness and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121584557A_ABST
    Figure CN121584557A_ABST
Patent Text Reader

Abstract

The invention discloses a power load prediction method and system, and the method comprises the steps: collecting an original power load sequence and an influence factor sequence, carrying out the data preprocessing of the original power load sequence and the influence factor sequence, and carrying out the coding of a time label of the power load sequence through employing a trigonometric function method, the coding result of the time label is used as a newly added column in the influence factor sequence, so that the influence factor sequence and the coding result of the time label are combined to form an exogenous factor matrix; carrying out modal decomposition on the preprocessed power load sequence by using variation modal decomposition based on a genetic algorithm, and decomposing the preprocessed power load sequence into K modals and residual errors; constructing a BiLSTM-Transform hybrid network, and training the BiLSTM-Transform hybrid network to obtain a trained model; data collected in real time are input into the trained model to obtain K + 1 prediction results, the prediction results are subjected to superposition reconstruction, and the reconstructed result is a power load prediction value; the method has the advantage that the prediction precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of energy demand management, and specifically to a method and system for predicting electricity load. Background Technology

[0002] Achieving high-precision power load forecasting is crucial for the optimized operation of new power systems. It is the core foundation for realizing coordinated interaction among power sources, grid, load, and storage; optimizing real-time power supply and demand balance; improving overall grid energy utilization efficiency; reducing system operating costs; and supporting precise and flexible resource regulation. With the large-scale and high-proportion integration of fluctuating renewable energy sources such as wind and solar power, unprecedented pressure has been placed on the distribution network to absorb these resources, posing a significant challenge to maintaining the real-time dynamic balance of the power system and severely testing the safe, stable, and economical operation of the grid. Therefore, it is necessary to establish a high-precision power load forecasting system for effective power energy management.

[0003] In recent years, with the rapid development of computer technology, prediction methods represented by machine learning have gained attention. In the field of power load forecasting, several representative methods have emerged. For example, Chinese Patent Publication No. CN119539187A discloses a novel power system load forecasting method that uses a two-layer gray BP neural network for load forecasting. However, this type of method only captures short-term fluctuations in the load sequence and struggles to fully grasp the long-term trend of power load changes. Chinese Patent Publication No. CN119539191A discloses a power load forecasting method that effectively captures medium- and long-term relationships, but it does not process the original load sequence, leading to various noise interferences affecting the prediction results. Chinese Patent Publication No. CN119340965A discloses a big data-based power load forecasting method that, while extensively statistically analyzing factors influencing power load, does not sufficiently mine the power load data and fails to fully utilize the hidden features of the power load data. Chinese Patent Publication No. CN120764762A discloses a short-term power load forecasting method that combines improved empirical mode decomposition and bidirectional long short-term memory (BSSM) networks. It constructs a prediction model based on BSSM and a self-attention mechanism for each component; the input layer extracts features through a sliding window, and the training layer uses BSSM to extract temporal hidden features. However, it fails to extract the periodic features hidden in the load sequence, making it difficult to fully grasp the characteristics of power load changes, thus affecting prediction accuracy. Furthermore, the simple splicing of BSSM and the attention mechanism in a coarse-grained fusion mode easily leads to the loss of important model features, ultimately resulting in reduced model accuracy. Moreover, it does not consider the impact of power load fluctuations on the prediction results, leading to low accuracy. Summary of the Invention

[0004] The technical problem to be solved by this invention is that existing power load forecasting methods do not extract the periodic features hidden in the load sequence. They simply splice together bidirectional long short-term memory networks and attention mechanisms, which easily lose important features of the model, resulting in low prediction accuracy.

[0005] This invention solves the above-mentioned technical problems through the following technical means: a power load forecasting method, comprising: S1. Collect the original power load sequence and influencing factor sequence, perform data preprocessing on the original power load sequence and influencing factor sequence, and use the trigonometric function method to encode the time label of the preprocessed power load sequence. Use the time label encoding result as a new column in the influencing factor sequence, so that the influencing factor sequence and the time label encoding result are merged to form an exogenous factor matrix. S2. The preprocessed power load sequence is decomposed into K modes and residuals using variational mode decomposition based on genetic algorithm. S3. Construct a BiLSTM-Transformer hybrid network. The BiLSTM-Transformer hybrid network sets up a transitional mixing layer between the BiLSTM model and the Transformer network. The K modes and residuals are merged with the exogenous factor matrix to obtain K+1 input matrices. The K+1 input matrices are then used as samples input to the BiLSTM-Transformer hybrid network through time window sliding, resulting in K+1 prediction results. The sum of these K+1 prediction results corresponds to the predicted power load values ​​at P future time points. The loss function of the BiLSTM-Transformer hybrid network is set, and the network is trained to obtain the trained model. S4. After training is completed, the real-time collected data is input into the trained model to obtain K+1 prediction results. The prediction results are superimposed and reconstructed, and the reconstructed result is the predicted power load value.

[0006] Furthermore, the original power load sequence is a power load sequence with n data points, with one data point collected per second, and n corresponding to the nth time moment; the influencing factor sequence has n rows and m columns, and the data in the nth row and mth column represents the recorded value of the mth influencing factor at the nth time moment.

[0007] Furthermore, the method of using trigonometric functions to encode the time labels of the preprocessed power load sequence, and using the encoded results of the time labels as new columns in the influencing factor sequence, merges the influencing factor sequence with the encoded results of the time labels to form an exogenous factor matrix, including: The encoding formula is Where T is the time period, For the current moment, The result is a sine code. Cosine encoding result; The time period is 12. Using integers from 0 to 11, the months in the time tags of the preprocessed power load sequence are encoded using the encoding formula to obtain the sine and cosine encoding results for the months; the time period is 24. Take integers from 0 to 23, encode the hours in the time tag of the preprocessed power load sequence using the encoding formula, and obtain the sine encoding result and the cosine encoding result of the hour; take the above four encoding results as four new columns in the influencing factor sequence, so that the encoding results of the influencing factor sequence and the time tag are merged to form the exogenous factor matrix.

[0008] Further, S2 includes: S21. Based on variational mode decomposition, the preprocessed power load sequence is processed, and the variational constraint equation is:

[0009] in, for The first time decomposition obtained One modality, yes The simplified form, For the first The center frequency of each mode Represents a partial differential operator, with respect to time. t Find the partial derivative. Let be the impulse function. For convolution, f This is the preprocessed power load sequence. yes The simplified form, The imaginary unit, This is a Hilbert transform; It is the total number of modes; Represents the square of the L2 norm; S22. Convert the variational constraint into a Lagrangian function:

[0010] in, For Lagrange multipliers, yes The simplified form, Punishment factor The inner product symbol is used. Indicates the center frequency of the intrinsic mode; S23. Under the premise of minimizing the Lagrange function, the iterative process is performed using the alternating direction multiplication operator as follows:

[0011]

[0012]

[0013] in, For iteration rounds, , , They are respectively , , Fourier transform, This is the iteration step size; Determine if convergence has occurred. If the convergence criteria are met, output the frequency domain signal of each mode. If convergence has not occurred, increment the iteration count by 1 and continue iterating. The convergence criteria are as follows: ; S24. After updating and iterating to obtain the frequency domain signal of each mode, inversely transform it to... Then, the residuals are obtained using the following formula: .

[0014] Furthermore, S2 also includes: the total number of modes and penalty factor The solution was obtained through optimization using a genetic algorithm.

[0015] Furthermore, the working process of the BiLSTM-Transformer hybrid network is as follows: A time window of length L is slid across the acquired input matrix with a step size of 1, obtaining one sample per slide. The sample is then input into a multi-layer BiLSTM network to obtain the output. ,Will The input is a transition blending layer, which consists of a sequentially connected linear projection layer and a LayerNorm normalization layer. The output of the transition blending layer is a sequence. ,sequence Inputting the sequence into a Transformer network, the Transformer network will process the sequence into a Transformer network. The vectors are weighted and mapped to query vectors, key vectors, and value vectors respectively. These vectors are then split into multiple attention heads by dimension. Each attention head performs self-attention computation. The results of all attention heads' self-attention computations are concatenated and multiplied by the multi-head computation weight matrix to obtain the multi-head fusion result. The multi-head fusion result is compared with the sequence. After performing residual connections, layer normalization is then performed to obtain the sequence. ;sequence Input feedforward neural network uses formula Processing is carried out, among which, It is a feedforward neural network. and It is the weight matrix of the linear layer of the feedforward neural network. and All are biased. This represents the activation function; then, through the formula... The output of the current Transformer network is obtained, where, The representation layer normalization operation is performed; multiple Transformer networks are set up, with the output of the upper Transformer network serving as the input of the lower Transformer network, and the final output is... Finally, the prediction results are output through a fully connected layer.

[0016] Furthermore, the loss function construction process of the BiLSTM-Transformer hybrid network is as follows: The Huber loss function is defined as follows:

[0017] in, Represents the predicted value. For the true value, This is the error threshold; The penalty items are defined as follows:

[0018] in, For the predicted value in t Time fluctuations, The true value fluctuates at time t. Indicates the predicted length; The loss function is as follows:

[0019] in, Let be the predicted value of the i-th sample at time t. Let i be the true value of the i-th sample at time t. Let i be the predicted value of the i-th sample and , The true value of the i-th sample and N is the total number of samples.

[0020] The present invention also provides a power load forecasting system, characterized in that it comprises: The data processing module is used to collect the original power load sequence and influencing factor sequence, perform data preprocessing on the original power load sequence and influencing factor sequence, and use the trigonometric function method to encode the time label of the preprocessed power load sequence. The encoded result of the time label is used as a new column in the influencing factor sequence, so that the influencing factor sequence and the encoded result of the time label are merged to form an exogenous factor matrix. The mode decomposition module is used to perform mode decomposition on the preprocessed power load sequence using variational mode decomposition based on genetic algorithm, decomposing it into K modes and residuals; The network construction module is used to build a BiLSTM-Transformer hybrid network. The BiLSTM-Transformer hybrid network sets a transitional mixing layer between the BiLSTM model and the Transformer network. K modes and residuals are merged with the exogenous factor matrix to obtain K+1 input matrices. Time window sliding values ​​are applied to each of the K+1 input matrices as samples input to the BiLSTM-Transformer hybrid network, resulting in K+1 prediction results. The sum of these K+1 prediction results corresponds to the predicted power load values ​​at P future time points. The loss function of the BiLSTM-Transformer hybrid network is set, and the network is trained to obtain a trained model. The testing and evaluation module is used to input real-time collected data into the trained model after training to obtain K+1 prediction results. The prediction results are then superimposed and reconstructed to obtain the power load prediction value.

[0021] Furthermore, the original power load sequence is a power load sequence with n data points, with one data point collected per second, and n corresponding to the nth time moment; the influencing factor sequence has n rows and m columns, and the data in the nth row and mth column represents the recorded value of the mth influencing factor at the nth time moment.

[0022] Furthermore, the method of using trigonometric functions to encode the time labels of the preprocessed power load sequence, and using the encoded results of the time labels as new columns in the influencing factor sequence, merges the influencing factor sequence with the encoded results of the time labels to form an exogenous factor matrix, including: The encoding formula is Where T is the time period, For the current moment, The result is a sine code. Cosine encoding result; The time period is 12. Using integers from 0 to 11, the months in the time tags of the preprocessed power load sequence are encoded using the encoding formula to obtain the sine and cosine encoding results for the months; the time period is 24. Take integers from 0 to 23, encode the hours in the time tag of the preprocessed power load sequence using the encoding formula, and obtain the sine encoding result and the cosine encoding result of the hour; take the above four encoding results as four new columns in the influencing factor sequence, so that the encoding results of the influencing factor sequence and the time tag are merged to form the exogenous factor matrix.

[0023] Furthermore, the mode decomposition module is also used for: S21. Based on variational mode decomposition, the preprocessed power load sequence is processed, and the variational constraint equation is:

[0024] in, for The first time decomposition obtained One modality, yes The simplified form, For the first The center frequency of each mode Represents a partial differential operator, with respect to time. t Find the partial derivative. Let be the impulse function. For convolution, f This is the preprocessed power load sequence. yes The simplified form, The imaginary unit, This is a Hilbert transform; It is the total number of modes; Represents the square of the L2 norm; S22. Convert the variational constraint into a Lagrangian function:

[0025] in, For Lagrange multipliers, yes The simplified form, Punishment factor The inner product symbol is used. Indicates the center frequency of the intrinsic mode; S23. Under the premise of minimizing the Lagrange function, the iterative process is performed using the alternating direction multiplication operator as follows:

[0026]

[0027]

[0028] in, For iteration rounds, , , They are respectively , , Fourier transform, This is the iteration step size; Determine if convergence has occurred. If the convergence criteria are met, output the frequency domain signal of each mode. If convergence has not occurred, increment the iteration count by 1 and continue iterating. The convergence criteria are as follows: ; S24. After updating and iterating to obtain the frequency domain signal of each mode, inversely transform it to... Then, the residuals are obtained using the following formula: .

[0029] Furthermore, the mode decomposition module is also used for: the total number of modes and penalty factor The solution was obtained through optimization using a genetic algorithm.

[0030] Furthermore, the working process of the BiLSTM-Transformer hybrid network is as follows: A time window of length L is slid across the acquired input matrix with a step size of 1, obtaining one sample per slide. The sample is then input into a multi-layer BiLSTM network to obtain the output. ,Will The input is a transition blending layer, which consists of a sequentially connected linear projection layer and a LayerNorm normalization layer. The output of the transition blending layer is a sequence. ,sequence Inputting the sequence into a Transformer network, the Transformer network will process the sequence into a Transformer network. The vectors are weighted and mapped to query vectors, key vectors, and value vectors respectively. These vectors are then split into multiple attention heads by dimension. Each attention head performs self-attention computation. The results of all attention heads' self-attention computations are concatenated and multiplied by the multi-head computation weight matrix to obtain the multi-head fusion result. The multi-head fusion result is compared with the sequence. After performing residual connections, layer normalization is then performed to obtain the sequence. ;sequence Input feedforward neural network uses formula Processing is carried out, among which, It is a feedforward neural network. and It is the weight matrix of the linear layer of the feedforward neural network. and All are biased. This represents the activation function; then, through the formula... The output of the current Transformer network is obtained, where, The representation layer normalization operation is performed; multiple Transformer networks are set up, with the output of the upper Transformer network serving as the input of the lower Transformer network, and the final output is... Finally, the prediction results are output through a fully connected layer.

[0031] Furthermore, the loss function construction process of the BiLSTM-Transformer hybrid network is as follows: The Huber loss function is defined as follows:

[0032] in, Represents the predicted value. For the true value, This is the error threshold; The penalty items are defined as follows:

[0033] in, For the predicted value in t Time fluctuations, The true value fluctuates at time t. Indicates the predicted length; The loss function is as follows:

[0034] in, Let be the predicted value of the i-th sample at time t. Let i be the true value of the i-th sample at time t. Let i be the predicted value of the i-th sample and , The true value of the i-th sample and N is the total number of samples.

[0035] The advantages of this invention are: (1) This invention uses trigonometric functions to encode the time labels of the power load sequence, and uses the encoded time label results as a new column in the influencing factor sequence. This encoding method is conducive to the model fully grasping the periodic dependence of the sequence, extracting the periodic features hidden in the load sequence, and optimizing the prediction effect. BiLSTM is used to capture short-range time series dependence, and Transformer is used to capture long-range global correlation. At the same time, a transitional hybrid layer is used to change the limitation of the traditional multi-model "simple splicing" and further improve the prediction accuracy.

[0036] (2) Traditional time series forecasting has inherent flaws in its handling of time information. It only converts timestamps into discrete values ​​as ordinary feature inputs, completely losing the periodicity and sequential dependence of time. This approach allows the model to passively fit the numerical trend of the data, unable to actively utilize prior time information. Consequently, when the data is noisy or the periodic patterns are complex, the robustness of the prediction decreases significantly, and the generalization ability is limited. Therefore, this invention proposes time encoding, which uses a trigonometric function structure to explicitly capture time features: by using sine and cosine encoding, discrete time is mapped into a continuous vector, preserving periodic correlation and sequential dependence. The core value of time encoding lies in injecting time patterns into the model: on the one hand, it solves the problem of distinguishing between the same numerical value but different time features, making the prediction results more consistent with the actual time series logic; on the other hand, the constructed time feature information reduces the model's dependence on pure numerical trends, and can still stably capture core patterns when the data is sparse or noisy, significantly improving the generalization ability.

[0037] (3) There are two major pain points in the fusion of traditional hybrid models: First, hard dimensionality adaptation, which directly adjusts the input dimensions of the models before and after by truncating or padding (e.g., when BiLSTM outputs 128 dimensions and Transformer requires 72 dimensions, the first 72 dimensions are directly truncated), resulting in the loss of a large number of key local features; Second, feature distribution mismatch, the local temporal features output by BiLSTM are affected by local data statistics and have large distribution fluctuations, while Transformer is sensitive to the stability of the input distribution. Direct splicing will lead to deviations in the calculation of attention weights and severe loss oscillations during training; This invention constructs a two-level transition structure of linear projection + LayerNorm normalization, Simultaneously, conditional activation logic is incorporated: the linear projection layer precisely maps the BiLSTM output to the required dimensions of the Transformer using a learnable weight matrix. Compared to truncation and zero-padding, this maximizes the preservation of the core local feature information of the BiLSTM. LayerNorm normalization standardizes the projected features, eliminating fluctuations in the distribution of local features and making the feature distribution of the input Transformer more stable. Linear projection achieves lossless feature transfer, while LayerNorm solves the distribution adaptation problem, enabling the Transformer to effectively utilize the local features of the BiLSTM, reducing training convergence time by 15%-20%. The complementary advantages of BiLSTM and Transformer require solving the feature adaptation problem. The transition hybrid layer breaks down the compatibility barrier between the two through linear projection and normalization, allowing the capture of local and global dependencies to form a synergistic effect.

[0038] (4) Traditional loss functions (MSE, MAE) have certain limitations in adapting to different scenarios. MSE penalizes outliers too heavily, leading to overfitting of the model to outliers and ignoring the overall temporal trend. While MAE is robust to outliers, it penalizes all errors equally, which can easily lead to overly smoothed predictions. More importantly, both only optimize the single-point numerical error between the predicted and actual values, completely ignoring the core requirement of time series prediction—consistency of fluctuation trends. This single optimization objective can lead to ineffective predictions with small numerical errors but completely opposite trends, which may have serious consequences in scenarios such as energy scheduling. This invention adopts a dual-objective structure of numerical accuracy optimization + fluctuation consistency constraint. The first part is Huber loss. When the error is small, MSE is used to accelerate convergence. When the error is large, MAE is used to avoid the excessive influence of outliers on the loss and improve the robustness of the model. The second part adds a fluctuation penalty term, which quantifies the fluctuation difference through first-order difference and penalizes the deviation between the predicted fluctuation and the actual fluctuation in the form of squared error, forcing the model to learn the temporal trend change. Huber loss ensures the basic numerical accuracy of the prediction while improving robustness to outliers and adapting to noisy time series data. The volatility penalty term incorporates trend consistency into the optimization objective, which solves the problem of traditional loss values ​​being close but the trend being wrong, making the prediction results more practical.

[0039] (5) In view of the fact that the existing technology does not consider the impact of power load fluctuation on the prediction results, the present invention sets a loss function and defines a penalty term to ensure that the fluctuation trend of the predicted value and the actual value are consistent. The optimization objective guides the model to pay attention to both numerical accuracy and fluctuation consistency, and transforms the fused features into more practical prediction results.

[0040] (6) This invention takes into account the requirements of power load reconfiguration, proposes a variational mode decomposition (VMD) parameter optimization criterion with minimizing the mean square error after decomposition as the objective function, and searches for the optimal parameters through a genetic algorithm, thereby significantly improving the prediction accuracy.

[0041] (7) The VMD-BiLSTM-Transformer hybrid model proposed in this invention effectively solves problems such as non-stationarity, insufficient utilization of time labels and incomplete feature capture by integrating cyclic coding, signal decomposition, local time series modeling and global attention mechanism, providing reliable technical support for practical applications such as power grid dispatch optimization and new energy grid connection planning. Attached Figure Description

[0042] Figure 1 This is a flowchart of a power load forecasting method disclosed in an embodiment of the present invention; Figure 2 This is a flowchart of data preprocessing in a power load forecasting method disclosed in an embodiment of the present invention; Figure 3 This is a flowchart of mode decomposition in a power load forecasting method disclosed in an embodiment of the present invention; Figure 4 This is a flowchart of a power load forecasting method disclosed in an embodiment of the present invention; Figure 5 This is a data flow diagram in a power load forecasting method disclosed in an embodiment of the present invention; Figure 6 This is a structural block diagram of a power load forecasting system disclosed in an embodiment of the present invention. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0044] Example 1 like Figure 1As shown, Embodiment 1 of the present invention provides a power load forecasting method, the method comprising the following steps: S1. Collect the original power load sequence and influencing factor sequence, perform data preprocessing on the original power load sequence and influencing factor sequence, and use the trigonometric function method to encode the time label of the preprocessed power load sequence. Use the time label encoding result as a new column in the influencing factor sequence, so that the influencing factor sequence and the time label encoding result are merged to form an exogenous factor matrix.

[0045] S11. Express the collected power load sequence using the following logic. X :

[0046] In the formula, n represents the number of power load sequence points collected by the system. One data point is collected per second, and n corresponds to the nth time point. x n This represents the power load value at time n.

[0047] The collected sequence of influencing factors is represented by Y:

[0048] In the formula, m represents m types of influencing factors, including factors such as temperature, humidity, precipitation, and whether it is a holiday. This represents the recorded value of the m-th influencing factor at time n; S12. Data preprocessing refers to checking the original load series and influencing factor matrix for missing or outlier values. For example... Figure 2 As shown, the mean method is used to handle missing and outlier values, and the following logic is used for processing:

[0049] For missing or outlier values ​​at time t, This is the normal value at time t+1. This represents the normal value at time t-1; S13. Encode the time labels of the preprocessed power load sequence. Power load sequences exhibit "proximity similarity" in time, meaning that the closer the time labels are to the power load values, the more similar they are. While this characteristic is intuitively understandable, it is difficult for deep learning models to capture. Therefore, a trigonometric function method is used to encode the time labels, specifically utilizing the following logic:

[0050] Where T is the time period. For the current moment, The result is a sine code. Cosine encoding result; taking hours as an example, the encoding formula becomes:

[0051] Where t takes integer values ​​from 0 to 23. The new sequence formed by encoding time tags in hours is used as an independent feature and incorporated into the original influencing factor matrix as a new column in the influencing factor matrix; Taking months as an example, the coding formula becomes:

[0052] Where t takes integer values ​​from 0 to 11. A new sequence formed by encoding time tags by month is incorporated as an independent feature into the original influencing factor matrix, becoming a new column in the matrix. S14. Incorporate the above-mentioned hourly and monthly coding features into the influencing factor sequence, where m = m + 4, to form an exogenous factor matrix. .

[0053] This invention aims to address the power load forecasting problem in new power systems, which is characterized by multi-factor coupling, increasing non-stationarity, and strong periodicity. It establishes a high-precision power load forecasting model. By integrating multi-source information, mining deep data features, and introducing advanced modeling techniques, this invention develops a novel forecasting method that is highly adaptable and reliable. This provides more effective decision support for refined power grid scheduling, optimized resource allocation, and safe and stable operation, thereby powerfully promoting the robust construction and high-quality development of new power systems.

[0054] S2. The preprocessed power load sequence is stabilized using Variational Mode Decomposition (VMD) based on a Genetic Algorithm (GA), dividing the sequence into various stationary modes and residuals. For example... Figure 3 As shown, the specific process of S2 is as follows: S21. Based on variational mode decomposition, the preprocessed power load sequence is processed. Variational mode decomposition is essentially a variational constraint problem, where each mode has a fixed bandwidth, and the bandwidths of different modes do not overlap. The goal is to minimize the sum of the bandwidths of all modes. Therefore, based on this logic, the following variational constraint equation can be obtained:

[0055] in, for The first time decomposition obtained One modality, yes The simplified form, For the first The center frequency of each mode Represents a partial differential operator, with respect to time. t Find the partial derivative. Let be the impulse function. For convolution, f This is the preprocessed power load sequence. yes The simplified form, The imaginary unit, This is a Hilbert transform; It is the total number of modes; This represents the square of the L2 norm.

[0056] S22, As shown in the above formula, and The problem is difficult to solve directly due to the mutual coupling between the two elements. Therefore, it is transformed into an unconstrained variational problem using the "Lagrange multiplier method," while introducing a quadratic penalty factor to control the constraint. The resulting augmented Lagrange function can then be viewed as an iteration to minimize the Lagrange function in the next iteration.

[0057] in, For Lagrange multipliers, yes The simplified form, Punishment factor The inner product symbol is used. The first term of the formula represents the center frequency of the intrinsic mode. The second term is the total bandwidth constraint, the third term is the signal reconstruction penalty term, and the fourth term is the introduced quadratic penalty factor.

[0058] S23. Using the alternating direction multiplication operator for iteration, the iteration process for the k-th mode is as follows: S231. Initialization, perform the following operations. Frequency domain transformation of the original signal, that is, transforming it using Fourier transform. Become .

[0059] Initialize the frequency domain signal and center frequency of each mode, that is... and It was initially set to 0.

[0060] The number of iterations r = 0. Wherein, , , They are respectively , , Fourier transform. S232, Update No. One mode, namely .

[0061] S233. After completing S232, iteratively update the... The center frequency of each mode, i.e. .

[0062] S234. After completing S233, calculate and update the... The specific execution logic of the modal Lagrange multipliers is as follows:

[0063] in The iteration step size is usually greater than 0 to control the convergence speed; in this invention, it is set to 0.1.

[0064] S235. Determine if convergence has occurred. If the convergence criteria are met, output the frequency domain signal for each mode. If convergence has not occurred, increment the iteration count by 1 and return to S232 to continue iteration. The convergence criteria are as follows:

[0065] S24. After updating and iterating to obtain the frequency domain signal of each mode, inversely transform it to... Then, the residual is obtained using the following logic:

[0066] S25. In the above decomposition process, the mode decomposition number K and the penalty factor Two hyperparameters need to be entered by the user. K determines the number of modal decompositions. Too high a value may produce spurious modes, while too low a value may cause temporal features to be hidden. The bandwidth of the modal components is crucial; too high a bandwidth can lead to local information hiding, while too low a bandwidth can cause mode aliasing. Therefore, hyperparameters need to be optimized before decomposition. This embodiment uses a genetic algorithm to optimize the modal decomposition number K and the penalty factor. Optimization is performed using genetic algorithms, which are existing technologies. The detailed process of step S25 is as follows: S251. Determine the total number of modes K and the penalty factor. The reasonable distribution ranges are respectively , , These are the minimum and maximum values ​​of the total number of modes. The minimum and maximum values ​​of the penalty factor are used to limit the parameter search boundary and avoid invalid searches; where It is a binary encoding with a length of , It is encoded as a real number and directly represented as a floating-point number.

[0067] S252. The fitness function is set based on the minimum mean square error of reconstruction after decomposition. The specific logic is as follows:

[0068] in, The length of the power load sequence. For the power load sequence after decomposition and reconstruction of all modes, the smaller the MSE, the more completely the original signal can be reflected after reconstruction. The information contained in the original signal is also fully contained in each mode.

[0069] S253. Randomly generate 500 populations, where each individual in the population represents a pair of K and K. K is randomly generated using binary encoding within the specified interval. Generated through uniform sampling within an interval. This provides a starting point for subsequent evolution; random distribution ensures the coverage of the search range; and the K and S values ​​of each population are utilized. Substitute the values ​​into the mode decomposition process and then calculate the fitness function value.

[0070] S254, Roulette wheel selection operator: The reciprocal of the fitness function value is taken as the selection probability. The lower the fitness value, the easier it is to be selected. The selection probability is used to randomly select from 500 populations. The selection can be repeated. Another 500 populations are selected as offspring.

[0071] S255, Crossover operation, simulating "gene exchange", the original 500 individuals are the parents, and the newly selected 500 are the offspring. Each offspring corresponds to two parameters K and of the parents. Gene exchange (parental crossover to produce new offspring, from which 500 are selected) yields a new K. Taking two of the child generations as an example, the specific execution logic is as follows: The binary encodings of the two corresponding parent values ​​of K are as follows: , .

[0072] If we randomly select intersection point c and perform a crossover, the binary code of the offspring K will be: The binary code of one of the offspring K is

[0073] The binary encoding of K in another offspring is

[0074] Where | represents the intersection position.

[0075] Each corresponds to two parent generations for: , ; One of the offspring for:

[0076] Another offspring for:

[0077] The weights are randomized, and the crossover probability is 0.8, meaning that the above operation is performed on 400 random offspring populations.

[0078] S256, Mutation operation, mutation probability is 0.1, that is, randomly select 50 offspring from 500 offspring and perform the following operation: K: Randomly select 1 binary bit and flip it.

[0079] Add random perturbation to a normal distribution, and the result after adding random perturbation... for ,in For normally distributed noise, if the noise exceeds the interval, the interval boundary value is used.

[0080] S257, Reusing the offspring's K and Perform mode decomposition, calculate fitness, and retain the 10% with the best fitness in each generation, that is, the 50 populations with the lowest fitness, to avoid the loss of excellent solutions due to crossover and mutation, and accelerate convergence. S258, Repeat the above operation until the average fitness value for 10 consecutive generations is less than 10. -4 The final output is K and the value corresponding to the minimum fitness. The final value is used for final mode decomposition.

[0081] S3. Construct a BiLSTM-Transformer hybrid network. The BiLSTM-Transformer hybrid network sets a transition layer between the BiLSTM model and the Transformer network. K modes and residuals are merged with the exogenous factor matrix to obtain K+1 input matrices. Time-window sliding values ​​are used to input these K+1 input matrices as samples into the BiLSTM-Transformer hybrid network, resulting in K+1 prediction results. The sum of these K+1 prediction results corresponds to the predicted power load at P future times. A loss function is set for the BiLSTM-Transformer hybrid network, and the network is trained to obtain a trained model. After training, real-time collected data is input into the trained model to obtain K+1 prediction results. These prediction results are then superimposed and reconstructed; the reconstructed result is the predicted power load value. Figure 4 and Figure 5 As shown, the specific process of S3 is as follows: S31. Normalize the k-th mode (use the residual after all modal components have been selected), and then merge it with the exogenous factor matrix. The merging method is to directly use it as a new column of the exogenous factor matrix.

[0082] S311. Construct the model input, for the k-th modal sequence The residuals and exogenous factor matrix are normalized respectively, and the specific logic is as follows:

[0083]

[0084] in, For the first k The input matrix consists of a modal sequence and an exogenous factor matrix. y As independent exogenous influencing factors (including temperature, humidity, and time coding, etc.), For normalized , for The first time decomposition obtained One modality, After normalization , This represents the normalized result of the recorded value of the (m+4)th influencing factor at time n. For ease of subsequent operations, it is denoted as... for Where D is the total feature dimension and N is the total number of samples.

[0085] S312. For each input, take the first 80% of N as the training set and the last 20% as the test set.

[0086] S32. Construct a loss function that not only focuses on the numerical difference between the true value and the predicted value, but also on whether the fluctuation trend of the predicted value is consistent with the true value.

[0087] S321. Define the Huber loss function. The specific execution logic is as follows:

[0088] in, Represents the predicted value. For the true value, This is the error threshold. When... Huber degenerates into MSE to ensure gradient smoothness and accelerate convergence; when Huber degenerates into MAE to avoid the excessive impact of outliers on the loss.

[0089] S322. Define a penalty term to ensure consistent fluctuation trends. The specific execution logic is as follows:

[0090] in, For the predicted value in t Time fluctuation is the difference between the predicted value at the current moment and the predicted value at the previous moment. The true value fluctuates at time t, and is the difference between the true value at the current moment and the true value at the previous moment. Indicates the predicted length.

[0091] S323. The total loss function is constructed, and the specific execution logic is as follows:

[0092] in, Let be the predicted value of the i-th sample at time t. Let i be the true value of the i-th sample at time t. Let be the predicted value for the i-th sample. Let be the true value of the i-th sample.

[0093] S33. Construct a Bidirectional Long Short-Term Memory (BiLSTM) neural network. BiLSTM is an improvement on recurrent neural networks and is one of the representative models of deep learning. It not only effectively avoids gradient explosion but also effectively captures bidirectional temporal dependencies in time-series data. The BiLSTM network includes a forget gate, an input gate, and an output gate. The forget gate preserves useful information from the previous time step to the current cell state; the input gate handles information input and cell state update preparation; and the output gate filters all previous information and determines the information to be used in the next computation.

[0094] S331. Set the length of the time window to L and the step size to 1. Slide the input matrix to obtain values ​​and output the prediction results for the next P time points.

[0095] For example, the first sample

[0096] The corresponding output is:

[0097] Second sample

[0098] The corresponding output is:

[0099] S332, sequentially x iInputting into a BiLSTM network begins the construction of a hybrid neural network. The first step is to establish a forget gate, the specific logic of which is as follows:

[0100] in, For the sigmoid function, Here is the forget gate weight matrix. To offset the forget gate, ( For positive dissemination, (For backpropagation) is the hidden state from the previous moment. This is the i-th sample input at the current time.

[0101] S333, Next, the input gate is constructed. The specific logic is as follows:

[0102]

[0103] For input gate, The input gate weight matrix, For input gate bias, This is the current candidate state. The candidate state weight matrix is... This is used to bias the candidate state.

[0104] S334. Cell state update: Retaining candidate information to achieve "memory," the specific logic of which is as follows:

[0105] C t This represents the current state. For Hadamard products.

[0106] S335, the output gate, has the following execution logic:

[0107]

[0108] in, For output gate, This is the output gate weight matrix. For output gate bias, This represents the hidden state at the current time step. The inverse LSTM, which inputs the time series from back to front (t=L decreasing to 1), implements the same logic. Combining the two forms the basic unit of a BiLSTM. The final output is as follows:

[0109] in, This is a hidden state for reverse transmission. This is the output after merging.

[0110] S336, single-layer BiLSTM output is:

[0111] After stacking multiple BiLSTM layers, the first l Output of the BiLSTM layer:

[0112] in, Indicates the first l Layered BiLSTM, The 0th layer is the input sample, and the final output of the multi-layer stacked BiLSTM is... .

[0113] S34. Construct a transitional blending layer for the BiLSTM to Transformer transition. Traditional model construction often directly cuts or pads the output of the previous model with zeros to meet the input requirements of the next model. This coarse-grained fusion method easily loses important model features, ultimately leading to reduced model accuracy. Therefore, this invention proposes a two-stage transition structure of "linear projection layer + LayerNorm normalization layer" to ensure that BiLSTM features can be smoothly passed to the Transformer. The BiLSTM output is converted into Transformer-compatible feature dimensions, including: S341, Linear Projection Layer, the specific execution logic is as follows:

[0114] in, For projection weights, For projection bias, The sequence output by the linear projection layer. The sequence output by the linear projection layer is the first... Each element.

[0115] S342, LayerNorm normalization layer, the specific execution logic is as follows:

[0116] in , for z The mean and standard deviation of the sequence, after standardization, are output as follows:

[0117] in, The sequence output by the LayerNorm normalized layer. The sequence output by the LayerNorm normalization layer Each element.

[0118] S35. While the BiLSTM constructed in the above steps can effectively model short-term local temporal correlations, its recursive structure limits its ability to extract features related to long-term dependencies. Therefore, a neural network is further constructed based on the Transformer, an architecture that has received widespread attention in recent years. The Transformer consists of an encoder and a decoder and includes a multi-head attention mechanism, which can effectively capture long-term dependencies. The hybrid model built by leveraging the advantages of both is good at handling short-term series and can capture dependencies in long-term series, achieving global capture of power load features.

[0119] The encoder and decoder are composed of stacked functional blocks with similar structures, each consisting of a multi-head attention layer and a neural network layer. The specific implementation logic of these functional blocks is as follows: S351. Input Mapping: Maps the input sequence into three vector matrices. The specific execution logic is as follows:

[0120] Where Q, K, and V are the query vector, key vector, and value vector, respectively. , and These are the weight matrices corresponding to the query vector, key vector, and value vector, respectively. This represents the feature dimensions of the query vector, key vector, and value vector. In this example, 72 is used.

[0121] S352. Split into multiple attention heads: This involves splitting the above vector matrix by dimension, resulting in h attention heads. Each attention head has a dimension of h. , with the first Taking the vector matrix of an attention head as an example, the specific execution logic is as follows (in this invention, it is split into 8 heads, each head having a dimension of 9):

[0122] in, This means retrieving all rows. Indicates taking the first Listed to number For example, in this embodiment, , When equal to 1, , indicating that the query vector is retrieved. Take the query vector from all rows. The query vector for the first attention head is obtained from columns 0 to 9. .

[0123] S353. Self-attention weights: Self-attention weights are calculated in the encoder, using activation functions to calculate the scores of each vector. The specific execution logic is as follows:

[0124] in, The first Each attention head corresponds to a query vector, key vector, and value vector. Softmax is the activation function used to calculate the weights. This is a scaling factor to avoid gradient explosion. T For transpose; S354. Multi-head fusion: The attention outputs of h heads are concatenated and then fused into the final result through a linear transformation. The specific execution logic is as follows:

[0125] in, Calculate the weight matrix for multiple heads. For splicing operations; S355, residual connections and layer normalization, alleviate the gradient vanishing problem in deep networks, making the model easier to train. The specific execution logic is as follows:

[0126]

[0127] in, Presentation layer normalization operation.

[0128] S356, Feedforward Neural Network: Implements nonlinear transformation of the input sequence, enhancing the nonlinear modeling capability of the Transformer. The specific execution logic is as follows:

[0129] in, It is a feedforward neural network. and It is the weight matrix of the linear layer of the feedforward neural network. and These are all biases of feedforward neural networks. Indicates the activation function; S357, Normalization and Residual Connections: Residual connections help alleviate the vanishing gradient problem in networks. Normalization normalizes the features of each sample, reducing internal covariate shifts and ensuring smooth convergence during training, thereby improving training stability. The specific execution logic is as follows:

[0130] in, This is the output of the current Transformer network.

[0131] S358, Multi-layer Transformer stacking, where the output of the upper layer is used as the input of the lower layer. For example, the output of the second-layer Transformer network is:

[0132] The final output is:

[0133] in, This represents the total number of layers in the Transformer network; in this example, the total number of layers is 3.

[0134] S359. The above-mentioned hybrid network connection and final output are completed through a fully connected layer. The specific execution logic is as follows:

[0135] in, W is the weight matrix of the fully connected layer. b, B This is used for biasing the fully connected layer.

[0136] S36. Repeat steps S31-S35 to start training. Stop training when the loss function value is minimized or the preset number of iterations is reached, and you will get the trained model.

[0137] S4. After training, the real-time collected data is input into the trained model to obtain the prediction results corresponding to each mode and residual. The prediction results are then superimposed and reconstructed. The reconstructed result is the predicted power load value. After comparison with the actual value, the result is evaluated. The superposition and reconstruction method is to directly add the prediction results together.

[0138] Results were evaluated using RMSE, MAE, and R. 2 The specific execution logic for evaluating the indicators is as follows:

[0139]

[0140]

[0141] in, The mean is used. RMSE, as a comprehensive index of error analysis, reflects the accuracy of prediction, while MAE assesses the degree of fluctuation in model prediction error, reflecting the robustness and stability of the model. The better the model fits the regression curve, the closer it is to 1.

[0142] Using data from a certain region from 2015 to 2019 as the dataset, experiments were conducted using the model proposed in this invention, and compared with current state-of-the-art models. The results are shown in Table 1 below. In terms of prediction accuracy, the model proposed in this invention has the highest accuracy, followed by CEEMD+BiLSTM. CEEMD is a complementary set empirical mode decomposition model, and its lower accuracy may be due to its failure to grasp the long-term characteristics of the sequence. Meanwhile, the model proposed in this invention has the lowest RMSE and MAE in the experimental results. The reason why other models have larger errors may be that they only focus on the difference between the predicted value and the true value, while ignoring the requirement for consistency of sequence fluctuations. In summary, the RMSE of the model proposed in this invention is reduced by 52.7% and the MAE is reduced by 73.9% compared to CEEMD+BiLSTM, demonstrating the superiority and robustness of this invention.

[0143] Table 1 Comparison results with various advanced models

[0144] Through the above technical solutions, this invention enables high-precision prediction of power load in increasingly complex new power systems. Specifically, it solves the technical problems of existing technologies, such as the inability to comprehensively handle the short-term and long-term characteristics of load sequences, the failure to filter out various complex interferences, the failure to fully utilize the hidden characteristic relationships of power load sequences, and the neglect of sequence volatility by traditional loss functions. By building a VMD-BiLSTM-Transformer model, a three-level structure of sequence decomposition, local modeling, and global dependency is realized. By integrating multi-source information, mining deep data features, and introducing advanced modeling techniques, a novel prediction method with strong adaptability and reliable accuracy is developed, providing more effective decision support for the refined scheduling, resource optimization, and safe and stable operation of the power grid, thereby powerfully promoting the robust construction and high-quality development of new power systems.

[0145] This invention enables power load forecasting in complex scenarios. By using historical load data and corresponding characteristic values, it predicts future loads and achieves accurate load forecasting even under extreme weather conditions with drastic fluctuations in factors such as temperature and precipitation. This further promotes the "resilience" of new power systems, improves dispatching and operation auxiliary decision-making functions, and deepens the development of forecasting technology. This invention helps the power grid achieve coordinated interaction among power sources, grid, load, and storage, optimizes real-time power supply and demand balance, improves overall grid energy utilization efficiency, reduces system operating costs, and supports precise control of flexible resources, thus possessing significant economic benefits.

[0146] This invention designs and clarifies an electricity load forecasting system. Based on traditional forecasting methods, it further optimizes the sequence distribution and mines sequence features, exhibiting strong robustness. In addition, it achieves a high degree of integration in the implementation of the electricity load forecasting method and simplifies the operation.

[0147] This invention introduces cyclic encoding in the data preprocessing stage. This encoding method helps the model comprehensively grasp the periodic dependence of sequences, thus optimizing prediction performance. VMD is used for mode decomposition, and a genetic algorithm is combined to optimize hyperparameters by minimizing MSE. The decomposition mode proposed in this invention is better at handling non-stationary data, can more accurately reconstruct the data to be predicted, and further improves prediction accuracy. A novel hybrid model is constructed by integrating the advantages of BiLSTM and Transformer to achieve global capture of load sequence features.

[0148] Example 2 like Figure 6 As shown in Embodiment 1, Embodiment 2 of the present invention also provides a power load forecasting system, comprising: The data processing module is used to collect the original power load sequence and influencing factor sequence, perform data preprocessing on the original power load sequence and influencing factor sequence, and use the trigonometric function method to encode the time label of the preprocessed power load sequence. The encoded result of the time label is used as a new column in the influencing factor sequence, so that the influencing factor sequence and the encoded result of the time label are merged to form an exogenous factor matrix. The mode decomposition module is used to perform mode decomposition on the preprocessed power load sequence using variational mode decomposition based on genetic algorithm, decomposing it into K modes and residuals; The network construction module is used to build a BiLSTM-Transformer hybrid network. The BiLSTM-Transformer hybrid network sets a transitional mixing layer between the BiLSTM model and the Transformer network. K modes and residuals are merged with the exogenous factor matrix to obtain K+1 input matrices. Time window sliding values ​​are applied to each of the K+1 input matrices as samples input to the BiLSTM-Transformer hybrid network, resulting in K+1 prediction results. The sum of these K+1 prediction results corresponds to the predicted power load values ​​at P future time points. The loss function of the BiLSTM-Transformer hybrid network is set, and the network is trained to obtain a trained model. The testing and evaluation module is used to input real-time collected data into the trained model after training to obtain K+1 prediction results. The prediction results are then superimposed and reconstructed to obtain the power load prediction value.

[0149] Specifically, the original power load sequence is a power load sequence with n data points, with one data point collected every second, and n corresponding to the nth time point; the influencing factor sequence has n rows and m columns, and the data in the nth row and mth column represents the recorded value of the mth influencing factor at the nth time point.

[0150] Specifically, the method of using trigonometric functions to encode the time labels of the preprocessed power load sequence, and using the encoded time label results as new columns in the influencing factor sequence, merges the influencing factor sequence with the encoded time label results to form an exogenous factor matrix, including: The encoding formula is Where T is the time period, For the current moment, The result is a sine code. Cosine encoding result; The time period is 12. Using integers from 0 to 11, the months in the time tags of the preprocessed power load sequence are encoded using the encoding formula to obtain the sine and cosine encoding results for the months; the time period is 24. Take integers from 0 to 23, encode the hours in the time tag of the preprocessed power load sequence using the encoding formula, and obtain the sine encoding result and the cosine encoding result of the hour; take the above four encoding results as four new columns in the influencing factor sequence, so that the encoding results of the influencing factor sequence and the time tag are merged to form the exogenous factor matrix.

[0151] Specifically, the mode decomposition module is also used for: S21. Based on variational mode decomposition, the preprocessed power load sequence is processed, and the variational constraint equation is:

[0152] in, for The first time decomposition obtained One modality, yes The simplified form, For the first The center frequency of each mode Represents a partial differential operator, with respect to time. t Find the partial derivative. Let be the impulse function. For convolution, f This is the preprocessed power load sequence. yes The simplified form, The imaginary unit, This is a Hilbert transform; It is the total number of modes; Represents the square of the L2 norm; S22. Convert the variational constraint into a Lagrangian function:

[0153] in, For Lagrange multipliers, yes The simplified form, Punishment factor The inner product symbol is used. Indicates the center frequency of the intrinsic mode; S23. Under the premise of minimizing the Lagrange function, the iterative process is performed using the alternating direction multiplication operator as follows:

[0154]

[0155]

[0156] in, For iteration rounds, , , They are respectively , , Fourier transform, This is the iteration step size; Determine if convergence has occurred. If the convergence criteria are met, output the frequency domain signal of each mode. If convergence has not occurred, increment the iteration count by 1 and continue iterating. The convergence criteria are as follows: ; S24. After updating and iterating to obtain the frequency domain signal of each mode, inversely transform it to... Then, the residuals are obtained using the following formula: .

[0157] More specifically, the mode decomposition module is also used for: the total number of modes and penalty factor The solution was obtained through optimization using a genetic algorithm.

[0158] Specifically, the working process of the BiLSTM-Transformer hybrid network is as follows: A time window of length L is slid across the acquired input matrix with a step size of 1, obtaining one sample per slide. The sample is then input into a multi-layer BiLSTM network to obtain the output. ,Will The input is a transition blending layer, which consists of a sequentially connected linear projection layer and a LayerNorm normalization layer. The output of the transition blending layer is a sequence. ,sequence Inputting the sequence into a Transformer network, the Transformer network will process the sequence into a Transformer network. The vectors are weighted and mapped to query vectors, key vectors, and value vectors respectively. These vectors are then split into multiple attention heads by dimension. Each attention head performs self-attention computation. The results of all attention heads' self-attention computations are concatenated and multiplied by the multi-head computation weight matrix to obtain the multi-head fusion result. The multi-head fusion result is compared with the sequence. After performing residual connections, layer normalization is then performed to obtain the sequence. ;sequence Input feedforward neural network uses formula Processing is carried out, among which, It is a feedforward neural network. and It is the weight matrix of the linear layer of the feedforward neural network. and All are biased. This represents the activation function; then, through the formula... The output of the current Transformer network is obtained, where, The representation layer normalization operation is performed; multiple Transformer networks are set up, with the output of the upper Transformer network serving as the input of the lower Transformer network, and the final output is... Finally, the prediction results are output through a fully connected layer.

[0159] Specifically, the loss function construction process of the BiLSTM-Transformer hybrid network is as follows: The Huber loss function is defined as follows:

[0160] in, Represents the predicted value. For the true value, This is the error threshold; The penalty items are defined as follows:

[0161] in, For the predicted value in t Time fluctuations, The true value fluctuates at time t. Indicates the predicted length; The loss function is as follows:

[0162] in, Let be the predicted value of the i-th sample at time t. Let i be the true value of the i-th sample at time t. Let i be the predicted value of the i-th sample and , The true value of the i-th sample and N is the total number of samples.

[0163] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting electricity load, characterized in that, include: S1. Collect the original power load sequence and influencing factor sequence, perform data preprocessing on the original power load sequence and influencing factor sequence, and use the trigonometric function method to encode the time label of the preprocessed power load sequence. Use the time label encoding result as a new column in the influencing factor sequence, so that the influencing factor sequence and the time label encoding result are merged to form an exogenous factor matrix. S2. The preprocessed original power load sequence is decomposed into K modes and residuals using variational mode decomposition based on genetic algorithm. S3. Construct a BiLSTM-Transformer hybrid network. The BiLSTM-Transformer hybrid network sets a transition mixing layer between the BiLSTM model and the Transformer network. The K modes and residuals are merged with the exogenous factor matrix to obtain K+1 input matrices. The K+1 input matrices are sampled by sliding time window values ​​as samples input to the BiLSTM-Transformer hybrid network to obtain K+1 prediction results. The sum of the K+1 prediction results corresponds to the predicted power load values ​​at P future time points. Set the loss function of the BiLSTM-Transformer hybrid network, train the BiLSTM-Transformer hybrid network, and obtain the trained model; S4. After training is completed, the real-time collected data is input into the trained model to obtain K+1 prediction results. The prediction results are superimposed and reconstructed, and the reconstructed result is the predicted power load value.

2. The power load forecasting method according to claim 1, characterized in that, The original power load sequence is a power load sequence with n data points, with one data point collected per second, and n corresponding to the nth time point; the influencing factor sequence has n rows and m columns, and the data in the nth row and mth column represents the recorded value of the mth influencing factor at the nth time point.

3. The power load forecasting method according to claim 1, characterized in that, The method of using trigonometric functions to encode the time labels of the preprocessed power load sequence, and using the encoded time label results as new columns in the influencing factor sequence, merges the influencing factor sequence with the encoded time label results to form an exogenous factor matrix, including: The encoding formula is Where T is the time period, For the current moment, The result is a sine code. Cosine encoding result; The time period is 12. Using integers from 0 to 11, the months in the time tags of the preprocessed power load sequence are encoded using the encoding formula to obtain the sine and cosine encoding results for the months; the time period is 24. Take integers from 0 to 23, encode the hours in the time tag of the preprocessed power load sequence using the encoding formula, and obtain the sine encoding result and the cosine encoding result of the hour; take the above four encoding results as four new columns in the influencing factor sequence, so that the encoding results of the influencing factor sequence and the time tag are merged to form the exogenous factor matrix.

4. The power load forecasting method according to claim 1, characterized in that, S2 includes: S21. Based on variational mode decomposition, the preprocessed power load sequence is processed, and the variational constraint equation is: in, for The first time decomposition obtained One modality, yes The simplified form, For the first The center frequency of each mode Represents a partial differential operator, with respect to time. t Find the partial derivative. Let be the impulse function. For convolution, f This is the preprocessed power load sequence. yes The simplified form, The imaginary unit, This is a Hilbert transform; It is the total number of modes; Represents the square of the L2 norm; S22. Convert the variational constraint into a Lagrangian function: in, For Lagrange multipliers, yes The simplified form, Punishment factor The inner product symbol is used. Indicates the center frequency of the intrinsic mode; S23. Under the premise of minimizing the Lagrange function, the iterative process is performed using the alternating direction multiplication operator as follows: in, For iteration rounds, , , They are respectively , , Fourier transform, This is the iteration step size; Determine if convergence has occurred. If the convergence criteria are met, output the frequency domain signal of each mode. If convergence has not occurred, increment the iteration count by 1 and continue iterating. The convergence criteria are as follows: ; S24. After updating and iterating to obtain the frequency domain signal of each mode, inversely transform it to... Then, the residuals are obtained using the following formula: 。 5. The power load forecasting method according to claim 4, characterized in that, S2 further includes: the total number of modes and penalty factor The solution was obtained through optimization using a genetic algorithm.

6. The power load forecasting method according to claim 1, characterized in that, The working process of the BiLSTM-Transformer hybrid network is as follows: A time window of length L is slid across the acquired input matrix with a step size of 1, obtaining one sample per slide. The sample is then input into a multi-layer BiLSTM network to obtain the output. ,Will The input is a transition blending layer, which consists of a sequentially connected linear projection layer and a LayerNorm normalization layer. The output of the transition blending layer is a sequence. ,sequence Inputting the sequence into a Transformer network, the Transformer network will process the sequence into a Transformer network. The vectors are weighted and mapped to query vectors, key vectors, and value vectors respectively. These vectors are then split into multiple attention heads by dimension. Each attention head performs self-attention computation. The results of all attention heads' self-attention computations are concatenated and multiplied by the multi-head computation weight matrix to obtain the multi-head fusion result. The multi-head fusion result is compared with the sequence. After performing residual connections, layer normalization is then performed to obtain the sequence. ;sequence Input feedforward neural network uses formula Processing is carried out, among which, It is a feedforward neural network. and It is the weight matrix of the linear layer of the feedforward neural network. and All are biased. This represents the activation function; then, through the formula... The output of the current Transformer network is obtained, where, The representation layer normalization operation is performed; multiple Transformer networks are set up, with the output of the upper Transformer network serving as the input of the lower Transformer network, and the final output is... Finally, the prediction results are output through a fully connected layer.

7. The power load forecasting method according to claim 1, characterized in that, The loss function construction process of the BiLSTM-Transformer hybrid network is as follows: The Huber loss function is defined as follows: in, Represents the predicted value. For the true value, This is the error threshold; The penalty terms are defined as follows: in, For the predicted value in t Time fluctuations, The true value fluctuates at time t. Indicates the predicted length; The loss function is as follows: in, Let be the predicted value of the i-th sample at time t. Let i be the true value of the i-th sample at time t. Let i be the predicted value of the i-th sample and , The true value of the i-th sample and N is the total number of samples.

8. A power load forecasting system, characterized in that, include: The data processing module is used to collect the original power load sequence and influencing factor sequence, perform data preprocessing on the original power load sequence and influencing factor sequence, and use the trigonometric function method to encode the time label of the preprocessed power load sequence. The encoded result of the time label is used as a new column in the influencing factor sequence, so that the influencing factor sequence and the encoded result of the time label are merged to form an exogenous factor matrix. The mode decomposition module is used to perform mode decomposition on the preprocessed power load sequence using variational mode decomposition based on genetic algorithm, decomposing it into K modes and residuals; The network construction module is used to build a BiLSTM-Transformer hybrid network. The BiLSTM-Transformer hybrid network sets a transition mixing layer between the BiLSTM model and the Transformer network. The K modes and residuals are merged with the exogenous factor matrix to obtain K+1 input matrices. The K+1 input matrices are then sampled by sliding time windows as samples input to the BiLSTM-Transformer hybrid network to obtain K+1 prediction results. The sum of the K+1 prediction results corresponds to the predicted power load values ​​at P future time points. Set the loss function of the BiLSTM-Transformer hybrid network, train the BiLSTM-Transformer hybrid network, and obtain the trained model; The testing and evaluation module is used to input real-time collected data into the trained model after training to obtain K+1 prediction results. The prediction results are then superimposed and reconstructed to obtain the power load prediction value.

9. A power load forecasting system according to claim 8, characterized in that, The original power load sequence is a power load sequence with n data points, with one data point collected per second, and n corresponding to the nth time point; the influencing factor sequence has n rows and m columns, and the data in the nth row and mth column represents the recorded value of the mth influencing factor at the nth time point.

10. A power load forecasting system according to claim 8, characterized in that, The method of using trigonometric functions to encode the time labels of the preprocessed power load sequence, and using the encoded time label results as new columns in the influencing factor sequence, merges the influencing factor sequence with the encoded time label results to form an exogenous factor matrix, including: The encoding formula is Where T is the time period, For the current moment, The result is a sine code. Cosine encoding result; The time period is 12. Using integers from 0 to 11, the months in the time tags of the preprocessed power load sequence are encoded using the encoding formula to obtain the sine and cosine encoding results for the months; the time period is 24. Take integers from 0 to 23, encode the hours in the time tag of the preprocessed power load sequence using the encoding formula, and obtain the sine encoding result and the cosine encoding result of the hour; take the above four encoding results as four new columns in the influencing factor sequence, so that the encoding results of the influencing factor sequence and the time tag are merged to form the exogenous factor matrix.

Citation Information

Patent Citations

  • Load prediction method of power system based on big data

    CN119340965A

  • Novel power system load prediction method

    CN119539187A

  • Transform model-based power load prediction method and system, and medium

    CN119539191A

  • Short-term power load prediction method combining improved empirical mode decomposition and bidirectional long short-term memory network

    CN120764762A