A photovoltaic power prediction method combining global convolution and attention mechanism
By combining the photovoltaic power prediction method of global convolution and attention mechanism, the problem of inaccurate photovoltaic power forecasting in existing technologies has been solved, and higher prediction accuracy and stability are achieved.
Patent Information
- Application Number
- CN202411573725.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-11-06
AI Technical Summary
Existing PV power prediction methods are difficult to accurately capture the long-term dependencies and multivariate correlations of time series, resulting in low prediction accuracy.
Combined with the photovoltaic power prediction method of global convolution and attention mechanisms, the parallel training framework combined by structured global convolution (SGC) and iTransFormer has been used to extract local and global characteristics, and use the attention layer to enhance multiple variables.
It improves the accuracy of photovoltaic power generation power prediction, can better capture long -term dependent relationships and variable correlations, and enhance the stability and generalization of models.
Smart Images

Figure CN119089396B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine learning, and in particular relates to a photovoltaic power prediction method combining global convolution and attention mechanism. Background Art
[0002] The development of a low-carbon economy has become the focus of today's society. Among them, solar energy has become one of the most popular renewable energy sources with its economic, convenient, environmentally friendly and sustainable characteristics. In recent years, with the gradual maturity and continuous innovation of the technology level of China's photovoltaic power generation industry, the cost of photovoltaic power generation has been significantly reduced, promoting the healthy and sustainable development of the photovoltaic industry. However, photovoltaic power generation is affected by meteorological factors such as radiation intensity, temperature, and humidity, making photovoltaic power generation sporadic, volatile, and random. These characteristics have a serious negative impact on the medium- and long-term prediction of photovoltaic power.
[0003] Photovoltaic power generation prediction is a typical multivariate long time series prediction task. At present, photovoltaic power generation prediction methods can be roughly divided into three categories: physical methods, statistical methods and artificial intelligence-based methods. Among them, artificial intelligence methods can be divided into traditional machine learning and deep learning methods. Physical methods rely heavily on accurate weather forecasts and a large amount of geographic location data, which limits their versatility. Statistical methods represented by autoregressive moving average models and multivariate regression models hinder the accurate prediction of photovoltaic power due to their limited nonlinear expression capabilities. Traditional machine learning represented by random forests, decision trees, gradient boosting regressors, etc., relies heavily on data quality and feature engineering. Deep learning algorithms based on the recurrent neural network family and Transformer have complex nonlinear fitting capabilities and can reveal complex structures in high-dimensional data, thereby obtaining more reliable results.
[0004] However, the recurrent neural network family is prone to ignoring important information and being unable to perform parallel calculations in long-sequence predictions, resulting in low training efficiency and prediction accuracy. To address these issues, a series of prediction methods based on Transformer have been proposed, and a large number of studies have shown that their performance is better than that of the recurrent neural network family. But this does not mean that the Transformer-based methods are flawless. There are two main reasons that prevent the Transformer family from further improving the accuracy of time series predictions: First, Transformer-based methods still find it difficult to capture the long-term relationship of time series and are prone to serious overfitting. Second, the existing Transformer method is not suitable for multivariate time series prediction. The features of the same time step represent completely different physical meanings, but are embedded in a token, erasing the correlation between multiple variables. These factors make it impossible for existing methods to accurately predict photovoltaic power generation. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a photovoltaic power prediction method combining global convolution and attention mechanism, which solves the problem of inaccurate photovoltaic power prediction in the prior art.
[0006] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a photovoltaic power prediction method combining global convolution and attention mechanism, comprising the following steps:
[0007] Step S1, obtaining a photovoltaic power generation data set, and dividing the photovoltaic power generation data set into a training set, a validation set, and a test set in a ratio of 7:1:2;
[0008] Among them, the photovoltaic power generation data set includes meteorological factors and historical power generation data;
[0009] Step S2, using the training set as input to train the neural network to obtain a photovoltaic power prediction model;
[0010] The photovoltaic power prediction model includes a local feature training module, a global feature training module, an attention layer, and a linear prediction layer;
[0011] Among them, the local feature training module is used to extract the local features of the training set; the global feature training module is used to extract the global features of the training set; the attention layer is used to determine the attention calculation results based on the local features and the global features; the linear prediction layer is used to determine the prediction data based on the attention calculation results and the local features;
[0012] Step S3: Use the validation set and the test set to respectively validate and test the photovoltaic power prediction model, input the photovoltaic power history data to be predicted into the photovoltaic power prediction model, and output the target predicted photovoltaic power data through the photovoltaic power prediction model.
[0013] The beneficial effects of the above scheme are:
[0014] The present invention introduces a parallel training framework combining SGC and iTransformer, and local features can be inverted during training, and the embedded vectors aggregate the global representation of the training data, which can be more variable-centric and better utilize the attention mechanism for multivariate association. The problem of the transformer family's lack of ability to depict multivariate correlations is solved. Relying on SGC makes up for the transformer family's lack of ability to capture long-term dependencies, while combining the multivariate correlation and short-term dependency learning capabilities of the iTransformer branch, thereby improving the accuracy of photovoltaic power generation prediction.
[0015] Further, in step S2, the local feature training module includes an embedding layer, a multivariate attention layer, a first layer normalization, a first feedforward network and a second layer normalization. In step S2, the method for extracting local features by the local feature training module is specifically:
[0016] Step S2-A1, convert the training set into an embedding vector through an embedding layer;
[0017] Step S2-A2, input the embedding vector into the multivariate attention layer, and increase the attention to the embedding vector through the multivariate attention layer;
[0018] Step S2-A3, inputting the embedded vector with added attention into the first layer normalization, reducing the difference between the embedded vectors with added attention through the first layer normalization, and obtaining the processed embedded vector;
[0019] Step S2-A4, inputting the processed embedding vector into the first feedforward network, processing the processed embedding vector through the first feedforward network to obtain an initial local embedding vector;
[0020] Step S2-A5: input the initial local embedding vector into the second layer normalization, and further reduce the difference between the initial local embedding vectors through the second layer normalization to obtain the extracted local features.
[0021] The beneficial effects of the above further scheme are: converting data into embedding vectors enables the model to process input data in numerical form, and the embedding vectors can capture the semantic relationship between input elements; the multivariate attention layer increases the focus on the embedding vectors, which enhances the model's understanding of the internal dependencies of the input sequence, especially in long sequences, which helps to better capture contextual information; normalization can prevent gradient explosion or vanishing problems, improve training stability, and accelerate convergence. The feedforward network can learn more complex nonlinear mappings, enhance the expressiveness of the model, and generate richer feature representations; the second layer of normalization further stabilizes the output of the model, ensuring that the input of each layer is within a reasonable range, which helps to improve the generalization ability and training stability of the model.
[0022] Further, in step S2, the global feature training module includes a second feedforward network, a structured convolution kernel and a third feedforward network. In step S2, the method for extracting global features by the global feature training module is specifically:
[0023] Step S2-B1, inputting the embedding vector into the second feedforward network, processing the embedding vector through the second feedforward network, and obtaining an initial global embedding vector;
[0024] Step S2-B2, inputting the initial global embedding vector into the structured convolution kernel, performing weighted combination on the initial global embedding vector through the structured convolution kernel, and obtaining a processed initial global embedding vector;
[0025] Step S2-B3: input the processed initial global embedding vector into the third feedforward network, process the processed initial global embedding vector through the third feedforward network and output it to obtain the extracted global feature.
[0026] The beneficial effects of the above further scheme are: the second feedforward network processes the embedding vector to capture more complex nonlinear relationships and generate more expressive global features, and the initial global embedding vector can better represent the overall information of the entire sequence or input; through the structured convolution kernel, certain specific structural information or patterns can be further extracted and emphasized, and the expressiveness of global features can be enhanced, which helps the model to better capture key global features when processing complex data; the third feedforward network can further refine and optimize the global embedding vector to make it more suitable for the needs of specific tasks.
[0027] Furthermore, in step S2, the method by which the attention layer determines the attention calculation result according to the local features and the global features is specifically:
[0028] Step S2-C1, receiving first conversion data, second conversion data and third conversion data;
[0029] Step S2-C2, calculating the similarity between the first conversion data and the second conversion data, determining the attention weight according to the similarity, and determining the attention calculation result based on the preset function and the third conversion data;
[0030] The first conversion data is obtained by converting the global features according to the first conversion formula;
[0031] The second conversion data is obtained by converting the local features according to the second conversion formula;
[0032] The third conversion data is obtained by converting the local features according to the third conversion formula.
[0033] Furthermore, in step S2, the method in which the linear prediction layer determines the prediction data according to the attention calculation result and the local feature is specifically:
[0034] Step S2-D1, receiving fusion data of the local feature and the fourth conversion data;
[0035] Step S2-D2, processing the fused data to obtain predicted data;
[0036] Among them, the fourth conversion data is obtained by linearly transforming the attention calculation result.
[0037] The beneficial effects of the above further scheme are: through multi-step processing and data fusion, features are gradually extracted and optimized, the model's ability to understand data is improved, the impact of a single data source is reduced, and the stability and generalization ability of the model are improved.
[0038] Furthermore, in step S2, the loss function of the photovoltaic power prediction model is:
[0039]
[0040] in, represents the number of predicted values, Indicates True value, Indicates predicted value.
[0041] Furthermore, in step S2-B2, the initial structured convolution kernel is weighted combined by the structured convolution kernel, and the scheme used is:
[0042]
[0043]
[0044] in, represents the parameterization method of the convolution kernel, represents the normalization constant, Indicates The parameters of the sub-kernels, Represents a parameter set for a single channel, , Indicates the length of the input data. represents the number of sub-kernels in the structured convolution kernel, represents the number of scales, , Indicates The set of parameters of the sub-kernels, , Indicates The coefficient of the sub-nucleus controlling the decay rate, Indicates The set of parameters of the sub-kernels is Upsampling on .
[0045] The beneficial effect of the above further scheme is that the multi-scale sub-kernel can capture features from different scales, so that the model can not only focus on global features, but also capture local subtle changes, improving the accuracy of complex pattern recognition. By weighted combination of features at different scales, the model can learn more invariance at different levels of abstraction and reduce the risk of overfitting.
[0046] Furthermore, in step S2-C2, the preset function is:
[0047]
[0048] in, represents the activation function, Represents a preset function, represents the query vector, represents the key vector, represents a value vector, represents the dimension of the key vector, Represents the transposed matrix of the key vectors.
[0049] The above further solution has the beneficial effect that by using preset functions, the structure of the model becomes more modular, which is convenient for subsequent debugging, maintenance and upgrading. Each function is an independent unit, and modification or replacement will not have a significant impact on the entire model.
[0050] Further, in step S2-C2, the first conversion formula is:
[0051]
[0052] in, represents the query vector, Represents the output data of the global feature training module, represents the linear transformation of the output data of the global feature training module into the query vector;
[0053] The second conversion formula is:
[0054]
[0055] in, represents the key vector, Represents the output data of the local feature training module, represents the linear transformation of the output data of the local feature training module into a key vector;
[0056] The third conversion formula is:
[0057]
[0058] in, represents a value vector, Represents the output data of the local feature training module, Represents a linear transformation that converts the output data of the local feature training module into a value vector.
[0059] The beneficial effect of the above further scheme is that the conversion formula can reduce the redundancy between features and increase the model's resistance to noise, thereby improving the stability of the overall model and its performance on unseen data. It can also help simplify data representation, reduce the computing resources required for subsequent processing, and accelerate the model training or inference process. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 Shown is a flowchart of a photovoltaic power prediction method that combines global convolution and attention mechanism.
[0061] Figure 2 Shown is a schematic diagram of the framework of the photovoltaic power prediction model.
[0062] Figure 3 Shown is a schematic diagram of the framework of the iTransformer branch. DETAILED DESCRIPTION
[0063] Now, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be understood that the embodiments shown and described in the accompanying drawings are only exemplary and are intended to explain the principles and spirit of the present invention, rather than to limit the scope of the present invention.
[0064] like Figure 1 As shown, a photovoltaic power prediction method combining global convolution and attention mechanism includes the following steps:
[0065] Step S1, obtaining a photovoltaic power generation data set, and dividing the photovoltaic power generation data set into a training set, a validation set, and a test set in a ratio of 7:1:2;
[0066] Among them, the photovoltaic power generation data set includes meteorological factors and historical power generation data;
[0067] Step S2, using the training set as input to train the neural network to obtain a photovoltaic power prediction model;
[0068] The photovoltaic power prediction model includes a local feature training module, a global feature training module, an attention layer, and a linear prediction layer;
[0069] Among them, the local feature training module is used to extract local features of the training set; the global feature training module is used to extract global features of the training set; the attention layer is used to determine the attention calculation results based on local features and global features; the linear prediction layer is used to determine the prediction data based on the attention calculation results and local features.
[0070] In this embodiment, in step S2, the local feature training module includes an embedding layer, a multivariate attention layer, a first layer normalization, a first feedforward network, and a second layer normalization. In step S2, the method for extracting local features by the local feature training module is specifically as follows:
[0071] Step S2-A1, convert the training set into an embedding vector through an embedding layer;
[0072] Step S2-A2, input the embedding vector into the multivariate attention layer, and increase the attention to the embedding vector through the multivariate attention layer;
[0073] Step S2-A3, inputting the embedded vector with added attention into the first layer normalization, reducing the difference between the embedded vectors with added attention through the first layer normalization, and obtaining the processed embedded vector;
[0074] Step S2-A4, inputting the processed embedding vector into the first feedforward network, processing the processed embedding vector through the first feedforward network to obtain an initial local embedding vector;
[0075] Step S2-A5: input the initial local embedding vector into the second layer normalization, and further reduce the difference between the initial local embedding vectors through the second layer normalization to obtain the extracted local features.
[0076] In this embodiment, in step S2, the global feature training module includes a second feedforward network, a structured convolution kernel and a third feedforward network. In step S2, the method for extracting global features by the global feature training module is specifically as follows:
[0077] Step S2-B1, inputting the embedding vector into the second feedforward network, processing the embedding vector through the second feedforward network, and obtaining an initial global embedding vector;
[0078] Step S2-B2, inputting the initial global embedding vector into the structured convolution kernel, performing weighted combination on the initial global embedding vector through the structured convolution kernel, and obtaining a processed initial global embedding vector;
[0079] Step S2-B3: input the processed initial global embedding vector into the third feedforward network, process the processed initial global embedding vector through the third feedforward network and output it to obtain the extracted global feature.
[0080] In this embodiment, in step S2, the method in which the attention layer determines the attention calculation result according to the local features and the global features is specifically:
[0081] Step S2-C1, receiving first conversion data, second conversion data and third conversion data;
[0082] Step S2-C2, calculating the similarity between the first conversion data and the second conversion data, determining the attention weight according to the similarity, and determining the attention calculation result based on the preset function and the third conversion data;
[0083] The first conversion data is obtained by converting the global features according to the first conversion formula;
[0084] The second conversion data is obtained by converting the local features according to the second conversion formula;
[0085] The third conversion data is obtained by converting the local features according to the third conversion formula.
[0086] In this embodiment, in step S2, the linear prediction layer determines the prediction data according to the attention calculation result and the local feature in the following manner:
[0087] Step S2-D1, receiving fusion data of the local feature and the fourth conversion data;
[0088] Step S2-D2, processing the fused data to obtain predicted data;
[0089] Among them, the fourth conversion data is obtained by linearly transforming the attention calculation result.
[0090] In this embodiment, in step S2, the loss function of the photovoltaic power prediction model is:
[0091]
[0092] in, represents the number of predicted values, Indicates True value, Indicates predicted value.
[0093] In this embodiment, in step S2, the output data of the second feedforward network is weighted combined based on the multi-scale sub-kernel, and the scheme used is:
[0094]
[0095]
[0096] in, represents the parameterization method of the convolution kernel, represents the normalization constant, Indicates The parameters of the sub-kernels, Represents a parameter set for a single channel, , Indicates the length of the input data. represents the number of sub-kernels in the structured convolution kernel, represents the number of scales, , Indicates The set of parameters of the sub-kernels, , Indicates The coefficient of the sub-nucleus controlling the decay rate, Indicates The set of parameters of the sub-kernels is Upsampling on .
[0097] In this embodiment, in step S2, the preset function is:
[0098]
[0099] in, represents the activation function, Represents a preset function, represents the query vector, represents the key vector, represents a value vector, represents the dimension of the key vector, Represents the transposed matrix of the key vectors.
[0100] In this embodiment, in step S2, the first conversion formula is:
[0101]
[0102] in, represents the query vector, Represents the output data of the global feature training module, Represents the linear transformation that converts the output data of the global feature training module into a query vector.
[0103] In this embodiment, in step S2, the second conversion formula is:
[0104]
[0105] in, represents the key vector, Represents the output data of the local feature training module, Represents the linear transformation of the output data of the local feature training module into a key vector.
[0106] In this embodiment, in step S2, the third conversion formula is:
[0107]
[0108] in, represents a value vector, Represents the output data of the local feature training module, Represents a linear transformation that converts the output data of the local feature training module into a value vector.
[0109] Exemplarily, Transformer is a deep learning model mainly used in the field of natural language processing (NLP). In this embodiment, the iTransformer branch is obtained by improving the Transformer model. The structured global convolution branch is a structured global convolution (SGC) model.
[0110] like Figure 2 As shown, Figure 2 Figure 1 is a schematic diagram of the framework of the photovoltaic power prediction model. Figure 2 In the example, the local feature training module is the iTransformer branch, and the global feature training module is the structured global convolution branch. After the training set passes through the embedding layer, it will be input into both the structured global convolution branch and the iTransformer branch for feature extraction. The core working principle of the structured global convolution branch can be:
[0111] The structured convolution kernel performs a weighted combination of the output data of the second feedforward network based on multi-scale sub-kernels. For example, the length of the input data can be , Represents a parameter set for a single channel, , represents the number of scales, , Indicates The set of parameters of the sub-kernels, , Indicates The coefficient of the sub-nucleus controlling the decay rate, at the same time, the normalization constant is introduced To ensure the constant input scale, the coefficient Based on this, it can be determined that the output data of the second feedforward network is weighted and combined based on the multi-scale sub-kernel.
[0112] Optionally, in the process of weighted combination of the output data of the second feedforward network by the structured convolution kernel based on the multi-scale sub-kernel, a fast Fourier transform is used in Convolution can be implemented in time, reducing the quadratic complexity to sublinear complexity.
[0113] A specific implementation example may be: given an input sequence , a global convolution kernel and an output sequence , the convolution operation can be expressed as:
[0114]
[0115] Among them, * represents the convolution operation, and its time complexity is .
[0116] However, based on the fast Fourier transform, its time complexity is , therefore, the convolution operation can be:
[0117]
[0118] in, stands for Fast Fourier Transform.
[0119] The output data of the structured global convolution branch can be converted according to the first conversion formula to obtain the first conversion data, the output data of the iTransformer branch can be converted according to the second conversion formula to obtain the second conversion data, and the output data of the iTransformer branch can be converted according to the third conversion formula to obtain the third conversion data. The attention layer can receive the first conversion data, the second conversion data, and the third conversion data, calculate the similarity between the first conversion data and the second conversion data, and determine the attention according to the similarity, and finally determine the attention calculation result based on the preset function and the third conversion data. Linear conversion of the attention calculation result can obtain fourth conversion data. The linear prediction layer can receive the fusion data of the output data of the iTransformer branch and the fourth conversion data, and process the fusion data to obtain prediction data.
[0120] like Figure 3 As shown, Figure 3 The following is a schematic diagram of the iTransformer branch framework. Figure 3 In the example, the working principle of the iTransformer branch can be:
[0121] Given by The time series of each variable indexed (i.e., training data) , is the time step of the time series, is a variable in the time series, is the future time step of the time series, then based on the time series Determine future sequence The process can be:
[0122]
[0123]
[0124]
[0125] in, , indicating that the included dimension is of embedding vectors, whose superscripts indicate the layer index, represents the embedding vector with index 0, Indicates that the time series is embedded in the layer Converted to embedding vector, represents the increased attention to the embedding vector through the multivariate attention layer, Represents the prediction function.
[0126] exist Figure 3 In the model, the embedding layer converts the original sequence (time embedding) into a higher-dimensional embedding representation to better capture the characteristics of the data. The multivariate attention layer processes the embedded data through the attention mechanism, focusing on the correlation between different variables. Layer normalization can normalize the data to ensure that the data is on the same scale and improve the stability of the model. The feedforward network can further process the normalized data to extract more advanced features. The linear prediction layer can output the final prediction result.
[0127] Among them, the formula for normalizing the data used by layer normalization can be:
[0128]
[0129] in, Represents the original data, represents the normalized data, represents the mean, Represents standard deviation.
[0130] In the multivariate attention layer, the attention mechanism can focus on the most important parts of the input data through the interaction of query, key and value. By calculating the similarity between query and key, the attention weight is obtained and used for weighted sum value.
[0131] For example, the structured global convolution branch is responsible for extracting long-term dependencies in the training set, while the iTransformer branch is used for multivariate correlations and local information between multiple variables in the training set. For example, the output of the structured global convolution branch can be , It represents the processing process of the structured global convolution branch on the data. The output of the iTransformer branch can be , Represents the data processing process of the iTransformer branch, where: Represents the data in the training set.
[0132] Step S3: Use the validation set and the test set to respectively validate and test the photovoltaic power prediction model, input the photovoltaic power history data to be predicted into the photovoltaic power prediction model, and output the target predicted photovoltaic power data through the photovoltaic power prediction model.
[0133] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A photovoltaic power prediction method combining global convolution and attention mechanism, characterized in that: The method comprises: Step S1, obtaining a photovoltaic power generation data set, and dividing the photovoltaic power generation data set into a training set, a validation set, and a test set in a ratio of 7:1:2; Wherein, the photovoltaic power generation data set includes meteorological factors and historical power generation data; Step S2, using the training set as input to train the neural network to obtain a photovoltaic power prediction model; The photovoltaic power prediction model includes a local feature training module, a global feature training module, an attention layer and a linear prediction layer; The local feature training module is used to extract the local features of the training set; the global feature training module is used to extract the global features of the training set; the attention layer is used to determine the attention calculation result according to the local features and the global features; the linear prediction layer is used to determine the prediction data according to the attention calculation result and the local features; In step S2, the local feature training module includes an embedding layer, a multivariate attention layer, a first layer normalization, a first feedforward network and a second layer normalization, and the method for extracting the local features by the local feature training module is specifically: Step S2-A1, converting the training set into an embedding vector through the embedding layer; Step S2-A2, inputting the embedding vector into the multivariate attention layer, and increasing attention to the embedding vector through the multivariate attention layer; Step S2-A3: input the embedded vector with added attention into the first layer for normalization, and reduce the difference between the embedded vectors with added attention through the first layer normalization to obtain a processed embedded vector; Step S2-A4, inputting the processed embedding vector into the first feed-forward network, and processing the processed embedding vector through the first feed-forward network to obtain an initial local embedding vector; Step S2-A5, inputting the initial local embedding vector into the second layer normalization, further reducing the difference between the initial local embedding vectors through the second layer normalization, and obtaining the extracted local features; In step S2, the global feature training module includes a second feedforward network, a structured convolution kernel and a third feedforward network, and the method for extracting global features by the global feature training module is specifically: Step S2-B1, inputting the embedding vector into the second feed-forward network, and processing the embedding vector through the second feed-forward network to obtain an initial global embedding vector; Step S2-B2, inputting the initial global embedding vector into the structured convolution kernel, performing weighted combination on the initial global embedding vector through the structured convolution kernel, and obtaining a processed initial global embedding vector; Step S2-B3, inputting the processed initial global embedding vector into the third feed-forward network, processing and outputting the processed initial global embedding vector through the third feed-forward network, and obtaining extracted global features; In step S2, the method in which the linear prediction layer determines the prediction data according to the attention calculation result and the local feature is specifically: Step S2-D1, receiving fusion data of the local feature and the fourth conversion data; Step S2-D2, processing the fused data to obtain predicted data; Wherein, the fourth conversion data is obtained by linearly converting the attention calculation result; Step S3: Use the verification set and the test set to verify and test the photovoltaic power prediction model respectively, input the photovoltaic power history data to be predicted into the photovoltaic power prediction model, and output the target predicted photovoltaic power data through the photovoltaic power prediction model.
2. The method according to claim 1, characterized in that In step S2, the method in which the attention layer determines the attention calculation result according to the local features and the global features is specifically: Step S2-C1, receiving first conversion data, second conversion data and third conversion data; Step S2-C2, calculating the similarity between the first conversion data and the second conversion data, determining the attention weight according to the similarity, and determining the attention calculation result based on a preset function and the third conversion data; Wherein, the first conversion data is obtained by converting the global feature according to a first conversion formula; The second conversion data is obtained by converting the local feature according to a second conversion formula; The third conversion data is obtained by converting the local features according to a third conversion formula.
3. The method according to claim 1, characterized in that In step S2, the loss function of the photovoltaic power prediction model is: in, represents the number of predicted values, Indicates True value, Indicates predicted value.
4. The method according to claim 1, characterized in that: In step S2-B2, the initial global embedding vector is weighted combined by the structured convolution kernel, and the scheme used is: in, represents the parameterization method of the convolution kernel, represents the normalization constant, Indicates The parameters of the sub-kernels, Represents a parameter set for a single channel, , Indicates the length of the input data. represents the number of sub-kernels in the structured convolution kernel, represents the number of scales, , Indicates The set of parameters of the sub-kernels, , Indicates The coefficient of the sub-nucleus controlling the decay rate, Indicates The set of parameters of the sub-kernels is Upsampling on .
5. The method according to claim 2, characterized in that: In the step S2-C2, the preset function is: in, represents the activation function, Represents a preset function, represents the query vector, represents the key vector, represents a value vector, represents the dimension of the key vector, Represents the transposed matrix of the key vectors.
6. The method according to claim 2, characterized in that In the step S2-C2, the first conversion formula is: in, represents the query vector, Represents the output data of the global feature training module, represents the linear transformation of the output data of the global feature training module into the query vector; The second conversion formula is: in, represents the key vector, Represents the output data of the local feature training module, represents the linear transformation of the output data of the local feature training module into a key vector; The third conversion formula is: in, represents a value vector, Represents the output data of the local feature training module, Represents a linear transformation that converts the output data of the local feature training module into a value vector.
Citation Information
Patent Citations
Text aspect level emotion recognition method based on bidirectional LSTM (Long Short Term Memory) and multi-head attention mechanism
CN114648031A
Photovoltaic power generation power prediction method based on depth feature fusion under domain knowledge constraint
CN117556379A