Photovoltaic power generation short-term power prediction method based on physical probability flow generation model
By using a physical probability flow generation model, combined with continuous-time normalized flow and adaptive step-size numerical integration algorithm, the problem of insufficient fusion of physical laws and data features in existing photovoltaic power generation short-term power prediction is solved, achieving high-precision photovoltaic power generation short-term power prediction that is adaptable to extreme weather and new power plant deployments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-03-13
AI Technical Summary
Existing methods for short-term photovoltaic power generation forecasting are unable to fully integrate physical laws and complex data characteristics, resulting in a large deviation between the forecast results and the actual power. This fails to meet the grid's accuracy requirements for photovoltaic power generation grid connection, especially under extreme weather conditions where the error increases significantly. Furthermore, the zero-sample migration capability is weak, making it difficult to quickly deploy new power plants.
A method based on a physical probability flow generation model is adopted. The constraints of the photovoltaic physical model are encoded into the velocity field of the probability flow through a continuous-time normalized flow framework to construct a velocity field network model. Combined with a decoder network, a physical constraint encoded flow model is constructed. A staged training strategy, a hybrid loss function and a zero-sample transfer strategy are used, combined with an adaptive step-size numerical integration algorithm for prediction.
It significantly improves the accuracy and reliability of short-term power prediction for photovoltaic power generation, reduces the deviation between the prediction results and the actual power, enhances the model's adaptability to new power plants and the prediction accuracy under extreme weather conditions, and meets the grid connection requirements.
Smart Images

