Photovoltaic electric quantity and power prediction method under different time scales
Through the error correction model of KDE based on CTFNet neural network and core density estimation, combined with the moving average method and the gated cyclic unit neural network, the problem of insufficient prediction accuracy of photovoltaic power and power is solved, and the photovoltaic power and power of the day and day is realized Accurate prediction provides a reliable reference for power system balance.
Patent Information
- Application Number
- CN202411824225.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-01-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has insufficient accuracy of photovoltaic power and power prediction under the recent and intraday time scales, resulting in insufficient power supply in the system or risk of abandoning light, making it difficult to provide an effective reference for the dispatching and operation of high-proportion new energy power system.
The photovoltaic power prediction model is constructed based on the CTFNet neural network, and the error correction model of the core density estimation KDE is combined with the moving average method to smooth the photovoltaic power data, and the gated cyclic unit neural network is used to predict intraday photovoltaic power.
It improves the accuracy of photovoltaic power prediction, and can accurately predict the next-day power generation and 15-minute power generation power curves on the day-before and intraday time scales, providing a reliable reference for power system balance.
Smart Images

Figure CN119294618A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic electricity and power prediction, and in particular to a photovoltaic electricity and power prediction method under different time scales. Background Art
[0002] It is necessary to predict the photovoltaic power generation for the next day in order to formulate the power generation plan of the thermal power unit for the next day. The photovoltaic power generation power changes all the time during the day, so it is necessary to predict the photovoltaic power generation power at the 15-minute level to provide a reference for the power balance at the minute level; when the current photovoltaic prediction accuracy is insufficient, the inaccurate prediction will lead to the risk of insufficient power supply or the risk of abandonment of light.
[0003] Therefore, how to predict photovoltaic power and electricity based on the day-ahead and day-intraday time scales respectively and improve the prediction accuracy has become a key issue that needs to be solved urgently, which can provide a reference for the dispatching and operation of high-proportion new energy power systems. Summary of the invention
[0004] In view of the deficiencies in the prior art, the present invention provides a method for predicting photovoltaic electricity and power at different time scales, which aims to solve the problems mentioned in the background technology.
[0005] To achieve the above object, the present invention provides the following technical solution: a method for predicting photovoltaic electricity and power at different time scales, comprising the following steps: Step S1: Collecting photovoltaic daily power generation data to construct a day-ahead photovoltaic power data set, and collecting photovoltaic power data to construct a day-ahead photovoltaic power data set; Step S2: construct and train a photovoltaic power prediction model based on the CTFNet neural network, and use the trained photovoltaic power prediction model to predict photovoltaic daily power generation data; Step S3: construct an error correction model based on kernel density estimation KDE to correct the error of the predicted value of the photovoltaic power prediction model; Step S4: Based on the moving average method, the intra-day photovoltaic power data set is smoothed to obtain a smoothed intra-day photovoltaic power data set; Step S5: construct a photovoltaic power prediction model to perform intra-day photovoltaic power prediction on the smoothed intra-day photovoltaic power data set.
[0006] Furthermore, the specific process of constructing a photovoltaic power prediction model based on the CTFNet neural network is as follows: construct a photovoltaic power prediction model based on the CTFNet neural network; design the photovoltaic power prediction model to have two hidden layers, and the number of neurons in the first hidden layer is 8; the number of neurons in the second hidden layer is 12, and only the data of the last time step is taken; and the activation function is selected as ReLU.
[0007] Furthermore, the specific process of step S1 is as follows: Step S1.1: Count the photovoltaic daily power generation data for N consecutive days to form a photovoltaic daily power generation data set , Represents the photovoltaic daily power generation data on the Nth day; the cubic spline interpolation method is used to expand the photovoltaic daily power generation data set to obtain the photovoltaic power data set on the day before , , , They respectively represent the first extended photovoltaic daily power generation data, the second extended photovoltaic daily power generation data and the third extended photovoltaic daily power generation data generated by expanding the photovoltaic daily power generation data of the Nth day by the cubic spline interpolation method; Step S1.2: Count the photovoltaic power data of M consecutive points, with a data sampling interval of 15 minutes, to form a photovoltaic power data set , Represents the photovoltaic power data of the Mth point. Through the maximum and minimum normalization method, the photovoltaic power data between 0 and 1 in the photovoltaic power data set are taken out to form the intraday photovoltaic power data set , Represents the photovoltaic power data of the Mth point between 0 and 1 obtained by the maximum and minimum normalization method.
[0008] Furthermore, the process of training the photovoltaic power prediction model is as follows: the photovoltaic power data set of the day before is The first training set and the first test set are divided into the proportions a% and 1-a%; the sliding window is set to x days; first, the photovoltaic power prediction model is trained on the first training set, and then the trained photovoltaic power prediction model is placed on the first test set to calculate the prediction error. When the absolute average percentage of the prediction error , then adjust the number of neurons in the hidden layer of the photovoltaic power prediction model until .
[0009] Furthermore, It is expressed as: ; In the formula, and are the known value and predicted value of the photovoltaic daily power generation data in the first test set, respectively; It is the effective photovoltaic daily power generation data in the first test set.
[0010] Furthermore, the specific process of step S3 is as follows: Step S3.1: Based on the error correction model of kernel density estimation KDE, the error value R generated by the photovoltaic power prediction model in the first training set is used as the input of the error correction model to train the error correction model; the trained error correction model is used to perform error prediction on the first test set to obtain the error prediction value S on the first test set; Step S3.2: The photovoltaic power prediction value E of the photovoltaic power prediction model pr Combined with the error prediction value S of the error correction model, the error correction weight k is adjusted to obtain the error-corrected prediction value E prs .
[0011] Furthermore, the specific process of step S5 is as follows: Step S5.1: constructing a photovoltaic power prediction model based on a gated recurrent unit neural network; Step S5.2: Smoothed intraday PV power data set The model is divided into the second training set and the second test set according to the preset ratios b% and 1-b%. The range of the input and output windows of the photovoltaic power prediction model is set, the length of the input and output windows of the photovoltaic power prediction model is initially set, and the average of the square of the difference between the predicted value and the actual value of the photovoltaic power prediction model is used as the loss function. The model is trained on the second training set and tested on the second test set. The photovoltaic power prediction model first predicts step by step through a large interval, and when it detects that the error continues to grow, it predicts through a small interval step size, and selects the photovoltaic power prediction model with the smallest loss function and saves it.
[0012] An electronic device comprises a processor, a memory and a bus, wherein the processor and the memory are connected via the bus, wherein the memory is used to store a set of program codes, and the processor is used to call the program codes stored in the memory to execute a method for predicting photovoltaic electricity and power under different time scales.
[0013] A non-volatile computer storage medium stores computer executable instructions, which can execute a photovoltaic electricity and power prediction method under different time scales.
[0014] Compared with the existing technology, the present invention has the following beneficial effects: the present invention predicts the photovoltaic power generation of the next day and the power generation power curve every 15 minutes of the next day on the day-ahead and intra-day time scales, which can be used by the dispatching department to formulate a day-ahead power balance plan and a point-by-point adjustment plan for intra-day photovoltaic power, respectively, to provide a reference basis for the system power balance; and the error correction model based on kernel density estimation KDE is used to correct the error of the predicted value of the photovoltaic power prediction model based on the CTFNet neural network, which can greatly improve the accuracy of the predicted value of the photovoltaic power prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a flow chart of the steps of the present invention.
[0016] Figure 2 It is the error box plot of the previous day prediction in the present invention.
[0017] Figure 3 It is the error distribution histogram of the day-ahead prediction in the present invention. DETAILED DESCRIPTION
[0018] like Figure 1 As shown, the present invention provides a technical solution: a photovoltaic power and power prediction method under different time scales, comprising the following steps:
[0019] Step S1: Collect photovoltaic daily power generation data to construct a day-ahead photovoltaic power data set, and collect photovoltaic power data to construct a day-ahead photovoltaic power data set.
[0020] Step S1.1: Count the photovoltaic daily power generation data for N consecutive days to form a photovoltaic daily power generation data set , Represents the photovoltaic daily power generation data on the Nth day; in order to increase data density and improve data continuity, the cubic spline interpolation method is used to expand the photovoltaic daily power generation data set to obtain the photovoltaic power data set on the day before. , , , They respectively represent the first extended photovoltaic daily power generation data, the second extended photovoltaic daily power generation data and the third extended photovoltaic daily power generation data generated by expanding the photovoltaic daily power generation data on the Nth day by the cubic spline interpolation method.
[0021] Step S1.2: Count the photovoltaic power data of M consecutive points, with a data sampling interval of 15 minutes, to form a photovoltaic power data set , Represents the photovoltaic power data of the Mth point. Through the maximum and minimum normalization method, the photovoltaic power data between 0 and 1 in the photovoltaic power data set are taken out to form the intraday photovoltaic power data set , Represents the photovoltaic power data of the Mth point between 0 and 1 obtained by the maximum and minimum normalization method.
[0022] Step S2: Build and train a photovoltaic power prediction model based on the CTFNet neural network, and use the trained photovoltaic power prediction model to predict the photovoltaic daily power generation data.
[0023] Step S2.1: Construct a photovoltaic power prediction model based on the CTFNet neural network (an anchor-free network based on center and scale prediction); design the photovoltaic power prediction model to have two hidden layers, and the number of neurons in the first hidden layer is 8, which is used to capture short-term dependencies in time series data; the number of neurons in the second hidden layer is 12, and only the data of the last time step is taken to extract higher-level features from the output of the hidden layer of the first layer; select the activation function as ReLU.
[0024] Step S2.2: The day-ahead photovoltaic power data set The first training set and the first test set are divided into the proportions a% and 1-a%; the sliding window is set to x days; first, the photovoltaic power prediction model is trained on the first training set, and then the trained photovoltaic power prediction model is placed on the first test set to calculate the prediction error. When the absolute average percentage of the prediction error , then adjust the number of neurons in the hidden layer of the photovoltaic power prediction model until .
[0025] It is expressed as: (1); In the formula, and are the known value and predicted value of the photovoltaic daily power generation data in the first test set, respectively; It is the effective photovoltaic daily power generation data in the first test set.
[0026] Step S3: construct an error correction model based on kernel density estimation (KDE) to correct the error of the predicted value of the photovoltaic power prediction model.
[0027] Step S3.1: Based on the error correction model of kernel density estimation (KDE), the error value R generated by the photovoltaic power prediction model in the first training set is used as the input of the error correction model to train the error correction model; the trained error correction model is applied to the error prediction of the first test set to obtain the error prediction value S on the first test set.
[0028] Step S3.2: The photovoltaic power prediction value E of the photovoltaic power prediction model pr Combined with the error prediction value S of the error correction model, the error correction weight k is adjusted to obtain the error-corrected prediction value E prs .
[0029] Step S4: Based on the moving average method, the intra-day photovoltaic power data set Perform smoothing to obtain the smoothed intraday photovoltaic power data set , express The data obtained after smoothing.
[0030] Step S5: Construct a photovoltaic power prediction model for the smoothed intraday photovoltaic power data set Conduct intraday photovoltaic power forecasting.
[0031] Step S5.1: Building a photovoltaic power prediction model based on a gated recurrent unit neural network (GRU).
[0032] Step S5.2: Smoothed intraday PV power data set The model is divided into the second training set and the second test set according to the preset ratios b% and 1-b%. The range of the input and output windows of the photovoltaic power prediction model is set, the length of the input and output windows of the photovoltaic power prediction model is initially set, and the average of the square of the difference between the predicted value and the actual value of the photovoltaic power prediction model is used as the loss function. The model is trained on the second training set and tested on the second test set. The photovoltaic power prediction model is first predicted step by step with a large interval. When it is detected that the error continues to increase, it is predicted with a small interval step size. The photovoltaic power prediction model with the smallest loss function is selected and saved.
[0033] The forecast effect of the photovoltaic power generation on the day before and the photovoltaic power generation within the day is analyzed:
[0034] The forecast effect analysis is carried out in the form of forecast error box plot and forecast error histogram. The error box plot of the day-ahead photovoltaic power forecast is shown in the figure below. Figure 2 The error distribution histogram of the photovoltaic power forecast is shown in Figure 3 shown.
[0035] Depend on Figure 2 and Figure 3 It can be seen that the minimum prediction error of the photovoltaic power prediction model based on the CTFNet neural network is -5.0697MWh, the maximum is 4.2003MWh, the median is -0.6191MWh, the upper quartile is 0.3776MWh, the lower quartile is -2.0587MWh, and 1 outlier appears; the error is concentrated between -6 and 5MWh, and is most concentrated at -0.3187MWh. After correction by the error correction model based on kernel density estimation, the minimum error is -2.7966MWh, the maximum is 2.9113MWh, the median is 0.1169MWh, the upper quartile is 1.1596MWh, and the lower quartile is -0.9548MWh, eliminating the outliers that appeared before the error correction; the error is concentrated between -3 and 3MWh. It can be seen that the error correction method of the present invention is effective.
[0036] The prediction effect is analyzed in the form of mean square error (MSE) and root mean square error (RMES). The effect of the day-ahead photovoltaic power prediction is calculated according to formula (2) and formula (3); the effect of the intraday photovoltaic power prediction is calculated according to formula (4) and formula (5); (2); (3); (4); (5); In the formula, and are the known values and predicted values of the photovoltaic power data in the second test set, respectively; is the effective photovoltaic power data in the second test set.
[0037] An electronic device comprises a processor, a memory and a bus, wherein the processor and the memory are connected via the bus, wherein the memory is used to store a set of program codes, and the processor is used to call the program codes stored in the memory to execute a method for predicting photovoltaic electricity and power under different time scales.
[0038] A non-volatile computer storage medium stores computer executable instructions, which can execute a photovoltaic electricity and power prediction method under different time scales.
[0039] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A photovoltaic power and power prediction method under different time scales, characterized in that: The steps include: Step S1: Collecting photovoltaic daily power generation data to construct a day-ahead photovoltaic power data set, and collecting photovoltaic power data to construct a day-ahead photovoltaic power data set; Step S2: construct and train a photovoltaic power prediction model based on the CTFNet neural network, and predict the photovoltaic daily power generation data through the trained photovoltaic power prediction model; Step S3: construct an error correction model based on kernel density estimation KDE to correct the error of the predicted value of the photovoltaic power prediction model; Step S4: Based on the moving average method, the intra-day photovoltaic power data set is smoothed to obtain a smoothed intra-day photovoltaic power data set; Step S5: construct a photovoltaic power prediction model to perform intra-day photovoltaic power prediction on the smoothed intra-day photovoltaic power data set.
2. The photovoltaic power and electricity prediction method under different time scales according to claim 1 is characterized by: The specific process of constructing a photovoltaic power prediction model based on the CTFNet neural network is as follows: construct a photovoltaic power prediction model based on the CTFNet neural network; design the photovoltaic power prediction model to have two hidden layers, with 8 neurons in the first hidden layer; the second hidden layer has 12 neurons, and only takes the data of the last time step; select the activation function as ReLU.
3. The photovoltaic power and power prediction method under different time scales according to claim 2 is characterized by: The specific process of step S1 is: Step S1.1: Count the photovoltaic daily power generation data for N consecutive days to form a photovoltaic daily power generation data set , Represents the photovoltaic daily power generation data on the Nth day; the cubic spline interpolation method is used to expand the photovoltaic daily power generation data set to obtain the photovoltaic power data set on the day before , , , They respectively represent the first extended photovoltaic daily power generation data, the second extended photovoltaic daily power generation data and the third extended photovoltaic daily power generation data generated by expanding the photovoltaic daily power generation data of the Nth day by the cubic spline interpolation method; Step S1.2: Count the photovoltaic power data of M consecutive points, with a data sampling interval of 15 minutes, to form a photovoltaic power data set , Represents the photovoltaic power data of the Mth point. Through the maximum and minimum normalization method, the photovoltaic power data between 0 and 1 in the photovoltaic power data set are taken out to form the intraday photovoltaic power data set , Represents the photovoltaic power data of the Mth point between 0 and 1 obtained by the maximum and minimum normalization method.
4. The photovoltaic power and electricity prediction method under different time scales according to claim 3 is characterized by: The process of training the photovoltaic power prediction model is as follows: the photovoltaic power data set of the day before is The first training set and the first test set are divided into the proportions a% and 1-a%; the sliding window is set to x days; first, the photovoltaic power prediction model is trained on the first training set, and then the trained photovoltaic power prediction model is placed on the first test set to calculate the prediction error. When the absolute average percentage of the prediction error , then adjust the number of neurons in the hidden layer of the photovoltaic power prediction model until .
5. The photovoltaic power and electricity prediction method under different time scales according to claim 4 is characterized in that: It is expressed as: ; In the formula, and are the known value and predicted value of the photovoltaic daily power generation data in the first test set, respectively; It is the effective photovoltaic daily power generation data in the first test set.
6. The photovoltaic power and power prediction method under different time scales according to claim 5 is characterized by: The specific process of step S3 is: Step S3.1: Based on the error correction model of kernel density estimation KDE, the error value R generated by the photovoltaic power prediction model in the first training set is used as the input of the error correction model to train the error correction model; the trained error correction model is used to perform error prediction on the first test set to obtain the error prediction value S on the first test set; Step S3.2: The photovoltaic power prediction value E of the photovoltaic power prediction model pr Combined with the error prediction value S of the error correction model, the error correction weight k is adjusted to obtain the error-corrected prediction value E prs .
7. The photovoltaic power and electricity prediction method under different time scales according to claim 6 is characterized by: The specific process of step S5 is: Step S5.1: constructing a photovoltaic power prediction model based on a gated recurrent unit neural network; Step S5.2: Smoothed intraday PV power data set The model is divided into the second training set and the second test set according to the preset ratios b% and 1-b%. The range of the input and output windows of the photovoltaic power prediction model is set, the length of the input and output windows of the photovoltaic power prediction model is initially set, and the average of the square of the difference between the predicted value and the actual value of the photovoltaic power prediction model is used as the loss function. The model is trained on the second training set and tested on the second test set. The photovoltaic power prediction model first predicts step by step through a large interval, and when it detects that the error continues to grow, it predicts through a small interval step size, and selects the photovoltaic power prediction model with the smallest loss function and saves it.
8. An electronic device, characterized in that: It includes a processor, a memory and a bus, wherein the processor and the memory are connected via the bus, wherein the memory is used to store a set of program codes, and the processor is used to call the program codes stored in the memory to execute a photovoltaic electricity and power prediction method under different time scales as described in any one of claims 1 to 7.
9. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions execute a photovoltaic electricity and power prediction method at different time scales as described in any one of claims 1-7.
Citation Information
Patent Citations
Photovoltaic power prediction method based on a convolutional neural network and meta-learning
CN110070226A
New energy medium-and-long-term electric quantity prediction method considering macroscopic volatility classification
CN112149879A
Intrusion detection method based on long-short-term memory self-encoding classifier under Internet of Things
CN113556319A
Short-time photovoltaic generating capacity prediction method and system considering weather conditions and medium
CN116402203A
Stacking plum rain season photovoltaic power prediction method and system based on BiGRU-Attention
CN117895484A