A very short-term photovoltaic power prediction method and system for real-time control

By normalizing the photovoltaic power generation data and building a deep learning framework, combined with BP neural network and LSTM network, the problem of insufficient time scale and low accuracy in traditional prediction methods is solved, and a resolution of 1 minute is achieved Extremely short-term photovoltaic power prediction meets the real-time control needs of photovoltaic power plants.

CN118554446BActive Publication Date: 2024-11-15NANJING GUODIAN NANZI WEIMEIDE AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410994130.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-15
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

The traditional photovoltaic power output prediction method has the problem of insufficient prediction time scale and low prediction accuracy, which is difficult to meet the flexible control needs of photohydrogen storage stations.

Method used

The limit values ​​of the year-round statistics are used to normalize radiation, temperature, humidity and photovoltaic power data, and build a double-layer photovoltaic output prediction framework based on deep learning, combining BP neural network and long-term and short-term recurrent neural network to optimize losses in time segments Function, through spline interpolation and moving time window filtering technology, extremely short-term photovoltaic power prediction with a resolution of 1 minute is achieved.

Benefits of technology

The time scale and accuracy of photovoltaic power prediction are improved, the real-time control needs of photovoltaic power stations are met, and the efficiency and economicality of operational decisions are significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118554446B_ABST
    Figure CN118554446B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of very short-term photovoltaic power prediction, and in particular to a very short-term photovoltaic power prediction method and system for real-time control, which aims to improve the accuracy and real-time performance of photovoltaic power prediction. Meteorological data is normalized and feature correlation analysis is performed; a BP neural network is used to predict short-term photovoltaic power, meteorological data and historical output data are input, and a short-term prediction value with a resolution of 15 minutes is output; spline interpolation and outlier removal are performed on the upper layer results of the BP neural network, and the results are used as inputs of long-term and short-term recurrent neural networks to improve the time resolution of the prediction data, and very short-term photovoltaic power prediction data with a resolution of 1 minute is obtained. By comprehensively considering meteorological factors and adopting advanced neural network models and data processing technologies, photovoltaic power prediction on an extremely short time scale can be achieved while ensuring prediction accuracy, which is suitable for real-time control and optimized operation of photovoltaic power stations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of very short-term photovoltaic power prediction, and in particular to a very short-term photovoltaic power prediction method and system for real-time control. Background Art

[0002] Since photovoltaic power generation output has the characteristics of strong randomness, the operation of photovoltaic power stations is complex and changeable, which can easily cause safety hazards and economic losses. Therefore, the study of photovoltaic power generation output prediction methods is of great significance to the performance monitoring, fault detection, operation control, etc. of photovoltaic power stations. There are many methods for predicting photovoltaic power generation output. According to different prediction forms, the prediction of photovoltaic power generation output is mainly divided into point prediction, interval prediction and probability prediction. Point prediction belongs to deterministic prediction, which gives a certain output prediction value at a certain future moment; interval prediction gives the output upper and lower bounds at a given confidence level, and probability prediction gives the expected output value and probability distribution information at future moments, which are collectively referred to as uncertainty prediction. The method proposed in the present invention is mainly used for real-time control of photovoltaic power stations, so the point prediction method is mainly discussed here. Since the artificial intelligence method does not need to obtain a specific expression between input and output, it obtains a prediction model for photovoltaic power generation output by training historical data. This type of method requires a large amount of historical data, is simple to operate, and is easy to implement. Artificial intelligence prediction methods have become one of the most commonly used photovoltaic power generation output point prediction methods. However, the current traditional artificial intelligence prediction method research focuses on short-term predictions for the next one to ten days and ultra-short-term predictions for the next four hours, with a time resolution of fifteen minutes. There are generally problems such as insufficient precision in the prediction time scale and low prediction accuracy, which makes it difficult to meet the needs of flexible control of photovoltaic hydrogen storage stations. Summary of the invention

[0003] In view of the above problems existing in the prior art, the present invention is proposed.

[0004] Therefore, the present invention provides an extremely short-term photovoltaic power prediction method for real-time control, which can solve the problem that the traditional prediction scale is not fine enough and the prediction accuracy is not high.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: a very short-term photovoltaic power prediction method for real-time control, comprising: using the extreme values ​​of annual statistics to normalize the radiation, temperature, humidity and photovoltaic power data to obtain the variable and photovoltaic power time series, performing feature correlation analysis, and constructing a double-layer photovoltaic output prediction framework based on deep learning; based on the BP neural network, short-term photovoltaic power prediction is carried out, with meteorological data and historical output data as input, and the loss function is optimized in different time periods to obtain the upper short-term prediction value with a resolution of 15min; spline interpolation is performed on the upper results, outliers are extracted by box plot and violin plot, and outliers are cleared by moving time window filtering, and the resolution of the prediction data is improved based on the long-term and short-term recurrent neural network, while taking into account the prediction time scale and prediction accuracy, the lower-layer very short-term photovoltaic power prediction data with a resolution of 1min is obtained.

