Photovoltaic day-ahead power prediction method and system based on deep learning, and storage medium

By adopting a deep learning-based method in photovoltaic pre-day power prediction, combined with the output data, historical data and meteorological data of photovoltaic stations, the problem of inaccurate prediction in the prior art is solved, and higher prediction accuracy and grid stability are achieved.

CN119905995APending Publication Date: 2025-04-29SHENZHEN SHENRAN CLEAN ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411893034.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The existing technology has failed to fully explore the high correlation parameters and contemporary and recent historical data in meteorological data, resulting in inaccurate photovoltaic power prediction results.

Method used

Using a deep learning-based method, the output data of the photovoltaic station, the historical expected prediction sunrise data, the next day meteorological data and the attention weight vector are spliced ​​into the prediction input vector, and input it to the trained photovoltaic pre-day power prediction model, and pre-training and fine-tuning are performed to obtain more accurate prediction results.

Benefits of technology

By further digging out high correlation parameters in historical data and making full use of concurrent and recent historical data, the accuracy of photovoltaics' pre-day power prediction is improved, the grid stability is enhanced and economic losses are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119905995A_ABST
    Figure CN119905995A_ABST
Patent Text Reader

Abstract

The invention provides a photovoltaic day-ahead power prediction method and system based on deep learning, and a storage medium. The method comprises the following steps: linearizing output data of a photovoltaic station at each moment on that day and historical output data of a day to be predicted in the same expectation within a preset time period into a combined feature vector; splicing the combined feature vector, the next-day meteorological feature vector and a preset attention weight vector into a prediction input vector; and inputting the prediction input vector into a trained photovoltaic day-ahead power prediction model to obtain a power prediction result at each moment before the day. According to the method, the feature vectors of the historical data are extracted, the model is pre-trained by using the feature vectors of the historical data, and then the pre-trained model parameters are finely adjusted, so that a prediction model which is more suitable for photovoltaic power generation is obtained; and high-correlation parameters in historical data are mined in a deeper level, and synchronous and recent historical data are fully utilized, so that the prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power dispatching technology, and in particular to a photovoltaic day-ahead power prediction method, system and storage medium based on deep learning. Background Art

[0002] Due to the influence of various environmental factors such as light intensity, temperature, and humidity, photovoltaic power generation has strong random fluctuations and non-stationarity, which poses a huge challenge to the safe and stable operation of the power system. Accurate and reliable prediction of photovoltaic power can improve the utilization rate of photovoltaics and ensure the reliability of power supply.

[0003] The use of neural networks to predict photovoltaic power has been made public recently. This method predicts photovoltaic power by training a large amount of historical data. However, the prediction method in the existing technology does not fully exploit the highly correlated parameters in meteorological data, nor does it make full use of the historical data of the same period and recent times. Therefore, it is impossible to give an accurate prediction result.

[0004] Therefore, the prior art needs to be further improved. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a photovoltaic day-ahead power prediction method, system and storage medium based on deep learning, so as to solve the defect that the prior art does not fully exploit the features in the relevant data, resulting in the inability to obtain accurate prediction results.

[0006] In a first aspect, the present application discloses a photovoltaic day-ahead power prediction method based on deep learning, which includes:

[0007] The output data of the photovoltaic station at each moment of the day and the historical and expected predicted daily output data within a preset time period are linearized into a combined feature vector;

[0008] The combined feature vector, the next day's meteorological feature vector constructed by the next day's meteorological data to be predicted, and the preset attention weight vector are concatenated into a prediction input vector;

[0009] The prediction input vector is input into the trained photovoltaic day-ahead power prediction model to obtain the power prediction results at each moment of the day-ahead output by the photovoltaic day-ahead power prediction model.

[0010] Optionally, the method for generating the photovoltaic day-ahead power prediction model includes:

[0011] Collecting historical photovoltaic data within a preset time period, and dividing the collected historical photovoltaic data into a pre-training data set and a training data set according to a preset ratio;

[0012] Extract feature vectors corresponding to photovoltaic historical data in the pre-training data set and the training data set;

[0013] Inputting the feature vector corresponding to the photovoltaic historical data in the pre-training data set into the preset network model, training the preset network model, and obtaining a pre-trained photovoltaic day-ahead power prediction model; wherein the preset network model is a BERT model;

[0014] The feature vector corresponding to the photovoltaic historical data in the training data set is input into the pre-trained photovoltaic day-ahead power prediction model, and the pre-trained photovoltaic day-ahead power prediction model is trained to obtain the trained photovoltaic day-ahead power prediction model.

