Power system load forecasting method based on modal decomposition and independent attention mechanism

Through the load prediction method of power system with modal decomposition and independent attention mechanism, the prediction difficulties caused by large load volatility and non-stationarity characteristics are solved, and load prediction with higher accuracy and efficiency is achieved, which improves the stability and management efficiency of the power grid.

CN119561009BActive Publication Date: 2025-09-02CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411591491.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-09-02
Estimated Expiration
2044-11-08

AI Technical Summary

Technical Problem

When the existing power system load prediction methods deal with large load fluctuations and non-stationarity characteristics, it is difficult to achieve efficient and accurate load prediction, which affects the stability and management efficiency of the power system.

Method used

The load prediction method of power system based on modal decomposition and independent attention mechanism is adopted, and the components of the eigenmodal function are obtained through empirical modal decomposition, and the iTransformer model is used for prediction, combining the independent attention mechanism to process the dependencies between variables to improve prediction accuracy.

Benefits of technology

It significantly improves the accuracy and efficiency of load sequence data analysis and prediction, enhances the stability and robustness of the power grid, improves the grid management and operation efficiency, and provides support for the development of smart grids.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561009B_ABST
    Figure CN119561009B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for power system load forecasting based on modal decomposition and an independent attention mechanism, comprising: obtaining historical load data for load forecasting; performing empirical mode decomposition on the historical load data to obtain a first intrinsic mode function component, and obtaining a second intrinsic mode function component based on the first intrinsic mode function component; constructing an i Transformer model including an independent attention mechanism; inputting the second intrinsic mode function component into the i Transformer model, and outputting a load forecast value. The model proposed in the present invention has higher prediction performance than current mainstream prediction models. When applied to power grids, it can significantly improve the accuracy and efficiency of load sequence data analysis and prediction, enhance the stability and robustness of the power grid, improve the efficiency of power grid management and operation, and provide strong support for the development of smart grids.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power grid dispatching and control automation technology, and more specifically, to a power system load forecasting method and system based on modal decomposition and independent attention mechanism. Background Art

[0002] Power system load forecasting, a crucial component of power system regulation, has long garnered significant attention from power experts and scholars. Power system load forecasting refers to the process of predicting power system load over a specific period of time. Ultra-short-term load forecasting involves predicting load data for the next hour. The primary purpose of load forecasting is to predict future power demand for effective management of power supply and system stability. Therefore, accurate load forecasting is crucial for reliable power system operation and safe management.

[0003] In terms of methods, power system load forecasting involves multiple technical means. Time series analysis is one of the most basic methods. By analyzing historical load data, autoregressive models, moving average models, etc. are used to predict future loads. Regression analysis makes predictions by establishing the relationship between load and meteorological factors (such as temperature and humidity), economic activities, etc. In recent years, machine learning and deep learning methods have been widely used in load forecasting, including support vector machines (SVM), random forests (RF), long short term memory networks (LSTM), Transformers and their various variants. These methods can handle complex data patterns and improve the prediction accuracy to a certain extent compared with traditional methods.

[0004] Load fluctuations are often large and non-stationary. Using empirical mode decomposition (EMD) to filter data can reduce the complexity of load series. The intrinsic mode function (IMF) components derived from modal decomposition are numerous, and reorganization of these components is necessary to reduce computational time. Predictive models are particularly important for load forecasting. New, highly accurate models are needed, and improvements should be considered to maximize their performance and improve forecast accuracy.

[0005] Therefore, a power system load forecasting method and system based on modal decomposition and independent attention mechanism is needed. Summary of the Invention

[0006] The present invention proposes a power system load forecasting method and system based on modal decomposition and independent attention mechanism to solve the problem of how to perform load forecasting efficiently.

[0007] In order to solve the above problems, according to one aspect of the present invention, a power system load forecasting method based on modal decomposition and independent attention mechanism is provided, the method comprising:

[0008] Obtain historical load data for load forecasting;

[0009] Performing empirical mode decomposition on the load history data to obtain a first intrinsic mode function component, and obtaining a second intrinsic mode function component based on the first intrinsic mode function component;

[0010] Build an iTransformer model with independent attention mechanism;

[0011] The second intrinsic mode function component is input into the iTransformer model, and a load prediction value is output.

[0012] Preferably, performing empirical mode decomposition on the load history data to obtain the first intrinsic mode function component includes:

[0013] The load sequence X(t) composed of historical load data is transformed into Calculate its instantaneous amplitude A(t) and instantaneous frequency for:

[0014]

[0015] Using A({t max}) and A({t min}) as the maximum value sequence and minimum value sequence of A(t), and interpolate them to obtain β1(t) and β2(t), and calculate their instantaneous mean a1(t) and instantaneous envelope a2(t) as follows:

[0016]

[0017] right and Interpolate to obtain η1(t) and η2(t), and calculate their instantaneous frequency components and for:

[0018]

[0019]

[0020] Calculate the local cutoff frequency for:

[0021]

[0022] For local cutoff frequency Reconstruct, f(t) is:

[0023]

[0024] Calculate the extreme points of f(t), use the extreme values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t). Calculate the stop signal θ(t) as:

[0025]