[0006] As a preferred solution of the very short-term photovoltaic power prediction method for real-time control described in the present invention, wherein: the normalization processing is expressed as,

[0007] ,

[0008] in, is the nth data to be processed, and are the maximum and minimum values ​​of the variable respectively;

[0009] The correlation between various meteorological factors and photovoltaic output was analyzed, and the numerical weather forecast and historical measured meteorology in the meteorological data of photovoltaic power stations and the active power generation power in the historical output data were determined as the input layer sample data of the BP neural network training process.

[0010] As a preferred solution of the very short-term photovoltaic power prediction method for real-time control described in the present invention, wherein: the BP neural network includes an input layer, a hidden layer and an output layer;

[0011] The input layer includes the output power of the photovoltaic power station, which is related to the solar radiation intensity and is also affected by temperature, relative humidity and cloud cover. The correlation analysis of the relationship between various meteorological factors and photovoltaic output is combined to determine the predicted solar radiation intensity in the numerical weather forecast of the photovoltaic power station, the actual solar radiation intensity of the historical measured meteorology and the active power generation power in the historical output data as the input layer sample data of the BP neural network training process;

[0012] The output layer performs short-term power forecasting, and the output layer outputs data that is the output power sequence of the photovoltaic power station in the next 24 hours, with a time interval of 15 minutes;

[0013] The selection of the number of neurons in the hidden layer is related to the scale and accuracy of the neural network. According to the Kolmogorov theorem, if the number of input variables is n, the number of neurons in the hidden layer is 2n+1. The number of neurons in the hidden layer is determined by repeated trials.

[0014] The BP neural network training process is related to the prediction accuracy of the output power model of the photovoltaic power generation system. By combining the BP learning algorithm with the added motion term and the BP learning algorithm with a variable learning rate, improvements are made to increase the convergence speed and reduce the probability of falling into a local minimum.

[0015] As a preferred solution of a very short-term photovoltaic power prediction method for real-time control described in the present invention, wherein: the BP learning algorithm combined with the added motion term and the BP learning algorithm with a variable learning rate includes sequentially inputting P samples and calculating the output and back propagation error of each layer; when all P samples are calculated, adjusting the connection weights of each layer according to the weight adjustment formula; calculating the output, back propagation error and total network error of each layer according to the new connection weights ,like or , then terminate the training process; if and , re-input P samples, calculate the output and back propagation error of each layer, and conduct a new round of training;

[0016] Among them, the number of training samples is P, T is the maximum number of training times, Allowable error of the system

[0017] As a preferred solution of the very short-term photovoltaic power prediction method for real-time control described in the present invention, wherein: the use of moving time window filtering to remove outliers includes performing spline interpolation on the results obtained by the upper BP network, displaying quartiles and medians, and data density distribution according to box plots and violin plots, preliminarily judging the concentration and dispersion of data by observing the shape and peak of the graph, combining statistical methods to identify outliers, and using interquartile range to define outliers;

[0018] Four hours were selected as the moving time window size, the mean and median statistics of the data within the window were calculated, the statistics within the window were used to replace the outliers, and then the time window was moved forward by one time unit until all the data were processed. After data cleaning, the outliers were removed.

[0019] As a preferred solution of the very short-term photovoltaic power prediction method for real-time control described in the present invention, wherein: the long-term and short-term recurrent neural network is used to improve the resolution of the prediction data, which is represented by the memory cell unit being the core component of the LSTM network, and the input of the model includes Time series input , Hidden layer cell state at the moment and memory unit ; Output contains the memory cell state With the hidden layer state ,in and Each contains the long-term and short-term memory information of the model. By controlling the input gate, forget gate and output gate, the memory cell unit can be read and modified to carry out the information flow between the networks. Tanh represents the activation function of tanh. The input gate uses the sigmoid activation function to input the parameters and control the variables between [0,1] to achieve right The forget gate selectively forgets the neuron state at the previous moment. The specific form is to use the memory unit right The output gate is used to output and control parameter variables, that is, to use right The calculation formulas are as follows:

[0020] ,

[0021] Among them, i t 、f t , o t Respectively represent the state calculation results of the input gate, forget gate and output gate; W ix and W ih , W fx and W fh , W ox and W oh With b i , b f , b o Represent the weight matrix and bias term of the corresponding gate respectively; Represents the sigmoid activation function.

[0022] The output result of the memory module at time t in the LSTM model is determined by the output gate and the unit state. The formula is as follows:

[0023] ,

[0024] In the formula, represents the unit state input at time t; tanh is the hyperbolic tangent activation function; W c , b c Represent the state weight matrix and bias term of the input layer respectively; It means that each element is multiplied by position.