[0015] Optionally, the photovoltaic historical data includes: data of the same day of each year in a preset time period of the photovoltaic station, data of the next day of each year in a preset time period of the photovoltaic station, and meteorological data of the next day of each year in a preset time period of the location of the photovoltaic station;

[0016] The step of extracting feature vectors corresponding to photovoltaic historical data in the pre-training data set and the training data set includes:

[0017] Process the data of the same day of each year in the preset time period of the photovoltaic station into the output feature vector of each day;

[0018] The next day data of the same period of each year in the preset time period of the photovoltaic station is linearly divided into full-day data according to the preset proportional coefficient, and the output feature vector of the next day of the same period of each year is obtained;

[0019] Linearly combine the daily output feature vector of each year and the historical daily output feature vector of the same period of each year into the daily output feature vector;

[0020] Process the meteorological data of the next day in the same period of each year within the preset time period where the photovoltaic station is located into the meteorological feature vector of the next day;

[0021] The current day's effort feature vector, the next day's meteorological characteristic vector, and the preset time's attention feature vector are concatenated into an input vector.

[0022] Optionally, the step of inputting the feature vector corresponding to the photovoltaic historical data in the pre-training data set into a preset network model, training the preset network model, and obtaining a pre-trained photovoltaic day-ahead power prediction model includes:

[0023] The feature vector corresponding to the photovoltaic historical data in the pre-training data set is input into the preset network model constructed based on the BERT model, and the preset network model is iteratively trained to obtain the pre-trained photovoltaic day-ahead power prediction model.

[0024] Optionally, the iterative training of the preset network model includes: the correction step includes:

[0025] The Huber loss value of the model is calculated according to the predicted value output by the preset network model in each iterative training, and it is determined whether the Huber loss value is less than the preset threshold;

[0026] If the Huber loss value is greater than the preset threshold, the parameters of the preset network model are adjusted through the back propagation algorithm and the gradient descent algorithm until the Huber loss value is less than or equal to the preset threshold, and the pre-trained photovoltaic day-ahead power prediction model is obtained.

[0027] Optionally, the step of inputting the feature vector corresponding to the photovoltaic historical data in the training data set into a pre-trained photovoltaic day-ahead power prediction model, training the pre-trained photovoltaic day-ahead power prediction model, and obtaining the trained photovoltaic day-ahead power prediction model includes:

[0028] Inputting the photovoltaic historical data in the training data set into the pre-trained photovoltaic day-ahead power prediction model to obtain the power prediction value output by the pre-trained photovoltaic day-ahead power prediction model;

[0029] Calculate the Huber loss based on the power prediction value, and determine whether the Huber loss is less than a preset fine-tuning threshold;

[0030] If the Huber loss is greater than the preset fine-tuning threshold, the model parameters of the pre-trained photovoltaic day-ahead power prediction model are adjusted through the back propagation algorithm and the gradient descent algorithm until the calculated Huber loss is less than or equal to the preset fine-tuning threshold, thereby obtaining the trained photovoltaic day-ahead power prediction model.

[0031] Optionally, the step of dividing the collected photovoltaic historical data into a pre-training data set and a training data set according to a preset ratio includes:

[0032] According to the division method of the minimum division module being the whole day, the minimum division module is 0:00 to 24:00, and the pre-training data set and the training data set are randomly divided according to the preset ratio.

[0033] Optionally, the step of splicing the combined feature vector, the next day's meteorological feature vector constructed by the next day's meteorological data to be predicted, and a preset attention weight vector into a prediction input vector includes:

[0034] Obtain the attention weights in the trained photovoltaic day-ahead power prediction model and construct the attention weight vector at the moment;

[0035] The combined feature vector, the next day's meteorological feature vector and the attention weight vector are added together according to the corresponding time points, and concatenated to obtain a composite prediction input vector.

[0036] In a second aspect, the present application discloses a photovoltaic day-ahead power prediction system based on deep learning, which includes:

[0037] A data integration module is used to linearize the output data of the photovoltaic station at each moment of the day and the output data of the historical and expected predicted days within a preset time period into a combined feature vector, and to splice the combined feature vector, the next day's meteorological feature vector constructed by the next day's meteorological data to be predicted, and a preset attention weight vector into a prediction input vector;

[0038] The prediction module is used to input the prediction input vector into the trained photovoltaic day-ahead power prediction model to obtain the power prediction results at each moment of the day-ahead output by the photovoltaic day-ahead power prediction model.

