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

By adopting modal decomposition and independent attention mechanism methods in the load prediction of power systems, the problems of large load volatility and low prediction accuracy in the prior art are solved, and more efficient and accurate load prediction is achieved, which improves the stability and management efficiency of the power grid.

CN119561009AActive Publication Date: 2025-03-04CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +1

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to effectively reduce load volatility and improve prediction accuracy in power system load prediction, especially when processing complex and non-stationary load data.

Method used

The load prediction method of power system based on modal decomposition and independent attention mechanism is adopted, and the eigenmodal function components are obtained through empirical modal decomposition, and an iTransformer model containing independent attention mechanism is constructed for prediction based on these components.

Benefits of technology

This method can significantly improve the accuracy and efficiency of load sequence data analysis and prediction, enhance the stability and robustness of the power grid, and improve the efficiency of grid management and operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561009A_ABST
    Figure CN119561009A_ABST
Patent Text Reader

Abstract

The invention discloses a power system load prediction method and system based on modal decomposition and an independent attention mechanism. The method comprises the steps of obtaining load historical data used for load prediction; performing empirical mode decomposition on the load historical 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; the method comprises the following steps of: constructing an i Transform model containing an independent attention mechanism; and inputting the second intrinsic mode function component into the i Transform model, and outputting a load prediction value. Compared with a current mainstream prediction model, the model provided by the invention has higher prediction performance, and when the model is applied to the power grid, the precision and efficiency of load sequence data analysis and prediction can be remarkably improved, the stability and robustness of the power grid are enhanced, the efficiency of power grid management and operation is improved, and powerful support is provided for the development of the smart power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] As an important part of power system regulation, power system load forecasting has always attracted the attention of power experts and scholars. Power system load forecasting refers to the process of predicting the power load of the power system in the future. Ultra-short-term load forecasting refers to predicting the load data within the next hour. The main purpose of load forecasting is to predict future power demand in order to effectively manage power supply and system stability. Therefore, accurate load forecasting is crucial to the reliable operation and safe management of the power system.

[0003] In terms of methods, power system load forecasting involves multiple technical means. Time series analysis is one of the most basic methods. It analyzes historical load data and uses autoregressive models, moving average models, etc. to predict future loads. Regression analysis makes predictions by establishing the relationship between load and meteorological factors (such as temperature, 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 to traditional methods.

[0004] Load fluctuations are usually large and non-stationary. Using the empirical mode decomposition method to filter the data can reduce the complexity of the load sequence. The intrinsic mode function components obtained from the modal decomposition data are relatively large, and it is necessary to consider reorganizing the intrinsic mode function components to reduce the calculation time. The prediction model is particularly important for load forecasting. It is necessary to select a novel and high-precision model in recent years for prediction. At the same time, it is also necessary to consider improving the model to maximize the performance of the model and improve the prediction 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 method and system for power system load forecasting 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 method for power system load forecasting 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 to output a load prediction value.

[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 and minimum sequences 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):

[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, we get f(t) as:

[0023]

[0024] Calculate the extreme points of f(t), use the extreme point values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t), and 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 average 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 comprises:

[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 components.

[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, the first intrinsic mode function component is segmented into multiple subsequences with lengths of m and m+1, and the sample entropy of the 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) An independent attention mechanism is used to process all variable labels, and the model learns the interdependencies between different variables. The principle of the independent attention mechanism is as follows:

[0034] Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k The 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, 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, forming a combined embedding r 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) In the feedforward layer of the iTransformer model, the output of the attention mechanism is normalized, 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 including:

[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 for acquiring load history 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 independent attention mechanism;

[0050] A 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 and minimum sequences 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):

[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, we get f(t) as:

[0061]

[0062] Calculate the extreme points of f(t), use the extreme point values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t), and 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 average 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 acquires the second intrinsic mode function component based on the first intrinsic mode 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 components.

[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, the first intrinsic mode function component is segmented into multiple subsequences with lengths of m and m+1, and the sample entropy of the first intrinsic mode function component is calculated based on the obtained multiple subsequences.

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

[0071] (1) An independent attention mechanism is used to process all variable labels, and the model learns the interdependencies between different variables. The principle of the independent attention mechanism is as follows:

[0072] Given an x ij ∈Rd , calculate x ij The nearby position is ab∈N k The 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, 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, forming a combined embedding r 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) In the feedforward layer of the iTransformer model, the output of the attention mechanism is normalized, 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 including:

[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 method for power system load forecasting 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 used to execute the program in the computer-readable storage medium.

[0088] The present invention provides a method and system for load forecasting of a power system based on modal decomposition and independent attention mechanism, including: obtaining load history 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; 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 and more basic modal components and reorganizes them, and respectively predicts the reorganized components through an iTransformer model based on independent attention. The model proposed by the present invention has higher prediction performance than the current mainstream prediction model. Applying it to the power grid 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. 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 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;

[0091] Figure 2 A 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 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] Now, exemplary embodiments of the present invention are described with reference to the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to disclose the present invention in detail and completely and to fully convey the scope of the present invention to those skilled in the art. The terms used in the exemplary embodiments shown in the accompanying drawings are not intended to limit the present invention. In the accompanying drawings, the same units / elements are marked with the same reference numerals.

[0096] Unless otherwise specified, the terms (including technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is understood that the 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] The present invention 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. 1 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 load forecasting of a power system 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. Applying it to the power grid 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. The method 100 for load forecasting of a power system 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 and minimum sequences 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):

