Load Day-Ahead Prediction Correction Method, Device, and Storage Medium Based on Error Correction
Through the combination of particle swarm algorithm setting key parameters and convolutional neural network model, the problems of large errors in load prediction of park-level micronetworks and difficult real-time adjustments are solved, real-time correction and accuracy improvement of park-level micronetworks load prediction, ensuring the safe, stable and economic operation of micronetworks.
Patent Information
- Application Number
- CN202011546792.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2040-12-24
AI Technical Summary
There are problems such as large errors in the prediction of micronet loads at the park level and difficulty in real time adjustment. The existing algorithm information input is large and the prediction accuracy is poor, so it is impossible to cope with the situation of increasing sudden loads.
The load pre-predictive method based on error correction is used, and the key parameters are adjusted through the particle swarm algorithm, combined with the convolutional neural network model, a daily prediction model is established using historical load and meteorological data, and a real-time correction is performed within the day to be predicted. The correction algorithm is ci=Reali-Predictti,i∈(n,n+x*m], and the correction condition is that the absolute deviation of the predicted load value and the actual value is greater than the threshold and the symbol is the same.
Realize real-time correction of park-level micronet load prediction, improve prediction accuracy and flexibility, and ensure the safe and stable operation of micronet and optimal economic operation.
Smart Images

