Load processing method based on ATT-CNN-BiGRU

By adopting the ATT-CNN-BiGRU method in the short-term load prediction model, combining the convolutional layer, pooling layer and bidirectional GRU layer, the attention mechanism and normalization processing are introduced, and the problem of insufficient data preprocessing in the existing technology is solved. , improves the prediction accuracy and model stability of short-term loads, and achieves accurate forecasting of short-term loads.

CN114819318BActive Publication Date: 2024-11-01GUANGXI POWER GRID CO LTD NANNING POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210402857.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-18
Publication Date
2024-11-01
Estimated Expiration
2042-04-18

AI Technical Summary

Technical Problem

The existing short-term load prediction model pays less attention to the data preprocessing part, resulting in limited prediction accuracy. Due to the increasing diversity of user electricity demand, the increase in load prediction complexity, which affects the prediction accuracy.

Method used

Using the load processing method based on ATT-CNN-BiGRU, the nonlinear grid historical load data characteristics are extracted through the convolution layer, the pooling layer screening characteristics, the bidirectional GRU layer fusion historical and future data, and the attention mechanism and normalization processing are introduced. , adjust the model parameters to improve prediction accuracy.

Benefits of technology

By improving the load data feature extraction method in the data preprocessing stage, the prediction accuracy of the short-term load prediction model is improved, the fault tolerance and stability of the model are enhanced, and the accurate forecast of short-term load is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114819318B_ABST
    Figure CN114819318B_ABST
Patent Text Reader

Abstract

The invention discloses a load processing method based on ATT-CNN-BiGRU, which relates to the technical field of load analysis of power systems, and comprises the following steps: S1, inputting historical load data of a power grid into a convolutional layer of a CNN model, and extracting features of the historical load data of the power grid through the convolutional layer; S2, the features of the historical load data of the power grid enter a pooling layer of the CNN model, and the features of the historical load data of the power grid are screened through the pooling layer; S3, the screened features of the historical load data of the power grid enter a fully connected FC layer of the CNN model, and the nonlinear features of the historical load data of the power grid are converted into linear features of the historical load data of the power grid; and improving the prediction accuracy of a short-term load prediction model by improving a load data feature extraction method in a data preprocessing stage.
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 system load analysis, and in particular to a load processing method based on ATT-CNN-BiGRU. Background Art

[0002] Short-term load forecasting has always been an important guarantee for the power system to provide users with qualified and reliable electricity. The short-term load forecasting of the Nanning power grid mainly predicts the power load in the next week or so. The forecast accuracy seriously affects the work of the staff in the planning, planning, marketing, market trading, dispatching and other departments of the power system. The key to the short-term power load forecasting work depends on the establishment of its load forecasting model. However, due to the uncertainty and randomness of short-term power load, the requirements for the load forecasting model are getting higher and higher. The factors affecting the accuracy of short-term load forecasting have become more complex as the power demand of users tends to be more diverse.

[0003] In recent years, with the development of artificial intelligence algorithms, the focus of short-term load forecasting model establishment has been mainly on the establishment of forecasting models, such as artificial neural networks, long short-term memory, extreme learning machines, support vector machines, etc., while less attention has been paid to the early data preprocessing part, which often has a great impact on the later forecasting results. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a load processing method based on ATT-CNN-BiGRU. The present invention improves the prediction accuracy of the short-term load forecasting model by improving the load data feature extraction method in the data preprocessing stage.

[0005] The objective of the present invention is achieved through the following technical solutions:

[0006] The load processing method based on ATT-CNN-BiGRU includes the following steps:

[0007] S1, inputting the historical load data of the power grid into the convolution layer of the CNN model, and extracting the features of the nonlinear historical load data of the power grid through the convolution layer;

[0008] S2, inputting the nonlinear power grid historical load data features into the pooling layer of the CNN model, and filtering the power grid historical load data features through the pooling layer;

[0009] S3, inputting the filtered nonlinear power grid historical load data features into the fully connected FC layer of the CNN model, converting the nonlinear power grid historical load data features into linear power grid historical load data features, and establishing a prediction model using the linear power grid historical load data features.

[0010] Furthermore, step S3 also includes step S4 and step S5, wherein step S4 is to normalize the historical load data characteristics of the linear power grid, and divide the normalized data into test set data and training set data according to a certain ratio, and step S3 is to establish a prediction model.

[0011] Furthermore, the method for establishing the prediction model in step S5 is:

[0012] S51, calculate the weight α of the features in the test set data and the training set data respectively i , weight α i The calculation formula is:

[0013]

[0014] In the formula, α i Represented as the weight of the i-th vector, s(x i ,q) is the attention screening function, q is the set vector;

[0015] S52, according to the function Calculate the weighted average of the test set data and the training set data;

