Photovoltaic medium and long term generating capacity prediction method, device, equipment and medium
By constructing a multi-timescale photovoltaic power generation prediction method based on the XGB model and the Prophet model, the problem of inaccurate medium- and long-term photovoltaic power generation prediction is solved, the prediction accuracy and stability are improved, and the accuracy of grid dispatch and power trading is supported.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies for photovoltaic power generation forecasting suffer from inaccurate predictions on medium- to long-term timescales. In particular, errors in weather forecast data and failure to consider the annual cycle and seasonal variations of historical actual power generation data lead to deviations in grid dispatching and power trading.
A historical daily power generation dataset was constructed using peak power residual features and periodic features based on the XGB model. The Prophet model was then used to predict photovoltaic power generation at multiple time scales. The trained XGB model and Prophet model were used to predict photovoltaic power generation at the first and second preset time scales, respectively. Historical meteorological data and power data were used for multi-scale analysis.
This improves the accuracy and stability of photovoltaic power generation forecasting, providing more comprehensive forecasting basis for grid dispatch and reducing deviation risks in power trading.
Smart Images

Figure CN121663478A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of clean energy technology, specifically to a method, apparatus, equipment, and medium for predicting medium- and long-term photovoltaic power generation. Background Technology
[0002] Due to the intensification of global climate change, photovoltaic power generation forecasting faces the challenge of insufficient forecast accuracy across multiple time scales on the power generation side. Grid dispatching needs to reserve a large amount of reserve capacity, while in terms of long-term photovoltaic power generation forecasting, the lack of cross-scale collaborative correction makes it difficult to support the accurate declaration of medium and long-term contracts in power trading, and there is a risk of deviation assessment and penalty. Furthermore, considering the medium and long-term market, the forecast stability of months / years needs to be taken into account.
[0003] However, most photovoltaic power generation prediction models in related technologies rely on numerical meteorological modeling. For short-term photovoltaic power generation predictions, such as those at the next day or half-hour level, meteorological forecast data can be used. However, for medium- and long-term power generation predictions, such as those at the monthly or yearly levels, meteorological forecast data has significant errors at medium- and long-term scales, making it inaccurate to use distorted meteorological forecast data for medium- and long-term photovoltaic power generation predictions. Furthermore, methods relying on numerical meteorological modeling also have the problem of not considering the annual and seasonal cyclical changes in historical actual power generation data at long-term scales, making it difficult to provide comprehensive prediction basis for grid dispatch.
[0004] Therefore, the photovoltaic medium- and long-term power generation prediction methods in related technologies have the problem of inaccurate prediction of power generation on medium- and long-term time scales. Summary of the Invention
[0005] In view of this, the present invention provides a method, apparatus, equipment and medium for predicting medium- and long-term photovoltaic power generation, in order to solve the problem of inaccurate prediction of power generation on medium- and long-term time scales in related technologies.
[0006] In a first aspect, the present invention provides a method for predicting medium- and long-term photovoltaic power generation. The method includes: acquiring historical meteorological data and historical power data of a target photovoltaic power plant; constructing a historical daily power generation dataset based on the numerical and temporal characteristics of the historical power data; and performing photovoltaic power generation prediction at a first preset time scale based on a first residual feature of the historical daily power generation dataset to obtain a first photovoltaic power generation prediction result; wherein the first residual feature is obtained from a pre-trained first XGB model, and the first XGB model is based on the historical meteorological data and the historical daily power generation... The peak power residual features and periodic features constructed from the numerical features of the dataset are used to train the model. The second residual features are used to predict the photovoltaic power generation at a second preset time scale based on the historical daily power generation dataset to obtain the second photovoltaic power generation prediction result. The second preset time scale is longer than the first preset time scale. The second residual features are obtained through a pre-trained second XGB model. The second XGB model is trained through pre-extracted average features. The average features are obtained through a third residual feature determined by the difference between the power generation prediction result and the actual power generation at the second preset time scale.
[0007] As an exemplary embodiment, the method of predicting photovoltaic power generation at a first preset time scale based on the first residual feature of the historical daily power generation dataset to obtain the first photovoltaic power generation prediction result includes: determining the boundary power features within a first preset time period based on the numerical features of the historical daily power generation dataset; constructing a set of daily actual and boundary peak power data based on the boundary power features; determining the maximum daily power generation for the whole year based on the numerical features of the historical daily power generation dataset; determining the daily maximum peak residual feature based on the daily actual and boundary peak power data set; constructing seasonal sine cycle features and seasonal cosine cycle features; constructing a feature set based on the daily maximum peak residual feature, the seasonal sine cycle feature, and the seasonal cosine cycle feature; training a first XGB model based on the feature set; performing a second photovoltaic power generation prediction based on the first XGB model to obtain the first residual feature; restricting the first residual feature based on a preset residual feature interval; and obtaining the first photovoltaic power generation prediction result based on the annual maximum daily power generation and the annual standard boundary power.
[0008] As an exemplary embodiment, the method of predicting photovoltaic power generation at a second preset time scale based on the second residual feature when predicting photovoltaic power generation using the historical daily power generation dataset to obtain the second photovoltaic power generation prediction result includes: obtaining preset trend term coefficients and preset seasonal term coefficients; constructing a Prophet model based on the preset trend term coefficients and preset seasonal term coefficients; inputting the historical daily power generation dataset into the Prophet model to predict photovoltaic power generation and obtain the photovoltaic power generation prediction result; determining the second residual feature based on the photovoltaic power generation prediction result and the historical daily power generation dataset; inputting the second residual feature into a pre-trained second XGB model to obtain a corrected residual feature; and correcting the photovoltaic power generation prediction result based on the corrected residual feature to obtain the second photovoltaic power generation prediction result.
[0009] As an exemplary embodiment, the step of constructing a historical daily power generation dataset based on the numerical and temporal features of the historical power data includes: decomposing the historical power data to obtain a first sub-historical power data with a preset time resolution; filtering the first sub-historical power data based on sunrise and sunset time restrictions according to the temporal features of the first sub-historical power data to obtain a second sub-historical power data; interpolating the second sub-historical power data based on the numerical features of the second sub-historical power data to obtain a third sub-historical power data; and smoothing the third sub-historical power data based on the numerical features of the third sub-historical power data to obtain the historical daily power generation dataset.
[0010] As an exemplary embodiment, the step of filtering the first sub-historical power data based on sunrise and sunset time restrictions according to the time characteristics of the first sub-historical power data to obtain the second sub-historical power data includes: filtering the positive and negative sequences of historical single-day power data contained in the first sub-historical power data according to a preset sliding window length and a preset sliding step size to obtain multiple sliding window sequences; in the sliding window sequences, taking the timestamps of a preset number of target first sub-historical power data that first appear with a value greater than zero as sunrise time points and / or sunset time points; filtering the historical single-day power data based on the sunrise time points and the sunset time points, retaining target single-day power data that simultaneously have the sunrise time points and the sunset time points, and whose actual time interval between the sunrise time points and the sunset time points is greater than a preset time interval, and obtaining the filtered first sub-historical power data as the second sub-historical power data.
[0011] As an exemplary embodiment, the step of interpolating the second sub-historical power data based on the numerical characteristics of the second sub-historical power data to obtain the third sub-historical power data includes: performing PCHIP interpolation on the second sub-historical power data to obtain the third sub-historical power data.
[0012] As an exemplary embodiment, smoothing the third sub-historical power data based on the numerical characteristics of the third sub-historical power data includes: performing Savitzky-Golay smoothing on the third sub-historical power data to obtain the historical daily power generation dataset.
[0013] Secondly, the present invention provides a photovoltaic medium- and long-term power generation prediction device, comprising: an acquisition module for acquiring historical meteorological data and historical power data of a target photovoltaic power station; a dataset construction module for constructing a historical daily power generation dataset based on the numerical and temporal features of the historical power data; and a first power generation prediction module for performing photovoltaic power generation prediction on a first preset time scale based on the first residual feature of the historical daily power generation dataset, thereby obtaining a first photovoltaic power generation prediction result; wherein the first residual feature is obtained by a pre-trained first XGB model, the first XGB model being based on the historical meteorological data and the historical power data. The peak power residual feature and periodic feature constructed from the numerical features of the historical daily power generation dataset are used to train the model; the second power generation prediction module is used to predict the photovoltaic power generation at a second preset time scale based on the second residual feature when predicting the second photovoltaic power generation based on the historical daily power generation dataset, and obtain the second photovoltaic power generation prediction result; wherein, the second preset time scale is longer than the first preset time scale, the second residual feature is obtained by a pre-trained second XGB model, the second XGB model is trained by a pre-extracted average feature, and the average feature is obtained by a third residual feature determined by the difference between the power generation prediction result and the actual power generation at the second preset time scale.
[0014] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the photovoltaic medium- and long-term power generation prediction method of the first aspect or any corresponding embodiment described above.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the photovoltaic medium- and long-term power generation prediction method of the first aspect or any corresponding embodiment thereof.
[0016] This invention provides a method, apparatus, equipment, and medium for predicting medium- and long-term photovoltaic (PV) power generation. The method includes: acquiring historical meteorological data and historical power data of a target PV power plant; constructing a historical daily power and power generation dataset based on the numerical and temporal characteristics of the historical power data; and performing PV power generation prediction at a first preset time scale based on a first residual feature of the historical daily power generation dataset to obtain a first PV power generation prediction result. The first residual feature is obtained from a pre-trained first XGB model, which uses peak power residual features and periodic features constructed based on the numerical characteristics of the historical meteorological data and the historical daily power generation dataset. The training process obtains the second residual feature used in the second photovoltaic power generation prediction based on the historical daily power generation dataset. This residual feature is then used to predict photovoltaic power generation at a second preset time scale, resulting in a second photovoltaic power generation prediction result. The second preset time scale is longer than the first preset time scale. The second residual feature is obtained through a pre-trained second XGB model, which is trained using pre-extracted average features. These average features are obtained through a third residual feature determined by the difference between the predicted power generation at the second preset time scale and the actual power generation. This method predicts photovoltaic power generation at both the first and second preset time scales, providing a comprehensive analysis of the future medium- and long-term potential power generation of photovoltaic power plants across multiple time scales. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the photovoltaic medium- and long-term power generation prediction method according to an embodiment of the present invention.
[0019] Figure 2 This is a structural block diagram of a photovoltaic medium- and long-term power generation prediction device according to an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] According to an embodiment of the present invention, a method for predicting medium- and long-term photovoltaic power generation is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0023] This embodiment provides a method for predicting medium- and long-term photovoltaic power generation. Figure 1 This is a flowchart of a photovoltaic medium- and long-term power generation prediction method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0024] Step S101: Obtain historical meteorological data and historical power data of the target photovoltaic power station.
[0025] For example, historical power data can be obtained by acquiring the historical power generation records of the target photovoltaic power station.
[0026] For example, the time resolution of the historical power data is 1 hour.
[0027] In one embodiment, historical power data is denoted as PGs, and the power generation data of the target photovoltaic power station over the past two years is obtained as the historical power data PGs.
[0028] For example, historical meteorological data can be obtained by collecting historical data through meteorological data acquisition equipment installed at the target photovoltaic power station.
[0029] For example, historical meteorological data may include data such as irradiance, temperature, humidity, wind speed, pressure, and wind direction.
[0030] For example, the time resolution of historical meteorological data is 30 minutes.
[0031] Step S102: Construct a historical daily power generation dataset based on the numerical and temporal characteristics of the historical power data.
[0032] After obtaining the historical power data, further processing is performed on the historical power data to construct a historical daily power generation dataset based on the numerical and temporal characteristics of the historical power data.
[0033] For example, historical power data is decomposed so that the time resolution of the historical daily power generation dataset is the same as that of the historical meteorological data.
[0034] For example, since the time resolution of historical power data and historical meteorological data is inconsistent, after obtaining historical power data and historical meteorological data, the historical power data is decomposed into daily power generation Ps.
[0035] Furthermore, the decomposed daily power generation is sequentially subjected to condition filtering, time constraint filtering, interpolation processing, and smoothing processing to obtain a historical daily power generation dataset.
[0036] Currently, most photovoltaic power generation prediction models rely on numerical meteorological modeling, ignoring the annual and seasonal cyclical changes in historical actual power generation data. Furthermore, the prediction time scale is relatively simple, making it difficult to provide comprehensive prediction basis for grid dispatch.
[0037] To address this issue, this invention uses historical daily power generation datasets to predict photovoltaic power generation over medium to long term at least two preset time scales. For example, the preset time scales include a first preset time scale and a second preset time scale, where the first preset time scale is a month and the second preset time scale is a year.
[0038] Step S103: Based on the historical daily power generation dataset, the first residual feature of the first photovoltaic power generation prediction is used to predict the photovoltaic power generation at a first preset time scale, and the first photovoltaic power generation prediction result is obtained; wherein, the first residual feature is obtained by a pre-trained first XGB model, and the first XGB model is obtained by training the model through peak power residual features and periodic features constructed based on the numerical features of the historical meteorological data and the historical daily power generation dataset.
[0039] In this embodiment, the photovoltaic power generation prediction is performed on the first residual feature of the first photovoltaic power generation prediction based on the historical daily power generation dataset, and the photovoltaic power generation prediction result is obtained.
[0040] For example, after obtaining the historical daily power generation dataset, a first photovoltaic power generation prediction model is constructed based on the historical daily power generation dataset to output the photovoltaic power generation prediction result at a first preset time scale. Furthermore, the photovoltaic power generation prediction at the first preset time scale is performed based on the first residual characteristics when the first photovoltaic power generation prediction model is used to predict the power generation.
[0041] For example, the first residual feature is obtained by a pre-trained first XGB model, which is trained by using peak power residual features and periodic features constructed based on the numerical features of historical daily power generation datasets.
[0042] Specifically, after obtaining the historical daily power generation dataset, a boundary power BPs is constructed. A daily actual and boundary peak power dataset QP is established by combining the actual daily peak power generation. The maximum daily power generation maxP for the entire year is calculated by taking the average of the maximum power generation of Ps on the s-th day from the power data of the past two years. s Then the most recent year's BPs generate the annual standard boundary power stdP for 8784 days. sj For the peak power residual T re Sine and cosine periodic characteristics (T) sin T cos The feature set constructed is cross-validated to train XGB and obtain residual R. t and R t The constraints are applied within the range of (-1, 15); finally, the first photovoltaic power generation prediction result is obtained by combining maxPs and stdPsj.
[0043] For example, the time scale of the first photovoltaic power generation forecast is monthly.
[0044] Step S104: Based on the historical daily power generation dataset, the second residual feature is used to predict photovoltaic power generation at a second preset time scale to obtain the second photovoltaic power generation prediction result; wherein, the second preset time scale is longer than the first preset time scale, the second residual feature is obtained through a pre-trained second XGB model, the second XGB model is trained through pre-extracted average features, and the average features are obtained through a third residual feature determined by the difference between the power generation prediction result and the actual power generation at the second preset time scale.
[0045] For example, after obtaining the historical daily power generation dataset, the photovoltaic power generation is predicted at a second preset time scale based on the second residual characteristics when making the second photovoltaic power generation prediction based on the historical daily power generation dataset.
[0046] In this embodiment, the photovoltaic power generation prediction at a second preset time scale is performed based on the second residual feature of the historical daily power generation dataset to obtain the second photovoltaic power generation prediction result; wherein, the second preset time scale is longer than the first preset time scale, the second residual feature is obtained by a pre-trained second XGB model, the second XGB model is trained by a pre-extracted average feature, and the average feature is obtained by a third residual feature determined by the difference between the power generation prediction result at the second preset time scale and the actual power generation.
[0047] This embodiment provides a method for predicting medium- and long-term photovoltaic (PV) power generation. The method includes: acquiring historical meteorological data and historical power data of a target PV power plant; constructing a historical daily power and power generation dataset based on the numerical and temporal features of the historical power data; and performing PV power generation prediction at a first preset time scale based on the first residual feature of the historical daily power generation dataset to obtain a first PV power generation prediction result. The first residual feature is obtained from a pre-trained first XGB model, which is trained using peak power residual features and periodic features constructed based on the numerical features of the historical meteorological data and the historical daily power generation dataset. Based on the historical daily power generation dataset, the second residual feature is used to predict photovoltaic power generation at a second preset time scale, resulting in a second photovoltaic power generation prediction result. The second preset time scale is longer than the first preset time scale. The second residual feature is obtained through a pre-trained second XGB model, which is trained using pre-extracted average features. The average features are obtained through a third residual feature determined by the difference between the predicted power generation at the second preset time scale and the actual power generation. This method predicts photovoltaic power generation at both the first and second preset time scales, providing a comprehensive analysis of the future medium- and long-term power generation of photovoltaic power plants across multiple time scales.
[0048] As an exemplary embodiment, the method of predicting photovoltaic power generation at a first preset time scale based on the first residual feature of the historical daily power generation dataset to obtain the first photovoltaic power generation prediction result includes: determining the boundary power features within a first preset time period based on the numerical features of the historical daily power generation dataset; constructing a set of daily actual and boundary peak power data based on the boundary power features; determining the maximum daily power generation for the whole year based on the numerical features of the historical daily power generation dataset; determining the daily maximum peak residual feature based on the daily actual and boundary peak power data set; constructing seasonal sine cycle features and seasonal cosine cycle features; constructing a feature set based on the daily maximum peak residual feature, the seasonal sine cycle feature, and the seasonal cosine cycle feature; training a first XGB model based on the feature set; performing a second photovoltaic power generation prediction based on the first XGB model to obtain the first residual feature; restricting the first residual feature based on a preset residual feature interval; and obtaining the first photovoltaic power generation prediction result based on the annual maximum daily power generation and the annual standard boundary power.
[0049] In this embodiment, the boundary power characteristics within a first preset time period are determined based on the numerical characteristics of the historical daily power generation dataset; specifically: in the historical daily power generation dataset, the power P that is 7 days before and after day s is taken. n Where s is a positive integer; based on a 24-hour period, for P n Take the data sequences corresponding to 1~24h respectively Then, for X respectively J Sort by reverse order and select X J P corresponding to the 10th percentile of length n The boundary power BP at the current time sj If BP sj If the length is less than 48, the corresponding position will be replaced with 0.
[0050] Furthermore, retrieve all BP values from the current s days. s BP of the power sequence corresponding to 1~24h respectively s Find the mean BP s_avg If the historical daily power generation dataset lacks the power corresponding to any day in s, then BP s Use BP s_avg Replacement.
[0051] The final boundary power BPs is obtained for a 30-minute time frequency that takes into account leap years (366 days in a leap year or 365 days in a non-leap year).
[0052] Furthermore, a daily actual and boundary peak power data set QP is constructed based on the boundary power characteristics.
[0053] Furthermore, the maximum daily power generation for the entire year is determined based on the numerical characteristics of the historical daily power generation dataset; specifically, the average of the maximum power generation values (Ps) for the s-th day of each of the past two years' power data in the maximum daily power generation dataset is used to construct the maximum daily power generation for the entire year. Next, take the boundary power BPs of the most recent year. If the number of days in the most recent year is less than 366, use the data of the last day of BPs to make up the difference. Finally, generate the annual standard boundary power stdP of 8784 days. sj .
[0054] Furthermore, the residual characteristics of the daily maximum power peak are determined based on the set of actual and boundary peak power data for the day; specifically, the residual characteristics of the daily maximum power peak are obtained using equation (11):
[0055] T re =QP (Daily Actual Peak Power) - QP (Daily Boundary Peak Power) (1)
[0056] Furthermore, seasonal sinusoidal periodic features and seasonal cosine periodic features are constructed; specifically, the seasonal sinusoidal periodic features are constructed using equation (2):
[0057] (2)
[0058] In equation (12), T sin It represents the seasonal sinusoidal periodicity characteristic, and dayofyear represents the dayofyear function value corresponding to each day.
[0059] The seasonal cosine periodicity feature is constructed using equation (3):
[0060] (3)
[0061] In equation (3), T cos It represents the seasonal cosine cycle characteristic, and dayofyear represents the dayofyear function value corresponding to each day.
[0062] Furthermore, a feature set is constructed based on the daily power maximum peak residual feature, the seasonal sine periodic feature, and the seasonal cosine periodic feature. .
[0063] A first XGB model is trained based on the feature set, and a second photovoltaic power generation prediction is performed based on the first XGB model.
[0064] For example, when training the first XGB model based on the feature set, the feature set is divided into 3 parts for cross-validation training of the XGB model, wherein grid search is used to optimize the model learning rate parameter to obtain the trained first XGB model.
[0065] For example, when predicting the second photovoltaic power generation based on the first XGB model, the residual of the maximum daily power generation predicted by the first XGB model after training is first used to predict the next 30 days. .
[0066] In one embodiment, after obtaining R t Then, equation (4) is used to apply R. t Apply maximum and minimum value restrictions:
[0067] (4)
[0068] Furthermore, equation (5) is adopted to use the residual R of the maximum daily power generation. t The maximum daily power generation (maxPs) and the annual standard boundary power (stdP) for the whole year. sj The first photovoltaic power generation prediction result was obtained:
[0069] (5)
[0070] In equation (5), Represents the residual of the maximum daily power generation. stdPsj represents the maximum daily power generation for the entire year, and stdPsj represents the standard boundary power for the entire year.
[0071] In this embodiment, the daily power generation Ps obtained from the daily and weekly power generation prediction process is used to construct the boundary power BPs. Combined with the actual daily peak power generation, a daily actual and boundary peak power data set QP is established. The maximum daily power generation of Ps for the entire year is calculated by taking the average of the maximum power generation of Ps on the s-th day from the power data of the past two years. Then, the annual standard boundary power stdPsj for 8784 days is generated from the BPs of the most recent year. The residual Rt is obtained by cross-validating the feature set constructed by the residual Tre of peak power and the sine and cosine periodic features (Tsin, Tcos). Rt is constrained in the range of (-1, 15). Finally, the monthly power generation PGd is calculated by combining maxPs and stdPsj.
[0072] As an exemplary embodiment, the method of predicting photovoltaic power generation at a second preset time scale based on the second residual feature when predicting photovoltaic power generation using the historical daily power generation dataset to obtain the second photovoltaic power generation prediction result includes: obtaining preset trend term coefficients and preset seasonal term coefficients; constructing a Prophet model based on the preset trend term coefficients and preset seasonal term coefficients; inputting the historical daily power generation dataset into the Prophet model to predict photovoltaic power generation and obtain the photovoltaic power generation prediction result; determining the second residual feature based on the photovoltaic power generation prediction result and the historical daily power generation dataset; inputting the second residual feature into a pre-trained second XGB model to obtain a corrected residual feature; and correcting the photovoltaic power generation prediction result based on the corrected residual feature to obtain the second photovoltaic power generation prediction result.
[0073] In this embodiment, the Prophet algorithm is used to predict photovoltaic power generation at the second preset time scale. Prophet can automatically detect trends and seasonality in the data and combine them to obtain the predicted value.
[0074] For example, after obtaining the historical daily power generation dataset, the daily power generation PG is obtained by accumulating and superimposing the historical daily power generation dataset using equation (6). s :
[0075] (6)
[0076] Furthermore, the daily power generation (PGs) is changed to a data format that the Prophet algorithm can recognize, with the time column as ds and the data column as y.
[0077] Furthermore, the preset trend coefficient and preset seasonal coefficient are obtained; specifically, for the annual daily power prediction in photovoltaics, there is only an annual cycle trend, so only the annual cycle control parameter is set, and the seasonal component with a cycle of one year is expanded as follows using equation (7):
[0078] (7)
[0079] In equation (7), T is the period, which is 365; N is the Fourier order, which is 4. The Fourier fit coefficients follow a zero-mean Gaussian distribution, with variances derived from... Decide.
[0080] Specifically, the variance conforms to the constraints shown in equation (8):
[0081] (8)
[0082] consider The larger the value, the stronger the allowed seasonal fluctuations. In this invention, .
[0083] For the preset trend term coefficient, Equation (9) is used to fit the piecewise linear trend model:
[0084] (9)
[0085] In equation (9), δ represents the initial growth rate. i For the first A variable point t i The growth rate increment at that location γ is the initial offset. i =-δ i ·t i .
[0086] The compensation term to ensure the continuity of the function, the growth rate The accumulation and change of the adjustment amount with the variable point are calculated using equation (10):
[0087] (10)
[0088] For example, in equations (9) and (10), δ i The absolute value of the size is determined by Control: The trend of increasing τ value is abrupt; the smaller the τ value, the smoother the trend. τ=0.005.
[0089] Furthermore, the historical daily power generation dataset is input into the Prophet model to predict photovoltaic power generation, and the photovoltaic power generation prediction result is obtained.
[0090] For example, the photovoltaic power generation prediction result of the Prophet model is denoted as PG. yS .
[0091] Furthermore, the second residual feature is determined based on the photovoltaic power generation prediction results and the historical daily power generation dataset.
[0092] Specifically, PG yS The second residual characteristic R is obtained by taking the residual from the daily power of PGs. d .
[0093] The second residual feature is input into the pre-trained second XGB model to obtain the corrected residual feature;
[0094] Specifically, after obtaining R d Afterwards, regarding R dExtract the moving average features from the trained XGB model. Further train the XGB model using the moving average features to obtain the second XGB model.
[0095] Furthermore, by using the average predicted power generation residuals of the previous 7 days, the average predicted power generation residuals of the previous 30 days, and the actual power generation residuals, the corrected residual characteristic R is obtained. pred .
[0096] The photovoltaic power generation prediction result is corrected based on the corrected residual characteristics to obtain the second photovoltaic power generation prediction result.
[0097] Specifically, the daily power generation PG for the next year is finally obtained using equation (11). y :
[0098] PG y= PG yS+ R pred (11)
[0099] In this embodiment, the prophet model sets the trend term coefficient. and seasonal coefficient Complete the model initialization, then calculate the daily power generation.
[0100] Change the data to the format required by the Prophet algorithm, and change the prediction results of the trained Prophet model to PG. yS With PG S Daily power as residual to generate R d For extracting R d The XGB model was trained using the average features from the 7 days and 30 days prior to the move. Finally, the corrected residuals R0 predicted by XGB were used. pred PG predicted by the Prophet model yS The sum of these yields the annual electricity generation PG. y .
[0101] As an exemplary embodiment, the step of constructing a historical daily power generation dataset based on the numerical and temporal features of the historical power data includes: decomposing the historical power data to obtain a first sub-historical power data with a preset time resolution; filtering the first sub-historical power data based on sunrise and sunset time restrictions according to the temporal features of the first sub-historical power data to obtain a second sub-historical power data; interpolating the second sub-historical power data based on the numerical features of the second sub-historical power data to obtain a third sub-historical power data; and smoothing the third sub-historical power data based on the numerical features of the third sub-historical power data to obtain the historical daily power generation dataset.
[0102] In order to make the time resolution of the historical daily power generation dataset the same as that of the historical meteorological data, in this embodiment, the historical power data is decomposed to obtain the first sub-historical power data Ps with a preset time resolution.
[0103] Furthermore, based on the time characteristics of the first sub-historical power data, the first sub-historical power data is filtered by sunrise and sunset time restrictions to obtain the second sub-historical power data.
[0104] As an exemplary embodiment, the step of filtering the first sub-historical power data based on sunrise and sunset time restrictions according to the time characteristics of the first sub-historical power data to obtain the second sub-historical power data includes: filtering the positive and negative sequences of historical single-day power data contained in the first sub-historical power data according to a preset sliding window length and a preset sliding step size to obtain multiple sliding window sequences; in the sliding window sequences, taking the timestamps of a preset number of target first sub-historical power data that first appear with a value greater than zero as sunrise time points and / or sunset time points; filtering the historical single-day power data based on the sunrise time points and the sunset time points, retaining target single-day power data that simultaneously have the sunrise time points and the sunset time points, and whose actual time interval between the sunrise time points and the sunset time points is greater than a preset time interval, and obtaining the filtered first sub-historical power data as the second sub-historical power data.
[0105] In this embodiment, for Daily power For both positive and negative sequences, a sliding window sequence with a preset sliding window length and a preset sliding step size is established. The first time all values in the sliding window sequence are greater than 0 corresponds to the time points of sunrise and sunset, respectively. If sunrise and sunset do not exist simultaneously, p is removed. If sunset - sunset is less than 8 hours, pi is removed.
[0106] Furthermore, based on the numerical characteristics of the second sub-historical power data, the second sub-historical power data is interpolated to obtain the third sub-historical power data.
[0107] In this embodiment, PCHIP interpolation can be performed on the second sub-historical power data to obtain the third sub-historical power data.
[0108] Specifically, for each interval [p, p i+1 The slope is calculated using equation (12):
[0109] (12)
[0110] Furthermore, the nodal derivative value d is determined using equation (13).i Where internal nodes i = 1, 2, ..., n-1, and endpoint nodes: d0 = δ0, d n =δ n-1
[0111] (13)
[0112] Furthermore, a cubic polynomial is constructed, and the interpolation polynomial H in the interval [p, pi+1] is... i (p i Satisfying equations (14) to (17):
[0113] H i (p i )=y i (14)
[0114] H i (p i+1 )=y i+1 (15)
[0115] (16)
[0116] (17)
[0117] Among them, the normalization parameter The polynomial expression is then given by equation (18):
[0118] (18)
[0119] Furthermore, the 30-minute resolution interpolation is calculated using equation (19) at t=0 (i.e., x=x). i The interpolation value at (+0.5 hours) is:
[0120] (19)
[0121] Finally, the historical power data of the third sub-sub was obtained. .
[0122] Furthermore, Savitzky-Golay smoothing is applied to the third sub-historical power data to obtain the historical daily power generation dataset.
[0123] Specifically, for each interpolation point p in the third sub-historical power data j The smoothed value is calculated using equation (20):
[0124] (20)
[0125] Where m is the window size, which is 7, the polynomial order is 3, and the coefficients c kIt is determined by the least squares solution fitted by polynomials.
[0126] Furthermore, mirror padding is used to process the power sequence boundaries, with the left end padded as follows:
[0127] Fill the right end: Finally, the smoothed power sequence is output. This yields a dataset of historical daily power generation.
[0128] In this embodiment, historical meteorological data of the photovoltaic power station (including irradiance, temperature, humidity, pressure, wind speed, and wind direction) is first preprocessed and abnormal time periods are removed. The historical power data is decomposed into power generation and its resolution is improved to 30 minutes. The sunrise and sunset times are determined by a sliding window. Then, PCHIP is used to perform polynomial interpolation on the power generation to ensure local monotonicity and shape. The Savitzky-Golay smoothing coefficient is determined by polynomial least squares to achieve smoothing of the interpolated power. By using polynomial interpolation and Savitzky-Golay smoothing on the historical power data to refine the hourly resolution to 30 minutes, the accuracy of daily and weekly power generation prediction is improved, while maintaining the local monotonicity and shape of the original power generation curve. Especially in weather with rapid changes in cloud thickness, the detailed trend of the power generation curve can be perfectly fitted.
[0129] For example, after obtaining the first sub-historical power data Ps, daily power generation data with fewer than 24 data entries or with a maximum daily power generation exceeding the installed capacity Cap are removed.
[0130] This embodiment provides a photovoltaic medium- and long-term power generation prediction device, such as... Figure 2 As shown, it includes:
[0131] The acquisition module 501 is used to acquire historical meteorological data and historical power data of the target photovoltaic power station;
[0132] Data set construction module 502 is used to construct a historical daily power generation dataset based on the numerical and temporal characteristics of the historical power data.
[0133] The first power generation prediction module 503 is used to predict photovoltaic power generation at a first preset time scale based on the first residual feature of the first photovoltaic power generation prediction based on the historical single-day power generation dataset, and obtain the first photovoltaic power generation prediction result; wherein, the first residual feature is obtained by a pre-trained first XGB model, and the first XGB model is obtained by model training based on the peak power residual feature and periodic feature constructed based on the numerical features of the historical meteorological data and the historical single-day power generation dataset;
[0134] The second power generation prediction module 504 is used to predict photovoltaic power generation at a second preset time scale based on the second residual feature when predicting the second photovoltaic power generation using the historical daily power generation dataset, and to obtain the second photovoltaic power generation prediction result; wherein, the second preset time scale is longer than the first preset time scale, the second residual feature is obtained by a pre-trained second XGB model, the second XGB model is trained by a pre-extracted average feature, and the average feature is obtained by a third residual feature determined by the difference between the power generation prediction result and the actual power generation at the second preset time scale.
[0135] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments.
[0136] It should be noted that the above modules, as part of the device, can be implemented in software or hardware, with the hardware environment including the network environment.
[0137] This invention also provides a computer device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to execute the methods described in any of the above embodiments by running the computer programs stored in the memory.
[0138] Figure 3 This is a structural block diagram of an optional computer device according to an embodiment of this application, such as... Figure 3 As shown, the system includes a processor 10, a communication interface 20, a memory 30, and a communication bus 40. The processor 10, communication interface 20, and memory 30 communicate with each other via the communication bus 40.
[0139] Memory 30 is used to store computer programs;
[0140] When the processor 10 executes the computer program stored in the memory 30, it implements the photovoltaic medium- and long-term power generation prediction method as described in any of the above embodiments.
[0141] Optionally, in this embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0142] The communication interface is used for communication between the aforementioned computer equipment and other devices.
[0143] The memory may include RAM, or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0144] The processor mentioned above can be a general-purpose processor, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0145] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.
[0146] Those skilled in the art will understand that Figure 3 The structure shown is for illustrative purposes only. The device that implements any of the methods in the above embodiments can be a terminal device, such as a smartphone (e.g., an Android phone, an iOS phone), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 3 This does not limit the structure of the aforementioned electronic device. For example, the terminal device may also include components that are more... Figure 3 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 3 The different configurations shown.
[0147] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.
[0148] As an exemplary embodiment, this application also provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the method steps of any one of the embodiments in this application at runtime.
[0149] Optionally, in this embodiment, the storage medium described above can be used to execute program code for the method steps of the embodiments of this application.
[0150] Optionally, in this embodiment, the storage medium may be located on at least one of the network devices in the network shown in the above embodiment.
[0151] Optionally, in this embodiment, the storage medium is configured to store methods for performing the above embodiments.
[0152] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated in this embodiment.
[0153] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, ROMs, RAMs, portable hard drives, magnetic disks, or optical disks.
[0154] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0155] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods in the above embodiments.
[0156] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0157] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the solution provided in this embodiment, depending on actual needs.
[0158] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0159] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0160] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for predicting medium- and long-term photovoltaic power generation, characterized in that, The method for predicting medium- and long-term photovoltaic power generation includes: Acquire historical meteorological and power data of the target photovoltaic power station; A historical daily power generation and power output dataset is constructed based on the numerical and temporal characteristics of the historical power data. Based on the historical daily power generation dataset, the first residual feature is used to predict the photovoltaic power generation at a first preset time scale, and the first photovoltaic power generation prediction result is obtained; wherein, the first residual feature is obtained by a pre-trained first XGB model, and the first XGB model is obtained by training the model through peak power residual features and periodic features constructed based on the numerical features of the historical meteorological data and the historical daily power generation dataset. Based on the historical daily power generation dataset, the second residual feature is used to predict photovoltaic power generation at a second preset time scale, resulting in a second photovoltaic power generation prediction result. The second preset time scale is longer than the first preset time scale. The second residual feature is obtained through a pre-trained second XGB model, which is trained using pre-extracted average features. The average features are obtained through a third residual feature determined by the difference between the predicted power generation at the second preset time scale and the actual power generation.
2. The photovoltaic medium- and long-term power generation prediction method as described in claim 1, characterized in that, The first residual feature of the photovoltaic power generation prediction based on the historical daily power generation dataset is used to predict photovoltaic power generation at a first preset time scale, resulting in the first photovoltaic power generation prediction result, including: The boundary power characteristics within the first preset time period are determined based on the numerical characteristics of the historical daily power generation dataset. Based on the aforementioned boundary power characteristics, a set of daily actual and boundary peak power data is constructed. The maximum daily power generation for the entire year is determined based on the numerical characteristics of the historical daily power generation dataset. The characteristics of the daily maximum peak power residual are determined based on the set of daily actual and boundary peak power data. Construct seasonal sine cycle characteristics and seasonal cosine cycle characteristics; A feature set is constructed based on the daily power maximum peak residual feature, the seasonal sine cycle feature, and the seasonal cosine cycle feature; The first XGB model is trained based on the feature set, and the second photovoltaic power generation is predicted based on the first XGB model to obtain the first residual feature. The first residual feature is restricted based on a preset residual feature interval, and the first photovoltaic power generation prediction result is obtained based on the maximum daily power generation and the annual standard boundary power.
3. The photovoltaic medium- and long-term power generation prediction method as described in claim 1, characterized in that, The second residual feature used in the second photovoltaic power generation prediction based on the historical daily power generation dataset is used to predict photovoltaic power generation at a second preset time scale, resulting in a second photovoltaic power generation prediction result, including: Obtain the preset trend coefficient and preset seasonal coefficient; Construct a Prophet model based on the preset trend coefficient and the preset seasonal coefficient; The historical daily power generation dataset is input into the Prophet model to predict photovoltaic power generation, and the photovoltaic power generation prediction result is obtained. The second residual feature is determined based on the photovoltaic power generation prediction results and the historical daily power generation dataset. The second residual feature is input into the pre-trained second XGB model to obtain the corrected residual feature; The photovoltaic power generation prediction result is corrected based on the corrected residual characteristics to obtain the second photovoltaic power generation prediction result.
4. The photovoltaic medium- and long-term power generation prediction method as described in claim 1, characterized in that, The construction of a historical daily power generation dataset based on the numerical and temporal features of the historical power data includes: The historical power data is decomposed to obtain the first sub-historical power data with a preset time resolution; Based on the time characteristics of the first sub-historical power data, the first sub-historical power data is filtered by sunrise and sunset time restrictions to obtain the second sub-historical power data. The third sub-historical power data is obtained by interpolating the second sub-historical power data based on the numerical characteristics of the second sub-historical power data. The historical daily power generation dataset is obtained by smoothing the third sub-historical power data based on the numerical characteristics of the third sub-historical power data.
5. The photovoltaic medium- and long-term power generation prediction method as described in claim 4, characterized in that, The step of filtering the first sub-historical power data based on sunrise and sunset time restrictions according to the time characteristics of the first sub-historical power data to obtain the second sub-historical power data includes: The positive and negative sequences of historical single-day power data contained in the first sub-historical power data are filtered according to the preset sliding window length and preset sliding step size to obtain multiple sliding window sequences; In the sliding window sequence, the timestamp of the first target first sub-historical power data that first appears with a value greater than zero is taken as the sunrise time and / or sunset time. Based on the sunrise and sunset times, the historical daily power data is filtered, and target daily power data that exists at both sunrise and sunset times and whose actual time interval between sunrise and sunset times is greater than a preset time interval is retained. The filtered first sub-historical power data is then used as the second sub-historical power data.
6. The photovoltaic medium- and long-term power generation prediction method as described in claim 4, characterized in that, The step of interpolating the second sub-historical power data based on the numerical characteristics of the second sub-historical power data to obtain the third sub-historical power data includes: The second sub-historical power data is subjected to PCHIP interpolation to obtain the third sub-historical power data.
7. The photovoltaic medium- and long-term power generation prediction method as described in claim 4, characterized in that, The smoothing of the third sub-historical power data based on the numerical characteristics of the third sub-historical power data includes: Savitzky-Golay smoothing is applied to the third sub-historical power data to obtain the historical daily power generation dataset.
8. A photovoltaic medium- and long-term power generation prediction device, characterized in that, The photovoltaic medium- and long-term power generation prediction device includes: The acquisition module is used to acquire historical meteorological data and historical power data of the target photovoltaic power station; The dataset construction module is used to construct a historical daily power generation dataset based on the numerical and temporal characteristics of the historical power data. The first power generation prediction module is used to predict photovoltaic power generation on a first preset time scale based on the first residual feature of the first photovoltaic power generation prediction based on the historical daily power generation dataset, and to obtain the first photovoltaic power generation prediction result; wherein, the first residual feature is obtained by a pre-trained first XGB model, and the first XGB model is obtained by model training based on the peak power residual feature and periodic feature constructed based on the numerical features of the historical meteorological data and the historical daily power generation dataset. The second power generation prediction module is used to predict photovoltaic power generation at a second preset time scale based on the second residual feature when predicting the second photovoltaic power generation using the historical daily power generation dataset, and to obtain the second photovoltaic power generation prediction result; wherein, the second preset time scale is longer than the first preset time scale, the second residual feature is obtained by a pre-trained second XGB model, the second XGB model is trained by a pre-extracted average feature, and the average feature is obtained by a third residual feature determined by the difference between the power generation prediction result and the actual power generation at the second preset time scale.
9. A computer device, characterized in that, include: A memory and a processor are interconnected, the memory stores computer instructions, and the processor executes the photovoltaic medium- and long-term power generation prediction method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the photovoltaic medium- and long-term power generation prediction method according to any one of claims 1 to 7.