Electricity consumption prediction model creation method and device, storage medium and terminal

By preprocessing and feature screening of historical power consumption data and weather data, combined with the Conv1D-BiGRU model and particle swarm optimization, accurate prediction of power load of residential users is achieved, solving the lack of accuracy in power consumption prediction in the existing technology. The problem satisfies the smart grid's demand for high-precision load forecasting.

CN118739261APending Publication Date: 2024-10-01ALPHA ESS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410730041.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing electricity consumption prediction models use outdated energy consumption data sets when evaluating and fail to fully consider recent energy consumption trends, which affects the accuracy of prediction results and cannot meet the needs of smart grids for high-precision load prediction.

Method used

By obtaining training data sets and test data sets containing historical electricity consumption data and weather data, perform outlier detection, feature screening and normalization processing, create a deep learning model including the Conv1D-BiGRU model, and use particle swarm optimization to adjust the model Parameters to achieve accurate prediction of electricity consumption.

Benefits of technology

This method can accurately predict power demand in the next few hours and days, help formulate more reasonable energy dispatch and distribution plans, and ensure the stable operation and efficient management of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118739261A_ABST
    Figure CN118739261A_ABST
Patent Text Reader

Abstract

The invention discloses an electricity consumption prediction model creation method and device, a storage medium and a terminal.The electricity consumption prediction model creation method comprises the following steps that a training data set and a test data set are obtained, and the training data set and the test data set both comprise historical electricity consumption data and weather data corresponding to the historical electricity consumption data; creating a deep learning model, training the deep learning model based on the training data set to obtain a training model, and optimizing the training model to obtain an optimized model; and testing the optimization model by using a test data set and outputting a test result. According to the invention, the power consumption prediction efficiency and accuracy are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric power technology, and in particular to a method, device, storage medium and terminal for creating an electricity consumption prediction model. Background Art

[0002] With the rapid development of smart grid technology and the widespread application of renewable energy, the supply and demand balance problem of the power grid has become increasingly prominent, and demand-side management and demand response have become important strategies in smart grid management. As the core link of demand-side management, power consumption forecasting aims to help power grid operators make more reasonable and effective energy scheduling and allocation decisions by accurately predicting power load in the future.

[0003] In the residential sector, it is often difficult to accurately predict changes in power loads because residential users have diverse electrical appliances, random usage habits, and unstable living conditions. In addition, residential users' electricity consumption behavior is also affected by multiple factors such as seasons, weather, and holidays, which further increases the difficulty of prediction. In recent years, although a variety of prediction techniques have achieved remarkable results in short time steps, most prediction models often use outdated energy consumption data sets when evaluating and fail to fully consider recent energy consumption trends. This limitation affects the accuracy of the prediction results and cannot meet the needs of smart grids for high-precision load prediction.

[0004] Therefore, how to solve the deficiencies and shortcomings of existing technologies by creating an effective electricity consumption prediction model has become an important issue that researchers in this field need to solve urgently. Summary of the invention

[0005] The purpose of the present invention is to address the above-mentioned problems and to provide a method, device, storage medium and terminal for creating an electricity consumption prediction model.

[0006] The technical solution of the present invention is: a method for creating an electricity consumption prediction model, comprising the following steps: obtaining a training data set and a test data set, both of which contain historical electricity consumption data and weather data corresponding to the historical electricity consumption data; creating a deep learning model, training the deep learning model based on the training data set to obtain a training model, and optimizing the training model to obtain an optimized model; using the test data set to test the optimized model and output the test results.

[0007] As an improvement to an embodiment of the present invention, a training data set and a test data set are obtained, each of which includes historical electricity consumption data and weather data corresponding to the historical electricity consumption data; the training data set and the test data set are both processed as follows: outlier detection and replacement are performed on the historical electricity consumption data to obtain first electricity consumption data; feature screening is performed on the weather data to obtain first weather data; and the first electricity consumption data and the first weather data are both normalized.

