Ultra-short-term photovoltaic power prediction method based on small-scale weather classification and adaptive window
Through the method of small-scale weather classification and adaptive window matching, the problem of low accuracy of photovoltaic power generation prediction in rainy weather is solved, and higher prediction accuracy and power system stability are achieved, which is suitable for energy scheduling of power grid systems.
Patent Information
- Application Number
- CN202411036983.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-26
AI Technical Summary
The existing photovoltaic power prediction is not effective in rainy weather, and the fixed time window cannot adapt to the changes in different time scales in the photovoltaic power time series, resulting in low prediction accuracy and affecting the stability of the power system.
Ultra-short-term photovoltaic power prediction method based on small-scale weather classification and adaptive windows is adopted, and small-time-scale meteorological events and adaptive time window matching are divided by DTW algorithm, and prediction is performed using BiGRU neural network.
It improves the accuracy of photovoltaic power prediction in complex situations such as rainy weather, enhances the stability and reliability of the power system, can accurately capture short-term meteorological sudden changes and long-term trends, and improves the adaptability and robustness of the prediction model.
Smart Images

Figure CN119026731A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of photovoltaic power generation prediction, and in particular relates to an ultra-short-term photovoltaic power prediction method based on small-scale weather classification and adaptive window. Background Art
[0002] Photovoltaic power generation, as a clean energy solution, is receiving widespread attention, and its grid-connected capacity has increased significantly. However, due to the obvious intermittency of photovoltaic power generation and the significant impact of weather changes, especially in rainy weather, photovoltaic power generation shows strong volatility and randomness, which brings severe challenges to the large-scale photovoltaic energy grid connection. At present, the photovoltaic power prediction effect is better in clear weather, but in rainy weather, the photovoltaic power prediction effect is greatly reduced. Therefore, under rainy meteorological conditions, accurate and reliable photovoltaic power generation prediction is of great significance to the energy dispatch and stable and safe operation of the power system.
[0003] Photovoltaic power prediction mainly adopts two major methods: physical method and statistical method. The physical method is limited because of its complex modeling and difficulty in adapting to certain extreme weather conditions, while the statistical method predicts based on the statistical law between input factors and actual power, which has strong robustness. Therefore, statistical methods have been increasingly widely used in recent years. Commonly used statistical methods include support vector machines, Markov chains, neural networks, etc. Among them, the gated recurrent unit (GRU) is a typical neural network algorithm, and the bidirectional gated recurrent unit (BiGRU) is improved on its basis by considering the change law of the previous and next data at the same time. It can more fully mine the correlation between the previous and next data and has better effect on time series prediction. However, the regularity of solar movement and the volatility of atmospheric state lead to complex changes in solar irradiance, resulting in different characteristics of photovoltaic power in different weather conditions, especially in rainy weather, which often presents mutations and large fluctuations, which brings great challenges to prediction.
[0004] At present, many scholars have improved the prediction performance of machine learning algorithms through pre-processing before prediction. For example, clustering algorithms are used to classify historical data into weather categories to establish different training sets to capture and reflect the impact of different weather conditions on photovoltaic power. However, based on the actual situation, the weather is complex and changeable. Simply classifying the weather conditions of a day into one type of weather cannot accurately represent the power changes of a day. This large-time scale classification method cannot capture the sudden changes and large fluctuations of solar irradiance in a short period of time. In addition, current machine learning methods are usually trained with a fixed time window, while photovoltaic power time series do not have fixed time window variation characteristics. Therefore, a single time window can provide reasonable estimates, but may result in missing or redundant information captured in certain time periods, and cannot adapt to changes in the time series patterns of short-term fluctuations and long-term trends.
[0005] The existing technical solutions have the following two problems that need to be solved:
[0006] Problem 1: The output of photovoltaic power generation varies greatly under different meteorological conditions, and its volatility and instability lead to poor prediction results, especially in rainy and other volatile weather conditions. Short-term weather fluctuations will cause large-scale fluctuations in photovoltaic output, and even short-term low output. If the weather process cannot be identified in time and targeted prediction methods cannot be established, it will seriously affect the power balance of the power system. Therefore, it is necessary to distinguish training sets under different meteorological conditions. Most of the existing weather type classifications are based on days. Rainy weather is affected by cloud movement and showers, and has strong randomness. It is difficult to predict the power of another day by similarity matching based on the changes in one day, and a smaller scale of meteorological events is required.
[0007] Problem 2: For ultra-short-term photovoltaic power forecasting, although the BiGRU neural network fixed time window can capture time series related information for forecasting, the changes in different time periods in the photovoltaic power time series are inconsistent, that is, there are differences in time scales. This means that the machine learning method trained with a fixed time window may not be able to capture the changes and trends at different scales in this time series, resulting in too limited information captured in certain time periods, or too much redundant information in certain time periods, and the failure to capture the large power fluctuations caused by meteorological mutations, thus affecting the prediction effect of photovoltaic power. Therefore, it is necessary to dynamically select the best matching time window and meteorological event as learning data for forecasting.
[0008] In summary, ultra-short-term photovoltaic power prediction requires smaller-scale weather condition division and real-time adjustment of time windows to establish prediction models for training and prediction. Summary of the invention
[0009] Purpose of the invention: In order to overcome the problem of inaccurate large-scale weather classification caused by complex and changeable weather and the difficulty of capturing information caused by fixed time windows, the present invention proposes an ultra-short-term photovoltaic power prediction method based on small-scale weather classification and adaptive windows. The ultra-short-term prediction of photovoltaic power under different weather conditions is carried out by using targeted learning windows and data, aiming to improve the ultra-short-term photovoltaic power prediction accuracy under complex conditions such as cloudy and rainy weather, enhance the stability and reliability of photovoltaic power generation grid-connected power systems, and thus be applied in the energy scheduling of power grid systems to improve system stability.
[0010] Technical solution: To achieve the purpose of the present invention, the technical solution adopted by the present invention is: an ultra-short-term photovoltaic power prediction method based on small-scale weather classification and adaptive window, comprising the following steps:
[0011] S1. Obtain historical measured data of photovoltaic power stations and numerical weather forecast data. Each measured data consists of photovoltaic power data and meteorological data. The numerical weather forecast data consists of multiple meteorological factor data. Perform data preprocessing and correlation analysis.
[0012] S2. Use the DTW algorithm to divide the historical data into three types of meteorological event sample data of small-scale rainy days, cloudy days, and sunny days, and obtain three types of small-time-scale meteorological event data sets;
[0013] S3, DTW algorithm adaptive time window matching: Use the DTW algorithm to match the NWP data of the forecast period with several historical meteorological events that are most similar to it;
[0014] S4. The data set divided by S2 is input into the BiGRU prediction model as a training set. The model is trained according to the matching and time window adaptation mechanism of S3, and the model outputs the predicted power data.
[0015] Furthermore, S1 performs data preprocessing and correlation analysis, the process includes:
[0016] Delete outliers and missing values, and use the Pearson correlation coefficient method to perform correlation analysis on all meteorological factors and photovoltaic power generation in historical measured data. The formula is as follows:
[0017]
[0018] In the formula, r is the correlation coefficient between meteorological factors and photovoltaic power generation, T is the length of the original input data, t is the tth moment, and X t is the value of a meteorological factor with a correlation coefficient with photovoltaic power generation at the tth moment, is the average value of the corresponding meteorological factor, Y t is the photovoltaic power value at the tth moment; is the average value of photovoltaic power generation.
[0019] Furthermore, S2 uses the DTW algorithm to divide the historical data into small-scale meteorological events, and divides the set X containing N historical data into three categories: rainy day, cloudy day, and sunny day meteorological events;
[0020] S2.1, let H be the typical weather sample of a rainy day as the matching benchmark, and L be the direct solar radiation sequence in the historical data;
[0021] H={h1,h2,...,h n} and L={l1,l2,...,l m} are two time series of direct solar radiation with lengths of n and m respectively, h i and lj The distance between two points is defined as d(i,j)=|h i -l j | p ,| | p represents the p-norm;
[0022] S2.2. Create an n×m distance matrix D, where the element (i, j) of the matrix represents the distance d(i, j) between the i-th point of time series H and the j-th point of time series L, and also represents the alignment of the i-th point of time series H with the j-th point of time series L;
[0023] S2.3. Find a path through several points in the matrix D. The path represents the matching relationship between each point in the time series H and L. Different paths correspond to different matching relationships.
[0024] Under the conditions of meeting the boundary, monotonicity and continuity, the dynamic programming method is used to solve the optimal regular path S = {s1, s2, ..., s k}, where s k is a point on the path, max(m,n)≤k≤m+n-1;
[0025] Cumulative distance It is the sum of the distance d(i,j) of the current element and the cumulative distance of the smallest adjacent element that can reach the element. The final cumulative distance The DTW distance corresponding to time series H and L, that is, the similarity measurement distance between time series H and L; The calculation formula is:
[0026]
[0027] in,
[0028] S2.4. According to the methods of S2.1 to S2.3, the similarity measurement distances are calculated respectively when cloudy and sunny days are used as typical weather samples as matching benchmarks, and the weather corresponding to the minimum distance of the three similarity measurement distances obtained in the same historical time period is taken as the small time scale weather classification result;
[0029] All historical data are divided into three categories of small time scale meteorological events H G , H G ={h′1,h′2,...,h′ g},G=1,2,...,M,h′ g is a small-scale meteorological event in a certain division in the historical data, and M is the total number of small-time-scale meteorological events divided.
[0030] Furthermore, S3 uses the DTW algorithm to match the NWP data of the forecast period with several historical meteorological events that are most similar to it. The process includes:
[0031] First, the meteorological event type of the time period is divided according to the NWP data of the time period to be predicted, and the direct solar radiation data of the corresponding time window is taken as the matching reference time series, which is expressed as L O ={l1,l2,...,l f}, where f is the time window length of the meteorological event type, l f is the direct solar radiation value corresponding to the fth moment;
[0032] Then all the small time scale meteorological events H that have been divided in S2 G Calculate the DTW similarity metric distance one by one To match the benchmark time series L O With H G The calculated similarity metric distance;
[0033] Get M small-scale meteorological event time series and matching benchmark time series L O The similarity metric distance is used to select the K hourly meteorological events corresponding to the smallest similarity metric distance value as the best matching learning data.
[0034] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:
[0035] 1. Traditional weather classification methods often use larger time scales as units, such as classification by day. However, the present invention, through in-depth research on the volatility and complexity of photovoltaic power time series, adopts the dynamic time warping algorithm (DTW) to divide historical meteorological data into small-scale meteorological events, thereby achieving a more detailed and flexible classification of weather conditions. The key to this improvement is that through the precise matching of DTW, meteorological events can be divided into small scales within a shorter time range, which more accurately reflects the output differences of photovoltaic power under different meteorological conditions. This small-scale weather event division method provides more targeted and accurate training data for photovoltaic power forecasting, especially under weather conditions with large fluctuations such as cloudy and rainy weather, providing a solid foundation for improving forecasting accuracy.
[0036] Second, when using neural networks for prediction, the setting of the time window is a crucial factor. In response to this key issue, the present invention introduces the concept of an adaptive time window in ultra-short-term photovoltaic power prediction to flexibly respond to changes and trends on different time scales in photovoltaic power time series. Unlike traditional fixed time windows, the selection of adaptive time windows is dynamic and can be adjusted in real time according to the characteristics of meteorological events in historical data, so that the machine learning algorithm can more accurately capture the changing patterns in photovoltaic power time series. The core of this improvement is that the NWP data of the time period to be predicted can be used to match the most similar historical meteorological events as learning data for prediction using the DTW method. This can not only quickly capture power fluctuations caused by sudden meteorological changes in the short term, but also adapt to changes in long-term trends, thereby improving the adaptability and robustness of the prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is an overall flow chart of the method of the present invention. DETAILED DESCRIPTION
[0038] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0039] The present invention studies historical fault events and photovoltaic power prediction of domestic and foreign power grid systems, and finds that the key to improving the prediction accuracy of photovoltaic power on rainy days is through the method of small-time-scale weather division and adaptive time window prediction. The present invention uses the dynamic time warping algorithm (DTW) to divide historical data into small-time-scale weather events to obtain three types of small-time-scale meteorological event data sets, and then uses DTW to match the best historical meteorological events in the time period to be predicted to achieve adaptive time windows, thereby constructing a BiGRU prediction model, which has the characteristics of strong pertinence and high prediction accuracy for photovoltaic power prediction of different weather types, and has good application prospects.
[0040] The present invention discloses an ultra-short-term photovoltaic power prediction method based on small-scale weather classification and adaptive window, the process is as follows: Figure 1 As shown, the specific implementation steps are as follows:
[0041] S1. Data preprocessing and correlation analysis.
[0042] This embodiment selects the historical measured data and numerical weather forecast data of a photovoltaic power station in Jurong City, Jiangsu Province from January 1, 2021 to December 31, 2021. The maximum installed capacity of this photovoltaic power station is 10MW. Each measured data consists of photovoltaic power data and meteorological data including direct solar radiation, scattered radiation, ambient temperature, relative humidity, wind speed, and wind direction. The numerical weather forecast data consists of forecasted meteorological data.
[0043] This embodiment excludes night data and retains data from 07:35 to 18:25 every day. The data is sampled every 5 minutes, with 131 sampling points per day, for a total of 47,815 data. After data quality control, outliers and missing values are deleted, leaving 46,936 data. The Pearson correlation coefficient method is used to perform a correlation analysis on all meteorological factors and photovoltaic power generation in the historical measured data. The original data matrix is expressed as:
[0044]
[0045] Where j = 8, x t1 ,x t2 ,…,x tj They are the values of photovoltaic power generation, direct solar irradiance, scattered solar irradiance, ambient temperature, wind speed, relative humidity, wind direction, and rainfall at time t.
[0046] The correlation of each meteorological factor is calculated by the Pearson correlation coefficient method, and the formula is as follows:
[0047]
[0048] In the formula, r is the correlation coefficient between meteorological factors and photovoltaic power generation, T is the length of the original input data, t is the tth moment, and X t is the value of a meteorological factor with a correlation coefficient with photovoltaic power generation at the tth moment, is the average value of the corresponding meteorological factor, Y t is the photovoltaic power value at the tth moment; is the average value of photovoltaic power generation.
[0049] S2. The historical data are divided into small-scale meteorological events through the DTW algorithm. The set X containing N historical data (historical measured meteorological data, measured power data and numerical weather forecast data) is divided into three categories of sample data: rainy day, cloudy day and sunny day meteorological events with two-hour data as a group.
[0050] S2.1. Since photovoltaic power has the strongest correlation with direct solar radiation, let H be the typical weather sample of a rainy day as the matching benchmark, and L be the direct solar radiation sequence in the historical data.
[0051] H={h1,h2,...,h n} and L={l1,l2,...,l m} are two time series of direct solar radiation with lengths of n and m respectively. i and l j The distance between two points is defined as d(i,j)=|h i -l j |p ,| | p represents the p-norm.
[0052] S2.2. Create an n×m distance matrix. The element (i, j) of the matrix represents the alignment of the i-th point of time series H with the j-th point of time series L, that is, the distance between the i-th point of time series H and the j-th point of time series L. The matrix is represented as:
[0053]
[0054] S2.3. Find a path through several points in the matrix D. The path represents the matching relationship between each point in the time series H and L. Different paths correspond to different matching relationships. Under the conditions of satisfying the boundary, monotonicity and continuity, the optimal regular path S = {s1, s2, ..., s k}, where s k is a point on the path, max(m,n)≤k≤m+n-1. Cumulative distance It is the sum of the distance d(i,j) of the current element and the cumulative distance of the smallest adjacent element that can reach the element. The final cumulative distance The DTW distance corresponding to time series H and L is also the similarity measure distance between time series H and L. The calculation formula is:
[0055]
[0056] in,
[0057] S2.4. According to the methods of S2.1 to S2.3, the similarity measurement distances are calculated respectively when cloudy and sunny days are used as typical weather samples as matching benchmarks, and the weather corresponding to the minimum distance of the three similarity measurement distances obtained in the same historical time period is taken as the small time scale weather classification result, and all historical data are divided into three categories of small time scale meteorological events H G , H G ={h′1,h′2,...,h′ g},G=1,2,...,M,h′ g is a small-scale meteorological event in a certain division in the historical data, and M is the total number of small-time-scale meteorological events divided.
[0058] S3, DTW algorithm adaptive time window matching. The DTW algorithm is used to match the numerical weather forecast (NWP) data of the forecast time period with a historical meteorological event that is most similar to the forecast time period, thereby achieving adaptive matching of different time window sizes.
[0059] According to the NWP data of the time period to be predicted, the meteorological event type of the time period to be predicted is divided, and the direct solar radiation data of the corresponding time window is taken as the matching reference time series, which is expressed as L O ={l1,l2,...,l f}, where f is the time window length of the meteorological event type, l f is the direct solar radiation value corresponding to the fth moment.
[0060] Then all the small time scale meteorological events H that have been divided in S2 G Calculate the DTW similarity metric distance one by one To match the benchmark time series L O With H G The similarity metric distance calculated is M small-scale meteorological event time series and the matching benchmark time series L O The similarity metric distance is used to select the 10 hourly meteorological events corresponding to the smallest similarity metric distance value as the best matching learning data.
[0061] S4. Normalize the original historical data.
[0062] S5. Build a BiGRU prediction model.
[0063] Bidirectional Gated Recurrent Unit (BiGRU) is a special variant structure of GRU, which consists of two layers of GRU models with the same output but opposite information transmission directions. When making predictions, BiGRU can simultaneously consider information from the past and future moments, fully exploit the photovoltaic power time series characteristics, and improve data utilization and model prediction accuracy. The specific calculation formula of BiGRU is expressed as:
[0064]
[0065] Where, X t represents the input of the GRU model at time t, δ represents the sigmoid activation function, represents the output of the forward GRU model at time t, Represents the output of the forward GRU model at time t-1, Represents the output of the backward GRU model at time t, represents the output of the backward GRU model at time t+1, h t represents the hidden layer output, W f1 With W f2 They represent the input weight matrix at time t and the output weight matrix at time t-1 of the forward GRU model respectively; W b1 and W b2W1 is the input weight matrix of the backward GRU model at time t and the output weight matrix at time t+1; W1 and W2 are the output weight matrices of the forward GRU model and the backward GRU model respectively.
[0066] S6. Train and predict the BiGRU neural network.
[0067] The last three events of each of the three categories of small-time-scale meteorological event data divided by S2 are used as the test set, and the other data of the same type of meteorological events are used as the training set. According to the matching and time window adaptation mechanism of S3, the model is trained, and the model outputs the predicted power data. Predict the test set to get the prediction result is the predicted value of the tth sample photovoltaic power data.
Claims
1. An ultra-short-term photovoltaic power prediction method based on small-scale weather classification and adaptive window, characterized in that: S1. Obtain historical measured data of photovoltaic power stations and numerical weather forecast data. Each measured data consists of photovoltaic power data and meteorological data. The numerical weather forecast data consists of multiple meteorological factor data. Perform data preprocessing and correlation analysis. S2. Use the DTW algorithm to divide the historical data into three types of meteorological event sample data of small-scale rainy days, cloudy days, and sunny days, and obtain three types of small-time-scale meteorological event data sets; S3, DTW algorithm adaptive time window matching: Use the DTW algorithm to match the NWP data of the forecast period with several historical meteorological events that are most similar to it; S4. The data set divided by S2 is input into the BiGRU prediction model as a training set. The model is trained according to the matching and time window adaptation mechanism of S3, and the model outputs the predicted power data.
2. The ultra-short-term photovoltaic power prediction method according to claim 1, characterized in that: S1 performs data preprocessing and correlation analysis, the process includes: Delete outliers and missing values, and use the Pearson correlation coefficient method to perform correlation analysis on all meteorological factors in the original data and photovoltaic power generation. The formula is as follows: In the formula, r is the correlation coefficient between meteorological factors and photovoltaic power generation, T is the length of the original input data, t is the tth moment, and X t is the value of a meteorological factor with a correlation coefficient with photovoltaic power generation at the tth moment, is the average value of the corresponding meteorological factors, Y t is the photovoltaic power value at the tth moment; is the average value of photovoltaic power generation.
3. The ultra-short-term photovoltaic power prediction method according to claim 1 or 2, characterized in that: S2 uses the DTW algorithm to divide historical data into small-scale meteorological events, and divides the set X containing N historical data into three categories: rainy day, cloudy day, and sunny day meteorological events; S2.1, let H be the typical weather sample of a rainy day as the matching benchmark, and L be the direct solar radiation sequence in the historical data; H={h1,h2,...,h n } and L={l1,l2,...,l m } are two time series of direct solar radiation with lengths of n and m respectively, h i and l j The distance between two points is defined as d(i,j)=|h i -l j p ,| | p represents the p-norm; S2.
2. Create an n×m distance matrix D, where the element (i, j) of the matrix represents the distance d(i, j) between the i-th point of time series H and the j-th point of time series L, and also represents the alignment of the i-th point of time series H with the j-th point of time series L; S2.
3. Find a path through several points in the matrix D. The path represents the matching relationship between each point in the time series H and L. Different paths correspond to different matching relationships. Under the conditions of meeting the boundary, monotonicity and continuity, the dynamic programming method is used to solve the optimal regular path S = {s1, s2, ..., s k }, where s k is a point on the path, max(m,n)≤k≤m+n-1; Cumulative distance It is the sum of the distance d(i,j) of the current element and the cumulative distance of the smallest adjacent element that can reach the element. The final cumulative distance The DTW distance corresponding to time series H and L, that is, the similarity measurement distance between time series H and L; The calculation formula is: in, S2.
4. According to the methods of S2.1 to S2.3, the similarity measurement distances are calculated respectively when cloudy and sunny days are used as typical weather samples as matching benchmarks, and the weather corresponding to the minimum distance of the three similarity measurement distances obtained in the same historical time period is taken as the small time scale weather classification result; All historical data are divided into three categories of small time scale meteorological events H G , H G ={h1′,h2′,...,h g ′},G=1,2,...,M,h′ g is a small-scale meteorological event in a certain division in the historical data, and M is the total number of small-time-scale meteorological events divided.
4. The ultra-short-term photovoltaic power prediction method according to claim 3, characterized in that: S3 uses the DTW algorithm to match the NWP data of the forecast period with several historical meteorological events that are most similar to it. The process includes: First, the meteorological event type of the time period is divided according to the NWP data of the time period to be predicted, and the direct solar radiation data of the corresponding time window is taken as the matching reference time series, which is expressed as L O ={l1,l2,...,l f }, where f is the time window length of the meteorological event type, l f is the direct solar radiation value corresponding to the fth moment; Then all the small time scale meteorological events H that have been divided in S2 G Calculate the DTW similarity metric distance one by one To match the benchmark time series L O With H G The calculated similarity metric distance; Get M small-scale meteorological event time series and matching benchmark time series L O The similarity metric distance is used to select the K hourly meteorological events corresponding to the smallest similarity metric distance value as the best matching learning data.
Citation Information
Cited By
Numerical fitting optimization method for detecting service life of LED device
CN119782848A
A Numerical Fitting Optimization Method for LED Device Lifetime Detection
CN119782848B
Large-scale new energy short-term power prediction method and device in extreme weather
CN120049436A
Transform model-based photovoltaic power generation prediction method
CN120450104A
Multi-modal data fused LSTM photovoltaic power generation power prediction method and system
CN121032279A
