A distributed photovoltaic power prediction method and system

By combining the self-attention mechanism, time convolution network and long-term memory network in photovoltaic power prediction, a hybrid prediction model and error correction model are solved, and the problem of insufficient prediction accuracy in the existing technology is achieved, and higher prediction accuracy and adaptability are achieved.

CN119787298APending Publication Date: 2025-04-08INFORMATION & COMMNUNICATION BRANCH STATE GRID JIANGXI ELECTRIC POWER CO
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411630193.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

Existing photovoltaic power prediction methods are difficult to fully explore the complex time series characteristics and their nonlinear relationships in photovoltaic power data, resulting in limited prediction accuracy.

Method used

A self-attention mechanism is used to combine time convolution networks to build a multi-head timing model, and a long and short-term memory network and gradient improvement decision tree is combined to build a hybrid prediction model and error correction model, and improve prediction accuracy through chimerization and correction.

Benefits of technology

It significantly improves the accuracy and robustness of photovoltaic power prediction, can more effectively capture time series characteristics and correct nonlinear errors, and adapt to complex photovoltaic system power changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119787298A_ABST
    Figure CN119787298A_ABST
Patent Text Reader

Abstract

The present invention provides a distributed photovoltaic power prediction method and system, which relates to the photovoltaic power prediction technology field. The specific scheme is as follows: obtaining and preprocessing known distributed photovoltaic system data to obtain photovoltaic data; building a multi-head time series model, building an initial model and training according to photovoltaic data to obtain a prediction model and training error data, and fitting the multi-head time series model with the prediction model to obtain a hybrid prediction model; building a correction model and using the training error data to obtain an error correction model; obtaining data to be predicted, assigning weights to the data to be predicted based on the hybrid prediction model, extracting features to obtain time series features, and predicting to obtain preliminary prediction results and their prediction error sequences; fitting the prediction error sequence based on the error correction model and correcting the preliminary prediction results to obtain photovoltaic power prediction values. The present invention improves the shortcomings of the prior art in the accuracy of photovoltaic power prediction, and improves the prediction accuracy and adaptability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of photovoltaic power prediction, and in particular to a distributed photovoltaic power prediction method and system. Background Art

[0002] With the widespread deployment of distributed photovoltaic power generation systems, accurate photovoltaic power forecasting has become essential. This forecast is not only crucial for grid dispatching, but also affects trading decisions in the power market. Currently, photovoltaic power forecasting mainly relies on statistical methods and traditional machine learning models. However, these methods usually cannot fully exploit the complex time series characteristics and nonlinear relationships in photovoltaic power data, resulting in limited prediction accuracy.

[0003] Traditional statistical methods, such as linear regression and time series analysis, have certain predictive capabilities, but they are insufficient when dealing with photovoltaic data with strong nonlinearity and dynamic changes. Machine learning models such as support vector machines and decision trees have improved in some cases, but their generalization ability is still limited when dealing with long time series data.

[0004] Therefore, it is urgent to develop a solution to solve the above problems. Summary of the invention

[0005] The purpose of the present invention is to provide a distributed photovoltaic power prediction method and system, aiming to give full play to the advantages of self-attention mechanism, temporal convolutional neural network, long short-term memory neural network and ensemble learning, improve the shortcomings of existing methods in photovoltaic power prediction accuracy, and improve the prediction accuracy and adaptability of the model.

[0006] The present invention provides a distributed photovoltaic power prediction method and system using the following technical solutions:

[0007] In a first aspect, a distributed photovoltaic power prediction method specifically includes:

[0008] Acquire and preprocess historical power data, meteorological data and environmental data of known distributed photovoltaic systems to obtain photovoltaic data;

[0009] A multi-head time series model is built based on the self-attention mechanism combined with a temporal convolutional network. An initial model is built based on a long short-term memory network and trained according to photovoltaic data to obtain a prediction model and training error data. The multi-head time series model is embedded in the prediction model to obtain a hybrid prediction model.

[0010] Building a correction model based on a gradient boosting decision tree, and training the correction model based on the training error data to obtain an error correction model;