[0016] S53, input the weighted average of the test set data and the weighted average of the training set data into the BiGRU layer respectively to obtain the training set output y1 and the test set output y2, draw the loss iteration curve of the training set and the loss iteration curve of the test set, and judge the loss amplitude between the training set and the test set iteration curves. When the loss amplitude is greater than S, adjust the parameters of the attention screening function, the attention function and each function in the CNN model through the training set data, repeat steps S1-S53 until the loss amplitude is less than or equal to S, and use the test set output y2 as the predicted value of this power load.

[0017] Furthermore, in step S53, the BiGRU layer is a bidirectional gated recurrent unit, which is composed of two GRU models, one GRU model learns historical data features backward, and the other GRU model learns future data features forward, and the past data and future data are fused to obtain outputs y1 and y2.

[0018] Furthermore, before step S1, historical power grid load data for the past D days is collected and stored as time series data. The length of the time series data is D*96, the time unit is minutes, and the sampling period is T minutes.

[0019] Furthermore, the CNN model includes a convolutional layer, a pooling layer, and a fully connected FC layer, the convolutional layer is connected to the pooling layer, and the pooling layer is connected to the fully connected FC layer.

[0020] Furthermore, the formula for the pooling layer to screen the characteristics of the historical load data of the power grid is: z = max x ij, (i, j) ∈ G, where G is the receptive neighborhood of the pooling layer, x ij To experience the historical load data characteristics of the power grid in the neighborhood.

[0021] Furthermore, the convolutional layer of the CNN module is defined as:

[0022] In the formula, w is the convolution kernel of the convolutional neural network, x is the input, and the dimension of x is consistent with the dimension of the matrix w.

[0023] Furthermore, the fully connected FC layer of the CNN module uses a linear rectification function to transform the nonlinear power grid historical load data features into linear power grid historical load data features.

[0024] A computer storage device includes one or more memories on which an executable program is stored, and one or more processors for executing the executable program in the memory to implement the steps of the load processing method based on ATT-CNN-BiGRU.

[0025] The beneficial effects of the present invention are:

[0026] 1. The present invention improves the prediction accuracy of the short-term load forecasting model by improving the load data feature extraction method in the data preprocessing stage.

[0027] 2. The patent of this invention extracts load features by adding a bidirectional GRU algorithm and an attention mechanism to the prediction model, and uses a convolutional neural network algorithm to achieve accurate prediction of short-term loads. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 This is a flow chart of the present invention patent;

[0029] Figure 2 This is the Attention layer structure diagram of the patent of this invention;

[0030] Figure 3 This is the BiGRU layer structure diagram of the patent of this invention;

[0031] Figure 4 This is a diagram of the link layer structure of the prediction model of the patent of this invention;

[0032] Figure 5 It is a loss iteration curve of the training set and a loss iteration curve of the test set of the patent of the present invention;

[0033] Figure 6 It is the short-term load forecast curve diagram of the patent of the present invention;

[0034] Figure 7 It is a system connection diagram of each module in the prediction model of the present invention;

[0035] Description of the figures: 1-input layer, 2-convolution layer, 3-pooling layer, 4-fully connected FC layer, 5-Attention layer, 6-BiGRU layer, 7-output layer; DETAILED DESCRIPTION

[0036] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other implementations obtained by ordinary technicians in this field without creative work.

[0037] In the description of the present invention, it should be understood that the terms "counterclockwise", "clockwise", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.

[0038] The load forecasting method based on ATT-CNN-BiGRU includes the following steps:

[0039] S1, input the historical load data of the power grid into the convolution layer 2 of the CNN model, and extract the characteristics of the nonlinear historical load data of the power grid through the convolution layer 2. Specifically, the historical grid data is input into the convolution layer 2 of the CNN model through the input layer 1 of the prediction model;

[0040] S2, the nonlinear power grid historical load data features are input into the pooling layer 3 of the CNN model, and the power grid historical load data features are screened through the pooling layer 3;

[0041] S3, inputting the filtered nonlinear power grid historical load data features into the fully connected FC layer 4 of the CNN model, converting the nonlinear power grid historical load data features into linear power grid historical load data features, and establishing a prediction model through the linear power grid historical load data features;

[0042] Specifically, the CNN model consists of a convolutional layer 2, a pooling layer 3, and a fully connected FC layer 4. The convolutional layer 2 is the module that distinguishes CNN from other neural network algorithms. The function of the convolutional layer 2 is to perform feature extraction on the data passing through this layer, so as to mine deep features from the data.

[0043] Furthermore, the step S3 further includes steps S4 and S5, wherein the step S4 is to normalize the historical load data characteristics of the linear power grid, and divide the normalized data into test set data and training set data according to a certain ratio, and the step S5 is to establish a prediction model;

[0044] Specifically, normalizing the data can eliminate the impact of data dimension differences on the prediction model. The data normalization formula is:

[0045] In the formula, x max is the maximum value of the data, x min is the minimum value of the data, X is the normalized data set matrix, and x is the input feature data set sample matrix;

[0046] The data is divided into training set data and prediction set data in a ratio of 7:3. The training set data is used to adjust the parameters of the prediction model to improve the accuracy and stability of the model. The output of the training set data is the predicted value after the prediction model is stabilized.

[0047] Furthermore, the method for establishing the prediction model in step S3 is:

[0048] S51, calculate the weight α of the features in the test set data and the training set data respectively i , weight α i The calculation formula is:

[0049]

[0050] In the formula, α i Represented as the weight of the i-th vector, s(x i ,q) is the attention screening function, q is the set vector, and xi is the feature data matrix; specifically, by setting a vector q, a function is introduced to allocate the attention value by calculating the correlation between the input vector and q, that is, the greater the correlation, the greater the attention, and vice versa;

[0051] S52, according to the function Calculate the weighted average of the test set data and the training set data;

[0052] S53, input the weighted average of the test set data and the weighted average of the training set data into the BiGRU model to obtain the training set output y1 and the test set output y2, draw the loss iteration curve of the training set and the loss iteration curve of the test set, and determine the loss amplitude between the training set and the test set iteration curves. When the loss amplitude is greater than S, adjust the parameters of the attention screening function, the attention function, and each function in the CNN model through the training set data, repeat steps S1-S53, until the loss amplitude is less than or equal to S, and use the test set output y2 as the predicted value of this power load;

[0053] Specifically, the functions in the CNN model include the convolution function of the convolution layer, the filtering function of the pooling layer, and the ReLU function of the fully connected FC layer;

[0054] Specifically, as attached Figure 2 As shown in Figure 2, the role of Attention layer 5 is to assign weights to the features output by CNN, assigning higher weights to key features and smaller weights to non-key features, thereby improving the prediction accuracy of the model. Figure 2 In the equation, a1 to an are the weights of each feature vector, and the weighted average value is output through the adder;

[0055] Furthermore, in step S53, the BiGRU layer 6 is a bidirectional gated recurrent unit, which is composed of two GRU models, one GRU model backward learning historical data features, and the other GRU model forward learning future data features, and the past data and the future data are fused to obtain outputs y1 and y2;

[0056] Furthermore, before step S1, the historical load data of the power grid for the past D days is collected and stored as time series data, the length of the time series data is: D*96, the time unit is minutes, and the sampling period is T minutes;

[0057] Specifically, as attached Figure 3 As shown, BiGRU layer 6 is composed of two GRU models, one for backward learning of historical data features, and the other for forward learning of future data features, that is, historical and future data information can be used simultaneously in the model training process, and fused and processed to output predicted values. The historical load data of the power grid is stored in the form of time series data. The data in one sampling period T is defined as the current time data, then the data in the previous period T is the historical data, and the data in the next period T is the future data;

[0058] Specifically, as attached Figure 5As shown in the figure, the loss iteration curve of the training set and the loss iteration curve of the test set are plotted in the same table. When the two curves tend to overlap, it means that the model tends to be stable. At this time, the prediction value of the test set data output by the prediction model is more accurate. The definition of overlap is that the smaller the loss amplitude S between the two curves, the more they tend to overlap.

[0059] Furthermore, the CNN model includes a convolutional layer 2, a pooling layer 3, and a fully connected FC layer 4, the convolutional layer 2 is connected to the pooling layer 3, and the pooling layer 3 is connected to the fully connected FC layer 4.

[0060] Furthermore, the formula for the pooling layer 3 to screen the characteristics of the historical load data of the power grid is: z = max x ij, (i, j) ∈ G, where G is the receptive neighborhood of the pooling layer 3, x ij To understand the historical load data characteristics of the power grid in the neighborhood;

[0061] Specifically, the pooling layer 3 is a module with a relatively simple structure. Its function is to select the data features extracted by the convolution layer 2, reduce the amount of data calculation to a certain extent, and effectively avoid overfitting. After being processed by the pooling layer 3, the fault tolerance of the model can be effectively improved;

[0062] Furthermore, the convolutional layer 2 of the CNN module is defined as:

[0063] In the formula, w is the convolution kernel of the convolutional neural network, x is the input, and the dimension of x is consistent with the dimension of the matrix w;

[0064] Furthermore, the fully connected FC layer 4 of the CNN module uses a linear rectification function to transform the nonlinear power grid historical load data features into linear power grid historical load data features;