[0039] In a third aspect, the present application discloses a computer storage medium, wherein the computer-readable storage medium stores one or more computer-readable programs, and the one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, the photovoltaic day-ahead power prediction method based on deep learning is implemented.

[0040] Beneficial effect: The present invention provides a photovoltaic day-ahead power prediction method, system and storage medium based on deep learning, which linearizes the output data of the photovoltaic station at each moment of the day and the output data of the historical expected predicted day within a preset time period into a combined feature vector; splices the combined feature vector, the next day meteorological feature vector constructed by the next day meteorological data to be predicted and the preset attention weight vector into a prediction input vector; inputs the prediction input vector into the trained photovoltaic day-ahead power prediction model to obtain the power prediction results of each moment of the day-ahead output by the photovoltaic day-ahead power prediction model. In this embodiment, by extracting the feature vector of historical data, and using the feature vector of historical data to pre-train the model and then fine-tuning the pre-trained model, a model that is more suitable for photovoltaic short-term power prediction is obtained, and the method and system disclosed in the present application improve the accuracy of prediction, improve the stability of the power grid and reduce unnecessary economic losses due to deeper mining of high correlation parameters in historical data and full use of contemporaneous and recent historical data. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flowchart of the steps of the photovoltaic day-ahead power prediction method based on deep learning provided by the present invention;

[0042] Figure 2 It is a schematic diagram of the input feature vector of the BERT centralized photovoltaic day-ahead power prediction model provided by the present invention;

[0043] Figure 3is a schematic diagram of a photovoltaic day-ahead power prediction model in an embodiment of the present invention;

[0044] Figure 4 It is a schematic diagram of the principle of data processing in the photovoltaic day-ahead power prediction model in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] Photovoltaic day-ahead power refers to the power generated by a photovoltaic power station from 0:00 to 24:00 the next day. The prediction of photovoltaic day-ahead power can be used for grid dispatching and operation management, while also reducing the impact of renewable energy generation on the grid and increasing the absorption rate. According to the forecast time scale, photovoltaic power forecasts can be divided into short-term, medium-term and long-term forecasts. The short-term forecast has a forecast time length of a few seconds to several days, and is mainly used in grid dispatching, improving power supply quality, spot markets, etc. Different from the intraday short-term forecast that focuses on immediate meteorological conditions and real-time changes, the photovoltaic day-ahead forecast focuses more on its long-term change trends and weather models, and mainly provides forecast results for the next day.

[0047] At present, the traditional prediction method is to compare the deviation area between the station prediction curve and the actual output curve, and the prediction result has a large deviation from the actual situation. The method of using neural network to predict photovoltaic day-ahead power only involves learning historical data, and does not fully explore the characteristic information in the data, so it is impossible to obtain accurate prediction results.

[0048] In order to obtain more accurate photovoltaic day-ahead power prediction results, the present application provides a photovoltaic day-ahead power prediction method, system and storage medium based on deep learning, by inputting the output data of the photovoltaic station at each moment of the day, the output data of the historical expected forecast day within a preset time period, and the next day's meteorological feature vector constructed by the predicted meteorological data of the next day into the trained photovoltaic day-ahead power prediction model to obtain the power prediction results at each moment of the day. The method of the present application obtains a model that is more suitable for photovoltaic short-term power prediction by pre-training and training the model respectively, and the method and system disclosed in the present application improve the accuracy of the prediction, improve the stability of the power grid and reduce unnecessary economic losses due to the deeper mining of high correlation parameters in historical data and the full use of the same period and recent historical data.

[0049] The photovoltaic day-ahead power prediction method, system and storage medium based on deep learning provided in this embodiment are further described in more detail below in conjunction with the accompanying drawings.

[0050] This embodiment provides a photovoltaic day-ahead power prediction method based on deep learning. Figure 1 As shown, including:

[0051] Step S1: linearize the output data of the photovoltaic station at each moment of the day and the historical and expected predicted daily output data within a preset time period into a combined feature vector.

