Photovoltaic output prediction method and system based on conditional variation auto-encoder
Through the method based on the conditional variational autoencoder, the encoder and decoder are trained using timing meteorological data and control vectors, the problem of difficult to capture complex timing characteristics of photovoltaic output is solved, and high-precision prediction of photovoltaic power generation is achieved, and the power grid optimization and energy scheduling are supported.
Patent Information
- Application Number
- CN202510426596.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-25
AI Technical Summary
The prior art is difficult to effectively capture the complex timing characteristics of photovoltaic output, especially in probabilistic modeling, which leads to the volatility and uncertainty of photovoltaic power generation challenges to power system scheduling and planning.
Using a method based on conditional variational autoencoder, the encoder and decoder are trained using time-series meteorological data and control vectors, the meteorological data is converted into potential variables through the encoder, the decoder is used to generate new timing data, and photovoltaic output prediction is performed in combination with the HDKR model.
It can generate time series similar to actual weather data, accurately simulate the output of the photovoltaic system, improve the accuracy and reliability of photovoltaic power generation prediction, and is suitable for grid optimization and energy scheduling.
Smart Images

Figure CN120377237A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of new energy output simulation, and particularly relates to a photovoltaic output prediction method and system based on conditional variational autoencoder. Background Art
[0002] At present, photovoltaic power generation has become a key part of the global energy transformation. As a clean and renewable energy, photovoltaic power generation can significantly reduce greenhouse gas emissions and alleviate climate change problems. However, photovoltaic power generation is greatly affected by weather conditions. The volatility of factors such as solar radiation intensity and temperature makes the photovoltaic output highly random and uncertain, which poses challenges to the dispatching and planning of power systems. By accurately simulating the photovoltaic output, it is possible to effectively cope with the volatility and uncertainty of photovoltaic power generation, provide important basis for grid optimization, energy dispatching, reliability assessment and policy making, and thus enhance the stability and sustainable development ability of the power grid.
[0003] The characteristics of photovoltaic output are closely related to various meteorological factors such as temperature, humidity, wind speed, and solar radiation. There are complex non-linear and time-series dependence relationships among these factors. Traditional statistical models often have difficulty accurately describing these complex dynamic characteristics, especially in the case of non-linearity and high dimensions, and the performance of the models is not satisfactory. Therefore, the modeling and prediction of photovoltaic output face great challenges.
[0004] In recent years, the rapid development of deep learning technology has provided a new solution for photovoltaic output simulation. Deep learning models can capture the behavioral characteristics of photovoltaic power generation systems under different meteorological conditions and time periods by learning from a large amount of historical data, overcoming the limitations of traditional models. For example, deep generative models can synthesize real simulation data based on learning the characteristics of historical data, and can flexibly combine weather information, seasonal trends and regional characteristics to generate more accurate simulation results. However, the research on dynamically simulating photovoltaic output based on meteorological data is still in the exploration stage, and there are still many technical problems.
[0005] The main challenges of photovoltaic output simulation include the impact of complex weather changes on photovoltaic power generation, the dynamic changes of spatio-temporal characteristics, and the impact of extreme weather events on photovoltaic output. In addition, the output of the photovoltaic system is related to multiple factors, such as solar irradiance, cloud cover, geographical location, etc. The interaction of these factors increases the difficulty of simulation. The current models are still difficult to effectively capture the complex time-series characteristics of photovoltaic output, especially there are certain limitations in probability modeling. Summary of the Invention
[0006] The object of the present invention is to provide a photovoltaic output prediction method and system based on a conditional variational autoencoder, so as to overcome the problems that the existing technology is difficult to effectively capture the complex time series characteristics of photovoltaic output and has limitations in probability modeling.
[0007] To achieve the above object, the technical solution adopted by the present invention is as follows: A photovoltaic output prediction method based on a conditional variational autoencoder, comprising the following steps: S1, training an encoder and a decoder using time series meteorological data and a control vector, converting the time series meteorological data into a latent variable in the latent space using the encoder, and calculating new time series data by the decoder for the obtained latent variable and control features; S2, simulating the generated new time series data using the HDKR model to obtain a simulated photovoltaic processing sequence.
[0008] Preferably, the data of each time step in the time series meteorological data includes multiple features, , where is the feature dimension of each time step.
[0009] Preferably, the control vector includes date, longitude and latitude, and weather data of the previous moment.
[0010] Preferably, using the encoder to convert the input time series data into a latent variable in the latent space , and using the decoder to generate new time series data according to the latent variable and control features .
[0011] Preferably, the hidden state of each time step generated by the decoder passes through a fully connected layer to generate the final output: (1.9) Wherein, is the generated output of the th time step, is the weight matrix, is the bias term, is the hidden state of the decoder, and the decoder outputs the prediction result of the entire time series: (1.10) Each corresponds to the predicted value of a time step.
[0012] Preferably, according to the HDKR model, calculate the irradiance, and finally calculate the output of the photovoltaic: (1.14) In the formula, is the total irradiance acting on the photovoltaic array during a period, ; , , are three components of, corresponding to the direct irradiance component, the sky diffuse component and the ground reflection component respectively, ; , are respectively the direct irradiance and the sky diffuse irradiance during the period of, ; , is the extraterrestrial horizontal irradiance during the period of, ; RB is the ratio of the inclined plane beam irradiance to the horizontal plane beam irradiance; is the installation inclination angle of the solar panel; , is the local total irradiance during the period of, ; is the ground reflection coefficient, generally taken as 0.2.
[0013] Preferably, according to the irradiance the output of the photovoltaic array can be calculated: (1.15) In the formula, is the photovoltaic output corresponding to the irradiance , is the rated photovoltaic output, kW; is the derating factor; is the irradiance under the standard test environment, .
[0014] A photovoltaic output prediction system based on conditional variational autoencoders, comprising a re-encoding module and a prediction module: The re-encoding module uses the time series meteorological data and the control vector to train the encoder and the decoder, uses the encoder to convert the time series meteorological data into a latent variable in the latent space, and uses the decoder to calculate the obtained latent variable and the control features to obtain new time series data; The prediction module uses the HDKR model to simulate the generated new time series data to obtain a simulated photovoltaic processing sequence.
[0015] Preferably, the data of each time step in the time series meteorological data contains multiple features, , where is the feature dimension of each time step.
[0016] Preferably, the control vector includes date, longitude and latitude, and weather data at the previous moment; the input time series data is converted into a latent variable in the latent space by using an encoder and a new time series data is generated by using a decoder according to the latent variable and control features .
[0017] Compared with the prior art, the present invention has the following beneficial technical effects: A photovoltaic output prediction method based on a conditional variational autoencoder according to the present invention uses time series meteorological data and a control vector to train an encoder and a decoder, converts the time series meteorological data into a latent variable in the latent space by using the encoder, calculates a new time series data by using the decoder for the obtained latent variable and control features, simulates the generated new time series data by using the HDKR model to obtain a simulated photovoltaic processing sequence, trains through meteorological data and control features, can generate time series data similar to actual weather data, and finally predicts the photovoltaic power through the HDKR model. The present invention can effectively simulate the output of a photovoltaic system and has a wide application prospect. Description of the Drawings
[0018] Figure 1 is a schematic flowchart of a photovoltaic output prediction method based on a conditional variational autoencoder in an embodiment of the present invention.
[0019] Figure 2 is to reduce the dimension and visualize the simulated sky diffuse radiation data and the original data in an embodiment of the present invention.
[0020] Figure 3 is the random simulation data of the photovoltaic output in one year in an embodiment of the present invention.
[0021] Figure 4 is the random simulation data of the photovoltaic output in one day in an embodiment of the present invention.
[0022] Figure 5 is a comparison diagram of reducing the dimension and visualizing the simulated direct irradiation data and the original data in an embodiment of the present invention. Detailed Embodiments
[0023] To enable those skilled in the art to better understand the solution of the present invention, the following will clearly and completely describe the technical solution in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data used in appropriate cases can be interchanged so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0025] As Figure 1 shown, the present invention provides a photovoltaic output prediction method based on conditional variational autoencoder for generating high-quality simulated photovoltaic output data, which specifically includes the following steps: S1. Train an encoder and a decoder using time series meteorological data and a control vector. Use the encoder to convert the time series meteorological data into a latent variable in the latent space, and use the decoder to calculate the obtained latent variable and control features to obtain new time series data; S2. Use the HDKR model to simulate the generated new time series data to obtain a simulated photovoltaic processing sequence.
[0026] In the specific embodiment of the present invention, the time series meteorological data and the control vector are used to train the encoder and the decoder. The data at each time step contains multiple features. Among them is the feature dimension at each time step. The control vector includes date, longitude and latitude, and weather data of the previous moment. The control vector is used as input to the decoder to generate controllable meteorological data when generating simulated data.
[0027] Specifically, the data at each time step includes temperature, humidity, and wind speed.
[0028] In a specific embodiment of the present invention, an encoder is used to convert the input sequential data into a latent variable in the latent space , and this latent variable can be used to generate new data. A GRU (Gated Recurrent Unit) is used to process the sequential data, which can capture the sequential dependencies in the input data. The shape of the input data is , that is, there are sequences in each batch of data, the length of each sequence is , and the feature dimension of each time step is . The role of the gated recurrent unit is to process the sequential data and capture the sequential dependencies therein. The hidden state at each time step is calculated by the following formula: (1.1) (1.2) (1.3) (1.4) where: is the reset gate, which is used to control the degree of combination of the input at the current time step and the hidden state at the previous time step. is the update gate, which is used to control the weighted ratio between the candidate hidden state at the current time step and the hidden state at the previous time step. is the candidate hidden state, which is calculated from the current input and the hidden state at the previous time step. is the hidden state at the current time step, which is the weighted sum of the candidate hidden state at the current time step and the hidden state at the previous time step.
[0029] Calculate the mean and the standard deviation . After the output of the GRU layer, the mean and the standard deviation of the latent variable are calculated through a fully connected layer. These two parameters determine the Gaussian distribution in the latent space: (1.5) (1.6) where: is the hidden state of the last time step in the output of the GRU layer, which contains the information of the entire input sequence. and are trainable weight matrices, and are bias terms. In order to enable the model to perform end-to-end backpropagation, CVAE adopts the reparameterization trick. By sampling the noise , the latent variables can be obtained : (1.7) where is the noise sampled from the standard normal distribution, and are the mean and standard deviation obtained from the encoder.
[0030] The goal of this application using the decoder is to generate new time series data based on the latent variable and control features (such as date, weather data at the previous moment) ; the decoder also uses GRU to process the time series data and generates the output for each time step through a fully connected layer. The dimension of the control feature is , and the input of the decoder is: (1.8) Here, has the shape of , and the control feature has the shape of . The decoder uses GRU to generate the output for each time step. The hidden state at each time step is jointly determined by the hidden state of the previous time step and the current input (including the latent variable and control features). The hidden state generated by the decoder at each time step passes through a fully connected layer to generate the final output: (1.9) where is the generated output at the th time step, is the weight matrix, is the bias term, is the hidden state of the decoder.
[0031] Finally, the decoder outputs the prediction results for the entire time series: (1.10) Each corresponds to the predicted value at one time step.
[0032] Calculate the loss function. The loss function of CVAE consists of two parts: Reconstruction loss: Measures the difference between the generated sequence and the real sequence. Usually, the mean squared error (MSE) is used: (1.11) KL divergence loss: Measures the difference between the distribution of the latent variable and the standard normal distribution: (1.12) Total loss: The total loss is the weighted sum of the reconstruction loss and the KL divergence loss: (1.13) where is a hyperparameter that adjusts the weights of the reconstruction loss and the KL divergence loss.
[0033] According to the HDKR model, the irradiation amount is calculated, and finally the output power of the photovoltaic is calculated: (1.14) In the formula, is the total irradiation amount acting on the photovoltaic array in the time period, ; , , are the three components of, corresponding to the direct irradiation component, the sky diffuse component, and the ground reflection component respectively, ; , are respectively the direct irradiation amount and the sky diffuse irradiation amount in the time period, ; , is the extraterrestrial horizontal irradiation amount in the time period, ; RB is the ratio of the inclined plane beam irradiation to the horizontal plane beam irradiation; is the installation inclination angle of the panel; , is the local total irradiation amount in the time period, ; is the ground reflection coefficient, generally taken as 0.2. According to the irradiation amount the output power of the photovoltaic array can be calculated: (1.15) In the formula, is the photovoltaic output power corresponding to the irradiation amount , is the rated photovoltaic output power, kW; is the derating factor; is the irradiation amount under the standard test environment, .
[0034] Embodiment During the training of the present invention, the input time-series meteorological data and the control vector are used to train the encoder and the decoder. The meteorological data includes: temperature, dew point temperature, wind direction, wind speed, sea level pressure, direct irradiation amount, sky diffuse irradiation amount, time stamp, It contains longitude and latitude, date, and weather characteristics at the previous moment. Output meteorological data that is consistent with the input. When the algorithm is applied, the input is used to generate controllable meteorological data, and output simulated sequential meteorological data.
[0035] Such as Figure 5 shown, the t-SNE algorithm is used to reduce the dimension and visualize the directly irradiated amount data and the original data generated by simulation. The blue dots in the figure represent the original data, and the red dots represent the simulated data. It can be seen from the results that the distribution of the simulated data is relatively similar to that of the original data, indicating that the generation model performs well in capturing the characteristics and distribution of the original data. This shows that the model can better reconstruct the latent structure of the data and has certain practical application value; as Figure 2 shown, the t-SNE algorithm is used to reduce the dimension and visualize the sky scattered amount data and the original data generated by simulation; the blue dots in the figure represent the original data, and the red dots represent the simulated data.
[0036] Use the encoder to convert the input sequential data into a latent variable in the latent space , and this latent variable can be used to generate new data; use GRU to process the sequential data, which can capture the sequential dependencies in the input data. The shape of the input data is , that is, there are sequences in each batch of data, the length of each sequence is , and the feature dimension of each time step is .
[0037] Calculate the mean and the standard deviation . After the output of the GRU layer, calculate the mean and the standard deviation of the latent variable through a fully connected layer. These two parameters determine the Gaussian distribution in the latent space: (1.5) (1.6) Where: is the hidden state of the last time step of the GRU layer output, which contains the information of the entire input sequence. and are trainable weight matrices, and are bias terms. In order to enable the model to perform end-to-end backpropagation, CVAE adopts the reparameterization trick.
[0038] The goal of using the decoder is to generate new data according to the latent variable and the control features Generate new time-series data. The decoder also uses GRU to process the time-series data and generates the output for each time step through a fully connected layer. The dimension of the control feature is , and the input to the decoder is:
[0039] Here, has a shape of , and the control feature has a shape of . The decoder uses GRU to generate the output for each time step. The hidden state at each time step is jointly determined by the hidden state of the previous time step and the current input (including the latent variable and the control feature).
[0040] According to the HDKR model, calculate the irradiation amount and finally calculate the output of the photovoltaic:
[0041] In the formula, is the total irradiation amount acting on the photovoltaic array during the period, , , are three components of , corresponding to the direct irradiation component, the sky diffuse component, and the ground reflection component respectively, , are respectively the direct irradiation amount and the sky diffuse irradiation amount during the period, , is the extraterrestrial horizontal irradiation amount during the period; RB is the ratio of the inclined plane beam irradiation to the horizontal plane beam irradiation; is the installation inclination angle of the panel; , is the local total irradiation amount during the period, is the ground reflection coefficient, generally taken as 0.2. According to the irradiation amount the output of the photovoltaic array can be calculated:
[0042] In the formula, is the photovoltaic output corresponding to the irradiation amount , is the rated photovoltaic output, kW; is the derating factor; is the irradiation amount under the standard test environment, .
[0043] The present invention conducts stochastic simulation on the photovoltaic output for one year. The data is as Figure 3 shown. It can be seen that the photovoltaic simulation data generated by the CVAE model can better reproduce the characteristics of historical data, demonstrating the model's ability to capture the randomness and uncertainty of photovoltaic output, indicating that the model can relatively accurately restore the changes in photovoltaic output. For the stochastic simulation data of the photovoltaic output for one day, as Figure 4 shown. It can be seen that the photovoltaic simulation data generated by the CVAE model can better reproduce the characteristics of historical data, with the output being 0 when there is no sunlight in the morning and evening, and reaching the peak at noon, which conforms to our general common sense.
[0044] In the specific implementation manner of the present invention, a photovoltaic output prediction system based on a conditional variational autoencoder is provided, including a re-encoding module and a prediction module: The re-encoding module trains an encoder and a decoder using time-series meteorological data and a control vector. The encoder is used to convert the time-series meteorological data into a latent variable in the latent space, and the decoder calculates new time-series data using the obtained latent variable and control features; The prediction module uses the HDKR model to simulate the generated new time-series data to obtain a simulated photovoltaic processing sequence.
[0045] By introducing meteorological data, the present invention can effectively capture the power output change law of the photovoltaic system in different time periods. The simulation results show the real sunlight intensity fluctuation characteristics and have high accuracy. This provides a reliable basis for photovoltaic power generation prediction, especially in the case of lack of actual measurement data, and can generate relatively accurate simulation results.
Claims
1. A photovoltaic output prediction method based on conditional variational autoencoder, characterized in that, Including the following steps: S1. Train an encoder and a decoder using time-series meteorological data and a control vector. Use the encoder to convert the time-series meteorological data into a latent variable in the latent space, and use the decoder to calculate new time-series data based on the obtained latent variable and control features; S2. Use the HDKR model to simulate the generated new time-series data to obtain a simulated photovoltaic processing sequence.
2. The photovoltaic output prediction method based on conditional variational autoencoder according to claim 1, wherein The data at each time step in the time series meteorological data contains multiple features, , where is the feature dimension at each time step.
3. A photovoltaic output power prediction method based on conditional variational autoencoder according to claim 1, characterized in that Control vector Includes date, longitude and latitude, and weather data at the previous moment.
4. A photovoltaic output power prediction method based on conditional variational autoencoder according to claim 1, characterized in that Use an encoder to convert the input time series data into a latent variable in the latent space , and use a decoder to generate new time series data based on the latent variable and the control feature .
5. A photovoltaic output power prediction method based on conditional variational autoencoder according to claim 4, characterized in that The hidden state at each time step generated by the decoder passes through a fully connected layer to generate the final output: Among them, is the generated output at the th time step, is the weight matrix, is the bias term, is the hidden state of the decoder, and the decoder outputs the prediction results for the entire time series: Each corresponds to the predicted value for one time step.
6. A photovoltaic output prediction method based on conditional variational autoencoder according to claim 1, characterized in that, According to the HDKR model, calculate the irradiance and finally calculate the photovoltaic output: Wherein, is the total irradiance acting on the photovoltaic array during a time period, ; , , are the three components of , corresponding to the direct irradiance component, the sky diffuse component and the ground reflected component respectively, ; , are respectively the direct irradiance and the sky diffuse irradiance during the time period of , ; , is the extraterrestrial horizontal irradiance during the time period of , ; RB is the ratio of the beam irradiance on the inclined plane to the beam irradiance on the horizontal plane; is the installation tilt angle of the solar panel; , is the local total irradiance during the time period of , ; is the ground reflectivity, generally taken as 0.
2.
7. A photovoltaic output prediction method based on conditional variational autoencoder according to claim 6, characterized in that According to the irradiation dose the output power of the photovoltaic array can be calculated as follows: In the formula, is the irradiation dose corresponding to the PV output is the rated PV output, in kW; is the derating factor; is the irradiation dose under standard test conditions .
8. A photovoltaic output prediction system based on conditional variational autoencoder, characterized in that, Including a recoding module and a prediction module: Recoding module: Train an encoder and a decoder using time-series meteorological data and a control vector. Use the encoder to convert the time-series meteorological data into a latent variable in the latent space, and use the decoder to calculate new time-series data based on the obtained latent variable and control features; Prediction module: Use the HDKR model to simulate the generated new time-series data to obtain a simulated photovoltaic processing sequence.
9. A photovoltaic output prediction system based on a conditional variational autoencoder according to claim 8, characterized in that The data for each time step in the time-series meteorological data contains multiple features, , where is the feature dimension for each time step.
10. A photovoltaic output prediction system based on a conditional variational autoencoder according to claim 8, characterized in that, Control vector including date, longitude and latitude, and weather data at the previous moment; using an encoder to convert the input time series data into a latent variable in the latent space , and using a decoder to generate new time series data according to the latent variable and control features .
Citation Information
Cited By
Photovoltaic data anomaly detection method and system based on time sequence variation auto-encoder
CN121188360A