Photovoltaic power prediction method and device

Historical weather data were screened and preprocessed by Pearson analysis, combined with the LSTM model and the cassia algorithm to optimize hyperparameters, the problem of low prediction accuracy of traditional photovoltaic power prediction methods was solved, and the prediction accuracy and adaptability were significantly improved.

CN119204330APending Publication Date: 2024-12-27MAOMING POWER SUPPLY BUREAU GUANGDONG POWER GRID CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411350937.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Traditional photovoltaic power prediction methods have low prediction accuracy, rely on a large amount of historical data and insufficient data preprocessing, and fail to fully explore the relationship between photovoltaic power fluctuation characteristics and meteorological factors, resulting in inaccurate prediction results, especially when meteorological conditions change drastically. The prediction error is large.

Method used

The Pearson analysis method was used to evaluate the correlation between historical weather data and photovoltaic power, filter the target data and preprocess the data, build an LSTM model, and optimize the hyperparameters using the squirt algorithm to improve the accuracy of the prediction model.

Benefits of technology

The accuracy of photovoltaic power prediction is significantly improved, especially when meteorological conditions change drastically, the prediction error is greatly reduced, which improves the model's adaptability between different meteorological conditions and photovoltaic power stations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204330A_ABST
    Figure CN119204330A_ABST
Patent Text Reader

Abstract

The invention relates to a photovoltaic power prediction method and device. The method comprises the following steps: respectively calculating a Pearson's correlation coefficient between historical weather data and historical photovoltaic power corresponding to the historical weather data by adopting a Pearson's analysis method, screening out target data from the historical weather data according to the Pearson's correlation coefficient, and carrying out data preprocessing on the target data to obtain a training data set; training the LSTM model by using the training data set, and optimizing hyper-parameters of the trained LSTM model by using a doliolaria algorithm to obtain a target prediction model; by adopting the method, the weather data with relatively high correlation with the photovoltaic power can be selected as the target data by adopting the Pearson analysis method, and the target data is preprocessed, so that the data quality of the training data set is improved, the subsequent training of the LSTM model is facilitated, and the accuracy of the LSTM model is improved. The hyper-parameters of the trained LSTM model are optimized by using the dogvessel algorithm, so that the accuracy of photovoltaic power prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of photovoltaic power technology, and in particular to a photovoltaic power prediction method and device. Background Art

[0002] Photovoltaic power generation has the advantages of being pollution-free, renewable, and having low operation and maintenance costs. It has been widely used and developed rapidly in recent years. However, since photovoltaic power generation is significantly affected by weather conditions (such as solar radiation intensity, cloud cover, temperature, etc.), its output power shows strong volatility and uncertainty. This volatility poses a huge challenge to the stable operation and scheduling of the power grid. In order to cope with the adverse effects of the volatility of photovoltaic power generation, photovoltaic output time series modeling technology has emerged. By analyzing and modeling the historical data of photovoltaic power generation, the power generation power in the future can be effectively predicted, thereby assisting in grid scheduling and operation optimization.

[0003] However, traditional photovoltaic power prediction methods mainly rely on historical data and statistical models, such as time series analysis and regression analysis, which have the problem of low prediction accuracy. Summary of the invention

[0004] Based on this, it is necessary to provide a photovoltaic power prediction method and device that can improve prediction accuracy in response to the above technical problems.

[0005] In a first aspect, the present application provides a photovoltaic power prediction method, the method comprising:

[0006] The Pearson analysis method is used to calculate the Pearson correlation coefficient between the historical weather data and the historical photovoltaic power corresponding to the historical weather data;

[0007] Filter the target data from the historical weather data according to the Pearson correlation coefficient, and pre-process the target data to obtain the training data set;

[0008] An LSTM model is constructed, and the training data set is used to train the LSTM model. The hyperparameters of the LSTM model are optimized using the Salp Algorithm to obtain a target prediction model. The target prediction model is used to predict the photovoltaic power at the output target prediction moment. Among them, the hyperparameters include learning rate, data batch size, and number of neurons.

[0009] In one embodiment, target data is screened out from historical weather data based on the Pearson correlation coefficient, including:

[0010] The absolute value corresponding to each Pearson correlation coefficient is obtained, and the historical weather data corresponding to the absolute value within the first numerical range is confirmed as the target data.

[0011] In one embodiment, data preprocessing is performed on the target data to obtain a training data set, including:

[0012] Sampling the target data according to a preset sampling interval to obtain sampling data;

[0013] When there are blank data in the sampled data, the interpolation method is used to supplement the blank data;

[0014] Obtain the numerical values ​​corresponding to the remaining data, determine the remaining data corresponding to the numerical values ​​outside the second numerical range as abnormal data, and replace the abnormal data using interpolation to obtain training data; wherein the remaining data is the data in the sampled data except the blank data;

[0015] The training data is normalized to obtain a training data set.

[0016] In one embodiment, the blank data is supplemented by an interpolation method, including:

[0017] Use the previous and next data corresponding to the blank data to supplement the blank data;

[0018] The interpolation method is used to replace the abnormal data to obtain training data, including:

[0019] Replace the abnormal data with the previous and next data corresponding to the abnormal data;