Figure CN114676866B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electric load forecasting, and particularly relates to a method, device, and storage medium for correcting day-ahead load forecasting based on error correction. Background Art
[0002] Electric load forecasting is an important basis for ensuring the stable and economic operation of the power system. Load forecasting with different time spans has different application purposes for the power grid. Among them, accurate short-term load forecasting results can help power system staff formulate reasonable production plans, maintain the balance between supply and demand, ensure the safety of the power grid, and at the same time reduce resource waste and electricity costs. The load level is affected by factors such as day type, weather, climate, and special activities. Load forecasting techniques can be divided into statistical methods and artificial intelligence methods. An artificial neural network is a soft computing technology that does not require forecasters to explicitly model the underlying physical system. It constructs a mapping relationship between input variables and power demand through simple learning and modeling of historical data for forecasting. In other words, the forecaster does not have to specify the functional form between input and output variables, which must be specified when constructing a multiple linear regression model. Therefore, artificial neural networks are often used for electric load forecasting. However, due to the certain randomness of power grid load forecasting, relatively low stability, and relatively many influencing factors, the error is relatively large, and the application of artificial neural networks has certain difficulties, especially for smaller-scale power grids, the possibility of prediction deviation is greater.
[0003] The purpose of short-term load forecasting at the park level is to plan an optimal power dispatching plan to meet load consumption and perform microgrid energy management. Microgrid energy management coordinates controllable distributed power sources and energy storage devices in the microgrid according to information such as the electrical load, heat load demand, atmospheric environment, grid electricity price, and gas price of the system to ensure the safe and stable operation of the microgrid and achieve the optimal economic operation of the microgrid.
[0004] Since the load scale of the park-level microgrid is small, the volatility and unpredictability are strong, and it is less affected by measurable and predictable factors such as weather and body sensation parameters, but is more affected by randomly started loads. Therefore, although short-term load forecasting is very important for microgrids, there is still less research in this area. Some existing work focuses on the day-ahead forecasting of building load consumption in microgrids, and there is no correction algorithm for making timely feedback and adjustment according to the actual load on the same day. This results in the previously proposed day-ahead load forecasting algorithms either requiring a large amount of information input and being difficult to obtain, lacking practicality; or having poor forecasting accuracy and being unable to cope with sudden increases in load. Summary of the Invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, and storage medium for correcting day-ahead load forecasting based on error correction.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A day-ahead load prediction correction method based on error correction, comprising the following steps:
[0008] Step 1: Based on historical load and historical meteorological data, establish a day-ahead prediction model;
[0009] Step 2: Obtain the prediction result of the day to be predicted based on the day-ahead prediction model, save the prediction result of the day to be predicted and the actual load data of the day to be predicted, and accumulate multiple groups of prediction results of the day to be predicted and the corresponding actual load data;
[0010] Step 3: Use multiple groups of prediction results of the day to be predicted and the corresponding actual load data, and adopt the particle swarm algorithm to tune the key parameters of the correction algorithm;
[0011] Step 4: During the correction period on the day to be predicted, regularly check whether the correction condition is satisfied based on the day-ahead predicted load value, the actual load value and the correction start deviation threshold value door. When the correction condition is satisfied, start the correction and correct the day-ahead prediction result of that day through the correction algorithm;
[0012] The correction algorithm is:
[0013] c i = Real i - Predict i , i ∈ (n, n + x * m]
[0014]
[0015] where Real i is the actual load value at the i-th sampling point, Predict i is the day-ahead predicted load value at the i-th sampling point, t now represents the moment when the correction is started, t end is the end time point of the correction period, n is the number of the first x hours of sampling point data before t now , m is the number of sampling points within each hour, k is the attenuation coefficient, Predict i * is the day-ahead predicted load value after correction at the i-th sampling point; the time of the i-th sampling point is t i , and the sampling time period corresponding to the sampling point i ∈ (n, n + x * m] is t i ∈ (t now - xh, t now , and the correction time period corresponding to the sampling point i ∈ [n + x * m, 24 * m) is t i ∈ [tnow , t end .
[0016] Preferably, the correction condition described in step 4 is that the absolute value of the deviation between the predicted load value and the actual load value of all sampling points within a certain period before the moment of starting the correction is greater than the correction start deviation threshold value door, and the signs of the deviation between the load prediction value and the actual value are the same.
[0017] Preferably, the key parameters of the correction algorithm described in step 3 are the end time point t of the correction period end , one or more of the correction start deviation threshold value door and the attenuation coefficient k.
[0018] Preferably, it further includes step 5 of repeating step 3 at regular intervals.
[0019] Preferably, in step 1, day-ahead prediction models for working days and rest days are established respectively according to the day type.
[0020] Preferably, the day-ahead prediction model in step 1 adopts a convolutional neural network model, and the historical meteorological data is input into the fully connected layer of the convolutional neural network module; the historical load data is input into the convolutional layer of the convolutional neural network module.
[0021] Preferably, the historical meteorological data includes weather data and weather type. The weather data is input into two fully connected layers of the convolutional neural network model, the weather type is input into one fully connected layer of the convolutional neural network model, the historical load data is input into the convolutional layer and pooling layer of the convolutional neural network model, and all the processed data is merged and passed through three fully connected layers of the convolutional neural network module to obtain the final output.
[0022] Preferably, the specific steps for tuning the correction parameters based on the particle swarm algorithm are as follows:
[0023] Step 31, input the data set composed of the accumulated multi-group of predicted results of the days to be predicted and the corresponding actual load data into the particle swarm algorithm;
[0024] Step 32, initialize the parameters, and set the parameters of the particle swarm algorithm, including the inertia factor, local velocity factor, global velocity factor, and the number of particle swarms;
[0025] Step 33, randomly initialize several particles, and the three-dimensional coordinates of the particles are the end time point t of the correction period end , the correction start deviation threshold value door, and the attenuation coefficient k, and set the change ranges of the end time point t of the correction period end , the correction start deviation threshold value door, and the attenuation coefficient k;
[0026] Step 34: Calculate the fitness of each particle according to the average number of corrections and average accuracy of the data set, and find the global optimal solution;
[0027] Step 35: Check whether the termination condition is satisfied. If the termination condition is not satisfied, go to Step 36; if the termination condition is satisfied, go to Step 37;
[0028] Step 36: Update the velocity and position based on the following formulas, and then go to Step 34 after the update;
[0029] V i,j (t + 1) = ωV i,j (t) + c1 * rand(0, 1) * [pbest i,j -x i,j (t)] + c2 * rand(0, 1) * [gbest i,j -x i,j (t)]
[0030] x i,j (t + 1) = x i,j (t) + V i,j (t + 1)
[0031] V i,j is the velocity of the particle; pbest i,j and gbest i, j are defined as the best position of the particle and the best position of the population respectively; rand(0, 1) is a random number between (0, 1); x i,j (t) is the current position of the particle; c1 and c2 are learning factors, and ω is a compression factor;
[0032] Step 37: Fit a curve according to the optimal solution obtained in each iteration to obtain the Pareto optimal solution, and output the end time point t end of the correction period of the optimal solution, the correction start deviation threshold value door, and the attenuation coefficient k of the correction function.
[0033] The present invention also provides a microgrid energy management device, including one or more processors and one or more memories storing computer programs. The one or more processors are configured to execute the computer programs to perform the steps of the above-mentioned load day-ahead prediction correction method based on error correction of the present invention.
[0034] The present invention also provides a storage medium storing a computer program. When the computer program is executed by one or more processors, the one or more processors are caused to execute the steps of the above-mentioned load day-ahead prediction correction method based on error correction of the present invention.
[0035] The load day-ahead prediction correction method based on error correction of the present invention establishes a load prediction model for a park-level microgrid, and performs day-ahead load prediction for the day to be predicted based on the load prediction model; after accumulating the predicted load values and actual load values for multiple days, the key parameters of the correction algorithm are set through a particle swarm algorithm to obtain the optimal parameters; the optimal parameters are built into the correction algorithm, and the load prediction result is corrected immediately on the day to be predicted, providing a more accurate and flexible prediction result for the microgrid energy management system, thereby ensuring the safe and stable operation of the microgrid and achieving the optimal economic operation of the microgrid.
[0036] In addition, the present invention regularly optimizes three key parameters in the correction algorithm through a particle swarm algorithm, namely the end time point t end of the correction period, the correction start deviation threshold door, and the attenuation coefficient k, and immediately corrects the load prediction result based on the correction algorithm of the present invention. As the microgrid system continuously operates and learns, more and more accurate prediction results can be obtained.
[0037] In addition, the day-ahead prediction model of the present invention respectively establishes day-ahead prediction models for working days and rest days according to the day type, and for the different input characteristics of historical load and historical meteorological data, they are processed through different input channels and then merged into the fully connected layer, so as to extract more effective information for training in the early stage, realize the improvement of the convolutional neural network, and without increasing the network depth of the convolutional neural network probability layer. Brief Description of the Drawings
[0038] Figure 1 is a schematic diagram of the steps of the load day-ahead prediction correction method according to an embodiment of the present invention;
[0039] Figure 2 is a schematic diagram of the load prediction model according to an embodiment of the present invention;
[0040] Figure 3 is a logic flow chart of the setting and updating of the correction algorithm parameters according to an embodiment of the present invention;
[0041] Figure 4 is a logic flow chart of determining whether the correction condition is satisfied according to an embodiment of the present invention;
[0042] Figure 5 is a comparison chart of the original day-ahead prediction value, the corrected prediction value, and the actual load value according to an embodiment of the present invention;
[0043] Figure 6 is a comparison chart of the day-ahead prediction and the corrected prediction according to an embodiment of the present invention. Detailed Embodiments
[0044] The following combines the attached Figures 1 to 6The following embodiments are provided to further illustrate the specific implementation manners of the method for correcting the day-ahead load prediction based on error correction according to the present invention. The method for correcting the day-ahead load prediction based on error correction according to the present invention is not limited to the descriptions of the following embodiments.
[0045] A method for correcting the day-ahead load prediction based on error correction according to the present invention includes the following steps:
[0046] Step 1: Establish a day-ahead prediction model based on historical load and historical meteorological data;
[0047] Step 2: Obtain the prediction result of the day to be predicted based on the day-ahead prediction model, save the prediction result of the day to be predicted and the actual load data of the day to be predicted, and accumulate multiple groups of prediction results of the days to be predicted and the corresponding actual load data;
[0048] Step 3: Use the accumulated multiple groups of prediction results of the days to be predicted and the corresponding actual load data, and adopt the particle swarm algorithm to tune the key parameters of the correction algorithm; preferably, the key parameters of the correction algorithm are one or more of the end time point t of the correction period, the correction start deviation threshold door, and the attenuation coefficient k. end
[0049] Step 4: During the correction period on the day to be predicted, regularly check whether the correction condition is satisfied based on the day-ahead predicted load value, the actual load value, and the correction start deviation threshold door. When the correction condition is satisfied, start the correction and correct the day-ahead prediction result of that day through the correction algorithm;
[0050] The correction algorithm is:
[0051] c i = Real i - Predict i , i ∈ (n, n + x * m]
[0052]
[0053] where Real i is the actual load value at the i-th sampling point, Predict i is the day-ahead predicted load value at the i-th sampling point, t now represents the moment when the correction is started, t end is the end time point of the correction period, n is the number of the sampling point data in the x hours before t now , m is the number of sampling points within each hour, k is the attenuation coefficient, Predicti * is the day-ahead predicted load value after correction at the i-th sampling point; the time of the i-th sampling point is t i , and the sampling time period corresponding to the sampling point i ∈ (n, n + x * m] is ti ∈(t now -xh,t now ], the correction time period corresponding to the sampling point i∈[n+x*m,24*m) is t i ∈[t now ,t end ], -xh means the previous x hours.
[0054] The error-corrected load day-ahead forecast correction method of the present invention establishes a load forecast model for a microgrid, and performs day-ahead load forecasting on the forecast day based on the load forecast model; after accumulating forecast load values and actual load values for multiple days, the particle swarm algorithm is used to adjust key parameters of the correction algorithm to obtain optimal parameters; the optimal parameters are built into the correction algorithm, and the load forecast results are immediately corrected on the forecast day, providing a more accurate and flexible prediction result for the microgrid energy management system, thereby ensuring safe and stable operation of the microgrid and achieving optimal economic operation of the microgrid.
[0055] The load day-ahead forecast correction method based on error correction of the present invention is applicable to a park-level microgrid system. The following is a detailed description of an embodiment of a park-level microgrid system of the present invention in conjunction with the accompanying drawings. The flowchart of the present invention is as follows: Figure 1 As shown:
[0056] Considering a park-level microgrid system, according to the method described above, the load day-ahead forecast is corrected to obtain the final forecast result.
[0057] This embodiment is implemented in Python 3.0, and calls MySQL database and Keras package to implement the day-ahead prediction part, and writes the day-ahead prediction results into the database; the Pandas package implements the particle swarm algorithm part to obtain the Pareto optimal solution of the three key parameters of the correction algorithm; on the day to be predicted, the database is read and written again to complete the real-time correction of the prediction results.
[0058] Step 1: Establish a day-ahead forecasting model based on historical load and historical meteorological data.
[0059] First, a certain amount of historical load data of the park microgrid is accumulated, and the historical load data can be stored in the historical load data table; historical meteorological data can be obtained by crawling the historical meteorological data of the park location from the Internet through a meteorological crawler and writing it into the meteorological database table. Then, a day-ahead prediction model is trained based on the historical load data and historical meteorological data obtained. The day-ahead prediction model can use an artificial neural network, which is a prior art in this field and will not be described in detail.
[0060] Preferably, in step 1, a day-ahead prediction model for working days and rest days is established according to the day type, and a day-ahead prediction model for working days and a day-ahead prediction model for rest days are established respectively.
[0061] Preferably, in step 1, the day-ahead prediction model adopts a convolutional neural network model.
[0062] As Figure 2 shown, in this embodiment, for the day-ahead prediction model, different input data processing methods are introduced at the input end. The historical meteorological data has complex non-linear relationships and is input into the fully connected layer of the convolutional neural network module; while the historical load data has strong time series characteristics and is input into the convolutional layer of the convolutional neural network module. Two input data processing methods are adopted; the processed data is then merged and input into the three-layer fully connected layer. In this embodiment, input features of various different characteristics can be processed through different input channels and then merged into the fully connected layer, so as to extract more effective information for training in the early stage, realize the improvement of the convolutional neural network, and without increasing the network depth of the probability layer of the convolutional neural network. Of course, according to different input data, three or more data processing methods can also be adopted.
[0063] This embodiment uses a convolutional neural network model with a multi-input data processing method to establish a day-ahead prediction model, and inputs the accumulated historical load data and historical meteorological data. Since both the historical meteorological data and the historical load data contain the load information of the day to be predicted, each input quantity must be processed in accordance with its time series characteristics. And because the load curve shapes are different under different day types, for example, the load curves on weekdays and rest days are significantly different, and the load curves on weekdays are surely different under different weather types, so classification training and prediction are required, and day-ahead prediction models for weekdays and rest days are established respectively according to the day type.
[0064] At the same time, when establishing the day-ahead prediction model, the order and parameters of the convolutional layer and the pooling layer need to be carefully designed to better extract the data characteristics of the time series. Generally speaking, the deeper the neural network, the higher the accuracy it can obtain in more complex tasks, but it will also lead to longer training time, optimization convergence and overfitting problems. Therefore, the essence of model design is to balance between the complexity and accuracy of the model. Usually, the convolutional layer and the activation function are combined to extract the non-linear relationship between the input and output.
[0065] Preferably, the historical meteorological data includes weather data and weather types. In this embodiment, the day-ahead prediction model selects the weather data (such as temperature data, and may also include data such as humidity, precipitation, sunshine, wind force, etc.) in the historical meteorological data through two fully connected layers of the convolutional neural network module, and the weather types in the historical meteorological data through one fully connected layer of the convolutional neural network module. The historical load data passes through one convolutional layer and one pooling layer of the convolutional neural network module. By adding the pooling layer, the training parameters are reduced without significantly reducing the accuracy. Preferably, the activation function is combined in the convolutional layer to extract the non-linear relationship between the input and output. Finally, all the data is merged and passes through three fully connected layers of the convolutional neural network module to obtain the final output, that is, the day-ahead prediction result.
[0066] Step 2: Obtain the prediction result of the day to be predicted based on the day-ahead prediction model, save the prediction result of the day to be predicted and the actual load data of the day to be predicted, and accumulate multiple groups of prediction results of the days to be predicted and the corresponding actual load data.
[0067] The prediction result of the day to be predicted is obtained from the corresponding input of the day to be predicted, that is, the first prediction result of the day to be predicted before correction. For example, input the date to be predicted: July 11, 2019; day type: working day (encoded as 1); temperature: maximum temperature (25), minimum temperature (12); weather type: sunny (encoded as 2 for example); historical load values. The historical load values can input three historical load data one week ago, two days ago, and one day ago. According to needs, more times can also be input as a reference, such as the historical load values of the same type of day many weeks ago. The actual load data is obtained according to the actual operating load of the campus microgrid on the day to be predicted and is saved to the database. The day-ahead prediction model for each day is predicted in multiple time periods, and the prediction results of each time period and the actual load data of each time period are saved. For example, a day is divided into 24 time periods, one hour for each time period; or a day is divided into 96 time periods, that is, one time period every 15 minutes.
[0068] See Figure 1 For the main part of the day-ahead prediction program, this embodiment is divided into 96 time periods. When predicting the day to be predicted, first judge whether it is a working day or a rest day. If it is a working day, the working day day-ahead prediction model is used. If it is a rest day, the rest day prediction model is used; then obtain the predicted load values at 96 points and write them into the database prediction load data table. The microgrid energy management system of the campus regularly writes the actual load data into the database actual load data table during operation, and generally can save records according to 96 time periods. After multiple days of prediction and operation, multiple groups of prediction results of the days to be predicted and the corresponding actual load data are accumulated.
[0069] Step 3: Use multiple groups of prediction results of the days to be predicted and the corresponding actual load data, and use the particle swarm algorithm to tune the key parameters of the correction method.
[0070] The key parameters of the correction algorithm described in step 3 are the end time point t of the correction period end , one or more of the correction start deviation threshold value door and the attenuation coefficient k. In this embodiment, the correction parameters to be tuned include the end time point t of the correction period end , the correction start deviation threshold value door and the attenuation coefficient k of the correction function. According to the cumulative one-day prediction results and actual load data over multiple days, aiming at the least average number of corrections and the highest average final accuracy, the parameters are tuned to determine the correction start deviation threshold value and the correction period, and a correction scheme is obtained
[0071] The particle swarm optimization (PSO) algorithm simulates the behavior of bird flocks flying for food, and the group reaches the goal through the collective cooperation among birds. Particles are characterized by position, velocity, and fitness value, and the particles continuously update their positions and velocities during iteration. By setting a suitable range of changes for the target parameters, the particle swarm optimization algorithm is used to solve the multi-objective optimization problem to obtain the Pareto optimal solution, that is, the highest prediction accuracy is obtained with the least number of corrections, and the result is used as the built-in parameter of the correction algorithm
[0072] Since the key issues affecting the final accuracy are in the correction start condition and the correction method, that is, the correction problem mainly focuses on three parameters: the end time point t of the correction period end , the correction start deviation threshold value door and the attenuation coefficient k of the correction function. Initialize a group of random particles (random solutions), and then find the optimal solution through iteration. In each iteration, the particles update themselves by tracking two "extreme values". After finding these two optimal values pbest and gbest, the particles update their velocities and positions through the following formulas
[0073] V i,j (t + 1) = ωV i,j (t) + c1 * rand(0, 1) * [pbest i,j - x i,j (t)] + c2 * rand(0, 1) * [gbest i,j - x i,j (t)]
[0074] x i,j (t + 1) = x i,j (t) + V i,j (t + 1)
[0075] V i,j is the velocity of the particle; pbest i,j and gbest i,jThey are respectively defined as the best position of the particle and the best position of the population; rand(0,1) is a random number between (0,1); x i,j (t) is the current position of the particle; c1 and c2 are learning factors, and ω is a compression factor. The learning factors c1 and c2 and the compression factor ω are set constants, which can be adjusted as needed and generally have common value ranges.
[0076] In this embodiment, the parameters of the particle swarm algorithm are set as the inertia factor 0.5, the local velocity factor 0.1, the global velocity factor 0.5, and the number of particle swarms 50.
[0077] In this embodiment, for the three parameters waiting to be trained, the end time point t end of the correction period, the correction start deviation threshold value door, and the change ranges of the attenuation coefficient k are respectively set to [64, 72], [20, 40], and [0.005, 3]. This range is mainly considered because this park is an industrial park, and the daily load change law has a certain periodicity. Also, by observing the prediction results for multiple days, it can be found that most of the large deviations are concentrated between the 64th and 72nd points among 96 time points, that is, between 16:00 and 18:00 in the afternoon. This time period is close to the off - work time, and the load will drop significantly, so the possibility of errors will also increase. Since the load peak of this park is between 200 kW and 600 kW, the more appropriate correction start threshold is between 10% - 20%, so it is set to 20 to 40.
[0078] After the parameters are set, the datasets of the prediction results and the actual load for multiple working days and rest days are used as the training library. The fitness value of each round of calculation is the average number of corrections and the average accuracy of the entire dataset. After completing the calculation of the set number of rounds, the Pareto optimal solution is found in all the fitness value sets, and the corresponding input variable group is the optimal parameter group. The logic is as Figure 3 shown.
[0079] The specific steps for tuning the three correction parameters based on the particle swarm algorithm PSO are as follows:
[0080] Step 31, input the dataset composed of the accumulated multiple groups of prediction results of the days to be predicted and the corresponding actual load data into the particle swarm algorithm; this dataset is a multi - day dataset composed of the daily day - ahead prediction results data and the actual load data at a certain time interval (for example, according to the relevant standards of load prediction, the data interval is 15 minutes, so there are 96 data points per day). For example, input the day - ahead prediction results and the actual load data from July to August 2019 into the particle swarm algorithm, and the correction algorithm obtained by parameter optimization is used for the correction parameters from September to October 2019, or for the correction parameters from July to August 2020.
[0081] Step 32: Initialize parameters. Set the parameters of the particle swarm algorithm as follows: inertia factor 0.5, local velocity factor 0.1, global velocity factor 0.5, and the number of particle swarms 50.
[0082] Step 33: Randomly initialize a number of particles. The three-dimensional coordinates of the particles are the end time point t of the correction period end , the correction start deviation threshold value door, and the attenuation coefficient k. Set the variation ranges of the end time point t of the correction period end , the correction start deviation threshold value door, and the attenuation coefficient k. In this embodiment, 50 particles are initialized, and the variation ranges of the end time point t of the correction period end , the correction start deviation threshold value door, and the attenuation coefficient k are set as [64, 72], [20, 40], and [0.005, 3] respectively. The number of particles can be set according to requirements. The correction time period [64, 72] can be specifically set according to the number of sampling points. For example, if 96 sampling points are set daily, select the load data corresponding to the sampling points in [64, 72]. The start threshold value can also be adjusted according to the specific load magnitude. For example, [20, 40] means the threshold value is between 20 - 40 kw, and the attenuation coefficient [0.005, 3] can be adjusted according to experience and experiments.
[0083] Step 34: Calculate the fitness of each particle according to the average number of corrections and average accuracy of the data set, and find the global optimal solution.
[0084] Step 35: Check whether the termination condition is met. For example, terminate if a certain number of iterations is reached. If the termination condition is not met, enter Step 36; if the termination condition is met, enter Step 37.
[0085] Step 36: Update the velocity and position based on the following formula. After the update, enter Step 34.
[0086] V i,j (t + 1) = ωV i,j (t) + c1 * rand(0, 1) * [pbest i,j -x i,j (t)] + c2 * rand(0, 1) * [gbest i,j -x i,j (t)]
[0087] x i,j (t + 1) = x i,j (t) + V i,j (t + 1)
[0088] V i,j is the velocity of the particle; pbest i,j and gbest i,jThey are respectively defined as the best position of the particle and the best position of the population; rand(0,1) is a random number between (0,1); x i,j (t) is the current position of the particle; c1 and c2 are learning factors, and ω is a compression factor;
[0089] The three parameters of the parameter group, the end time point t of the correction period end 、the correction start deviation threshold door, and the attenuation coefficient k can be understood as the three coordinates of a point in three-dimensional space. By finding the best position of the particle Pareto optimal solution and the best position of the population, the optimal solution is obtained, and the coordinates of the optimal solution of the point are the optimal parameter group.
[0090] Step 37, obtain the Pareto optimal solution according to the optimal fitting curve obtained by each iteration, and output the end time point t of the correction period of the optimal solution end and the correction start deviation threshold door and the attenuation coefficient k of the correction function. The optimal solution of each iteration is fitted into the form of a curve, and the position of the inflection point is considered to be the Pareto optimal solution.
[0091] Step 4: During the correction period on the day to be predicted, regularly check whether the correction condition is satisfied based on the day-ahead predicted load value, the actual load value, and the correction start deviation threshold door. When the correction condition is satisfied, start the correction and correct the day-ahead prediction result of that day through the correction algorithm.
[0092] Set the tuning results of the parameters in the above step 3, that is, the end time point t of the correction period end and the correction start deviation threshold door and the attenuation coefficient k of the correction function in the correction algorithm. During the correction period of the day to be predicted, dynamic detection of errors is carried out. The load sequence of the past hour is detected every unit time interval. If the correction condition is satisfied, such as when the error is higher than the correction start deviation threshold door, the correction algorithm is started to update the day-ahead prediction result of that day. Continuously repeat the above dynamic detection steps to judge whether to start the correction until the correction period ends, and then the real-time updated load prediction value can be obtained for the energy management system to use. The correction algorithm is related to the error size in this period, that is, a time-decaying term is superimposed on the original day-ahead load prediction result, and the attenuation coefficient k is obtained by tuning the above-mentioned particle swarm algorithm. The correction algorithm is always online monitored until the set daily end time point is reached.
[0093] The corrected start deviation threshold value door is a positive number. The correction condition described in step 4 is checked based on the day-ahead predicted load value, the actual load value, and the corrected start deviation threshold value door. For example, when the absolute value of the difference between the predicted load value and the actual load value is greater than the corrected start deviation threshold value door, the correction is started. For example, when the absolute value of the deviation between the predicted load value and the actual load value at all sampling points within a previous time period before the moment of starting the correction is greater than the corrected start deviation threshold value door, the correction is started.
[0094] In this implementation, the correction condition described in step 4 is that when the predicted load sequence and the actual load sequence during the correction value period satisfy the following two conditions, the correction can be started:
[0095] abs(Real i -Predict i )>door, i∈(n, n + x*m], t i ∈(t now -xh, t now ,
[0096] (Real i -Predict i )(Real i+1 -Predict i+1 )>0, i∈(n, n + x*m - 1], t i ∈(t now -xh, t now ,
[0097] where door is the corrected start deviation threshold value, one of the correction program parameters, Real i is the actual load value at the i-th sampling point, Predict i is the day-ahead predicted load value at the i-th sampling point, t now is the moment of starting the correction, n is the number of the sampling point data in the x hours before t now , m is the number of sampling points within each hour, and the time of the i-th sampling point is t i .
[0098] That is, when the absolute value of the deviation between the predicted load value and the actual load value at all sampling points within the previous time period of x hours before the moment of starting the correction is greater than the corrected start deviation threshold value door, and the signs of the deviation between the load predicted value and the actual value are the same, the correction condition is met. The previous time period of x hours can be adjusted as needed. In this embodiment, it is preferably set to 1 hour, and can also be set to half an hour or 2 hours, etc. according to needs.
[0099] See Figure 4In the embodiment, taking a 15 - minute data interval as an example, it is determined whether the absolute values of the predicted load values and the actual load values of 4 data points (t, t - 1 / 4h, t - 1 / 2h, t - 3 / 4h) in the past hour before t are greater than the corrected start - deviation threshold value door. That is, m = 4. If all are greater than the corrected start - deviation threshold value door and the signs of (yn - xn), that is, (predicted load value - actual load value), are the same, then correction is performed according to the correction method.
[0100] The correction algorithm is as follows:
[0101] c i = Real i - Predict i , i ∈ (n, n + x * m]
[0102]
[0103] Among them, Real i is the actual load value of the i - th sampling point, Predict i is the day - ahead predicted load value of the i - th sampling point, t now represents the moment to start correction, t end is the end - time point of the correction period. The daily correction period can be from 1 am to t end , n is the number of the sampling - point data in the x hours before t now In this embodiment, x takes the value of 1, m is the number of sampling points within each hour. In this embodiment, m takes the value of 4, k is the attenuation coefficient used to control the attenuation speed of the correction amount, Predict i * is the day - ahead predicted load value after correction of the i - th sampling point; the time of the i - th sampling point is t i , the sampling time period corresponding to the sampling point i ∈ (n, n + x * m] is t i ∈ (t now - xh, t now , the correction time period corresponding to the sampling point i ∈ [n + x * m, 24 * m) is t i ∈ [t now , t end .
[0104] Assume that the data is sampled once every 15 minutes throughout the day, so there are 96 sampling points in a day. The current time is 1 pm. It is determined whether the data in the previous hour meets the correction conditions, that is, x = 1, m = 4. Then the sampling - point time is t i (12, 13], and the sampling point i belongs to (48, 48 + 1x4], that is, the sampling - point numbers i = 49, 50, 51, 52. It is determined whether the data of these 4 sampling points meets the correction - start conditions; if the correction - start conditions are met, then obtain tend , that is, from the current moment to the specific correction time, such as calculating and obtaining t end is 2 pm, that is, the correction moment is from (13, 14], and the corresponding sampling points at this time are [53, 54, 55, 56]. That is, the predicted load values of the sampling points [53, 54, 55, 56] are corrected according to the correction formula. Taking July 11, 2019 as an example, the comparison between the final predicted curve corrected based on the above correction method and the original predicted curve is as Figure 5 shown.
[0105] In this example, the accuracy evaluation standard adopts the daily average prediction accuracy rate, and the expression is as follows:
[0106]
[0107] where y′ i represents the predicted value of the i-th point on the current day, and y i represents the actual value of the i-th point on the current day.
[0108] As Figure 6 shown, the comparison between the day-ahead prediction accuracy of 16 consecutive days of prediction and the final accuracy after the correction algorithm. It can be seen that the predicted result after correction is more accurate, which is conducive to ensuring the safe and stable operation of the microgrid and realizing the optimal economic operation of the microgrid.
[0109] Step 5: Repeat Step 3 at regular intervals to adjust the key parameters of the correction algorithm.
[0110] With the operation of the microgrid system, more and more predicted results of the days to be predicted and the corresponding actual load data are accumulated. Repeat Step 3 at regular intervals to re-adjust the key parameters of the correction algorithm and update the correction model.
[0111] The present invention also provides a microgrid energy management device, including one or more processors and one or more memories storing computer programs. The one or more processors are used to execute the computer programs to perform the steps of the load day-ahead prediction correction method based on error correction of the present invention.
[0112] The present invention also provides a storage medium storing a computer program. When the computer program is executed by one or more processors, the one or more processors are caused to execute the steps of the load day-ahead prediction correction method based on error correction of the present invention.
[0113] The above content is a further detailed description of the present invention in combination with specific preferred embodiments. It cannot be determined that the specific implementation of the present invention is only limited to these descriptions. For those of ordinary skill in the technical field to which the present invention belongs, without departing from the concept of the present invention, several simple deductions or substitutions can be made, and all should be regarded as belonging to the protection scope of the present invention.
Claims
1. A day-ahead load forecasting correction method based on error correction, characterized in that, It includes the following steps: Step 1: Based on historical load and historical meteorological data, establish a day-ahead prediction model; Step 2: Obtain the prediction results for the day to be predicted based on the day-ahead prediction model, save the prediction results for the day to be predicted and the actual load data for the day to be predicted, and accumulate multiple groups of prediction results for the day to be predicted and the corresponding actual load data; Step 3: Use multiple groups of prediction results for the day to be predicted and the corresponding actual load data, and adopt the particle swarm optimization algorithm to tune the key parameters of the correction algorithm; Step 4: During the correction period on the day to be predicted, regularly check whether the correction condition is met based on the day-ahead predicted load value, the actual load value, and the correction start deviation threshold value door. When the correction condition is met, start the correction, and correct the day-ahead prediction results for that day through the correction algorithm; The correction algorithm is as follows: c i = Real i - Predict i , i ∈ (n, n + x * m] Among them, Real i is the actual load value of the i-th sampling point, Predict i is the day-ahead predicted load value of the i-th sampling point, t now represents the moment when the correction is started, t end is the end time point of the correction period, n is the number of the data of the x hours before t now , m is the number of sampling points within each hour, k is the attenuation coefficient, Predict i * is the day-ahead predicted load value after correction of the i-th sampling point; The time of the i-th sampling point is t i , the sampling time period corresponding to the sampling point i ∈ (n, n + x * m] is t i ∈ (t now - xh, t now , the corrected time period corresponding to the sampling point i ∈ [n + x * m, 24 * m) is t i ∈ [t now , t end .
2. The method for correcting the day-ahead load prediction based on error correction according to claim 1, characterized in that: The correction condition described in Step 4 is that the absolute value of the deviation between the predicted load value and the actual load value at all sampling points in the previous time period before the moment of starting the correction is greater than the correction start deviation threshold value door, and the signs of the deviation between the load prediction value and the actual value are the same.
3. The load day-ahead prediction correction method based on error correction according to claim 1, characterized in that: The key parameters of the correction algorithm described in step 3 are the end time point t of the correction period end , one or more of the correction start deviation threshold value door and the attenuation coefficient k.
4. The load day-ahead prediction correction method based on error correction according to claim 1, characterized in that: It also includes Step 5, repeating Step 3 at regular intervals.
5. The method for correcting the day-ahead load prediction based on error correction according to claim 1, characterized in that: In Step 1, establish day-ahead prediction models for weekdays and rest days respectively according to the day type.
6. The load day-ahead prediction correction method based on error correction according to claim 1, characterized in that: In Step 1, the day-ahead prediction model adopts a convolutional neural network model. The historical meteorological data is input into the fully connected layer of the convolutional neural network module; the historical load data is input into the convolutional layer of the convolutional neural network module.
7. The method for correcting the day-ahead load prediction based on error correction according to claim 6, characterized in that: The historical meteorological data includes weather data and weather type. The weather data is input into two fully connected layers of the convolutional neural network model, the weather type is input into one fully connected layer of the convolutional neural network model, and the historical load data is input into the convolutional layer and pooling layer of the convolutional neural network model. All the processed data is merged and passed through three fully connected layers of the convolutional neural network module to obtain the final output.
8. The method for correcting the day-ahead load prediction based on error correction according to claim 1 or 3, characterized in that The specific steps for tuning the correction parameters based on the particle swarm optimization algorithm are as follows: Step 31, input the data set composed of multiple groups of prediction results for the day to be predicted and the corresponding actual load data into the particle swarm optimization algorithm; Step 32, initialize the parameters, and set the parameters of the particle swarm optimization algorithm, including the inertia factor, local velocity factor, global velocity factor, and the number of particle swarms; Step 33, randomly initialize a number of particles, and the three-dimensional coordinates of the particles are the end time point t of the correction period end , the correction start deviation threshold value door and the attenuation coefficient k, and set the end time point t of the correction period end , the change ranges of the correction start deviation threshold value door and the attenuation coefficient k; Step 34, calculate the fitness for each particle according to the average number of corrections and average accuracy of the data set; Step 35, check whether the termination condition is met. If the termination condition is not met, enter Step 36; if the termination condition is met, enter Step 37; Step 36, update the velocity and position based on the following formula, and enter Step 34 after the update; V i,j (t + 1) = ωV i,j (t) + c1 * rand(0,1) * [pbest i,j - x i,j (t)] + c2*rand(0,1)*[gbest i,j -x i,j (t)] x i,j (t + 1)=x i,j (t)+V i,j (t + 1) V i,j is the velocity of the particle; pbest i,j and gbest i,j are defined as the best position of the particle and the best position of the population respectively; rand(0,1) is a random number between (0,1); x i,j (t) is the current position of the particle; c1 and c2 are learning factors, and ω is the compression factor; Step 37: Obtain the Pareto optimal solution by fitting a curve based on the optimal solution obtained in each iteration, and output the end time point t of the correction period of the optimal solution. end And the correction start deviation threshold value door and the attenuation coefficient k of the correction function.
9. A microgrid energy management device includes one or more processors and one or more memories storing computer programs. The one or more processors are used to execute the computer programs to perform the steps of the load day-ahead prediction correction method based on error correction according to any one of claims 1-8.
10. A storage medium storing a computer program, when the computer program is executed by one or more processors, causing the one or more processors to execute the steps of the load day-ahead prediction correction method based on error correction according to any one of claims 1-8.
Citation Information
Patent Citations
Short-term load prediction method
CN103606022A
All-weather 96-point daily load curve prediction and optimization correction system
CN105069525A