[0052] This step first obtains the output data of the photovoltaic station at each moment of the day and the historical and expected predicted daily output data within the preset time period. Among them, the output data of the photovoltaic station at each moment of the day refers to the power output generated by the photovoltaic at different time points in a day. If you want to obtain the output data of the photovoltaic station at each moment of the day, you can obtain the real-time record of the power output data of the photovoltaic station from the photovoltaic station monitoring system. Or by accessing the photovoltaic station monitoring system, you can obtain the output data of the photovoltaic station at each moment of the day, and the output data at each moment can be displayed in the form of a chart or table. You can also obtain the output data of the photovoltaic station at each moment of the day from the information collected or recorded by the power generation company or operator. The historical and expected predicted daily output data within the preset time period is the power output of the photovoltaic station at each moment expected to be generated on the predicted day in the historical period. To obtain the historical and expected predicted daily output data within the preset time period, you can obtain it from the historical output data, for example: obtain the output data of the photovoltaic station on the same day as the predicted day in the past period of time (for example, the past 3 years) from the monitoring system of the photovoltaic station. These data include the power output at each moment.

[0053] The output data of the photovoltaic station at each moment of the day and the historical expected daily output data within the preset time period are linearized to obtain a combined feature vector after linearization. Specifically, linearization is data normalization, which means mapping each data to a certain range to eliminate the dimensional differences between features. By normalizing the above data, different features are on the same scale, thereby achieving a fairer comparison and improving algorithm performance.

[0054] Step S2: concatenate the combined feature vector, the next day's meteorological feature vector constructed by the next day's meteorological data to be predicted, and the preset attention weight vector into a prediction input vector.

[0055] Obtain the next day's meteorological data to be predicted, and construct the next day's meteorological feature vector based on the next day's meteorological data to be predicted. Specifically, the next day's meteorological data to be predicted include: ambient temperature, air pressure, and relative humidity. The output data described in the above steps include: photovoltaic power generation power, total radiation, direct radiation, scattered radiation, photovoltaic module temperature, solar irradiance, etc. For the above-mentioned various data types, in the specific implementation, select the output data and meteorological data whose correlation coefficient is greater than the preset coefficient threshold, and obtain more accurate characteristic vectors corresponding to the meteorological data by mining the highly correlated parameters in the data.

[0056] The above-mentioned combined feature vector, the constructed next-day meteorological feature vector and the preset attention weight vector are spliced ​​to obtain a preset input vector. Among them, the preset attention weight vector is the attention parameter corresponding to each time period set by experience, and can also be the corresponding attention weight vector in the trained photovoltaic day-ahead power prediction model. The attention weight in the trained photovoltaic day-ahead power prediction model is obtained to construct the attention weight vector at the moment.

[0057] The method of splicing the data in this step is specifically as follows: adding the combined feature vector, the next day's meteorological feature vector and the attention weight vector corresponding to the time, and splicing them to obtain a composite prediction input vector.

[0058] Step S3: input the prediction input vector into the trained photovoltaic day-ahead power prediction model to obtain the power prediction results at each moment of the day-ahead output by the photovoltaic day-ahead power prediction model.

[0059] After the prediction input vector is obtained by splicing in the above step S2, the spliced ​​prediction input vector is input into the trained photovoltaic day-ahead power prediction model, and the power prediction value at each moment of the day-ahead is obtained based on the output of the photovoltaic day-ahead power prediction model.

[0060] Furthermore, the photovoltaic day-ahead power prediction model disclosed in this step is obtained by sequentially undergoing one pre-training and one formal training based on the BERT model.

[0061] Specifically, the method for generating the photovoltaic day-ahead power prediction model includes:

[0062] Step S01: Collect photovoltaic historical data within a preset time period, and divide the collected photovoltaic historical data into a pre-training data set and a training data set according to a preset ratio.

[0063] Collect the photovoltaic historical data within the preset time period, and divide the collected photovoltaic historical data into a pre-training data set and a training data set. Specifically, the photovoltaic historical data includes: the photovoltaic station's historical output data for the same period of the preset time period, the historical output data for the next day of the same period of the preset time period, and the historical meteorological data for the next day of the same period of the preset time period released by the meteorological department where the photovoltaic station is located. For example: the historical output data for the same period of the past three years, the historical output data for the next day of the same period of the past three years, and the historical meteorological data for the next day of the same period of the past three years.

[0064] After obtaining the historical photovoltaic data, for the historical output data and historical meteorological data for the same period, select the relevant data with a correlation coefficient greater than the preset coefficient threshold, and perform linear normalization on the selected data. For example, the meteorological parameters that are highly correlated with photovoltaic output are: total radiation, diffuse irradiance, direct irradiance, ambient temperature, and total cloud cover.

[0065] Specifically, the calculation formula of the correlation coefficient is as follows:

[0066]

[0067] The normalization formula is as follows:

[0068]