[0008] As an improvement of an embodiment of the present invention, the "detecting and replacing outliers on the historical electricity consumption data to obtain first electricity consumption data" specifically includes: using the interquartile range method to identify outliers in the historical electricity consumption data, calculating the average value at the same time point in the N days before the date corresponding to the outlier, and using the average value to replace the outlier to obtain the first electricity consumption data, where N is a positive integer.

[0009] As an improvement of an embodiment of the present invention, the "feature screening of the weather data to obtain first weather data" specifically includes: using the Spearman method to perform correlation analysis on the first electricity consumption data and the weather data, and screening M weather features based on the results of the correlation analysis to obtain the first weather data.

[0010] As an improvement of an embodiment of the present invention, the "normalizing the first electricity consumption data and the first weather data to obtain a training data set and a test data set" specifically includes: using a min-max scaler method to normalize the first electricity consumption data and the first weather data to obtain a training data set and a test data set.

[0011] As an improvement of an embodiment of the present invention, the "creating a deep learning model" specifically includes: the deep learning model includes: a Conv1D-BiGRU model architecture including two channels, a fusion layer and a fully connected layer, wherein each channel includes two Conv1D layers and a BiGRU layer of 60 units.

[0012] As an improvement of an embodiment of the present invention, the "optimizing the training model to obtain an optimized model" specifically includes: using root mean square error RMSE as an evaluation index of the training model, and using particle swarm optimization to adjust parameters of the training model to obtain an optimized model.

[0013] To achieve one of the above-mentioned purposes, an embodiment of the present invention provides a power consumption prediction device, comprising the following modules:

[0014] An information acquisition module, used to acquire historical electricity consumption data and first weather data corresponding to the historical electricity consumption data;

[0015] a processing module, configured to pre-process the historical power consumption data to obtain first power consumption data, and perform feature screening on the weather data to obtain first weather data; normalize both the first power consumption data and the first weather data to obtain a training data set and a test data set, and divide the first data set into a training data set and a test data set;

[0016] A deep learning model creation module, used to create a deep learning model, train the deep learning model based on the training data set to obtain a training model, and optimize the training model to obtain an optimized model;

[0017] The testing module is used to test the optimization model using a test data set and output the test results.

[0018] To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention provides a storage medium storing program instructions, which, when executed, implement the method for creating a power consumption prediction model as described in any one of the above items.

[0019] To achieve one of the above-mentioned purposes of the invention, an embodiment of the present invention provides a terminal, including a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to implement the method for creating a power consumption prediction model as described in any one of the above items.

[0020] The method, device, storage medium and terminal for creating a power consumption prediction model provided by the embodiment of the present invention have the following advantages: the method uses advanced algorithms and models to accurately predict the power load of residential users. The method can not only accurately predict the power demand in the next few hours and days, but also formulate a more reasonable energy scheduling and allocation plan based on the prediction results, thereby ensuring the stable operation and efficient management of the power grid. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a flowchart of the method for creating the power consumption prediction model of the present invention;

[0022] Figure 2 It is a heat map obtained by performing correlation analysis using the Spearman method of the present invention;

[0023] Figure 3 It is a schematic diagram of the architecture of the electricity consumption prediction model described in the present invention. DETAILED DESCRIPTION

[0024] The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.

[0025] If the present invention involves directions (for example, up, down, left, right, front, back, outside, inside, etc.) when describing, it is necessary to define the directions involved.

[0026] The scope of the embodiments herein includes the entire scope of the claims, and all available equivalents of the claims.Herein, the terms "first", "second", etc. are only used to distinguish one element from another, without requiring or implying any actual relationship or order between these elements.In fact, the first element can also be called the second element, and vice versa.Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the structure, device or equipment including a series of elements not only include those elements, but also include other elements not clearly listed, or also include elements inherent to such structure, device or equipment.In the absence of more restrictions, the elements limited by the statement "include one..." do not exclude the existence of other identical elements in the structure, device or equipment including the elements.Each embodiment herein is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same similar parts between each embodiment can be referred to each other.