[0026] If θ(t) is less than the threshold ξ, then X(t) is taken as a first intrinsic mode function component; if θ(t) is greater than the threshold ξ, then x1(t) = x t -m(t), where m(t) is the local mean value of the instantaneous envelope and is recalculated from equation (1) to equation (9);

[0027] Among them, B Loughlin (t) is the Loughlin instantaneous bandwidth; is the average instantaneous frequency.

[0028] Preferably, obtaining a second eigenmode function component based on the first eigenmode function component includes:

[0029] The sample entropy of each first intrinsic mode function component is calculated based on the sample entropy algorithm, and the first intrinsic mode function components corresponding to the sample entropies whose sample entropy differences are within a preset range are merged to obtain the second intrinsic mode function component.

[0030] Preferably, the sample entropy of each first intrinsic mode function component is calculated based on a sample entropy algorithm, comprising:

[0031] For any first intrinsic mode function component, segmentation processing is performed on the any first intrinsic mode function component to divide it into multiple subsequences with lengths of m and m+1, and the sample entropy of the any first intrinsic mode function component is calculated based on the obtained multiple subsequences.

[0032] Preferably, an iTransformer model including an independent attention mechanism is constructed, comprising:

[0033] (1) Using the independent attention mechanism to process all variable labels, the model learns the interdependence between different variables; the principle of the independent attention mechanism is:

[0034] Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k Output y of region (i, j) ijThe attention formula is:

[0035]

[0036] The position information is embedded in the independent attention mechanism and encoded; where the point at position (i, j) to each position ab∈N k (i, j), it has two offsets, namely row offset ai and column offset bi, which are respectively related to the embedding r a-i and r b-i Influence each other, by connecting the two embeddings, a combined embedding r is formed a-i,b-i , the attention calculation formula after introducing position information is:

[0037]

[0038] Among them, q ij , k ab and v ab They are the query vector, key vector and value vector of the position (i, j) and nearby points respectively; softmax ab It is the softmax calculated among the points adjacent to position (i, j);

[0039] (2) Perform layer-normalization on the output of the attention mechanism in the feedforward layer of the iTransformer model, including:

[0040]

[0041] Where H=[h1,h2,…,h N ] is an input with N variables, h n is the representation vector of the nth variable, and Mean represents the vector h n The mean of Var represents the vector h n The variance of .

[0042] Preferably, the method further comprises:

[0043] Based on the mean absolute error y MAE and the mean absolute percentage error y MAPE Two error evaluation indicators are used to evaluate the model; among them, the error of n prediction results is calculated as follows:

[0044]

[0045] Among them, y act (i) and y pred (i) is the actual value and predicted value of the load at the i-th data point; y act (i) and y predThe smaller the value of (i), the higher the prediction accuracy of the model.

[0046] According to another aspect of the present invention, a power system load forecasting system based on modal decomposition and independent attention mechanism is provided, the system comprising:

[0047] A data acquisition unit, used to acquire historical load data for load forecasting;

[0048] an empirical mode decomposition unit, configured to perform empirical mode decomposition on the load history data to obtain a first intrinsic mode function component, and obtain a second intrinsic mode function component based on the first intrinsic mode function component;

[0049] A model building unit for building an iTransformer model with an independent attention mechanism;

[0050] The prediction unit is used to input the second intrinsic mode function component into the iTransformer model and output a load prediction value.

[0051] Preferably, the empirical mode decomposition unit performs empirical mode decomposition on the load history data to obtain the first intrinsic mode function component, including:

[0052] The load sequence X(t) composed of historical load data is transformed into Calculate its instantaneous amplitude A(t) and instantaneous frequency for:

[0053]

[0054] Using A({t max}) and A({t min}) as the maximum value sequence and minimum value sequence of A(t), and interpolate them to obtain β1(t) and β2(t), and calculate their instantaneous mean a1(t) and instantaneous envelope a2(t) as follows:

[0055]

[0056] right and Interpolate to obtain η1(t) and η2(t), and calculate their instantaneous frequency components and for:

[0057]

[0058] Calculate the local cutoff frequency for:

[0059]

[0060] For local cutoff frequency Reconstruct, f(t) is:

[0061]

[0062] Calculate the extreme points of f(t), use the extreme values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t). Calculate the stop signal θ(t) as:

[0063]

[0064] If θ(t) is less than the threshold ξ, then X(t) is taken as a first intrinsic mode function component; if θ(t) is greater than the threshold ξ, then x1(t) = x t -m(t), where m(t) is the local mean value of the instantaneous envelope and is recalculated from equation (1) to equation (9);

[0065] Among them, B Loughlin (t) is the Loughlin instantaneous bandwidth; is the average instantaneous frequency.

[0066] Preferably, the empirical mode decomposition unit obtains the second eigenmode function component based on the first eigenmode function component, comprising:

[0067] The sample entropy of each first intrinsic mode function component is calculated based on the sample entropy algorithm, and the first intrinsic mode function components corresponding to the sample entropies whose sample entropy differences are within a preset range are merged to obtain the second intrinsic mode function component.

[0068] Preferably, the empirical mode decomposition unit calculates the sample entropy of each first intrinsic mode function component based on a sample entropy algorithm, comprising:

[0069] For any first intrinsic mode function component, segmentation processing is performed on the any first intrinsic mode function component to divide it into multiple subsequences with lengths of m and m+1, and the sample entropy of the any first intrinsic mode function component is calculated based on the obtained multiple subsequences.

[0070] Preferably, the model building unit constructs an iTransformer model including an independent attention mechanism, comprising:

[0071] (1) Using the independent attention mechanism to process all variable labels, the model learns the interdependence between different variables; the principle of the independent attention mechanism is:

[0072] Given an x ij ∈Rd , calculate x ij The nearby position is ab∈N k Output y of region (i, j) ij The attention formula is:

[0073]

[0074] The position information is embedded in the independent attention mechanism and encoded; where the point at position (i, j) to each position ab∈N k (i, j), it has two offsets, namely row offset ai and column offset bi, which are respectively related to the embedding r a-i and r b-i Influence each other, by connecting the two embeddings, a combined embedding r is formed a-i,b-i , the attention calculation formula after introducing position information is:

[0075]

[0076] Among them, q ij , k ab and v ab They are the query vector, key vector and value vector of the position (i, j) and nearby points respectively; softmax ab It is the softmax calculated among the points adjacent to position (i, j);

[0077] (2) Perform layer-normalization on the output of the attention mechanism in the feedforward layer of the iTransformer model, including:

[0078]

[0079] Where H=[h1,h2,…,h N ] is an input with N variables, h n is the representation vector of the nth variable, and Mean represents the vector h n The mean of Var represents the vector h n The variance of .

[0080] Preferably, the system further comprises:

[0081] Evaluation unit for the mean absolute error y MAE and the mean absolute percentage error y MAPE Two error evaluation indicators are used to evaluate the model; among them, the error of n prediction results is calculated as follows:

[0082]

[0083] Among them, y act(i) and y pred (i) is the actual value and predicted value of the load at the i-th data point; y act (i) and y pred The smaller the value of (i), the higher the prediction accuracy of the model.

[0084] Based on another aspect of the present invention, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any step of a power system load forecasting method based on modal decomposition and independent attention mechanism.

[0085] According to another aspect of the present invention, the present invention provides an electronic device, including:

[0086] The computer-readable storage medium described above;

[0087] One or more processors are configured to execute the program in the computer-readable storage medium.

[0088] The present invention provides a power system load forecasting method and system based on modal decomposition and an independent attention mechanism, comprising: obtaining historical load data for load forecasting; performing empirical mode decomposition on the historical load data to obtain a first intrinsic mode function component, and obtaining a second intrinsic mode function component based on the first intrinsic mode function component; constructing an iTransformer model including an independent attention mechanism; inputting the second intrinsic mode function component into the iTransformer model, and outputting a load forecast value. The present invention decomposes a complex time series into several simpler, more basic modal components and reorganizes them, and then predicts each of the reorganized components using an iTransformer model based on independent attention. The proposed model has higher prediction performance than current mainstream prediction models. Its application in power grids can significantly improve the accuracy and efficiency of load series data analysis and forecasting, enhance the stability and robustness of power grids, improve the efficiency of power grid management and operations, and provide strong support for the development of smart grids. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] A more complete understanding of exemplary embodiments of the present invention may be obtained by referring to the following drawings:

[0090] Figure 1 Flowchart of a power system load forecasting method 100 based on modal decomposition and independent attention mechanism according to an embodiment of the present invention;

[0091] Figure 2 Schematic diagram of an ultra-short-term load forecasting process based on modal decomposition and independent attention mechanism according to an embodiment of the present invention;

[0092] Figure 3 A schematic diagram of the structure of an iTransformer model according to an embodiment of the present invention;

[0093] Figure 4 is a schematic diagram of an independent attention calculation method according to an embodiment of the present invention;

[0094] Figure 5 Schematic diagram of the structure of a power system load forecasting system 500 based on modal decomposition and independent attention mechanism according to an embodiment of the present invention. DETAILED DESCRIPTION

[0095] Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings. However, the present invention may be embodied in many different forms and is not limited to the embodiments described herein. These embodiments are provided to provide a thorough and complete disclosure of the present invention and to fully convey the scope of the present invention to those skilled in the art. The terminology used in the exemplary embodiments shown in the accompanying drawings is not intended to limit the present invention. In the accompanying drawings, identical elements are denoted by the same reference numerals.

[0096] Unless otherwise specified, the terms used herein (including technical terms) have the meanings commonly understood by those skilled in the art. In addition, it is understood that terms defined in commonly used dictionaries should be understood to have the same meanings as those in the context of the relevant fields, and should not be understood as idealized or overly formal meanings.

[0097] This paper proposes a power system load forecasting method based on modal decomposition and independent attention mechanism, aiming to predict power load through the empirical mode decomposition-recombination method and the iTransformer model based on independent attention, so as to play a certain role in power grid regulation.