[0069] Among them, r is the correlation coefficient, n is the number of data, x i and i Respectively represent the values ​​of the two variables at the i-th data point, and are the means of x and y, respectively, x max The maximum value of the specified range for normalization, x min is the minimum value of the normalized specified range. The linear correlation between two variables is obtained by calculating the mean of the product of the difference between the two variables and their respective means and dividing it by the product of the standard deviations of the two variables. In this embodiment, the two variables are output data and meteorological data, and the amount of data is the total amount of output data and meteorological data.

[0070] Furthermore, in this step, the pre-training and training sets are randomly divided according to a preset ratio, for example, 70% and 30%, according to the division method of the smallest division module being the day, that is, from 0:00 to 24:00 is defined as the smallest division module.

[0071] Step S02: extracting feature vectors corresponding to photovoltaic historical data in the pre-training data set and the training data set.

[0072] After the acquired photovoltaic historical data is normalized, the characteristic vectors in the photovoltaic historical data are also extracted so as to use the extracted characteristic vectors for model training.

[0073] Specifically, the steps of extracting feature vectors corresponding to photovoltaic historical data in the pre-training data set and the training data set include:

[0074] Process the data of the same day of each year in the preset time period of the photovoltaic station into the output feature vector of the same day of each year; linearly divide the data of the next day of the same day of each year in the preset time period of the photovoltaic station into full-day data according to the preset proportional coefficient to obtain the output feature vector of the next day of the same day of each year; linearly combine the output feature vector of the same day of each year and the output feature vector of the next day of the same day of each year into the output feature vector of the same day; process the meteorological data of the next day of the same day of each year in the preset time period of the location of the photovoltaic station into the meteorological feature vector of the next day; splice the output feature vector of the same day, the meteorological characteristic vector of the next day and the attention feature vector of the preset time into the input vector. Among them, the preset time period can be in recent years, for example: in the past 3 years or in the past 5 years.

[0075] Step S03: input the feature vector corresponding to the photovoltaic historical data in the pre-training data set into the preset network model, train the preset network model, and obtain a pre-trained photovoltaic day-ahead power prediction model; wherein the preset network model is a BERT model.

[0076] The characteristic vector extracted from the photovoltaic historical data in the divided pre-training data set is input into the preset network model to train the preset network model to obtain the pre-trained photovoltaic day-ahead power prediction model.

[0077] In this step, the preset network model is built based on the BERT model. Figures 2 to 4 As shown in the figure, the BERT model includes: a hidden multi-head attention layer (Masked Multi-Head Attention layer), a first residual connection layer, a normalization layer (Layer Normalization layer), a forward feedback layer (FeedForward layer), a second residual connection layer and a fully connected layer. Specifically, the input data first passes through the Masked Multi-Head Attention layer (hidden multi-head attention layer), then passes through the first residual and normalization layer, then passes through the FeedForward layer (forward feedback layer), and then passes through the second residual and normalization layer, repeating the above hierarchical steps 24 times, and finally passes through the fully connected layer for prediction.

[0078] Specifically, the step of inputting the feature vector corresponding to the photovoltaic historical data in the pre-training data set into the preset network model, training the preset network model, and obtaining the pre-trained photovoltaic day-ahead power prediction model includes:

[0079] The feature vector corresponding to the photovoltaic historical data in the pre-training data set is input into the preset network model constructed based on the BERT model, and the preset network model is iteratively trained to obtain the pre-trained photovoltaic day-ahead power prediction model.

[0080] The steps of correcting the model parameters based on the calculated loss values ​​in the above pre-training process include:

[0081] The Huber loss value of the model is calculated according to the predicted value output by the preset network model in each iterative training, and it is determined whether the Huber loss value is less than the preset threshold; if the Huber loss value is greater than the preset threshold, the parameters of the preset network model are adjusted through the back propagation algorithm and the gradient descent algorithm until the Huber loss value is less than or equal to the preset threshold, thereby obtaining the pre-trained photovoltaic day-ahead power prediction model.

[0082] Specifically, first determine whether the Huber loss value is less than the initial threshold value. If it is greater than the initial threshold value, adjust the parameters of the preset network model. Continue to input the photovoltaic historical data into the preset network model after the model parameters are adjusted to obtain the prediction results after the model parameters are adjusted. Calculate the loss value according to the prediction results, and repeatedly determine whether the loss value is less than the initial threshold value. If the loss value is greater than the initial threshold value, adjust the parameters of the preset network model, and repeat the step of inputting the photovoltaic historical data into the preset network model after the model parameters are adjusted, until the calculated loss value is less than or equal to the initial threshold value, thereby obtaining the pre-trained photovoltaic day-ahead power prediction model.