[0065] Specifically, in order to make the iteration speed of the model faster, the ReLU function is generally used as the excitation function of the convolutional neural network, Re LU(x) = max(0,x); the role of the fully connected FC layer 4 is similar to that of a multi-classifier. This module contains most of the calculation processes in the CNN model. This module mainly performs linear and nonlinear processing on the data. The linear operation is mainly for the input data, and the nonlinear operation is mainly for the mapping of data between layers. At the same time, this layer also acts as a memory. The data features extracted by the convolution layer 2, the data after pooling 3, and the data required for the model output are all stored here;

[0066] A computer storage device comprises one or more memories on which an executable program is stored, and one or more processors for executing the executable program in the memory to implement the steps of the load processing method based on ATT-CNN-BiGRU.

[0067] Specifically, after the prediction model is stable, the processed data length is: 8*96, the time unit is minute (m), and the sampling period T is 15 minutes, which is input into the prediction model. The load prediction curve output by the output layer 7 is as shown in the attached figure. Figure 6 shown.

[0068] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0069] It should be noted that, in the description of this application, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" and "multiple" refers to at least two.

[0070] It should be understood that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or there may be an intervening element at the same time; when an element is referred to as being "connected to" another element, it can be directly connected to the other element or there may be an intervening element at the same time. In addition, the "connection" used here may include wireless connection; the term "and / or" used includes any unit and all combinations of one or more associated listed items.

[0071] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0072] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0073] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0074] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0075] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0076] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0077] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A load processing method based on ATT-CNN-BiGRU, characterized in that: The following steps are involved: S1, inputting the historical load data of the power grid into the convolution layer of the CNN model, and extracting the features of the nonlinear historical load data of the power grid through the convolution layer; S2, inputting the nonlinear power grid historical load data features into the pooling layer of the CNN model, and filtering the power grid historical load data features through the pooling layer; S3, inputting the filtered nonlinear power grid historical load data features into the fully connected FC layer of the CNN model, converting the nonlinear power grid historical load data features into linear power grid historical load data features, and establishing a prediction model using the linear power grid historical load data features; The method for establishing the prediction model is: S51, calculate the weight α of the features in the test set data and the training set data respectively i , weight α i The calculation formula is: In the formula, α i Represented as the weight of the i-th vector, s(x i ,q) is the attention screening function, q is the set vector; S52, according to the function Calculate the weighted average of the test set data and the training set data; S53, input the weighted average of the test set data and the weighted average of the training set data into the BiGRU layer to obtain the training set output y1 and the test set output y2, draw the loss iteration curve of the training set and the loss iteration curve of the test set, and determine the loss amplitude between the training set and the test set iteration curves. When the loss amplitude is greater than S, adjust the parameters of the attention screening function, the attention function, and each function in the CNN model through the training set data, repeat steps S1-S53, until the loss amplitude is less than or equal to S, and use the test set output y2 as the predicted value of this power load; In step S53, the BiGRU layer is a bidirectional gated recurrent unit, which is composed of two GRU models. One GRU model learns the historical data features backward, and the other GRU model learns the future data features forward. The past data and the future data are fused to obtain the outputs y1 and y2.

2. The load processing method based on ATT-CNN-BiGRU according to claim 1, characterized in that: The step S3 also includes steps S4 and S5. The step S4 is to normalize the historical load data characteristics of the linear power grid, and divide the normalized data into test set data and training set data according to a certain ratio. The step S5 is to establish a prediction model.

3. The load processing method based on ATT-CNN-BiGRU according to claim 1, characterized in that: Before step S1, the historical load data of the power grid in the past D days are collected and stored as time series data. The length of the time series data is: D*96, the time unit is minutes, and the sampling period is T minutes.

4. The load processing method based on ATT-CNN-BiGRU according to claim 1, characterized in that: The CNN model includes a convolutional layer, a pooling layer, and a fully connected FC layer. The convolutional layer is connected to the pooling layer, and the pooling layer is connected to the fully connected FC layer.

5. The load processing method based on ATT-CNN-BiGRU according to claim 4 is characterized in that: The formula for the pooling layer to screen the characteristics of the historical load data of the power grid is: z = max x ij, (i, j) ∈ G, where G is the receptive neighborhood of the pooling layer, x ij To experience the historical load data characteristics of the power grid in the neighborhood.

6. The load processing method based on ATT-CNN-BiGRU according to claim 4, characterized in that: The convolutional layer of the CNN module is defined as: In the formula, w is the convolution kernel of the convolutional neural network, x is the input, and the dimension of x is consistent with the dimension of the matrix w.

7. The load processing method based on ATT-CNN-BiGRU according to claim 4, characterized in that: The fully connected FC layer of the CNN module uses a linear rectification function to transform the nonlinear power grid historical load data features into linear power grid historical load data features.

8. A computer storage device, characterized in that: It includes one or more memories on which executable programs are stored, and one or more processors for executing the executable programs in the memories to implement the steps of the load processing method based on ATT-CNN-BiGRU as described in any one of claims 1 to 7.