[0098] Figure 1 FIG is a flow chart of a power system load forecasting method 100 based on modal decomposition and independent attention mechanism according to an embodiment of the present invention. Figure 1As shown, the method for power system load forecasting based on modal decomposition and independent attention mechanism provided by the embodiment of the present invention decomposes a complex time series into several simpler and more basic modal components and reorganizes them, and predicts the reorganized components separately through the iTransformer model based on independent attention. The model proposed by the present invention has higher prediction performance than the current mainstream prediction model. When applied to the power grid, it can significantly improve the accuracy and efficiency of load series data analysis and prediction, enhance the stability and robustness of the power grid, improve the efficiency of power grid management and operation, and provide strong support for the development of smart grids. The method 100 for power system load forecasting based on modal decomposition and independent attention mechanism provided by the embodiment of the present invention starts from step 101. In step 101, historical load data for load forecasting is obtained.

[0099] In step 102, empirical mode decomposition is performed on the load history data to obtain a first intrinsic mode function component, and a second intrinsic mode function component is obtained based on the first intrinsic mode function component.

[0100] Preferably, performing empirical mode decomposition on the load history data to obtain the first intrinsic mode function component includes:

[0101] The load sequence X(t) composed of historical load data is transformed into Calculate its instantaneous amplitude A(t) and instantaneous frequency for:

[0102]

[0103] Using A({t max}) and A({t min}) as the maximum value sequence and minimum value sequence of A(t), and interpolate them to obtain β1(t) and β2(t), and calculate their instantaneous mean a1(t) and instantaneous envelope a2(t) as follows:

[0104]

[0105] right and Interpolate to obtain η1(t) and η2(t), and calculate their instantaneous frequency components and for:

[0106]

[0107]

[0108] Calculate the local cutoff frequency for:

[0109]

[0110] For local cutoff frequency Reconstruct, f(t) is:

[0111]

[0112] Calculate the extreme points of f(t), use the extreme values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t). Calculate the stop signal θ(t) as:

[0113]

[0114] If θ(t) is less than the threshold ξ, then X(t) is taken as a first intrinsic mode function component; if θ(t) is greater than the threshold ξ, then x1(t) = x t -m(t), where m(t) is the local mean value of the instantaneous envelope and is recalculated from equation (1) to equation (9);

[0115] Among them, B Loughlin (t) is the Loughlin instantaneous bandwidth; is the average instantaneous frequency.

[0116] Preferably, obtaining a second eigenmode function component based on the first eigenmode function component includes:

[0117] The sample entropy of each first intrinsic mode function component is calculated based on the sample entropy algorithm, and the first intrinsic mode function components corresponding to the sample entropies whose sample entropy differences are within a preset range are merged to obtain the second intrinsic mode function component.

[0118] Preferably, the sample entropy of each first intrinsic mode function component is calculated based on a sample entropy algorithm, comprising:

[0119] For any first intrinsic mode function component, segmentation processing is performed on the any first intrinsic mode function component to divide it into multiple subsequences with lengths of m and m+1, and the sample entropy of the any first intrinsic mode function component is calculated based on the obtained multiple subsequences.

[0120] Combine Figure 2 As shown, in the present invention, load history data is first obtained and decomposed using a time-varying filter modal decomposition algorithm to obtain the first intrinsic mode function component. The sample entropy value of the decomposed first intrinsic mode function component is calculated, and the intrinsic mode function components with similar entropy values ​​are added together to reconstruct a new intrinsic mode function component, namely the second intrinsic mode function component. Specifically, it includes:

[0121] 1) Perform time-varying filtering on the load data using empirical mode decomposition. Define the load sequence as X(t), and perform Hilbert transform on it to become Its instantaneous amplitude A(t) and instantaneous frequency The calculation formula is:

[0122]

[0123] Using A({t max}) and A({t min}) as the maximum value sequence and minimum value sequence of A(t), and interpolate them to obtain β1(t) and β2(t), so that their instantaneous mean a1(t) and instantaneous envelope a2(t) can be calculated:

[0124]

[0125] right and Interpolate to obtain η1(t) and η2(t), and calculate their instantaneous frequency components and

[0126]

[0127] Calculate the local cutoff frequency

[0128]

[0129] Reconstruct formula (7) and calculate it as follows:

[0130]

[0131] Calculate the extreme points of f(t) and use them as the nodes of the filter to approximate X(t) using B-spline interpolation. The formula for calculating the stop signal θ(t) is:

[0132]

[0133] Where B Loughlin (t) is the Loughlin instantaneous bandwidth; is the average instantaneous frequency.

[0134] If θ(t) is less than the threshold ξ, X(t) is taken as an intrinsic mode function component; if θ(t) is greater than the threshold ξ, let x1(t) = x t -m(t), where m(t) is the local mean value of the instantaneous envelope, and is recalculated from equation (1) to equation (9).

[0135] 2) Performing empirical mode decomposition to obtain all first intrinsic mode function components and calculating their sample entropy using a sample entropy algorithm, including: first, segmenting the eigenmode function components into multiple subsequences of length m and m+1. Then, calculating the similarity of each subsequence. Based on the similarity ratio between subsequences of different lengths m and m+1, the sample entropy is derived. After obtaining the sample entropy, first eigenmode function components with similar sample entropy are merged to obtain a new set of eigenmode function components, namely, second eigenmode function components.

[0136] In step 103, an iTransformer model including an independent attention mechanism is constructed.

[0137] Preferably, an iTransformer model including an independent attention mechanism is constructed, comprising:

[0138] (1) Using the independent attention mechanism to process all variable labels, the model learns the interdependence between different variables; the principle of the independent attention mechanism is:

[0139] Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k Output y of region (i, j) ij The attention formula is:

[0140]

[0141] The position information is embedded in the independent attention mechanism and encoded; where the point at position (i, j) to each position ab∈N k (i, j), it has two offsets, namely row offset ai and column offset bi, which are respectively related to the embedding r a-i and r b-i Influence each other, by connecting the two embeddings, a combined embedding r is formed a-i,b-i , the attention calculation formula after introducing position information is:

[0142]

[0143] Among them, q ij , k ab and v ab They are the query vector, key vector and value vector of the position (i, j) and nearby points respectively; softmax ab It is the softmax calculated among the points adjacent to position (i, j);

[0144] (2) Perform layer-normalization on the output of the attention mechanism in the feedforward layer of the iTransformer model, including:

[0145]

[0146] Where H=[h1,h2,…,h N ] is an input with N variables, h n is the representation vector of the nth variable, and Mean represents the vector h n The mean of Var represents the vector h n The variance of .

[0147] iTransformer is a model designed specifically for time series forecasting. It reuses the traditional Transformer architecture without modifying its basic components. Figure 3 As shown in the figure, the iTransformer model receives as input the intrinsic mode function components reconstructed by empirical mode decomposition. This sequence contains multiple variables, each with its own time series. To make model training more stable, the input data needs to be standardized, scaling all eigenvalues ​​to the range [0, 1]. In the embedding layer, each variable's time series is independently embedded through a multi-layer perceptron (MLP). This step converts the time series into a set of high-dimensional feature vectors that are more suitable for processing by deep learning models. Because iTransformer operates on the variable dimension, each variable in the time series is treated as an independent entity in space, and the time points are indirectly expressed through the relationship between the variable labels.

[0148] In this paper, an independent attention mechanism is used to replace the self-attention mechanism in the original iTransformer model to process all variable labels, and the model learns the interdependencies between different variables. The principle of the independent attention mechanism is as follows:

[0149] Given a Calculate x ij The nearby position is ab∈N k Output y of region (i, j) ij The attention formula is:

[0150]

[0151] Where q ij , k ab and v ab is the query vector, key vector and value vector of position (i, j) and nearby points, softmax ab It is the softmax calculated among the points adjacent to position (i, j). The whole process is as follows Figure 4 shown.

[0152] The position information is embedded in the independent attention mechanism and encoded. From the point at position (i, j) to each position ab∈Nk(i, j), it has two offsets, namely the row offset ai and the column offset bi, which are respectively a-i and r b-i Influence each other, and then embed and connect the two in a certain way to form a combined embedding r a-i,b-i , so the attention calculation formula after introducing position information is:

[0153]

[0154] Here, the attention weights determine what information from other variables is important when predicting the future value of a certain variable.

[0155] Combine Figure 2 As shown in Figure 1, in the feedforward layer, each variable token passes through an independent feedforward network, which usually contains several linear layers and nonlinear activation functions. The feedforward layer further processes the output of the attention mechanism and extracts more complex feature representations for the final prediction.