[0083] Step S04: input the feature vector corresponding to the photovoltaic historical data in the training data set into the pre-trained photovoltaic day-ahead power prediction model, train the pre-trained photovoltaic day-ahead power prediction model, and obtain the trained photovoltaic day-ahead power prediction model.

[0084] In this step, the divided training data set is used to further fine-tune the model parameters of the pre-trained photovoltaic day-ahead power prediction model to obtain the final trained photovoltaic day-ahead power prediction model.

[0085] Furthermore, the step of inputting the feature vector corresponding to the photovoltaic historical data in the training data set into the pre-trained photovoltaic day-ahead power prediction model, training the pre-trained photovoltaic day-ahead power prediction model, and obtaining the trained photovoltaic day-ahead power prediction model includes:

[0086] Inputting the photovoltaic historical data in the training data set into the pre-trained photovoltaic day-ahead power prediction model to obtain the power prediction value output by the pre-trained photovoltaic day-ahead power prediction model;

[0087] Calculate the Huber loss based on the power prediction value, and determine whether the Huber loss is less than a preset fine-tuning threshold;

[0088] If the Huber loss is greater than the preset fine-tuning threshold, the model parameters of the pre-trained photovoltaic day-ahead power prediction model are adjusted through the back propagation algorithm and the gradient descent algorithm until the calculated Huber loss is less than or equal to the preset fine-tuning threshold, thereby obtaining the trained photovoltaic day-ahead power prediction model.

[0089] In a specific embodiment, the formula corresponding to the trained photovoltaic day-ahead power prediction model is as follows:

[0090]

[0091] Among them, the Masked Multi-Head Attention layer uses a query vector sequence, a key vector sequence, and a value vector sequence:

[0092] Q=W Q X;

[0093] K=W K X;

[0094] V=W V X;

[0095] The self-attention mechanism used is shown in the following formula:

[0096] X attention =selfAttention(Q,K,V);

[0097] Among them, the residual connection connects the original vector and the weighted vector to save the information of the original vector. The formula is as follows:

[0098] X hidden =X embedding +selfAttention(Q, K, V);

[0099] Among them, the normalization layer (Layer Normalization layer) normalizes the vector output by the Masked Multi-Head Attention layer to a standard normal distribution, that is, independent and identically distributed, in order to speed up the training and accelerate the convergence.

[0100] The formula for finding the mean is as follows:

[0101]

[0102] The formula for finding the variance is as follows:

[0103]

[0104] The normalization formula is as follows:

[0105]

[0106] The forward feedback layer projects the vector obtained by the multi-head attention layer into a larger space, then uses the Relu activation function to extract the required information, and finally projects it back to the original space of the token vector. Projecting the information in the token vector into a higher-dimensional space makes it easier to distinguish the various types of information in the vector in the high-dimensional space. The corresponding formula is as follows:

[0107] FFN(x)=ReLU(W 1 x+b 1 )W 2 +b 2 ;

[0108] Among them, the fully connected layer maps the high-dimensional vector to a one-dimensional vector to calculate the power prediction value.

[0109] The Huber loss function in this embodiment combines the advantages of mean absolute error MAE and mean square error MSE, and the calculation formula is as follows:

[0110]

[0111] Among them, the photovoltaic day-ahead power prediction model is a linear neural network connected on top of the Decoder, and the Relu function is used to output the corresponding prediction value. The Decoder model structure is as follows: Figure 4 The specific formula is as follows:

[0112] h 0 =UW e +W p ;

[0113]

[0114] For fine-tuning on a specific task dataset, such as the supervised dataset C, the data is a sequence x 1 ,…,x m And a label y. After inputting the data into the pre-trained model, the output vector Then use the linear regression layer to predict the label value; at the same time, it is necessary to maximize the likelihood function. The specific formula is as follows:

[0115]

[0116] L 2 (C)=∑(x,y) logP(y|x 1 ,…,x m );

[0117] Finally, the objective function of the supervised task model fine-tuned on the basis of the pre-trained model is as follows:

[0118] L 3 (C)=L 2 (C)+λ*L 1 (C);

[0119] The feature vector of the relevant data to be predicted is used as the input of the fine-tuned pre-trained BERT centralized photovoltaic day-ahead power prediction model. After the streamlined Decoder layer and the fully connected layer, the output vector is obtained and then mapped to a specific numerical value, that is, the predicted sequence value of the fine-tuned pre-trained photovoltaic day-ahead power prediction model.