[0020] The training data is normalized to obtain a training data set, including:

[0021] According to the numerical size of the training data, the maximum value and the minimum value of the corresponding data type, the normalized data value of the training data is calculated, and the training data set is obtained based on the normalized data value.

[0022] In one embodiment, the hyperparameters of the trained LSTM model are optimized using the Salp algorithm to obtain a target prediction model, including:

[0023] Initialize the salp population, and iteratively screen the salp population according to the preset value to obtain the calculation result;

[0024] Based on the calculation results, the hyperparameters are optimized to obtain the target prediction model.

[0025] In one embodiment, iterative screening of the salp population according to a preset value to obtain a calculation result includes:

[0026] Calculate the individual fitness of the salp population, sort the individual fitness, and determine the current optimal fitness value;

[0027] Identify the salp individual corresponding to the current optimal fitness value as the leader, and identify the other salp individuals in the salp population except the leader as followers, determine the search parameters according to the current number of iterations and the preset value, update the position of the leader based on the search parameters, and update the position of the followers according to the position of the leader; return to execute the steps of calculating the individual fitness in the salp population, sorting the individual fitness, and determining the current optimal fitness value, until the number of iterations reaches the preset value;

[0028] Get the calculation result according to the current optimal fitness value.

[0029] In a second aspect, the present application also provides a photovoltaic power prediction device, the device comprising:

[0030] A coefficient acquisition module, used for respectively calculating the Pearson correlation coefficient between the historical weather data and the historical photovoltaic power corresponding to the historical weather data by using the Pearson analysis method;

[0031] A preprocessing module is used to filter out target data from historical weather data based on the Pearson correlation coefficient and perform data preprocessing on the target data to obtain a training data set;

[0032] The model acquisition module is used to build an LSTM model, train the LSTM model using a training data set, and optimize the hyperparameters of the LSTM model using the Salp Algorithm to obtain a target prediction model. The target prediction model is used to predict the photovoltaic power at the output target prediction moment; wherein the hyperparameters include learning rate, data batch size, and number of neurons.

[0033] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0034] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when the computer program is executed by a processor.

[0035] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0036] The above-mentioned photovoltaic power prediction method and device use the Pearson analysis method to calculate the Pearson correlation coefficient between historical weather data and the historical photovoltaic power corresponding to the historical weather data, select the target data from the historical weather data according to the Pearson correlation coefficient, and preprocess the target data to obtain a training data set, use the training data set to train the LSTM model, and use the Salp Sea Squid algorithm to optimize the hyperparameters of the trained LSTM model to obtain a target prediction model; the present application uses the Pearson analysis method to select weather data with a high correlation with photovoltaic power as target data, and preprocesses the target data, thereby improving the data quality of the training data set, facilitating the subsequent training of the LSTM model, and further improving the accuracy of photovoltaic power prediction by optimizing the hyperparameters of the trained LSTM model using the Salp Sea Squid algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0038] FIG1 is a schematic diagram of a flow chart of a photovoltaic power prediction method in one embodiment;

[0039] FIG2 is a schematic diagram of output of historical photovoltaic power within five days in one embodiment;

[0040] FIG3 is a schematic diagram of historical photovoltaic power output in 2023 in one embodiment;

[0041] FIG4 is a schematic diagram of the structure of hidden layer neurons of an LSTM neural network in one embodiment;

[0042] FIG5 is a schematic diagram of the Pearson correlation coefficient between historical photovoltaic power and historical weather data in one embodiment;

[0043] FIG6 is a schematic flow chart of a photovoltaic power prediction method in another embodiment;

[0044] FIG7 is a structural block diagram of a photovoltaic power prediction device in one embodiment;

[0045] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art of the technical field of the present application. The terms used herein in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It is understood that the terms "first", "second", etc. used in the present application can be used to describe various elements in this article, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element.

[0048] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" etc. specify the presence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.

[0049] At present, the main methods for modeling photovoltaic power output time series include the following: (1) Time series analysis methods, which are applicable to stationary time series data, and use autoregressive moving average (ARMA) models to describe the correlation of data through autoregressive (AR) and moving average (MA) components; there are also autoregressive integrated moving average (ARIMA) models applicable to non-stationary time series, which are converted into stationary series through differential operations and then the ARMA model is applied; there are also seasonal ARIMA (SARIMA) models applicable to time series with seasonal fluctuations, which contain seasonal difference and seasonal ARMA components; (2) Regression analysis methods. With the development of machine learning, many regression methods have been improved: there are regression methods based on support vector machines, which are suitable for non-stationary time series. Support vector regression (SVR) for nonlinear and high-dimensional data; Random forest regression (RFR) which performs regression analysis by constructing multiple decision trees and taking the average value, and has a strong ability to handle nonlinear and noisy data; It also includes the gradient boosting regression tree method (GBRT) which is suitable for handling complex nonlinear relationships by gradually constructing multiple decision trees, each tree fitting the residual of the previous tree; (3) Deep learning methods. When deep learning plays a more important role in the modeling process, many methods have emerged: a long short-term memory network (LSTM) based on a recurrent neural network (RNN) suitable for time series data; a Transformer model based on the attention mechanism that can effectively process long sequence data, etc.