[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, we get f(t) as:

[0111]

[0112] Calculate the extreme points of f(t), use the extreme point values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t), and 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 average 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 comprises:

[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 components.

[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, the first intrinsic mode function component is segmented into multiple subsequences with lengths of m and m+1, and the sample entropy of the first intrinsic mode function component is calculated based on the obtained multiple subsequences.

[0120] Combination Figure 2 As shown, in the present invention, firstly, load history data is obtained, and then decomposed by a time-varying filtering modal decomposition algorithm to obtain a first intrinsic modal function component, and the sample entropy value of the first intrinsic modal function component obtained by decomposition is calculated, and the intrinsic modal function components with similar entropy values ​​are added together to reorganize into a new intrinsic modal function component, i.e., the second intrinsic modal 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 and minimum sequences of A(t), and interpolate them to obtain β1(t) and β2(t), respectively, 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] In the formula, 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 ξ, x1(t) = x t -m(t), where m(t) is the local average 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 intrinsic mode 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, the first intrinsic mode function components with similar sample entropy are merged to obtain a new set of intrinsic mode function components, namely, the second intrinsic mode 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) An independent attention mechanism is used to process all variable labels, and the model learns the interdependencies between different variables. The principle of the independent attention mechanism is as follows:

[0139] Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k The 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, 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, forming a combined embedding r 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) In the feedforward layer of the iTransformer model, the output of the attention mechanism is normalized, 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 the intrinsic mode function components reconstructed by empirical mode decomposition as input. This sequence contains multiple variables, each of which has its own time series. In order to make the model training more stable, the input data needs to be standardized and all eigenvalues ​​need to be scaled to the range of [0,1]. In the embedding layer, the time series of each variable 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 deep learning models to process. Since iTransformer operates on the variable dimension, each variable of the time series is regarded as an independent entity in space, and the time point is indirectly expressed through the relationship between the variable labels.

[0148] In this invention, 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 The output y of region (i, j) ij The attention formula is:

[0150]

[0151] In the formula, q ij , k ab and v ab is the query vector, key vector, and value vector of the position (i, j) and nearby points, softmax ab 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 related to the embedding r 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] Combination 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 H with N variables, H = [h1, h2, ..., h N ]The calculation layer normalization formula is as follows:

[0157]

[0158] In the formula, 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] Combination 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 including:

[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 calculating n prediction results is as follows:

[0167]

[0168] In the formula, 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] The present invention aims at power system load forecasting and provides a power system load forecasting method based on modal decomposition and independent attention mechanism. The method aims at the deficiencies of the prior art, performs empirical mode decomposition and reorganization on the load data, and adopts the iTransformer model based on independent attention for forecasting. The present invention can overcome the limitations of traditional models, improve the performance, efficiency and adaptability of the model through innovative technical means, 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 specifically illustrates 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 and 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. An independent attention mechanism is used to replace the original self-attention mechanism of iTransformer to improve its ability to perceive features. The input sequence length of the improved iTransformer model is 96, the output sequence length is 12, the encoder is set to 2 layers, the batch size is set to 32, the learning rate is set to 0.0001, and the training round is set to 10.

[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 prediction value.

[0176] Step 5: Compare the load forecast value with the actual load forecast value according to equation (13) and equation (14) to judge the model prediction capability. You can also use the current mainstream load forecast model for comparison to evaluate the effect of the model proposed in the present invention. The method ends.

[0177] Figure 5 FIG. 5 is a schematic 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 in an embodiment of the present invention includes: a data acquisition unit 501, an empirical mode decomposition unit 502, a model building unit 503 and a forecasting unit 504.

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

[0179] Preferably, the empirical mode decomposition unit 502 is used 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 and minimum sequences 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):