[0025] Another object of the present invention is to provide an extremely short-term photovoltaic power prediction system for real-time control. The feature correlation analysis module enhances the understanding of the interaction between data through statistical normalization and time series analysis of environmental and power data, providing a solid data foundation for accurate prediction. The short-term power prediction module uses meteorological and historical output data and BP neural network to achieve optimized power resource allocation and cost control, significantly improving the efficiency and economy of operational decisions. The extremely short-term fine prediction module enhances the system's response speed to sudden climate changes through high-resolution prediction and advanced data processing technology, and improves the reliability of the power grid and the maintenance efficiency of photovoltaic equipment.

[0026] As a preferred solution of the ultra-short-term photovoltaic power prediction system for real-time control described in the present invention, it includes: a feature analysis module, a short-term power prediction module, and an ultra-short-term fine prediction module;

[0027] The characteristic analysis module uses the extreme values ​​of the whole year statistics to normalize the radiation, temperature, humidity and photovoltaic power data, obtains the variable and photovoltaic power time series, and performs characteristic correlation analysis;

[0028] The short-term power prediction module performs short-term photovoltaic power prediction based on BP neural network, takes meteorological data and historical output data as input, optimizes the loss function by time period, and obtains the upper short-term prediction value with a resolution of 15 minutes;

[0029] The very short-term fine prediction module performs spline interpolation on the upper layer results, extracts outliers using box plots and violin plots, removes outliers using moving time window filtering, improves the resolution of prediction data based on long-term and short-term recurrent neural networks, and obtains the lower layer very short-term photovoltaic power prediction data with a resolution of 1 minute while taking into account the prediction time scale and prediction accuracy.

[0030] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of any one of the methods of very short-term photovoltaic power prediction for real-time control are implemented.

[0031] A computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of any one of the methods of a very short-term photovoltaic power prediction method for real-time control are implemented.

[0032] Beneficial effects of the present invention: The method of the present invention comprehensively considers meteorological factors, adopts advanced neural network models and data processing technology, can realize photovoltaic power prediction on an extremely short time scale while ensuring prediction accuracy, and is suitable for real-time control and optimized operation of photovoltaic power stations. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0034] Figure 1 The present invention is a flowchart of a very short-term photovoltaic power prediction method for real-time control.

[0035] Figure 2 A schematic diagram of a BP network structure and learning process of a very short-term photovoltaic power prediction method for real-time control provided by an embodiment of the present invention.

[0036] Figure 3 An embodiment of the present invention provides a basic structure of an LSTM network for an extremely short-term photovoltaic power prediction method for real-time control.

[0037] Figure 4 A loss function variation trend of a training process of an extremely short-term photovoltaic power prediction method for real-time control provided by an embodiment of the present invention.

[0038] Figure 5 A schematic diagram comparing short-term prediction values ​​of a proposed method, short-term prediction values ​​of existing methods, and measured values ​​in a training set of an extremely short-term photovoltaic power prediction method for real-time control provided by an embodiment of the present invention.

[0039] Figure 6 A test set of a very short-term photovoltaic power prediction method for real-time control provided by an embodiment of the present invention shows a schematic diagram for comparing short-term prediction values ​​of the proposed method, short-term prediction values ​​of existing methods, and actual measured values.

[0040] Figure 7 A schematic diagram of a mean square error curve during a training process of a very short-term photovoltaic power prediction method for real-time control provided by an embodiment of the present invention.

[0041] Figure 8 A schematic diagram of a loss function curve during the training process of an extremely short-term photovoltaic power prediction method for real-time control provided by an embodiment of the present invention.

[0042] Fig. 9A schematic diagram showing comparison of prediction results of a training set of a very short-term photovoltaic power prediction method for real-time control provided by an embodiment of the present invention.

[0043] Fig.10 A schematic diagram showing comparison of prediction results of a test set of a very short-term photovoltaic power prediction method for real-time control provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0045] Example 1

[0046] Reference Figure 1-Figure 3 , which is the first embodiment of the present invention, provides an extremely short-term photovoltaic power prediction method for real-time control, comprising:

[0047] First, based on meteorological data and historical output data, we constructed Figure 1 The deep learning-based two-layer photovoltaic output prediction framework shown in the figure uses the complex nonlinear mapping approximation capability of the BP neural network and the long-short term recurrent neural network (LSTM) to capture and model the long-term dependencies in the power sequence data, and obtains photovoltaic output prediction data that can meet the real-time control requirements of photovoltaic power stations, solving the problems of insufficient prediction scale and low prediction accuracy.

[0048] Secondly, the upper layer conducts short-term photovoltaic power forecasting based on BP neural network, replaces the extreme value of annual statistics for normalization preprocessing and feature correlation analysis, optimizes the loss function by time period, obtains short-term forecast value with a resolution of 15 minutes, and improves the forecast accuracy;