[0050] The above methods have improved the accuracy of photovoltaic power generation prediction to a certain extent, but the following problems still exist: (1) The prediction accuracy is not high. The existing methods rely on a large amount of historical data for modeling, and have high requirements for data integrity and quality. They are limited in dealing with photovoltaic power volatility, and the prediction results are often not accurate enough, especially when meteorological conditions change drastically. The prediction errors are large; (2) Data preprocessing is insufficient. The existing methods do not conduct in-depth analysis of the factors affecting photovoltaic power. The data preprocessing steps are simple and fail to fully mine the useful information in the data; (3) There is a lack of in-depth mining of fluctuation characteristics. When dealing with photovoltaic power fluctuation characteristics, most of the existing methods simply perform smoothing or directly apply statistical features, and fail to deeply mine the relationship between fluctuation characteristics and meteorological factors, resulting in poor prediction results; that is, the existing methods do not make full use of the photovoltaic power fluctuation characteristics for prediction, and fail to establish an effective relationship between fluctuation characteristics and meteorological factors.

[0051] The photovoltaic power prediction method provided in the embodiment of the present application evaluates the correlation of various influencing factors (historical weather data corresponding to different types) through Pearson analysis, and pre-processes the acquired target data, fully utilizes the useful information in the historical weather data, improves the quality of data pre-processing, and at the same time improves the adaptability of the target prediction model between different meteorological conditions and different photovoltaic power stations based on fluctuation characteristic classification and matching relationship mining. Finally, the hyperparameters of the LSTM model of the Salp Sea Squib algorithm are optimized to significantly improve the accuracy of photovoltaic power prediction, especially when the meteorological conditions change drastically, the prediction error is greatly reduced.

[0052] In an exemplary embodiment, as shown in FIG1 , a photovoltaic power prediction method is provided, the method comprising:

[0053] S102, using a Pearson analysis method to respectively calculate the Pearson correlation coefficient between the historical weather data and the historical photovoltaic power corresponding to the historical weather data.

[0054] It should be noted that photovoltaic output power (photovoltaic power) is affected by meteorological factors such as irradiance and temperature, and the output power of each photovoltaic power station varies at different times. Therefore, before conducting accurate photovoltaic power prediction, it is necessary to first understand the power variation characteristics of the photovoltaic power generation system and analyze the potential relationship between various meteorological factors and photovoltaic output power. Among them, the embodiment of this application will analyze the daily and annual variation characteristics of photovoltaic output power, and select the key factors (training data sets) that have a greater impact on photovoltaic output power from many influencing factors as model input.

[0055] Exemplarily, photovoltaic power (output) is affected by a variety of weather factors. Therefore, in order to study the laws of photovoltaic power and build a suitable prediction model, it is crucial to obtain reliable historical photovoltaic power data (historical photovoltaic power) and meteorological data (historical weather data). The historical weather data and the corresponding historical photovoltaic power used in the embodiments of the present application are illustrated using the data of the Ivanpah solar thermal power station in the Nevada desert, USA as an example. The data includes historical power data of the photovoltaic array (historical photovoltaic power) and related weather data such as irradiance and temperature (historical weather data). The time sampling interval of the historical weather data is 5 minutes, covering a one-year time span from January 1, 2023 to December 31, 2023.

[0056] Among them, the photovoltaic power from January 1 to January 5, 2023 is selected for visualization, and the photovoltaic output power is shown in Figure 2. Due to the influence of weather factors, the photovoltaic power generation power varies every day. For example, the power generation power on January 1 and 2 exceeded 8kW and was relatively stable, while on January 4 and 5, due to the weather, the photovoltaic output was low, not exceeding 4kW, and fluctuated greatly. The photovoltaic power change curve for the whole year of 2023 is visualized as shown in Figure 3. It can be seen that due to the real-time changes in weather factors, the photovoltaic power shows volatility throughout the year.

[0057] Specifically, the factors that affect the power output of photovoltaic power generation systems are mainly divided into two categories: internal and external. Internal factors include the number and area of ​​photovoltaic panels, photoelectric conversion efficiency, inverter parameters, etc. These parameters are determined during production and are relatively fixed in the short term. External factors are mainly meteorological conditions such as irradiance, temperature, humidity, wind speed, precipitation, etc. Since these factors are uncertain and uncontrollable, they have a significant impact on photovoltaic power output, so they should be focused on in short-term forecasts; the Pearson analysis method is used in the embodiment of the present application to calculate the Pearson correlation coefficient between historical weather data and the historical photovoltaic power corresponding to the historical weather data, where the Pearson correlation coefficient can be used to characterize the correlation between historical weather data and the historical photovoltaic power corresponding to the historical weather data; historical weather data include: GHI (Global Horizontal Irradiance, overall horizontal irradiance), DHI (Diffuse Horizontal Irradiance, horizontal diffuse irradiance), wind speed, wind direction, temperature, humidity, precipitation data.

[0058] S104, selecting target data from historical weather data based on the Pearson correlation coefficient, and performing data preprocessing on the target data to obtain a training data set.

