Disclosure of Invention
In view of the above, the application provides a photovoltaic power station power ultra-short-term prediction method, device and related equipment, so as to realize ultra-short-term prediction of the photovoltaic power station generated power.
In order to achieve the above object, a first aspect of the present application provides a photovoltaic power station power ultra-short term prediction method, including:
acquiring a weather forecast time sequence of a photovoltaic power station in a first time period, a cloud picture time sequence in a second time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period and a third time period;
inputting the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence into a trained power prediction model to obtain a power prediction time sequence in a first time period;
the cloud picture time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period in advance;
The power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels;
the second time period is before the first time period, the second time period is different from the first time period by a preset first time interval, the third time period is before the second time period, the third time period is different from the first time period by a preset second time interval, and the lengths of the first time period, the second time period and the third time period are consistent;
the fifth time period is before the fourth time period, the fifth time period and the fourth time period differ by the first time interval, the sixth time period is before the fourth time period and the fifth time period, the sixth time period and the fourth time period differ by the second time interval, and the lengths of the fourth time period, the fifth time period and the sixth time period are consistent.
Preferably, the power prediction model comprises an image pre-processing unit, a first circulating neural network layer, a first fully-connected layer, a second circulating neural network layer, a second fully-connected layer, a third circulating neural network layer and a fourth fully-connected layer;
the cloud picture time sequence is input to the image pre-processing unit, and the image pre-processing unit performs feature extraction and flattening processing on the cloud picture time sequence to obtain a processed cloud picture time sequence;
the processed cloud image time sequence is input to the first cyclic neural network layer, and the first cyclic neural network layer performs feature extraction on the processed cloud image time sequence to obtain a first feature representation;
the first full-connection layer performs linear superposition on the first characteristic representation to obtain a first output result;
the weather forecast time sequence and the irradiation intensity actual measurement time sequence are input to the second circulating neural network layer, and the second circulating neural network layer performs feature extraction on the weather forecast time sequence and the irradiation intensity actual measurement time sequence to obtain a second feature representation;
the second full-connection layer performs linear superposition on the second characteristic representation to obtain a second output result;
The first output result and the second output result are input to the third full-connection layer after being combined, the third full-connection layer maps the first output result and the second output result into a first sample label space to obtain a third output result, and the third output result comprises irradiation intensity prediction data;
the third output result and the power actual measurement time sequence are merged and then input to the third circulating neural network layer, and the third circulating neural network layer performs feature extraction on the third output result and the power actual measurement time sequence to obtain a third feature representation;
and the fourth full connection layer maps the third characteristic representation into a second sample tag space to obtain a power prediction time sequence.
Preferably, the weather forecast time sequence includes a temperature forecast time sequence, a humidity forecast time sequence, a wind speed forecast time sequence, a wind direction forecast time sequence, and an irradiation intensity forecast time sequence;
the number of the neurons of the third full-connection layer is more than or equal to 2, and 1 neuron in the third full-connection layer corresponds to an irradiation intensity predicted value; the number of the neurons of the fourth full-connection layer is 1, and the neurons of the fourth full-connection layer correspond to a power predicted value.
Preferably, the training process of the power prediction model includes:
acquiring a historical weather forecast data set, a historical cloud layer picture set, a historical wind speed actual measurement data set, a historical wind direction actual measurement data set, a historical irradiation intensity actual measurement data set and a historical power actual measurement data set of the photovoltaic power station, wherein the historical weather forecast data set comprises weather forecast data of a plurality of historical time points, the historical cloud layer picture set comprises cloud layer pictures of the plurality of historical time points, the historical irradiation intensity actual measurement data set comprises irradiation intensity actual measurement data of the plurality of historical time points, and the historical power actual measurement data set comprises power actual measurement data of the plurality of historical time points;
respectively carrying out data processing on the historical weather forecast data set, the historical cloud layer picture set, the historical wind speed actual measurement data set, the historical wind direction actual measurement data set, the historical irradiation intensity actual measurement data set and the historical power actual measurement data set to obtain a historical weather forecast time sequence, a target historical cloud layer picture set, a historical wind speed actual measurement time sequence, a historical wind direction actual measurement time sequence, a historical irradiation intensity actual measurement time sequence and a historical power actual measurement time sequence, wherein the data processing is used for realizing data standardization and data completion;
Generating a historical cloud picture time sequence by using the historical wind speed actual measurement time sequence, the historical wind direction actual measurement time sequence and the target historical cloud picture set;
constructing a training set based on the historical weather forecast time sequence, the historical cloud image time sequence, the historical irradiation intensity actual measurement time sequence and the historical power actual measurement time sequence;
and training the power prediction model based on the training set and a preset loss function.
Preferably, the loss function is:
where n is the number of samples in the training set,
for a preset weight coefficient, +.>
and />
Respectively, the power measured value and the irradiation intensity measured value of the ith sample, < + >>
and />
The power predicted value and the irradiation intensity predicted value of the ith sample are respectively obtained.
Preferably, the first time period is from a preset time to 4 hours after the preset time, the preset time is within 20 minutes from the current time, the preset first time interval is 4 hours, and the preset second time interval is 24 hours;
the process for obtaining the weather forecast time sequence of the photovoltaic power station in the first time period, the cloud image time sequence in the second time period, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence in the second time period and the third time period comprises the following steps:
Acquiring weather forecast data of a photovoltaic power station in a first time period, wherein the weather forecast data comprises temperature forecast data, humidity forecast data, wind speed forecast data, wind direction forecast data and irradiation intensity forecast data;
performing interpolation operation on the weather forecast data to obtain a temperature forecast time sequence, a humidity forecast time sequence, a wind speed forecast time sequence, a wind direction forecast time sequence and an irradiation intensity forecast time sequence;
acquiring wind speed measured data, wind direction measured data, irradiation intensity measured data, power measured data and cloud layer pictures of the photovoltaic power station in a second time period;
respectively carrying out interpolation operation on the wind speed measured data, the wind direction measured data, the irradiation intensity measured data and the power measured data to obtain a wind speed measured time sequence, a wind direction measured time sequence, an irradiation measured time sequence and a power measured time sequence in a second time period;
generating a cloud picture time sequence in the second time period by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period;
obtaining the irradiation intensity measured data and the power measured data of the photovoltaic power station in a third time period, and respectively carrying out interpolation operation on the irradiation intensity measured data and the power measured data to obtain an irradiation intensity measured time sequence and a power measured time sequence in the third time period;
Each time series within the same time period has the same time point and sequence length.
Preferably, the process of generating the cloud image time sequence in the second time period by using the wind speed actually measured time sequence, the wind direction actually measured time sequence and the cloud image picture in the second time period includes:
converting each cloud picture in the second time period into a size of
Wherein w is the width of the cloud picture, h is the height of the cloud picture, and c is the number of channels of the cloud picture;
expanding each sequence element in the measured wind speed time sequence in the second time period into a size of
The value of each matrix element in the wind speed matrix is equal to the actually measured wind speed value of the sequence element;
expanding each sequence element in the measured wind direction time sequence in the second time period to a size of
The values of each matrix element in the wind direction matrix are equal to the measured wind direction values of the sequence elements;
and combining the wind speed matrix, the wind direction matrix and the cloud picture matrix corresponding to the same time point to obtain a cloud picture matrix embedded with the wind direction and the wind speed, and forming a cloud picture time sequence by the cloud picture matrix embedded with the wind direction and the wind speed in the second time period.
The second aspect of the present application provides a photovoltaic power plant power ultrashort-term prediction apparatus, comprising:
the data acquisition unit is used for acquiring weather forecast time sequences of the photovoltaic power station in a first time period, cloud picture time sequences in a second time period, irradiation intensity actual measurement time sequences and power actual measurement time sequences in the second time period and a third time period;
the power prediction unit is used for inputting the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence into a trained power prediction model to obtain a power prediction time sequence in a first time period;
the cloud picture time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period in advance;
the power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels;
The second time period is before the first time period, the second time period is different from the first time period by a preset first time interval, the third time period is before the second time period, the third time period is different from the first time period by a preset second time interval, and the lengths of the first time period, the second time period and the third time period are consistent;
the fifth time period is before the fourth time period, the fifth time period and the fourth time period differ by the first time interval, the sixth time period is before the fourth time period and the fifth time period, the sixth time period and the fourth time period differ by the second time interval, and the lengths of the fourth time period, the fifth time period and the sixth time period are consistent.
A third aspect of the present application provides a photovoltaic power plant power ultrashort-term prediction apparatus, comprising: a memory and a processor;
the memory is used for storing programs;
and the processor is used for executing the program to realize each step of the photovoltaic power station power ultra-short-term prediction method.
A fourth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a photovoltaic power plant power ultra-short term prediction method as described above.
According to the technical scheme, firstly, the weather forecast time sequence of the photovoltaic power station in the first time period, the cloud image time sequence in the second time period, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence in the second time period and the third time period are obtained. The cloud picture time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period in advance, and the time correlation information of the cloud picture can be better captured by embedding the wind speed and the wind direction in the meteorological data in the cloud picture. Before the first time period, the second time period is a cloud picture time sequence, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period are all historical actual measurement data; and the second time period differs from the first time period by a preset first time interval. The third time period is before the second time period, namely the irradiation intensity actually measured time sequence and the power actually measured time sequence in the third time period are both historical actually measured data; and the third time period is different from the first time period by a preset second time interval, and the preset second time interval has a sunlight periodicity attribute, so that the meteorological data of the third time period has a certain reference meaning for the first time period. Further, the lengths of the first period, the second period, and the third period are uniform. It is understood that each point in time in each time period corresponds to a point in time of each element in the time series within the time period. And then, inputting the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence into a trained power prediction model to obtain a power prediction time sequence in a first time period. It should be noted that, the power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels. Wherein the fifth time period precedes the fourth time period, and the fifth time period differs from the fourth time period by the first time interval, the sixth time period precedes the fourth time period and the fifth time period, and the sixth time period differs from the fourth time period by the second time interval, and the fourth time period, the fifth time period, and the sixth time period are identical in length. According to the power prediction model, the correlation between the cloud layer picture and the wind speed and the wind direction, the correlation between the weather data and the weather actual measurement data, the correlation between the weather forecast data and the weather actual measurement data and the correlation between the weather data and the photovoltaic power station power are utilized, so that the power prediction model can predict the power value based on the weather forecast data, the historical cloud layer picture, the historical irradiation intensity actual measurement data and the historical power actual measurement data, and the power prediction model has important application value.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The machine learning model applied to photovoltaic power generation power prediction mainly comprises a cyclic neural network model, a convolutional neural network model and a transducer series model. Based on given data, such as numerical weather forecast, photovoltaic power station power, meteorological monitoring data, full sky imager data, etc., such machine learning methods train a model to learn the mapping of given data to photovoltaic power generation power, and this trained model is then used to predict the power generation power of the power station for future time periods.
The observed quantity for predicting the photovoltaic power generation power includes the following components: 1) Data of numerical weather forecast: forecasting temperature, forecasting humidity, forecasting wind speed, forecasting wind direction and forecasting irradiation intensity; 2) Site weather monitoring data: measured temperature, measured humidity, measured wind speed, measured wind direction, and measured irradiation intensity; 3) Actual power generated; 4) Sky cloud layer distribution pictures shot by all-sky imaging instrument and sun shielding condition. The numerical weather forecast data is updated every 4 hours, and the spatial resolution can reach 1 km. The full-sky imager takes a cloud picture every 30 seconds, and the spatial resolution is sub-kilometers. The purpose of using the cloud picture is to capture the relationship between the cloud change and the solar radiation intensity. By looking at the cloud picture at multiple moments in time, we can predict the change in the cloud. The change of the cloud has a great relation with the weather change, wherein the wind speed and the wind direction are important influencing factors, and the cloud image data are combined with the wind speed and the wind direction data in an attempt to predict the solar radiation intensity and the power generated by the photovoltaic power station.
The method for predicting the power of the photovoltaic power station in an ultra-short period is described below. Referring to fig. 1, the photovoltaic power station power ultra-short term prediction method provided in the embodiment of the present application may include the following steps:
step S101, a weather forecast time sequence of a photovoltaic power station in a first time period, a cloud picture time sequence in a second time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period and a third time period are obtained.
It is understood that the first time period, the second time period, and the third time period are uniform in length.
The weather forecast time sequence in the first time period consists of weather forecast data of each time point in the first time period, wherein the weather forecast data can comprise temperature, humidity, wind speed, wind direction, irradiation intensity, ultraviolet intensity and the like.
The cloud image time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud layer picture in the second time period in advance. It can be understood that the cloud layer picture in the second time period is a cloud picture shot by using the full-sky imager in the second time period, and the shooting time points of the cloud picture correspond to each time point of the wind speed actual measurement time sequence and the wind direction actual measurement time sequence in the second time period one by one.
The measured time sequence of the irradiation intensity in the second time period consists of measured data of the irradiation intensity at each time point in the second time period, the measured time sequence of the power in the second time period consists of measured data of the power at each time point in the second time period, and each time point of the measured time sequence of the irradiation intensity in the second time period corresponds to each time point of the measured time sequence of the power in the second time period one by one.
The measured time sequence of the irradiation intensity in the third time period consists of measured data of the irradiation intensity at each time point in the third time period, the measured time sequence of the power in the third time period consists of measured data of the power at each time point in the third time period, and each time point of the measured time sequence of the irradiation intensity in the third time period corresponds to each time point of the measured time sequence of the power in the third time period one by one.
Step S102, inputting the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence into a trained power prediction model to obtain a power prediction time sequence in a first time period.
The second time period is before the first time period, and the second time period is different from the first time period by a preset first time interval, as shown in fig. 2. Assuming that the ultra-short term prediction needs to predict the power generated by the photovoltaic power plant for 15 minutes to 4 hours (time resolution of 15 minutes), the preset first time interval is 4 hours, and the first time period starting time point and the second time period ending time point are different by 15 minutes. The third time period is before the second time period, and the third time period is different from the first time period by a preset second time interval. The preset second time interval has a solar periodical attribute or other related attributes, so that the meteorological data of the second time period has a certain reference meaning for the first time period. It can be understood that there are a plurality of time points in each time period, and each time point in each time period corresponds to each element in the time sequence in the time period one by one; the first time period, the second time period and the third time period are consistent in length.
By way of example, assuming now that it is 11 pm for 3 months 5 days, it is necessary to predict the power generated by a certain photovoltaic plant for 16 time points during the 3 months 5 days 12 pm to 15 pm 45 minutes. Then, the first time period may be set to be between 12 pm and 15 pm for 3 months 5 days, the second time period may be set to be between 8 am and 11 pm for 3 months 5 days, and the third time period may be set to be between 12 pm and 15 pm for 3 months 4 days.
The power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels.
As shown in fig. 3, the fifth time period precedes the fourth time period, and the fifth time period and the fourth time period differ by a first time interval, the sixth time period precedes the fourth time period and the fifth time period, and the sixth time period and the fourth time period differ by a second time interval, and the lengths of the fourth time period, the fifth time period, and the sixth time period are consistent. The time relation between the data adopted in the model training is consistent with the time relation between the data in the model application.
Illustratively, as shown in fig. 4, it is assumed that the fourth period is from 12 pm to 15 pm 45 minutes on 3 months 5 days, the fifth period is from 8 am to 11 pm 45 minutes on 3 months 5 days, and the sixth period is from 12 pm to 15 pm 45 minutes on 3 months 4 days. Then, the data in the dashed box in the figure is the training sample, and the data in the solid box is the sample label corresponding to the training sample. Wherein, (P) T, (P) RH, (P) WS, (P) WD, (P) IR respectively represent temperature forecast data, humidity forecast data, wind speed forecast data, wind direction forecast data and irradiation intensity forecast data; (M) WS, (M) WD, (M) IR, and (M) PV respectively represent measured wind speed data, measured wind direction data, measured irradiation intensity data, and measured power data.
According to the method, firstly, a weather forecast time sequence of a photovoltaic power station in a first time period, a cloud picture time sequence in a second time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period and a third time period are obtained. The cloud picture time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period in advance, and the time correlation information of the cloud picture can be better captured by embedding the wind speed and the wind direction in the meteorological data in the cloud picture. Before the first time period, the second time period is a cloud picture time sequence, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period are all historical actual measurement data; and the second time period differs from the first time period by a preset first time interval. The third time period is before the second time period, namely the irradiation intensity actually measured time sequence and the power actually measured time sequence in the third time period are both historical actually measured data; and the third time period is different from the first time period by a preset second time interval, and the preset second time interval has a sunlight periodicity attribute, so that the meteorological data of the third time period has a certain reference meaning for the first time period. Further, the lengths of the first period, the second period, and the third period are uniform. It is understood that each point in time in each time period corresponds to a point in time of each element in the time series within the time period. And then, inputting the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence into a trained power prediction model to obtain a power prediction time sequence in a first time period. It should be noted that, the power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels. Wherein the fifth time period precedes the fourth time period, and the fifth time period differs from the fourth time period by the first time interval, the sixth time period precedes the fourth time period and the fifth time period, and the sixth time period differs from the fourth time period by the second time interval, and the fourth time period, the fifth time period, and the sixth time period are identical in length. According to the power prediction model, the correlation between the cloud layer picture and the wind speed and the wind direction, the correlation between the weather data and the weather actual measurement data, the correlation between the weather forecast data and the weather actual measurement data and the correlation between the weather data and the photovoltaic power station power are utilized, so that the power prediction model can predict the power value based on the weather forecast data, the historical cloud layer picture, the historical irradiation intensity actual measurement data and the historical power actual measurement data, and the power prediction model has important application value.
In some embodiments of the present application, the foregoing weather forecast time sequences may include a temperature forecast time sequence, a humidity forecast time sequence, a wind speed forecast time sequence, a wind direction forecast time sequence, and an irradiance intensity forecast time sequence.
In some embodiments of the present application, the first time period mentioned in step S101 is 4 hours after the preset time to the preset time, where, to meet the time requirement of the ultra-short-term prediction, the preset time differs from the current time by less than 20 minutes, for example, the preset time may be set to a time that differs from the current time by 15 minutes, the preset first time interval is 4 hours, and the preset second time interval is 24 hours.
The above setting of the time interval is applicable to the case where the weather is relatively stable and the weather conditions on adjacent dates are relatively close.
It will be appreciated that in the case of a time resolution of 15 minutes, where 4 data points are provided per hour, then 16 data points per time period will be provided and the length of the time series will be 16.
In some embodiments of the present application, the step S101 of obtaining the weather forecast time sequence, the cloud image time sequence, the radiation intensity actual measurement time sequence and the power actual measurement time sequence of the photovoltaic power station in the first time period, the second time period and the third time period may include:
S1, weather forecast data of the photovoltaic power station in a first time period are obtained.
Wherein the weather forecast data comprises temperature forecast data, humidity forecast data, wind speed forecast data, wind direction forecast data and irradiation intensity forecast data.
And S2, carrying out interpolation operation on the weather forecast data to obtain a temperature forecast time sequence, a humidity forecast time sequence, a wind speed forecast time sequence, a wind direction forecast time sequence and an irradiation intensity forecast time sequence.
And S3, acquiring wind speed measured data, wind direction measured data, irradiation intensity measured data, power measured data and cloud layer pictures of the photovoltaic power station in a second time period.
And S4, respectively carrying out interpolation operation on the wind speed actual measurement data, the wind direction actual measurement data, the irradiation intensity actual measurement data and the power actual measurement data to obtain a wind speed actual measurement time sequence, a wind direction actual measurement time sequence, an irradiation actual measurement time sequence and a power actual measurement time sequence in a second time period.
S5, generating a cloud image time sequence in the second time period by using the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud image picture in the second time period.
S6, obtaining the measured data of the irradiation intensity and the measured data of the power of the photovoltaic power station in the third time period, and respectively carrying out interpolation operation on the measured data of the irradiation intensity and the measured data of the power to obtain a measured time sequence of the irradiation intensity and a measured time sequence of the power in the third time period.
The interpolation operation aims at data completion, and after interpolation operation, each time sequence has the same time point and sequence length.
In some embodiments of the present application, the step S5 of generating the cloud image time sequence in the second period by using the wind speed measured time sequence, the wind direction measured time sequence, and the cloud image picture in the second period may include:
and S51, converting each cloud layer picture in the second time period into a cloud picture matrix with a size.
Wherein w is the width of the cloud picture, h is the height of the cloud picture, and c represents the channel number of the cloud picture. It will be appreciated that when the cloud picture is a color image, there are 3 channels, where c has a value of 3, i.e., the size of the cloud matrix is
. When the actual cloud picture is not a color image, but a gray image or other type of image, the number of channels c should be adapted accordingly.
S52, expanding each sequence element in the wind speed actual measurement time sequence in the second time period into a size of
Is a wind speed matrix of (a).
Wherein the values of each matrix element in the wind speed matrix are equal to the measured wind speed values of the sequence of elements.
Exemplary, assume that the wind speed measured time series within the second time period is at a time point
The measured wind speed of the sequence element is 2.2m/s, thenThe wind speed matrix is: />
;
S53, expanding each sequence element in the wind direction actual measurement time sequence in the second time period into a size of
Is a wind direction matrix of (a).
Likewise, the value of each matrix element in the wind direction matrix is equal to the measured wind direction value of the sequence element.
S54, combining the wind speed matrix, the wind direction matrix and the cloud picture matrix corresponding to the same time point to obtain the cloud picture matrix embedded with the wind direction and the wind speed.
It will be appreciated that the size of the cloud matrix is
. And finally, forming a cloud image time sequence by cloud image matrixes embedded with wind directions and wind speeds in the second time period. Illustratively, assume a time point +.>
The cloud image time sequence at the point is +.>
And assuming that the time series length is 16, wherein +.>
Then the cloud image time series can be expressed as:
it can be understood that, since the time resolution of the weather forecast data and the weather actual measurement data is different from that of the all-sky imager, specifically, the sampling frequency of the all-sky imager is higher than that of the numerical weather forecast data, we only select the pictures taken at the time corresponding to the numerical weather forecast and the actual measurement data, for example, assuming that the time resolution of the weather forecast data and the weather actual measurement data is 15 minutes and the data acquisition time corresponds to the 0 th, 15 th, 30 th and 45 th minutes of each hour, then, for the cloud pictures taken by the all-sky imager, only the cloud pictures taken at the 0 th, 15 th, 30 th and 45 th minutes of each time are selected.
In some embodiments of the present application, as shown in fig. 5, the power prediction model mentioned in step S102 may include an image Pre-processing unit (Pre), a first recurrent neural network layer (lstm_1), a first fully connected layer (fc_1), a second recurrent neural network layer (lstm_2), a second fully connected layer (fc_2), a third fully connected layer (fc_3), a third recurrent neural network layer (lstm_3), and a fourth fully connected layer (fc_4).
The first, second, and third recurrent neural network layers may be, for example, GRU networks (gated recurrent neural network, gated recurrent neural networks).
The workflow of each component in the power prediction model is as follows:
the cloud image time sequence is input to an image pre-processing unit, and the image pre-processing unit performs feature extraction and flattening processing on the cloud image time sequence to obtain a processed cloud image time sequence.
The processed cloud image time sequence is input to a first cyclic neural network layer, and the first cyclic neural network layer performs feature extraction on the processed cloud image time sequence to obtain a first feature representation.
The first fully connected layer linearly superimposes the first characteristic representation to obtain a first output result (Out 1).
The weather forecast time sequence and the irradiation intensity actual measurement time sequence are input into a second cyclic neural network layer, and the second cyclic neural network layer performs feature extraction on the weather forecast time sequence and the irradiation intensity actual measurement time sequence to obtain a second feature representation.
The second fully connected layer linearly superimposes the second representation of the feature to obtain a second output result (Out 2).
The first output result and the second output result are combined and then input to a third full-connection layer, the third full-connection layer maps the first output result and the second output result into a first sample tag space to obtain a third output result, and the third output result comprises irradiation intensity prediction data (IR).
And the third output result and the power actual measurement time sequence are combined and then input into a third cyclic neural network layer, and the third cyclic neural network layer performs feature extraction on the third output result and the power actual measurement time sequence to obtain a third feature representation.
The fourth full connection layer maps the third feature representation into a second sample tag space to obtain a power prediction time sequence.
Fig. 5 illustrates that the weather forecast time series includes a temperature forecast time series (P) T, a humidity forecast time series (P) RH, a wind speed forecast time series (P) WS, a wind direction forecast time series (P) WD, an irradiation intensity forecast time series (P) IR, and the irradiation intensity actual measurement time series includes an irradiation intensity actual measurement time series (M) ir_24 before 24 hours, and an irradiation intensity actual measurement time series (M) ir_4 before 4 hours.
Referring to fig. 5, the dimensions of the numerical weather forecast data and the site measured data input to the model are as follows
Where bs is batch_size,16 is the length of the sequence data (covering a time frame of +.>
) 9 is the number of features (corresponding to 6 time series). The dimension of the input to the convolutional neural network layer (CNN_1) is +.>
(assuming that the cloud layer picture is a color image), the output of the model is the irradiation intensity and the photovoltaic power generation power of 16 time points, and the dimension of the labeling data is +.>
。
In some embodiments of the present application, as shown in fig. 5, the image Pre-processing unit (Pre) may include 2 convolutional neural network layers (cnn_1 and cnn_2) connected in series in sequence. More specifically, the convolutional neural network layer, the cyclic neural network layer and the full-connection layer used in the power prediction model can be a convolutional neural network layer torch.nn.conv3d, a cyclic neural network layer torch.nn.lstm and a full-connection layer torch.nn.linear which are self-contained in the Py-Torch framework. The number of channels and convolution kernel sizes of the 2 convolutional neural network layers (cnn_1 and cnn_2), the number of neurons of the 3 convolutional neural network layers (lstm_1, lstm_2 and lstm_3), and the number of neurons of the first fully-connected layer (fc_1) and the second fully-connected layer (fc_2) in the image pre-processing unit may be determined according to actual needs.
In some embodiments of the present application, the number of neurons in the third fully connected layer is greater than or equal to 2, 1 neuron in the third fully connected layer corresponding to an irradiance intensity prediction; the number of neurons of the fourth fully connected layer is 1, and the neurons of the fourth fully connected layer correspond to power predictors.
Fig. 5 only illustrates the case where the number of neurons of the third fully connected layer is 2, with 1 more free neurons outputting the variable F. Since there are only 1 constrained neurons in the third fully connected layer, and the number of neurons in the first fully connected layer is greater than or equal to 2, then more unconstrained neurons can extract unnamed physical features from the data, so that the capability of extracting information from the model is enhanced, and the degree of freedom of the model is improved from the viewpoint of the intermediate output of the model.
In some embodiments of the present application, the foregoing training process of the power prediction model may include the following steps:
step S201, a historical weather forecast data set, a historical cloud layer picture set, a historical wind speed actual measurement data set, a historical wind direction actual measurement data set, a historical irradiation intensity actual measurement data set and a historical power actual measurement data set of a photovoltaic power station are obtained.
The historical weather forecast data set comprises weather forecast data of a plurality of historical time points, the historical cloud layer picture set comprises cloud layer pictures of the plurality of historical time points, the historical irradiation intensity actual measurement data set comprises irradiation intensity actual measurement data of the plurality of historical time points, and the historical power actual measurement data set comprises power actual measurement data of the plurality of historical time points.
Step S202, respectively carrying out data processing on a historical weather forecast data set, a historical cloud layer picture set, a historical wind speed actual measurement data set, a historical wind direction actual measurement data set, a historical irradiation intensity actual measurement data set and a historical power actual measurement data set to obtain a historical weather forecast time sequence, a target historical cloud layer picture set, a historical wind speed actual measurement time sequence, a historical wind direction actual measurement time sequence, a historical irradiation intensity actual measurement time sequence and a historical power actual measurement time sequence.
The data processing is used for realizing data standardization and data completion. Specifically, when a data loss occurs, interpolation is performed by using a suitable mathematical method to complement the missing data. After the data are completed, all the data are normalized by using a proper normalization method.
And step S203, generating a historical cloud picture time sequence by utilizing the historical wind speed actual measurement time sequence, the historical wind direction actual measurement time sequence and the target historical cloud picture set.
The specific generation method of the cloud image time sequence can be referred to the above description.
Step S204, a training set is constructed based on a historical weather forecast time sequence, a historical cloud image time sequence, a historical irradiation intensity actual measurement time sequence and a historical power actual measurement time sequence;
step S205, training the power prediction model based on the training set and a preset loss function.
Specifically, training samples in a training set are input into a power prediction model one by one to obtain output irradiation intensity prediction data and power prediction data, wherein the irradiation intensity prediction data is an intermediate output quantity, the power prediction data is a final output quantity, a loss value is calculated based on the output quantities, a loss function and a sample label corresponding to the training sample, and whether the power prediction model is trained is judged based on the loss value. If not, transmitting the loss value to a power prediction model for adjusting model parameters; if yes, determining the model at the moment as a finally adopted model, and obtaining a trained power prediction model.
In some embodiments of the present application, the mean square error (mean squared error, MSE) may be utilized to evaluate model performance. Based on this, the aforementioned loss function may be:
where n is the number of samples in the training set,
for a preset weight coefficient, +.>
and />
Respectively, the power measured value and the irradiation intensity measured value of the ith sample, < + >>
and />
The power predicted value and the irradiation intensity predicted value of the ith sample are respectively obtained.
The photovoltaic power station power ultra-short term prediction device provided by the embodiment of the application is described below, and the photovoltaic power station power ultra-short term prediction device described below and the photovoltaic power station power ultra-short term prediction method described above can be correspondingly referred to each other.
Referring to fig. 6, the photovoltaic power station power ultra-short term prediction apparatus provided in the embodiment of the present application may include:
a data acquisition unit 21, configured to acquire a weather forecast time sequence of the photovoltaic power station in a first time period, a cloud image time sequence in a second time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period and a third time period;
the power prediction unit 22 is configured to input the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence, and the power actual measurement time sequence into a trained power prediction model, so as to obtain a power prediction time sequence in a first time period;
The cloud picture time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period in advance;
the power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels;
the second time period is before the first time period, the second time period is different from the first time period by a preset first time interval, the third time period is before the second time period, the third time period is different from the first time period by a preset second time interval, and the lengths of the first time period, the second time period and the third time period are consistent;
the fifth time period is before the fourth time period, the fifth time period and the fourth time period differ by the first time interval, the sixth time period is before the fourth time period and the fifth time period, the sixth time period and the fourth time period differ by the second time interval, and the lengths of the fourth time period, the fifth time period and the sixth time period are consistent.
The photovoltaic power station power ultra-short-term prediction device provided by the embodiment of the application can be applied to photovoltaic power station power ultra-short-term prediction equipment, such as a computer and the like. Alternatively, fig. 7 shows a block diagram of a hardware structure of the photovoltaic power plant power ultra-short term prediction apparatus, and referring to fig. 7, the hardware structure of the photovoltaic power plant power ultra-short term prediction apparatus may include: at least one processor 31, at least one communication interface 32, at least one memory 33 and at least one communication bus 34.
In the embodiment of the present application, the number of the processor 31, the communication interface 32, the memory 33, and the communication bus 34 is at least one, and the processor 31, the communication interface 32, and the memory 33 complete communication with each other through the communication bus 34;
the processor 31 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present application, etc.;
the memory 33 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one magnetic disk memory;
wherein the memory 33 stores a program, the processor 31 may call the program stored in the memory 33, the program being for:
Acquiring a weather forecast time sequence of a photovoltaic power station in a first time period, a cloud picture time sequence in a second time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period and a third time period;
inputting the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence into a trained power prediction model to obtain a power prediction time sequence in a first time period;
the cloud picture time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period in advance;
the power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels;
the second time period is before the first time period, the second time period is different from the first time period by a preset first time interval, the third time period is before the second time period, the third time period is different from the first time period by a preset second time interval, and the lengths of the first time period, the second time period and the third time period are consistent;
The fifth time period is before the fourth time period, the fifth time period and the fourth time period differ by the first time interval, the sixth time period is before the fourth time period and the fifth time period, the sixth time period and the fourth time period differ by the second time interval, and the lengths of the fourth time period, the fifth time period and the sixth time period are consistent.
Alternatively, the refinement function and the extension function of the program may be described with reference to the above.
The present embodiment also provides a computer-readable storage medium storing a program adapted to be executed by a processor, the program being configured to:
acquiring a weather forecast time sequence of a photovoltaic power station in a first time period, a cloud picture time sequence in a second time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period and a third time period;
inputting the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence into a trained power prediction model to obtain a power prediction time sequence in a first time period;
The cloud picture time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period in advance;
the power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels;
the second time period is before the first time period, the second time period is different from the first time period by a preset first time interval, the third time period is before the second time period, the third time period is different from the first time period by a preset second time interval, and the lengths of the first time period, the second time period and the third time period are consistent;
the fifth time period is before the fourth time period, the fifth time period and the fourth time period differ by the first time interval, the sixth time period is before the fourth time period and the fifth time period, the sixth time period and the fourth time period differ by the second time interval, and the lengths of the fourth time period, the fifth time period and the sixth time period are consistent.
Alternatively, the refinement function and the extension function of the program may be described with reference to the above.
To sum up:
according to the method, firstly, a weather forecast time sequence of a photovoltaic power station in a first time period, a cloud picture time sequence in a second time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period and a third time period are obtained. The cloud picture time sequence in the second time period is generated by utilizing the wind speed actual measurement time sequence, the wind direction actual measurement time sequence and the cloud picture in the second time period in advance, and the time correlation information of the cloud picture can be better captured by embedding the wind speed and the wind direction in the meteorological data in the cloud picture. Before the first time period, the second time period is a cloud picture time sequence, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the second time period are all historical actual measurement data; and the second time period differs from the first time period by a preset first time interval. The third time period is before the second time period, namely the irradiation intensity actually measured time sequence and the power actually measured time sequence in the third time period are both historical actually measured data; and the third time period is different from the first time period by a preset second time interval, and the preset second time interval has a sunlight periodicity attribute, so that the meteorological data of the third time period has a certain reference meaning for the first time period. Further, the lengths of the first period, the second period, and the third period are uniform. It is understood that each point in time in each time period corresponds to a point in time of each element in the time series within the time period. And then, inputting the weather forecast time sequence, the cloud image time sequence, the irradiation intensity actual measurement time sequence and the power actual measurement time sequence into a trained power prediction model to obtain a power prediction time sequence in a first time period. It should be noted that, the power prediction model is obtained by training a weather forecast time sequence in a fourth time period, a cloud image time sequence in a fifth time period, an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fifth time period and a sixth time period as training samples, and an irradiation intensity actual measurement time sequence and a power actual measurement time sequence in the fourth time period as sample labels. Wherein the fifth time period precedes the fourth time period, and the fifth time period differs from the fourth time period by the first time interval, the sixth time period precedes the fourth time period and the fifth time period, and the sixth time period differs from the fourth time period by the second time interval, and the fourth time period, the fifth time period, and the sixth time period are identical in length. According to the power prediction model, the correlation between the cloud layer picture and the wind speed and the wind direction, the correlation between the weather data and the weather actual measurement data, the correlation between the weather forecast data and the weather actual measurement data and the correlation between the weather data and the photovoltaic power station power are utilized, so that the power prediction model can predict the power value based on the weather forecast data, the historical cloud layer picture, the historical irradiation intensity actual measurement data and the historical power actual measurement data, and the power prediction model has important application value.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the present specification, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and may be combined according to needs, and the same similar parts may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.