[0120] Among them, the relevant data feature vector to be predicted is constructed as follows:

[0121] The photovoltaic output data of the centralized photovoltaic station on the current day is linearly combined with the historical data of the next day of the same period in the past three years to form an output vector;

[0122] The weather data for the next day predicted by the meteorological department in the area where the centralized photovoltaic station is located is divided into grades to construct the weather feature vector for the next day;

[0123] According to the fine-tuned pre-trained BERT centralized photovoltaic power prediction model, the attention weights are set and the attention weight vector at each moment is constructed.

[0124] The above three feature vectors are concatenated as the prediction input vector of the BERT centralized photovoltaic power prediction model.

[0125] In this embodiment, the winning prediction input vector is input to the pre-trained photovoltaic day-ahead power prediction model after fine-tuning to obtain the power prediction value output by the photovoltaic day-ahead power prediction model.

[0126] Since the pre-training method is adopted in this embodiment, the historical power-related data and meteorological data are fully trained, making the model more applicable to the field of photovoltaic short-term power prediction; the training set is used to fine-tune the BERT centralized photovoltaic power prediction model to fully mine historical data information; the advanced BERT model is used to improve the accuracy of photovoltaic short-term power prediction. On the one hand, it improves the stability of the power grid and increases the power grid's photovoltaic absorption capacity; on the other hand, it helps photovoltaic power stations reduce economic losses caused by power restrictions and improve the operation and management efficiency of photovoltaic power stations.

[0127] In addition to providing the above-mentioned prediction method, this embodiment further provides a photovoltaic day-ahead power prediction system based on deep learning, and the prediction system includes:

[0128] The data integration module is used to linearize the output data of the photovoltaic station at each moment of the day and the historical output data of the expected predicted day within a preset time period into a combined feature vector, and to splice the combined feature vector, the next day's meteorological feature vector constructed by the next day's meteorological data to be predicted, and the preset attention weight vector into a prediction input vector; its functions are as described in steps S1 and S2.

[0129] The prediction module is used to input the prediction input vector into the trained photovoltaic day-ahead power prediction model to obtain the power prediction results at each moment of the day-ahead output by the photovoltaic day-ahead power prediction model. Its function is as described in step S3.

[0130] The present application discloses a computer storage medium, wherein the computer-readable storage medium stores one or more computer-readable programs, and the one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, the photovoltaic day-ahead power prediction method based on deep learning is implemented.

[0131] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable storage medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or used in combination with these instruction execution systems, devices or apparatuses.

[0133] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0134] It is understandable that the above embodiments are exemplary and cannot be construed as limitations on the present application. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A photovoltaic day-ahead power prediction method based on deep learning, characterized in that: include: The output data of the photovoltaic station at each moment of the day and the historical and expected predicted daily output data within a preset time period are linearized into a combined feature vector; The combined feature vector, the next day's meteorological feature vector constructed by the next day's meteorological data to be predicted, and the preset attention weight vector are concatenated into a prediction input vector; The prediction input vector is input into the trained photovoltaic day-ahead power prediction model to obtain the power prediction results at each moment of the day-ahead output by the photovoltaic day-ahead power prediction model.

2. The photovoltaic day-ahead power prediction method based on deep learning according to claim 1 is characterized in that: The method for generating the photovoltaic day-ahead power prediction model comprises: Collecting historical photovoltaic data within a preset time period, and dividing the collected historical photovoltaic data into a pre-training data set and a training data set according to a preset ratio; Extract feature vectors corresponding to photovoltaic historical data in the pre-training data set and the training data set; Inputting the feature vector corresponding to the photovoltaic historical data in the pre-training data set into the preset network model, training the preset network model, and obtaining a pre-trained photovoltaic day-ahead power prediction model; wherein the preset network model is a BERT model; The feature vector corresponding to the photovoltaic historical data in the training data set is input into the pre-trained photovoltaic day-ahead power prediction model, and the pre-trained photovoltaic day-ahead power prediction model is trained to obtain the trained photovoltaic day-ahead power prediction model.