[0059] Specifically, the target data is selected from the historical weather data based on the Pearson correlation coefficient. However, in actual applications, due to missing data, data errors, low sampling rate, and inconsistent data dimensions of different variables, the target data cannot be directly used for modeling and testing. Therefore, it is necessary to preprocess the target data to obtain a training data set in order to provide a suitable data basis for subsequent training and testing of the model.

[0060] S106, constructing an LSTM (Long Short Term Memory) model, using a training data set to train the LSTM model, and using a Salp Unica algorithm to optimize the hyperparameters of the LSTM model to obtain a target prediction model, the target prediction model is used to predict the photovoltaic power at the output target prediction moment; wherein the hyperparameters include a learning rate, a data batch size, and a number of neurons.

[0061] Among them, the target prediction time can be set according to actual conditions and is not limited in the embodiments of the present application.

[0062] Specifically, in order to more effectively apply data mining technology to predict photovoltaic power generation, choosing a suitable prediction model is crucial to improving prediction accuracy. The long short-term memory neural network (LSTM) model, as a deep learning prediction model, is the mainstream direction of current research. This application trains the LSTM model using a training data set, and uses the Salp Sea Squid algorithm to optimize the hyperparameters of the trained LSTM model to obtain the target prediction model, which effectively reduces the prediction error and improves the prediction accuracy.

[0063] It should be noted that the LSTM neural network is based on the recurrent neural network (RNN). By introducing gated units to replace neurons in the hidden layer of the RNN, it can effectively process long time series information. It can selectively retain or discard information, thereby overcoming the problems of insufficient memory, gradient disappearance, and gradient explosion encountered by traditional RNN in the process of long time series processing. Figure 4 shows an example of the structure of a hidden layer neuron of the LSTM neural network; in which x t Represents the input data information at time t; h t-1 and h t Respectively represent the output data information at time t-1 and t; C t-1 and C t Respectively represent the states of the memory unit at time t-1 and t; C t represents the temporary state of the memory unit at time t. The memory unit is the core of controlling the transmission of time series data information; f t Represents the state of the forget gate at time t, which determines the memory state C t Keep C t-1 The amount of information; i t Represents the input gate state at time t, which is used to control x t Pass to C t The amount of information; t Indicates the state of the output gate at time t, which is used to control C t Pass to h t The information transmission process in Figure 4 is shown in the following formula (1):

[0064] (1);

[0065] in, is the bipolar activation function; tanh is the hyperbolic tangent activation function; , and is the weight vector from the input layer and hidden layer to the forget gate and the offset of the forget gate; , and is the weight vector from the input layer and hidden layer to the input gate and the offset of the input gate; , and is the weight vector from the input layer and hidden layer to the memory unit and the offset of the memory unit; , and is the weight vector from the input layer and hidden layer to the output layer and the offset of the output layer.

[0066] In the information transmission process of the LSTM neural network, the historical weather data from (t-n+1) to time t is used to train the input-output mapping, and the data to be tested (photovoltaic power) at time (t+m) is predicted. Here, n represents the length of the historical sequence involved in the training, that is, the total number of historical sample points; x t and h t are the input factors and photovoltaic power at time t respectively. The gating unit in the LSTM network determines the fitting relationship between the multidimensional meteorological factors and photovoltaic power by adjusting the weights between them. t-1 With h t-1 The LSTM model can not only reflect the relationship between input and output, but also capture the correlation information between sample points by jointly participating in the weight update at time t. The main hyperparameters that need to be optimized for the LSTM model include: data batch size, learning rate, and number of neurons.

[0067] From the above, it can be concluded that the LSTM model is not only suitable for mining the relationship between the prediction input factors and photovoltaic power, but its unique network structure and information transmission mechanism can also effectively reveal the potential correlation between the sample points in the fluctuation sequence. Through the action of the forget gate, input gate and output gate, the LSTM unit can retain important information, ignore irrelevant information, and update the state value in real time, and then pass it to the next LSTM unit.

[0068] In the above photovoltaic power prediction method, the Pearson correlation coefficient between the historical weather data and the historical photovoltaic power corresponding to the historical weather data is calculated by using the Pearson analysis method, and the target data is screened out from the historical weather data according to the Pearson correlation coefficient. The target data is preprocessed to obtain a training data set, which improves the data quality of the training data set and facilitates the subsequent training of the LSTM model. The LSTM model is trained using the training data set, and the hyperparameters of the trained LSTM model are optimized using the Salp Alveolar Algorithm to obtain a target prediction model, which further improves the accuracy of photovoltaic power prediction.

[0069] In one embodiment, target data is screened out from historical weather data based on the Pearson correlation coefficient, including:

[0070] The absolute value corresponding to each Pearson correlation coefficient is obtained, and the historical weather data corresponding to the absolute value within the first numerical range is confirmed as the target data.

[0071] Among them, the first numerical range can be set according to actual conditions. In the embodiment of the present application, the first numerical range is taken as 0.4 to 1 as an example for explanation.

[0072] Specifically, the calculation formula of the Pearson correlation coefficient is shown in formula (2):

[0073] (2);