[0156] Layer normalization is to improve the convergence and training stability of the iTransformer network. It applies normalization to the series representation of a single variable. For an input with N variables H = [h1,h2,…,h N The calculation layer normalization formula is as follows:

[0157]

[0158] Where h n is the representation vector of the nth variable, and Mean represents the vector h n The mean of Var represents the vector h n The variance of .

[0159] In the iTransformer model, layer normalization not only helps to deal with scale differences between different variables, but also enhances the model's adaptability and generalization ability to time series data.

[0160] In step 104, the second intrinsic mode function component is input into the iTransformer model, and a load prediction value is output.

[0161] Combine Figure 2As shown, in the present invention, it is finally converted back to the predicted time series format through a mapping layer, and the second intrinsic mode function components obtained by the data empirical mode decomposition-reconstruction are respectively used as inputs, and the results are added together to obtain the predicted value of the load forecast.

[0162] Preferably, the method further comprises:

[0163] Based on the mean absolute error y MAE and the mean absolute percentage error y MAPE Two error evaluation indicators are used to evaluate the model; among them, the error of n prediction results is calculated as follows:

[0164]

[0165] Among them, y act (i) and y pred (i) is the actual value and predicted value of the load at the i-th data point; y act (i) and y pred The smaller the value of (i), the higher the prediction accuracy of the model.

[0166] In this paper, in order to evaluate the performance of the prediction model based on modal decomposition and independent attention mechanism, the mean absolute error y MAE and the mean absolute percentage error y MAPE Two error evaluation indicators are used to evaluate the model. The error indicator expression for n prediction results is as follows:

[0167]

[0168] Where y act (i) and y pred (i) is the actual value and predicted value of the load at the i-th data point. act (i) and y pred The smaller the value of (i), the higher the prediction accuracy of the model.

[0169] Aiming at power system load forecasting, the present invention provides a power system load forecasting method based on modal decomposition and independent attention mechanism. This method addresses the shortcomings of the existing technology, performs empirical mode decomposition and reorganizes the load data, and adopts the iTransformer model based on independent attention for prediction. The present invention can overcome the limitations of traditional models, improve the performance, efficiency and adaptability of the model through innovative technical means, and promote its application in various complex data processing tasks, thereby playing an important role in power grid regulation and improving the operating efficiency, safety and intelligence level of the power grid.

[0170] The following examples illustrate the embodiments of the present invention.

[0171] The present invention uses the load data of the high voltage side of a 220kV substation in a certain province of China from January 1, 2019 to December 26, 2019 as an example, with a sampling interval of 5 minutes. The process of ultra-short-term load forecasting based on modal decomposition and independent attention mechanism provided by the invention is as shown in the attached figure. Figure 2 As shown, the specific steps include:

[0172] Step 1: Obtain load forecast data. The input data includes the active power on the high-voltage side of a 220kV substation in a certain province in China, as well as five types of weather data: local weather, maximum temperature, minimum temperature, wind direction, and wind speed.

[0173] Step 2: Use the TVF-EMD algorithm to perform empirical mode decomposition on the load data to obtain 12 intrinsic mode function components. Then use the SE algorithm to calculate the entropy value of each intrinsic mode function component and merge the intrinsic mode function components with similar entropy values ​​into new components.

[0174] Step 3: Build an improved iTransformer model. Replace the original iTransformer self-attention mechanism with an independent attention mechanism to improve its feature perception. The improved iTransformer model has an input sequence length of 96, an output sequence length of 12, a 2-layer encoder, a batch size of 32, a learning rate of 0.0001, and 10 training rounds.

[0175] Step 4: Input the new intrinsic mode function components reorganized in step 2 into the improved iTransformer model in sequence, and sum the results output by the model to obtain the load forecast value.

[0176] Step 5: Compare the load forecast value with the actual load forecast value according to equations (13) and (14) to evaluate the model's forecasting ability. Alternatively, a current mainstream load forecasting model can be used for comparison to evaluate the effectiveness of the proposed model. The method ends.

[0177] Figure 5 FIG is a structural diagram of a power system load forecasting system 500 based on modal decomposition and independent attention mechanism according to an embodiment of the present invention. Figure 5 As shown, the power system load forecasting system 500 based on modal decomposition and independent attention mechanism provided by an embodiment of the present invention includes: a data acquisition unit 501, an empirical mode decomposition unit 502, a model construction unit 503 and a prediction unit 504.

[0178] Preferably, the data acquisition unit 501 is used to acquire historical load data for load forecasting.

[0179] Preferably, the empirical mode decomposition unit 502 is configured to perform empirical mode decomposition on the load history data to obtain a first intrinsic mode function component, and obtain a second intrinsic mode function component based on the first intrinsic mode function component.

[0180] Preferably, the empirical mode decomposition unit 502 performs empirical mode decomposition on the load history data to obtain the first intrinsic mode function component, including:

[0181] The load sequence X(t) composed of historical load data is transformed into Calculate its instantaneous amplitude A(t) and instantaneous frequency for:

[0182]

[0183] Using A({t max}) and A({t min}) as the maximum value sequence and minimum value sequence of A(t), and interpolate them to obtain β1(t) and β2(t), and calculate their instantaneous mean a1(t) and instantaneous envelope a2(t) as follows:

[0184]

[0185] right and Interpolate to obtain η1(t) and η2(t), and calculate their instantaneous frequency components and for:

[0186]

[0187] Calculate the local cutoff frequency for:

[0188]

[0189] For local cutoff frequency Reconstruct, f(t) is:

[0190]

[0191] Calculate the extreme points of f(t), use the extreme values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t). Calculate the stop signal θ(t) as:

[0192]

[0193] If θ(t) is less than the threshold ξ, then X(t) is taken as a first intrinsic mode function component; if θ(t) is greater than the threshold ξ, then x1(t) = x t -m(t), where m(t) is the local mean value of the instantaneous envelope and is recalculated from equation (1) to equation (9);

[0194] Among them, B Loughlin (t) is the Loughlin instantaneous bandwidth; is the average instantaneous frequency.

[0195] Preferably, the empirical mode decomposition unit 502 obtains the second eigenmode function component based on the first eigenmode function component, including:

[0196] The sample entropy of each first intrinsic mode function component is calculated based on the sample entropy algorithm, and the first intrinsic mode function components corresponding to the sample entropies whose sample entropy differences are within a preset range are merged to obtain the second intrinsic mode function component.

[0197] Preferably, the empirical mode decomposition unit 502 calculates the sample entropy of each first intrinsic mode function component based on a sample entropy algorithm, including:

[0198] For any first intrinsic mode function component, segmentation processing is performed on the any first intrinsic mode function component to divide it into multiple subsequences with lengths of m and m+1, and the sample entropy of the any first intrinsic mode function component is calculated based on the obtained multiple subsequences.

[0199] Preferably, the model building unit 503 is used to build an iTransformer model including an independent attention mechanism.

[0200] Preferably, the model building unit 503 builds an iTransformer model including an independent attention mechanism, including:

[0201] (1) Using the independent attention mechanism to process all variable labels, the model learns the interdependence between different variables; the principle of the independent attention mechanism is:

[0202] Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k Output y of region (i, j) ij The attention formula is:

[0203]