[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, we get f(t) as:

[0190]

[0191] Calculate the extreme points of f(t), use the extreme point values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t), and 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 average 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 acquires the second intrinsic mode function component based on the first intrinsic mode 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 components.

[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, the first intrinsic mode function component is segmented into multiple subsequences with lengths of m and m+1, and the sample entropy of the 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) An independent attention mechanism is used to process all variable labels, and the model learns the interdependencies between different variables. The principle of the independent attention mechanism is as follows:

[0202] Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k The 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, 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, forming a combined embedding r 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) In the feedforward layer of the iTransformer model, the output of the attention mechanism is normalized, 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 used 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 including:

[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, which 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 method for power system load forecasting 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 used 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 therein. All references to "a / said / the [means, components, etc.]" are to be openly interpreted as at least one instance of said means, components, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not necessarily have to be performed in the exact order disclosed, unless explicitly stated otherwise.

[0222] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, 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 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 flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, 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 flowchart and / or block diagram. 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 capable of directing a computer or other programmable data processing device to operate 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 A 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 operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified 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 rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant 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 within 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; The second intrinsic mode function component is input into the iTransformer model, and a load prediction value is output.

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 and minimum sequences 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): 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, we get f(t) as: Calculate the extreme points of f(t), use the extreme point values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t), and 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 average of the instantaneous envelope and is recalculated from equation (1) to equation (9); Among them, B Loughlin (t) is Loughlin instantaneous bandwidth; is the average instantaneous frequency.

3. The method according to claim 1, characterized in that Acquiring 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 components.

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, the first intrinsic mode function component is segmented into multiple subsequences with lengths of m and m+1, and the sample entropy of the first intrinsic mode function component is calculated based on the obtained multiple subsequences.

5. The method according to claim 1, characterized in that: Build an iTransformer model with independent attention mechanism, including: (1) An independent attention mechanism is used to process all variable labels, and the model learns the interdependencies between different variables. The principle of the independent attention mechanism is as follows: Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k The 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, 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, forming a combined embedding r 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) In the feedforward layer of the iTransformer model, the output of the attention mechanism is normalized, 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 .

6. 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 including: 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.

7. 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 for acquiring load history 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 independent attention mechanism; A prediction unit is used to input the second intrinsic mode function component into the iTransformer model and output a load prediction value.

8. The system according to claim 7, 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 and minimum sequences 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): 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, we get f(t) as: Calculate the extreme points of f(t), use the extreme point values ​​as the nodes of the filter, and use B-spline interpolation to approximate X(t), and 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 average of the instantaneous envelope and is recalculated from equation (1) to equation (9); Among them, B Loughlin (t) is Loughlin instantaneous bandwidth; is the average instantaneous frequency.

9. The system according to claim 7, characterized in that 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 components.

10. The system according to claim 9, 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, the first intrinsic mode function component is segmented into multiple subsequences with lengths of m and m+1, and the sample entropy of the first intrinsic mode function component is calculated based on the obtained multiple subsequences.

11. The system according to claim 7, characterized in that The model building unit builds an iTransformer model including an independent attention mechanism, including: (1) An independent attention mechanism is used to process all variable labels, and the model learns the interdependencies between different variables. The principle of the independent attention mechanism is as follows: Given an x ij ∈R d , calculate x ij The nearby position is ab∈N k The 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, 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, forming a combined embedding r 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) In the feedforward layer of the iTransformer model, the output of the attention mechanism is normalized, 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 .

12. The system according to claim 7, characterized in that 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 including: 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.

13. 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 6 are implemented.

14. An electronic device, characterized in that: include: The computer readable storage medium as claimed in claim 13; as well as One or more processors are used 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

  • Power load prediction method based on modal decomposition and reconstruction and LSTM-MLR hybrid model

    CN116362398A

  • Judicial case task scheduling method and device

    CN117709690A

  • Power system adaptive load flow calculation method and device based on edge graph attention network

    CN118783448A

Cited By

  • Factory power load monitoring and early warning method based on digital twinning

    CN120433173A

  • A plant power load monitoring and early warning method based on digital twinning

    CN120433173B

  • User side micro-grid load regulation and control method, system and equipment based on artificial intelligence

    CN121602630A

  • Artificial intelligence-based user-side microgrid load regulation method, system and device

    CN121602630B