[0011] Obtain the data to be predicted of the distributed photovoltaic system, assign weights to the data to be predicted based on the hybrid prediction model, perform feature extraction to obtain time series features with time series correlation, and perform prediction based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences;

[0012] The prediction error sequence is fitted based on the error correction model, and the preliminary prediction result is corrected based on the fitting function to obtain the photovoltaic power prediction value and output a photovoltaic power prediction report.

[0013] Optionally, historical power data, meteorological data and environmental data of the distributed photovoltaic system are acquired and preprocessed to obtain photovoltaic data, including:

[0014] Obtain the historical power data, meteorological data and environmental data of the distributed photovoltaic system, fill the missing data with the data at the same time and location of the previous day, and linearly normalize the filled data to obtain photovoltaic data;

[0015] The photovoltaic data were randomly divided into training set, validation set and test set in a ratio of 8:1:1;

[0016] The meteorological data include the temperature and radiation intensity of the distributed photovoltaic system; the environmental data include the humidity and wind speed of the environment in which the distributed photovoltaic system is located.

[0017] Optionally, an initial model is built based on a long short-term memory network and trained according to photovoltaic data to obtain a prediction model and training error data, including:

[0018] Build an initial model based on the long short-term memory network and initialize the model parameters;

[0019] The initial model is trained based on the training set obtained by randomly dividing the photovoltaic data, and the error between the predicted value and the actual value is calculated to obtain the training error data;

[0020] Construct a cross entropy loss function based on the training error data, and minimize the cross entropy loss function based on the gradient descent method, iteratively update the initial model parameters until the loss function value tends to a stable value or the maximum number of iterations is reached to end the training;

[0021] The initial model is evaluated and fine-tuned based on the validation set and the test set to obtain a prediction model.

[0022] Optionally, training a correction model based on the training error data to obtain an error correction model includes:

[0023] Construct a decision tree as an initial learner, calculate the residual between the predicted value and the true value of the training error data by the initial learner, create a new decision tree to fit the residual and then merge it into the correction model;

[0024] Construct a cross entropy loss function and regularize its coefficients, and minimize the loss function based on the gradient descent method; iteratively update the parameters of the correction model until the loss function tends to a stable value or reaches the maximum number of updates, end the training, and evaluate and fine-tune the correction model according to the evaluation indicators to obtain the error correction model.

[0025] Optionally, evaluation indicators used when evaluating and fine-tuning the prediction model and the correction model include root mean square error and determination coefficient.

[0026] Optionally, the prediction error sequence is fitted based on an error correction model, a preliminary prediction result is corrected based on a fitting function, a photovoltaic power prediction value is obtained, and a photovoltaic power prediction report is output, including:

[0027] Inputting the predicted error sequence into the error correction model for fitting to obtain a fitting function, and calculating the predicted value of the error based on the fitting function;

[0028] The difference between the initial predicted power value and the actual power mean is calculated to obtain the prediction error;

[0029] The preliminary predicted power value is corrected based on the difference between the predicted value of the error and the predicted error, the photovoltaic power prediction value is obtained, and a photovoltaic power prediction report is output;

[0030] Among them, the correction calculation formula of the photovoltaic power prediction value is as follows:

[0031] e=P'-P;

[0032] e'(t)=f[e(tT),e(t-2T),...,e(t-nT)];

[0033]

[0034] Where P' is the initial predicted power value, P is the true power mean, e is the prediction error, e' is the predicted value of the error, and e(t-nT) is the historical prediction error of n times before time t. is the final predicted power value, and f is the fitting function.

[0035] The beneficial effects of a distributed photovoltaic power prediction method provided by the present invention are:

[0036] 1. The present invention adopts the temporal convolutional network (TCN) to extract the spatiotemporal features in the original data, and uses the self-attention mechanism to enhance the performance of TCN. The self-attention mechanism assigns different weights to different features, so that the model can pay more attention to those features that contribute more to the prediction results.

[0037] 2. Based on the Long Short-Term Memory (LSTM) network, the present invention significantly improves the accuracy and robustness of photovoltaic power prediction by combining the error correction of SATCN (Self-attention Temporal Convolutional Network) and LightGBM (Light Gradient Boosting Machine). Compared with the prior art, this method has stronger time series feature capture capability and nonlinear error correction capability, and can more effectively adapt to complex power changes in distributed photovoltaic systems.

