Distributed photovoltaic ultra-short-term power prediction method and system
By combining Seq2Seq with GRU, a distributed photovoltaic ultra-short-term power prediction model is constructed, which solves the problems of low automation and insufficient utilization of multi-source data in existing technologies, and achieves efficient and accurate photovoltaic power prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN RICHSOFT ELECTRIC POWER INFORMATION TECH
- Filing Date
- 2025-11-17
- Publication Date
- 2026-04-10
AI Technical Summary
Existing ultra-short-term photovoltaic power prediction methods rely on empirical processing strategies, making it difficult to achieve full automation. They fail to effectively capture the complex spatiotemporal coupling characteristics of photovoltaic power sequences and do not fully utilize multi-source meteorological and environmental information, resulting in insufficient model adaptability and robustness.
By combining a Seq2Seq structure with a GRU, and through the collaborative work of the encoder and decoder, a fully automated learning process is achieved. Multi-source meteorological and environmental data are integrated to perform multi-step feature extraction and temporal relationship modeling, thereby constructing a distributed photovoltaic ultra-short-term power prediction model.
It achieves fully automated learning, improving prediction accuracy and model robustness. In particular, it can accurately capture the physical causes of photovoltaic power fluctuations under complex weather conditions, providing an efficient and accurate ultra-short-term photovoltaic power prediction solution.
Smart Images

