Photovoltaic power generation power prediction method based on feature reconstruction and hybrid deep learning
Through the method of feature reconstruction and hybrid deep learning, combined with Fourier variational autoencoder and hybrid deep learning model, the problems of insufficient time-frequency feature separation and lack of physical constraints in photovoltaic power generation prediction are solved, and a more accurate and physical law prediction effect is achieved.
Patent Information
- Application Number
- CN202510326766.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-24
AI Technical Summary
The existing deep learning models have problems such as insufficient time-frequency feature separation, defects in model architecture singularity and physical constraints in photovoltaic power prediction.
Using a method based on feature reconstruction and hybrid deep learning, the weather data is characterized by a Fourier variational autoencoder, and a hybrid deep learning model of hybrid convolutional neural network, attention mechanism and long and short-term memory network is constructed, combining the physical correction mechanism of sunshine state.
It improves the accuracy and physical rationality of photovoltaic power generation power prediction, breaks through the bottleneck of characterization of a single model in relying on weather data to obtain photovoltaic power generation power prediction, and ensures that the prediction results meet the physical constraints of photovoltaic system operation.
Smart Images

Figure CN120196930A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a photovoltaic power prediction method based on feature reconstruction and hybrid deep learning, belonging to the application of machine learning in the prediction of new energy power grids. Background Art
[0002] Accurate prediction of the power after photovoltaic power is connected to the grid is the core technical basis for the intelligent power grid system to achieve energy optimization scheduling, power market trading, and stable operation of the power grid. With the accelerating transformation of the global energy structure towards low-carbonization, the installed capacity of photovoltaic power generation continues to climb, and the strong volatility and intermittency characteristics of its power output pose a severe challenge to the real-time balance control of the power system. Traditional prediction methods for photovoltaic power mainly rely on numerical weather prediction (NWP) data and statistical models, but they have significant limitations in modeling complex meteorological-power non-linear mappings.
[0003] With the in-depth development of machine learning technology, constructing a deep learning model to adapt to the complex characteristics of photovoltaic power data has obvious advantages over traditional prediction methods, but there are still the following technical drawbacks:
[0004] (1) Insufficient separation of time-frequency features. Traditional deep learning models directly model the time-domain data in photovoltaic power data, making it difficult to effectively capture the periodic characteristics of photovoltaic power (such as day-night cycle, seasonal cycle).
[0005] (2) Defect of single model architecture. A single network architecture has inherent limitations. For example, the CNN model is good at local feature extraction but ignores long-range temporal dependencies; the LSTM model can model sequence relationships but is insensitive to spatial features; the feedforward neural network is difficult to handle dynamic change patterns. For example, the patent application with the application number CN202411310791.8 discloses a short-term photovoltaic power prediction method and device for a mobile platform based on weather type division. This method predicts the photovoltaic power generation during this period based on the weather type using a pre-constructed CNN-LSTM combined deep learning model. In this way, the randomness and volatility of single-unit photovoltaic output can be reduced, and the accuracy of photovoltaic power prediction can be improved. Although this hybrid model (such as CNN-LSTM) has some improvements, it lacks an explicit modeling mechanism for feature interaction.
[0006] (3) Problem of lack of physical constraints. Mainstream prediction methods do not incorporate the physical operation constraints of the photovoltaic system (such as zero power output at night) into the model architecture, resulting in prediction results that violate basic physical laws, such as still outputting photovoltaic power at night. Summary of the Invention
[0007] The technical problem solved by the present invention is: in view of the above problems existing in the existing deep learning model for photovoltaic power prediction, a photovoltaic power prediction method based on feature reconstruction and hybrid deep learning is provided.
[0008] The present invention is implemented by adopting the following technical solutions:
[0009] The present invention first discloses a photovoltaic power prediction method based on feature reconstruction and hybrid deep learning, which specifically includes the following steps:
[0010] S1. Collect historical photovoltaic power data and the original weather data corresponding to the data time points, and calibrate the sunshine state of the photovoltaic power station at each data time point according to the geographical location information of the photovoltaic power station;
[0011] S2. Perform normalization processing on the original weather data, generate enhanced weather data by passing the normalized original weather data through a Fourier variational autoencoder FVAE, splice the enhanced weather data and the normalized original weather data in the feature dimension to form a data set, and divide all samples in the data set into a training set, a validation set and a test set;
[0012] S3. Construct a hybrid deep learning model integrating a convolutional neural network, an attention mechanism and a long short-term memory network. The model inputs the weather data of the data set in step S2 and outputs the predicted value of the photovoltaic power. Among them, the hybrid deep learning model is trained using the training set, and the model parameters are optimized using the validation set;
[0013] S4. Use the test set to input the hybrid deep learning model, and correct the predicted values of the photovoltaic power at different data time points according to the sunshine state calibrated in step S1;
[0014] S5. Use the trained hybrid deep learning model to perform actual prediction of the photovoltaic power.
[0015] In the photovoltaic power prediction method based on feature reconstruction and hybrid deep learning of the present invention, further, the original weather data in step S1 includes global horizontal irradiance, direct normal irradiance, temperature, humidity, wind speed, wind direction, air pressure, and historical photovoltaic power data collected at corresponding time points at equal time intervals.
[0016] In the photovoltaic power prediction method based on feature reconstruction and hybrid deep learning of the present invention, further, in step S1, the ephem library of python is used to obtain the solar altitude angle at each data time point of the given geographical location information to calibrate the sunshine state of the photovoltaic power station. For the solar altitude angle greater than 0 degrees, the sunshine state is calibrated as daytime, otherwise it is night.
[0017] In the photovoltaic power prediction method based on feature reconstruction and hybrid deep learning of the present invention, further, in step S4, the predicted photovoltaic power value with the sunlight state calibrated as daytime is retained, and the predicted photovoltaic power value with the sunlight state calibrated as night is corrected to 0.
[0018] In the photovoltaic power prediction method based on feature reconstruction and hybrid deep learning of the present invention, further, in step S2, the generation of enhanced weather data by the Fourier variational autoencoder FVAE includes the following sub-steps:
[0019] S21. Data preprocessing and frequency domain transformation. Define the feature matrix X of the original weather data after normalization NWP , X NWP ∈R N×T×D , where N is the number of samples of the original weather data, T is the time step of the original weather data, D is the feature dimension of the original weather data. After exchanging the time step and feature dimension of X NWP , perform Fourier transform on the time series X d of each sample feature to generate the frequency domain
[0020]
[0021] where F represents the Fourier transform operation, B represents the batch size of the samples, and C represents the complex domain of the weather data after normalization;
[0022] S22. Take the amplitude |X freq |, |X freq |∈R B×D×T of all feature frequency domains in the sample, and map the input frequency domain amplitude |X freq | to the latent space through the following formula to obtain the latent space parameters:
[0023] h1 = ReLU(W1|X freq | + b1)∈R B×D×128 .
[0024] h2 = ReLU(W2h1 + b2)∈R B×D×32 ,
[0025] h1 and h2 respectively represent the outputs of the encoder hidden layers, that is, the mapped latent space. W1 and W2 are the weight matrices of the encoder hidden layers, b1 and b2 are the bias vectors of the encoder hidden layers, R represents the real domain of the weather data after normalization, ReLU represents the activation function, and generate the latent variable z through the latent space parameters,
[0026] z = μ + σ⊙∈, ∈~N(0, I)、
[0027] μ = Wμ h2 + h μ ∈ R B×D×32 、
[0028] logσ 2 = W σ h2 + h σ ∈ R B×D×32 ,
[0029] where ⊙ is element - wise multiplication, ∈ is standard Gaussian noise, μ is the mean, logσ 2 is the log variance, W μ 、W σ are weight matrices that map h2 to the mean and log variance respectively, h μ 、h σ are bias terms that add h2 to the mean and log variance;
[0030] S23. The decoder of the variational auto - encoder reconstructs the frequency - domain features from the latent variable z:
[0031] h3 = ReLU(W3z + b3) ∈ R B×D×64 、
[0032] h4 = ReLU(W4h3 + b4) ∈ R B×D×128 ,
[0033] h3 and h4 represent the outputs of the decoder hidden layers respectively, W3 and W4 are the weight matrices of the decoder hidden layers, b3 and b4 are the bias vectors of the decoder hidden layers. The frequency - domain signal of the original weather data is converted back to the time - domain through the inverse Fourier transform,
[0034] X recon = F -1 (h4) ∈ C B×D×T 、
[0035]
[0036] where, F -1 represents the inverse Fourier transform, X recon is the complex - valued time - domain signal converted back from h4 through the inverse Fourier transform F -1 , Real is the operation of taking the real part of a complex number, is the time - domain data reconstructed for X recon ;
[0037] S24. Normalize the reconstructed time - domain data using the Sigmoid activation function:
[0038]
[0039] W ois the weight matrix of the Sigmoid activation function, b o is the bias vector of the Sigmoid activation function, is the normalized reconstructed time-domain data, and then exchange the time step and the feature dimension to obtain the enhanced weather data of the original weather data samples generated by the Fourier variational autoencoder FVAE in this batch;
[0040] S25. After processing all batches of original weather data samples, finally obtain the feature matrix of the enhanced weather data
[0041] In the photovoltaic power prediction method based on feature reconstruction and hybrid deep learning of the present invention, further, the Fourier variational autoencoder FVAE uses a loss function composed of a reconstruction loss and a KL divergence.
[0042] In the photovoltaic power prediction method based on feature reconstruction and hybrid deep learning of the present invention, further, in step S2, select a sample from the dataset as the test set, and divide the remaining samples into a training set and a validation set at a ratio of 8:2.
[0043] In the photovoltaic power prediction method based on feature reconstruction and hybrid deep learning of the present invention, further, the hybrid deep model includes: connected layer by layer
[0044] An input layer that receives the concatenated enhanced weather data and the normalized original weather data as the input of the model;
[0045] A convolutional layer that extracts features from the input data of the model;
[0046] A batch normalization layer that normalizes the feature data extracted from the input data of each batch of the model;
[0047] A max pooling layer that reduces the normalized feature dimension by downsampling;
[0048] A multi-head self-attention layer that captures different levels of temporal dependencies for the pooled feature sequence;
[0049] A residual connection layer that adds the output features extracted by the convolutional layer and the output features of the multi-head self-attention layer element by element to form a residual connection;
[0050] A long short-term memory network layer, including two layers of long short-term memory networks. The first layer of long short-term memory network returns the output sequence of each time step in the sequence, providing an input with a time step dimension for the next layer of long short-term memory network. The second layer of long short-term memory network does not return the entire sequence, and outputs the state information of the last time step as the final feature;
[0051] A fully connected layer, which is used for further learning the features finally output by the long short-term memory network layer;
[0052] A Dropout layer, which discards neurons in the fully connected layer with a probability of 0.5;
[0053] An output layer, which outputs the predicted value of the photovoltaic power generation.
[0054] In the photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning of the present invention, further, the hybrid deep model training process uses an Adam optimizer and a Huber loss function to optimize the model.
[0055] The present invention also discloses a photovoltaic power generation prediction system based on feature reconstruction and hybrid deep learning, including:
[0056] A data acquisition module, which collects historical data of photovoltaic power generation and original weather data corresponding to the data time points;
[0057] A data enhancement module, which performs normalization processing on the original weather data, generates enhanced weather data by passing the normalized original weather data through a Fourier variational autoencoder FVAE, splices the enhanced weather data and the normalized original weather data in the feature dimension to form a data set, and divides all samples in the data set into a training set, a validation set and a test set;
[0058] A model construction module, which constructs a hybrid deep learning model of a hybrid convolutional neural network, an attention mechanism and a long short-term memory network. The model inputs the weather data of the data set formed by the data enhancement module and outputs the predicted value of the photovoltaic power generation. Among them, the training set is used to train the hybrid deep learning model, the validation set is used to optimize the model parameters, and the test set is used for model evaluation;
[0059] A photovoltaic correction module, which calibrates the sunshine state of the photovoltaic power station at each data time point according to the geographical location information of the photovoltaic power station and the corresponding data time point, and corrects the predicted value of the photovoltaic power generation output by the hybrid deep learning model according to the sunshine state at different data time points;
[0060] Use the hybrid deep learning model trained by the model construction module to perform actual prediction of the photovoltaic power generation.
[0061] The present invention has the following beneficial effects:
[0062] (1) Aiming at the problem that the lack of extraction of the periodic characteristics of photovoltaic data leads to the lack of physical rationality in the generated data, the present invention uses the Fourier variational autoencoder FVAE to decouple and reconstruct the frequency domain features of the weather data for predicting photovoltaic power generation, and performs frequency domain-time domain joint modeling using the Fourier variational autoencoder FVAE. The frequency domain features in the weather data are extracted through the fast Fourier transform FFT, and enhanced weather data is generated through the variational autoencoder VAE, enhancing the subsequent hybrid deep model's ability to analyze the complex meteorological-power correlation.
[0063] (2) The present invention constructs a hybrid deep model CNN-Attention-LSTM based on the convolutional neural network CNN, the attention mechanism Attention, and the long short-term memory network LSTM. The local meteorological features in the input weather data are extracted through the convolutional neural network CNN, the global dependencies in the features are captured by the attention mechanism Attention, and then the time series relationship of the weather data is modeled by the long short-term memory network LSTM, realizing the construction of a progressive modeling chain of "local features → global dependencies → time series evolution", solving the problem of limited modeling ability of a single model for the complex meteorological-power mapping relationship in weather data, and breaking through the representation bottleneck of a single model in predicting photovoltaic power generation relying on weather data.
[0064] (3) The present invention also introduces a physical correction mechanism for the sunshine state, physically constraining the prediction results of photovoltaic power generation, improving the consideration of the sunshine state in machine learning for predicting photovoltaic power generation at different geographical locations, and introducing an astronomical algorithm to dynamically generate a day-night mask for calibrating the sunshine state of a photovoltaic power station, ensuring that the prediction results strictly conform to the physical constraints of the operation of the photovoltaic system.
[0065] In summary, the photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning provided by the present invention enhances the time-frequency features in the weather data, uses a hybrid deep model to predict the photovoltaic power generation of a photovoltaic power station, and the prediction results are more accurate and conform to the physical laws of photovoltaic power generation.
[0066] The following further describes the present invention in conjunction with the accompanying drawings and specific embodiments. Description of the Drawings
[0067] Figure 1 It is a schematic flowchart of the photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning of the present invention.
[0068] Figure 2 It is a schematic structural diagram of the hybrid deep model of the present invention.
[0069] Figure 3 It is a comparison chart of the prediction results using the original weather data and the enhanced weather data in the embodiment. Specific Embodiments
[0070] Embodiment
[0071] Refer to Figure 1 , as shown in the figure is the specific process of the photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning of the present invention, which specifically includes the following steps:
[0072] S1. Collect historical data of photovoltaic power generation, as well as the original weather data corresponding to the data time points, and calibrate the sunshine state of the photovoltaic power station at each data time point according to the geographical location information of the photovoltaic power station and the corresponding data time points.
[0073] The data required for the present invention to predict the photovoltaic power generation include historical numerical weather forecasts, historical data of photovoltaic power generation, and geographical location information of the photovoltaic power station. The specific data information is as follows:
[0074] The historical numerical weather forecast is used as the original weather data for predicting the photovoltaic power generation, including the global horizontal irradiance, direct normal irradiance, temperature, humidity, wind speed, wind direction, and air pressure within the historical period of the photovoltaic power station. In this embodiment, the above original weather data is collected at a frequency of once every 15 minutes.
[0075] The historical data of photovoltaic power generation corresponds to the historical photovoltaic power generation of the photovoltaic power station at the meteorological forecast data time point.
[0076] The geographical location information of the photovoltaic power station is the geographical coordinates where the photovoltaic power station is located, including longitude and latitude.
[0077] For the sunshine state of different data time points of the photovoltaic power station, it is calibrated by the solar altitude angle at each data time point given the geographical location information. For the solar altitude angle greater than 0 degrees, it is calibrated as daytime, otherwise it is night. In this application, the python library ephem (version number: 4.1.6) is used to calculate the sunshine state at a specific time point given the latitude and longitude of the photovoltaic power station. The specific steps are as follows:
[0078] (1) Initialize the position of the photovoltaic power station: Use ephem.Observer() to initialize the photovoltaic power station object, and set the latitude (observer.lat) and longitude (observer.lon) of the photovoltaic power station.
[0079] (2) Time processing: Convert the input time column to the UTC time format.
[0080] (3) Sunshine state judgment: For each data time point, calculate the solar altitude angle (ephem.Sun(observer).alt). Judge whether the solar altitude angle is greater than 0 degrees. If it is greater than 0 degrees, calibrate the photovoltaic power station at this time point as daytime, otherwise calibrate it as night.
[0081] S2. Normalize the original weather data, generate enhanced weather data from the normalized original weather data through the Fourier variational autoencoder FVAE, splice the enhanced weather data and the normalized original weather data in the feature dimension to form a data set, and divide all samples in the data set into a training set, a validation set, and a test set.
[0082] To eliminate the scale differences between the features of the original weather data, in this embodiment, min-max normalization is used to normalize the original weather data, and the value of each feature is scaled to the range of [0, 1]. The formula is as follows:
[0083]
[0084] where X is the original weather data, X min is the minimum value in the original weather data, X max is the maximum value in the original weather data, X scaled is the normalized original weather data.
[0085] The generation of the enhanced weather data by the Fourier variational autoencoder FVAE is a process of original weather data → FVAE feature enhancement → enhanced data set. Through frequency domain feature extraction and data reconstruction, weather data features required for high-quality photovoltaic power prediction are generated, specifically including the following sub-steps:
[0086] S21. Data preprocessing and frequency domain transformation. Define the feature matrix X NWP of the normalized original weather data, X NWP ∈R N×T×D , that is, the normalized data X scaled , where N is the number of samples of the original weather data, T is the time step. According to the data collection frequency of every 15 minutes in this embodiment, T = 96, and D is the feature dimension of the original weather data. The original weather data in this embodiment includes global horizontal irradiance, direct normal irradiance, temperature, humidity, wind speed, wind direction, and air pressure. Therefore, D = 7.
[0087] The shapes of the feature matrix of the original weather data and the feature matrix of the enhanced weather data are both N×T×D, which is convenient for splicing in the feature dimension and the input shape of the hybrid deep learning model. The input shape of the Fourier variational autoencoder FVAE is N×D×T. After exchanging the time step and the feature dimension of X NWP , perform Fourier transform on the time series X d of each sample feature to generate the frequency domain
[0088]
[0089] Among them, B represents the batch size of the original weather data samples, C represents the complex domain of the normalized weather data, and F represents the Fourier transform operation. The calculation formula is:
[0090]
[0091] Among them, X k is the complex representation of the k-th frequency component, and X n is the input value at the n-th time step.
[0092] S22. Take the amplitudes |X freq |, |X freq | ∈ C B×D×T of all the characteristic frequency domains in the sample, input them into the encoder of the variational autoencoder, retain the frequency energy information, and map the input frequency domain amplitudes |X freq | to the latent space in the fully connected layer of the encoder. Obtain the latent space parameters through the following formula:
[0093] h1 = ReLU(W1|X freq | + b1) ∈ R B×D×128 .
[0094] h2 = ReLU(W2h1 + b2) ∈ R B×D×32 .
[0095] h1 and h2 respectively represent the outputs of the hidden layers of the encoder, that is, the mapped latent space. W1 and W2 are the weight matrices of the hidden layers of the encoder, b1 and b2 are the bias vectors of the hidden layers of the encoder, and R represents the real domain of the normalized weather data. Generate the latent variable z through the latent space parameters,
[0096] z = μ + σ ⊙ ∈, ∈ ~ N(0, I),
[0097] μ = W μ h2 + h μ ∈ R B×D×32 .
[0098] logσ 2 = W σ H2 + h σ ∈ R B×D×32 .
[0099] Among them, ⊙ is element-wise multiplication, ∈ is standard Gaussian noise, μ is the mean, logσ 2 is the log variance, W μ and W σ are respectively the weight matrices that map h2 to the mean and log variance, h μ and h σis the bias term added to the mean and log variance by h2. The latent variable learns an abstract representation of the weather data through the encoder network, reflecting the latent structure, pattern, or regularity in the input weather data.
[0100] S23. The decoder fully connected layer of the variational autoencoder reconstructs the frequency domain features from the latent variable z:
[0101] h3 = ReLU(W3z + b3) ∈ R B×D×64 ,
[0102] h4 = ReLU(W4h3 + b4) ∈ R B×D×128 .
[0103] h3 and h4 respectively represent the outputs of the decoder hidden layers, W3 and W4 are the weight matrices of the decoder hidden layers, b3 and b4 are the bias vectors of the decoder hidden layers. The frequency domain signal of the original weather data is converted back to the time domain through the inverse Fourier transform,
[0104] X recon = F -1 (h4) ∈ C B×D×T ,
[0105]
[0106] where F -1 represents the inverse Fourier transform, and X recon is the complex time domain signal converted back from h4 through the inverse Fourier transform F -1 . Real is the operation of taking the real part of the complex number. is the time domain data reconstructed for X recon .
[0107] S24. The output layer of the variational autoencoder uses the Sigmoid activation function to normalize the reconstructed time domain data:
[0108]
[0109] W o is the weight matrix of the Sigmoid activation function, and b o is the bias vector of the Sigmoid activation function. is the normalized reconstructed time domain data, and then the time steps and feature dimensions of are exchanged to obtain the enhanced weather data of the original weather data samples in this batch generated by the Fourier variational autoencoder FVAE.
[0110] S25. After processing all batches of original weather data samples, the feature matrix of the enhanced weather data is finally obtained
[0111] The Fourier variational autoencoder FVAE in this embodiment uses the reconstruction loss and the KL divergence to form the loss function, and the total loss is composed of the reconstruction loss and the KL divergence:
[0112] L total = L recon + β·L KL .
[0113] Among them, L total is the total loss, L recon is the reconstruction loss, L KL is the KL divergence, and β is the balancing hyperparameter, with the default β = 1.
[0114] Reconstruction loss (binary cross-entropy):
[0115]
[0116] B is the batch size of the original weather data samples, that is, the number of samples input into the Fourier variational autoencoder FVA E each time, T is the time step of the original weather data, representing the number of time steps of each sample, D is the feature dimension of the original weather data, representing the number of features at each time step, x itd is the true value of the d-th feature of the i-th original weather data sample at the t-th time step, is the enhanced reconstruction value of the d-th feature of the i-th original weather data sample at the t-th time step.
[0117] KL divergence (regularization term):
[0118]
[0119] The dimension of the latent space is 32, μ j is the mean of the j-th latent variable, is the variance of the j-th latent variable.
[0120] For the dataset after concatenating the enhanced weather data and the normalized original weather data, select a sample from the dataset as the test set, and divide the remaining samples into a training set and a validation set in a ratio of 8:2.
[0121] The samples in the dataset are divided based on time windows. Each sample represents one day and consists of 96 time points, with an interval of 15 minutes between each time point. Each time window contains multiple weather data features, which are divided into multiple samples in chronological order. Each sample contains 96 data points and each sample is a multi-dimensional value. The historical photovoltaic power generation data is also processed in the same way, that is, each sample contains 96 time points and each sample is a one-dimensional value. During the dataset division process, the total number of samples is first calculated. Then, according to the specified proportion of training set samples and the number of test set samples, the number of samples in the training set and the validation set is calculated. Specifically, the size of the test set is determined by the specified number of samples. The number of samples in the training set is the proportionally divided part excluding the number of test set samples, and the size of the validation set is the remaining samples excluding the training set and the test set. For example, if there are 11 days of data in the dataset, first, the last 1-day data sample is set aside as the test set, and then the remaining 10-day data samples are divided according to 8:2, that is, the first 8-day data samples are used as the training set, and the last 2-day data samples are used as the validation set. The experiment in this embodiment uses an 8:2 division method, and in actual applications, it may depend on the model performance.
[0122] S3. Construct a hybrid deep learning model combining a convolutional neural network, an attention mechanism, and a long short-term memory network. This model takes the weather data in the dataset in step S2 as input and outputs the predicted value of photovoltaic power generation. Among them, the hybrid deep learning model is trained using the training set, and the model parameters are optimized using the validation set.
[0123] Specifically, as Figure 2 shown, the hybrid deep model is a deep learning architecture that combines a convolutional neural network, an attention mechanism, and a long short-term memory network. It specifically includes an input layer, a convolutional layer, a batch normalization layer, a max pooling layer, a multi-head self-attention layer, a residual connection layer, a long short-term memory network layer, a fully connected layer, a Dropout layer, and an output layer.
[0124] The input layer accepts the concatenated enhanced weather data and the normalized original weather data as the input of the model. The input layer accepts an input X with a specified shape. In this embodiment that is, the enhanced weather data and the normalized original weather data X NWP are concatenated in the feature dimension as the input of the model. In this embodiment, the number of input samples in each training step is 32. The time step dimension is the number of time steps included in each sample, which is 96 steps in this application. The feature dimension is the number of features, which is 7 in historical numerical weather forecasting, and then 7 are generated by the Fourier variational autoencoder for enhanced weather data, so there are a total of 14. Therefore, the input dimension of the application is (32, 96, 14).
[0125] The convolutional layer has 128 filters to extract features from the input data of the model. The convolutional kernel size is 3, indicating that each convolutional operation involves a region of 3 time steps. The ReLU function is selected as the activation function to process non-linear features. The data padding method uses same padding to ensure that the output is consistent with the input in the spatial dimension and avoid boundary effects.
[0126] The batch normalization layer normalizes the feature data extracted from the input data of each batch of the model, improving the training stability and convergence speed of the model. Here, the normalization uses standard normalization to standardize the input data, accelerating the training process, improving the stability of the model, and enhancing the efficiency of gradient propagation by making the data have stable mean and variance.
[0127] The pooling size of the max pooling layer is 2, indicating that each pooling operation takes the maximum value of 2 time steps, reducing the dimension of the normalized features through downsampling.
[0128] The number of heads in the multi-head self-attention layer is 4, indicating that the pooled feature sequence is divided into 4 subspaces for parallel computing. The key dimension is 64, representing the feature dimension of each attention head, which is used to calculate the attention weights to capture time dependencies at different levels.
[0129] The residual connection layer adds the output features extracted by the convolutional layer and the output features of the multi-head self-attention layer element-wise to form a residual connection, which helps to alleviate the vanishing gradient problem in the training of deep networks and strengthen the information flow at the same time.
[0130] The long short-term memory network layer has 64 hidden units, including two layers of long short-term memory networks. The first layer of long short-term memory network returns the output sequence for each time step in the sequence, providing an input with a time step dimension for the next layer of long short-term memory network. The second layer of long short-term memory network does not return the entire sequence and outputs the state information of the last time step as the final feature.
[0131] The fully connected layer has 64 neurons to further learn the features finally output by the long short-term memory network layer. The ReLU function is used as the activation function to process the non-linear relationship between data.
[0132] The Dropout layer discards neurons in the fully connected layer with a probability of 0.5 to reduce the risk of overfitting.
[0133] The output layer has 96 neurons. The model outputs a vector containing 96 elements, which is the final photovoltaic power prediction result, predicting the photovoltaic power generation for 96 time steps within the next day, with each time step being 15 minutes.
[0134] The optimizer and loss function in the training process of the hybrid depth model are the Adam optimizer and the Huber loss function respectively. The Adam optimizer has the advantage of adaptive learning rate and can find the optimal solution more effectively during the training process. The Huber loss function, which combines the mean squared error and the absolute error, is used to process data containing outliers and can train the model more robustly.
[0135] The Huber loss function is defined as:
[0136]
[0137] where \(a = y - f(x)\) is the difference between the predicted value \(f(x)\) and the true value \(y\), and \(\delta\) is a threshold.
[0138] S4. Use the test set to input into the hybrid deep learning model, and correct the predicted value of the output photovoltaic power according to the sunshine state at different data time points calibrated in step S1. In the training stage of the hybrid depth model, the model receives weather data from the training set and the validation set as input and outputs the predicted value of the photovoltaic power. By comparing the predicted value output by the model with the actual photovoltaic power data (i.e., the uncorrected photovoltaic power), the model parameters are continuously adjusted and optimized. After the model training is completed, the test set is used to correct the predicted value of the photovoltaic power. At this time, the model is fixed and the parameters are no longer updated. The weather data in the test set is input into the trained hybrid depth model to obtain the predicted value of the photovoltaic power and then correct it. Specifically, the correction coefficient is set to 1 for the data time points where the sunshine state is judged to be daytime, and the correction coefficient is set to 0 for the data time points where the sunshine state is judged to be night. When predicting the output photovoltaic power of the test set, it is multiplied by the correction coefficient corresponding to the data time point. The predicted value of the photovoltaic power calibrated as daytime for the sunshine state is retained, and the predicted value of the photovoltaic power calibrated as night for the sunshine state is corrected to 0.
[0139] S5. Use the trained hybrid deep learning model to perform actual prediction of the photovoltaic power, and correct the predicted value of the output photovoltaic power by combining the sunshine state correction coefficient of the data time point during the actual prediction.
[0140] In practical applications, the present invention also discloses a photovoltaic power prediction system based on feature reconstruction and hybrid deep learning, including a data acquisition module, a data enhancement module, a model construction module, and a photovoltaic correction module.
[0141] The data acquisition module collects historical data of photovoltaic power generation and the original weather data at the corresponding data time points; the data enhancement module normalizes the original weather data, generates enhanced weather data from the normalized original weather data through the Fourier variational autoencoder FVAE, splices the enhanced weather data and the normalized original weather data in the feature dimension to form a data set, and divides all samples in the data set into a training set, a validation set, and a test set; the model construction module constructs a hybrid deep learning model of a hybrid convolutional neural network, an attention mechanism, and a long short-term memory network. This model inputs the weather data of the data set formed by the data enhancement module and outputs the predicted value of photovoltaic power generation. Among them, the hybrid deep learning model is trained using the training set, the model parameters are optimized using the validation set, and the model is evaluated by the test set; the photovoltaic correction module calibrates the sunshine state of the photovoltaic power station at each data time point according to the geographical location information of the photovoltaic power station and the corresponding data time point, and corrects the predicted value of photovoltaic power generation output by the hybrid deep learning model according to the sunshine state at different data time points; the trained hybrid deep learning model of the model construction module is used for actual prediction of photovoltaic power generation, and the predicted value of photovoltaic power generation output is corrected by the photovoltaic correction module in combination with the sunshine state correction coefficient of the data time point.
[0142] The technical effects of the present invention are elaborated in detail below through a specific application example of this embodiment.
[0143] This example collected the historical numerical weather forecasts and geographical location information of a power station in Hebei Province. The information included in the historical numerical weather forecasts includes data time, global horizontal irradiance, direct normal irradiance, temperature, humidity, wind speed, wind direction, and air pressure. The geographical location information includes longitude and latitude. The time range of the data is from January 1, 2019 to May 31, 2019. The data sampling frequency is 15 minutes.
[0144] Use the longitude and latitude in the geographical location information and the data time in the historical numerical weather forecasts to calculate whether each time point of the data time is in daylight. Normalize the historical numerical weather forecasts, then use the Fourier variational autoencoder FVAE to generate new enhanced weather data, and splice it with the historical numerical weather forecasts to form a new data set, that is, an enhanced data set. Use the data of the last day of the data set as the test set. Divide the data before the test set into a training set and a validation set, and the ratio of the training set to the validation set is 8:2.
[0145] Use the training set to train the hybrid deep model of this embodiment, adjust the model parameters according to the performance of the validation set, and use the test set for prediction.
[0146] According to the calibration of daylight hours, the predicted power that is not during daylight hours is corrected to 0. The following table shows the comparison before and after correction using the original dataset (i.e., the original weather data without enhancement by the Fourier variational autoencoder FVAE) and the enhanced dataset.
[0147]
[0148] According to the evaluation metrics, it can be shown that the enhanced dataset significantly improves the performance of the hybrid deep model in this embodiment by introducing more information, reduces the prediction errors (MSE and MAE), and improves the goodness of fit (R2) of the model. Although the power correction brings a small improvement, it still improves the prediction accuracy to a certain extent and is more in line with the actual photovoltaic power generation situation. The improvement of each index after correcting the power using the enhanced dataset is small, indicating that the enhanced dataset may already contain the periodic characteristics of the sunshine state. To visually display the prediction results, prediction graphs using the original features and enhanced features after correction are plotted in Figure 3 . As can be seen from Figure 3 , the use of the enhanced dataset improves the prediction accuracy of photovoltaic power generation compared to the original dataset. Especially in the prediction of the photovoltaic power generation peak, the effect is significant, and the accuracy of the photovoltaic power generation peak prediction is crucial for the efficient operation of the power system.
[0149] In this article, the orientation or positional relationship indicated by terms such as "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", "vertical", "horizontal", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the sake of clear expression of the technical solution and convenient description, so it cannot be construed as a limitation of the present invention.
[0150] In this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, and in addition to the listed elements, it may also include other elements not expressly listed.
[0151] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning, characterized by: The steps include: S1. Collect historical data of photovoltaic power generation and original weather data at corresponding data time points, and calibrate the sunshine status of the photovoltaic power station at each data time point according to the geographical location information of the photovoltaic power station; S2. Normalize the original weather data, generate enhanced weather data from the normalized original weather data through Fourier variational autoencoder FVAE, concatenate the enhanced weather data and the normalized original weather data in feature dimension to form a data set, and divide all samples in the data set into training set, validation set and test set; S3, constructing a hybrid deep learning model of a hybrid convolutional neural network, an attention mechanism, and a long short-term memory network, the model inputs the weather data of the data set in step S2, and outputs a photovoltaic power generation power prediction value, wherein the hybrid deep learning model is trained using the training set, and the model parameters are optimized using the validation set; S4, using the test set to input the hybrid deep learning model, and correcting the photovoltaic power prediction value at different data time points according to the sunshine state calibrated in step S1; S5. Use the trained hybrid deep learning model to perform actual prediction of photovoltaic power generation.
2. The photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning according to claim 1 is characterized in that: The original weather data in step S1 includes global horizontal irradiance, direct normal irradiance, temperature, humidity, wind speed, wind direction, air pressure, and historical data of photovoltaic power generation at corresponding time points collected at equal time intervals.
3. The photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning according to claim 1 is characterized in that: In step S1, the ephem library of Python is used to obtain the solar altitude angle at each data time point of the given geographical location information to calibrate the sunshine state of the photovoltaic power station. If the solar altitude angle is greater than 0 degrees, the sunshine state is calibrated as daytime, otherwise it is nighttime.
4. The photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning according to claim 3 is characterized in that: In the step S4, the photovoltaic power generation prediction value when the sunshine state is calibrated as daytime is retained, and the photovoltaic power generation prediction value when the sunshine state is calibrated as nighttime is corrected to 0.
5. The photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning according to claim 1 is characterized in that: In step S2, the generation of enhanced weather data by the Fourier variational autoencoder FVAE includes the following sub-steps: S21, data preprocessing and frequency domain transformation, define the characteristic matrix X of the normalized original weather data NWP , X NWP ∈R N ×T×D , where N is the number of samples of the original weather data, T is the time step of the original weather data, and D is the feature dimension of the original weather data. NWP After the time step and feature dimension are calculated for each sample feature time series X d Perform Fourier transform to generate frequency domain Where F represents the Fourier transform operation, B represents the batch size of the samples, and C represents the complex domain of the normalized weather data; S22, take the amplitude of all characteristic frequency domains in the sample |X freq |,|X freq |∈R B×D×T , the input frequency domain amplitude |X freq |The latent space parameters are obtained by mapping to the latent space through the following formula: h1=ReLU(W1|X freq |+b1)∈R B×D×128 、 <h2 style=";text-align:left;direction:ltr">h2 = ReLU(W2h1+b2)∈R<h2 style=";text-align:left;direction:ltr"> B×D×32 <h2 style=";text-align:left;direction:ltr"> , h1 and h2 represent the output of the encoder hidden layer, i.e., the latent space obtained by mapping. W1 and W2 are the weight matrices of the encoder hidden layer. b1 and b2 are the bias vectors of the encoder hidden layer. R represents the real number domain of the normalized weather data. ReLU represents the activation function. The latent variable z is generated through the latent space parameters. z=μ+σ⊙∈,∈~N(0,I), μ=W μ h2+h μ ∈R B×D×32 、 logσ 2 =W σ h2+h σ ∈R B×D×32 , Among them, ⊙ is element-by-element multiplication, ∈ is standard Gaussian noise, μ is the mean, logσ 2 is the logarithmic variance, W μ , W σ are the weight matrices that map h2 to the mean and log variance, respectively. μ 、h σ is a bias term that adds h2 to the mean and log variance; S23, the decoder of the variational autoencoder reconstructs frequency domain features from the latent variable z: <h2 style=";text-align:left;direction:ltr">h3 = ReLU(W3z+b3)∈R<h2 style=";text-align:left;direction:ltr"> B×D×64 <h2 style=";text-align:left;direction:ltr"> 、 h4=ReLU(W4h3+b4)∈R B×D×128 , h3 and h4 represent the output of the decoder hidden layer, respectively. W3 and W4 are the weight matrices of the decoder hidden layer. b3 and b4 are the bias vectors of the decoder hidden layer. The frequency domain signal of the original weather data is converted back to the time domain through the inverse Fourier transform. X recon =F -1 (h4)∈C B×D×T 、 Among them, F -1 represents the inverse Fourier transform, X recon is obtained by inverse Fourier transform F -1 The complex time domain signal converted back from h4, Real is the operation of taking the real part of the complex number, For X recon Reconstructed time domain data; S24, use the Sigmoid activation function to normalize and reconstruct the time domain data: W o is the weight matrix of the Sigmoid activation function, b o is the bias vector of the Sigmoid activation function, To normalize the reconstructed time domain data, then exchange The enhanced weather data of this batch of original weather data samples generated by Fourier variational autoencoder FVAE is obtained by the time step and feature dimension; S25. After processing all batches of original weather data samples, the feature matrix of enhanced weather data is finally obtained.
6. The photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning according to claim 5 is characterized in that: The Fourier variational autoencoder FVAE uses a loss function consisting of reconstruction loss and KL divergence.
7. The photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning according to claim 1 is characterized in that: In step S2, one sample is selected from the data set as a test set, and the remaining samples are divided into a training set and a validation set in a ratio of 8:
2.
8. The photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning according to claim 1 is characterized in that: The hybrid deep model includes layer-by-layer connections: The input layer receives the concatenated enhanced weather data and the normalized original weather data as the input of the model; Convolutional layers extract features from the model’s input data; Batch normalization layer, which normalizes the feature data extracted from each batch of model input data; The maximum pooling layer reduces the dimension of the normalized features by downsampling; Multi-head self-attention layer captures different levels of temporal dependencies of the pooled feature sequence; The residual connection layer adds the output features extracted by the convolutional layer and the output features of the multi-head self-attention layer element by element to form a residual connection; The LSTM layer includes two layers of LSTM. The first layer of LSTM returns the output sequence of each time step in the sequence, providing the next layer of LSTM with input with the time step dimension. The second layer of LSTM does not return the entire sequence, but outputs the state information of the last time step as the final feature. The fully connected layer is used to further learn the features of the final output of the long short-term memory network layer; Dropout layer, which discards neurons in the fully connected layer with a probability of 0.5; Output layer, outputs the predicted value of photovoltaic power generation.
9. The photovoltaic power generation prediction method based on feature reconstruction and hybrid deep learning according to claim 8 is characterized in that: The hybrid deep model training process uses the Adam optimizer and Huber loss function to perform model optimization.
10. A system using the photovoltaic power prediction method based on feature reconstruction and hybrid deep learning as claimed in any one of claims 1 to 9, characterized in that: include: Data acquisition module, which collects historical data of photovoltaic power generation and original weather data at the corresponding data time point; The data enhancement module normalizes the original weather data, generates enhanced weather data from the normalized original weather data through the Fourier variational autoencoder FVAE, concatenates the enhanced weather data and the normalized original weather data in the feature dimension to form a data set, and divides all samples in the data set into a training set, a validation set, and a test set; The model building module builds a hybrid deep learning model of a hybrid convolutional neural network, an attention mechanism, and a long short-term memory network. The model inputs the weather data of the data set formed by the data enhancement module and outputs the photovoltaic power generation prediction value. The hybrid deep learning model is trained using the training set, the model parameters are optimized using the validation set, and the model is evaluated using the test set. The photovoltaic correction module calibrates the sunshine status of the photovoltaic power station at each data time point according to the geographical location information of the photovoltaic power station and the corresponding data time point, and corrects the photovoltaic power generation power prediction value output by the hybrid deep learning model according to the sunshine status at different data time points; Use the hybrid deep learning model trained by the model building module to perform actual predictions of photovoltaic power generation.
Citation Information
Patent Citations
Mobile platform short-term photovoltaic power generation power prediction method and device based on weather type division
CN119135077A
Cited By
Method and system for predicting distributed photovoltaic output in changeable weather
CN120892843A
Multi-scale photovoltaic power prediction method and system fusing numerical weather forecast and physical information neural network
CN121150003A