[0038] In a second aspect, a distributed photovoltaic power prediction system specifically includes:

[0039] A data processing module is used to acquire and pre-process historical power data, meteorological data and environmental data of known distributed photovoltaic systems to obtain photovoltaic data;

[0040] The prediction model building module builds a multi-head time series model based on the self-attention mechanism combined with the time convolution network, builds an initial model based on the long short-term memory network and trains it according to the photovoltaic data to obtain the prediction model and training error data, and integrates the multi-head time series model with the prediction model to obtain a hybrid prediction model;

[0041] An error model construction module is used to construct a correction model based on a gradient boosting decision tree, and to train the correction model based on the training error data to obtain an error correction model;

[0042] A preliminary prediction module is used to obtain the data to be predicted of the distributed photovoltaic system, assign weights to the data to be predicted based on the hybrid prediction model, perform feature extraction to obtain time series features with time series correlation, and perform prediction based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences;

[0043] The error correction module fits the prediction error sequence based on the error correction model, corrects the preliminary prediction result based on the fitting function, obtains the photovoltaic power prediction value and outputs the photovoltaic power prediction report.

[0044] Optionally, the hybrid prediction model consists of a multi-head time series model and a prediction model. The multi-head time series model is used to assign weights to the data to be predicted and then perform feature extraction to obtain time series features with time series correlation. The prediction model is used to perform predictions based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences.

[0045] Optionally, the multi-head time series model is built based on a self-attention mechanism combined with a temporal convolutional network, and the multi-head time series model includes: a causal convolutional layer, a residual block and a self-attention layer;

[0046] The causal convolution layer is used to extract features from the data to be predicted to obtain time series features. It can capture local patterns of the time series. It expands the receptive field of the convolution kernel by introducing a dilation factor, thereby capturing dependencies over a longer time range. It can obtain dependencies over a longer time range and ensure that the output of each time step depends only on the current and past inputs, not on future inputs.

[0047] Residual blocks are structures that add the input directly to the output of the causal convolutional layer, aiming to alleviate the gradient vanishing and gradient exploding problems in deep networks;

[0048] The self-attention layer is added after each random discard of the residual block to weight each position of the temporal feature extracted from the feature of the data to be predicted, calculate the attention weight of each position, generate the corresponding weighted representation, and assign different weights according to the importance of the feature.

[0049] Optionally, the prediction model includes a forget gate, an input gate, and an output gate;

[0050] The forget gate is used to control the degree of forgetting of memory units in the prediction model. Its output is a value between 0 and 1, indicating how much old memory to keep or discard;

[0051] The input gate is used to determine how the input information of the current time step is updated to the memory unit. Its functions include: activating the input gate and generating new candidate values ​​for updating the memory;

[0052] The output gate is used to output the current hidden state value from the memory cell.

[0053] The beneficial effects of the second aspect can refer to the description of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 A flowchart of the overall steps of a distributed photovoltaic power prediction method provided by the present invention;

[0055] Figure 2 A logical schematic diagram of a self-attention layer of a distributed photovoltaic power prediction method provided by the present invention;

[0056] Figure 3 A schematic diagram of the prediction model structure of a distributed photovoltaic power prediction method provided by the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Unless otherwise defined, the technical terms or scientific terms used herein should be understood by people with general skills in the field to which the present invention belongs. "Including" and similar words used in this article mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0058] An embodiment of the present invention provides a distributed photovoltaic power prediction method, comprising the following steps:

[0059] S1. Acquire and preprocess the historical power data, meteorological data and environmental data of the known distributed photovoltaic system to obtain photovoltaic data;

[0060] S2. Build a multi-head time series model based on the self-attention mechanism combined with the time convolution network, build an initial model based on the long short-term memory network and train it according to the photovoltaic data to obtain the prediction model and training error data, and integrate the multi-head time series model with the prediction model to obtain a hybrid prediction model;

[0061] S3, constructing a correction model based on a gradient boosting decision tree, and training the correction model based on the training error data to obtain an error correction model;