Figure CN121840552A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of photovoltaic power prediction, in particular to a distributed photovoltaic ultra-short-term power prediction method. BACKGROUND
[0002] With the growth of global energy demand and the improvement of environmental protection awareness, renewable energy has become a research hotspot in the energy field. Photovoltaic power generation relies on solar energy, and its output is affected by many factors such as solar radiation intensity, weather conditions, geographical location, etc., which has volatility and uncertainty, bringing challenges to the stable operation of the power system. Accurate prediction of photovoltaic power output helps power grid operators to plan power resource allocation in advance, reasonably arrange conventional power generation plans according to the prediction results, ensure power supply and demand balance, and improve power system operation efficiency.
[0003] In the current field of ultra-short-term photovoltaic power prediction, traditional prediction methods still have obvious shortcomings: (1) Some methods rely on empirical processing strategies. When selecting and optimizing the data reconstruction components, the prior knowledge of the field experts is needed for parameter tuning, resulting in more manual intervention in the model construction process, making it difficult to achieve full automation and unable to meet the requirements of end-to-end learning.
[0004] (2) The traditional single-step prediction mechanism cannot effectively capture the complex spatio-temporal coupling characteristics in the photovoltaic power sequence. Due to the lack of in-depth mining of multi-time scale features, the prediction accuracy is further improved and faces a bottleneck.
[0005] (3) Some existing methods only rely on a single data source of photovoltaic power historical data, and fail to fully utilize multi-source meteorological and environmental information that affects photovoltaic output, resulting in insufficient adaptability and robustness of the model under complex weather conditions. SUMMARY
[0006] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, one purpose of the present application is to propose a distributed photovoltaic ultra-short-term power prediction method and system. The method realizes the full-automatic learning from the original data input to the prediction result output through the synergistic effect of the encoder and decoder structure, without human intervention in the intermediate link, thereby effectively overcoming the dependence of traditional methods on empirical knowledge. At the same time, the model has multi-step feature extraction and time series relationship modeling capabilities, and can fuse multi-source meteorological and environmental data, significantly improving the prediction accuracy and model robustness on the basis of ensuring the calculation efficiency, providing an efficient and accurate solution for ultra-short-term photovoltaic power prediction.
[0007] In order to solve the above problems, the present application provides a distributed photovoltaic ultra-short-term power prediction method, comprising the following steps: S1 performs multi-source data processing according to numerical weather forecast data and local measurement data of the photovoltaic power station, including constructing input feature sequences and output power sequences through a sliding window, performing outlier detection, correlation analysis, adding time features and normalization processing on the data, to obtain preprocessed training set, validation set and test set; S2 performs model construction according to the preprocessed training set, validation set and test set obtained in S1, and constructs a prediction model based on a sequence-to-sequence (Seq2Seq) structure and a gated recurrent unit (GRU), which includes an encoder and a decoder, the encoder adopts a bidirectional GRU layer, and the decoder adopts a GRU layer, the prediction sequence is generated through encoder state transmission and decoder autoregression, to obtain an initialized Seq2Seq-GRU prediction model; S3 performs model training and prediction according to the initialized Seq2Seq-GRU prediction model obtained in S2 and the training set and validation set obtained in S1, trains and optimizes the model using the training set, implements early stopping control through the validation set to avoid overfitting, obtains a trained prediction model, evaluates the model performance using the test set, and outputs the ultra-short-term photovoltaic power prediction result; S4 performs comparative verification according to the ultra-short-term photovoltaic power prediction result obtained in S3, verifies the advantages of multi-source data input and model structure through comparative experiments, including performance comparison with single data source method and other prediction models, and robustness verification under different weather conditions, obtains model performance evaluation conclusion, and is used for optimizing actual application.
[0008] Preferably, the specific way of constructing input feature sequences and output power sequences through a sliding window in S1 includes: The length of the first input window is set to 96, representing 24 hours of data in the past, and the first input feature sequence I1 is: I1=(x t ,x t …,x t ,x t );(1) t Where t represents a certain time, and x t represents the feature at time t: t x t =(ngi t ,ndi t ,nt t ,nh t ,nws t ,nwd t ,np t ,lti t ,ldi t ,lt t ,lp t ,lwd tlws t ,p t ) ; (2) where ngi t represents numerical weather prediction-global horizontal irradiance, ndi t represents numerical weather prediction-direct irradiance, nt t represents numerical weather prediction-temperature, nh t represents numerical weather prediction-humidity, nws t represents numerical weather prediction-wind speed, nwd t represents numerical weather prediction-wind direction, np t represents numerical weather prediction-atmospheric pressure, lti t represents local measurement-total irradiance, ldi t represents local measurement-diffuse irradiance, lt t represents local measurement-environmental temperature, lp t represents local measurement-pressure, lwd t represents local measurement-wind direction, lws t represents local measurement-wind speed, p t represents the output power at time t; The second input window length is set to 16, representing the future 4 hours of weather forecast data, and the second input feature sequence I2 is: I2=(x t+1′ ,x t+2 ′,…,x t+16′ ) ; (3) where x t+1′ represents the feature at time t+1, and is expressed as: x t+1′ =(ngi t+1 ,ndi t+1 ,nt t+1 ,nh t+1 ,nws t+1 ,nwd t+1 ) ; (4) The output window length is set to 16, representing the predicted future 4 hours of photovoltaic power, and the output power sequence y is: y=(p t+1 ,p t+2 ,…,p t+16 ) ; (5) The sliding step is set to 3 to maximize the number of samples.
[0009] Preferably, the anomaly value detection in S1 uses a mutation detector, and the detection formula is: ; (6) Wherein, Anomaly represents an outlier, M right is the right window, M left is the left window, and epsilon is a threshold value; the detected outlier is treated as a missing value, and linear interpolation is used for repair, so the interpolation formula is ; (7) Wherein, y x represents a missing point value, y a represents a previous non-missing point value, y b represents a subsequent non-missing point value, t a represents a previous non-missing point, and t b represents a subsequent non-missing point.
[0010] Preferably, the correlation analysis in S1 uses the Pearson correlation coefficient, and the calculation formula is as follows: ; (8) Wherein, p X,Y represents the Pearson correlation coefficient, X represents meteorological data, Y represents photovoltaic power data, sigma X represents the standard deviation of X, and sigma Y represents the standard deviation of Y; features with absolute values higher than a preset threshold value are retained, and the threshold value is set to 0.3.
[0011] Preferably, the normalization processing in S1 uses the maximum-minimum normalization method, and the formula is as follows: ; (9) Wherein, x' is the normalized value, x is the value to be normalized, max(x) represents the maximum value of x, and min(x) represents the minimum value of x.
[0012] Preferably, the specific process of model construction in S2 includes: Encoder part: first layer BiGRU encoding, forward GRU calculation formula is , backward GRU calculation formula is , and the final hidden state ; Second layer BiGRU encoding, forward GRU calculation formula is , backward GRU calculation formula is , and the final hidden state H 2 = ; Encoder state transmission: H2 is transmitted to the decoder through repeated expansion mechanism, and the formula is: ; Decoder part: the first layer GRU decoding formula is , and the initial state The second layer GRU decoding formula is , the initial state ; Feature fusion: the fusion formula is ; Output layer: nonlinear transformation is performed through a time distribution fully connected layer Final output .
[0013] Preferably, the hyperparameter settings of the model in S2 include: The input feature dimension is 96 time steps x 11 features; the number of hidden nodes of the encoder BiGRU layer is 32; the number of hidden nodes of the decoder GRU layer is 64; the number of nodes of the fully connected layer is 64 and 1; the optimizer is Adam, the learning rate is 0.00003, the loss function is mean square error, the number of iterations is 100, and the early stopping mechanism patience value is 10.
[0014] Preferably, the model evaluation in S3 uses the mean absolute error MAE and the root mean square error RMSE indicators, and the calculation formulas are respectively: ; Wherein, is the true value, is the predicted value, and n is the sample number; the MAE of the model on the test set is 0.02, and the RMSE is 0.04.
[0015] A system used in a distributed photovoltaic ultra-short-term power prediction method, comprising: A data acquisition module for acquiring numerical weather prediction data and local measurement data of a photovoltaic power station; A data processing module configured to perform sliding window construction, outlier detection, correlation analysis, time feature addition, and normalization processing, the sliding window construction uses formulas (1) to (5), the outlier detection uses formulas (6) and (7), the correlation analysis uses the Pearson formula of formula (8), and the normalization uses formula (9); A model training module including a Seq2Seq model with an encoder-decoder structure, the encoder uses a BiGRU layer, and the decoder uses a GRU layer; A prediction output module for generating an ultra-short-term photovoltaic power prediction result and evaluating based on the mean absolute error MAE and the root mean square error RMSE indicators; A verification module for performing comparative verification with a single data source method and other models to verify robustness.
[0016] Preferably, the system further comprises a visualization module for drawing a comparison chart of the predicted curve and the real curve to intuitively show the model fitting effect; the output of the visualization module includes the prediction results under different weathers.
[0017] The distributed photovoltaic ultra-short-term power prediction method and system of the present application has the following advantages compared with the prior art: (1) The Seq2Seq-based ultra-short-term prediction model can realize full-process automatic learning, get rid of the dependence on prior knowledge of domain experts, and meet the end-to-end learning needs.
[0018] (2) With powerful multi-step feature extraction and time sequence relationship modeling capabilities, complex spatiotemporal coupling features can be deeply mined, the prediction accuracy can be greatly improved while maintaining the computing efficiency, and an efficient and accurate solution for ultra-short-term photovoltaic power prediction is provided.
[0019] (3) The introduction of meteorological and other multi-source data can effectively provide additional information, and the model can more accurately capture the physical causes of power fluctuations (such as cloud cover causing a sharp drop in irradiance) by learning and fusing these information, thereby improving the prediction accuracy, especially in the scenario of weather mutation. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.
[0021] Fig. 1 The method flowchart of the present application.
[0022] Fig. 2 The model prediction result curve chart under different weathers obtained by using the method of the present application (wherein a is sunny weather, b is cloudy weather, c is rainy weather, and d is smog weather). DETAILED DESCRIPTION
[0023] The embodiments of the present application will be described in detail below, and examples of the embodiments are shown in the drawings, wherein the same or similar reference signs represent the same or similar elements or elements with the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application.
[0024] In the description of the present application, it should be noted that unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connecting" should be understood in a broad sense, for example, it can be fixed connection, or detachable connection, or integrally connected; it can be mechanical connection, or electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0025] The present application will be further described in detail below with reference to the accompanying drawings.
[0026] In combination Figs. 1-2 , a distributed photovoltaic ultra-short-term power prediction method of the present application comprises: (1) Multi-source data processing ① Data processing Sliding window construction of input and output: The meteorological data of the photovoltaic power station includes two types of numerical weather prediction (NWP) of meteorological service and local measurement data (LMD) of the photovoltaic power station. The numerical weather prediction includes 7 types of data: numerical weather prediction-global horizontal irradiance, numerical weather prediction-direct irradiance, numerical weather prediction-temperature, numerical weather prediction-humidity, numerical weather prediction-wind speed, numerical weather prediction-wind direction and numerical weather prediction-pressure, and the local measurement data includes 6 types of data: local measurement-total irradiance, local measurement-diffuse irradiance, local measurement-environmental temperature, local measurement-pressure, local measurement-wind direction, local measurement-wind speed. The input feature sequence and the output power sequence are constructed by using sliding window.
[0027] The input feature sequence is divided into two sequences, the first input feature sequence is the combination of the day-ahead numerical weather prediction (NWP) feature sequence, the day-ahead local measurement data (LMD) feature sequence and the day-ahead photovoltaic power sequence, and the second input feature sequence is the numerical weather prediction (NWP) feature sequence of the future 4 hours. The first input window length is set to 96, representing the data of the past 24 hours. The first input feature sequence is shown as formula (1): (1) Wherein, represents the first feature sequence, represents a certain time, represents the feature at time , as shown in formula (2): (2) Wherein, represents Instantaneous numerical weather prediction - global horizontal irradiance, represents Instantaneous numerical weather prediction - direct irradiance, represents Instantaneous numerical weather prediction - temperature, represents Instantaneous numerical weather prediction - humidity, represents Instantaneous numerical weather prediction - wind speed, represents Instantaneous numerical weather prediction - wind direction, represents Instantaneous numerical weather prediction - atmospheric pressure, represents Instantaneous local measurement - total irradiance, represents Instantaneous local measurement - diffuse irradiance, represents Instantaneous local measurement - ambient temperature, represents Instantaneous local measurement - pressure, represents Instantaneous local measurement - wind direction, represents Instantaneous local measurement - wind speed, represents Instantaneous output power. The second input window length is set to 16, representing the weather forecast data for the next 4 hours, and the second input feature sequence is shown in equation (3): (3) wherein represents the second feature sequence, represents the feature at time t, as shown in equation (4): (4) The output window is set to 16, representing the predicted photovoltaic power for the next 4 hours. The output power sequence is the sequence of future photovoltaic power values, which is shown in equation (5).
[0028] (5) The sliding step is set to 3, and the interval of each sliding is sampled, thereby maximizing the number of samples as much as possible.
[0029] Outlier detection: Outliers are detected by using the mutation detector and treated as missing values. The degree of missing values of variables is calculated, and the independent variables with a missing degree greater than 60% are removed; the remaining feature variables are used as the input variables of the screened model, and the missing values are filled by linear interpolation. The threshold detection formula is shown in equation (6): (6) wherein represents an outlier, is a left window, is a right window, is a threshold.
[0030] The linear interpolation formula is shown in equation (7): (7) wherein represents a missing point value, represents a previous non-missing point value, represents a subsequent missing point value, represents a previous non-missing point, represents a subsequent non-missing point.
[0031] Correlation analysis: The Pearson correlation between meteorological data (13 types of data such as numerical weather prediction-global horizontal irradiance, local measurement-total irradiance, etc.) and photovoltaic power is calculated, and the independent variables with a correlation less than 0.3 are removed. The formula for calculating the Pearson correlation coefficient is: wherein represents, represents meteorological data, represents photovoltaic power data, represents standard deviation, represents standard deviation.
[0032] Add time features: Add hour features to reflect the periodic change of data within a day; add date features for time series modeling and date calculation.
[0033] Normalization: The data is scaled to 0 to 1 by using the maximum-minimum normalization method, and the formula is shown in equation (9).
[0034] (9) wherein is the normalized value, is the value to be normalized, represents the maximum value of represents the minimum value of Dataset construction: First, the data set is divided by stratified sampling strategy, and the training set, validation set and test set are constructed in turn according to the ratio of 7:1.5:1.5. And the global random shuffle processing is carried out on the data set to ensure the randomness and unbiasedness of the sample distribution, and then the corresponding samples are extracted from the shuffled data set in equal proportion.
[0035] (2) Construction of ultra-short-term photovoltaic power prediction based on Seq2Seq and GRU ① Model structure The model structure of ultra-short-term photovoltaic power prediction based on Seq2Seq and GRU is shown in Fig. 2 The main structure of the prediction model is composed of an encoder, a decoder and a semantic vector according to the Seq2Seq model. The encoder is responsible for generating a semantic vector from an input sequence, while the decoder is responsible for generating a specified sequence according to the semantic vector. Through this structure, the model realizes the mapping from a variable-length input sequence to a variable-length output sequence, effectively solving the problem of fixed input and output length limitation in multi-step ahead prediction faced by traditional methods. In addition, the hidden layers of the encoder and decoder of the model use gated recurrent units as the core neural units. GRU can more effectively capture long-term dependencies in time series through its gating mechanism of update gate and reset gate, and alleviate the problem of gradient vanishing or explosion in traditional recurrent neural networks, thereby improving the performance of the model in time series prediction tasks.
[0036] The main process is as follows: Step one: First layer bidirectional GRU encoding. The first input feature sequence enters the encoder and is encoded by the first layer BiGRU. It mainly includes three parts: forward GRU calculation, backward GRU calculation and final state splicing. The forward GRU calculation formula is: , where represents the forward hidden state of the first layer BiGRU, represents the input at time t, is the previous time forward hidden layer state of the first layer BiGRU, represents the calculation process of the forward gated recurrent unit. The backward GRU calculation formula is: , where represents the backward hidden state of the first layer BiGRU, represents the next time backward hidden state of the first layer BiGRU, represents the calculation process of the backward gated recurrent unit. The calculation formula of the final state splicing is: , denotes the final hidden state of the second layer BiGRU, which is obtained by concatenating the forward hidden state and the backward hidden state of each time step of the second layer BiGRU.
[0037] Step two: second layer bidirectional GRU encoding. The feature sequence output by the first layer BiGRU is passed to the second layer BiGRU for encoding, which mainly includes three parts, forward GRU calculation, backward GRU calculation and final state splicing. The forward GRU calculation formula is: wherein denotes the forward hidden state of the second layer BiGRU, is the output of the first layer GRU at time, is the previous time forward hidden layer state of the second layer BiGRU. The backward GRU calculation formula is: wherein denotes the next time backward hidden state of the second layer BiGRU, , denotes the calculation process of the backward gated recurrent unit, and the calculation formula of the final state splicing is: , denotes the final hidden state of the second layer BiGRU, which is obtained by concatenating the forward hidden state and the backward hidden state of each time step of the second layer BiGRU.
[0038] Step three: encoder state transmission. The hidden state output by the second layer BiGRU and the output state of the first layer jointly constitute the final state representation of the encoder, which is used as the initial input of the decoder. The state repetition mechanism formula is: wherein is the repeated and expanded encoder state tensor, is the tensor repetition expansion operation, is the final hidden state of the second layer BiGRU of the encoder, is the number of future time steps to be predicted.
[0039] Step four: first layer decoder GRU decoding. The first layer decoding calculation formula is: wherein denotes the final hidden state of the first layer of the decoder at time step , denotes the decoder first layer GRU calculation function, denotes the external input feature of the decoder, denotes the hidden state of the decoder first layer at time step t-1, denotes the final hidden state of the first layer BiGRU, denotes the final hidden state of the second layer of the decoder at time step
[0040] Step five: second layer decoder GRU decoding. The second layer decoding calculation formula is: , denotes the final hidden state of the second layer of the decoder at time step , denotes the gating recurrent unit calculation function of the second layer of the decoder, denotes the output state of the first layer of the decoder at time step t, denotes the final hidden state of the second layer of the decoder at time step , denotes the hidden state of the second layer of the decoder at the initial time step, is the final hidden state of the second layer of the encoder BiGRU.
[0041] Step six: feature fusion. The feature fusion calculation formula is: wherein denotes the fusion feature vector at time step , denotes the slice of the repeated and expanded second layer state of the encoder at time step , denotes the hidden state of the second layer of the decoder at time step .
[0042] Step seven: time distribution fully connected layer. The time distribution fully connected layer mainly includes nonlinear transformation and output. The nonlinear transformation calculation formula is: wherein denotes the activation value after nonlinear transformation, denotes the linear unit activation function, denotes the weight matrix of the fully connected layer, denotes the fusion feature vector at time step , denotes the bias vector of the fully connected layer. The final output calculation formula is: wherein denotes the predicted output of the model at time step , denotes the weight matrix of the output layer, denotes the activation value after nonlinear transformation, denotes the bias term of the output layer.
[0043] The model adopts a bidirectional gated recurrent unit in the encoder part, which can integrate the global context information of the input sequence. This means that during the encoding process, the feature representation at each time point is determined by the information of the entire sequence, including all past and future time points, to generate a context vector that contains richer temporal patterns, providing more comprehensive information support for subsequent decoding prediction. The main task of the decoder part of the model is to generate future prediction sequences autoregressively, so a unidirectional GRU is used. This structure design fully utilizes the bidirectional feature extraction capability of BiGRU and the advantage of the gating mechanism of GRU, realizing effective modeling and accurate prediction of multi-source time series data.
[0044] ② Model parameter settings Input layer: The input feature dimension is 96 historical time steps, and each time step contains 11 features.
[0045] First layer encoder: Network type is BiGRU, and the number of hidden layer nodes is 32.
[0046] Second layer encoder: Network type is BiGRU, and the number of hidden layer nodes is 32.
[0047] First layer decoder: Network type is GRU, and the number of hidden layer nodes is 64.
[0048] Second layer decoder: Network type is GRU, and the number of hidden layer nodes is 64.
[0049] First layer full connection layer: Network type is TimeDistributed Dense, number of nodes is 64, and activation function is ReLU.
[0050] Second layer full connection layer: Network type is TimeDistributed Dense, number of nodes is 1, and activation function is linear activation.
[0051] In terms of hyperparameters, the model uses Adam optimizer and mean square error as the loss function. The number of iterations is set to 100, the value of 1r is set to 0.00003, and the parameters of the Adam optimizer are set to default values. The early stopping mechanism is set, and the patience value is 10.
[0052] ③ Prediction results and evaluation The root mean square error (RMSE) and mean absolute error (MAE) are used to quantify and evaluate the results. The results show that the MAE of the model on the test data set is 0.02, and the RMSE is 0.04, which can effectively complete the photovoltaic power prediction task.
[0053] (3) Effect comparison ① Comparison with the prediction method of a single data source To verify the contribution of multi-source data fusion to the prediction performance, the multi-source input (including irradiance, temperature, wind speed, and other meteorological data) of the present application is replaced with only historical photovoltaic power data while keeping the prediction model structure consistent. Test results show that the MAE of the model under single data source conditions is 0.04, and the RMSE is 0.09; after using multi-source data input, both error indicators are significantly reduced, fully demonstrating the key role of multi-source data in improving prediction accuracy.
[0054] ② Comparison of performance with other prediction models To comprehensively evaluate the performance advantages of the model proposed in the present application, it is compared with a variety of mainstream prediction methods, including a benchmark model based on Seq2Seq structure and a prediction model based on Transformer. Experimental results show that the model proposed in the present application based on the combination of Seq2Seq and GRU is superior to the comparison methods in multiple evaluation indicators, especially in capturing complex temporal dependencies and multivariate coupling relationships, showing stronger modeling ability, further verifying the effectiveness and advancement of the model structure design in the present application.
[0055] ③ Robustness verification To evaluate the robustness of the model under different weather conditions, the data set is statistically analyzed under different weather conditions. As shown in Fig. 2 , although the model prediction accuracy shows normal fluctuations within expectations under complex weather conditions such as cloudy, rainy, and smoggy weather, the performance decay is limited, and the error indicators remain within an acceptable range. This result shows that the model proposed in the present application is not sensitive to weather changes, has good generalization ability and robustness, and can meet the stable prediction needs of various weather scenarios in actual applications.
[0056] Finally, the unfinished parts of the present application all use mature products and mature technical means in the prior art.
[0057] The present application and its embodiments have been described above, which is not restrictive, and the embodiments shown in the drawings are only one of the embodiments of the present application, and the actual structure is not limited thereto. In summary, if a person skilled in the art is inspired by it, without departing from the purpose of the present application, without creative design, similar structural methods and embodiments of the technical solution should belong to the protection scope of the present application.
Claims
1. A method for predicting ultra-short-term power output of distributed photovoltaic systems, characterized in that: Includes the following steps: S1 performs multi-source data processing based on numerical weather forecast data and local measurement data from photovoltaic power plants. This includes constructing input feature sequences and output power sequences through a sliding window, performing outlier detection, correlation analysis, adding time features, and normalization on the data to obtain preprocessed training sets, validation sets, and test sets. S2 constructs a model based on the preprocessed training set, validation set, and test set obtained from S1. It builds a prediction model based on the sequence-to-sequence Seq2Seq structure and gated recurrent unit (GRU). The model includes an encoder and a decoder. The encoder uses a bidirectional GRU layer, and the decoder uses a GRU layer. The prediction sequence is generated through encoder state propagation and decoder autoregression to obtain the initialized Seq2Seq-GRU prediction model. S3 uses the initialized Seq2Seq-GRU prediction model obtained in S2 and the training and validation sets obtained in S1 to train and predict the model. The training set is used to train the model and optimize the hyperparameters. Early stopping control is implemented through the validation set to avoid overfitting. The trained prediction model is obtained, and the model performance is evaluated using the test set. The ultra-short-term photovoltaic power prediction results are output. Based on the ultra-short-term photovoltaic power prediction results obtained from S3, S4 conducts comparative verification. Through comparative experiments, it verifies the advantages of multi-source data input and model structure, including performance comparison with single data source methods and other prediction models, as well as robustness verification under different weather conditions. The model performance evaluation conclusions are obtained for optimization of practical applications.
2. The distributed photovoltaic ultra-short-term power prediction method according to claim 1, characterized in that: The specific methods for constructing the input feature sequence and output power sequence using the sliding window described in S1 include: Setting the first input window length to 96, representing a review of data from the past 24 hours, then the first input feature sequence I1 is: I1=(x t-95 ,x t-94, …,x t-1 ,x t );(1) Where t represents a certain moment, x t Characteristics at time t: x t =(you t ,I t ,nt t ,nh t ,nws t ,nwd t ,np t ,lti t ,ldi t ,lt t ,lp t ,lwd t ,lws t ,p t (2) In the formula, ngi t Indicates numerical weather prediction - global horizontal irradiance, ndi t Numerical weather forecast - direct irradiance, nt t This indicates numerical weather forecast - temperature, nh t Numerical weather forecast - humidity, nws t This indicates numerical weather forecast - wind speed, nwd t Indicates numerical weather forecast - wind direction, np t LTI represents numerical weather forecast - atmospheric pressure. t LDI represents the local measurement of total irradiance. t Indicates local measurement - diffuse irradiance, lt t Indicates local measurement - ambient temperature, lp t Indicates local measurement - pressure, lwd t Indicates local measurement - wind direction, lws t Indicates local measurement - wind speed, p t This represents the output power at time t; If the length of the second input window is set to 16, representing the weather forecast data for the next 4 hours, then the second input feature sequence I2 is: I2=(x t+1′ ,x t+2 ′,…,x t+16′ );(3) Where, x t+1′ The characteristic at time t+1 is represented as: x t+1′ =(my t+1 ,the t+1 ,nt t+1 ,h t+1 ,it t+1 ,nwd t+1 );(4) Setting the output window length to 16 to represent the predicted photovoltaic power for the next 4 hours, the output power sequence y is then: y=(p t+1 ,p t+2 ,…,p t+16 );(5) The sliding step size is set to 3 to maximize the number of samples.
3. The distributed photovoltaic ultra-short-term power prediction method according to claim 1, characterized in that: The outlier detection described in S1 uses a mutation detector, and the detection formula is: ;(6) Where Anomaly represents outliers, M right For the right window, M left Let ε be the threshold value and ε be the left window. Detected outliers are treated as missing values and repaired using linear interpolation. The interpolation formula is as follows: ;(7) Among them, y x Indicates the missing point value, y a y represents the previous non-missing point value. b t represents the value of the next non-missing point. a t represents the previous non-missing point. b This indicates the next non-missing point.
4. The distributed photovoltaic ultra-short-term power prediction method according to claim 1, characterized in that: The correlation analysis described in S1 uses the Pearson correlation coefficient, calculated as follows: ;(8) Where, ρ X,Y Let X represent the Pearson correlation coefficient, Y represent the meteorological data, and σ represent the photovoltaic power data. X σ represents the standard deviation of X. Y This represents the standard deviation of Y; features with absolute values higher than a preset threshold are retained, with the threshold set to 0.
3.
5. The distributed photovoltaic ultra-short-term power prediction method according to claim 1, characterized in that: The normalization process described in S1 uses the max-min normalization method, as shown in the following formula: ;(9) Where x′ is the normalized value, x is the value to be normalized, max(x) represents the maximum value of x, and min(x) represents the minimum value of x.
6. The distributed photovoltaic ultra-short-term power prediction method according to claim 1, characterized in that: The specific process of model construction described in S2 includes: Encoder section: First layer BiGRU encoding, forward GRU calculation formula is as follows: The formula for calculating backward GRU is: Ultimately hidden state ; The second-layer BiGRU encoding, the forward GRU calculation formula is as follows: The formula for calculating backward GRU is: Ultimately hidden state H 2 = ; Encoder state transfer: H2 is transferred to the decoder via a repeating extension mechanism, as shown in the formula: ; Decoder section: The first-layer GRU decoding formula is as follows: initial state The second-layer GRU decoding formula is: initial state ; Feature fusion: The fusion formula is as follows ; Output layer: Nonlinear transformation is performed through a time-distributed fully connected layer. Final output .
7. The distributed photovoltaic ultra-short-term power prediction method according to claim 1, characterized in that: The hyperparameter settings for the model described in S2 include: The input feature dimension is 96 time steps × 11 features; the encoder BiGRU layer has 32 hidden nodes; the decoder GRU layer has 64 hidden nodes; the fully connected layer has 64 and 1 nodes; the optimizer is Adam with a learning rate of 0.00003, the loss function is mean squared error, the number of iterations is 100, and the early stopping mechanism patience value is 10.
8. The distributed photovoltaic ultra-short-term power prediction method according to claim 1, characterized in that: The model evaluation described in S3 uses the Mean Absolute Error (MAE) and Root Mean Square Error (RMSE) as indices, calculated using the following formulas: ; in, For the true value, is the predicted value, n is the number of samples; the model's MAE is 0.02 and RMSE is 0.04 on the test set.
9. A system used in the distributed photovoltaic ultra-short-term power prediction method as described in claims 1-8, characterized in that, include: Data acquisition module: used to acquire numerical weather forecast data and local measurement data of photovoltaic power plants; Data processing module: configured to perform sliding window construction, outlier detection, correlation analysis, addition of time features and normalization processing. The sliding window construction adopts equations (1) to (5), the outlier detection adopts equations (6) and (7), the correlation analysis adopts Pearson's formula of equation (8), and the normalization adopts equation (9). Model training module: includes a Seq2Seq model with an encoder-decoder structure, where the encoder uses a BiGRU layer and the decoder uses a GRU layer; Prediction output module: used to generate ultra-short-term photovoltaic power prediction results and evaluate them based on the indicators of mean absolute error (MAE) and root mean square error (RMSE). Validation module: Used to perform comparative validation against single data source methods and other models to verify robustness.
10. The system used in the distributed photovoltaic ultra-short-term power prediction method according to claim 9, characterized in that: The system also includes a visualization module, which is used to draw a comparison graph of the predicted curve and the actual curve to intuitively show the model fitting effect; the output of the visualization module includes the prediction results under different weather conditions.