[0204] The position information is embedded in the independent attention mechanism and encoded; where the point at position (i, j) to each position ab∈N k (i, j), it has two offsets, namely row offset ai and column offset bi, which are respectively related to the embedding r a-i and r b-i Influence each other, by connecting the two embeddings, a combined embedding r is formed a-i,b-i , the attention calculation formula after introducing position information is:

[0205]

[0206] Among them, q ij , k ab and v ab They are the query vector, key vector and value vector of the position (i, j) and nearby points respectively; softmax ab It is the softmax calculated among the points adjacent to position (i, j);

[0207] (2) Perform layer-normalization on the output of the attention mechanism in the feedforward layer of the iTransformer model, including:

[0208]

[0209] Where H=[h1,h2,…,h N ] is an input with N variables, h n is the representation vector of the nth variable, and Mean represents the vector h n The mean of Var represents the vector h n The variance of .

[0210] Preferably, the prediction unit 504 is configured to input the second intrinsic mode function component into the iTransformer model and output a load prediction value.

[0211] Preferably, the system further comprises:

[0212] Evaluation unit for the mean absolute error y MAE and the mean absolute percentage error y MAPE Two error evaluation indicators are used to evaluate the model; among them, the error of n prediction results is calculated as follows:

[0213]

[0214] Among them, y act (i) and y pred (i) is the actual value and predicted value of the load at the i-th data point; y act (i) and ypred The smaller the value of (i), the higher the prediction accuracy of the model.

[0215] The power system load forecasting system 500 based on modal decomposition and independent attention mechanism of an embodiment of the present invention corresponds to the power system load forecasting method 100 based on modal decomposition and independent attention mechanism of another embodiment of the present invention, and will not be repeated here.

[0216] Based on another aspect of the present invention, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any step of a power system load forecasting method based on modal decomposition and independent attention mechanism.

[0217] According to another aspect of the present invention, the present invention provides an electronic device, including:

[0218] The computer-readable storage medium described above;

[0219] One or more processors are configured to execute the program in the computer-readable storage medium.

[0220] The invention has been described above with reference to a few embodiments. However, it is readily apparent to a person skilled in the art that other embodiments than the ones disclosed above are equally within the scope of the invention, as defined by the appended patent claims.

[0221] Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a / the [means, component, etc.]" are to be interpreted openly as referring to at least one instance of the means, component, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not necessarily need to be performed in the exact order disclosed, unless explicitly stated otherwise.

[0222] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0223] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0224] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0225] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0226] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A power system load forecasting method based on modal decomposition and independent attention mechanism, characterized in that: The method comprises: Obtain historical load data for load forecasting; Performing empirical mode decomposition on the load history data to obtain a first intrinsic mode function component, and obtaining a second intrinsic mode function component based on the first intrinsic mode function component; Build an iTransformer model with independent attention mechanism; Inputting the second intrinsic mode function component into the iTransformer model and outputting a load prediction value; Among them, the iTransformer model with independent attention mechanism is constructed, including: (1) Using the independent attention mechanism to process all variable labels, the model learns the interdependence between different variables; the principle of the independent attention mechanism is: Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k Output y of region (i, j) ij The attention formula is: The position information is embedded in the independent attention mechanism and encoded; where the point at position (i, j) to each position ab∈N k (i, j), it has two offsets, namely row offset ai and column offset bi, which are respectively related to the embedding r a-i and r b-i Influence each other, by connecting the two embeddings, a combined embedding r is formed a-i,b-i , the attention calculation formula after introducing position information is: Among them, q ij , k ab and v ab They are the query vector, key vector and value vector of the position (i, j) and nearby points respectively; softmax ab It is the softmax calculated among the points adjacent to position (i, j); (2) Perform layer-normalization on the output of the attention mechanism in the feedforward layer of the iTransformer model, including: Where H=[h1,h2,…,h N ] is an input with N variables, h n is the representation vector of the nth variable, and Mean represents the vector h n The mean of Var represents the vector h n The variance of .

2. The method according to claim 1, characterized in that Performing empirical mode decomposition on the load history data to obtain a first intrinsic mode function component includes: The load sequence X(t) composed of historical load data is transformed into Calculate its instantaneous amplitude A(t) and instantaneous frequency for: Using A({t max }) and A({t min }) as the maximum value sequence and minimum value sequence of A(t), and interpolate them to obtain β1(t) and β2(t), and calculate their instantaneous mean a1(t) and instantaneous envelope a2(t) as follows: right and Interpolate to obtain η1(t) and η2(t), and calculate their instantaneous frequency components and for: Calculate the local cutoff frequency for: For local cutoff frequency Reconstruct, f(t) is: Calculate the extreme points of f(t), use the extreme values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t). Calculate the stop signal θ(t) as: If θ(t) is less than the threshold ξ, then X(t) is taken as a first intrinsic mode function component; if θ(t) is greater than the threshold ξ, then x1(t) = x t -m(t), where m(t) is the local mean value of the instantaneous envelope and is recalculated from equation (1) to equation (9); Among them, B Loughlin (t) is the Loughlin instantaneous bandwidth; is the average instantaneous frequency.

3. The method according to claim 1, characterized in that Obtaining a second eigenmode function component based on the first eigenmode function component includes: The sample entropy of each first intrinsic mode function component is calculated based on the sample entropy algorithm, and the first intrinsic mode function components corresponding to the sample entropies whose sample entropy differences are within a preset range are merged to obtain the second intrinsic mode function component.