[0049] Finally, the lower layer performs spline interpolation fitting on the upper layer results, uses box plots and violin plots to extract outliers, and uses moving time window filtering to remove outliers. Based on the long-short term recurrent neural network (LSTM), while taking into account the prediction time scale and prediction accuracy, the extremely short-term photovoltaic power prediction data with a resolution of 1 minute is obtained, thereby improving the resolution of the prediction data.

[0050] Compared with the prior art, the prediction method proposed in the present invention has good prediction accuracy and high-precision prediction resolution, and can meet the needs of real-time control.

[0051] S1: The radiation, temperature, humidity and PV power data are normalized using the extreme values ​​of the whole year statistics to obtain the time series of variables and PV power for feature correlation analysis.

[0052] It should be noted that the designed normalization and feature analysis method, when using multivariate time series for photovoltaic power prediction, has different dimensions between different input variables and large numerical differences. Considering the input and output range of the nonlinear activation function in the model, in order to avoid neuron saturation and to equally consider the effect of each variable on photovoltaic power, it is necessary to normalize the variables and photovoltaic power time series. The prediction model of the present invention adopts the Sigmoid excitation function, and the output is limited to 0~1. The inputs such as radiation, temperature, humidity and photovoltaic power are normalized using the extreme values ​​of the annual statistics, and their values ​​are reduced to the interval [0,1]. The expression is:

[0053] (1);

[0054] in, is the nth data to be processed, and are the maximum and minimum values ​​of the variable respectively;

[0055] The correlation between various meteorological factors and photovoltaic output was analyzed, and the numerical weather forecast and historical measured meteorology in the meteorological data of photovoltaic power stations and the active power generation power in the historical output data were determined as the input layer sample data of the BP neural network training process.

[0056] S2: Short-term photovoltaic power forecasting is carried out based on BP neural network. Numerical weather forecast, historical measured meteorological data and active power generation are used as inputs. The loss function is optimized in different time periods to obtain the upper short-term forecast value with a resolution of 15 minutes.

[0057] It should be noted that it consists of three parts: input layer, hidden layer and output layer:

[0058] 1) Input layer, the output power of photovoltaic power station is mainly related to the intensity of solar radiation, and is also affected by temperature, relative humidity and cloud cover. Combined with the correlation analysis of the relationship between various meteorological factors and photovoltaic output, it is determined that the predicted solar radiation intensity in the numerical weather forecast of photovoltaic power station, the actual solar radiation intensity of historical measured meteorology and active power generation are used as the input layer sample data of the BP neural network training process.

[0059] 2) Output layer: Carry out short-term power forecasting. The output data of the output layer is the output power sequence of the photovoltaic power station in the next 24 hours, with a time interval of 15 minutes.

[0060] 3) The improvement of the hidden layer and the accuracy of the artificial neural network can be achieved by increasing the number of its neurons in a single hidden layer, which is simpler in structural implementation than increasing the number of hidden layers. Therefore, the output power prediction model of the photovoltaic power generation system adopts a single hidden layer structure. The selection of the number of hidden layer neurons is directly related to the scale and accuracy of the neural network. According to the Kolmogorov theorem, if the number of input variables is n, the number of hidden layer neurons can generally be taken as 2n + 1, or the number of hidden layer neurons can also be determined by the trial-and-error method.

[0061] The training process of the BP neural network is directly related to the prediction accuracy of the output power model of the photovoltaic power generation system. The traditional BP neural network training uses the error backpropagation learning algorithm, which has problems such as being prone to falling into local minima and slow convergence speed. Scholars at home and abroad have improved the traditional BP learning algorithm from different perspectives, which can be generally divided into two categories: (1) improvements based on the standard gradient descent method, such as the BP learning algorithm with an added momentum term, the BP learning algorithm with a variable learning rate, etc.; (2) improvements based on numerical optimization algorithms, such as the quasi-Newton method, the Levenberg-Marquardt algorithm, the conjugate gradient method, etc.

[0062] The present invention combines the BP learning algorithm with an added momentum term and the BP learning algorithm with a variable learning rate to improve the traditional BP learning algorithm, so as to increase the convergence speed and reduce the probability of falling into local minima. Suppose there are P training samples, T is the maximum number of training times, w is the connection weight, is the weight value at the t-th iteration, is the weight change amount at the t-th iteration according to the traditional BP learning algorithm, is the total network error at the t-th iteration, is the system allowable error, is the learning rate. The flowchart of the BP learning algorithm is as Figure 2 shown, and the algorithm steps are as follows:

[0063] ① Initialize the weight w, and assume that the current is the t-th iteration;

[0064] ② Input P samples in sequence. Assume that the currently input is the p-th sample, and calculate the outputs and backpropagation errors of each layer;

