Distributed energy generation power prediction method and system based on time-frequency characteristics
By using time-frequency feature extraction and self-attention mechanisms in distributed energy power prediction, the problem of poor prediction results in the prior art is solved, and higher prediction accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202411836147.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-12-13
AI Technical Summary
The existing distributed energy power generation power prediction methods are difficult to effectively capture the dependence between long-term and large-scale distributed energy historical power generation data, resulting in poor prediction results.
A distributed energy power generation power prediction method based on time-frequency characteristics is proposed. The dependent features and time-frequency characteristics of the sequence are extracted through the self-attention layer and the STFT layer of the encoder, and input them into the decoder for prediction. This method introduces sparse operations in the encoding and decoding stages to prevent data from being overfitted and reduce the computational amount.
By utilizing self-attention mechanism and STFT, the method can effectively capture the time-frequency characteristics of distributed energy historical data, improving the accuracy and efficiency of power generation power sequence prediction.
Smart Images

Figure CN119990389A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of electric power systems, and in particular relates to a distributed energy generation power prediction method and system based on time-frequency characteristics. Background Art
[0002] In recent years, distributed energy generation has become an important part of the power system. Distributed energy power stations such as photovoltaic power stations and wind power stations can not only effectively utilize natural resources and provide considerable power supply to the power grid, but also reduce carbon emissions and help the power grid transform to a green and low-carbon one.
[0003] The power generation information of distributed energy has important reference value for the planning, scheduling and maintenance of power grids. Predicting the power generation of each distributed energy node in advance can assist managers in making scheduling decisions for the power grid, so it is of great significance to predict the power generation of distributed energy. Existing power generation prediction methods mainly use one-dimensional convolutional neural networks, recurrent neural networks and other models for prediction. These models have difficulty in capturing the long-term and large-scale dependencies between historical power generation data of distributed energy, resulting in poor prediction results. Summary of the invention
[0004] The purpose of the present invention is to provide a distributed energy generation power prediction method and system based on time-frequency characteristics in order to solve the above problems existing in the prior art.
[0005] To achieve the above objectives, the technical solution of the present invention is as follows:
[0006] In a first aspect, the present invention proposes a distributed energy generation power prediction method based on time-frequency characteristics, comprising:
[0007] S1. Collect the historical power generation time series data of the distributed energy nodes that need to be predicted;
[0008] S2, input the historical power generation time series data into the encoder, the encoder's self-attention layer extracts the dependency features of the sequence, and the encoder's STFT layer extracts the time-frequency features of the sequence;
[0009] S3, adding the historical power generation time series data, the sequence dependency features extracted by the self-attention layer of the encoder, and the sequence time-frequency features extracted by the STFT layer of the encoder, and obtaining the output encoding result of the encoder through the feedforward layer;
[0010] S4. Based on the output encoding result of the encoder, use the decoder to predict the power generation sequence of the distributed energy node.
[0011] In S2, the self-attention layer of the encoder includes a one-dimensional convolutional layer and a sparse self-attention layer;
[0012] The encoder’s self-attention layer extracts dependent features of the sequence, including:
[0013] A1. Through the one-dimensional convolution layer, the time domain features of the sequence x[n] are extracted using the following formula:
[0014]
[0015] In the above formula, y conv [t] is the time domain feature of the sequence extracted by the one-dimensional convolution layer, K is the length of the convolution kernel, wk is the convolution kernel of length k, and t is time;
[0016] A2, the sparse self-attention layer maps the sequence time domain features extracted by the one-dimensional convolutional layer into the query matrix q through the linear layer t , key matrix k t And the value matrix v t , introduce sparse operation to transform the matrix q t Sparse, get the sparse query matrix The following formula is used to extract the dependency features of the sequence x[n]:
[0017]
[0018] In the above formula, Atten is the sequence dependency feature extracted by the self-attention layer, σ(·) is the activation function, and k T is the key matrix k t The transpose of dim t is the query matrix q t Dimensions;
[0019] The STFT layer of the encoder extracts the time-frequency features of the sequence, including:
[0020] B1. Randomly select several groups of STFT parameters, where the STFT parameters include the number of points of a discrete Fourier transform, a window function, and a moving step of the window function, and use the following formula to perform a short-time Fourier transform on the sequence x[n] to obtain the short-time Fourier transform results of several sequences x[n]:
[0021]
[0022] In the above formula, X[m, k] is the short-time Fourier transform result at time period index m and frequency component index k, m is the index of the window function time period, k is the index of the frequency component in the Fourier transform, w[n-mR] is the window function, R is the moving step of the window function, j is an imaginary number, and N is the number of points of a discrete Fourier transform in the STFT;
[0023] B2. Compare the short-time Fourier transform results of several sequences x[n], select the short-time Fourier transform results with frequency resolution higher than the threshold δ or time resolution higher than the threshold ε, and splice them into a matrix And the matrix Perform random sampling and reduce its dimension to a matrix The time-frequency features of the sequence x[n] are extracted using the following formula:
[0024]
[0025] In the above formula, Q is the time-frequency feature of the sequence extracted by the STFT layer, and STFT -1 is the inverse transform of STFT, Padding(·) is the zero-padding operation, and Conv(·) is the convolution operation.
[0026] The S3 includes:
[0027] S31, take the second half of the historical power generation time series data x[n], and fill it with zeros until the length is the same as the original x[n], and record this sequence as x de,in ;
[0028] S32, sequence x de,in The self-attention layer and STFT layer of the decoder are input respectively for sequence dependency feature extraction and time-frequency feature extraction to obtain the sequence x de,in The sequence dependence feature matrix Atten de And the time-frequency feature matrix Q de ;
[0029] S33, based on the sequence dependency features and time-frequency features extracted by the decoder's self-attention layer and STFT layer, combined with the historical power generation time series data x[n], the following formula is used for sequence decomposition:
[0030] x t [n]=AvgPool(Padding(x[n]+ReduceDim(Atten de +Q de ));
[0031] x s [n]=Padding(x[n])+ReduceDim(Atten de +Q de )-x t [n];
[0032] In the above formula, x t [n] is the trend term, AvgPool(·) is the average pooling operation, Padding(·) is the zero padding operation, ReduceDim(·) is the dimensionality reduction operation, and xs [n] is the seasonal term;
[0033] S34, the seasonal term after sequence decomposition and the output encoding result of the encoder x en Input to the time-frequency feature layer of the decoder, introduce sparse operation to perform time-frequency feature self-attention operation and sequence self-attention operation, and add the time-frequency self-attention output and sequence self-attention output obtained by the time-frequency feature self-attention operation and sequence self-attention operation to obtain the time-frequency feature layer output:
[0034] y t,f [n] = y s [n]+y f [n];
[0035] In the above formula, y t,f [n] is the output of the time-frequency feature layer, y f [n] is the time-frequency feature self-attention output, y s [n] is the sequence self-attention output;
[0036] S35, adding the seasonal term after the sequence decomposition of the time-frequency feature layer output and step S33, and performing sequence decomposition on the result after the addition using the following formula to obtain the seasonal component:
[0037]
[0038] In the above formula, is the trend component, For seasonal components;
[0039] S36, the seasonal component after sequence decomposition is passed through a feedforward neural network to obtain a feature sequence of aggregated dependency features and time-frequency features, and the feature sequence is added to the historical power generation time series data x[n] to obtain the output x of the decoder de , the output of the decoder is the predicted power generation sequence of the distributed energy nodes.
[0040] In S34, the time-frequency feature self-attention operation includes:
[0041] C1, through the linear layer, the seasonal term after sequence decomposition is mapped to the query matrix q, and the output encoding result of the encoder is x en Mapped into value matrix v, key matrix k;
[0042] C2. Input matrix q, matrix v, and matrix k into the STFT layer of the decoder for short-time Fourier transform, and introduce sparse operation to sparse matrix q, matrix v, and matrix k to obtain the time-frequency matrix And the time-frequency self-attention is calculated using the following formula:
[0043]
[0044] In the above formula, Atten f is the time-frequency self-attention, σ(·) is the activation function, For the matrix The transpose of dim f For the matrix Dimensions;
[0045] C3, use the following formula to perform zero padding operation and STFT inverse transformation on the time-frequency self-attention to obtain the time-frequency feature self-attention output y f [n]:
[0046] y f [n] = STFT -1 (Padding(Atten f ));
[0047] The sequence self-attention operation includes:
[0048] D1. The seasonal terms after sequence decomposition are passed through the one-dimensional convolutional layer of the decoder to obtain the time domain features of the seasonal terms, and then the time domain features of the seasonal terms are mapped into the query matrix q through the linear layer. t ′, the output encoding result x of the encoder en Mapped to value matrix v t ′, key matrix k t ′, introduce sparse operation to transform the matrix q t 'Sparse, get the sparse query matrix The following formula is used to calculate the sequence self-attention:
[0049]
[0050] In the above formula, Atten s is the sequence self-attention, (k t ′) T is the matrix k t ′, dim s is the matrix q t ' dimension;
[0051] D2. Use the following formula to input the sequence self-attention into the one-dimensional convolution layer and pooling layer to obtain the sequence self-attention output y s [n]:
[0052] y s [n] = Pooling(Conv1d(Atten s ));
[0053] In the above formula, Pooling(·) is a one-dimensional convolution operation, and Convld(·) is a pooling operation.
[0054] In the second aspect, the present invention proposes a distributed energy generation power prediction system based on time-frequency characteristics, including a historical generation power time series data collection module, an encoder feature extraction module, an encoding result output module, and a decoder power prediction module;
[0055] The historical power generation time series data collection module is used to collect the historical power generation time series data of the distributed energy nodes that need to be predicted;
[0056] The encoder feature extraction module is used to input the historical power generation time series data into the encoder, the encoder's self-attention layer extracts the dependency features of the sequence, and the encoder's STFT layer extracts the time-frequency features of the sequence. The encoder's self-attention layer includes a one-dimensional convolution layer and a sparse self-attention layer;
[0057] The encoding result output module is used to add the historical power generation time series data and the sequence dependency features extracted by the self-attention layer of the encoder and the sequence time-frequency features extracted by the STFT layer of the encoder, and obtain the output encoding result of the encoder through the feedforward layer;
[0058] The decoder power prediction module is used to use the decoder to predict the power generation sequence of the distributed energy node based on the output encoding result of the encoder.
[0059] The encoder feature extraction module includes a dependency feature extraction unit and a time-frequency feature extraction unit;
[0060] The dependency feature extraction unit is used for extracting dependency features of a sequence from the self-attention layer of the encoder, including:
[0061] A1. Through the one-dimensional convolution layer, the time domain features of the sequence x[n] are extracted using the following formula:
[0062]
[0063] In the above formula, y conv [t] is the time domain feature of the sequence extracted by the one-dimensional convolution layer, K is the length of the convolution kernel, and w k is the convolution kernel of length k, and t is the time;
[0064] A2, the sparse self-attention layer maps the sequence time domain features extracted by the one-dimensional convolutional layer into the query matrix q through the linear layer t , key matrix k t And the value matrix v t , introduce sparse operation to transform the matrix q t Sparse, get the sparse query matrix The following formula is used to extract the dependency features of the sequence x[n]:
[0065]
[0066] In the above formula, Atten is the sequence dependency feature extracted by the self-attention layer, σ(·) is the activation function, and k T is the key matrix k t The transpose of dim t is the query matrix q t Dimensions;
[0067] The time-frequency feature extraction unit is used for extracting the time-frequency features of the sequence at the STFT layer of the encoder, including:
[0068] B1. Randomly select several groups of STFT parameters, where the STFT parameters include the number of points of a discrete Fourier transform, a window function, and a moving step of the window function, and use the following formula to perform a short-time Fourier transform on the sequence x[n] to obtain the short-time Fourier transform results of several sequences x[n]:
[0069]
[0070] In the above formula, X[m, k] is the short-time Fourier transform result at time period index m and frequency component index k, m is the index of the window function time period, k is the index of the frequency component in the Fourier transform, w[n-mR] is the window function, R is the moving step of the window function, j is an imaginary number, and N is the number of points of a discrete Fourier transform in the STFT;
[0071] B2. Compare the short-time Fourier transform results of several sequences x[n], select the short-time Fourier transform results with frequency resolution higher than the threshold δ or time resolution higher than the threshold ε, and splice them into a matrix And the matrix Perform random sampling and reduce its dimension to a matrix The time-frequency features of the sequence x[n] are extracted using the following formula:
[0072]
[0073] In the above formula, Q is the time-frequency feature of the sequence extracted by the STFT layer, and STFT -1 is the inverse transform of STFT, Padding(·) is the zero-padding operation, and Conv(·) is the convolution operation.
[0074] The decoder power prediction module includes a sequence zero-filling unit, a feature extraction unit, a sequence decomposition unit, a time-frequency feature layer output unit, a seasonal component calculation unit, and a decoder output unit;
[0075] The sequence zero-filling unit is used to take the second half of the sequence of the historical power generation time series data x[n], and fill it with zeros until the length is the same as the original x[n]. The sequence is recorded as x de,in ;
[0076] The feature extraction unit is used to transform the sequence x de,in The self-attention layer and STFT layer of the decoder are input respectively for sequence dependency feature extraction and time-frequency feature extraction to obtain the sequence x de,in The sequence dependence feature matrix Atten de And the time-frequency feature matrix Q de ;
[0077] The sequence decomposition unit is used to perform sequence decomposition based on the sequence dependency features and time-frequency features extracted by the self-attention layer and the STFT layer of the decoder, combined with the historical power generation time series data x[n], using the following formula:
[0078] x t [n]=AvgPool(Padding(x[n])+ReduceDim(Atten de +Q de ));
[0079] x s [n]=Padding(x[n])+ReduceDim(Atten de +Q de )-x t [n];
[0080] In the above formula, x t [n] is the trend term, AvgPool(·) is the average pooling operation, Padding(·) is the zero padding operation, ReduceDim(·) is the dimensionality reduction operation, and x s [n] is the seasonal term;
[0081] The time-frequency feature layer output unit is used to convert the seasonal term after sequence decomposition and the output encoding result x of the encoder en Input to the time-frequency feature layer of the decoder, introduce sparse operation to perform time-frequency feature self-attention operation and sequence self-attention operation, and add the time-frequency self-attention output and sequence self-attention output obtained by the time-frequency feature self-attention operation and sequence self-attention operation to obtain the time-frequency feature layer output:
[0082] y t,f [n] = y s [n]+y f [n];
[0083] In the above formula, y t,f [n] is the output of the time-frequency feature layer, yf [n] is the time-frequency feature self-attention output, y s [n] is the sequence self-attention output;
[0084] The seasonal component calculation unit is used to add the seasonal term of the time-frequency feature layer output and the sequence decomposition, and perform sequence decomposition on the result after the addition using the following formula to obtain the seasonal component:
[0085]
[0086] In the above formula, is the trend component, For seasonal components;
[0087] The decoder output unit is used to pass the seasonal component after sequence decomposition through a feedforward neural network to obtain a feature sequence of aggregated dependency features and time-frequency features, and add the feature sequence to the historical power generation time series data x[n] to obtain the decoder output x de , the output of the decoder is the predicted power generation sequence of the distributed energy nodes.
[0088] In the time-frequency feature layer output unit, the time-frequency feature self-attention operation includes:
[0089] C1, through the linear layer, the seasonal term after sequence decomposition is mapped to the query matrix q, and the output encoding result of the encoder is x en Mapped into value matrix v, key matrix k;
[0090] C2. Input matrix q, matrix v, and matrix k into the STFT layer of the decoder for short-time Fourier transform, and introduce sparse operation to sparse matrix q, matrix v, and matrix k to obtain the time-frequency matrix And the time-frequency self-attention is calculated using the following formula:
[0091]
[0092] In the above formula, Atten f is the time-frequency self-attention, σ(·) is the activation function, For the matrix The transpose of dim f For the matrix Dimensions;
[0093] C3, use the following formula to perform zero padding operation and STFT inverse transformation on the time-frequency self-attention to obtain the time-frequency feature self-attention output y f [n]:
[0094] y f [n] = STFT -1(Padding(Atten f ));
[0095] The sequence self-attention operation includes:
[0096] D1. The seasonal terms after sequence decomposition are passed through the one-dimensional convolutional layer of the decoder to obtain the time domain features of the seasonal terms, and then the time domain features of the seasonal terms are mapped into the query matrix q through the linear layer. t ′, the output encoding result x of the encoder en Mapped to value matrix v t ′, key matrix k t ′, introduce sparse operation to transform the matrix q t 'Sparse, get the sparse query matrix The following formula is used to calculate the sequence self-attention:
[0097]
[0098] In the above formula, Atten s is the sequence self-attention, (k t ′)T is the matrix k t ′, dim s is the matrix q t ' dimension;
[0099] D2. Use the following formula to input the sequence self-attention into the one-dimensional convolution layer and pooling layer to obtain the sequence self-attention output y s [n]:
[0100] y s [n] = Pooling(Convld(Atten s ));
[0101] In the above formula, Pooling(·) is a one-dimensional convolution operation, and Convld(·) is a pooling operation.
[0102] In a third aspect, the present invention proposes a distributed energy generation power prediction device based on time-frequency characteristics, comprising a processor and a memory;
[0103] The memory is used to store computer program code and transmit the computer program code to the processor;
[0104] The processor is used to execute the aforementioned distributed energy generation power prediction method based on time-frequency characteristics according to the instructions in the computer program code.
[0105] In a fourth aspect, the present invention provides a computer storage medium having a computer program stored thereon;
[0106] When the computer program is executed by the processor, the steps of the aforementioned method for predicting distributed energy generation power based on time-frequency characteristics are implemented.
[0107] Compared with the prior art, the present invention has the following beneficial effects:
[0108] 1. The present invention proposes a distributed energy power generation prediction method and system based on time-frequency characteristics. The method first collects the historical power generation time series data of the distributed energy nodes to be predicted; the historical power generation time series data is input into the encoder, the self-attention layer of the encoder extracts the dependency features of the sequence, and the STFT layer of the encoder extracts the time-frequency features of the sequence; then the historical power generation time series data and the sequence dependency features extracted by the self-attention layer of the encoder and the sequence time-frequency features extracted by the STFT layer of the encoder are added, and the output encoding result of the encoder is obtained through the feedforward layer; finally, based on the output encoding result of the encoder, the decoder is used to predict the power generation sequence of the distributed energy nodes. The method uses the self-attention mechanism and STFT to effectively capture the dependency relationship and time-frequency features between the long-term and large-scale distributed energy historical power generation data, thereby improving the accuracy of sequence prediction.
[0109] 2. The present invention proposes a distributed energy generation power prediction method and system based on time-frequency characteristics. The method introduces sparse operations in both the encoding and decoding stages of the sequence, which can effectively reduce the amount of data calculation while preventing data overfitting, thereby speeding up the training and prediction speed of the sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0110] Figure 1 The figure is an overall flow chart of the method of the present invention.
[0111] Figure 2 This is a diagram of the operation process of the time-frequency feature self-attention described in Example 1.
[0112] Figure 3 The structure diagram of the system of the present invention is shown in FIG.
[0113] Figure 4 This is a structural diagram of the device described in Example 3. DETAILED DESCRIPTION
[0114] The present invention is further described in detail below in conjunction with specific implementations and drawings.
[0115] The present invention proposes a distributed energy power generation prediction method and system based on time-frequency features, which obtains and processes the historical power generation time series data of the distributed energy nodes to be predicted, and inputs the processed historical power generation time series data into an encoder module based on a time-frequency feature Transformer to perform self-attention-based sequence dependency feature extraction and short-time Fourier transform time-frequency feature extraction. Finally, the extracted dependency features and time-frequency features are input into a decoder module based on a time-frequency feature Transformer to obtain the power generation prediction result of the distributed energy node.
[0116] Embodiment 1:
[0117] like Figure 1 As shown, a distributed energy generation power prediction method based on time-frequency characteristics is performed in the following steps:
[0118] 1. Collect the historical power generation time series data of the distributed energy nodes that need to be predicted;
[0119] The historical power generation data of the distributed energy nodes to be predicted is expressed in time series as Where x[n] is the historical power generation time series data, n is the index of the time series data point, is a set of real numbers, and d is the number of points of historical power generation data.
[0120] 2. Input the historical power generation time series data into the encoder, the encoder's self-attention layer extracts the dependency features of the sequence, and the encoder's STFT layer extracts the time-frequency features of the sequence;
[0121] The Transformer encoder consists of several different encoding layers. Except for the first layer whose input is the original data, each encoding layer in the encoder uses the output of the previous layer as the input of this layer.
[0122] The self-attention layer of the Transformer encoder consists of a one-dimensional convolutional layer and a sparse self-attention layer, which is used to extract sequence dependency features, including:
[0123] The convolution kernel of the one-dimensional convolution layer is W = [w1, ..., w k ..., w K ], through a one-dimensional convolutional layer, the time domain features of the sequence x[n] are extracted using the following formula:
[0124]
[0125] In the above formula, y conv [t] is the time domain feature of the sequence extracted by the one-dimensional convolution layer, K is the length of the convolution kernel, and w k is the convolution kernel of length k, and t is the time;
[0126] The sparse self-attention layer maps the sequential time domain features extracted by the one-dimensional convolutional layer into the query matrix q through the linear layer. t , key matrix k t And the value matrix v t In order to reduce the amount of calculation, a sparse operation is introduced to convert the matrix q t Sparse, that is, randomly select the matrix q t Set some values in to zero to get the sparse query matrix The following formula is used to extract the dependency features of the sequence x[n]:
[0127]
[0128] In the above formula, Atten is the sequence dependency feature extracted by the self-attention layer, σ(·) is the activation function, and k T is the key matrix k t The transpose of dim t is the query matrix q t Dimensions;
[0129] The STFT layer extracts the time-frequency features of the sequence, including:
[0130] Several groups of STFT parameters are randomly selected, including the number of points of a discrete Fourier transform, the window function, and the moving step of the window function. The following formula is used to perform a short-time Fourier transform on the sequence x[n]:
[0131]
[0132] In the above formula, X[m, k] is the short-time Fourier transform result at time period index m and frequency component index k, m is the index of the window function time period, k is the index of the frequency component in the Fourier transform, w[n-mR] is the window function, R is the moving step of the window function, j is an imaginary number, and N is the number of points of a discrete Fourier transform in the STFT;
[0133] Compare the short-time Fourier transform results of several sequences x[n], select the short-time Fourier transform results with frequency resolution higher than the threshold δ or time resolution higher than the threshold ε, and use the concatenate function to concatenate them into a matrix In order to reduce the amount of calculation and prevent overfitting, the matrix Perform random sampling and reduce its dimension to a matrix The time-frequency features of the sequence x[n] are extracted using the following formula:
[0134]
[0135] In the above formula, Q is the time-frequency feature of the sequence extracted by the STFT layer, and STFT -1 is the inverse transform of STFT, Padding(·) is the zero-padding operation, and Conv(·) is the convolution operation.
[0136] 3. Add the historical power generation time series data x[n], the sequence dependency features extracted by the self-attention layer, and the sequence time-frequency features extracted by the STFT layer, and introduce nonlinear operations through the nonlinear activation function in the feedforward layer to obtain the output encoding result x of the encoder. en ;
[0137] The nonlinear activation function in the feedforward layer is the Sigmoid function, and its calculation formula is:
[0138]
[0139] 4. Based on the output encoding result of the encoder, use the Transformer decoder to predict the power generation sequence of the distributed energy node;
[0140] Take the second half of the historical power generation time series data x[n] and fill it with zeros until the length is the same as the original x[n]. This sequence is recorded as x de,in ;
[0141] The decoder also consists of several identical decoding layers. The input of the first decoding layer is x de,in , after which the input of the decoding layer is the output of the previous decoding layer. The operation of the decoding layer mainly includes the following steps:
[0142] The sequence x de,in The self-attention layer and STFT layer of the decoder are input respectively for sequence dependency feature extraction and time-frequency feature extraction to obtain the sequence x de,in The sequence dependence feature matrix Atten de And the time-frequency feature matrix Q de , the feature extraction method of the self-attention layer and STFT layer of the decoder is the same as that of the encoding layer;
[0143] Based on the sequence dependency features and time-frequency features extracted by the decoder's self-attention layer and STFT layer, combined with the historical power generation time series data x[n], the following formula is used for sequence decomposition:
[0144] x t [n]=AvgPool(Padding(x[n])+ReduceDim(Atten de +Q de ));
[0145] x s[n]=Padding(x[n])+RediceDim(Atten de +Q de )-x t [n];
[0146] In the above formula, x t [n] is the trend term, AvgPool(·) is the average pooling operation, Padding(·) is the zero padding operation, ReduceDim(·) is the dimensionality reduction operation implemented by the linear layer, and x s [n] is the seasonal term;
[0147] The seasonal term after sequence decomposition and the output encoding result of the encoder x en Input to the time-frequency feature layer of the decoder, introduce sparse operation to perform time-frequency feature self-attention operation and sequence self-attention operation, and obtain the output of the time-frequency feature layer;
[0148] The operation process of the time-frequency feature self-attention is as follows Figure 2 As shown, including:
[0149] Through the linear layer, the seasonal terms after sequence decomposition are mapped to the query matrix q, and the output encoding result x of the encoder is en Mapped into value matrix v, key matrix k;
[0150] Input matrix q, matrix v, and matrix k into the STFT layer of the decoder for short-time Fourier transform, and introduce sparse operation to sparse matrix q, matrix v, and matrix k to obtain the time-frequency matrix And the time-frequency self-attention is calculated using the following formula:
[0151]
[0152] In the above formula, Atten f is the time-frequency self-attention, σ(·) is the activation function, For the matrix The transpose of dim f For the matrix Dimensions;
[0153] The time-frequency self-attention is zero-filled and STFT inverse transformed using the following formula to obtain the time-frequency feature self-attention output y f [n]:
[0154]
[0155] The sequence self-attention operation includes:
[0156] Let the convolution kernel be W de =[w 1,de, ..., w k,de , ..., w K,de ], the seasonal terms after sequence decomposition are passed through the one-dimensional convolutional layer of the decoder to obtain the time domain features of the seasonal terms:
[0157]
[0158] In the above formula, y conv,de [t] is the temporal characteristic of the seasonal term;
[0159] Then, through the linear layer, the temporal features of the seasonal term are mapped to the query matrix q t ′, the output encoding result x of the encoder en Mapped to value matrix v t ′, key matrix k t ′, introduce sparse operation to transform the matrix q t 'Sparse, get the sparse query matrix The following formula is used to calculate the sequence self-attention:
[0160]
[0161] In the above formula, Atten s is the sequence self-attention, (k t ′) T is the matrix k t ′, dim s is the matrix q t ' dimension;
[0162] The following formula is used to input the sequence self-attention into the one-dimensional convolution layer and the pooling layer to obtain the sequence self-attention output y s [n]:
[0163] y s [n] = Pooling(Conv1d(Atten s ));
[0164] In the above formula, Pooling(·) is a one-dimensional convolution operation, and Convld(·) is a pooling operation, which takes the mean value in a data point and its neighborhood instead of the original data point to generate a pooling result;
[0165] Add the time-frequency self-attention output and the sequence self-attention output to get the time-frequency feature layer output:
[0166] y t,f [n] = y s [n]+y f [n];
[0167] In the above formula, y t,f[n] is the output of the time-frequency feature layer;
[0168] In summary, the output of the time-frequency feature layer and the seasonal term of the sequence decomposition are added together, and the result of the addition is sequence decomposed using the following formula to obtain the seasonal component:
[0169]
[0170] In the above formula, is the trend component, For seasonal components;
[0171] The seasonal component after sequence decomposition is passed through a feedforward neural network to obtain a feature sequence of aggregated dependency features and time-frequency features, and this feature sequence is added to the historical power generation time series data x[n] to obtain the decoder output x de , the output of the decoder is the predicted power generation sequence of the distributed energy nodes.
[0172] Embodiment 2:
[0173] like Figure 3 As shown, a distributed energy generation power prediction system based on time-frequency characteristics includes a historical generation power time series data collection module, an encoder feature extraction module, an encoding result output module, and a decoder power prediction module;
[0174] The historical power generation time series data collection module is used to collect the historical power generation time series data of the distributed energy nodes that need to be predicted;
[0175] The encoder feature extraction module is used to input the historical power generation time series data into the encoder, the encoder's self-attention layer extracts the dependency features of the sequence, and the encoder's STFT layer extracts the time-frequency features of the sequence. The encoder's self-attention layer includes a one-dimensional convolution layer and a sparse self-attention layer;
[0176] The encoding result output module is used to add the historical power generation time series data and the sequence dependency features extracted by the self-attention layer of the encoder and the sequence time-frequency features extracted by the STFT layer of the encoder, and obtain the output encoding result of the encoder through the feedforward layer;
[0177] The decoder power prediction module is used to use the decoder to predict the power generation sequence of the distributed energy node based on the output encoding result of the encoder.
[0178] The encoder feature extraction module includes a dependency feature extraction unit and a time-frequency feature extraction unit;
[0179] The dependency feature extraction unit is used for extracting dependency features of a sequence from the self-attention layer of the encoder, including:
[0180] A1. Through the one-dimensional convolution layer, the time domain features of the sequence x[n] are extracted using the following formula:
[0181]
[0182] In the above formula, y conv [t] is the time domain feature of the sequence extracted by the one-dimensional convolution layer, K is the length of the convolution kernel, and w k is the convolution kernel of length k, and t is the time;
[0183] A2, the sparse self-attention layer maps the sequence time domain features extracted by the one-dimensional convolutional layer into the query matrix q through the linear layer t , key matrix k t And the value matrix v t , introduce sparse operation to transform the matrix q t Sparse, get the sparse query matrix The following formula is used to extract the dependency features of the sequence x[n]:
[0184]
[0185] In the above formula, Atten is the sequence dependency feature extracted by the self-attention layer, σ(·) is the activation function, and k T is the key matrix k t The transpose of dim t is the query matrix q t Dimensions;
[0186] The time-frequency feature extraction unit is used for extracting the time-frequency features of the sequence at the STFT layer of the encoder, including:
[0187] B1. Randomly select several groups of STFT parameters, where the STFT parameters include the number of points of a discrete Fourier transform, a window function, and a moving step of the window function, and use the following formula to perform a short-time Fourier transform on the sequence x[n] to obtain the short-time Fourier transform results of several sequences x[n]:
[0188]
[0189] In the above formula, X[m, k] is the short-time Fourier transform result at time period index m and frequency component index k, m is the index of the window function time period, k is the index of the frequency component in the Fourier transform, w[n-mR] is the window function, R is the moving step of the window function, j is an imaginary number, and N is the number of points of a discrete Fourier transform in the STFT;
[0190] B2. Compare the short-time Fourier transform results of several sequences x[n], select the short-time Fourier transform results with frequency resolution higher than the threshold δ or time resolution higher than the threshold ε, and splice them into a matrix And the matrix Perform random sampling and reduce its dimension to a matrix The time-frequency features of the sequence x[n] are extracted using the following formula:
[0191]
[0192] In the above formula, Q is the time-frequency feature of the sequence extracted by the STFT layer, and STFT -1 is the inverse transform of STFT, Padding(·) is the zero-padding operation, and Conv(·) is the convolution operation.
[0193] The decoder power prediction module includes a sequence zero-filling unit, a feature extraction unit, a sequence decomposition unit, a time-frequency feature layer output unit, a seasonal component calculation unit, and a decoder output unit;
[0194] The sequence zero-filling unit is used to take the second half of the sequence of the historical power generation time series data x[n], and fill it with zeros until the length is the same as the original x[n]. The sequence is recorded as x de,in ;
[0195] The feature extraction unit is used to transform the sequence x de,in The self-attention layer and STFT layer of the decoder are input respectively for sequence dependency feature extraction and time-frequency feature extraction to obtain the sequence x de,in The sequence dependence feature matrix Atten de And the time-frequency feature matrix Q de ;
[0196] The sequence decomposition unit is used to perform sequence decomposition based on the sequence dependency features and time-frequency features extracted by the self-attention layer and the STFT layer of the decoder, combined with the historical power generation time series data x[n], using the following formula:
[0197] x t [n]=AvgPool(Padding(x[n])+ReduceDim(Atten de +Q de ));
[0198] x s [n]=Padding(x[n])+ReduceDim(Atten de +Q de )-x t [n];
[0199] In the above formula, x t [n] is the trend term, AvgPool(·) is the average pooling operation, Padding(·) is the zero padding operation, ReduceDim(·) is the dimensionality reduction operation, and xs [n] is the seasonal term;
[0200] The time-frequency feature layer output unit is used to convert the seasonal term after sequence decomposition and the output encoding result x of the encoder en Input to the time-frequency feature layer of the decoder, introduce sparse operation to perform time-frequency feature self-attention operation and sequence self-attention operation, and add the time-frequency self-attention output and sequence self-attention output obtained by the time-frequency feature self-attention operation and sequence self-attention operation to obtain the time-frequency feature layer output:
[0201] y t,f [n] = y s [n]+y f [n];
[0202] In the above formula, y t,f [n] is the output of the time-frequency feature layer, y f [n] is the time-frequency feature self-attention output, y s [n] is the sequence self-attention output;
[0203] The seasonal component calculation unit is used to add the seasonal term of the time-frequency feature layer output and the sequence decomposition, and perform sequence decomposition on the added result using the following formula to obtain the seasonal component:
[0204]
[0205] In the above formula, is the trend component, For seasonal components;
[0206] The decoder output unit is used to pass the seasonal component after sequence decomposition through a feedforward neural network to obtain a feature sequence of aggregated dependency features and time-frequency features, and add the feature sequence to the historical power generation time series data x[n] to obtain the decoder output x de , the output of the decoder is the predicted power generation sequence of the distributed energy nodes.
[0207] In the time-frequency feature layer output unit, the time-frequency feature self-attention operation includes:
[0208] C1, through the linear layer, the seasonal term after sequence decomposition is mapped to the query matrix q, and the output encoding result of the encoder is x en Mapped into value matrix v, key matrix k;
[0209] C2. Input matrix q, matrix v, and matrix k into the STFT layer of the decoder for short-time Fourier transform, and introduce sparse operation to sparse matrix q, matrix v, and matrix k to obtain the time-frequency matrix And the time-frequency self-attention is calculated using the following formula:
[0210]
[0211] In the above formula, Atten f is the time-frequency self-attention, σ(·) is the activation function, For the matrix The transpose of dim f For the matrix Dimensions;
[0212] C3, use the following formula to perform zero padding operation and STFT inverse transformation on the time-frequency self-attention to obtain the time-frequency feature self-attention output y f [n]:
[0213] y f [n] = STFT -1 (Padding(Atten f ));
[0214] The sequence self-attention operation includes:
[0215] D1. The seasonal terms after sequence decomposition are passed through the one-dimensional convolutional layer of the decoder to obtain the time domain features of the seasonal terms, and then the time domain features of the seasonal terms are mapped into the query matrix q through the linear layer. t ′, the output encoding result x of the encoder en Mapped to value matrix v t ′, key matrix k t ′, introduce sparse operation to transform the matrix q t 'Sparse, get the sparse query matrix The following formula is used to calculate the sequence self-attention:
[0216]
[0217] In the above formula, Atten s is the sequence self-attention, (k t ′) T is the matrix k t ′, dim s is the matrix q t ' dimension;
[0218] D2. Use the following formula to input the sequence self-attention into the one-dimensional convolution layer and pooling layer to obtain the sequence self-attention output y s [n]:
[0219] y s [n] = Pooling(Cov1d(Atten s ));
[0220] In the above formula, Pooling(·) is a one-dimensional convolution operation, and Convld(·) is a pooling operation.
[0221] Embodiment 3:
[0222] like Figure 4 As shown, a distributed energy generation power prediction device based on time-frequency characteristics includes a processor and a memory;
[0223] The memory is used to store computer program code and transmit the computer program code to the processor;
[0224] The processor is used to execute a distributed energy generation power prediction method based on time-frequency characteristics described in Example 1 according to the instructions in the computer program code.
[0225] Embodiment 4:
[0226] A computer storage medium having a computer program stored thereon;
[0227] When the computer program is executed by the processor, the steps of a distributed energy generation power prediction method based on time-frequency characteristics described in this solution are implemented.
Claims
1. A distributed energy generation power prediction method based on time-frequency characteristics, characterized in that: The method comprises: S1. Collect the historical power generation time series data of the distributed energy nodes that need to be predicted; S2, input the historical power generation time series data into the encoder, the encoder's self-attention layer extracts the dependency features of the sequence, and the encoder's STFT layer extracts the time-frequency features of the sequence; S3, adding the historical power generation time series data, the sequence dependency features extracted by the self-attention layer of the encoder, and the sequence time-frequency features extracted by the STFT layer of the encoder, and obtaining the output encoding result of the encoder through the feedforward layer; S4. Based on the output encoding result of the encoder, use the decoder to predict the power generation sequence of the distributed energy node.
2. A distributed energy generation power prediction method based on time-frequency characteristics according to claim 1, characterized in that: In S2, the self-attention layer of the encoder includes a one-dimensional convolutional layer and a sparse self-attention layer; The encoder’s self-attention layer extracts dependent features of the sequence, including: A1. Through the one-dimensional convolution layer, the time domain features of the sequence x[n] are extracted using the following formula: In the above formula, y conv [t] is the time domain feature of the sequence extracted by the one-dimensional convolution layer, K is the length of the convolution kernel, and w k is the convolution kernel of length k, and t is the time; A2, the sparse self-attention layer maps the sequence time domain features extracted by the one-dimensional convolutional layer into the query matrix q through the linear layer t , key matrix k t And the value matrix v t , introduce sparse operation to transform the matrix q t Sparse, get the sparse query matrix The following formula is used to extract the dependency features of the sequence x[n]: In the above formula, Atten is the sequence dependency feature extracted by the self-attention layer, σ(·) is the activation function, and k T is the key matrix k t The transpose of dim t is the query matrix q t Dimensions; The STFT layer of the encoder extracts the time-frequency features of the sequence, including: B1. Randomly select several groups of STFT parameters, where the STFT parameters include the number of points of a discrete Fourier transform, a window function, and a moving step of the window function, and use the following formula to perform a short-time Fourier transform on the sequence x[n] to obtain the short-time Fourier transform results of several sequences x[n]: In the above formula, X[m, k] is the short-time Fourier transform result at time period index m and frequency component index k, m is the index of the window function time period, k is the index of the frequency component in the Fourier transform, w[n-mR] is the window function, R is the moving step of the window function, j is an imaginary number, and N is the number of points of a discrete Fourier transform in the STFT; B2. Compare the short-time Fourier transform results of several sequences x[n], select the short-time Fourier transform results with frequency resolution higher than the threshold δ or time resolution higher than the threshold ε, and splice them into a matrix And the matrix Perform random sampling and reduce its dimension to a matrix The time-frequency features of the sequence x[n] are extracted using the following formula: In the above formula, Q is the time-frequency feature of the sequence extracted by the STFT layer, and STFT -1 is the inverse transform of STFT, Padding(·) is the zero-padding operation, and Conv(·) is the convolution operation.
3. The distributed energy generation power prediction method based on time-frequency characteristics according to claim 1 is characterized in that: The S3 includes: S31, take the second half of the historical power generation time series data x[n], and fill it with zeros until the length is the same as the original x[n], and record this sequence as x de,in ; S32, sequence x de,in The self-attention layer and STFT layer of the decoder are input respectively for sequence dependency feature extraction and time-frequency feature extraction to obtain the sequence x de,in The sequence dependence feature matrix Atten de And the time-frequency feature matrix Q de ; S33, based on the sequence dependency features and time-frequency features extracted by the decoder's self-attention layer and STFT layer, combined with the historical power generation time series data x[n], the following formula is used for sequence decomposition: x t [n]=AvgPool(Padding(x[n])+ReduceDim(Atten de +Q de )); x s [n]=Padding(x[n])+ReduceDim(Atten de +Q de )-x t [n]: In the above formula, x t [n] is the trend term, AvgPool(·) is the average pooling operation, Padding(·) is the zero padding operation, ReduceDim(·) is the dimensionality reduction operation, and x S [n] is the seasonal term; S34, the seasonal term after sequence decomposition and the output encoding result of the encoder x en Input to the time-frequency feature layer of the decoder, introduce sparse operation to perform time-frequency feature self-attention operation and sequence self-attention operation, and add the time-frequency self-attention output and sequence self-attention output obtained by the time-frequency feature self-attention operation and sequence self-attention operation to obtain the time-frequency feature layer output: and t,f [n]=y S [n]+y f [n]; In the above formula, y t,f [n] is the output of the time-frequency feature layer, y f [n] is the time-frequency feature self-attention output, y S [n] is the sequence self-attention output; S35, adding the seasonal term after the time-frequency feature layer output and the sequence decomposition in step S33, and performing sequence decomposition on the result after the addition using the following formula to obtain the seasonal component: In the above formula, is the trend component, For seasonal components; S36, the seasonal component after sequence decomposition is passed through a feedforward neural network to obtain a feature sequence of aggregated dependency features and time-frequency features, and the feature sequence is added to the historical power generation time series data x[n] to obtain the output x of the decoder de , the output of the decoder is the predicted power generation sequence of the distributed energy nodes.
4. A distributed energy generation power prediction method based on time-frequency characteristics according to claim 3, characterized in that: In S34, the time-frequency feature self-attention operation includes: C1, through the linear layer, the seasonal term after sequence decomposition is mapped to the query matrix q, and the output encoding result of the encoder is x en Mapped into value matrix ν and key matrix k; C2. Input matrix q, matrix ν, and matrix k into the STFT layer of the decoder for short-time Fourier transform, and introduce sparse operation to sparse matrix q, matrix v, and matrix k to obtain the time-frequency matrix And the time-frequency self-attention is calculated using the following formula: In the above formula, Atten f is the time-frequency self-attention, σ(·) is the activation function, For the matrix The transpose of dim f For the matrix Dimensions; C3, use the following formula to perform zero padding operation and STFT inverse transformation on the time-frequency self-attention to obtain the time-frequency feature self-attention output y f [n]: y f [n]=STFT -1 (Padding(Atten f )); The sequence self-attention operation includes: D1. The seasonal terms after sequence decomposition are passed through the one-dimensional convolutional layer of the decoder to obtain the time domain features of the seasonal terms, and then the time domain features of the seasonal terms are mapped into the query matrix q through the linear layer. t ′, the output encoding result x of the encoder en Mapped to value matrix v t ′, key matrix k t ′, introduce sparse operation to transform the matrix q t 'Sparse, get the sparse query matrix The following formula is used to calculate the sequence self-attention: In the above formula, Atten S is the sequence self-attention, (k t ′) T is the matrix k t ′, dim S is the matrix q t ' dimension; D2. Use the following formula to input the sequence self-attention into the one-dimensional convolution layer and pooling layer to obtain the sequence self-attention output y s [n]: y S [n]=Pooling(Conv1d(Atten s )); In the above formula, Pooling(·) is a one-dimensional convolution operation, and Convld(·) is a pooling operation.
5. A distributed energy generation power prediction system based on time-frequency characteristics, characterized in that: The system includes a historical power generation time series data collection module, an encoder feature extraction module, an encoding result output module, and a decoder power prediction module; The historical power generation time series data collection module is used to collect the historical power generation time series data of the distributed energy nodes that need to be predicted; The encoder feature extraction module is used to input the historical power generation time series data into the encoder, the encoder's self-attention layer extracts the dependency features of the sequence, and the encoder's STFT layer extracts the time-frequency features of the sequence. The encoder's self-attention layer includes a one-dimensional convolution layer and a sparse self-attention layer; The encoding result output module is used to add the historical power generation time series data and the sequence dependency features extracted by the self-attention layer of the encoder and the sequence time-frequency features extracted by the STFT layer of the encoder, and obtain the output encoding result of the encoder through the feedforward layer; The decoder power prediction module is used to use the decoder to predict the power generation sequence of the distributed energy node based on the output encoding result of the encoder.
6. A distributed energy generation power prediction system based on time-frequency characteristics according to claim 5, characterized in that: The encoder feature extraction module includes a dependency feature extraction unit and a time-frequency feature extraction unit; The dependency feature extraction unit is used for extracting dependency features of a sequence from the self-attention layer of the encoder, including: A1. Through the one-dimensional convolution layer, the time domain features of the sequence x[n] are extracted using the following formula: In the above formula, y conv [t] is the time domain feature of the sequence extracted by the one-dimensional convolution layer, K is the length of the convolution kernel, and w k is the convolution kernel of length k, and t is the time; A2, the sparse self-attention layer maps the sequence time domain features extracted by the one-dimensional convolutional layer into the query matrix q through the linear layer t , key matrix k t And the value matrix v t , introduce sparse operation to transform the matrix q t Sparse, get the sparse query matrix The following formula is used to extract the dependency features of the sequence x[n]: In the above formula, Atten is the sequence dependency feature extracted by the self-attention layer, σ(·) is the activation function, and k T is the key matrix k t The transpose of dim t is the query matrix q t Dimensions; The time-frequency feature extraction unit is used for extracting the time-frequency features of the sequence at the STFT layer of the encoder, including: B1. Randomly select several groups of STFT parameters, where the STFT parameters include the number of points of a discrete Fourier transform, a window function, and a moving step of the window function, and use the following formula to perform a short-time Fourier transform on the sequence x[n] to obtain the short-time Fourier transform results of several sequences x[n]: In the above formula, X[m, k] is the short-time Fourier transform result at time period index m and frequency component index k, m is the index of the window function time period, k is the index of the frequency component in the Fourier transform, w[n-mR] is the window function, R is the moving step of the window function, j is an imaginary number, and N is the number of points of a discrete Fourier transform in the STFT; B2. Compare the short-time Fourier transform results of several sequences x[n], select the short-time Fourier transform results with frequency resolution higher than the threshold δ or time resolution higher than the threshold ε, and splice them into a matrix And the matrix Perform random sampling and reduce its dimension to a matrix The time-frequency features of the sequence x[n] are extracted using the following formula: In the above formula, Q is the time-frequency feature of the sequence extracted by the STFT layer, and STFT -1 is the inverse transform of STFT, Padding(·) is the zero-padding operation, and Conv(·) is the convolution operation.
7. A distributed energy generation power prediction system based on time-frequency characteristics according to claim 5, characterized in that: The decoder power prediction module includes a sequence zero-filling unit, a feature extraction unit, a sequence decomposition unit, a time-frequency feature layer output unit, a seasonal component calculation unit, and a decoder output unit; The sequence zero-filling unit is used to take the second half of the sequence of the historical power generation time series data x[n], and fill it with zeros until the length is the same as the original x[n]. The sequence is recorded as x de,in ; The feature extraction unit is used to transform the sequence x de,in The self-attention layer and STFT layer of the decoder are input respectively for sequence dependency feature extraction and time-frequency feature extraction to obtain the sequence x de,in The sequence dependence feature matrix Atten de And the time-frequency feature matrix Q de ; The sequence decomposition unit is used to perform sequence decomposition based on the sequence dependency features and time-frequency features extracted by the self-attention layer and the STFT layer of the decoder, combined with the historical power generation time series data x[n], using the following formula: x t [n]=AvgPool(Padding(x[n])+ReduceDim(Atten de +Q de )); x S [n]=Padding(x[n])+ReduceDim(Atten de +Q de )-x t [n]: In the above formula, x t [n] is the trend term, AvgPool(·) is the average pooling operation, Padding(·) is the zero padding operation, ReduceDim(·) is the dimensionality reduction operation, and x S [n] is the seasonal term; The time-frequency feature layer output unit is used to convert the seasonal term after sequence decomposition and the output encoding result x of the encoder en Input to the time-frequency feature layer of the decoder, introduce sparse operation to perform time-frequency feature self-attention operation and sequence self-attention operation, and add the time-frequency self-attention output and sequence self-attention output obtained by the time-frequency feature self-attention operation and sequence self-attention operation to obtain the time-frequency feature layer output: and t,f [n]=y s [n]+y f [n]; In the above formula, y t,f [n] is the output of the time-frequency feature layer, y f [n] is the time-frequency feature self-attention output, y S [n] is the sequence self-attention output; The seasonal component calculation unit is used to add the seasonal term of the time-frequency feature layer output and the sequence decomposition, and perform sequence decomposition on the result after the addition using the following formula to obtain the seasonal component: In the above formula, is the trend component, For seasonal components; The decoder output unit is used to pass the seasonal component after sequence decomposition through a feedforward neural network to obtain a feature sequence of aggregated dependency features and time-frequency features, and add the feature sequence to the historical power generation time series data x[n] to obtain the decoder output x de , the output of the decoder is the predicted power generation sequence of the distributed energy nodes.
8. A distributed energy generation power prediction system based on time-frequency characteristics according to claim 7, characterized in that: In the time-frequency feature layer output unit, the time-frequency feature self-attention operation includes: C1, through the linear layer, the seasonal term after sequence decomposition is mapped to the query matrix q, and the output encoding result of the encoder is x en Mapped into value matrix v, key matrix k; C2. Input matrix q, matrix v, and matrix k into the STFT layer of the decoder for short-time Fourier transform, and introduce sparse operation to sparse matrix q, matrix V, and matrix k to obtain the time-frequency matrix And the time-frequency self-attention is calculated using the following formula: In the above formula, Atten f is the time-frequency self-attention, σ(·) is the activation function, For the matrix The transpose of dim f For the matrix Dimensions; C3, use the following formula to perform zero padding operation and STFT inverse transformation on the time-frequency self-attention to obtain the time-frequency feature self-attention output y f [n]: y f [n]=STFT -1 (Padding(Atten f )); The sequence self-attention operation includes: D1. The seasonal terms after sequence decomposition are passed through the one-dimensional convolutional layer of the decoder to obtain the time domain features of the seasonal terms, and then the time domain features of the seasonal terms are mapped into the query matrix q through the linear layer. t ′, the output encoding result x of the encoder en Mapped to value matrix v t ′, key matrix k t ′, introduce sparse operation to transform the matrix q t 'Sparse, get the sparse query matrix The following formula is used to calculate the sequence self-attention: In the above formula, Atten S is the sequence self-attention, (k t ′) T is the matrix k t ′, dim S is the matrix q t ' dimension; D2. Use the following formula to input the sequence self-attention into the one-dimensional convolution layer and pooling layer to obtain the sequence self-attention output y S [n]: y S [n]=Pooling(Convld(Atten S )); In the above formula, Pooling(·) is a one-dimensional convolution operation, and Convld(·) is a pooling operation.
9. A distributed energy generation power prediction device based on time-frequency characteristics, characterized in that: including a processor and a memory; The memory is used to store computer program code and transmit the computer program code to the processor; The processor is used to execute a distributed energy generation power prediction method based on time-frequency characteristics as described in any one of claims 1-4 according to the instructions in the computer program code.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a distributed energy generation power prediction method based on time-frequency characteristics described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Regional electricity consumption prediction method and system based on combination of frequency domain and spatial domain, and medium
CN115049169A
Short-term load prediction method and terminal
CN115481778A
Generation reasoning power generation power prediction method based on sparse self-attention
CN116205327A
Wind power generation prediction method based on improved Transform model
CN116911442A
Method and system for predicting ultra-short-term distributed energy output of power distribution network
CN119026450A
Cited By
Multi-scale time sequence feature adaptive extraction power prediction method and system
CN121172743A