[0027] The terms "longitudinal", "lateral", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. in this document indicate the orientation or position relationship based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing this document and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In the description of this document, unless otherwise specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a mechanical connection or an electrical connection, it can also be the internal communication of two elements, it can be a direct connection, or it can be an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0028] Embodiment 1 of the present invention provides a method for creating a power consumption prediction model, such as Figure 1 As shown, the method for creating the power consumption prediction model includes the following steps:

[0029] Step 101: obtaining a training data set and a test data set, wherein the training data set and the test data set both contain historical electricity consumption data and weather data corresponding to the historical electricity consumption data;

[0030] In practice, the historical electricity consumption data of the residential building for which the electricity consumption is to be predicted can be obtained from the power distribution company for the past year. The historical electricity consumption data may include: active power and date, and the time interval may be 15 minutes; the weather data corresponding to the historical electricity consumption data may be obtained from the weather website, and the weather data may include: year, month, week, hour, season, temperature, wind speed, air pressure, and humidity. The week and season may be in a one-hot encoding format, where the one-hot encoding format is also called a one-bit valid encoding, and the method is to use an N-bit state register to encode N states, each state has its own independent register bit, and at any time, only one of them is valid. It can be understood that the one-hot encoding can process non-continuous data.

[0031] Step 102: creating a deep learning model, training the deep learning model based on the training data set to obtain a training model, and optimizing the training model to obtain an optimized model;

[0032] Step 103: Use the test data set to test the optimization model and output the test results.

[0033] In this embodiment, the "obtaining a training data set and a test data set, each of which contains historical electricity consumption data and weather data corresponding to the historical electricity consumption data" specifically includes: obtaining a training data set and a test data set, each of which contains historical electricity consumption data and weather data corresponding to the historical electricity consumption data; performing the following processing on the training data set and the test data set: performing outlier detection and replacement on the historical electricity consumption data therein to obtain first electricity consumption data; performing feature screening on the weather data therein to obtain first weather data; and normalizing both the first electricity consumption data and the first weather data.

[0034] In this embodiment, the "detecting and replacing outliers on the historical electricity consumption data to obtain the first electricity consumption data" specifically includes: using the interquartile range method to identify outliers in the historical electricity consumption data, calculating the average value at the same time point in the N days before the date corresponding to the outlier, and using the average value to replace the outlier to obtain the first electricity consumption data, where N is a positive integer.

[0035] Here, the interquartile range method is a method of measuring variability, which is achieved by dividing the data set into quartiles. Quartiles divide a data set sorted by rank into four equal parts, namely the first quartile Q1, the second quartile Q2, and the third quartile Q3. The interquartile range IQR = Q3-Q1, and the data outside Q3+1.5*IQR or Q1-1.5*IQR is regarded as an outlier, that is, an abnormal value of the historical electricity consumption data. Calculate the average value of the same time point in the N days before the date corresponding to the abnormal value, and use the average value to replace the abnormal value to obtain the first electricity consumption data. Preferably, N = 5. It can be understood that five days can capture the recent trend of changes without introducing data irrelevant to the current time point due to the large time span, which helps to improve the reliability and accuracy of the data and provide a more solid foundation for subsequent data analysis and prediction.

[0036] In this embodiment, the "feature screening of the weather data to obtain the first weather data" specifically includes: using the Spearman method to perform a correlation analysis on the first power consumption data and the weather data, and screening M weather features based on the results of the correlation analysis to obtain the first weather data.

[0037] Here, the Spearman method is a nonparametric statistical method used to measure the dependence of two variables. It uses a monotonic equation to evaluate the correlation between two statistical variables, such as Figure 2 As shown, the value range of the Spearman correlation coefficient is from -1 to +1, where -1 indicates a complete negative correlation, +1 indicates a complete positive correlation, and 0 indicates no correlation, thereby screening out M weather features, preferably, M = 5, and the weather features with strong correlation can be: temperature, hour, month, year, week. It can be understood that by limiting the number of weather features to 5, the main factors affecting power consumption can be captured while reducing computational complexity and avoiding overfitting. Secondly, selecting features with strong correlation can more accurately understand and predict power consumption. For example, temperature affects the demand for power consumption (such as the use of air conditioning and heating equipment), and hours, months, years and weeks reflect periodic changes at different time scales. These periodic changes are usually closely related to people's daily activity patterns and power demand. Therefore, by selecting these five weather features with strong correlation, power consumption can be analyzed and predicted more effectively.