[0065] ③ If p < P, then p = p + 1, go to step ②, otherwise go to step ④;

[0066] ④ Adjust the connection weights of each layer according to the weight adjustment formula;

[0067] ⑤ According to the new connection weights, calculate the outputs, backpropagation errors and total network error of each layer , if or , the training process is terminated; otherwise, , go to step ② for a new round of training;

[0068] Among them, the number of training samples is P, and T is the maximum number of training times.

[0069] Because photovoltaic power is only available during the day, the prediction accuracy during the daytime is important for flexible control. The prediction accuracy is calculated by dividing the daytime and nighttime periods, integrating the accuracy calculation formula into the loss function, optimizing the parameters of the substandard data, and increasing the penalty coefficient of the model. The limited calculation case resources are applied to the models with substandard accuracy for priority processing, and the substandard model results are repeatedly verified.

[0070] S3: Perform spline interpolation on the upper layer results, use box plots and violin plots to extract outliers, and use moving time window filtering to remove outliers. The resolution of the prediction data is improved based on the long-term and short-term recurrent neural network. While taking into account the prediction time scale and prediction accuracy, the lower layer of extremely short-term photovoltaic power prediction data with a resolution of 1 minute is obtained.

[0071] It should be noted that the designed LSTM structure recurrent neural network has the following structure: Figure 3 As shown. Before using data to train LSTM, the data collected from the SCADA system needs to be preprocessed. Spline interpolation is performed on the results obtained by the upper BP network, and the quartiles and medians, as well as the density distribution of the data, are displayed based on the box plot and violin plot. The concentration and dispersion of the data are preliminarily judged by observing the shape and peak of the graph. Statistical methods are combined to identify outliers, and the interquartile range is used to define outliers.

[0072] Select four hours as the moving time window size, calculate the mean, median and other statistics of the data in the window, use the statistics in the window to replace the outlier, and then move the time window forward by one time unit until all the data is processed. After data cleaning, outliers are removed, making the statistical characteristics of the data more obvious, which is conducive to the training of neural networks. The LSTM network structure consists of an input gate, an output gate and a forget gate. Unlike traditional recurrent neural networks, it has multiple hidden layers inside, and the neurons in the hidden layers are replaced by memory units with a gating mechanism. The gating unit is introduced in its topology to control the degree of influence of the current moment information on the previous information, so that the model has a longer "memory function" and is suitable for long-term nonlinear sequence problems.

[0073] The memory cell unit is the core component of the LSTM network. The input of the model includes Time series input , Hidden layer cell state at the moment and memory unit ; Output contains the memory cell state With the hidden layer state ,in and Each contains the long-term and short-term memory information of the model. By controlling the input gate, forget gate and output gate, the memory cell unit can be read and modified to carry out the information flow between the networks. Tanh represents the activation function of tanh. The input gate uses the sigmoid activation function to input the parameters and control the variables between [0,1] to achieve right The forget gate selectively forgets the neuron state at the previous moment. The specific form is to use the memory unit right The output gate is used to output and control parameter variables, that is, to use right The calculation formulas are as follows:

[0074] (2);

[0075] Among them, i t 、f t , o t Respectively represent the state calculation results of the input gate, forget gate and output gate; W ix and W ih , W fx and W fh , W ox and W oh With b i , b f , b o Represent the weight matrix and bias term of the corresponding gate respectively; Represents the sigmoid activation function.

[0076] The output result of the memory module at time t in the LSTM model is determined by the output gate and the unit state. The formula is as follows:

[0077] (3);

[0078] In the formula, represents the unit state input at time t; tanh is the hyperbolic tangent activation function; W c , b c Represent the state weight matrix and bias term of the input layer respectively; It means that each element is multiplied by position.

[0079] Example 2

[0080] refer to Figure 4-Figure 10 , which is the second embodiment of the present invention, provides an extremely short-term photovoltaic power prediction method for real-time control. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.

[0081] In order to verify the effectiveness of the method proposed in the present invention, a photovoltaic power station located in Delingha City, Haixi Mongolian and Tibetan Autonomous Prefecture, Qinghai Province (97.37 east longitude, 37.37 north latitude) was selected, with an installed capacity of 100MW and a grid-connected rate of 85%. The historical output power data and historical meteorological information on April 1, 2023 and May 4, 2023 were selected, and the above model was used for prediction. Days 1 to 20 were taken as the training set, and days 21 to 34 were taken as the test set.

[0082] First, the upper BP neural network is trained and its prediction effect is evaluated. The number of hidden layers is 2, and the Sigmoid activation function is used. The learning rate is set to 0.1, and the stochastic gradient descent (SGD) is used for optimization. The model is trained for 10,000 rounds, and the training loss is recorded every 100 rounds. Since the photovoltaic power is not 0 only when there is sunshine, the error calculation is divided into two cases: considering the night and not considering the night.