[0074] in, is the Pearson correlation coefficient; and is the sample average of the input and output variables; n is the total number of time nodes; and Enter the value of the output variable at time i (set according to actual situation). Indicates the correlation between the input variable and the output variable. The value range is between -1 and 1. Positive values ​​indicate positive correlation, and negative values ​​indicate negative correlation. Get the absolute value corresponding to each Pearson correlation coefficient ,when The closer the value is to 1, the higher the correlation is. The closer the value is to 0, the lower the correlation is. See Table 1 for the specific corresponding relationship.

[0075] Table 1

[0076]

[0077] According to formula (2), the Pearson correlation coefficients between GHI, DHI, wind speed, wind direction, temperature, humidity, precipitation data and photovoltaic power in historical weather data are calculated respectively. The results are shown in Figure 5. As shown in Figure 5, GHI has the greatest impact on photovoltaic output, and its Pearson correlation coefficient is as high as 0.91, which is within the first numerical range. It is taken as one of the main input factors. Secondly, the Pearson correlation coefficient of DHI is about 0.55, which also has a significant impact on photovoltaic output power. It is within the first numerical range and is also included in the input factors. The Pearson correlation coefficients of temperature and humidity are both around 0.4 (within the first numerical range). Although their correlation with output power is relatively general, they should still be taken as input variables for comprehensive analysis. Wind speed mainly affects the surface temperature of the solar panel, and its Pearson coefficient is only 0.24, which has a weak correlation, so it should not be selected as an input factor; wind direction and precipitation have little impact on photovoltaic output power and can be ignored. In summary, GHI, DHI, temperature and humidity (target data) are finally selected as input factors for photovoltaic power prediction.

[0078] In the embodiment of the present application, the correlation of each historical weather data (influencing factor) is evaluated by using the Pearson correlation coefficient, and the historical weather data with weak correlation is eliminated, so that the useful information in the historical weather data is fully utilized, which facilitates the subsequent training of the LSTM model and improves the prediction accuracy.

[0079] In one embodiment, data preprocessing is performed on the target data to obtain a training data set, including:

[0080] Sampling the target data according to a preset sampling interval to obtain sampling data;

[0081] When there are blank data in the sampled data, the interpolation method is used to supplement the blank data;

[0082] Obtain the numerical values ​​corresponding to the remaining data, determine the remaining data corresponding to the numerical values ​​outside the second numerical range as abnormal data, and replace the abnormal data using interpolation to obtain training data; wherein the remaining data is the data in the sampled data except the blank data;

[0083] The training data is normalized to obtain a training data set.

[0084] Among them, the preset sampling interval can be set according to actual conditions, and the preset sampling interval of 30 minutes is taken as an example for explanation in the embodiment of the present application; the second numerical range can be set according to actual conditions and is not limited in the embodiment of the present application.

[0085] Specifically, it can be obtained from the above that the time sampling interval of historical weather data is 5 minutes, which is easy to cause the problem of excessive data volume, thereby affecting the prediction efficiency and increasing the calculation burden. Therefore, the sampling interval of the data is adjusted to 30 minutes to improve the efficiency of practical application and obtain the sampled data; due to reasons such as photovoltaic array failure or recorder failure, there may be missing values ​​(blank data) in the sampled data, which will affect the accuracy of the prediction, so the interpolation method is used to supplement the blank data to ensure the accuracy and smoothness of the data; further, when the weather is stable and the photovoltaic array is working normally, the photovoltaic data may fluctuate abnormally. At this time, by obtaining the numerical value corresponding to the remaining data, the remaining data corresponding to the numerical value outside the second numerical range is determined as abnormal data, and the interpolation method is used to replace the abnormal data and delete the original abnormal data; because the historical photovoltaic power and historical weather data have different dimensions, direct use may affect the prediction accuracy, therefore, the training data is normalized to improve the calculation speed and obtain more accurate prediction results.

[0086] Exemplarily, negative abnormal data in the photovoltaic power data are replaced by 0.

[0087] In the embodiment of the present application, by adjusting the sampling interval of the target data, filling in missing data, eliminating erroneous data and performing data normalization processing, abnormal data is cleaned, and useful information in historical data (historical weather data and historical photovoltaic power) is fully utilized, the quality of data preprocessing is improved, the subsequent training of the LSTM model is facilitated, and the prediction accuracy is improved.

[0088] In one embodiment, the blank data is supplemented by an interpolation method, including:

[0089] Use the previous and next data corresponding to the blank data to supplement the blank data;

[0090] The interpolation method is used to replace the abnormal data to obtain training data, including:

[0091] Replace the abnormal data with the previous and next data corresponding to the abnormal data;

[0092] The training data is normalized to obtain a training data set, including:

[0093] According to the numerical size of the training data, the maximum value and the minimum value of the corresponding data type, the normalized data value of the training data is calculated, and the training data set is obtained based on the normalized data value.

[0094] Specifically, the blank data is filled by using the mean of the preceding and following data corresponding to the blank data, wherein the number of preceding and following data can be set according to the actual situation, for example: the blank data is supplemented by using the preceding and following data of the blank data, and the average value between the two is used to supplement the blank data. Similarly, the abnormal data can be replaced by using the preceding and following data corresponding to the abnormal data, wherein the number of preceding and following data can be set according to the actual situation, and the replacement method is similar to the above-mentioned supplementation method, which will not be described in detail in the embodiments of the present application.

