Photovoltaic power generation prediction method and system
By introducing time attention mechanism and multi-layer neural network model into the photovoltaic power generation prediction system, the accuracy and inefficiency of the existing photovoltaic power generation prediction methods are solved, and more accurate and real-time photovoltaic power generation prediction is achieved.
Patent Information
- Application Number
- CN202411960180.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-06-20
AI Technical Summary
Existing photovoltaic power generation prediction methods are difficult to accurately predict photovoltaic power generation. Due to the influence of various factors such as weather, seasonal changes and equipment aging, the predictions are inaccurate and inefficient.
A photovoltaic power generation prediction method and system is proposed, which preprocesses historical photovoltaic data and uses multi-layer neural network models, especially the LSTM model that introduces the temporal attention mechanism, to train the prediction model. The system also filters key parameters through preset correlation thresholds to improve the efficiency and accuracy of the prediction model.
By introducing a time attention mechanism and a multi-layer neural network model, the accuracy and real-time nature of photovoltaic power generation prediction are significantly improved, which can better reflect the characteristics of photovoltaic power generation changes over time, and meet the photovoltaic power generation prediction needs in different scenarios.
Smart Images

Figure CN120181277A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power generation prediction, and particularly to a photovoltaic power generation prediction method and system. Background Art
[0002] Energy is an important material basis for the survival and development of human society. The use of fossil fuels has caused serious global environmental pollution. Developing renewable energy and reducing dependence on traditional fossil energy are of great significance for future energy development and mitigating global warming. Solar energy is a renewable resource with rich reserves and characteristics such as cleanliness and safety. There are mainly two technologies for solar power generation: photovoltaic power generation and solar thermal power generation. In 2021, wind power and photovoltaic power generation in China accounted for about 11% of the total national electricity consumption, while the proportion of global wind power and photovoltaic power generation reached 10.3%. In the application field of new energy, photovoltaic power generation has become one of the main power generation methods. Photovoltaic power generation directly converts sunlight into electric energy. The main technologies include crystalline silicon photovoltaic, thin-film photovoltaic, and concentrating photovoltaic, etc. The power generation depends on the light intensity and time, and is suitable for distributed power generation.
[0003] Photovoltaic power generation is generally affected by multiple factors. The solar radiation intensity directly determines the efficiency of photovoltaic power generation. The solar altitude angle and geographical latitude will affect the light intensity on the ground surface, thus having an important impact on the power generation efficiency of the photovoltaic system. The attenuation, temperature characteristics, and hidden crack problems of photovoltaic modules will all affect their long-term efficiency. In addition, environmental factors also have an important impact. External factors such as temperature, dust, shadow occlusion, and snow cover will affect the output efficiency of photovoltaic modules.
[0004] Accurate prediction of photovoltaic power generation is crucial for the operation and dispatching of the power system. Through accurate prediction, the power supply can be effectively adjusted to avoid grid instability caused by the fluctuations of photovoltaic power generation, thereby improving the operation efficiency and stability of the power system. Accurate prediction data helps energy companies and grid operators better plan power generation, optimize energy distribution, reduce energy waste, and lower the operating costs of the power market. With the increase in photovoltaic installed capacity, accurate photovoltaic prediction has become the key to building a new type of highly resilient and diversely integrated power system. This helps improve the carrying capacity of photovoltaic systems in distributed power grids, delay or avoid the need for grid upgrades, and reduce marginal costs. Summary of the Invention
[0005] The purpose of this part is to outline some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this part, as well as in the abstract and title of the present application, to avoid obscuring the purpose of this part, the abstract, and the title. However, such simplifications or omissions shall not be used to limit the scope of the present invention.
[0006] In view of the above existing problems, the present invention is proposed.
[0007] Therefore, the present invention provides a photovoltaic power generation prediction method and system, which can solve the problems mentioned in the background art.
[0008] To solve the above technical problems, the present invention provides the following technical solutions:
[0009] In a first aspect, the present invention provides a photovoltaic power generation prediction method, including:
[0010] Obtain the first historical photovoltaic data, and perform a first preprocessing on the first historical photovoltaic data;
[0011] Train a first prediction model according to the first historical photovoltaic data after the first preprocessing;
[0012] Obtain the first real-time photovoltaic data, and use the first real-time photovoltaic data as the input of the first prediction model after training is completed, and perform photovoltaic power generation prediction according to the output of the first prediction model after training is completed.
[0013] As a preferred solution of the photovoltaic power generation prediction method of the present invention, wherein: the first prediction model includes:
[0014] The first prediction model is any model with the input being the photovoltaic data after the first preprocessing and the output being the photovoltaic power generation prediction result or relevant parameters that can directly or indirectly obtain the photovoltaic power generation prediction result;
[0015] The first prediction model at least includes several layers of neural networks stacked.
[0016] As a preferred solution of the photovoltaic power generation prediction method of the present invention, wherein: the several layers of neural networks at least include two layers of neural networks, and the several layers of neural networks are stacked in series, and the output of the previous layer of neural network is used as the input of the next layer of neural network.
[0017] As a preferred solution of the photovoltaic power generation prediction method of the present invention, wherein: the training of the first prediction model according to the first historical photovoltaic data after the first preprocessing includes:
[0018] Perform a first evaluation on the trained first prediction model, and the first evaluation is an evaluation criterion carried out through several rating indicators;
[0019] Output the first prediction model that meets the first evaluation as the first prediction model after training is completed.
[0020] As a preferred solution of the photovoltaic power generation prediction method of the present invention, wherein: the first prediction model further includes introducing a time attention mechanism.
[0021] As a preferred solution of the photovoltaic power generation prediction method of the present invention, wherein: the obtaining of the first historical photovoltaic data at least includes component temperature, air pressure, total radiation, diffuse radiation, direct radiation, and power generation power.
[0022] As a preferred solution of the photovoltaic power generation prediction method of the present invention, wherein: the first preprocessing of the first historical photovoltaic data at least includes:
[0023] Performing a first correlation analysis on the data related to power output in the first historical photovoltaic data;
[0024] Obtaining several parameters with relatively high correlation with power output in the first historical photovoltaic data;
[0025] The several parameters with relatively high correlation are determined by a preset first correlation threshold.
[0026] In a second aspect, the present invention provides a photovoltaic power generation prediction system, including:
[0027] A data processing module, configured to obtain first historical photovoltaic data and perform first preprocessing on the first historical photovoltaic data;
[0028] A model establishment module, configured to train a first prediction model according to the first historical photovoltaic data after the first preprocessing;
[0029] A prediction module, configured to obtain first real-time photovoltaic data, use the first real-time photovoltaic data as the input of the trained first prediction model, and perform photovoltaic power generation prediction according to the output of the trained first prediction model.
[0030] In a third aspect, the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the method described above are implemented.
[0031] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described above are implemented.
[0032] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention provides a photovoltaic power generation prediction method and system, which acquires first historical photovoltaic data and performs first preprocessing on the first historical photovoltaic data; trains a first prediction model according to the first historical photovoltaic data after the first preprocessing; acquires first real-time photovoltaic data, uses the first real-time photovoltaic data as the input of the trained first prediction model, and performs photovoltaic power generation prediction according to the output of the trained first prediction model. By introducing a time attention mechanism, the processing ability of the model for time series data is enhanced, making the prediction result more accurate and better reflecting the characteristics of photovoltaic power generation varying with time. By presetting a first correlation threshold, parameters with a relatively high correlation with power output are screened out, thereby improving the efficiency and accuracy of the prediction model. The system can automatically adjust and optimize the prediction model to ensure the real-time and accuracy of the prediction result, meeting the photovoltaic power generation prediction requirements in different scenarios. The photovoltaic power generation prediction system of the present invention has good scalability and can adapt to photovoltaic power stations of different scales, providing strong support for the operation and dispatching of the power system. Through the photovoltaic power generation prediction method and system of the present invention, the waste of power resources caused by inaccurate prediction can be effectively reduced, the energy utilization efficiency can be improved, and the sustainable development of renewable energy can be promoted. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts. Among them:
[0034] Figure 1 It is a flowchart of a method for a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0035] Figure 2 It is a photovoltaic data diagram collected by a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0036] Figure 3 It is a schematic diagram of attention distribution of a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0037] Figure 4 It is an LSTM gate structure diagram of a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0038] Figure 5 It is a stacked LSTM structure diagram of a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0039] Figure 6 The structural diagram of the stacked LSTM model with added time attention for a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0040] Figure 7 The prediction effect diagram of the comparison model for a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0041] Figure 8 The prediction effect diagram of the model of the present application for a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0042] Figure 9 The model error comparison diagram for a photovoltaic power generation prediction method and system provided by an embodiment of the present invention;
[0043] Figure 10 The internal structural diagram of a computer device for a photovoltaic power generation prediction method and system provided by an embodiment of the present invention. Detailed implementation manners
[0044] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will describe in detail the specific implementation manners of the present invention with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0045] Embodiment 1
[0046] Referring to Figures 1 - 10 , which is the first embodiment of the present invention. This embodiment provides a photovoltaic power generation prediction method and system, including:
[0047] In the existing related technologies, there are some problems. For example, the output power of the photovoltaic power generation system is affected by various factors such as weather conditions, seasonal changes, and equipment aging, resulting in greater prediction difficulty. Traditional prediction methods often rely on statistical analysis of historical data and lack the ability to quickly respond to real-time changes, which to a certain extent limits the accuracy and practicality of prediction. In addition, existing prediction systems may not be efficient in processing large-scale data and cannot meet the requirements of the rapidly developing photovoltaic power generation industry for high-precision and high-efficiency prediction.
[0048] The present application provides a method that can effectively solve the above-mentioned problems. Next, multiple embodiments will be combined to elaborate in detail how to implement the photovoltaic power generation prediction method;
[0049] Figure 1 Shows a method flow chart of a photovoltaic power generation prediction method and system, including:
[0050] S101, obtain the first historical photovoltaic data and perform a first preprocessing on the first historical photovoltaic data;
[0051] In an optional embodiment, the first historical photovoltaic data may include relevant data of different photovoltaic power stations in different regions, and relevant technicians can select according to actual needs;
[0052] In an optional embodiment, the first historical photovoltaic data can be automatically collected by remote data acquisition devices, which can be sensors and data recorders installed in photovoltaic power stations. The collected data is then transmitted to a central processing server through a wireless or wired network. On the server side, the data will be cleaned and formatted to ensure its accuracy and consistency.
[0053] In an optional embodiment, in order to improve the accuracy of prediction, auxiliary information such as meteorological data, geographical location information, and historical maintenance records can also be combined. Through the analysis of these comprehensive data, the output power of the photovoltaic power generation system can be predicted more accurately, thereby providing strong data support for the operation and maintenance of the photovoltaic power generation system.
[0054] In the embodiment of the present application, the obtaining of the first historical photovoltaic data at least includes component temperature, air pressure, total radiation, diffuse radiation, direct radiation, and power generation power.
[0055] In the embodiment of the present application, the photovoltaic data used in the present application is from the annual data of a certain photovoltaic power station in Xinjiang in 2019. The data acquisition frequency is once every 15 minutes, and the time span is one year. The data includes component temperature, air pressure, total radiation, diffuse radiation, direct radiation, and power generation power.
[0056] In the embodiment of the present application, the first preprocessing of the first historical photovoltaic data at least includes:
[0057] Perform a first correlation analysis on the data related to power output in the first historical photovoltaic data;
[0058] Obtain several parameters with relatively high correlation with power output in the first historical photovoltaic data;
[0059] The several parameters with relatively high correlation are determined by a preset first correlation threshold.
[0060] In an alternative embodiment, the first correlation analysis can use the Pearson correlation coefficient to measure the linear correlation degree between each parameter and the power generation. Through calculation, the correlation coefficient between each parameter and the power generation can be obtained, thereby screening out the parameters with a relatively high correlation with the power generation. For example, when the absolute value of the correlation coefficient is greater than 0.7, it can be considered that the parameter has a relatively high correlation with the power generation.
[0061] It should be noted that such parameters may include component temperature, total radiation, etc., because they directly affect the efficiency and power generation of photovoltaic cells. In this way, the unnecessary data volume in the subsequent analysis can be effectively reduced, and the accuracy and efficiency of the prediction model can be improved.
[0062] In an alternative embodiment, the first correlation analysis can also use the Spearman rank correlation coefficient to evaluate the non-linear correlation between the parameter and the power generation. The Spearman correlation coefficient is a non-parametric rank correlation coefficient, which is suitable for evaluating the monotonic relationship between two variables. Even if the data distribution is not a normal distribution, it can give an effective correlation evaluation.
[0063] It should be noted that through this method, the correlation results obtained by the Pearson correlation coefficient can be further verified to ensure that the correlation between the selected parameters and the power generation is robust. In addition, the system can also include a data processing module for further analyzing and processing the selected correlation parameters to optimize the performance of the prediction model.
[0064] In an alternative embodiment, the first correlation analysis can also use the principal component analysis (PCA) method to identify and extract the key variables affecting the power generation. Principal component analysis is a statistical technique that transforms a set of potentially correlated variables into a set of linearly uncorrelated variables through an orthogonal transformation. These variables are called principal components.
[0065] It should be noted that in this way, the original data set can be reduced in dimension while retaining most of the variability of the data. In the context of photovoltaic power generation prediction, principal component analysis helps to identify which factors have the greatest impact on the power generation, so that resources and attention can be concentrated on these key factors to further improve the performance and accuracy of the prediction model.
[0066] In the embodiment of the present application, the first correlation analysis is implemented using the Pearson correlation coefficient.
[0067] In the embodiments of the present application, due to reasons such as zero light intensity at night and environmental interference, there are some zero values in the dataset, and the radiation value is 0, while the actual power generation is greater than 0 for abnormal data. These data need to be processed to reduce their impact on the model. The power generation is 0 caused by night time, and these data can be removed. After removing the abnormal data, the present application performs interpolation processing on this part of the missing values. The factors affecting the actual power generation include temperature, air pressure, total radiation, direct radiation, and diffuse radiation. In the dataset, a correlation analysis is performed between all relevant factors and the actual power generation, as shown in Table 1.
[0068] Table 1 Correlation Analysis of Power Generation
[0069]
[0070] It should be noted that the higher the correlation value, the higher the correlation between the two features.
[0071] It should also be noted that the actual power generation is the output of the model of the present application, and the total radiation, direct radiation, and module temperature with the highest correlation among several features are used as the output.
[0072] It should be noted that the first historical photovoltaic data is obtained, and the first preprocessing is performed on the first historical photovoltaic data to improve the accuracy and reliability of the data, providing higher-quality input for the prediction model. Through the preprocessing steps, noise and outliers in the data can be effectively removed, thereby reducing the prediction error. The preprocessing process can also include data normalization or standardization to ensure that data of different magnitudes and units can be correctly processed by the model. In addition, the preprocessing steps help to extract key features, laying a foundation for subsequent feature selection and model training.
[0073] S102, training a first prediction model according to the first preprocessed first historical photovoltaic data;
[0074] In the embodiments of the present application, the first prediction model includes:
[0075] The first prediction model is any model with the preprocessed photovoltaic data as the input and the photovoltaic power generation prediction result or relevant parameters that can directly or indirectly obtain the photovoltaic power generation prediction result as the output;
[0076] The first prediction model includes at least several layers of neural networks stacked.
[0077] In an alternative embodiment, the first prediction model can be constructed using deep learning algorithms, such as convolutional neural networks (CNNs) or long short-term memory networks (LSTMs), to capture the temporal and spatial features in the photovoltaic data. The system can also integrate data fusion techniques to synthesize information from different sensors and data sources, thereby enhancing the comprehensiveness and accuracy of the prediction.
[0078] In another alternative embodiment, there may be a user interface that allows users to input specific parameters, such as geographical location, weather conditions, etc., to further customize the prediction results. The system may also have the ability of self-learning and optimization. By continuously receiving new data and feedback, it can automatically adjust the model parameters to adapt to the long-term changes of the photovoltaic system.
[0079] In an alternative embodiment, the first prediction model can also use the support vector machine (SVM) algorithm to handle non-linear problems and improve the prediction ability of the model through kernel tricks. In addition, to further improve the prediction accuracy, the system may adopt ensemble learning methods, such as random forests or gradient boosting decision trees (GBDTs). These methods can combine the prediction results of multiple models to reduce the risk of overfitting and improve the overall performance. The system may also include a data preprocessing module for cleaning and normalizing the input data to ensure that the prediction model receives high-quality data inputs.
[0080] In an alternative embodiment, the first prediction model can also use a prediction model based on time series analysis, such as the autoregressive integrated moving average model (ARIMA), to capture the trends and periodic characteristics of the photovoltaic power generation over time. This model can predict future power generation through historical data and is suitable for the analysis and prediction of time series data.
[0081] In the embodiment of the present application, the first prediction model at least includes several layers of neural networks stacked, and is designed using long short-term memory neural networks (LSTMs);
[0082] In the embodiment of the present application, the several layers of neural networks at least include two layers of neural networks, and the several layers of neural networks are stacked in series. The output of the previous layer of neural network is used as the input of the next layer of neural network.
[0083] In the embodiment of the present application, the first prediction model further includes the introduction of a time attention mechanism.
[0084] In the embodiment of the present application, the introduction of the time attention mechanism includes the following operations:
[0085] In deep learning, the temporal attention mechanism is often used to process time series data. It can assign different weights to information at different time steps, facilitating the model to learn the importance of different parts of the data and deeply capture data features. The goal of the temporal attention mechanism is to dynamically adjust the weights of the input parts by calculating the relationship between each part of the input sequence and the current output.
[0086] In the embodiments of the present application, when processing time series, the attention mechanism usually generates a weight distribution based on the correlation between the input at the current time step and the inputs at all previous time steps. The method using the temporal attention mechanism is generally a recurrent neural network based on temporal attention. The present application uses an LSTM-stack plus a temporal attention mechanism.
[0087] In an optional embodiment, several parameters with the highest correlation with power output in the data, such as global radiation, direct radiation, temperature, etc., are taken as a vector: x i ={r i ,t i ,s i}, obtaining an input vector:
[0088] X = {x1, x2, x3, … x n}
[0089] X is a vector sequence containing n elements, where x i is a data point in the time series, and n is the sequence length.
[0090] In an optional embodiment, a query vector q with the same dimension as the elements in the input sequence is established, q ∈ R d , where d is the dimension of the input vector components, and it is used to calculate the attention scores with each element in the sequence. In the present application, the dot product model is used here to measure the similarity between the input vector and the query vector, obtaining the weights of each element and normalizing them through the softmax function.
[0091]
[0092] Among them, s(x n , q) is the scoring function, which measures the similarity between the input vector and the query vector.
[0093] In an optional embodiment, the attention weighted output is obtained by weighted summing the input sequence with the attention weights, and the calculation method is:
[0094]
[0095] Among them, z represents the index position of the selected information, and E represents the expected value.
[0096] In an optional embodiment, in the temporal attention mechanism, the weights assigned by the model to each time step are obtained from training and continuously adjusted. The photovoltaic power station data used in this application are real data collected every 15 minutes, and data at different times of each day are assigned their respective weights. From Figure 2 It can be seen that the data of the photovoltaic power station have obvious characteristics. Although the curves of each day are different, their shapes are very similar. However, since solar radiation is divided into direct radiation and diffuse radiation, and the solar radiation at different times of each day varies, the temporal attention mechanism can well assign corresponding weights to data at different time steps, improving the prediction accuracy.
[0097] In an optional embodiment, to extract features in the time dimension, that is, multiply by a fully connected matrix in the time step dimension to assign a weight to each time step:
[0098]
[0099] Among them, s1 is the time step vector, W T is the weight, and b is the bias;
[0100]
[0101] In an optional embodiment, α1 represents the attention weight of the first time step;
[0102] A = {a t}
[0103] Among them, t ∈ (1, 2, 3…n);
[0104]
[0105] In an optional embodiment, multiplying the input matrix by the weight matrix gives an output matrix. This output matrix F is a weighted representation of the input time series, which can help the stacked LSTM model better capture the key temporal dependencies in the photovoltaic data, thereby improving the prediction performance. The specific schematic diagram is as Figure 3 .
[0106] In the embodiment of this application, training the first prediction model according to the first preprocessed first historical photovoltaic data includes:
[0107] Performing a first evaluation on the trained first prediction model, where the first evaluation is an evaluation criterion based on several rating indicators;
[0108] Outputting the first prediction model that meets the first evaluation as the first prediction model after training is completed.
[0109] In an alternative embodiment, the first evaluation can be performed according to rating metrics such as prediction accuracy, model stability, computational efficiency, and generalization ability.
[0110] In an alternative embodiment, the prediction accuracy can be evaluated by comparing the error between the predicted value and the actual value;
[0111] In an alternative embodiment, the model stability is measured by the consistency of the model prediction results over different time periods.
[0112] In an alternative embodiment, the computational efficiency focuses on the time required for model training and prediction, while the generalization ability is evaluated by the performance of the model on unseen data.
[0113] It should be noted that through these comprehensive evaluation metrics, the reliability and effectiveness of the first prediction model in practical applications can be ensured.
[0114] However, in the embodiments of the present application, the first evaluation can be completed based on the first correlation analysis and the first correlation threshold in the first preprocessing;
[0115] Specifically, the first evaluation process includes the following steps: First, determine the correlation between the input data and the photovoltaic power generation using the first correlation analysis; Second, screen out the data features with a high correlation with the photovoltaic power generation according to the first correlation threshold; Then, use these screened data features for model training; Finally, evaluate the prediction accuracy of the model by comparing the model prediction results with the actual photovoltaic power generation data. If the prediction accuracy of the model meets the preset threshold, it is considered that the model has passed the first evaluation and can be used as part of the final photovoltaic power generation prediction system. Through such an evaluation mechanism, the prediction results of the photovoltaic power generation prediction system can be ensured to have high accuracy and reliability.
[0116] In an alternative embodiment, the long short-term memory neural network (LSTM) is a special type of recurrent neural network (RNN) that solves the problems of gradient explosion and gradient vanishing in traditional RNNs when processing sequential data. LSTM introduces a special memory mechanism and gating mechanism, and the gating structure is as Figure 4 shown, including an input gate, a forget gate, and an output gate.
[0117] It should be noted that the input of a cell in LSTM includes the previous state h t-1 and the current input x t , and the cell contains three sigmoid functions and one tanh function, which interact in a specific way to achieve three gating functions. The gates can selectively pass information to select important information, remove useless information, and update the cell state.
[0118] It should be noted that the function of the forget gate is implemented by Figure 4 the first sigmoid function on the left, which determines what information to forget from the cell state. As Figure 4 shown in t-1 it reads the previous cell state h t and the current input x t and outputs a vector f
[0119]
[0120] which is multiplied by the previous cell output. The vector output is as shown in Equation 1; t :
[0121]
[0122] It should be noted that the input gate is implemented by the sigmoid function and the tanh function in the middle. It determines what information remains in the cell state, which consists of two parts: the sigmoid function filters the information to be updated, and the tanh function creates a new vector to be added to the cell state. The two are multiplied to obtain the new vector i t :
[0121]
[0122] It should be noted that the function of the output gate is implemented by Figure 4 the rightmost sigmoid function in
[0123]
[0124] which determines which part of the information in the cell state is output to the next cell. The current cell state is obtained through the calculations of the input gate and the forget gate:
[0125]
[0126] h t = o t *tanh(s t )
[0127] In the embodiments of the present application, when a single-layer LSTM processes time series data, its hidden layer representation ability is relatively limited and may not be able to capture complex patterns and long-term dependencies in the data. Stacked LSTM stacks multiple LSTM units, enabling each layer to learn features at different levels. The lower layers capture short-term dependencies, and the higher layers capture long-term dependencies. This multi-layer structure allows the model to model the data from multiple perspectives and provide richer feature representations. By increasing the number of LSTM layers, the network can gradually extract more abstract and complex features, enabling the model to better model dependency relationships at different time scales, which is particularly important for processing complex sequence data. The multi-layer structure can also help the model avoid over-relying on the features of a certain layer, thereby improving the generalization ability of the model. Through deeper feature abstraction, stacked LSTM can usually achieve better performance on the training data and also have strong robustness on the test set. Through layer-by-layer learning, multi-layer LSTM can capture dependency relationships over a longer time range. Especially when processing sequence data with a long time span, stacked LSTM can better model long-term time series dependencies.
[0128] In the embodiments of the present application, stacked LSTM takes the output of the previous layer of LSTM as the input of the next layer. The stacking of LSTM makes the model deeper, enabling it to extract deeper-level features and improve the prediction accuracy. In the stacked LSTM, the lower-layer LSTM units can capture short-term dependency relationships, and the higher-layer LSTM units can learn more complex long-term dependency relationships. The hierarchical structure allows the model to obtain features at different levels during the learning process. However, too many layers will also lead to overfitting. Therefore, a Dropout layer is used in the model to reduce overfitting, and reasonable setting of the Dropout ratio can effectively prevent overfitting.
[0129] In the embodiments of the present application, the structure diagram of a two-layer stacked LSTM is as Figure 5 shown. Each input time step of the first layer of LSTM generates an output, and the generated sequence is output to the next layer.
[0130] In an alternative embodiment, those skilled in the art can stack more levels of the structure according to actual needs, and the present application does not make any restrictions.
[0131] It should be noted that training the first prediction model according to the first preprocessed historical photovoltaic data can significantly improve the accuracy of photovoltaic power generation prediction. By using deep learning techniques, especially stacked LSTM networks, the model can learn complex patterns and long-term dependencies in time series data. This model structure can not only capture the impact of short-term weather changes on power generation, but also take into account long-term seasonal changes and trends. In addition, by introducing a time attention mechanism, the model can dynamically adjust the importance of data at different time steps, thereby more accurately predicting future photovoltaic power generation. The implementation of this prediction method and system provides strong data support for the operation of photovoltaic power stations, helps improve energy utilization efficiency, reduce operating costs, and provides a scientific basis for power grid dispatching.
[0132] S103, obtain the first real-time photovoltaic data, use the first real-time photovoltaic data as the input of the first prediction model after training is completed, and perform photovoltaic power generation prediction according to the output of the first prediction model after training is completed.
[0133] In an optional embodiment, after completing the photovoltaic power generation prediction, the prediction result will be automatically recorded and compared with the actual power generation. Through this real-time feedback mechanism, the parameters of the prediction model can be continuously optimized to improve the prediction accuracy.
[0134] In an optional embodiment, it is also possible to automatically adjust the operation strategy of the photovoltaic power station according to the difference between the prediction result and the actual data to adapt to changing environmental conditions and ensure maximum power generation efficiency. At the same time, the system also has a data storage function and can store historical prediction data and actual data for a long time, providing valuable data resources for future research and decision-making.
[0135] In summary, the present invention proposes a photovoltaic power generation prediction method, which obtains first historical photovoltaic data and performs first preprocessing on the first historical photovoltaic data; trains a first prediction model according to the first preprocessed first historical photovoltaic data; obtains first real-time photovoltaic data, uses the first real-time photovoltaic data as the input of the first prediction model after training is completed, and performs photovoltaic power generation prediction according to the output of the first prediction model after training is completed. By introducing a time attention mechanism, the processing ability of the model for time series data is enhanced, making the prediction result more accurate and better reflecting the characteristics of photovoltaic power generation changing with time. By presetting a first correlation threshold, parameters with a relatively high correlation with power output are screened out, thereby improving the efficiency and accuracy of the prediction model. The system can automatically adjust and optimize the prediction model to ensure the real-time and accuracy of the prediction result and meet the photovoltaic power generation prediction requirements in different scenarios. The photovoltaic power generation prediction system of the present invention has good scalability and can adapt to photovoltaic power stations of different scales, providing strong support for the operation and dispatching of the power system. Through the photovoltaic power generation prediction method and system of the present invention, the waste of power resources caused by inaccurate prediction can be effectively reduced, the energy utilization efficiency can be improved, and the sustainable development of renewable energy can be promoted.
[0136] Embodiment 2
[0137] The LSTM-stack model based on the time attention mechanism proposed in this application performs excellently in time series prediction and improves the prediction accuracy. Its basic structure is as Figure 6 . It includes two parts. The first part is the time attention part, which directly accepts data input and extracts the trends and significant features at the time level in the data to ensure that important information is not lost in both the short term and the long term. The second part is the stacked structure of LSTM, which can process the input data more effectively, further extract features from the data, and achieve more accurate prediction.
[0138] The comparative test models used in this application to compare model performance are the LSTM, stacked LSTM (S-LSTM), and LSTM based on phase space reconstruction (recon-LSTM) models. The LSTM architecture consists of a single layer of LSTM units and a dense layer. The LSTM layer has 4 units and inputs a 3D tensor with the shape (batch_size, look_back, n_features), where look_back is the number of time steps to look back and n_features is the number of features in the input data. The dense layer has one unit and produces a two-dimensional tensor with the shape (batch_size, 1). The architecture of the stacked LSTM involves stacking two LSTM layers on top of each other, which allows the model to capture more complex features in the data. The LSTM model based on phase space reconstruction utilizes the chaotic characteristics in the time series. By reconstructing the input data through phase space reconstruction as the input of the LSTM, the chaotic characteristics in the time series are revealed, improving the generalization ability of the model.
[0139] To reasonably compare the models, this application selects to use common evaluation metrics. The metrics used are the mean squared error (MSE) and the root mean squared error (RMSE).
[0140]
[0141] The ranges are both [0, +∞). The larger the error, the larger the values of MSE and RMSE.
[0142] This application uses 70% of the dataset as the training set, 20% as the test set, and 10% as the validation set. Since the dataset is large, this application shows the performance of the model on the test set. Figures 7 - 8 The performance of the four models on the test set is shown. It can be seen from the figure that the LSTM model has a strong prediction ability for time series data and can basically learn and predict the trends and features of the data. However, the performance of the stacked LSTM model with an attention mechanism is better.
[0143] Table 2 shows the evaluation metric data of different models.
[0144]
[0145] Figure 9 The bar chart of the model error comparison intuitively shows the prediction effects of each model.
[0146] This application proposes an stacked LSTM model with a time attention mechanism. The time attention mechanism allows the model to better understand the data and make better predictions. The reason for using LSTM to implement time attention is that in the current scenario, they are the core of all sequence prediction problems. To demonstrate the advantages of the model, this application uses a common LSTM model for comparison. The addition of attention enables the LSTM to better learn the input, thereby improving the prediction accuracy. And the performance of this model is compared with hybrid models such as recon-LSTM. Compared with the common model, the model proposed in this application has certain advantages in evaluation metrics. Therefore, it can be concluded that the addition of attention improves the accuracy of the existing model.
[0147] Embodiment 3
[0148] This embodiment also provides a photovoltaic power generation prediction system, including:
[0149] A data processing module, configured to obtain first historical photovoltaic data and perform first preprocessing on the first historical photovoltaic data;
[0150] A model establishment module, configured to train a first prediction model according to the first historical photovoltaic data after the first preprocessing;
[0151] A prediction module, configured to obtain first real-time photovoltaic data, and use the first real-time photovoltaic data as the input of the first prediction model after training is completed, and perform photovoltaic power generation prediction according to the output of the first prediction model after training is completed.
[0152] The above-mentioned unit modules can be embedded in the processor in the computer device in hardware form or be independent of the processor, or can be stored in the memory in the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above-mentioned modules.
[0153] This embodiment also provides a computer device, which can be a terminal, and its internal structure diagram can be as Figure 10As shown in the figure. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a carrier network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor, implements a photovoltaic power generation prediction method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0154] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0155] Obtain first historical photovoltaic data and perform first preprocessing on the first historical photovoltaic data;
[0156] Train a first prediction model according to the first historical photovoltaic data after the first preprocessing;
[0157] Obtain first real-time photovoltaic data, use the first real-time photovoltaic data as the input of the first prediction model after training is completed, and perform photovoltaic power generation prediction according to the output of the first prediction model after training is completed.
[0158] 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 them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
[0159] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages. For example, object-oriented programming languages such as Java and interpreted scripting languages such as JavaScript, etc.
[0160] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0161] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0162] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0163] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present application.
[0164] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these changes and modifications.
Claims
1. A photovoltaic power generation prediction method, characterized in that: include: Acquire first historical photovoltaic data, and perform first preprocessing on the first historical photovoltaic data; training a first prediction model according to the first historical photovoltaic data after the first preprocessing; First real-time photovoltaic data is acquired, and the first real-time photovoltaic data is used as an input of a first prediction model after training, and photovoltaic power generation prediction is performed according to an output of the first prediction model after training.
2. The photovoltaic power generation prediction method according to claim 1, characterized in that: The first prediction model includes: The first prediction model is any model whose input is the photovoltaic data after the first preprocessing and whose output is the photovoltaic power generation prediction result or the relevant parameters of the photovoltaic power generation prediction result that can be directly or indirectly obtained; The first prediction model includes at least several layers of neural network superposition.
3. The photovoltaic power generation prediction method according to claim 2, characterized in that: The plurality of neural network layers include at least two neural network layers, and the plurality of neural network layers are superimposed in series, and the output of the previous neural network layer serves as the input of the next neural network layer.
4. The photovoltaic power generation prediction method according to claim 3, characterized in that: The training of the first prediction model according to the first preprocessed first historical photovoltaic data comprises: Performing a first evaluation on the trained first prediction model, wherein the first evaluation is an evaluation standard performed by using a plurality of rating indicators; The first prediction model that meets the first evaluation is output as the first prediction model after training.
5. The photovoltaic power generation prediction method according to claim 4, characterized in that: The first prediction model also includes introducing a temporal attention mechanism.
6. The photovoltaic power generation prediction method according to claim 5, characterized in that: The first historical photovoltaic data obtained at least includes component temperature, air pressure, total radiation, scattered radiation, direct radiation and power generation.
7. The photovoltaic power generation prediction method according to claim 6, characterized in that: The first preprocessing of the first historical photovoltaic data at least comprises: performing a first correlation analysis on data related to power output in the first historical photovoltaic data; Acquire several parameters with high correlation with power output in the first historical photovoltaic data; The plurality of parameters with higher correlation are determined by presetting a first correlation threshold.
8. A photovoltaic power generation prediction system, characterized in that: include: A data processing module, used for acquiring first historical photovoltaic data and performing first preprocessing on the first historical photovoltaic data; A model building module, used for training a first prediction model according to the first historical photovoltaic data after the first preprocessing; The prediction module is used to obtain first real-time photovoltaic data, and use the first real-time photovoltaic data as the input of the first prediction model after training, and perform photovoltaic power generation prediction according to the output of the first prediction model after training.
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.
Citation Information
Cited By
Distributed photovoltaic short-term generation power prediction system based on machine learning
CN120996303A