[0038] In this embodiment, the “normalizing the first electricity consumption data and the first weather data to obtain a training data set and a test data set” specifically includes: using a min-max scaler method to normalize the first electricity consumption data and the first weather data to obtain a training data set and a test data set.

[0039] Here, min-max scaler is an important tool in the Scikit-learn library, which is mainly used for data normalization. Normalization is to scale the data so that it falls into a small specific interval, such as [0,1]. Min-maxscaler achieves normalization by calculating the minimum and maximum values ​​of the feature column. It is very important for stabilizing the model training process and improving the performance of the model. The scalar formula of the min-max scaler is: Where x is the original value of the feature, x min is the minimum value of the feature, x max is the maximum value of the feature, x ‘ is the normalized value of the feature.

[0040] In this embodiment, the "creating a deep learning model" specifically includes: the deep learning model includes: a Conv1D-BiGRU model architecture with two channels, a fusion layer and a fully connected layer, wherein each channel includes two Conv1D layers and a BiGRU layer with 60 units.

[0041] Here, if Figure 3 As shown, the deep learning model adopts a dual-channel Conv1D-BiGRU model architecture, including the characteristics of the one-dimensional convolutional layer Conv1D and the bidirectional gated recurrent unit BiGRU in CNN (Convolutional Neural Network), and combines the fusion layer and the fully connected layer.

[0042] The deep learning model first processes the training data set through a dual-channel Conv1D-BiGRU model architecture. Conv1D performs convolution operations on the training data set, automatically extracts descriptive features from the training data set, and uses a bidirectional gated recurrent unit (BiGRU) layer containing 60 units to learn the long-term dependencies of the extracted descriptive features. Subsequently, the outputs of the two independent channels are fused in series through a fusion layer to obtain a combined output, which is passed to the fully connected layer to generate predicted power consumption.

[0043] In this embodiment, the “optimizing the training model to obtain an optimized model” specifically includes: using a root mean square error (RMSE) as an evaluation index of the training model, and using particle swarm optimization to adjust parameters of the training model to obtain an optimized model.

[0044] Here, the predicted power consumption output by the deep learning model is evaluated using the root mean square error (RMSE), the training model corresponding to the smallest root mean square error (RMSE) is retained, and the training model is parameterized using particle swarm optimization to obtain an optimized model. Among them A j represents the actual power consumption in time period j, P j Represents the predicted power consumption of time period j, and n represents the total number of time periods. The particle swarm optimization (PSO) is a meta-heuristic optimization algorithm. It simulates the social interactions observed in a particle group, helps to efficiently explore the search space, and find the best or near-optimal solutions to various optimization challenges. First, a particle swarm consisting of multiple particles is initialized, each particle represents a candidate solution for a parameter combination, and the particles have a position (i.e., parameter value) and a speed (indicating the direction and speed of parameter change). Based on the individual optimal solution of each particle (i.e., the optimal parameter combination of the particle) and the global optimal solution (i.e., the optimal parameter combination of all particles), the speed and position of the particle are updated until the preset number of iterations is reached. In each iteration, the particle swarm will gradually approach the optimal solution area. After the iteration, the global optimal solution is selected as the optimal parameter combination of the deep learning model to obtain the optimization model, and the optimization model is tested using a test data set to obtain the test results.

[0045] Embodiment 2 of the present invention provides a power consumption prediction device, comprising the following modules:

[0046] An information acquisition module, used to acquire historical electricity consumption data and first weather data corresponding to the historical electricity consumption data;

[0047] a processing module, configured to pre-process the historical power consumption data to obtain first power consumption data, and perform feature screening on the weather data to obtain first weather data; normalize both the first power consumption data and the first weather data to obtain a training data set and a test data set, and divide the first data set into a training data set and a test data set;