[0095] The historical weather data include: GHI (Global Horizontal Irradiance), DHI (Diffuse Horizontal Irradiance), wind speed, wind direction, temperature, humidity, and precipitation data. That is, they correspond to different data types, and the maximum and minimum values ​​in the training data corresponding to each data type are obtained. The data are normalized according to the maximum and minimum values. The specific method of normalization is shown in the following formula (3):

[0096] (3);

[0097] in, is the normalized value; is the target data; and The training data corresponding to each data type are normalized to obtain the training data set based on the results of the normalization.

[0098] In one embodiment, the hyperparameters of the trained LSTM model are optimized using the Salp algorithm to obtain a target prediction model, including:

[0099] Initialize the salp population, and iteratively screen the salp population according to the preset value to obtain the calculation result;

[0100] Based on the calculation results, the hyperparameters are optimized to obtain the target prediction model.

[0101] Among them, the preset value can be set according to actual conditions and is not limited in the embodiments of the present application.

[0102] Specifically, the Salp Swarm Algorithm (SSA) is similar to some swarm intelligence algorithms. The position of the salp is defined in a search space of size d×s, where s represents the number of variables to be optimized and d is the size of the salp population, i.e., the number of candidate solutions. First, the position of each salp is initialized, as shown in the following formula (4):

[0103] (4);

[0104] in, is the i-th salp individual in the j-th dimension; is a random number between 0 and 1; and are the upper and lower bounds of the j-th dimension search range respectively.

[0105] Assume that there is a food source named F in the search space as the target of the salp population. In order to find this food source, the leader updates the position according to formula (5).

[0106] (5);

[0107] Where: The leader, i.e., the first salp representing the jth dimension, is responsible for guiding other followers to search within the search range; is the position of the j-th dimension food; , is a random number ranging from 0 to 1, where It can be obtained by following formula (6):

[0108] (6);

[0109] Among them, n is the current number of iterations, and N is the total number of iterations (preset value).

[0110] In the initial stage, the parameters The leader searches extensively within the upper and lower bounds to determine the approximate location of the food. Gradually decreasing and stabilizing, the leader gradually narrows the search range and switches to a fine search mode, thereby accurately locating food. These characteristics make SSA have a high search efficiency.

[0111] As the leader's position changes, the follower will adjust its position according to the leader's path. According to Newton's second law, the follower's update rule can be obtained by the following formula (7):

[0112] (7);

[0113] in, is the leader, representing the i-th salp in the j-th dimension.

[0114] By exploring and utilizing a certain search space, the leader guides the followers to find the global optimum, which is the food source that the leader is tracking. The main characteristics of SSA are described as follows: (1) After each iteration, SSA retains the optimal solution in the current iteration and distributes it near the accessible food source. Therefore, even if the overall result of the population deteriorates in subsequent iterations, the optimal solution will not be eliminated; (2) The algorithm only updates the position of the leader relative to the food source, that is, the optimal solution, to discover, utilize and search the space around it and eventually find the food source. At the same time, the followers continue to shorten the distance with the previous followers, avoiding the local minimum problem caused by the slow movement of the followers. (3) Since the beginning of the algorithm, the parameters Adaptively reduce to meet the search needs. In the early stage, the leader conducts a large-scale exploration within the upper and lower bounds to determine the approximate location of the food. Near the end, the step size tends to a constant value, and the focus shifts to the utilization of resources in the surrounding search space. This feature helps maintain the exploration and utilization balance of the algorithm and improves the optimization efficiency. (4) During the entire iteration process, only is a main control parameter, so SSA has the advantages of low complexity and easy implementation.

[0115] In summary, based on these characteristics, SSA becomes an excellent candidate algorithm for exploring unknown space and solving optimization problems. The adaptive characteristics of SSA avoid local minima and can find the global optimal solution. By initializing the salp population, the salp population is iteratively screened according to the preset value to obtain the operation result F. According to the operation result F, the learning rate, data batch size and number of neurons of the LSTM model are optimized to obtain the target prediction model.

[0116] In the embodiments of the present application, the calculation results are obtained by iteratively screening the salp population according to preset values, and the hyperparameters are optimized based on the calculation results to obtain the target prediction model. The fluctuation characteristic mining and LSTM combination model (LSTM model combined with salp algorithm) are used to significantly improve the accuracy of photovoltaic power prediction, especially when the meteorological conditions change drastically, the prediction error is greatly reduced, thereby improving the accuracy of the prediction.

[0117] In one embodiment, iterative screening of the salp population according to a preset value to obtain a calculation result includes:

[0118] Calculate the individual fitness of the salp population, sort the individual fitness, and determine the current optimal fitness value;

[0119] Identify the salp individual corresponding to the current optimal fitness value as the leader, and identify the other salp individuals in the salp population except the leader as followers, determine the search parameters according to the current number of iterations and the preset value, update the position of the leader based on the search parameters, and update the position of the followers according to the position of the leader; return to execute the steps of calculating the individual fitness in the salp population, sorting the individual fitness, and determining the current optimal fitness value, until the number of iterations reaches the preset value;

[0120] Get the calculation result according to the current optimal fitness value.

