Photovoltaic power prediction method and system based on multi-characteristic variables and time series correlation
Through a photovoltaic power prediction method based on multi-eigen variables and time series correlation, combined with data enhancement and attention mechanism, the problem of insufficient photovoltaic power prediction accuracy in the existing technology is solved, and higher prediction accuracy and model interpretation are achieved. , adapt to complex scenarios and data limitations.
Patent Information
- Application Number
- CN202411216251.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-09-02
AI Technical Summary
The existing photovoltaic power prediction methods have limitations in the case of complex operating conditions and poor data quality, and fail to fully consider the complex interactions between various influencing factors.
Using a photovoltaic power prediction method based on multi-eigen variables and time series correlation, the data augmentation model and the attention mechanism are constructed, the attention distribution of the prediction model is extracted, the data set is optimized, and the time series branch module and variable branch module are used for prediction. Fusion time series and variable prediction sequences are combined to output the final prediction sequence.
It improves prediction accuracy and generalization capabilities, enhances the model's understanding of complex interactions, reduces the problems of insufficient data and uneven distribution, reduces the cumulative effect of external data errors, and improves prediction quality and model transparency.
Smart Images

Figure CN118734079B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power prediction, and in particular to a photovoltaic power prediction method and system based on multi-characteristic variables and time series correlation. Background Art
[0002] With the proposal of the "carbon peak" and "carbon neutrality" goals, my country is accelerating the transformation of its energy structure, and the installed capacity of renewable energy such as photovoltaic and wind power has increased significantly. Among them, photovoltaic power generation has higher sustainability, cleanliness and economy, but its output power is affected by the temporal and regional changes in light conditions, showing significant volatility and intermittency. These characteristics have brought challenges to the safe and stable operation of the power system, especially putting forward higher requirements on the peak-shaving capacity of the power grid and the level of access to new energy.
[0003] In order to solve the impact of photovoltaic power fluctuations on the power grid, the main measures taken include the coordinated operation of photovoltaic and traditional power generation methods, and the optimization of scheduling plans and power grid operation strategies through accurate power forecasting. As one of the key technologies, photovoltaic power forecasting plays a vital role in improving the peak-shaving capacity of the power grid, enhancing the ability to accept new energy, and improving the safety and economy of power system operation. Traditional photovoltaic power prediction methods mainly include mathematical models based on physical principles and statistical models based on historical data. In recent years, with the application of Internet technology and big data, photovoltaic power prediction methods have been continuously innovated, and photovoltaic power generation prediction models established using machine learning and artificial intelligence technologies have developed rapidly.
[0004] At present, the mainstream photovoltaic prediction models include models associated with characteristic variables, models based on time series relationships, and models combining historical power and meteorological information; among them, the model associated with characteristic variables predicts power output by analyzing the relationship between characteristic variables such as meteorology and power generation, and this method has limitations in dealing with time series dependencies; the model based on time series relationships uses time series analysis technology to capture the changing patterns of power data over time, but ignores the interactions between different variables; the model combining historical power and meteorological information establishes a direct mapping relationship between input and output through machine learning or neural network technology, but the model is insufficient in interpretability and sensitivity to data quality; although the above-mentioned machine learning models have made certain progress in improving the accuracy of photovoltaic power prediction, due to the failure to fully consider the complex interactions between various influencing factors, when faced with complex operating conditions and poor data quality, the accuracy of photovoltaic power prediction is still limited. Summary of the invention
[0005] In order to improve the prediction accuracy of photovoltaic power, the photovoltaic power prediction method and system based on multi-feature variables and time series correlation provided by the present invention takes the correlation of features between variables and the time series correlation of the variables themselves as the basis for prediction. The technical solutions adopted are as follows:
[0006] The technical solution of the first aspect of the present invention proposes a photovoltaic power prediction method based on multiple characteristic variables and time series correlation, the method comprising:
[0007] Acquire photovoltaic power data and meteorological data, and obtain historical data sets after preprocessing;
[0008] Build a data enhancement model, train the data enhancement model based on the historical data set and generate an enhanced data set;
[0009] Build a prediction model and train the prediction model using the enhanced dataset;
[0010] Extract the attention distribution of the prediction model based on the attention mechanism and optimize the data augmentation dataset;
[0011] The prediction model is trained based on the optimized enhanced data set, and the photovoltaic power and meteorological data prediction series are output.
[0012] Furthermore, photovoltaic power data and meteorological data are obtained, and after preprocessing, the historical data sets obtained include:
[0013] Collect photovoltaic power data and meteorological data according to preset time intervals, where the meteorological data includes at least temperature, humidity, traffic volume and irradiation;
[0014] The photovoltaic power data and meteorological data are aggregated and grouped according to the preset time resolution to obtain a historical data set.
[0015] Furthermore, a data enhancement model is constructed, and training the data enhancement model based on the historical data set and generating an enhanced data set includes:
[0016] Build a data enhancement model based on generative adversarial networks;
[0017] Use historical data sets to train data augmentation models and generate simulation data sets;
[0018] The simulation dataset is merged with the historical dataset to obtain an enhanced dataset.
[0019] Furthermore, the expression of the data enhancement model training loss function is:
[0020]
[0021] In the formula, the generator The goal is to minimize ; Discriminator The goal is to maximize ; Indicates expected value; Indicates that it follows a specific distribution The noise, Indicates that it follows the distribution The real historical data, Represents the mean.
[0022] Furthermore, building a prediction model includes:
[0023] Construct a time series branch module, including a variable encoding layer, a time series association layer, and a variable decoding layer, to extract the correlation between data at different time points from the enhanced dataset;
[0024] A variable branching module is constructed, including a temporal encoding layer, a variable association layer, and a temporal decoding layer, to extract the correlation between different feature variables from the enhanced dataset.
[0025] Furthermore, the attention distribution of the prediction model is extracted based on the attention mechanism and the data augmentation dataset is optimized including:
[0026] Extract the attention weight matrix of the variable association layer and the temporal association layer of the prediction model;
[0027] Draw a heat map of the attention weight matrix to extract the key variables and timing features of the model when predicting photovoltaic power;
[0028] The data augmentation dataset is screened based on key variables and time series features to obtain an optimized data augmentation dataset.
[0029] Furthermore, based on the optimized enhanced data set, the prediction model is trained to output the photovoltaic power and meteorological data prediction sequence including:
[0030] Input the optimized enhanced data set, and use the time series branch module and the variable branch module to extract the time series prediction sequence and the variable prediction sequence;
[0031] The time series prediction sequence and the variable prediction sequence are correlated and fused through the correlation fusion layer to obtain the final prediction sequence.
[0032] Further, extracting the time series prediction sequence and the variable prediction sequence by using the time series branch module and the variable branch module includes:
[0033] The encoding layer is used to encode the features of each moment of the temporal branch module and the variable branch module;
[0034] The self-attention of the data in the time dimension and variable dimension of the enhanced data set is optimized by using the association layer calculation to obtain the correlation characteristics of the time dimension and variable dimension;
[0035] The decoding layer is used to restore the correlation characteristics of the time dimension and the variable dimension to obtain the time series prediction sequence and the variable prediction sequence.
[0036] Furthermore, the expression of the prediction model loss function is:
[0037]
[0038] In the formula, represents a time series prediction sequence; represents the variable prediction sequence; represents the final prediction sequence; Represents a future real sequence; represents a first preset weight; represents a second preset weight; It means mean square error.
[0039] The technical solution of the second aspect of the present invention proposes a photovoltaic power prediction system based on multiple characteristic variables and time series correlation, including the photovoltaic power prediction method based on multiple characteristic variables and time series correlation described in the technical solution of the first aspect of the present invention, and the photovoltaic power prediction system includes:
[0040] Data monitoring module, used to collect photovoltaic power data and meteorological data at different times and send them to the photovoltaic power station data center;
[0041] Photovoltaic power plant data center, which is used to integrate photovoltaic power data and meteorological data into historical data sets;
[0042] A data enhancement module, configured to train a data enhancement model based on a historical data set and generate an enhanced data set;
[0043] A visualization tuning module, which is configured to extract the attention distribution of the prediction model based on the attention mechanism and optimize the data augmentation dataset;
[0044] A prediction model training module, configured to train a prediction model using the enhanced data set and the optimized enhanced data set;
[0045] The prediction module is configured to output a photovoltaic power and meteorological data prediction sequence using a prediction model.
[0046] The present invention has the following beneficial effects:
[0047] The photovoltaic power prediction method and system based on multi-feature variables and time series correlation provided by the present invention take into account the correlation between meteorological variables and photovoltaic power, and solve the problems of insufficient data volume or uneven data distribution in actual scenarios by constructing a data enhancement model and introducing an attention mechanism. The attention mechanism can automatically identify which features in the enhanced data set are more important for the prediction task and assign higher weights, which helps the prediction model to focus on the truly important information; finally, through the prediction model, the model training is carried out using optimized enhancements to avoid using meteorological prediction data as additional input, which helps to reduce the error accumulation effect caused by inaccurate external data. While predicting photovoltaic power, related variables such as meteorology are also predicted. This joint prediction method can improve the overall prediction quality and provide more comprehensive information for the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A schematic flow chart of a photovoltaic power prediction method based on multiple characteristic variables and time series correlation provided by an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of the structure of a prediction model provided by an embodiment of the present invention;
[0051] Figure 3 for Figure 2 The enlarged schematic diagram of the middle A part;
[0052] Figure 4 for Figure 2 The enlarged schematic diagram of the middle part B;
[0053] Figure 5 for Figure 2 The enlarged schematic diagram of the middle C part;
[0054] Figure 6 for Figure 2 The enlarged schematic diagram of the middle D part;
[0055] Figure 7 A schematic diagram of the structure of a photovoltaic power prediction system based on multiple characteristic variables and time series correlation provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the photovoltaic power prediction method and system based on multi-feature variables and time series correlation proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0057] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0058] The specific scheme of a photovoltaic power prediction method and system based on multiple characteristic variables and time series correlation provided by the present invention is described in detail below in conjunction with the accompanying drawings.
[0059] See also Figure 1 , which shows a schematic flow chart of a photovoltaic power prediction method based on multiple characteristic variables and time series correlation provided by an embodiment of the present invention, the method comprising:
[0060] Step S100: Acquire photovoltaic power data and meteorological data, and obtain a historical data set after preprocessing;
[0061] Step S100 specifically includes:
[0062] Step S110: Collecting photovoltaic power data and meteorological data according to preset time intervals, where the meteorological data includes at least temperature, humidity, traffic volume and irradiation; specifically, collecting photovoltaic power data and meteorological data at different times according to preset time intervals, for example, when receiving a data collection signal sent every minute, obtaining meteorological data such as temperature, humidity, cloudiness, irradiation and photovoltaic real-time power at this time, and sending the collected data to the photovoltaic power station data center;
[0063] Step S120: Aggregate and group the photovoltaic power data and meteorological data according to the preset time resolution to obtain a historical data set; specifically, since the original data is collected at a time resolution of minutes, the photovoltaic power station data center will aggregate the data according to the required time resolution (such as hourly); for the data within each hour, calculate the arithmetic mean of all minute data to obtain hourly meteorological data and photovoltaic power output; then the continuous The data of the day are grouped by date, each group includes Meteorological data and photovoltaic power data at time points; The data of the day is used as feature input, The data of the past 24 hours is used as the standard for prediction, and all processed data groups are merged into a historical data set for training data enhancement models and prediction models;
[0064] Step S200: constructing a data enhancement model, training the data enhancement model based on the historical data set and generating an enhanced data set;
[0065] Step S200 specifically includes:
[0066] Step S210: Construct a data enhancement model based on the generative adversarial network; for the use of the data enhancement method, it is necessary to construct a data enhancement model, and then process the historical data set in step S100 to obtain a large amount of generated data that is similar to the historical data in terms of variables and time series features to support the training of the prediction model; the data enhancement model includes a generator and the discriminator , where both the generator and the discriminator are composed of fully connected layers. In the process of training the generative adversarial network, the generator needs to generate generated data similar to the real data as much as possible, while the discriminator needs to distinguish the difference between the generated data and the real data as much as possible. This process can be regarded as a binary minimax game. The expression of the training loss function of the data enhancement model is:
[0067]
[0068] In the formula, the generator The goal is to minimize ; Discriminator The goal is to maximize ; Indicates expected value; Indicates that it follows a specific distribution The noise, Indicates that it follows the distribution The real historical data, represents the mean;
[0069] Step S220: using the historical data set to train the data enhancement model and generate a simulation data set; that is, by inputting random noise into the generator to generate a large amount of simulation data, the simulation data is similar to the real historical data in terms of variables and time series characteristics;
[0070] Step S230: The simulation data set is merged with the historical data set to obtain an enhanced data set, which contains more samples to support the training of the prediction model, increasing the diversity and quantity of the prediction model training data, so that it can make more accurate predictions under different conditions; in particular, the simulation data can help the prediction model learn the complex nonlinear relationships in the data, which is especially important for photovoltaic power prediction because photovoltaic power is affected by many factors; more training data can also reduce the risk of overfitting, making the model more stable on unknown data.
[0071] The following is a specific implementation of a data enhancement model:
[0072] This implementation scheme is based on a generative adversarial network (GAN) for data enhancement. Specifically, the model uses 6 days of photovoltaic, temperature, humidity, cloud cover, irradiance and encoded time series data as input, where the first 5 days of the 6 days of data are model inputs and the last day is the benchmark value of the model output value. Each set of data contains 144 time points, forming a 6×144 matrix.
[0073] The architecture of the generator of the data enhancement model is: a 6-layer fully connected layer (FC) structure, with the number of neurons in each layer being ; Among them, the first 5 layers are hidden layers, and the activation function Pick , its leakage slope is taken as 0.2; the last layer is the output layer, the activation function Take ; The input of the generator is of dimension Gaussian noise; except for the first and last layers, each layer uses batch normalization to ensure the stability of the model training process; the discriminator is also a 6-layer fully connected layer, and the number of neurons in each layer is ; Among them, the first 5 layers are hidden layers, and the activation function Pick , its leakage slope is taken as 0.2; the last layer is the output layer, the activation function Take During the training process, the batch size is 32, the number of training rounds is 1500, RMSprop is used as the optimizer for training, and the learning rates of the discriminator and generator are respectively and The generator and discriminator architecture designed in this embodiment, combined with an effective training strategy, can effectively generate simulated data similar to real data, thereby improving the performance of the photovoltaic prediction model.
[0074] Step S300: construct a prediction model and train the prediction model using an enhanced data set;
[0075] Step S300 specifically includes:
[0076] Step S310: construct a time series branch module, including a variable encoding layer, a time series association layer and a variable decoding layer, which is used to extract the correlation of data between different time points from the enhanced data set; the time series branch module is used to capture the time dependence of photovoltaic power data, which is because the power output is affected by multiple factors such as seasonality and diurnal cycle.
[0077] Step S320: construct a variable branching module, including a time series encoding layer, a variable association layer, and a time series decoding layer, for extracting the correlation between different feature variables from the enhanced data set; the variable branching module is used to capture the interaction between different feature variables, for example, the influence of factors such as temperature, humidity, and cloudiness on photovoltaic power is not isolated, but interrelated;
[0078] This prediction model, by simultaneously considering the correlation between time series and features, can capture the complex patterns of photovoltaic power changes, including periodic changes, trend changes, and interactions between different features, and can better handle unseen data, thereby enabling the model to more accurately predict photovoltaic power, especially when dealing with complex and nonlinear data sets. The two branch modules process the correlation between time series and feature variables respectively, and finally combine the advantages of both to build an efficient prediction model. This design can significantly improve the accuracy of predictions and help the model better understand and respond to complex environmental changes.
[0079] Preferably, the variable encoding layer of the prediction model is a 3-layer fully connected layer, and the number of neurons in each layer is , the activation function is taken as The variable encoding layer is used to map the six input feature variables (PV power, temperature, humidity, cloud cover, irradiation, and encoded time) into a higher-dimensional model dimension 512-dimensional space to capture the complex relationship between the features; the variable decoding layer of the prediction model uses a 3-layer fully connected layer, and the number of neurons in each layer is , the activation function is taken as , the variable decoding layer maps the 512-dimensional model space back to the original 6-dimensional feature space; the temporal encoding layer of the prediction model is a 3-layer fully connected layer, and the number of neurons in each layer is , the activation function is taken as , which is used to map the input 120 time steps of time series data to a higher dimensional 512-dimensional space to capture the dynamic changes and long-term dependencies in the time series; the time series decoding layer of the prediction model is a 3-layer fully connected layer, and the number of neurons in each layer is , the activation function is taken as , which is used to map the 512-dimensional model space back to the output time series data of 24 time steps; the time series association layer and variable association layer of the prediction model are both taken as 8-head attention layers, and each attention head , , The dimensions of , the output matrix The dimension is ; The time series association layer is used to capture the long-term dependencies in the time series data. Through the multi-head attention mechanism, the model can focus on the correlation between different time points in the time series data; The variable association layer is used to capture the correlation between different feature variables. Through the multi-head attention mechanism, the model can focus on the interaction between different features; During the training process, the batch size is set to The number of training rounds is 20, using the adaptive estimation optimizer (Adam) and the adaptive learning rate technique, setting the initial learning rate to , after each round of training, the learning rate is multiplied by 0.9 to ensure that the model training can converge;
[0080] The variable encoding layer of the preferred prediction model can map the input multi-feature variables to a higher-dimensional representation space, so as to better capture the complex nonlinear relationship between features. The time series encoding layer can capture the dynamic changes in time series data. Through the multi-head attention mechanism in the time series association layer, the model can pay attention to the correlation between different time points. By simultaneously considering the interaction between features and the dynamic changes in the time series, the model can more accurately predict photovoltaic power.
[0081] Step S400: extracting the attention distribution of the prediction model based on the attention mechanism and optimizing the data augmentation dataset;
[0082] Step S400 specifically includes:
[0083] Step S410: extract the attention weight matrix of the variable association layer and the time series association layer of the prediction model; specifically, in the variable association layer, we extract the first attention weight matrix of each attention head, which is a two-dimensional matrix, whose rows represent the input feature variables, and whose columns represent the feature representation inside the model. The first attention weight matrix reflects the importance between different feature variables, that is, the weights assigned to each feature when the model processes the input; in the time series association layer, similarly extract the second attention weight matrix of each attention head, which is also a two-dimensional matrix, whose rows represent the time steps of the input, and whose columns represent the time step representation inside the model. The second attention weight matrix reflects the importance between different time steps, that is, the weights assigned to each time point when the model processes the time series;
[0084] Step S420: draw a heat map of the attention weight matrix to extract key variables and time series features when the model predicts photovoltaic power; the first and second attention weight matrices can be drawn into a heat map, and the color intensity in the heat map reflects the importance of the corresponding element (feature or time step), and the darker the color, the greater the influence of the feature or time step on the model prediction;
[0085] Step S430: Filter the data enhancement dataset based on key variables and time series features to obtain an optimized data enhancement dataset; by observing the heat map, we can determine which feature variables and time steps are most important for the model to predict photovoltaic power. For example, if a feature frequently appears with high weight values in the heat map, the feature is considered a key variable; if a certain time period frequently appears with high weight values in the heat map, this time period is considered a key time series feature; based on the identified key variables and time series features, we can filter out data samples containing these key information from the enhanced dataset; for example, if it is found that temperature and humidity are key variables affecting photovoltaic power, then data samples containing significant temperature and humidity changes can be retained first. Similarly, if it is found that data within certain specific time periods are particularly important for model prediction, then data samples within these time periods will also be retained first; finally, the filtered key data samples are merged with new samples generated by data enhancement technology to obtain an optimized data enhancement dataset;
[0086] For example, the dimension of the attention weight matrix is , each row represents an input feature, and each column represents an output feature. The 1st to 6th dimensions represent photovoltaic power, temperature, humidity, cloud cover, irradiation, and time, respectively. To obtain the variables that the model focuses on when predicting photovoltaic power, we can observe the variables corresponding to the columns with higher values in the first row of the attention weight matrix. The variables corresponding to these columns are the variables that the model focuses on when predicting photovoltaic power, and these variables are retained in the historical data set.
[0087] Step S400 extracts and utilizes the attention distribution of the model, focusing on key variables and time series features, which can improve the sensitivity of the model to important information, thereby improving the prediction accuracy; the heat map of the attention weight matrix provides a visual representation of the model decision process, which helps to understand how the model makes predictions and enhances the transparency of the model; by optimizing the data set, irrelevant information can be reduced, and the model can be prevented from over-relying on noise or unimportant features during training, thereby reducing the risk of overfitting, which can not only improve the prediction performance of the model, but also enhance the interpretability and training efficiency of the model, which is conducive to improving the accuracy of photovoltaic power prediction;
[0088] Step S500: training a prediction model based on the optimized enhanced data set, and outputting a prediction sequence of photovoltaic power and meteorological data; wherein the loss function of the prediction model is expressed as:
[0089]
[0090] In the formula, represents a time series prediction sequence; represents the variable prediction sequence; represents the final prediction sequence; Represents a future real sequence; represents a first preset weight; represents a second preset weight; Indicates the mean square error; during the training process, the model parameters are updated through back propagation to minimize the loss function and obtain the trained prediction model.
[0091] Step S500 specifically includes:
[0092] Step S510: Input the optimized enhanced data set, and use the time series branch module and the variable branch module to extract the time series prediction sequence and the variable prediction sequence; specifically, use the encoding layer to perform feature encoding on each moment of the time series branch module and the variable branch module; use the association layer to calculate the self-attention of the data in the optimized enhanced data set in the time dimension and the variable dimension, and obtain the correlation characteristics of the time dimension and the variable dimension; use the decoding layer to restore the correlation characteristics of the time dimension and the variable dimension, and obtain the time series prediction sequence and the variable prediction sequence; please refer to Figures 2 to 6 As shown, for the time series branch module, the variable features of each moment are first encoded through the variable encoding layer to expand the variable dimension to a higher dimension. Then, the self-attention of the data in the time dimension is calculated through the time series association layer to obtain the correlation features of the data in the time dimension. Finally, the variable dimension is restored to the initial dimension through the variable decoding layer to obtain the time series prediction sequence. For the variable branch module, the time series features of each variable are first encoded through the time series encoding layer to expand the time dimension to a higher dimension. Then, the self-attention of the data in the variable dimension is calculated through the variable association layer to obtain the correlation features of the data in the variable dimension. Finally, the time dimension is restored to the dimension required for prediction through the time series decoding layer to obtain the variable prediction sequence; finally, the time series prediction sequence and the variable prediction sequence are combined through the correlation fusion layer to obtain the target prediction sequence, including photovoltaic power and related variables;
[0093] The variable encoding layer, variable decoding layer, temporal encoding layer, and temporal decoding layer are all composed of fully connected layers. The specific calculation is shown in the following formula:
[0094]
[0095]
[0096] In the formula, Represents input variables. For input variables , through the fully connected layer Layer After the operation, the output variable is obtained ; Indicates The result obtained after the operation; and They represent the fully connected layer Layer learnable weight matrices and bias vectors; Represents the selected nonlinear activation function; Represents the number of fully connected layers; the fully connected layer converts the input data into Mapping to output , each fully connected layer will pass To calculate the new feature representation, and through the activation function Introducing nonlinear transformations, this structure allows the model to learn complex nonlinear relationships, thereby improving prediction accuracy;
[0097] Among them, the time series association layer and the variable association layer adopt a multi-head self-attention layer , to capture the correlation of data in the time dimension, its expression is:
[0098]
[0099]
[0100]
[0101] In the formula, Represents the input of the multi-head self-attention layer; Represents the attention layer Internal variables used in calculations; are model parameters; is the normalized exponential function; Indicates Attention head; Respectively represent The attention heads are calculated separately , , The learnable weight matrix used when ; Represents the concatenation of vectors; Represents a learnable output matrix that maps the dimensions of the output sequence from the model internal dimensions to the dimensions required for the output; Represents the number of attention heads; the multi-head self-attention mechanism captures different aspects of the input data through multiple parallel attention heads, and each attention head can focus on different parts of the input;
[0102] Step S520: The time series prediction sequence and the variable prediction sequence are correlated and fused through the correlation fusion layer to obtain the final prediction sequence; its expression is:
[0103]
[0104]
[0105] In the formula, through The operation splices the time series forecast sequence and the variable forecast sequence together to form a complete forecast sequence; It represents the sequence obtained by concatenating the time series prediction sequence and the variable prediction sequence; and They are time series prediction sequence and variable prediction sequence respectively; Represents the prediction sequence of the final model output;
[0106] Through the above steps, a complete photovoltaic prediction model is constructed with the time series association layer and variable association layer based on the attention mechanism as the core. The photovoltaic prediction model captures the complex relationship between time series and multi-feature variables through the multi-head self-attention mechanism, which helps to improve the accuracy of the model in predicting photovoltaic power; the self-attention mechanism can clearly point out which variables have the greatest impact on the prediction results at different time points, enhancing the interpretability of the model; the variable encoding and time series encoding layers can expand the feature dimensions, allowing the model to learn richer feature representations; the multi-head self-attention mechanism can effectively process long sequence data and avoid the gradient vanishing problem that may occur in traditional recurrent neural networks (RNNs). The photovoltaic power prediction method based on multi-feature variables and time series correlation can effectively improve the prediction accuracy and model interpretability by combining the self-attention mechanism and the fully connected layer, while simplifying the model structure, improving training efficiency, and reducing the risk of overfitting.
[0107] It can be seen that the photovoltaic power prediction method based on multi-feature variables and time series correlation has the following beneficial effects:
[0108] (1) Improving prediction accuracy and generalization ability. By analyzing the relationship between photovoltaic power series and related variable series such as meteorology, as well as the temporal relationship of the series themselves, the present invention improves the prediction model's ability to understand the complex interactions between these variables. This method not only considers the data at a single time point, but also considers the changing trend of the time series, thereby improving the model's adaptability to different scenarios and enhancing its generalization ability.
[0109] (2) Excellent expressiveness and interpretability. The neural network and attention mechanism automatically learn the correlation and temporal dependency between variables, reducing the need to manually set features. The attention mechanism enables the model to automatically identify which variables or which time points are more important and give them more weight, making the model more intelligent and easier to understand.
[0110] (3) The data problem is solved. The number and diversity of training samples are increased through data augmentation technology, which effectively alleviates the problems of insufficient and uneven data distribution in practical applications and reduces the cost of collecting new data. Diversified training data helps the model maintain good performance when facing unknown data.
[0111] (4) Reduced error accumulation. Avoiding using forecast data (such as weather forecasts) as additional input helps reduce the error accumulation effect caused by inaccurate external data. While forecasting photovoltaic power, related variables such as meteorology are also forecasted. This joint forecasting method can improve the overall forecast quality and provide more comprehensive information for the model.
[0112] (5) Improved transparency of the prediction model. By drawing a heat map of the attention weight matrix, researchers can intuitively understand how the model allocates attention, which is very useful for model debugging and performance optimization. The heat map can help reveal which factors contribute most to the prediction results, thereby better understanding and explaining the behavior of the model.
[0113] In summary, the photovoltaic power prediction method based on multi-feature variables and time series correlation proposed in the present invention not only improves the prediction accuracy, but also enhances the interpretability and generalization ability of the model through the design of its internal mechanism. At the same time, it solves the data limitation problem in practical applications through data enhancement technology. It is a comprehensive and efficient prediction solution.
[0114] See also Figure 7 , which shows a schematic diagram of the structure of a photovoltaic power prediction system based on multiple characteristic variables and time series correlation provided by an embodiment of the present invention, wherein the photovoltaic power prediction system comprises:
[0115] Data monitoring module, used to collect photovoltaic power data and meteorological data at different times and send them to the photovoltaic power station data center;
[0116] Photovoltaic power plant data center, which is used to integrate photovoltaic power data and meteorological data into historical data sets;
[0117] A data enhancement module, configured to train a data enhancement model based on a historical data set and generate an enhanced data set;
[0118] A visualization tuning module, which is configured to extract the attention distribution of the prediction model based on the attention mechanism and optimize the data augmentation dataset;
[0119] A prediction model training module, configured to train a prediction model using the enhanced data set and the optimized enhanced data set;
[0120] The prediction module is configured to output a photovoltaic power and meteorological data prediction sequence using a prediction model.
[0121] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0122] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. Photovoltaic power prediction method based on multi-feature variables and time series correlation, It is characterized in that The method comprises: Acquire photovoltaic power data and meteorological data, and obtain historical data sets after preprocessing; Build a data enhancement model, train the data enhancement model based on the historical data set and generate an enhanced data set, including: Build a data enhancement model based on generative adversarial networks; Use historical data sets to train data augmentation models and generate simulation data sets; The simulation dataset is merged with the historical dataset to obtain an enhanced dataset; Build a predictive model and train the predictive model using an enhanced dataset, including: Construct a time series branch module, including a variable encoding layer, a time series association layer, and a variable decoding layer, to extract the correlation between data at different time points from the enhanced dataset; Construct a variable branching module, including a temporal encoding layer, a variable association layer, and a temporal decoding layer, to extract the correlation between different feature variables from the enhanced dataset; Extract the attention distribution of the prediction model based on the attention mechanism and optimize the data augmentation dataset, including: extracting the attention weight matrix of the variable association layer and the time series association layer of the prediction model; Draw a heat map of the attention weight matrix to extract the key variables and timing features of the model when predicting photovoltaic power; The data augmentation dataset is screened based on key variables and time series features to obtain an optimized data augmentation dataset; The prediction model is trained based on the optimized enhanced data set, and the photovoltaic power and meteorological data prediction series are output.
2. The photovoltaic power prediction method based on multiple characteristic variables and time series correlation as claimed in claim 1, It is characterized in that Photovoltaic power data and meteorological data are obtained, and after preprocessing, the historical data sets include: Collect photovoltaic power data and meteorological data according to preset time intervals, where the meteorological data includes at least temperature, humidity, traffic volume and irradiation; The photovoltaic power data and meteorological data are aggregated and grouped according to the preset time resolution to obtain a historical data set.
3. The photovoltaic power prediction method based on multiple characteristic variables and time series correlation as claimed in claim 1, It is characterized in that The expression of the data enhancement model training loss function is: In the formula, the generator The goal is to minimize ; Discriminator The goal is to maximize ; Indicates expected value; Indicates that it follows a specific distribution The noise, Indicates that it follows the distribution The real historical data, Represents the mean.
4. The photovoltaic power prediction method based on multiple characteristic variables and time series correlation according to any one of claims 1 to 3, It is characterized in that Based on the optimized enhanced data set, the prediction model is trained to output the photovoltaic power and meteorological data prediction sequence including: Input the optimized enhanced data set, and use the time series branch module and the variable branch module to extract the time series prediction sequence and the variable prediction sequence; The time series prediction sequence and the variable prediction sequence are correlated and fused through the correlation fusion layer to obtain the final prediction sequence.
5. The photovoltaic power prediction method based on multiple characteristic variables and time series correlation as claimed in claim 4, It is characterized in that Extracting the time series prediction sequence and the variable prediction sequence using the time series branch module and the variable branch module includes: The encoding layer is used to encode the features of each moment of the temporal branch module and the variable branch module; The self-attention of the data in the time dimension and variable dimension of the enhanced data set is optimized by using the association layer calculation to obtain the correlation characteristics of the time dimension and variable dimension; The decoding layer is used to restore the correlation characteristics of the time dimension and the variable dimension to obtain the time series prediction sequence and the variable prediction sequence.
6. The photovoltaic power prediction method based on multiple characteristic variables and time series correlation as claimed in claim 5, It is characterized in that The expression of the prediction model loss function is: In the formula, represents a time series prediction sequence; represents the variable prediction sequence; represents the final prediction sequence; Represents a future real sequence; represents a first preset weight; represents a second preset weight; It means mean square error.
7. Photovoltaic power prediction system based on multi-feature variables and time series correlation, It is characterized in that The photovoltaic power prediction method based on multiple characteristic variables and time series correlation according to any one of claims 1 to 6, wherein the photovoltaic power prediction system comprises: Data monitoring module, used to collect photovoltaic power data and meteorological data at different times and send them to the photovoltaic power station data center; Photovoltaic power plant data center, which is used to integrate photovoltaic power data and meteorological data into historical data sets; A data enhancement module, configured to train a data enhancement model based on a historical data set and generate an enhanced data set; A visualization tuning module, which is configured to extract the attention distribution of the prediction model based on the attention mechanism and optimize the data augmentation dataset; A prediction model training module, configured to train a prediction model using the enhanced data set and the optimized enhanced data set; The prediction module is configured to output a photovoltaic power and meteorological data prediction sequence using a prediction model.