[0083] To accurately evaluate the prediction model, certain evaluation indicators need to be used. The most commonly used indicator for evaluating prediction is the mean absolute percentage error (MAPE), as shown in formula (4):

[0084] (4);

[0085] In the formula, N is the total number of data; is the i-th predicted value; is the ith actual value.

[0086] Since photovoltaic power has a zero value, If MAPE approaches infinity, it will lose its meaning. Therefore, the root mean square error (RMSE) is used to evaluate the prediction results. RMSE (root mean square error) reflects the performance of the model in controlling the absolute error. The calculation formula is:

[0087] ε RMSE = 1 n ∑ i = 1 n [ P ⌢ ( i ) − P ( i )] 2 (5);

[0088] In the formula, and are the actual value and predicted value of photovoltaic power respectively; The number of prediction validation data; Number the prediction point sequence.

[0089] Figure 4 The loss function change trend during the training process shows that the loss function of the neural network in the method proposed in the present invention converges after about 1000 trainings, which takes no more than 1 minute. The training time is short, the convergence is fast, and it has high practical value.

[0090] Figure 5 To compare the predicted output of the training set with the measured values ​​and the existing short-term prediction values, the three curves in the figure are the measured values ​​of photovoltaic output, the short-term prediction values ​​of the proposed method, and the short-term prediction values ​​of the existing method. Figure 6 The short-term forecast results are compared with the measured values ​​and the existing short-term forecast values.

[0091] To verify the prediction accuracy of the proposed method, the RMSE of the short-term prediction results and the measured results are shown in Table 1, where the prediction accuracy is given by ( ) is measured. It is worth noting that the following situations are additionally considered when calculating the prediction accuracy: (1) Considering day and night: Because photovoltaic power only has output during the day, the prediction accuracy of the daytime period in the prediction result is of great significance for flexible control; (2) Considering only the prediction error of the test set: The overall set contains the training set data, and in general, the prediction accuracy of the training set is higher than that of the test set, which may interfere with the judgment. Therefore, the test set is used as the basis for calculating the prediction accuracy. (3) After the prediction is completed, the test set results are spline interpolated and the error after interpolation is calculated. There is no significant improvement in the prediction accuracy before and after interpolation. It can be seen from the table that the proposed short-term photovoltaic power prediction method is more accurate than the existing short-term and ultra-short-term prediction methods, and the prediction accuracy reaches 85%.

[0092] Table 1 Prediction accuracy analysis

[0093]

[0094] Then, the prediction effect of the lower LSTM network is evaluated, where the prediction results of the upper BP neural network are used as the input of the LSTM network. MATLAB is used as the deep learning training platform, equipped with the Adam optimizer with adaptive learning ability, to debug the LSTM model, including modifying the network structure, modifying the ratio of training validation test sets, increasing or decreasing the number of data sets, and adjusting the training step size. The final network parameters and calculation results are shown in Table 2:

[0095] Table 2 LSTM neural network parameters

[0096]

[0097] The predicted values ​​of meteorological data for future periods, the measured values ​​of historical periods, and the short-term predicted values ​​of photovoltaic power of the upper BP neural network are used as train_inputs, and the measured values ​​of photovoltaic power are used as train_targets for training. 70% of the existing data set is taken as the training set, and the remaining 30% is taken as the test set, and interpolation processing is performed.

[0098] During the training process, the maximum number of training iterations (MaxEpochs) is set to 50 times. All training data is sent to the model for training once in each training (epoch). During the training process, in order to improve the computational efficiency, the data is usually grouped according to the mini-batch (MiniBatchSize) and sent to the model for training. The batch value is 128. The initial learning rate (InitialLearnRate) is set to 0.001. This parameter determines the step size of parameter update during the optimization process. The learning rate reduction strategy (LearnRateSchedule) uses the piecewise constant method (piecewise). During the training process, the learning rate usually decreases as the training progresses, which can help the model to make more precise adjustments in the later stages of training. Set the learning rate drop factor (LearnRateDropFactor) to 0.1 and the learning rate drop cycle to 40 times. At the end of each learning rate drop cycle, the learning rate will be multiplied by the drop factor and updated. In addition, the data is shuffled after each epoch. Shuffling the data can improve the generalization performance of the model.

[0099] The structure of the LSTM neural network is shown in Table 3, where the number of hidden layer neurons is 20 and the number of linear layers is one. The activation parameters of the long short-term memory (LSTM) neural network are usually expressed as (C)×(B)×(S), where (C) is the feature dimension or the number of hidden units. (B) is the batch size, that is, the number of samples processed at a time. (S) is the time step, that is, the sequence length.

[0100] Table 3 LSTM neural network structure parameters

[0101]