[0121] Specifically, calculate the fitness of individuals in the salp population, select the salp individual corresponding to the current optimal fitness value as the leader, and the rest as followers; update the search parameters according to (6) , and update the positions of the leader and follower according to (5) and (7) respectively; return to execute the steps of calculating the fitness of individuals in the salp population, sorting the individual fitness, and determining the current optimal fitness value, until the number of iterations reaches the preset value, and obtain the calculation result according to the current optimal fitness value (food source F in the salp algorithm) finally obtained.

[0122] In order to facilitate the understanding of those skilled in the art, the photovoltaic power prediction method is explained below with a specific example. As shown in Figure 6, the SSA-LSTM model (LSTM model combined with the Salp Intestine algorithm) can automatically optimize the learning rate, data batch size and number of neurons of the LSTM model. The optimization process of the SSA-LSTM model is: initialize the parameters of the LSTM model, set the initial number of neurons and data batch size, determine the network structure, initialize the Salp Intestine algorithm, set the population size and number of iterations (preset values), and randomly initialize the parameters. , and ; Randomly initialize the salp population, input the preprocessed data (training data set) into the LSTM model, calculate the fitness of each individual; select the individual with the best fitness (the salp individual corresponding to the current best fitness value) and update it as the food source F, represents the i-th salp in the j-th dimension. When i is equal to 1, it is the leader, and when i is greater than or equal to 2, it is the follower. The positions of the leader and follower are updated according to equations (5) and (7), respectively, and the search parameters are updated according to equation (6). ; Recalculate the fitness of each individual, and if there is a fitness better than the current F, update it to the new F until the maximum number of iterations is reached, and output the F at this time as the optimal solution of the hyperparameters of the LSTM model. Use the optimized SSA-LSTM model to predict the photovoltaic power at the target prediction time and evaluate its accuracy.

[0123] Among them, N SSA It usually refers to the number of salps involved in the optimization problem, which can be understood as the number of salps individuals or population size in the algorithm.

[0124] It should be noted that five prediction error evaluation indicators can also be selected, including root mean square error (RMSE), mean absolute error (MAE), maximum prediction error (δmax) and qualified rate (QR0), as shown in the following equations (8) to (12):

[0125] (8);

[0126] (9);

[0127] (10);

[0128] (11);

[0129] (12);

[0130] Where n represents the number of sampling points in the prediction period. and Respectively represent the actual value and predicted value of the photovoltaic output power at that moment; is the total installed or operating capacity of the photovoltaic power station during the forecast period, A binary variable taking the value 0 or 1.

[0131] Through testing, the prediction model structure based on SSA-LSTM neural network was adopted, and the combined prediction effect of data processing methods such as fluctuation characteristic mining and K-means-based weather type classification was compared. Through the prediction analysis of the test day under complex and strong fluctuation weather, the results show that the photovoltaic power prediction method proposed in this application has strong applicability, and the target prediction model is consistent with the actual photovoltaic power generation power curve change trend, and the fit is the best.

[0132] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0133] Based on the same inventive concept, the embodiment of the present application also provides a photovoltaic power prediction device for implementing the photovoltaic power prediction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more photovoltaic power prediction device embodiments provided below can refer to the limitations of the photovoltaic power prediction method above, and will not be repeated here.

[0134] In an exemplary embodiment, as shown in FIG7 , a photovoltaic power prediction device 700 is provided, and the device 700 includes:

[0135] A coefficient acquisition module 701 is used to calculate the Pearson correlation coefficient between the historical weather data and the historical photovoltaic power corresponding to the historical weather data by using the Pearson analysis method;

[0136] A preprocessing module 702 is used to filter out target data from historical weather data according to the Pearson correlation coefficient, and perform data preprocessing on the target data to obtain a training data set;

[0137] The model acquisition module 703 is used to construct an LSTM model, train the LSTM model using a training data set, and optimize the hyperparameters of the LSTM model using the Salp Algorithm to obtain a target prediction model, which is used to predict the photovoltaic power at the output target prediction moment; wherein the hyperparameters include a learning rate, a data batch size, and a number of neurons.

[0138] In one embodiment, the preprocessing module 702 is further used to obtain the absolute value corresponding to each Pearson correlation coefficient, and confirm the historical weather data corresponding to the absolute value within the first numerical range as the target data.

[0139] In one embodiment, the preprocessing module 702 is further used to sample the target data according to a preset sampling interval to obtain sampled data;

[0140] When there are blank data in the sampled data, the interpolation method is used to supplement the blank data;

[0141] Obtain the numerical values ​​corresponding to the remaining data, determine the remaining data corresponding to the numerical values ​​outside the second numerical range as abnormal data, and replace the abnormal data using interpolation to obtain training data; wherein the remaining data is the data in the sampled data except the blank data;

[0142] The training data is normalized to obtain a training data set.

[0143] In one embodiment, the preprocessing module 702 is further used to supplement the blank data using the preceding and following data corresponding to the blank data;

[0144] The preprocessing module 702 is further used to replace the abnormal data with the previous and next data corresponding to the abnormal data;

[0145] The preprocessing module 702 is further used to calculate the normalized data value of the training data according to the numerical value of the training data, the maximum value and the minimum value of the corresponding data type, and obtain the training data set based on the normalized data value.