[0062] S4, obtaining the data to be predicted of the distributed photovoltaic system, assigning weights to the data to be predicted based on the hybrid prediction model, performing feature extraction to obtain time series features with time series correlation, and performing prediction based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences;

[0063] S5. Fit the prediction error sequence based on the error correction model, correct the preliminary prediction result based on the fitting function, obtain the photovoltaic power prediction value and output the photovoltaic power prediction report.

[0064] In some embodiments, when executing step S1, acquiring and preprocessing historical power data, meteorological data and environmental data of the distributed photovoltaic system to obtain photovoltaic data includes:

[0065] Obtain the historical power data, meteorological data and environmental data of the distributed photovoltaic system, fill the missing data with the data at the same time and location of the previous day, and linearly normalize the filled data to obtain photovoltaic data;

[0066] The photovoltaic data were randomly divided into training set, validation set and test set in a ratio of 8:1:1.

[0067] Furthermore, the meteorological data includes the temperature and radiation intensity of the distributed photovoltaic system; and the environmental data includes the humidity and wind speed of the environment in which the distributed photovoltaic system is located.

[0068] Further preprocessing, including filling missing data, dividing data and normalization, is performed to ensure data quality and consistency. Normalization uses linear normalization as follows:

[0069]

[0070] Where x is the actual value, xmin is the minimum value, and xmax is the maximum value.

[0071] In some embodiments, when executing step S2, it specifically includes:

[0072] S2-1. Build a multi-head time series model based on the self-attention mechanism combined with the temporal convolutional network;

[0073] S2-2, build an initial model based on the long short-term memory network and train it according to photovoltaic data to obtain the prediction model and training error data;

[0074] S2-3. Integrate the multi-head time series model with the prediction model to obtain a hybrid prediction model.

[0075] Specifically, when executing step S2-1, a multi-head time series model is built based on the self-attention mechanism combined with the time convolution network, and the multi-head time series model includes: a causal convolution layer, a residual block and a self-attention layer;

[0076] The causal convolution layer is used to extract features from the data to be predicted to obtain time series features. It can capture local patterns of the time series. It expands the receptive field of the convolution kernel by introducing a dilation factor, thereby capturing dependencies over a longer time range. It can obtain dependencies over a longer time range and ensure that the output of each time step depends only on the current and past inputs, not on future inputs.

[0077] Residual blocks are structures that add the input directly to the output of the causal convolutional layer, aiming to alleviate the gradient vanishing and gradient exploding problems in deep networks;

[0078] The self-attention layer is added after each random discard of the residual block to weight each position of the temporal feature extracted from the feature of the data to be predicted, calculate the attention weight of each position, generate the corresponding weighted representation, and assign different weights according to the importance of the feature.

[0079] Furthermore, the causal convolution is defined as:

[0080]

[0081] Where F(t) is the output of the sequence at time t, * is the convolution operation, k is the convolution kernel size, d is the dilation factor, xt-d·i is the element of the input sequence, and i is the sequence number.

[0082] In fact, the residual block allows the network to directly pass input information through a skip path during training, thereby reducing the burden of information transmission on each layer of the network. In a standard convolutional layer, the input x undergoes a convolution operation and a nonlinear activation function to obtain the output F(x). By adding a residual connection, the actual output becomes:

[0083] Output = x + F (x);

[0084] In the formula, x is the input, and F(x) is the result of the convolution operation and activation function.

[0085] In fact, see Figure 2 , the self-attention layer consists of three vectors: query vector Q (query), key vector K (key) and value vector V (value). These three vectors are obtained by multiplying the input data X by three weight matrices (i.e., Wq, Wk, Wv). The self-attention mechanism calculates the relevance of different positions through Q and K, and then normalizes the result with the Softmax function to obtain the weight matrix. Finally, the weight matrix is ​​multiplied by V to obtain the final result. The calculation formula is as follows:

[0086] [Q,K,V] = X[Wq,Wk,Wv];

[0087]

[0088] Where Wq, Wk, and Wv are the weight matrices obtained through training, and dk is the dimension of the key vector. The dot product result can be normalized, which helps stabilize the training process and improve the performance of the model.