[0048] A deep learning model creation module, used to create a deep learning model, train the deep learning model based on the training data set to obtain a training model, and optimize the training model to obtain an optimized model;

[0049] The testing module is used to test the optimization model using a test data set and output the test results.

[0050] Embodiment 3 of the present invention provides a storage medium storing program instructions, which, when executed, implements the method for creating a power consumption prediction model as described in any one of the above items.

[0051] Embodiment 4 of the present invention provides a terminal, including a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to implement the method for creating a power consumption prediction model as described in any one of the above items.

[0052] It should be understood that although this specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation mode may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

[0053] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for creating an electricity consumption prediction model, characterized in that: The following steps are involved: Acquire a training data set and a test data set, wherein the training data set and the test data set both contain historical electricity consumption data and weather data corresponding to the historical electricity consumption data; Creating a deep learning model, training the deep learning model based on the training data set to obtain a training model, and optimizing the training model to obtain an optimized model; The optimization model is tested using a test data set and the test results are output.

2. The method for creating a power consumption prediction model according to claim 1, characterized in that: The “obtaining a training data set and a test data set, wherein both the training data set and the test data set contain historical electricity consumption data and weather data corresponding to the historical electricity consumption data” specifically includes: obtaining a training data set and a test data set, wherein both the training data set and the test data set contain historical electricity consumption data and weather data corresponding to the historical electricity consumption data; The following processing is performed on both the training data set and the test data set: outlier detection and replacement are performed on the historical electricity consumption data to obtain the first electricity consumption data; feature screening is performed on the weather data to obtain the first weather data; and both the first electricity consumption data and the first weather data are normalized.

3. The method for creating a power consumption prediction model according to claim 2, characterized in that: The "detecting and replacing outliers on the historical electricity consumption data to obtain the first electricity consumption data" specifically includes: using the interquartile range method to identify outliers in the historical electricity consumption data, calculating the average value at the same time point in the N days before the date corresponding to the outlier, and using the average value to replace the outlier to obtain the first electricity consumption data, where N is a positive integer.

4. The method for creating a power consumption prediction model according to claim 2, characterized in that: The “screening the weather data for features to obtain first weather data” specifically includes: performing a correlation analysis on the first power consumption data and the weather data using the Spearman method, and screening out M weather features based on the results of the correlation analysis to obtain the first weather data.

5. The method for creating a power consumption prediction model according to claim 2, characterized in that: The “normalizing the first electricity consumption data and the first weather data to obtain a training data set and a test data set” specifically includes: using a min-max scaler method to normalize the first electricity consumption data and the first weather data to obtain a training data set and a test data set.

6. The method for creating a power consumption prediction model according to claim 1, characterized in that: The "creating a deep learning model" specifically includes: the deep learning model includes: a Conv1D-BiGRU model architecture with two channels, a fusion layer and a fully connected layer, wherein each channel includes two Conv1D layers and a BiGRU layer with 60 units.

7. The method for creating a power consumption prediction model according to claim 1, characterized in that: The “optimizing the training model to obtain an optimized model” specifically includes: using root mean square error RMSE as an evaluation index of the training model, and using particle swarm optimization to adjust parameters of the training model to obtain an optimized model.

8. A power consumption prediction device, characterized in that: Includes the following modules: An information acquisition module, used to acquire a training data set and a test data set, wherein the training data set and the test data set both contain historical electricity consumption data and weather data corresponding to the historical electricity consumption data; A model creation module, used to create a deep learning model, train the deep learning model based on the training data set to obtain a training model, and optimize the training model to obtain an optimized model; The testing module is used to test the optimization model using a test data set and output the test results.

9. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the method for creating the electricity consumption prediction model as described in any one of claims 1 to 7 is implemented.

10. A terminal, characterized in that: It includes a processor and a memory, the memory stores program instructions, and the processor runs the program instructions to implement the method for creating a power consumption prediction model as described in any one of claims 1 to 7.