[0146] In one embodiment, the model acquisition module 703 is further used to initialize the salp population, and iteratively screen the salp population according to a preset value to obtain a calculation result;

[0147] Based on the calculation results, the hyperparameters are optimized to obtain the target prediction model.

[0148] In one embodiment, the model acquisition module 703 is also used to calculate the individual fitness within the salp population, and sort the individual fitness to determine the current optimal fitness value;

[0149] Identify the salp individual corresponding to the current optimal fitness value as the leader, and identify the other salp individuals in the salp population except the leader as followers, determine the search parameters according to the current number of iterations and the preset value, update the position of the leader based on the search parameters, and update the position of the followers according to the position of the leader; return to execute the steps of calculating the individual fitness in the salp population, sorting the individual fitness, and determining the current optimal fitness value, until the number of iterations reaches the preset value;

[0150] Get the calculation result according to the current optimal fitness value.

[0151] Each module in the photovoltaic power prediction device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0152] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sampling data and target data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a photovoltaic power prediction method is implemented.

[0153] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0154] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the above-mentioned photovoltaic power prediction method is implemented when the processor executes the computer program.

[0155] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned photovoltaic power prediction method is implemented.

[0156] In one embodiment, a computer program product is provided, comprising a computer program, wherein the computer program implements the photovoltaic power prediction method when executed by a processor.

[0157] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0158] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0160] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A photovoltaic power prediction method, characterized in that: The method comprises: The Pearson analysis method is used to calculate the Pearson correlation coefficient between the historical weather data and the historical photovoltaic power corresponding to the historical weather data; Filtering target data from the historical weather data according to the Pearson correlation coefficient, and performing data preprocessing on the target data to obtain a training data set; An LSTM model is constructed, the training data set is used to train the LSTM model, and the hyperparameters of the LSTM model are optimized using the Salp Unica algorithm to obtain a target prediction model, wherein the target prediction model is used to predict the photovoltaic power at the output target prediction moment; wherein the hyperparameters include a learning rate, a data batch size, and a number of neurons.

2. The method according to claim 1, characterized in that The step of selecting target data from the historical weather data according to the Pearson correlation coefficient includes: The absolute value corresponding to each of the Pearson correlation coefficients is obtained, and the historical weather data corresponding to the absolute value within the first numerical range is confirmed as the target data.

3. The method according to claim 1, characterized in that The step of performing data preprocessing on the target data to obtain a training data set includes: Sampling the target data according to a preset sampling interval to obtain sampled data; In the case where blank data exists in the sampled data, the blank data is supplemented by an interpolation method; Obtaining the numerical value corresponding to the remaining data, determining the remaining data corresponding to the numerical value outside the second numerical range as abnormal data, and replacing the abnormal data with the interpolation method to obtain training data; wherein the remaining data is the data in the sampled data except the blank data; The training data is normalized to obtain the training data set.

4. The method according to claim 3, characterized in that The method of supplementing the blank data by interpolation includes: Supplementing the blank data using the preceding and following data corresponding to the blank data; The step of replacing the abnormal data with the interpolation method to obtain training data includes: Replacing the abnormal data with the preceding and following data corresponding to the abnormal data; The normalizing the training data to obtain the training data set includes: According to the numerical value of the training data, the maximum value and the minimum value of the corresponding data type, the normalized data value of the training data is calculated, and the training data set is obtained based on the normalized data value.

5. The method according to claim 1, characterized in that The method of optimizing the hyperparameters of the trained LSTM model by using the Salp Algorithm to obtain a target prediction model includes: Initializing a salp population, and iteratively screening the salp population according to a preset value to obtain a calculation result; The hyperparameters are optimized based on the calculation results to obtain the target prediction model.

6. The method according to claim 5, characterized in that The iterative screening of the salp population according to the preset value to obtain the calculation result includes: Calculating the fitness of individuals in the salp population, and sorting the individual fitness to determine the current optimal fitness value; Identify the salp individual corresponding to the current optimal fitness value as a leader, and identify other salp individuals in the salp population except the leader as followers, determine the search parameter according to the current number of iterations and the preset value, update the position of the leader based on the search parameter, and update the position of the follower according to the position of the leader; return to the step of calculating the individual fitness in the salp population, sorting the individual fitness, and determining the current optimal fitness value, until the number of iterations reaches the preset value; The calculation result is obtained according to the current optimal fitness value.

7. A photovoltaic power prediction device, characterized in that: The device comprises: A coefficient acquisition module, used to calculate the Pearson correlation coefficient between the historical weather data and the historical photovoltaic power corresponding to the historical weather data by using the Pearson analysis method; A preprocessing module, used for filtering target data from the historical weather data according to the Pearson correlation coefficient, and performing data preprocessing on the target data to obtain a training data set; A model acquisition module is used to build an LSTM model, train the LSTM model using the training data set, and optimize the hyperparameters of the LSTM model using the Salp Sea Squib algorithm to obtain a target prediction model, wherein the target prediction model is used to predict the photovoltaic power at the output target prediction moment; wherein the hyperparameters include a learning rate, a data batch size, and a number of neurons.

8. 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 6 are implemented.

9. 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 6 are implemented.

10. A computer program product, comprising a computer program, 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 6 are implemented.