[0089] Specifically, when executing step S2-2, an initial model is built based on a long short-term memory network and trained according to photovoltaic data to obtain a prediction model and training error data, including:

[0090] Build an initial model based on the long short-term memory network and initialize the model parameters;

[0091] The initial model is trained based on the training set obtained by randomly dividing the photovoltaic data, and the error between the predicted value and the actual value is calculated to obtain the training error data;

[0092] Construct a cross entropy loss function based on the training error data, and minimize the cross entropy loss function based on the gradient descent method, iteratively update the initial model parameters until the loss function value tends to a stable value or the maximum number of iterations is reached to end the training;

[0093] The initial model is evaluated and fine-tuned based on the validation set and the test set to obtain a prediction model.

[0094] In fact, see Figure 3 , the prediction model includes: a forget gate, an input gate and an output gate;

[0095] The forget gate is used to control the degree of forgetting of memory units in the prediction model. Its output is a value between 0 and 1, indicating how much old memory to keep or discard;

[0096] The input gate is used to determine how the input information of the current time step is updated to the memory unit. Its functions include: activating the input gate and generating new candidate values ​​for updating the memory;

[0097] The output gate is used to output the current hidden state value from the memory cell.

[0098] Furthermore, the calculation formula of the forget gate is as follows:

[0099] ft=σ(Wf·[ht-1,xt]+bf);

[0100] Where σ is the sigmoid activation function, Wf is the weight, bf is the bias, ht-1 is the hidden state of the previous time step, and xt is the input of the current time step.

[0101] Furthermore, the calculation formula of the input gate is as follows:

[0102] it=σ(Wi·[ht-1,xt]+bi);

[0103]

[0104] In the formula, is the new candidate memory, tanh is the hyperbolic tangent activation function, Wi, W C ,bi,b C All are weights and biases, and other parameters are the same as above.

[0105] Combine the forget gate and the input gate to update the memory unit state. The update formula is as follows:

[0106]

[0107] Where Ct-1 is the state of the memory cell at the previous time step, and Ct is the state of the memory cell at the current time step.

[0108] Furthermore, the output gate determines how much information is output from the memory cell to the current hidden state, and its calculation formula is:

[0109] ot=σ(Wo·[ht-1,xt]+bo);

[0110] Compute the hidden state at the current time step:

[0111] ht=ot·tanh(Ct);

[0112] Where Wo and bo are weights and biases, ht is the hidden state output value of the current time step, Ct is the memory unit state of the current time step, and other parameters are the same as above.

[0113] Specifically, when executing step S2-3, the multi-head time series model is integrated with the prediction model to obtain a hybrid prediction model, which is composed of a multi-head time series model and a prediction model. The multi-head time series model is used to assign weights to the data to be predicted, and then perform feature extraction to obtain time series features with time series correlation. The prediction model is used to make predictions based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences.

[0114] In some embodiments, when executing step S3, a correction model is constructed based on a gradient boosting decision tree, and the correction model is trained based on the training error data to obtain an error correction model, including:

[0115] Construct a decision tree as an initial learner, calculate the residual between the predicted value and the true value of the training error data by the initial learner, create a new decision tree to fit the residual and then merge it into the correction model;

[0116] Construct a cross entropy loss function and regularize its coefficients, and minimize the loss function based on the gradient descent method; iteratively update the parameters of the correction model until the loss function tends to a stable value or reaches the maximum number of updates, end the training, and evaluate and fine-tune the correction model according to the evaluation indicators to obtain the error correction model.

[0117] Specifically, the error correction model adopts the gradient boosting method, which iteratively constructs a series of weak learners (i.e., decision trees) and combines them to form a strong learner. In each iterative step, the algorithm updates the gradient according to the prediction error of the existing weak learners on the data, thereby constructing a new weak learner until the stopping criterion is met.

[0118] Furthermore, the parameters of the error correction model include: learning rate, number of leaf nodes, evaluation function, objective function, boosting type, weights of positive and negative samples, bag sampling ratio, bag frequency and minimum data size of leaf nodes.

[0119] Specifically, the evaluation indicators used when evaluating and fine-tuning the prediction model and the correction model include root mean square error and determination coefficient.