3. The photovoltaic day-ahead power prediction method based on deep learning according to claim 2 is characterized in that: The photovoltaic historical data includes: data of the same day of each year in the preset time period of the photovoltaic station, data of the next day of each year in the preset time period of the photovoltaic station, and meteorological data of the next day of each year in the preset time period of the location of the photovoltaic station; The step of extracting feature vectors corresponding to photovoltaic historical data in the pre-training data set and the training data set includes: Process the data of the same day of each year in the preset time period of the photovoltaic station into the output feature vector of each day; The next day data of the same period of each year in the preset time period of the photovoltaic station is linearly divided into full-day data according to the preset proportional coefficient, and the output feature vector of the next day of the same period of each year is obtained; Linearly combine the daily output feature vector of each year and the historical daily output feature vector of the same period of each year into the daily output feature vector; Process the meteorological data of the next day in the same period of each year within the preset time period where the photovoltaic station is located into the meteorological feature vector of the next day; The current day's effort feature vector, the next day's meteorological characteristic vector, and the preset time's attention feature vector are concatenated into an input vector.

4. The photovoltaic day-ahead power prediction method based on deep learning according to claim 2 is characterized in that: The step of inputting the feature vector corresponding to the photovoltaic historical data in the pre-training data set into the preset network model, training the preset network model, and obtaining the pre-trained photovoltaic day-ahead power prediction model comprises: The feature vector corresponding to the photovoltaic historical data in the pre-training data set is input into the preset network model constructed based on the BERT model, and the preset network model is iteratively trained to obtain the pre-trained photovoltaic day-ahead power prediction model.

5. The photovoltaic day-ahead power prediction method based on deep learning according to claim 4 is characterized in that: The iterative training of the preset network model includes: the correction step includes: The Huber loss value of the model is calculated according to the predicted value output by the preset network model in each iterative training, and it is determined whether the Huber loss value is less than the preset threshold; If the Huber loss value is greater than the preset threshold, the parameters of the preset network model are adjusted through the back propagation algorithm and the gradient descent algorithm until the Huber loss value is less than or equal to the preset threshold, and the pre-trained photovoltaic day-ahead power prediction model is obtained.

6. The photovoltaic day-ahead power prediction method based on deep learning according to claim 2 is characterized in that: The step of inputting the feature vector corresponding to the photovoltaic historical data in the training data set into the pre-trained photovoltaic day-ahead power prediction model, training the pre-trained photovoltaic day-ahead power prediction model, and obtaining the trained photovoltaic day-ahead power prediction model includes: Inputting the photovoltaic historical data in the training data set into the pre-trained photovoltaic day-ahead power prediction model to obtain the power prediction value output by the pre-trained photovoltaic day-ahead power prediction model; Calculate the Huber loss based on the power prediction value, and determine whether the Huber loss is less than a preset fine-tuning threshold; If the Huber loss is greater than the preset fine-tuning threshold, the model parameters of the pre-trained photovoltaic day-ahead power prediction model are adjusted through the back propagation algorithm and the gradient descent algorithm until the calculated Huber loss is less than or equal to the preset fine-tuning threshold, thereby obtaining the trained photovoltaic day-ahead power prediction model.

7. The photovoltaic day-ahead power prediction method based on deep learning according to claim 2 is characterized in that: The steps of dividing the collected photovoltaic historical data into a pre-training data set and a training data set according to a preset ratio include: According to the division method of the minimum division module as the whole day, the minimum division module is 0:00 to 24:00, and the pre-training data set and the training data set are randomly divided according to the preset ratio.

8. The photovoltaic day-ahead power prediction method based on deep learning according to claim 1 is characterized in that: The step of splicing the combined feature vector, the next day's meteorological feature vector constructed by the next day's meteorological data to be predicted, and the preset attention weight vector into a prediction input vector includes: Obtain the attention weights in the trained photovoltaic day-ahead power prediction model and construct the attention weight vector at the moment; The combined feature vector, the next day's meteorological feature vector and the attention weight vector are added together according to the corresponding time points, and concatenated to obtain a composite prediction input vector.

9. A photovoltaic day-ahead power prediction system based on deep learning, characterized in that: include: A data integration module is used to linearize the output data of the photovoltaic station at each moment of the day and the output data of the historical and expected predicted days within a preset time period into a combined feature vector, and to splice the combined feature vector, the next day's meteorological feature vector constructed by the next day's meteorological data to be predicted, and a preset attention weight vector into a prediction input vector; The prediction module is used to input the prediction input vector into the trained photovoltaic day-ahead power prediction model to obtain the power prediction results at each moment of the day-ahead output by the photovoltaic day-ahead power prediction model.

10. A computer storage medium, characterized in that: The computer-readable storage medium stores one or more computer-readable programs, and the one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, the photovoltaic day-ahead power prediction method based on deep learning as described in any one of claims 1 to 8 is implemented.