[0102] The mean square error curve and loss function curve during training are as follows: Figure 7 and Figure 8 As shown in the figure, it can be seen that after about 10 iterations, a good training effect has been achieved. There are 50 rounds of iterative training, 267 iterations per round, and the maximum number of iterations is 13350. The iterative training takes a total of 2 minutes and 25 seconds.

[0103] The prediction results of LSTM neural network are shown in Table 4. Evaluate the reliability of the model, which indicates the degree of correlation between the model prediction value and the actual value. The value is 0.9995, which means that the model is able to explain nearly 99.95% of the power variation in the training set, indicating that the model fits the training set very well. The value of 0.99906 indicates that the generalization performance of the model on the test set is also very strong. The prediction accuracy of the model is measured by the mean absolute error (MAE). The MAE on the training set and the test set are 0.27026 and 0.34514 respectively. The MAE value is small, which confirms the excellent performance of the model in prediction accuracy. Overall, the LSTM model in the present invention shows satisfactory results in the photovoltaic power generation prediction task. Although both the coefficient of determination and the mean absolute error show the excellent performance of the model, future research needs to further explore other evaluation indicators, such as the maximum error and the prediction accuracy under different light intensities, in order to obtain a more comprehensive understanding of the model performance.

[0104] Table 4 LSTM neural network calculation results

[0105]

[0106] Fig. 9 and Fig.10 They are the prediction results corresponding to the training set and the test set, respectively. The horizontal axis is the number of prediction samples, and the time interval between adjacent points is 1 minute. That is, the lower neural network achieves high-resolution photovoltaic power prediction. The time resolution is compatible with the real-time control requirements of photovoltaic power stations and has good engineering application value.

[0107] Compared with traditional prediction methods, the photovoltaic power prediction method designed by the present invention takes into account the prediction time scale and prediction accuracy, and obtains extremely short-term photovoltaic power prediction data with a resolution of 1 minute, which can meet the real-time control needs of photovoltaic power stations and has good engineering application value.

[0108] Example 3

[0109] The third embodiment of the present invention is different from the first two embodiments in that:

[0110] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0111] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0112] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

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

[0114] Example 4

[0115] The fourth embodiment of the present invention provides an extremely short-term photovoltaic power prediction system for real-time control, characterized in that it includes a feature analysis module, a short-term power prediction module, and an extremely short-term fine prediction module;

[0116] The characteristic analysis module uses the extreme values ​​of the whole year statistics to normalize the radiation, temperature, humidity and photovoltaic power data, obtains the variable and photovoltaic power time series, and performs characteristic correlation analysis;

[0117] The short-term power prediction module performs short-term photovoltaic power prediction based on BP neural network, takes meteorological data and historical output data as input, optimizes the loss function by time period, and obtains the upper short-term prediction value with a resolution of 15 minutes;

[0118] The very short-term fine prediction module performs spline interpolation on the upper layer results, extracts outliers using box plots and violin plots, removes outliers using moving time window filtering, improves the resolution of prediction data based on long-term and short-term recurrent neural networks, and obtains the lower layer very short-term photovoltaic power prediction data with a resolution of 1 minute while taking into account the prediction time scale and prediction accuracy.

[0119] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A very short-term photovoltaic power prediction method for real-time control, characterized in that: include, The radiation, temperature, humidity and photovoltaic power data are normalized using the extreme values ​​of the whole year statistics to obtain the time series of variables and photovoltaic power, and feature correlation analysis is performed to build a two-layer photovoltaic output prediction framework based on deep learning. Based on BP neural network, short-term photovoltaic power forecasting is carried out, with meteorological data and historical output data as input, and the loss function is optimized in different time periods to obtain the upper short-term forecast value with a resolution of 15 minutes. Spline interpolation is performed on the upper layer results, outliers are extracted using box plots and violin plots, and outliers are removed using moving time window filtering. The resolution of the prediction data is improved based on the long- and short-term recurrent neural network. While taking into account the prediction time scale and prediction accuracy, the lower layer extremely short-term photovoltaic power prediction data with a resolution of 1 minute is obtained.

2. A very short-term photovoltaic power prediction method for real-time control as claimed in claim 1, characterized in that: The normalization process is expressed as, , in, is the nth data to be processed, and are the maximum and minimum values ​​of the variable respectively; The correlation between various meteorological factors and photovoltaic output was analyzed, and the numerical weather forecast and historical measured meteorology in the meteorological data of photovoltaic power stations and the active power generation power in the historical output data were determined as the input layer sample data of the BP neural network training process.