[0120] Furthermore, the calculation formulas for the root mean square error and the coefficient of determination are as follows:

[0121]

[0122]

[0123] Where N is the number of samples, Pi is the true power value, To predict the power value, is the average power value.

[0124] In some embodiments, when executing step S4, it includes:

[0125] S4-1. Obtain the data to be predicted of the distributed photovoltaic system;

[0126] S4-2, after assigning weights to the data to be predicted based on the hybrid prediction model, feature extraction is performed to obtain time series features with time series correlation;

[0127] S4-3. Predict according to the time series characteristics to obtain a preliminary prediction result and its corresponding prediction error sequence.

[0128] Specifically, when executing step S4-1, the data types to be predicted include historical power data, meteorological data and environmental data;

[0129] Specifically, when executing step S4-2, the multi-head time series model part of the hybrid prediction model is used.

[0130] Specifically, when executing step S4-3, the prediction model part of the hybrid prediction model is used.

[0131] In some embodiments, when executing step S5, the prediction error sequence is fitted based on the error correction model, the preliminary prediction result is corrected based on the fitting function, the photovoltaic power prediction value is obtained and the photovoltaic power prediction report is output, including:

[0132] Inputting the predicted error sequence into the error correction model for fitting to obtain a fitting function, and calculating the predicted value of the error based on the fitting function;

[0133] The difference between the initial predicted power value and the actual power mean is calculated to obtain the prediction error;

[0134] The preliminary predicted power value is corrected based on the difference between the predicted value of the error and the predicted error, the photovoltaic power prediction value is obtained and a photovoltaic power prediction report is output.

[0135] Specifically, the correction calculation formula for the photovoltaic power prediction value is as follows:

[0136] e=P'-P;

[0137] e'(t)=f[e(tT),e(t-2T),...,e(t-nT)];

[0138]

[0139] Where P' is the initial predicted power value, P is the true power mean, e is the prediction error, e' is the predicted value of the error, and e(t-nT) is the historical prediction error of n times before time t. is the final predicted power value, and f is the fitting function.

[0140] The embodiment of the present invention further provides a distributed photovoltaic power prediction system, which specifically includes:

[0141] A data processing module is used to acquire and pre-process historical power data, meteorological data and environmental data of known distributed photovoltaic systems to obtain photovoltaic data;

[0142] The prediction model building module builds a multi-head time series model based on the self-attention mechanism combined with the time convolution network, builds an initial model based on the long short-term memory network and trains it according to the photovoltaic data to obtain the prediction model and training error data, and integrates the multi-head time series model with the prediction model to obtain a hybrid prediction model;

[0143] An error model construction module is used to construct a correction model based on a gradient boosting decision tree, and to train the correction model based on the training error data to obtain an error correction model;

[0144] A preliminary prediction module is used to obtain the data to be predicted of the distributed photovoltaic system, assign weights to the data to be predicted based on the hybrid prediction model, perform feature extraction to obtain time series features with time series correlation, and perform prediction based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences;

[0145] The error correction module fits the prediction error sequence based on the error correction model, corrects the preliminary prediction result based on the fitting function, obtains the photovoltaic power prediction value and outputs the photovoltaic power prediction report.

[0146] Specifically, the hybrid prediction model consists of a multi-head time series model and a prediction model. The multi-head time series model is used to assign weights to the data to be predicted, and then perform feature extraction to obtain time series features with time series correlation. The prediction model is used to perform predictions based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences.

[0147] Furthermore, the multi-head time series model is built based on the self-attention mechanism combined with the time convolution network, and the multi-head time series model includes: a causal convolution layer, a residual block and a self-attention layer;

[0148] The causal convolution layer is used to extract features from the data to be predicted to obtain time series features. It can capture local patterns of the time series. It expands the receptive field of the convolution kernel by introducing a dilation factor, thereby capturing dependencies over a longer time range. It can obtain dependencies over a longer time range and ensure that the output of each time step depends only on the current and past inputs, not on future inputs.

[0149] Residual blocks are structures that add the input directly to the output of the causal convolutional layer, aiming to alleviate the gradient vanishing and gradient exploding problems in deep networks;