4. The method according to claim 3, characterized in that The sample entropy of each first intrinsic mode function component is calculated based on the sample entropy algorithm, including: For any first intrinsic mode function component, segmentation processing is performed on the any first intrinsic mode function component to divide it into multiple subsequences with lengths of m and m+1, and the sample entropy of the any first intrinsic mode function component is calculated based on the obtained multiple subsequences.

5. The method according to claim 1, characterized in that The method further comprises: Based on the mean absolute error y MAE and the mean absolute percentage error y MAPE Two error evaluation indicators are used to evaluate the model; among them, the error of n prediction results is calculated as follows: Among them, y act (i) and y pred (i) is the actual value and predicted value of the load at the i-th data point; y act (i) and y pred The smaller the value of (i), the higher the prediction accuracy of the model.

6. A power system load forecasting system based on modal decomposition and independent attention mechanism, characterized in that: The system comprises: A data acquisition unit, used to acquire historical load data for load forecasting; an empirical mode decomposition unit, configured to perform empirical mode decomposition on the load history data to obtain a first intrinsic mode function component, and obtain a second intrinsic mode function component based on the first intrinsic mode function component; A model building unit for building an iTransformer model with an independent attention mechanism; A prediction unit, configured to input the second intrinsic mode function component into the iTransformer model and output a load prediction value; The model building unit constructs an iTransformer model with an independent attention mechanism, including: (1) Using the independent attention mechanism to process all variable labels, the model learns the interdependence between different variables; the principle of the independent attention mechanism is: Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k Output y of region (i, j) ij The attention formula is: The position information is embedded in the independent attention mechanism and encoded; where the point at position (i, j) to each position ab∈N k (i, j), it has two offsets, namely row offset ai and column offset bi, which are respectively related to the embedding r a-i and r b-i Influence each other, by connecting the two embeddings, a combined embedding r is formed a-i,b-i , the attention calculation formula after introducing position information is: Among them, q ij , k ab and v ab They are the query vector, key vector and value vector of the position (i, j) and nearby points respectively; softmax ab It is the softmax calculated among the points adjacent to position (i, j); (2) Perform layer-normalization on the output of the attention mechanism in the feedforward layer of the iTransformer model, including: Where H=[h1,h2,…,h N ] is an input with N variables, h n is the representation vector of the nth variable, and Mean represents the vector h n The mean of Var represents the vector h n The variance of .

7. The system according to claim 6, characterized in that The empirical mode decomposition unit performs empirical mode decomposition on the load history data to obtain a first intrinsic mode function component, including: The load sequence X(t) composed of historical load data is transformed into Calculate its instantaneous amplitude A(t) and instantaneous frequency for: Using A({t max }) and A({t min }) as the maximum value sequence and minimum value sequence of A(t), and interpolate them to obtain β1(t) and β2(t), and calculate their instantaneous mean a1(t) and instantaneous envelope a2(t) as follows: right and Interpolate to obtain η1(t) and η2(t), and calculate their instantaneous frequency components and for: Calculate the local cutoff frequency for: For local cutoff frequency Reconstruct, f(t) is: Calculate the extreme points of f(t), use the extreme values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t). Calculate the stop signal θ(t) as: If θ(t) is less than the threshold ξ, then X(t) is taken as a first intrinsic mode function component; if θ(t) is greater than the threshold ξ, then x1(t) = x t -m(t), where m(t) is the local mean value of the instantaneous envelope and is recalculated from equation (1) to equation (9); Among them, B Loughlin (t) is the Loughlin instantaneous bandwidth; is the average instantaneous frequency.

8. The system according to claim 6, wherein: The empirical mode decomposition unit obtains a second intrinsic mode function component based on the first intrinsic mode function component, including: The sample entropy of each first intrinsic mode function component is calculated based on the sample entropy algorithm, and the first intrinsic mode function components corresponding to the sample entropies whose sample entropy differences are within a preset range are merged to obtain the second intrinsic mode function component.

9. The system according to claim 8, characterized in that The empirical mode decomposition unit calculates the sample entropy of each first intrinsic mode function component based on a sample entropy algorithm, including: For any first intrinsic mode function component, segmentation processing is performed on the any first intrinsic mode function component to divide it into multiple subsequences with lengths of m and m+1, and the sample entropy of the any first intrinsic mode function component is calculated based on the obtained multiple subsequences.

10. The system according to claim 6, wherein: The system further comprises: Evaluation unit for the mean absolute error y MAE and the mean absolute percentage error y MAPE Two error evaluation indicators are used to evaluate the model; among them, the error of n prediction results is calculated as follows: Among them, y act (i) and y pred (i) is the actual value and predicted value of the load at the i-th data point; y act (i) and y pred The smaller the value of (i), the higher the prediction accuracy of the model.

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

12. An electronic device, characterized in that: include: The computer-readable storage medium of claim 11; as well as One or more processors are configured to execute the program in the computer-readable storage medium.

Citation Information

Patent Citations

  • Load prediction method under extreme scene based on modal decomposition and transfer learning

    CN112488397A

  • Transform and dense feature fusion-based remote sensing image change detection method and system

    CN115690002A