Figure CN121664104A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic power generation technology, and in particular to a method for short-term power prediction of photovoltaic power generation based on a physical probability flow generation model. Background Technology
[0002] With the global energy structure transformation and the advancement of carbon neutrality goals, photovoltaic (PV) power generation has developed rapidly as an important form of renewable energy. However, the intermittency and randomness of PV power generation pose significant challenges to the safe and stable operation of the power grid. Accurate short-term power forecasting of PV power generation is a key support for grid dispatch, resource optimization, and electricity market trading, and has become one of the core technologies of modern energy system management.
[0003] Existing photovoltaic (PV) power prediction methods are mainly classified into three categories: statistical methods, physical methods, and hybrid methods. Early statistical methods relied on traditional time series analysis models, which are computationally simple but struggle to handle nonlinear relationships and complex weather changes, resulting in limited prediction accuracy. Subsequent developments in machine learning and deep learning methods, while capable of uncovering hidden patterns in historical data, suffer from a lack of physical interpretability and perform poorly in extreme weather and data-sparse scenarios. Physical methods, based on the physical principles of PV power generation, construct models by establishing deterministic relationships between solar radiation, battery temperature, and output power. They possess good interpretability and generalization capabilities, making them suitable for new power plants or scenarios with insufficient data. However, they rely on detailed system parameters and struggle to accurately characterize the dynamic characteristics of PV systems under complex weather conditions, especially exhibiting significant prediction errors when cloud cover changes rapidly. Hybrid methods attempt to combine the advantages of statistical and physical methods. They typically obtain preliminary prediction results through physical models and then correct errors using statistical or machine learning methods. However, current technologies often use simple series or parallel structures for physical knowledge and data-driven models, lacking deep integration mechanisms and failing to fully leverage the synergistic effects of both.
[0004] In recent years, deep generative models have been increasingly applied to photovoltaic (PV) power prediction. Traditional generative models and normalized flow models primarily focus on fitting data distributions, neglecting the physical constraints of the PV system. Furthermore, traditional normalized flow models employ discrete transformation sequences, making it difficult to naturally integrate continuous physical constraints and resulting in high computational complexity. Continuous normalized flow, as a novel form of normalized flow, defines a continuous transformation process of variables through ordinary differential equations, providing a new approach to the integration of physical knowledge. However, current applications of continuous normalized flow are concentrated in computer vision and natural language processing, with research in PV power prediction still in its early stages. Existing prediction methods generally suffer from key shortcomings: insufficient quantification of prediction uncertainty, with most only outputting point prediction results and failing to effectively assess prediction risks; poor adaptability to extreme weather, with errors significantly increasing in scenarios such as rapid cloud changes and transitions between cloudy and rainy weather; and weak zero-sample transferability, making direct application to new power plants difficult, requiring lengthy data collection and model retraining processes, thus impacting grid connection efficiency. Meanwhile, the grid's requirements for photovoltaic power generation grid connection are constantly increasing, and the demand for ultra-short-term forecast accuracy and rapid deployment of forecast models for new power plants is becoming increasingly urgent. Existing methods are unable to fully integrate physical laws and complex data characteristics, resulting in large deviations between forecast results and actual power, which cannot meet the needs of practical applications.
[0005] Chinese Patent Publication No. CN118822036A discloses a short-term photovoltaic power prediction method based on a physical model and Informer, including: Step 1, loading photovoltaic power generation and meteorological data from a data source and cleaning the data; Step 2, obtaining direct and diffuse radiation through a physical model and normalizing the data; Step 3, using the K-means clustering algorithm to divide the data into three categories: sunny, cloudy, and rainy; Step 4, inputting the three categories of data from the training set into the prediction model for training to obtain prediction models for the corresponding weather types; Step 5, feeding the test set into the corresponding model for prediction and inverse normalizing to obtain the prediction result. This scheme only divides the data into three weather categories using K-means clustering and trains the Informer model separately, making it difficult to fully integrate physical laws and complex data characteristics, resulting in a large deviation between the prediction result and the actual power, thus reducing the accuracy of short-term photovoltaic power prediction. Summary of the Invention
[0006] To address this issue, the present invention provides a method for short-term photovoltaic power generation prediction based on a physical probability flow generation model. This method overcomes the problem in existing technologies where it is difficult to fully integrate physical laws and complex data characteristics, resulting in a large deviation between the prediction results and the actual power, which reduces the accuracy of short-term photovoltaic power generation prediction.
[0007] To achieve the above objectives, this invention provides a method for short-term photovoltaic power generation prediction based on a physical probability flow generation model, comprising the following steps: S1. Collect historical power data and historical meteorological data of photovoltaic power stations to obtain photovoltaic power station data, and standardize the photovoltaic power generation data to obtain standardized photovoltaic power station data. Label the standardized photovoltaic power station data to obtain a photovoltaic power station data feature set, which includes a data training set, a data validation set, and a data test set. S2. Based on the continuous-time normalized flow framework, the photovoltaic physical model constraints are encoded into the velocity field of the probability flow to obtain the velocity field network model. The velocity field network model is then combined with the decoder network to obtain the physical constraint encoded flow model. S3. Construct a physical constraint loss function, and then construct a hybrid loss function based on the physical constraint loss function and the data fitting objective. S4. Input the data training set into the physical constraint coding flow model, train the physical constraint coding flow model based on the phased training strategy, physical constraint loss function and hybrid loss function to obtain the trained model, and adjust the parameters of the trained model according to the data validation set to obtain the parameter-adjusted model. Input the data test set into the parameter-adjusted model, and test the parameter-adjusted model based on the zero-sample transfer strategy and uncertainty quantification evaluation strategy. When the prediction accuracy of the parameter-adjusted model on the data test set reaches the preset prediction accuracy, output the photovoltaic power generation short-term power prediction model. S5. Collect meteorological data and system parameters of the target photovoltaic power station for the forecast period to obtain the dataset to be predicted, and standardize the dataset to be predicted to obtain a standardized dataset to be predicted. S6. Input the standardized dataset to be predicted into the photovoltaic power generation short-term power prediction model, solve the latent variable space in the photovoltaic power generation short-term power prediction model through the adaptive step size numerical integration algorithm, obtain multiple endpoint latent variables, and convert each endpoint latent variable into the corresponding photovoltaic power generation short-term power.
[0008] Compared with the prior art, the beneficial effects of this application are as follows: By encoding the constraints of the photovoltaic physical model into the velocity field of the probability flow based on a continuous-time normalized flow framework, a velocity field network model is obtained. This velocity field network model is then combined with a decoder network to form a physical constraint encoded flow model. This deeply embeds the core laws of the photovoltaic physical model into the model architecture. Simultaneously, a hybrid loss function is constructed, incorporating both physical constraint loss and data fitting objectives, allowing the training of the physical constraint encoded flow model to simultaneously consider adherence to physical laws and the learning of complex data features. A phased training strategy is employed. The training data set is input into the physical constraint encoded flow model to obtain the trained model. Then, the parameters of the trained model are adjusted using a data validation set to obtain the parameter-adjusted model. This allows for continuous optimization of the fusion effect between physical laws and data features through data feedback, significantly reducing the deviation between predicted results and actual power, and improving the accuracy of short-term photovoltaic power prediction.
[0009] By adjusting the input parameters of the data test set and testing the model based on a zero-sample migration strategy and an uncertainty quantification evaluation strategy, the physical constraint coding flow model is ensured to output a short-term photovoltaic power prediction model after achieving a preset prediction accuracy. This strengthens the fusion and adaptability of physical laws and complex data features from a performance verification perspective. In the prediction phase, a standardized dataset to be predicted is input into the short-term photovoltaic power prediction model. An adaptive step-size numerical integration algorithm is used to accurately solve the latent variable space in the model, obtaining multiple endpoint latent variables. These latent variables are then converted into corresponding short-term photovoltaic power. This adaptively captures the dynamic correlation between data features and physical constraints, further reducing prediction bias and ensuring the accuracy of short-term photovoltaic power prediction. This effectively solves the prediction accuracy problem caused by insufficient fusion of physical laws and complex data features.
[0010] Furthermore, S2 includes the following steps: S21. By defining the continuous transformation path of the latent variable over time through ordinary differential equations, a continuous-time normalized flow framework is obtained, wherein the mathematical expression of the continuous-time normalized flow framework is: In the formula, Indicates time The latent variable state at that location, , Represents the velocity field function, Represents a condition variable; S22. The velocity field function in the continuous-time normalized flow framework is divided into a basic physical constraint part and a self-attention enhancement part to obtain a velocity field network model, where the condition variables... The condition variables are determined by the physical parameters in the photovoltaic power generation process. The mathematical expression is: In the formula, Indicates predicted power. This represents the system efficiency factor. This indicates the rated power under preset standard test conditions. Indicates the current irradiance. This indicates the irradiance under preset standard test conditions. Indicates the power temperature coefficient. Indicates the current battery temperature. This indicates the temperature under preset standard test conditions; Velocity field network model The mathematical expression is: In the formula, Representing latent variables, This represents the fundamental physical constraints. It includes four fully connected layers, each analyzed using the Swish activation function. , This indicates the part that enhances self-attention. , This represents a multilayer perceptron consisting of two fully connected networks. This indicates a multi-head attention mechanism. This represents the weight matrix used to generate the query matrix. This represents the weight matrix used to generate the key matrix. This represents the weight matrix used to generate the value matrix; S23. Construct a decoder network at the output of the velocity field network model, and map the latent variable space to the photovoltaic power prediction space through the decoder network to obtain the physical constraint coding flow model. The mathematical expression for mapping the latent variable space to the photovoltaic power prediction space is as follows: , This represents the predicted photovoltaic power value. The latent variable representing the endpoint of the probability flow. This represents the decoder network.
[0011] In this scheme, a continuous-time normalized flow framework is constructed by defining the continuous transformation path of latent variables through ordinary differential equations, which can accurately characterize the changes of latent variables over time. The velocity field function is divided into a basic physical constraint part and a self-attention enhancement part, and conditional variables are determined in combination with photovoltaic physical parameters, taking into account both physical laws and data characteristics. A decoder network is constructed at the output of the velocity field network model to decode and map the latent variable space to the photovoltaic power prediction space, thus constructing a physical constraint encoded flow model, which can effectively improve the accuracy of photovoltaic power prediction.
[0012] Furthermore, in step S23, the process of constructing the physical constraint coding flow model also includes calculating variable conditions. The power prediction probability density is given below, wherein the mathematical expression for the power prediction probability density is: In the formula, Representing condition variables The power prediction probability density is as follows. Indicates in condition variable Logarithmic power prediction probability density This represents the probability density function of the standard normal distribution. This represents the trace of the Jacobian matrix of the velocity field function with respect to the latent variables.
[0013] In this scheme, by calculating the power prediction probability density under variable conditions during the construction of the physical constraint coding flow model, and combining the standard normal distribution probability density and the trace of the velocity field function on the latent variable Jacobian matrix, the distribution of photovoltaic power prediction under specific condition variables can be more accurately characterized, thereby improving the accuracy and reliability of photovoltaic power prediction.
[0014] Furthermore, in S3, the hybrid loss function The mathematical expression is: In the formula, Represents the true data distribution. Represents the expected value of the true data distribution. Indicates the physical constraint weight coefficient. Represents the physical constraint loss function. , This represents the expectation of the latent variables, state, and time. Denotes the square of the L2 norm. This represents the physical residual function.
[0015] In this scheme, by adopting a hybrid loss function that includes a logarithmic power prediction term and a physical constraint loss term, and by utilizing factors such as the expected distribution of real data and the weight coefficients of physical constraints, physical constraints can be effectively incorporated while optimizing power prediction, thereby improving the accuracy and physical rationality of the model prediction.
[0016] Furthermore, in step S4, the implementation process of the phased training strategy includes the following steps: Step A1: Construct a pre-training dataset containing theoretical power values based on the photovoltaic physical model. Input the pre-training dataset into the physical constraint coding flow model. Pre-train the physical constraint coding flow model according to the physical constraint loss function. Perform gradient clipping analysis during the pre-training process. When the first gradient norm of the pre-trained physical constraint coding flow model exceeds the preset gradient clipping threshold, clip the gradient vector of the pre-trained physical constraint coding flow model to obtain the pre-trained model. Step A2: Obtain real observation data and standardize the real observation data to obtain standardized real observation data. Input the data training set and standardized real observation data into the pre-trained model. Perform global optimization training on the pre-trained model based on the hybrid loss function. During the global optimization training process, perform gradient clipping analysis. When the second gradient norm of the pre-trained model after global optimization training exceeds the preset gradient clipping threshold, clip the gradient vector of the pre-trained model after global optimization training to obtain the global optimized model. Step A3: Input standardized real observation data into the global optimization model, adjust and train the global optimization model, and perform gradient clipping analysis during the adjustment and training process. When the third gradient norm of the adjusted and trained global optimization model exceeds the preset gradient clipping threshold, clip the gradient vector of the adjusted and trained global optimization model to obtain the trained model.
[0017] In this scheme, a pre-training dataset is constructed based on a photovoltaic physical model. The physical constraint encoding flow model is pre-trained using a physical constraint loss function, and gradient clipping is used during pre-training to avoid gradient anomalies and ensure the stability of the pre-trained model. After standardizing the real observation data, the pre-trained model is globally optimized using a hybrid loss function, while gradient clipping is used simultaneously to suppress training oscillations. Finally, further optimization through training adjustments and gradient clipping ensures that the trained model fully conforms to the physical laws of photovoltaics and can efficiently utilize real observation data, effectively improving the convergence and stability of model training, while enhancing the model's fitting accuracy and generalization ability, and ensuring the reliability of model application.
[0018] Furthermore, in S4, the implementation process of the zero-sample migration strategy includes the following steps: Step B1: Based on the decoder network of the parameter-adjusted model, construct an initial test model that includes a general physical model and a site adjustment network; Step B2: Collect basic information of the new grid-connected power station, automatically infer the physical parameters corresponding to the new grid-connected power station based on the basic information, input the physical parameters into the initial test model, adjust the network parameters of the site to obtain the configured test model; Step B3: Collect real-time operating data of the new grid-connected power station, and adaptively train the configured test model based on the real-time operating data to obtain the adapted test model. During the adaptive training process, a test loss function is used for training. The mathematical expression is: In the formula, This represents the data fitting loss. Represents the regularization coefficient. This indicates that the parameters need to be updated. This represents the square of the L2 norm.
[0019] In this scheme, an initial test model is constructed by a decoder network based on the parameter-adjusted model. The physical parameters are automatically inferred and the site adjustment network is configured using the basic information of the new grid-connected power station. Then, the model is adaptively trained by combining real-time operating data and a specific test loss function. This can quickly obtain a model that is adapted to the new grid-connected power station, effectively improve the model's adaptability to the new grid-connected power station, reduce manual intervention, and improve the accuracy and reliability of the model in new scenarios.
[0020] Furthermore, in S4, the implementation process of the uncertainty quantification assessment strategy includes the following steps: Step C1: Sample multiple initial latent variables from the standard normal distribution, and perform numerical integration on each initial test latent variable according to the adaptive step size numerical integration algorithm to obtain multiple endpoint test latent variables. Then, convert each test endpoint latent variable into the corresponding power prediction value through the decoder network to form a prediction sample set. Step C2: Calculate the predetermined quantiles based on the predicted sample set to obtain the prediction interval, and calculate the sample standard deviation of the predicted sample set as a measure of prediction uncertainty. The mathematical expression for the prediction interval is: In the formula, This indicates the lower limit of the prediction interval. Indicates the upper limit of the prediction interval. This represents the confidence level parameter. express Quantiles express Quantiles Represents a set of sample data. Let N represent the i-th sample data, and N represent the total number of samples; Step C3: Based on the predicted sample set and the measurement of the predicted uncertainty, the predicted uncertainty is decomposed into cognitive uncertainty and accidental uncertainty.
[0021] In this scheme, the initial latent variables are sampled from the standard normal distribution and obtained by numerical integration and decoder network to obtain the prediction sample set. Then, the prediction interval and sample standard deviation are calculated to measure the uncertainty. Finally, the uncertainty is decomposed into cognitive uncertainty and accidental uncertainty, which can accurately quantify and evaluate the prediction uncertainty and improve the reliability of photovoltaic power prediction.
[0022] Furthermore, the mathematical expression for the adaptive step-size numerical integration algorithm is: In the formula, Indicates adaptive step size, , Indicates the basic step size coefficient. This represents the threshold used to control step size adjustment. Describing the L2 norm, This represents the state of the latent variable at time t. Indicates time The latent variable state at that location, The latent variable state at time t is represented as The condition variable is The velocity field function.
[0023] In this scheme, an adaptive step-size numerical integration algorithm is used. The adaptive step size can be flexibly adjusted to calculate the state of latent variables at different times more accurately, thereby improving the accuracy and efficiency of numerical integration. Attached Figure Description
[0024] Figure 1 This is a flowchart illustrating the short-term power prediction method for photovoltaic power generation based on a physical probability flow generation model, according to an embodiment of the present invention. Figure 2 This is a schematic diagram illustrating the construction process of the physical constraint coding flow model in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the construction process of the short-term power prediction model for photovoltaic power generation in an embodiment of the present invention. Detailed Implementation
[0025] The following detailed description illustrates the specific implementation methods: like Figure 1 The diagram shown is a flowchart illustrating the short-term power prediction method for photovoltaic power generation based on a physical probability flow generation model according to an embodiment of the present invention, including the following steps: S1. Collect historical power data and historical meteorological data of photovoltaic power stations to obtain photovoltaic power station data, and standardize the photovoltaic power generation data to obtain standardized photovoltaic power station data. Label the standardized photovoltaic power station data to obtain a photovoltaic power station data feature set, which includes a data training set, a data validation set, and a data test set. S2. Based on the continuous-time normalized flow framework, the photovoltaic physical model constraints are encoded into the velocity field of the probability flow to obtain the velocity field network model. The velocity field network model is then combined with the decoder network to obtain the physical constraint encoded flow model. S3. Construct a physical constraint loss function, and then construct a hybrid loss function based on the physical constraint loss function and the data fitting objective. S4. Input the data training set into the physical constraint coding flow model, train the physical constraint coding flow model based on the phased training strategy, physical constraint loss function and hybrid loss function to obtain the trained model, and adjust the parameters of the trained model according to the data validation set to obtain the parameter-adjusted model. Input the data test set into the parameter-adjusted model, and test the parameter-adjusted model based on the zero-sample transfer strategy and uncertainty quantification evaluation strategy. When the prediction accuracy of the parameter-adjusted model on the data test set reaches the preset prediction accuracy, output the photovoltaic power generation short-term power prediction model. S5. Collect meteorological data and system parameters of the target photovoltaic power station for the forecast period to obtain the dataset to be predicted, and standardize the dataset to be predicted to obtain a standardized dataset to be predicted. S6. Input the standardized dataset to be predicted into the photovoltaic power generation short-term power prediction model, solve the latent variable space in the photovoltaic power generation short-term power prediction model through the adaptive step size numerical integration algorithm, obtain multiple endpoint latent variables, and convert each endpoint latent variable into the corresponding photovoltaic power generation short-term power.
[0026] In this embodiment, in step S1, historical power data of the photovoltaic power station is collected, including basic data such as actual power generation time series, system capacity, and component parameters. Specifically, the collected data includes: power output value every 15 minutes, component type, number of components, photoelectric conversion efficiency, power temperature coefficient, and DC and AC side losses. This power data is directly obtained from the power station monitoring system and transmitted to the data processing server through a standardized interface. Relevant meteorological data is also collected, including historical meteorological observation data and weather forecast data. Historical meteorological observation data includes: global horizontal irradiance (GHI), direct normal irradiance (DNI), diffuse horizontal irradiance (DHI), ambient temperature, wind speed, wind direction, relative humidity, air pressure, and cloud cover. Weather forecast data is obtained from the National Meteorological Administration or professional meteorological service providers, including forecast values for the next 0-6 hours, and contains the same meteorological elements as the historical observation data.
[0027] The collected data undergoes quality checks and outlier handling. Statistical methods are used to identify and process outliers, including: data exceeding physical boundary values (such as negative power values, power values exceeding installed capacity), abrupt changes caused by sensor malfunctions, and missing values due to communication interruptions. Different processing strategies are employed for detected outliers based on data characteristics: median filtering or linear interpolation is used for occasional outliers; for consecutive missing data segments, similar-day pattern imputation is used, i.e., filling in the missing data by finding historical date data with similar meteorological conditions.
[0028] Data standardization processing. Power data undergoes capacity standardization by dividing the actual power value by the system's rated capacity, converting it to a standardized power value within the 0-1 range. Meteorological data undergoes unified dimension processing, employing the Z-Score standardization method to transform meteorological elements with different dimensions to the same standard scale. In the formula, 0 is the standardized value. These are the original data values. It is the mean of the features. It is the standard deviation of the features. This standardization process can eliminate the dimensional differences between different meteorological elements, enabling the model to better learn the correlations between the elements.
[0029] When labeling standardized photovoltaic power station data, the standardized power value is used as the core label. Standardized meteorological element data and standardized power-related basic data for each time point are matched one-to-one with the corresponding standardized power target value. During the labeling process, the consistency of timestamps for each data point is strictly verified to avoid misalignment between data and labels. Simultaneously, the weather pattern category (sunny, cloudy, overcast, rainy / snowy, etc.) corresponding to the label is recorded to ensure that the label includes both the target prediction value and is associated with key environmental attributes. Finally, the standardized photovoltaic power station data and corresponding labels are randomly divided according to a data training set: data validation set: data test set ratio of 8:1:1 to ensure that each subset contains typical weather pattern samples. A stratified sampling strategy is used for extreme weather samples to ensure their representativeness. The final result is a photovoltaic power station data feature set containing the data training set, data validation set, and data test set.
[0030] like Figure 2 As shown, it is a schematic diagram of the construction process of the physical constraint coding flow model in an embodiment of the present invention, including: S21. By defining the continuous transformation path of the latent variable over time through ordinary differential equations, a continuous-time normalized flow framework is obtained, wherein the mathematical expression of the continuous-time normalized flow framework is: In the formula, Indicates the first The latent variable state at time t, , Represents the velocity field function, Represents a condition variable; when the latent variable is in The time follows a baseline distribution (usually a standard normal distribution), and after stream transformation, it is in The target distribution is obtained at that time; S22. The velocity field function in the continuous-time normalized flow framework is divided into a basic physical constraint part and a self-attention enhancement part to obtain a velocity field network model, where the condition variables... The condition variables are determined by the physical parameters in the photovoltaic power generation process. The mathematical expression is: In the formula, Indicates predicted power. This represents the system efficiency factor. This indicates the rated power under preset standard test conditions. Indicates the current irradiance. This indicates the irradiance under preset standard test conditions. Indicates the power temperature coefficient. Indicates the current battery temperature. This indicates the temperature under preset standard test conditions; Current battery temperature The mathematical expression is: In the formula, Indicates ambient temperature. This indicates the battery mounting method coefficient. Indicates irradiance; Velocity field network model The mathematical expression is: In the formula, Representing latent variables, This represents the fundamental physical constraints. It includes four fully connected layers, each analyzed using the Swish activation function. , This indicates the part that enhances self-attention. , This represents a multilayer perceptron consisting of two fully connected networks. This indicates a multi-head attention mechanism. This represents the weight matrix used to generate the query matrix. This represents the weight matrix used to generate the key matrix. This represents the weight matrix used to generate the value matrix; The computational steps of the multi-head attention mechanism include: , , ,in, Represents the query matrix. Represents the key matrix, Represents a value matrix, This indicates a splicing operation, where h represents the total number of attention heads; in this embodiment, h is 8. This represents the output of the h-th attention head. This represents the learnable parameter matrix. This represents the output of the j-th attention head. This represents the query projection matrix corresponding to the j-th head, and the query matrix is... Projected onto the feature subspace of the j-th head. This represents the key projection matrix corresponding to the j-th head. The key matrix... Projected onto the feature subspace of the j-th head. This represents the value projection matrix corresponding to the j-th head. Projected onto the feature subspace of the j-th head. The core computation function representing a single attention head. This represents the activation function. This represents the transpose of the key matrix. In this embodiment, the scaling factor is represented. It is 64; S23. Construct a decoder network at the output of the velocity field network model, and map the latent variable space to the photovoltaic power prediction space through the decoder network to obtain the physical constraint coding flow model. The mathematical expression for mapping the latent variable space to the photovoltaic power prediction space is as follows: , This represents the predicted photovoltaic power value. The latent variable representing the endpoint of the probability flow. This represents the decoder network.
[0031] In this embodiment, the decoder network adopts a design that combines a multilayer perceptron with residual connections. The specific structure is as follows: 3 fully connected layers, each with 256 neurons, using the LeakyReLU activation function, and adding residual connections between each layer to improve gradient propagation efficiency.
[0032] like Figure 3 As shown, it is a flowchart of the construction of the short-term power prediction model for photovoltaic power generation in an embodiment of the present invention, including: in step S23, the process of constructing the physical constraint coding flow model also includes calculating variable conditions. The power prediction probability density is given below, wherein the mathematical expression for the power prediction probability density is: In the formula, Representing condition variables The power prediction probability density is as follows. Indicates in condition variable Logarithmic power prediction probability density This represents the probability density function of the standard normal distribution. This represents the trace of the Jacobian matrix of the velocity field function with respect to the latent variables.
[0033] Specifically, in S3, the hybrid loss function The mathematical expression is: In the formula, Represents the true data distribution. Represents the expected value of the true data distribution. Indicates the physical constraint weight coefficient. Represents the physical constraint loss function. , This represents the expectation of the latent variables, state, and time. Denotes the square of the L2 norm. This represents the physical residual function.
[0034] Specifically, in step S4, the implementation process of the phased training strategy includes the following steps: Step A1: Construct a pre-training dataset containing theoretical power values based on the photovoltaic physical model. Input the pre-training dataset into the physical constraint coding flow model. Pre-train the physical constraint coding flow model according to the physical constraint loss function. During the pre-training process, perform gradient pruning analysis. When the first gradient norm of the pre-trained physical constraint coding flow model exceeds the preset gradient pruning threshold, prune the gradient vector of the pre-trained physical constraint coding flow model to obtain the pre-trained model. The pre-training lasts for 50 cycles, using the Adam optimizer with a learning rate of 0.001 and a batch size of 128. The pre-training stage enables the photovoltaic power generation short-term power prediction model to initially grasp the basic physical laws of photovoltaic power generation, providing good initial parameters for subsequent training. Step A2: Obtain real observation data and standardize it to obtain standardized real observation data. Input the training set and standardized real observation data into the pre-trained model. Perform global optimization training on the pre-trained model based on the hybrid loss function. During the global optimization training process, perform gradient clipping analysis. When the second gradient norm of the pre-trained model after global optimization training exceeds the preset gradient clipping threshold, clip the gradient vector of the pre-trained model after global optimization training to obtain the globally optimized model. The global optimization phase lasts for 200 cycles, using the Adam optimizer with an initial learning rate of 0.0005, which decays to 0.8 times the original rate every 40 cycles, and a batch size of 96. During the global optimization phase, the photovoltaic power generation short-term power prediction model can gradually transition from being dominated by physical laws to being dominated by data features, learning the complex characteristics of the actual photovoltaic system. In this embodiment, the model is dynamically adjusted according to the training process. , The mathematical expression for the dynamic adjustment process is: , Indicates the first Physical constraint weights for each training cycle Indicates the initial weights. Indicates the attenuation rate. This indicates the total number of training cycles.
[0035] Step A3: Input standardized real observation data into the global optimization model, adjust and train the global optimization model, and perform gradient clipping analysis during the adjustment and training process. When the third gradient norm of the adjusted and trained global optimization model exceeds the preset gradient clipping threshold, clip the gradient vector of the adjusted and trained global optimization model to obtain the trained model. The adjustment and training phase lasts for 50 cycles, using the Adam optimizer, with a learning rate of 0.0001 and a batch size of 64. The adjustment and training phase enables the photovoltaic power generation short-term power prediction model to capture the subtle characteristics of the actual photovoltaic system and further improve the prediction accuracy.
[0036] In this embodiment, the gradient clipping threshold is set to 5.0, and the mathematical expression for gradient clipping is: In the formula, Represents the loss function For model parameters and The gradient of 1, This represents the L2 norm, i.e. the length of the gradient vector. At the same time, gradient accumulation technology is used to process large amounts of data, and the model parameters are updated every 4 steps, which effectively improves the efficiency of GPU memory utilization and enhances the stability of model optimization.
[0037] Specifically, in S4, the implementation process of the zero-sample migration strategy includes the following steps: Step B1: Based on the decoder network of the parameter-adjusted model, construct an initial test model containing a general physics model and a site adjustment network; the site adjustment network adopts a lightweight design, containing two fully connected layers, each with 128 neurons, and using the PReLU activation function; Step B2: Collect basic information of the new grid-connected power station, automatically infer the physical parameters corresponding to the new grid-connected power station based on the basic information, input the physical parameters into the initial test model, adjust the network parameters of the site to obtain the configured test model; the basic information includes geographical coordinates (longitude, latitude, altitude), azimuth, tilt angle, component type, inverter type, etc. The steps for automatically inferring the physical parameters of a new grid-connected power station based on the aforementioned basic information include: (1) inferring the optimal tilt angle and azimuth angle based on the geographical location. If the actual installation parameters are unknown, an empirical formula is used: the optimal tilt angle is approximately equal to the latitude, and the azimuth angle is assumed to be due south (Northern Hemisphere) or due north (Southern Hemisphere). (2) automatically setting relevant physical parameters based on the component type, including the power temperature coefficient. (The efficiency factor is approximately -0.4% / °C for monocrystalline silicon and -0.45% / °C for polycrystalline silicon), and the battery installation coefficient k (approximately 0.03 for rooftop installation and approximately 0.025 for ground installation). (3) Infer the system efficiency factor based on the inverter model and system configuration. Considering DC side losses (approximately 2-3%), inverter conversion losses (approximately 2-5%), and AC side losses (approximately 1-2%).
[0038] Step B3: Collect real-time operating data of the new grid-connected power station, and adaptively train the configured test model based on the real-time operating data to obtain the adapted test model. During the adaptive training process, a test loss function is used for training. The mathematical expression is: In the formula, This represents the data fitting loss. Represents the regularization coefficient. This indicates that the parameters need to be updated. This represents the square of the L2 norm.
[0039] Specifically, in S4, the implementation process of the uncertainty quantification assessment strategy includes the following steps: Step C1: Sample multiple initial latent variables from the standard normal distribution, and perform numerical integration on each initial test latent variable according to the adaptive step size numerical integration algorithm to obtain multiple endpoint test latent variables. Then, convert each test endpoint latent variable into the corresponding power prediction value through the decoder network to form a prediction sample set. Step C2: Calculate the predetermined quantiles based on the predicted sample set to obtain the prediction interval, and calculate the sample standard deviation of the predicted sample set as a measure of prediction uncertainty. The mathematical expression for the prediction interval is: In the formula, This indicates the lower limit of the prediction interval. Indicates the upper limit of the prediction interval. This represents the confidence level parameter. express Quantiles express Quantiles Represents a set of sample data. Let N represent the i-th sample data, and N represent the total number of samples; Step C3: Based on the predicted sample set and the measurement of the predicted uncertainty, the predicted uncertainty is decomposed into cognitive uncertainty and accidental uncertainty.
[0040] In this embodiment, 100 initial test latent variables are sampled from the baseline distribution: For each initial test latent variable, the ODE is solved using the adaptive step-size numerical integration method to obtain the final test latent variable. Then, 100 power prediction values are obtained through the decoder network: Based on these 100 prediction samples, the mean is calculated as the point prediction result: Based on the sampling distribution, quantiles are calculated to generate a 90% prediction interval: Meanwhile, the sample standard deviation is calculated as a measure of prediction uncertainty: Furthermore, the prediction uncertainty is decomposed into cognitive uncertainty (the uncertainty of the model itself) and accidental uncertainty (the inherent randomness of the data), providing more granular uncertainty information.
[0041] Specifically, the mathematical expression for the adaptive step-size numerical integration algorithm is: In the formula, Indicates adaptive step size, , Indicates the basic step size coefficient. This represents the threshold used to control step size adjustment. Describing the L2 norm, This represents the state of the latent variable at time t. Indicates time The latent variable state at that location, The latent variable state at time t is represented as The condition variable is The velocity field function.
[0042] In this embodiment, to improve the practical application efficiency of the system, several computational acceleration and engineering optimization measures are implemented. The complete model knowledge is distilled into a lightweight model; the teacher model is a complete physical constraint encoding flow model, and the student model is a simplified feedforward neural network. Knowledge transfer is achieved by minimizing the KL divergence of the prediction distribution. In the formula, This represents the knowledge distillation loss. This represents the input samples of the model. This represents additional constraints in the teacher model. Indicates under given conditions Below, the input samples for the model The predicted probability distribution Indicates that the student model is under the same conditions Below, the input samples for the model The predicted probability distribution is calculated. GPU parallel computing is used to accelerate the inference process, implementing a batch processing mechanism to handle multiple prediction requests at once, fully utilizing the parallel computing capabilities of the GPU. A custom, efficient parallel operator is implemented based on the CUDA programming model, with specific optimizations for the sampling integration process, improving computational efficiency by approximately 3 times compared to a general implementation. Numerical precision optimization is implemented. A mixed-precision computing strategy is adopted, maintaining 32-bit floating-point precision for key operations (such as gradient calculation and loss function) and using 16-bit floating-point precision for other operations (such as matrix multiplication in forward propagation), improving computational speed while maintaining algorithm accuracy. Simultaneously, algorithm optimization is performed for specific hardware platforms (such as Tensor Cores) to fully utilize hardware acceleration capabilities. A distributed prediction system architecture is designed. A microservice-based distributed prediction system is constructed, consisting of four main modules: data processing service, model training service, prediction service, and result display service. The modules communicate asynchronously through message queues to achieve high concurrency processing capabilities. Furthermore, an elastic scaling mechanism is designed to automatically adjust the allocation of computing resources based on request load, optimizing resource utilization efficiency while ensuring response speed.
[0043] Based on the above content, conduct experimental analysis: This embodiment employs an enhanced hardware and software configuration in its experimental environment to verify the performance of the method of this invention under more diverse power plant types and meteorological conditions. The hardware platform used in the experiment is a distributed computing cluster containing an 8-node server, each node configured with an Intel Xeon Gold 6248R CPU, 384GB of memory, and four NVIDIA A100 GPUs (each with 40GB of VRAM). The software environment uses Python 3.9, PyTorch 1.12.1, and CUDA 11.6, and integrates the Ray distributed computing framework to support large-scale parallel sampling. The test sites are expanded to representative photovoltaic power plants in five major regions across China: a 100MW large-scale ground-mounted power plant in North China, a 40MW industrial and commercial rooftop power plant in East China, an 80MW desert photovoltaic power plant in Northwest China, a 30MW agricultural-solar hybrid power plant in Southwest China, and a 60MW fishery-solar hybrid power plant in Northeast China. The meteorological data sources include routine weather forecasts provided by the China Meteorological Administration, cloud imagery data from Chinese remote sensing satellites, and high-precision local weather forecasts provided by third-party meteorological service providers. The data dimensions cover multiple indicators such as irradiance, temperature, wind speed, cloud cover, atmospheric transparency, and aerosol concentration. The experiment lasted from March to September 2024, fully covering various typical and extreme weather conditions across spring, summer, and autumn, with a total data volume of 12TB.
[0044] Comparison Scheme 1 Explanation: The traditional physical model method adopts a deterministic model based on physical processes widely used in the industry. This model is based on the equivalent model of a single-photovoltaic diode circuit and includes comprehensive physical processes such as incident irradiance conversion, temperature correction, module efficiency calculation, and DC-AC conversion losses. The core equation of the model is: P1 = η0 × A × G × [1 + αp(Tc - Tstc)] × ηinv, where P1 is the output power, η0 is the module efficiency, A is the panel area, G is the tilt surface irradiance, αp is the temperature coefficient, Tc is the actual battery temperature, Tstc is the standard test condition temperature (25℃), and ηinv is the inverter efficiency. This model also includes a battery temperature estimation model: Tc = Ta + (NOCT - 20) × G / 800, where Ta is the ambient temperature and NOCT is the nominal operating battery temperature. The physical model used in this comparative test was provided by a well-known domestic photovoltaic design institute and has been verified in actual engineering for more than ten years, representing the highest level of traditional physical models. The parameter calibration method uses historical data from large photovoltaic power plants and optimizes each parameter using the least squares method to ensure the best fit under standard conditions.
[0045] Comparison with Scheme 2: The deep learning ensemble method integrates state-of-the-art deep learning technologies, constructing a complex ensemble architecture based on three models: Long Short-Term Memory (LSTM), Temporal Convolutional Network (TCN), and Transformer. The LSTM module employs a 4-layer structure with 256 neurons per layer, focusing on capturing long-term dependencies in time series data. The TCN module uses an 8-layer dilated convolutional structure, with a receptive field covering 72 hours of historical data, excelling at extracting multi-scale temporal features. The Transformer module uses a 6-layer multi-head self-attention structure with 8 attention heads per layer, effectively handling complex interactions between features. The ensemble employs a dynamic weight allocation mechanism, automatically adjusting the weights of each model based on historical prediction accuracy. This method uses 50 independently trained ensemble models, quantifying prediction uncertainty through model averaging and Monte Carlo Dropout (with a Dropout rate of 0.2). To enhance model generalization ability, data augmentation techniques are employed during training, including adding Gaussian noise (σ1=0.01), random masking (15% masking rate), and temporal warping (with a warping coefficient of ±10%). This method, developed by a well-known artificial intelligence research laboratory, represents the cutting edge of current purely data-driven approaches.
[0046] The experiment in this embodiment was conducted in four main stages following a rigorous scientific process. First, in the data preparation stage, historical power generation data and multi-source meteorological data from five test power plants for 26 months, from January 2022 to February 2024, were collected and integrated to ensure the dataset covered various seasonal variations and extreme weather events. Data preprocessing included time alignment (standardizing the sampling interval to 15 minutes), missing value imputation (using high-order spline interpolation), outlier detection and processing (based on the local anomaly factor algorithm), and multi-source data fusion (merging different meteorological source data through dynamic weighting). The processed data was divided into training set (70%), validation set (10%), and test set (20%) according to time order, and stratified sampling was performed to ensure that each set included samples from different seasons and weather conditions. In the model training stage, an improved three-stage training strategy was adopted for the physical probability flow model of this invention. The first stage of physical constraint pre-training was extended to 30 cycles, using a pure physical loss function and synthetic data for training, establishing a sound physical prior foundation. The second stage of hybrid loss optimization employed a dynamic weight adjustment mechanism. The initial physical constraint weight λphys was set to 1.0, gradually decreasing to 0.2 according to an exponential decay law, completing 200 cycles of thorough optimization. The third stage, fine-tuning with real data, involved 50 cycles of precise adjustments tailored to the characteristics of each power station, using mini-batch training (batch size=64) to improve the model's adaptability to the characteristics of each station. In contrast, the physical model calibration of Scheme 1 employed a hierarchical parameter estimation method, first determining basic parameters through theoretical calculations, and then optimizing the decay coefficient and efficiency factor through historical data regression. Scheme 2 underwent comprehensive model training, including three stages: pre-training, transfer learning, and model ensemble, totaling 2500 GPU hours for training. The prediction performance testing phase covered a comprehensive evaluation across four dimensions. Short-term prediction accuracy testing was conducted across different time scales, including very short-term (0-6 hours, 15-minute granularity), short-term (6-24 hours, 1-hour granularity), and medium-term (24-72 hours, 3-hour granularity), evaluating performance across different prediction periods. The extreme weather adaptability test specifically selected 15 typical extreme weather days, including severe convective weather (4 cases), rapidly changing cloud cover (5 cases), sandstorms (3 cases), and extreme temperature weather (3 cases), to comprehensively evaluate the model's adaptability to abnormal conditions. The zero-sample migration test used two newly connected power plants as validation: a 25MW photovoltaic power plant in Central China and a 15MW distributed photovoltaic system in South China, to evaluate the model's migration performance under conditions with only basic parameters and minimal data. The computational efficiency test recorded the algorithm's execution time, memory usage, and resource consumption for power plants of different sizes from 10MW to 500MW, evaluating the algorithm's scalability. The uncertainty quantification assessment stage conducted an in-depth analysis of the reliability and uncertainty of the prediction results.First, prediction intervals with multiple confidence levels (50%, 80%, 90%, and 95%) were generated, and the actual coverage of each interval was calculated. Second, the correlation between the prediction interval width and the actual power fluctuation amplitude was evaluated to verify the accuracy of uncertainty quantification. Finally, information entropy and the Kullback-Leibler divergence method were applied to decompose and quantify the contribution ratios of cognitive uncertainty and accidental uncertainty, providing an in-depth analysis of the model's ability to represent different types of uncertainty.
[0047] This embodiment employs a rigorous scientific evaluation system to comprehensively assess the performance of the three methods from multiple dimensions. Regarding prediction accuracy evaluation, four core indicators are used: Mean Relative Error (MAPE) measures the relative deviation between the predicted and actual values, calculated as MAPE = (1 / n)∑|(Ai-Pi) / Ai|×100%, where Ai is the actual value and Pi is the predicted value; Root Mean Square Error (RMSE) assesses the absolute deviation level of the prediction, calculated as RMSE = sqrt[(1 / n)∑ The coefficient of determination (R²) assesses the goodness of fit of the model, and is calculated using the following formula: = 1-∑ / ∑ ,in The average of the actual values is used; the standardized bias (nBias) assesses the systematic bias of the prediction, calculated as nBias = ∑(Pi-Ai) / ∑Ai. A 95% confidence interval was calculated for each indicator, and robust statistical estimates were obtained using the bootstrap resampling method (1000 resampling attempts). The uncertainty quantification assessment employs three professional indicators: Predicted Interval Coverage (PICP), which calculates the proportion of actual values falling within the predicted interval, with the formula PICP = (1 / n)∑I(Ai∈[Li,Ui]), where I is the indicator function, and Li and Ui are the lower and upper bounds, respectively; Standardized Average Width of Predicted Interval (PINAW), which assesses the compactness of the predicted interval, with the formula PINAW = (1 / n)∑(Ui-Li) / R, where R is the range of actual values; and Comprehensive Interval Score (CWC), which considers both coverage and interval width, with the formula CWC = PINAW·(1+γ·exp(-η1·(PICP-μ))), where γ, η1, and μ are adjustment parameters, set to 50, 50, and the target coverage, respectively. In addition, an interval sharpness index is introduced to assess the sensitivity of the predicted interval to power fluctuations, calculating the correlation coefficient between the predicted interval width and actual power fluctuations. Zero-shot transfer capability assessment employed four professional indicators: data efficiency ratio (MAPR) to calculate the proportion of data required to achieve the same accuracy (MAPE < 5%); transfer adaptation time (TAK) to record the shortest data collection time required to achieve stable predictive performance; knowledge retention rate (KRR) to assess the proportion of knowledge retained by the model when transferring between different sites, calculated based on parameter similarity; and site correlation impact factor (SCIF) to analyze the degree of influence of differences in physical characteristics between sites on transfer performance. Each transfer test underwent at least five independent replicate experiments to ensure the reliability of the results. Computational efficiency assessment included five technical indicators: training time (total computation time required to complete model training in hours); inference speed (computation time required to calculate a single complete prediction (including interval estimation) in seconds); computational resource consumption (CPU / GPU utilization and memory usage); model complexity (number of model parameters and number of floating-point operations (FLOPs); and scalability coefficient (SC) to analyze the trend of algorithm processing capability with the growth of power plant scale, calculated as SC = log(T2 / T1) / log(S2 / S1), where T1 and T2 are computation times, and S1 and S2 are the power plant scale. All computational efficiency metrics were obtained through a unified benchmarking platform to ensure the fairness of the comparison.
[0048] The experimental results are shown in the table below:
[0049] Multi-dimensional experimental evaluations of the proposed solution fully demonstrate the superior performance of the physical probability flow model. In terms of prediction accuracy, the proposed solution achieves a mean relative error (MAPE) of 1.10% in short-term predictions (0-6 hours), a reduction of 55.5% compared to the 2.47% of the comparative solution 2, and a reduction of 79.0% compared to the 5.23% of the traditional physical model solution. This significant improvement stems from the accurate encoding of the photovoltaic power generation physical processes by the physical probability flow model and the effective modeling of uncertainties by the probabilistic framework. Particularly noteworthy is that the proposed solution maintains a stable performance advantage as the prediction timeframe extends, achieving a MAPE of 4.32% in medium-term predictions (24-72 hours), 43.0% lower than the 7.58% of the deep learning ensemble method. This demonstrates the importance of physical constraints in long-term predictions, effectively preventing the error accumulation problem of purely data-driven methods in long-term predictions. (Coefficient of Determination (...)) Further analysis confirmed this, demonstrating that the proposed solution performs well in 0-6 hour predictions. The MAPE of the proposed method reached 0.976, significantly higher than the other two methods, indicating a very high consistency between the predicted results and the actual power. In extreme weather condition adaptability tests, the proposed method demonstrated excellent robustness. Under various extreme weather conditions (strong convection, rapidly changing cloud formations, sandstorms, and extreme temperatures), the MAPE of the proposed method was only 1.45%, a reduction of 83.2% compared to the 8.63% of the comparative method 2, and a reduction of 91.2% compared to the 16.42% of the physical model. Particularly under extreme temperature conditions, the MAPE of the proposed method was only 1.64%, a reduction of 84.3% compared to the 10.42% of the comparative method 2. This significant performance difference stems from the temperature-dependent physical relationship encoded in the physical probability flow model, enabling the model to accurately capture the impact of high or low temperatures on photovoltaic module efficiency. Detailed analysis of the prediction results shows that the proposed method can accurately predict power drops under extreme conditions, while the comparative methods often exhibit prediction lag or insufficient response. The ability to quantify uncertainty is another significant advantage of the proposed method. The proposed solution achieves a 98.5% coverage rate for the 90% prediction interval, significantly higher than the 82.6% of the deep learning ensemble method. Simultaneously, the normalized average width of the prediction interval (PINAW) is only 8.7%, a 52.7% reduction compared to the 18.4% of the deep learning ensemble method. This means that the proposed solution not only provides a more reliable prediction interval (higher coverage) but also more accurate interval estimates (narrower interval width). The interval sharpness correlation coefficient reaches 0.87, significantly higher than the 0.31 of the comparative solution 2, indicating that the proposed solution can dynamically adjust the prediction interval based on the uncertainty of actual weather conditions, automatically expanding the prediction interval during periods of high volatility and providing more accurate predictions under stable conditions. Furthermore, this invention achieves, for the first time, precise quantification of cognitive uncertainty, with a quantification accuracy of 96.8%, providing more valuable uncertainty information for scheduling decisions.
[0050] Zero-sample transfer capability is one of the most prominent advantages of this invention. For new grid-connected power plants, this invention only requires 2 hours of data to achieve a stable prediction level, which is 97.7% shorter than the 86 hours of the comparative scheme 2 and 98.8% shorter than the 168 hours of the traditional physical model. Knowledge retention rate (KRR) analysis shows that this invention retains 94.2% of the knowledge during the transfer process, far exceeding the 38.6% of the deep learning ensemble method and the 12.3% of the physical model. This superior transfer capability stems from the physical knowledge encoded in the physical probability flow model and the effective design of the zero-sample transfer strategy, enabling the model to quickly adapt to and achieve high-precision prediction based on the basic physical parameters of the new power plant (such as photovoltaic module type, installation method, geographical location, etc.), greatly reducing the technical threshold and time cost of connecting new power plants to the intelligent prediction system. In terms of computational efficiency, this invention achieves high computational efficiency while maintaining high prediction accuracy. The inference time for a 40MW power plant is only 0.5 seconds, comparable to the physical model, but 57 times faster than the 28.5 seconds of the deep learning ensemble method. On a 100MW large-scale power plant, this scheme requires 12 seconds to complete full probability prediction, with GPU memory usage of only 2.8GB, a 91.4% reduction compared to the 32.6GB of the comparative scheme 2. Scalability coefficient analysis shows that the algorithm complexity of this invention increases very slowly with the scale of the power plant (coefficient of 1.32), far superior to the 4.26 of the deep learning ensemble method. This means that this invention has a significant computational efficiency advantage in large-scale power plant cluster prediction. In terms of training time, this invention requires only 12 hours, an 87.2% reduction compared to the 94 hours of the deep learning ensemble method, which greatly reduces the cost of model updates and maintenance.
[0051] This embodiment provides an extended application of the photovoltaic power generation prediction method based on the present invention in a microgrid system. Microgrid systems typically include various energy devices, such as photovoltaic arrays, wind turbines, energy storage devices, and controllable loads. The accuracy of photovoltaic power generation prediction is crucial for the energy optimization scheduling and economic operation of the microgrid. This embodiment demonstrates how to extend the physical probability flow generation model of the present invention to a microgrid energy management system, achieving multi-timescale prediction and multi-device coordinated control. In the microgrid application scenario, this embodiment extends the physical constraint encoded flow model to simultaneously consider the power flow constraints within the microgrid and the operating characteristics of each device. Specifically, in addition to weather forecast data, the condition variable c also includes microgrid system state information, such as the state of charge (SOC) of the energy storage devices, predicted load demand, and grid interaction power constraints. The extended condition variable c_extended can be represented as c_extended = [c_weather, c_microgrid], where c_weather represents the original weather forecast data, and c_microgrid represents the microgrid system information. To adapt to microgrid application scenarios, this embodiment adjusts the velocity field network structure, adding a dedicated sub-network adapted to microgrid characteristics. The extended velocity field function f_θ(z, t, c_extended) is expressed as: f_θ(z, t, c_extended) = f_base(z, t) + f_attn(z, c_weather,t) + f_microgrid(z, c_microgrid, t). Here, f_microgrid represents the newly added microgrid characteristic encoding part, f_base(z, t) represents the basic velocity field function, and f_attn represents the velocity field correction term driven by the attention mechanism. A graph neural network structure is used to capture the topological relationships and mutual influences between microgrid devices. The graph neural network is based on the microgrid topology, with nodes representing devices and edges representing power connection relationships, modeling the interactions between devices through an information transmission mechanism.
[0052] In a microgrid environment, the physical residual function further considers the energy balance constraints between devices. In addition to the basic photovoltaic physical model, a system-level energy balance equation is introduced: P_pv + P_wind + P_storage + P_grid = P_load, where P_pv represents photovoltaic power generation, P_wind represents wind power generation, P_storage represents energy storage charging and discharging power, P_grid represents grid interaction power, and P_load represents load demand power. Based on this, the extended physical residual function P_extended(x, c_extended) is: P_extended(x, c_extended) = [P(x, c_weather), P_balance(x, c_extended)], where P_balance represents the energy balance residual.
[0053] The hybrid optimization mechanism is more complex in this embodiment, requiring a balance between the physical constraints of photovoltaic power generation, the constraints of the microgrid system, and the data-driven objective. The adjusted hybrid loss function L_flow_extended is: L_flow_extended = -E[log p_X(x|c_extended)] + λ_phys·L_phys(f_θ, g_φ, c_weather) + λ_microgrid·L_microgrid(f_θ, g_φ, c_extended), where L_microgrid represents the microgrid system constraint loss, λ_microgrid represents the corresponding weight coefficient, λ_phys represents the adjustable weight coefficient of the physical constraint loss, and L_phys represents the extended physical constraint loss function. The microgrid system constraints include multiple factors such as energy storage device capacity limitations, state of charge variation patterns, and grid interaction power limitations.
[0054] In this embodiment, the prediction timescale has been expanded to include three different scales: ultra-short-term (0-1 hour), short-term (1-6 hours), and medium-term (6-24 hours). For different timescales, a multi-sampling strategy is designed: for ultra-short-term predictions, high-frequency small-step sampling is used to ensure prediction accuracy; for short-term predictions, a standard step-size strategy is used; and for medium-term predictions, a progressive coarsening strategy is used, employing larger step sizes at longer time points to reduce computational load. The step-size adjustment strategy can be expressed as: ε_t = η·min(1, τ / ‖f_θ(z_t, t, c_extended)‖_2)·α(Δt), where α(Δt) represents the timescale adjustment factor, which increases with the prediction time.
[0055] To address the specific needs of microgrid scenarios, this embodiment develops a variational inference method for conditional probability density estimation. By introducing an auxiliary variational distribution q_φ(z|x, c_extended), the variational lower bound is calculated as: ELBO = E_q[log p_X(x3|z, c_extended)] - D_KL(q_φ(z|x, c_extended)||p_Z(z)), where ELBO represents the objective function in the four-variational inference, E_q[·] represents the mathematical expectation operator based on the variational distribution q, log p_X(x3|z, c_extended) represents the log-likelihood of the observed data x3 given the latent variable z and the extended conditional variable, p_Z(z) represents the prior probability distribution of the latent variable z, and D_KL represents the KL divergence. This method significantly improves the computational efficiency of probability density estimation while maintaining the original accuracy, making it suitable for the real-time scheduling requirements of microgrids. This embodiment particularly focuses on the synergistic optimization problem of photovoltaic power generation and energy storage systems in microgrids. The prediction results are directly input into the coordination and control module of the microgrid energy management system, and a risk-aware energy storage dispatch strategy is formulated based on the generated uncertainty interval. Specifically, the expected value of photovoltaic power generation E[P_pv(t)] and the standard deviation σ[P_pv(t)] of each time period during the day are calculated through the predicted distribution generated by multi-particle sampling. Combined with the risk preference parameter λ_risk, the energy storage scheduling target is constructed as follows: energy storage charging power P_storage_charge(t) = max(0, E[P_pv(t)]- P_load(t) - λ_risk·σ[P_pv(t)]), energy storage discharging power P_storage_discharge(t) = max(0, P_load(t) - E[P_pv(t)]+ λ_risk·σ[P_pv(t)]), where P_pv(t) represents the photovoltaic power generation power of time period t during the day, E[P_pv(t)] represents the expected value of photovoltaic power generation power of time period t during the day, and P_load(t) represents the power load of electricity consumption of time period t during the day.
[0056] To address the collaborative prediction and control problem of multiple devices in a microgrid, this embodiment implements a multi-agent decision-making framework based on reinforcement learning. Various devices in the microgrid are abstracted as agents, aiming to maximize economic benefits and system stability. The photovoltaic power generation prediction results of this invention are used as an important component of the environmental state to train the agents to make optimal control decisions. The reinforcement learning algorithm adopts a distributed dominant actor-commentator architecture. The state space includes the current system state and the future predicted state, the action space includes the control commands of each device, and the reward function comprehensively considers multiple factors such as economic benefits, system stability, and user comfort. In terms of practical deployment, this embodiment develops a lightweight implementation scheme for edge computing platforms. Through knowledge distillation technology, the trained physical probability flow model is compressed to a scale suitable for edge devices, reducing the model size by 85% and inference time by 78%, while maintaining the prediction accuracy loss within an acceptable range. The compressed model can be directly deployed on the microgrid controller to achieve localized prediction and control, avoiding the risk of network communication delays and interruptions. This embodiment also designs a prediction strategy adjustment mechanism for microgrid islanding modes. When a microgrid disconnects from the main grid and enters islanded operation mode, the system stability requirements increase significantly, making prediction reliability more important than extreme accuracy. By dynamically adjusting the weighting coefficients in the hybrid loss function and increasing the proportion of physical constraint terms, the physical rationality and robustness of the prediction results are improved. At the same time, adjusting the number of sampling particles generates a more conservative prediction range, ensuring safe operation in islanded mode.
[0057] The above are merely embodiments of the present invention. Commonly known structures and characteristics are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.
Claims
1. A method for short-term photovoltaic power generation prediction based on a physical probability flow generation model, characterized in that: Includes the following steps: S1. Collect historical power data and historical meteorological data of photovoltaic power stations to obtain photovoltaic power station data, and standardize the photovoltaic power generation data to obtain standardized photovoltaic power station data. Label the standardized photovoltaic power station data to obtain a photovoltaic power station data feature set, which includes a data training set, a data validation set, and a data test set. S2. Based on the continuous-time normalized flow framework, the photovoltaic physical model constraints are encoded into the velocity field of the probability flow to obtain the velocity field network model. The velocity field network model is then combined with the decoder network to obtain the physical constraint encoded flow model. S3. Construct a physical constraint loss function, and then construct a hybrid loss function based on the physical constraint loss function and the data fitting objective. S4. Input the data training set into the physical constraint coding flow model, train the physical constraint coding flow model based on the phased training strategy, physical constraint loss function and hybrid loss function to obtain the trained model, and adjust the parameters of the trained model according to the data validation set to obtain the parameter-adjusted model. Input the data test set into the parameter-adjusted model, and test the parameter-adjusted model based on the zero-sample transfer strategy and uncertainty quantification evaluation strategy. When the prediction accuracy of the parameter-adjusted model on the data test set reaches the preset prediction accuracy, output the photovoltaic power generation short-term power prediction model. S5. Collect meteorological data and system parameters of the target photovoltaic power station for the forecast period to obtain the dataset to be predicted, and standardize the dataset to be predicted to obtain a standardized dataset to be predicted. S6. Input the standardized dataset to be predicted into the photovoltaic power generation short-term power prediction model, solve the latent variable space in the photovoltaic power generation short-term power prediction model through the adaptive step size numerical integration algorithm, obtain multiple endpoint latent variables, and convert each endpoint latent variable into the corresponding photovoltaic power generation short-term power.
2. The method for short-term photovoltaic power generation prediction based on a physical probability flow generation model according to claim 1, characterized in that: S2 includes the following steps: S21. By defining the continuous transformation path of the latent variable over time through ordinary differential equations, a continuous-time normalized flow framework is obtained, wherein the mathematical expression of the continuous-time normalized flow framework is: In the formula, Indicates time The latent variable state at that location, , Represents the velocity field function, Represents a condition variable; S22. The velocity field function in the continuous-time normalized flow framework is divided into a basic physical constraint part and a self-attention enhancement part to obtain a velocity field network model, where the condition variables... The condition variables are determined by the physical parameters in the photovoltaic power generation process. The mathematical expression is: In the formula, Indicates predicted power. This represents the system efficiency factor. This indicates the rated power under preset standard test conditions. Indicates the current irradiance. This indicates the irradiance under preset standard test conditions. Indicates the power temperature coefficient. Indicates the current battery temperature. This indicates the temperature under preset standard test conditions; Velocity field network model The mathematical expression is: In the formula, Representing latent variables, This represents the fundamental physical constraints. It includes four fully connected layers, each analyzed using the Swish activation function. , This indicates the part that enhances self-attention. , This represents a multilayer perceptron consisting of two fully connected networks. This indicates a multi-head attention mechanism. This represents the weight matrix used to generate the query matrix. This represents the weight matrix used to generate the key matrix. This represents the weight matrix used to generate the value matrix; S23. Construct a decoder network at the output of the velocity field network model, and map the latent variable space to the photovoltaic power prediction space through the decoder network to obtain the physical constraint coding flow model. The mathematical expression for mapping the latent variable space to the photovoltaic power prediction space is as follows: , This represents the predicted photovoltaic power value. The latent variable representing the endpoint of the probability flow. This represents the decoder network.
3. The method for short-term photovoltaic power generation prediction based on a physical probability flow generation model according to claim 2, characterized in that: In step S23, the process of constructing the physical constraint coding flow model also includes calculating variable conditions. The power prediction probability density is given below, wherein the mathematical expression for the power prediction probability density is: In the formula, Representing condition variables The power prediction probability density is as follows. Indicates in condition variable Logarithmic power prediction probability density This represents the probability density function of the standard normal distribution. This represents the trace of the Jacobian matrix of the velocity field function with respect to the latent variables.
4. The method for short-term photovoltaic power generation prediction based on a physical probability flow generation model according to claim 3, characterized in that: In S3, the hybrid loss function The mathematical expression is: In the formula, Represents the true data distribution. Represents the expected value of the true data distribution. Indicates the physical constraint weight coefficient. Represents the physical constraint loss function. , This represents the expectation of the latent variables, state, and time. Denotes the square of the L2 norm. This represents the physical residual function.
5. The method for short-term photovoltaic power generation prediction based on a physical probability flow generation model according to claim 1, characterized in that: In step S4, the implementation process of the phased training strategy includes the following steps: Step A1: Construct a pre-training dataset containing theoretical power values based on the photovoltaic physical model. Input the pre-training dataset into the physical constraint coding flow model. Pre-train the physical constraint coding flow model according to the physical constraint loss function. Perform gradient clipping analysis during the pre-training process. When the first gradient norm of the pre-trained physical constraint coding flow model exceeds the preset gradient clipping threshold, clip the gradient vector of the pre-trained physical constraint coding flow model to obtain the pre-trained model. Step A2: Obtain real observation data and standardize the real observation data to obtain standardized real observation data. Input the data training set and standardized real observation data into the pre-trained model. Perform global optimization training on the pre-trained model based on the hybrid loss function. During the global optimization training process, perform gradient clipping analysis. When the second gradient norm of the pre-trained model after global optimization training exceeds the preset gradient clipping threshold, clip the gradient vector of the pre-trained model after global optimization training to obtain the global optimized model. Step A3: Input standardized real observation data into the global optimization model, adjust and train the global optimization model, and perform gradient clipping analysis during the adjustment and training process. When the third gradient norm of the adjusted and trained global optimization model exceeds the preset gradient clipping threshold, clip the gradient vector of the adjusted and trained global optimization model to obtain the trained model.
6. The method for short-term photovoltaic power generation prediction based on a physical probability flow generation model according to claim 5, characterized in that: In S4, the implementation process of the zero-sample migration strategy includes the following steps: Step B1: Based on the decoder network of the parameter-adjusted model, construct an initial test model that includes a general physical model and a site adjustment network; Step B2: Collect basic information of the new grid-connected power station, automatically infer the physical parameters corresponding to the new grid-connected power station based on the basic information, input the physical parameters into the initial test model, adjust the network parameters of the site to obtain the configured test model; Step B3: Collect real-time operating data of the new grid-connected power station, and adaptively train the configured test model based on the real-time operating data to obtain the adapted test model. During the adaptive training process, a test loss function is used for training. The mathematical expression is: In the formula, This represents the data fitting loss. Represents the regularization coefficient. This indicates that the parameters need to be updated. This represents the square of the L2 norm.
7. The method for short-term photovoltaic power generation prediction based on a physical probability flow generation model according to claim 6, characterized in that: In S4, the implementation process of the uncertainty quantification assessment strategy includes the following steps: Step C1: Sample multiple initial latent variables from the standard normal distribution, and perform numerical integration on each initial test latent variable according to the adaptive step size numerical integration algorithm to obtain multiple endpoint test latent variables. Then, convert each test endpoint latent variable into the corresponding power prediction value through the decoder network to form a prediction sample set. Step C2: Calculate the predetermined quantiles based on the predicted sample set to obtain the prediction interval, and calculate the sample standard deviation of the predicted sample set as a measure of prediction uncertainty. The mathematical expression for the prediction interval is: In the formula, This indicates the lower limit of the prediction interval. Indicates the upper limit of the prediction interval. This represents the confidence level parameter. express Quantiles express Quantiles Represents a set of sample data. Let N represent the i-th sample data, and N represent the total number of samples; Step C3: Based on the predicted sample set and the measurement of the predicted uncertainty, the predicted uncertainty is decomposed into cognitive uncertainty and accidental uncertainty.
8. The method for short-term photovoltaic power generation prediction based on a physical probability flow generation model according to claim 1 or 7, characterized in that: The mathematical expression for the adaptive step-size numerical integration algorithm is: In the formula, Indicates adaptive step size, , Indicates the basic step size coefficient. This represents the threshold used to control step size adjustment. Represents the L2 norm. This represents the state of the latent variable at time t. Indicates time The latent variable state at that location, The latent variable state at time t is represented as The condition variable is The velocity field function.
Citation Information
Patent Citations
Short-term photovoltaic power prediction method based on physical model and Informer
CN118822036A
Cited By
A physical orientation-based source-load interval prediction method, storage medium and device thereof
CN122198272A
A physical orientation-based source-load interval prediction method, storage medium and device thereof
CN122198272B