[0150] The self-attention layer is added after each random discard of the residual block to weight each position of the temporal feature extracted from the feature of the data to be predicted, calculate the attention weight of each position, generate the corresponding weighted representation, and assign different weights according to the importance of the feature.

[0151] In fact, the prediction model includes a forget gate, an input gate, and an output gate;

[0152] The forget gate is used to control the degree of forgetting of memory units in the prediction model. Its output is a value between 0 and 1, indicating how much old memory to keep or discard;

[0153] The input gate is used to determine how the input information of the current time step is updated to the memory unit. Its functions include: activating the input gate and generating new candidate values ​​for updating the memory;

[0154] The output gate is used to output the current hidden state value from the memory cell.

[0155] Although the embodiments of the present invention are described in detail above, it is obvious to those skilled in the art that various modifications and variations can be made to these embodiments. However, it should be understood that such modifications and variations are within the scope and spirit of the present invention as described in the claims. Moreover, the present invention described herein may have other embodiments and may be implemented or realized in a variety of ways.

Claims

1. A distributed photovoltaic power prediction method, characterized in that: include: Acquire and preprocess historical power data, meteorological data and environmental data of known distributed photovoltaic systems to obtain photovoltaic data; A multi-head time series model is built based on the self-attention mechanism combined with a temporal convolutional network. An initial model is built based on a long short-term memory network and trained according to photovoltaic data to obtain a prediction model and training error data. The multi-head time series model is embedded in the prediction model to obtain a hybrid prediction model. Building a correction model based on a gradient boosting decision tree, and training the correction model based on the training error data to obtain an error correction model; Obtain the data to be predicted of the distributed photovoltaic system, assign weights to the data to be predicted based on the hybrid prediction model, perform feature extraction to obtain time series features with time series correlation, and perform prediction based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences; The prediction error sequence is fitted based on the error correction model, and the preliminary prediction result is corrected based on the fitting function to obtain the photovoltaic power prediction value and output a photovoltaic power prediction report.

2. A distributed photovoltaic power prediction method according to claim 1, characterized in that: Acquire and preprocess the historical power data, meteorological data and environmental data of the distributed photovoltaic system to obtain photovoltaic data, including: Obtain the historical power data, meteorological data and environmental data of the distributed photovoltaic system, fill the missing data with the data at the same time and location of the previous day, and linearly normalize the filled data to obtain photovoltaic data; The photovoltaic data were randomly divided into training set, validation set and test set in a ratio of 8:1:1; The meteorological data include the temperature and radiation intensity of the distributed photovoltaic system; the environmental data include the humidity and wind speed of the environment in which the distributed photovoltaic system is located.

3. A distributed photovoltaic power prediction method according to claim 2, characterized in that: An initial model is built based on the long short-term memory network and trained according to photovoltaic data to obtain a prediction model and training error data, including: Build an initial model based on the long short-term memory network and initialize the model parameters; The initial model is trained based on the training set obtained by randomly dividing the photovoltaic data, and the error between the predicted value and the actual value is calculated to obtain the training error data; Construct a cross entropy loss function based on the training error data, and minimize the cross entropy loss function based on the gradient descent method, iteratively update the initial model parameters until the loss function value tends to a stable value or the maximum number of iterations is reached to end the training; The initial model is evaluated and fine-tuned based on the validation set and the test set to obtain a prediction model.

4. A distributed photovoltaic power prediction method according to claim 3, characterized in that: Training the correction model based on the training error data to obtain an error correction model includes: Construct a decision tree as an initial learner, calculate the residual between the predicted value and the true value of the training error data by the initial learner, create a new decision tree to fit the residual and then merge it into the correction model; Construct a cross entropy loss function and regularize its coefficients, and minimize the loss function based on the gradient descent method; iteratively update the parameters of the correction model until the loss function tends to a stable value or reaches the maximum number of updates, end the training, and evaluate and fine-tune the correction model according to the evaluation indicators to obtain the error correction model.

5. A distributed photovoltaic power prediction method according to claim 4, characterized in that: The evaluation indicators used when evaluating and fine-tuning the prediction model and the correction model include root mean square error and determination coefficient.