3. A very short-term photovoltaic power prediction method for real-time control as claimed in claim 2, characterized in that: The BP neural network includes an input layer, a hidden layer and an output layer; The input layer includes the output power of the photovoltaic power station, which is related to the solar radiation intensity and is also affected by temperature, relative humidity and cloud cover. The correlation analysis of the relationship between various meteorological factors and photovoltaic output is combined to determine the predicted solar radiation intensity in the numerical weather forecast of the photovoltaic power station, the actual solar radiation intensity of the historical measured meteorology and the active power generation power in the historical output data as the input layer sample data of the BP neural network training process; The output layer performs short-term power forecasting, and the output layer outputs data that is the output power sequence of the photovoltaic power station in the next 24 hours, with a time interval of 15 minutes; The selection of the number of neurons in the hidden layer is related to the scale and accuracy of the neural network. According to the Kolmogorov theorem, if the number of input variables is n, the number of neurons in the hidden layer is 2n+1. The number of neurons in the hidden layer is determined by repeated trials. The BP neural network training process is related to the prediction accuracy of the output power model of the photovoltaic power generation system. By combining the BP learning algorithm with the added motion term and the BP learning algorithm with a variable learning rate, improvements are made to increase the convergence speed and reduce the probability of falling into a local minimum.

4. A very short-term photovoltaic power prediction method for real-time control as claimed in claim 3, characterized in that: The BP learning algorithm combining the added motion term and the BP learning algorithm with a variable learning rate includes initializing the weight w, assuming that the current iteration is the tth iteration; Input P samples in sequence and calculate the output and backpropagation error of each layer; when all P samples are calculated, adjust the connection weights of each layer according to the weight adjustment formula; calculate the output, backpropagation error and total network error of each layer according to the new connection weights ,like or , then terminate the training process; if and , re-input P samples, calculate the output and back propagation error of each layer, and conduct a new round of training; Among them, the number of training samples is P, T is the maximum number of training times, is the allowable error of the system.

5. A very short-term photovoltaic power prediction method for real-time control as claimed in claim 4, characterized in that: The method of removing outliers by moving time window filtering includes performing spline interpolation on the results obtained by the upper BP network, displaying quartiles and medians, and density distribution of data according to box plots and violin plots, preliminarily judging the concentration and dispersion of data by observing the shape and peak of the graph, combining statistical methods to identify outliers, and using interquartile range to define outliers; Four hours were selected as the moving time window size, the mean and median statistics of the data within the window were calculated, the statistics within the window were used to replace the outliers, and then the time window was moved forward by one time unit until all the data were processed. After data cleaning, the outliers were removed.

6. A very short-term photovoltaic power prediction method for real-time control as claimed in claim 5, characterized in that: The long short-term recurrent neural network is used to improve the resolution of prediction data. The memory cell unit is the core component of the LSTM network. The input of the model includes Time series input , Hidden layer cell state at the moment and memory unit ; The output contains the memory cell state With the hidden layer state ,in and Each contains the long-term and short-term memory information of the model. By controlling the input gate, forget gate and output gate, the memory cell unit can be read and modified to carry out the information flow between the networks. Tanh represents the activation function of tanh. The input gate uses the sigmoid activation function to input the parameters and control the variables between [0,1] to achieve right The forget gate selectively forgets the neuron state at the previous moment. The specific form is to use the memory unit right The output gate is used to output and control parameter variables, that is, to use right The calculation formulas are as follows: , Among them, i t 、f t , o t Respectively represent the state calculation results of the input gate, forget gate and output gate; W ix and W ih , W fx and W fh , W ox and W oh With b i 、b f 、b o Represent the weight matrix and bias term of the corresponding gate respectively; Represents the sigmoid activation function.

7. A very short-term photovoltaic power prediction method for real-time control as claimed in claim 6, characterized in that: The method of improving the resolution of prediction data based on long-term and short-term recurrent neural networks also includes: The output result of the memory module at time t in the LSTM model is determined by the output gate and the unit state. The formula is as follows: , In the formula, represents the unit state input at time t; tanh is the hyperbolic tangent activation function; W c 、b c Represent the state weight matrix and bias term of the input layer respectively; It means that each element is multiplied by position.

8. A system for a very short-term photovoltaic power prediction method for real-time control based on any one of claims 1 to 7, characterized in that: Including, feature analysis module, short-term power prediction module, and very short-term fine prediction module; The characteristic analysis module uses the extreme values ​​of the whole year statistics to normalize the radiation, temperature, humidity and photovoltaic power data, obtains the variable and photovoltaic power time series, and performs characteristic correlation analysis; The short-term power prediction module performs short-term photovoltaic power prediction based on BP neural network, takes meteorological data and historical output data as input, optimizes the loss function by time period, and obtains the upper short-term prediction value with a resolution of 15 minutes; The very short-term fine prediction module performs spline interpolation on the upper layer results, extracts outliers using box plots and violin plots, removes outliers using moving time window filtering, improves the resolution of prediction data based on long-term and short-term recurrent neural networks, and obtains the lower layer very short-term photovoltaic power prediction data with a resolution of 1 minute while taking into account the prediction time scale and prediction accuracy.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.