6. A distributed photovoltaic power prediction method according to claim 1, characterized in that: The prediction error sequence is fitted based on the error correction model, and the preliminary prediction result is corrected based on the fitting function to obtain the photovoltaic power prediction value and output the photovoltaic power prediction report, including: Inputting the predicted error sequence into the error correction model for fitting to obtain a fitting function, and calculating the predicted value of the error based on the fitting function; The difference between the initial predicted power value and the actual power mean is calculated to obtain the prediction error; The preliminary predicted power value is corrected based on the difference between the predicted value of the error and the predicted error, the photovoltaic power prediction value is obtained, and a photovoltaic power prediction report is output; Among them, the correction calculation formula of the photovoltaic power prediction value is as follows: e=P'-P; e'(t)=f[e(tT),e(t-2T),...,e(t-nT)]; Where P' is the initial predicted power value, P is the true power mean, e is the prediction error, e' is the predicted value of the error, and e(t-nT) is the historical prediction error of n times before time t. is the final predicted power value, and f is the fitting function.

7. A distributed photovoltaic power prediction system, characterized in that: include: A data processing module is used to acquire and pre-process historical power data, meteorological data and environmental data of known distributed photovoltaic systems to obtain photovoltaic data; The prediction model building module builds a multi-head time series model based on the self-attention mechanism combined with the time convolution network, builds an initial model based on the long short-term memory network and trains it according to the photovoltaic data to obtain the prediction model and training error data, and integrates the multi-head time series model with the prediction model to obtain a hybrid prediction model; An error model construction module is used to construct a correction model based on a gradient boosting decision tree, and to train the correction model based on the training error data to obtain an error correction model; A preliminary prediction module is used to obtain the data to be predicted of the distributed photovoltaic system, assign weights to the data to be predicted based on the hybrid prediction model, perform feature extraction to obtain time series features with time series correlation, and perform prediction based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences; The error correction module fits the prediction error sequence based on the error correction model, corrects the preliminary prediction result based on the fitting function, obtains the photovoltaic power prediction value and outputs the photovoltaic power prediction report.

8. A distributed photovoltaic power prediction system according to claim 7, characterized in that: The hybrid prediction model consists of a multi-head time series model and a prediction model. The multi-head time series model is used to assign weights to the data to be predicted, and then perform feature extraction to obtain time series features with time series correlation. The prediction model is used to perform predictions based on the time series features to obtain preliminary prediction results and their corresponding prediction error sequences.

9. A distributed photovoltaic power prediction system according to claim 8, characterized in that: The multi-head time series model is built based on the self-attention mechanism combined with the time convolution network. The multi-head time series model includes: a causal convolution layer, a residual block and a self-attention layer; The causal convolution layer is used to extract features from the data to be predicted to obtain time series features. It can capture local patterns of the time series. It expands the receptive field of the convolution kernel by introducing a dilation factor, thereby capturing dependencies over a longer time range. It can obtain dependencies over a longer time range and ensure that the output of each time step depends only on the current and past inputs, not on future inputs. Residual blocks are structures that add the input directly to the output of the causal convolutional layer, aiming to alleviate the gradient vanishing and gradient exploding problems in deep networks; The self-attention layer is added after each random discard of the residual block to weight each position of the temporal feature extracted from the data feature to be predicted, calculate the attention weight of each position, generate the corresponding weighted representation, and assign different weights according to the importance of the feature.

10. A distributed photovoltaic power prediction system according to claim 8, characterized in that: The prediction model includes a forget gate, an input gate and an output gate; The forget gate is used to control the degree of forgetting of memory units in the prediction model. Its output is a value between 0 and 1, indicating how much old memory to keep or discard; The input gate is used to determine how the input information of the current time step is updated to the memory unit. Its functions include: activating the input gate and generating new candidate values ​​for updating the memory; The output gate is used to output the current hidden state value from the memory cell.

Citation Information

Cited By

  • Photovoltaic energy storage control method based on intelligent learning

    CN120127716A

  • Data acquisition method and system for electrical cabinet

    CN120408220A

  • Wide-area photovoltaic power prediction method and system based on space-time residual feature fusion

    CN122026337A