Grounding current prediction method based on space-time attention mechanism
By introducing a spatiotemporal attention mechanism in the Autoformer model, combining the optimal frequency domain decomposition module and data slice and embedding module, the problem of difficulty in capturing variable dependencies in ground current data in the existing technology is solved, and high accuracy and robustness are achieved ground current prediction.
Patent Information
- Application Number
- CN202411343629.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-25
AI Technical Summary
Existing attention mechanisms are difficult to effectively fit the potential dependencies between variables in the ground current dataset, especially in the presence of dynamic correlations, which cannot achieve high-precision ground current prediction.
The spatiotemporal attention mechanism based on the Autoformer model is adopted, and the local characteristics of time-series data and the dependence between the time dimension and the variable dimension are extracted through the optimal frequency domain decomposition module, the Encoder module and the Decoder module to achieve accurate prediction of ground current.
It improves the accuracy and robustness of ground current prediction, can effectively capture the intrinsic characteristics between timing data and variables, and is suitable for complex timing data prediction tasks.
Smart Images

Figure CN119416827A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of time series prediction, deep learning and substation fault prediction, and specifically relates to a grounding current prediction method based on a spatiotemporal attention mechanism. Background Art
[0002] The grounding current at the grounding point of the substation is one of the key indicators for evaluating power quality, and it is directly related to the operating status of the substation equipment. By real-time monitoring of the grounding current, the health status and dynamic changes of the equipment can be understood in a timely manner. To ensure the safe and stable operation of the substation and effectively prevent equipment failures, it is crucial to master the dynamic changes of the grounding current. The core of the grounding current prediction task is to deeply analyze and process the historical grounding current data collected by sensors installed at different grounding points, explore the potential laws and trends in the grounding current data, so as to predict future grounding current data and provide strong data support for the safety prevention of substation equipment.
[0003] This task can be regarded as the application of time series prediction in the power field. For this task, the literature (Li Bingxiao, Zhang Shiwei, Huang Feihu. Power load prediction based on LSTM and self-attention mechanism [J]. China Testing, 2022, 48 (S2): 38-43.) achieved accurate prediction of power load data by integrating LSTM and attention mechanism. The literature (Zhang Jianliang, Li Yang, Zhu Chunshan, et al. Substation equipment fault warning method based on dual-domain sparse Transformer [J]. Computer Science, 2024, 51 (05): 62-69.) obtained the time series data generated by the operation of substation electrical equipment, constructed a dual-domain sparse Transformer model, and learned the potential information of historical data to predict the future data of the equipment, which significantly improved the prediction accuracy and efficiency. However, the above traditional attention method cannot fit the potential dependency between variables well, and is not suitable for the prediction of data sets such as grounding current where there is dynamic correlation between variables (Mou Longhua, Li Guoxin, Meng Qinghai. Analysis of the influence of interconnection of high and low voltage power grid protective grounding network [J]. Journal of Coal Society, 2004, (02): 238-242.). Summary of the invention
[0004] In order to achieve high-precision prediction of the grounding current at the docking location, the present invention provides a grounding current prediction method based on a spatiotemporal attention mechanism based on an Autoformer model.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A ground current prediction method based on a spatiotemporal attention mechanism, the method comprising the following steps:
[0007] Step 1: Build a ground current dataset, and perform training and testing on the ground current dataset;
[0008] Step 2: Construct an SPTFormer deep learning model including the optimal frequency domain decomposition module, Encoder module, and Decoder module; where:
[0009] Optimal frequency domain decomposition module: obtains high- and low-frequency component data containing different component features to enhance the features of time series data;
[0010] Encoder module: First, the local features of time series data are extracted through data slicing and embedding modules, and then the dependency between the time dimension and variable dimension of time series data is captured through the spatiotemporal attention mechanism to improve the feature extraction capability of the model;
[0011] Decoder module: Aggregates the data features obtained by the Encoder module through the spatiotemporal cross attention mechanism, and superimposes them to obtain the predicted grounding current values at different grounding points.
[0012] Furthermore, the specific operation of the optimal frequency domain decomposition module in step 2 is:
[0013] S2.1: The input time series X is decomposed into low-frequency component data Z by the optimal frequency domain decomposition module low and high frequency component data Z high ;
[0014] In the optimal frequency domain decomposition module, the input time series X is first subjected to Fourier transform to obtain the frequency domain value F, and then different time domain component data are mapped by selecting different frequency domain demarcation points f. The specific calculation process is as follows:
[0015] F=FFT(X)
[0016]
[0017] Among them, FFT stands for fast Fourier transform, F is the frequency domain sequence obtained after Fourier transform; iFFT is the inverse Fourier transform, They represent the low-frequency time domain component and the high-frequency time domain component at the dividing point f, respectively. [:f] means slicing the frequency domain sequence F, starting from the first element and ending at the f-th element of the sequence. [f+1:] means slicing the frequency domain sequence F, starting from the f+1-th element and ending at the end of the sequence.
[0018] S2.2: The optimal dividing point between high and low frequencies is obtained by minimizing the difference between the correlation coefficients of high and low frequency components and the original data; the formula for minimizing the objective function is defined as:
[0019] O=argmin|L f -H f |
[0020] In the above formula, L f , H f They represent the correlation coefficient between the low-frequency component and the original data, and the correlation coefficient between the high-frequency component and the original data at the dividing point f respectively; O is the objective function value. When the objective function reaches the minimum value, the correlation coefficient between the low-frequency component and the original data, and the correlation coefficient between the high-frequency component and the original data reach the best balance.
[0021] Furthermore, the specific operation of the Encoder module in step 2 is:
[0022] S2.3: High frequency component data Z high and low frequency component data Z low After the feature enhancement of the optimal frequency domain decomposition module, the data enters the data slicing and embedding module in the Encoder module. First, the component data is extended to ensure that the sequence length after segmentation is consistent; then the extended data is sliced to obtain sliced data of the same length; finally, the segmented sequence is value-embedded and position-embedded, and stacked to obtain the embedded vector e out , the specific calculation process is as follows:
[0023]
[0024] In the above formula, Z d represents the input sequence of the dth dimension, represents the slicing result of the i-th sequence block in the d-th dimension, unfold represents slicing the sequence, padding represents extending the sequence, L represents the total length of the sequence, L s represents the segment length, D represents the total dimension of the variable, valueEmbedding represents value embedding, and positionEmbedding represents position embedding;
[0025] S2.4: When the embedded vector e out After multi-head mapping in the time dimension, we get the query matrix Q t , key matrix K t , value matrix V t , the specific calculation process is as follows:
[0026]
[0027] In the above formula, d k represents the model depth, n is the number of attention heads;
[0028] S2.5: Then calculate the query matrix Q tInstead of translating the lagged sequence key matrix K backward by τ time points t The autocorrelation coefficient between Next, we obtain the k translation lengths with the largest autocorrelation coefficients, and use softmax normalization to obtain the attention weights S between sequences under different translation lengths. j ; Finally, based on the k translation lengths obtained, vector V t Shift backward and multiply it by its attention weight to obtain the time dimension feature Z after delayed aggregation time , the specific calculation process is as follows:
[0029]
[0030] In the above formula, FFT * represents performing FFT on the input vector and then finding its conjugate vector; argTopk represents obtaining k maximum translation lengths; Roll is the operation of backward translation of the input sequence; j∈[0,k] represents the jth translation length.
[0031] S2.6: When the embedded vector e out After variable dimension multi-head mapping, the query matrix Q corresponding to the input vector is obtained d , key matrix K d Sum value matrix V d ; Then the query matrix Q d With the key matrix K d Perform dot product operation to obtain the attention weight score A between variables, and normalize it with the value matrix V after softmax activation function normalization. d Perform product operation to obtain the high-dimensional feature Z of the variable dimension dim , the specific calculation process is as follows:
[0032]
[0033] In the formula, It means taking the square root of the dimension value d, which is used to normalize the vector.
[0034] S2.7: After obtaining the time dimension feature Z of the input vector time and high-dimensional features Z of variable dimensions dim After that, the vector Z dim Transform the dimension with vector Z time Dimensions are aligned, then with Z dim Directly concatenate, then pass through a linear projection layer and softmax function, and get the weight distributions h1 and h2 corresponding to the two attention modules. Based on this distribution, we get the output result X of the spatiotemporal attention mechanism. att The specific calculation process is as follows:
[0035] G=M·Concat(Z dim ,Z time )+b
[0036] h1,h2=softmax(G)
[0037] X att =Concat(h1×Z dim , h2×Z time )
[0038] In the formula, M and b represent weight matrices, G represents the features obtained by the linear projection layer, and Concat represents the vector concatenation operation.
[0039] Furthermore, the specific operation of the Decoder module in step 2 is:
[0040] S2.8: After the decoder module is initialized, it first passes through the data slicing and embedding module to obtain sequence blocks in different time regions, and then passes through the spatiotemporal attention module to extract the time dimension features of the data and learn the correlation relationship between the variable dimensions;
[0041] S2.9: The time series features learned by the Encoder module and the features learned by the time and space attention module in the Decoder are integrated through the time and space cross attention module. At the same time, reasoning is performed using the time dimension feature rules and the variable dimension correlation relationship. After a fully connected layer, the prediction sequences of different components are obtained and added together to obtain the final prediction result.
[0042] Step 3: Model training and reasoning: Training and testing based on the constructed SPTFormer deep learning model to predict the grounding current at different grounding points;
[0043] Step 4: Analysis of ground current prediction results.
[0044] Compared with the prior art, the present invention has the following advantages:
[0045] The present invention discloses a ground current prediction method based on a spatiotemporal attention mechanism. First, in the data preprocessing stage, an optimized frequency domain decomposition algorithm is designed and implemented, aiming to effectively separate the high-frequency and low-frequency components in the time series data, thereby enhancing the feature representation of the data. Secondly, in the feature extraction stage, a data slicing and embedding module is introduced. This module is responsible for fine-tuning the component data, including data filling, slicing and embedding operations. Through these operations, the local features of the data in the time dimension can be effectively extracted, providing richer information for the model. Finally, in order to further enhance the feature extraction capability of the model, an innovative spatiotemporal attention module is proposed. This module can capture the intrinsic features of the sequence between the time dimension and the variable dimension in parallel, thereby achieving accurate prediction of the ground current.
[0046] In contrast, the advantages of the present invention are mainly reflected in the following three aspects:
[0047] (1) High prediction accuracy. The SPTFormer deep learning model proposed in the present invention can well learn the dependency relationship of the time dimension of time series data and the coupling relationship of the variable dimension, and realize accurate prediction of ground current.
[0048] (2) Strong robustness. The SPTFormer proposed in this paper designs a new time series decomposition method, which solves the problem of modal aliasing when traditional time series methods process high-frequency data, and is suitable for prediction tasks of any time series data with complex features.
[0049] (3) Intelligent early warning. The ground current prediction method of the present invention can realize accurate prediction of ground current, thereby assisting substation operation and maintenance personnel in preventing substation equipment failures, with low cost and great benefits. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 Flowchart of a ground current prediction method based on spatiotemporal attention mechanism;
[0051] Figure 2 This is a schematic diagram of time series data after outlier processing;
[0052] Figure 3 This is a schematic diagram of the model architecture;
[0053] Figure 4 Schematic diagram of data slicing and embedding module;
[0054] Figure 5 Schematic diagram of the spatiotemporal attention module;
[0055] Figure 6 This is a schematic diagram of the prediction results of grounding point a;
[0056] Figure 7 Schematic diagram of the prediction results of grounding point b. DETAILED DESCRIPTION
[0057] In order to gain a deeper understanding of the present invention, we will provide a comprehensive and detailed description of the present invention. However, the present invention has multiple implementations and is not limited to the specific examples listed herein. The presentation of these examples is intended to deepen the comprehensive understanding of the disclosure of the present invention.
[0058] A ground current prediction method based on a spatiotemporal attention mechanism, the method comprising the following steps:
[0059] Step 1: Construct a grounding current dataset, and perform training and testing on the grounding current dataset; perform training and testing on the grounding current dataset collected from a 220kV substation in northern my country. Considering that the grounding current collection process is easily affected by sensor anomalies, transmission equipment anomalies, etc., and data jumps and anomalies occur, the quartile method is used to detect and remove abnormal data, and the missing values are filled with the regional mean filling method, resulting in 6,000 data items. It covers time series data under the influence of multiple factors, providing data support for subsequent model training. Some data from different grounding points are as follows: Figure 2 As shown;
[0060] Step 2: Construct an SPTFormer deep learning model including an optimal frequency domain decomposition module, an Encoder module, and a Decoder module; the prediction of ground current belongs to a multivariate time series association, that is, in addition to considering the dependency of the time series time dimension, it is also necessary to consider the dependency between different variables. The traditional attention mechanism is difficult to effectively capture the dependency between different variables. The present invention is based on the Autoformer model, and improves its attention mechanism and backbone network, so that it can be well applied to multivariate prediction tasks.
[0061] Furthermore, the step 2 constructs an SPTFormer deep learning model including an optimal frequency domain decomposition module, an Encoder module, and a Decoder module; wherein:
[0062] Optimal frequency domain decomposition module: obtains high- and low-frequency component data containing different component features to enhance the features of time series data;
[0063] Encoder module: First, the local features of time series data are extracted through data slicing and embedding modules, and then the dependency between the time dimension and variable dimension of time series data is captured through the spatiotemporal attention mechanism to improve the feature extraction capability of the model;
[0064] Decoder module: Aggregates the data features obtained by the Encoder module through the spatiotemporal cross attention mechanism, and superimposes them to obtain the predicted grounding current values at different grounding points;
[0065] The specific operation of the optimal frequency domain decomposition module in step 2 is:
[0066] S2.1: If Figure 3 As shown, the input time series X is decomposed into low-frequency component data Z by the optimal frequency domain decomposition module. low and high frequency component data Z high ;
[0067] In the optimal frequency domain decomposition module, the input time series X is first subjected to Fourier transform to obtain the frequency domain value F, and then different time domain component data are mapped by selecting different frequency domain demarcation points f. The specific calculation process is as follows:
[0068] F=FFT(X)
[0069]
[0070] Among them, FFT stands for fast Fourier transform, F is the frequency domain sequence obtained after Fourier transform; iFFT is the inverse Fourier transform, They represent the low-frequency time domain component and high-frequency time domain component at the dividing point f respectively. [:f] means slicing the frequency domain sequence F, starting from the first element and ending at the f-th element of the sequence. [f+1:] means slicing the frequency domain sequence F, starting from the f+1-th element of the sequence and ending at the end of the sequence.
[0071] S2.2: The difference in the high- and low-frequency dividing points f directly affects the similarity between the obtained component data and the original data. The present invention uses the Pearson correlation coefficient to measure the correlation between different component data and the original data. The optimal dividing point between high and low frequencies is obtained by minimizing the difference in the correlation coefficients between the high and low frequency components and the original data. By selecting the optimal dividing point, it can ensure that the low-frequency component is fully utilized, and at the same time, it can also avoid the situation where the low-frequency component accounts for too small a proportion, resulting in the high-frequency component being too random and difficult to predict. The formula for minimizing the objective function is defined as:
[0072] O=argmin|L f -H f |
[0073] In the above formula, L f , H f They represent the correlation coefficient between the low-frequency component and the original data, and the correlation coefficient between the high-frequency component and the original data at the dividing point f respectively; O is the objective function value. When the objective function reaches the minimum value, the correlation coefficient between the low-frequency component and the original data, and the correlation coefficient between the high-frequency component and the original data reach the best balance.
[0074] The specific operation of the Encoder module in step 2 is:
[0075] S2.3: High frequency component data Z high and low frequency component data Z low After the best frequency domain decomposition module features are enhanced, the data slicing and embedding module in the Encoder module is entered. Its specific structure is as follows: Figure 4 First, the component data is extended to ensure that the length of the sequence after segmentation is consistent; then the extended data is sliced to obtain sliced data of the same length; finally, the segmented sequence is value-embedded and position-embedded, and stacked to obtain the embedded vector e out ; S2.3: high frequency component data Z high and low frequency component data Z low After the feature enhancement of the optimal frequency domain decomposition module, the data enters the data slicing and embedding module in the Encoder module. First, the component data is extended to ensure that the sequence length after segmentation is consistent; then the extended data is sliced to obtain sliced data of the same length; finally, the segmented sequence is value-embedded and position-embedded, and stacked to obtain the embedded vector e out , the specific calculation process is as follows:
[0076]
[0077] In the above formula, Z d represents the input sequence of the dth dimension, represents the slicing result of the i-th sequence block in the d-th dimension, unfold represents slicing the sequence, padding represents extending the sequence, L represents the total length of the sequence, L s represents the segment length, D represents the total dimension of the variable, valueEmbedding represents value embedding, and positionEmbedding represents position embedding;
[0078] S2.4: If Figure 5 As shown on the left, when the embedded vector e out After multi-head mapping in the time dimension, we get the query matrix Q t , key matrix K t , value matrix V t , the specific calculation process is as follows:
[0079]
[0080] In the above formula, d k represents the model depth, n is the number of attention heads;
[0081] S2.5: Then calculate the query matrix Qt Instead of translating the lagged sequence key matrix K backward by τ time points t The autocorrelation coefficient between Next, we obtain the k translation lengths with the largest autocorrelation coefficients, and use softmax normalization to obtain the attention weights S between sequences under different translation lengths. j ; Finally, based on the k translation lengths obtained, vector V t Shift backward and multiply it by its attention weight to obtain the time dimension feature Z after delayed aggregation time , the specific calculation process is as follows:
[0082]
[0083] In the above formula, FFT * represents performing FFT on the input vector and then finding its conjugate vector; argTopk represents obtaining the k maximum translation lengths; Roll is the operation of shifting the input sequence backward, and j∈[0,k] represents the jth translation length.
[0084] S2.6: If Figure 5 As shown on the right, the embedded vector e out First, through the variable dimension multi-head mapping, the query matrix Q corresponding to the input vector is obtained d , key matrix K d Sum value matrix V d ; Then the query matrix Q d With the key matrix K d Perform dot product operation to obtain the attention weight score A between variables, and normalize it with the value matrix V after softmax activation function normalization. d Perform product operation to obtain the high-dimensional feature Z of the variable dimension dim , the specific calculation process is as follows:
[0085]
[0086] In the formula, Indicates taking the square root of the dimension value d, which is used to normalize the vector;
[0087] S2.7: After obtaining the time dimension feature Z of the input vector time and high-dimensional features Z of variable dimensions dim After that, the vector Z dim Transform the dimension with vector Z time Dimensions are aligned, then with Z dim Directly concatenate, then pass through a linear projection layer and softmax function, and get the weight distributions h1 and h2 corresponding to the two attention modules. Based on this distribution, we get the output result X of the spatiotemporal attention mechanism. attThe specific calculation process is as follows:
[0088] G=M·Concat(Z dim ,Z time )+b
[0089] h1,h2=softmax(G)
[0090] X att =Concat(h1×Z dim , h2×Z time )
[0091] In the formula, M and b represent weight matrices, G represents the features obtained by the linear projection layer, and Concat represents the vector concatenation operation.
[0092] The specific operation of the Decoder module in step 2 is:
[0093] S2.8: The input of the decoder is a random number matrix with the same shape as the prediction target. After the decoder module is initialized, it first passes through the data slicing and embedding module to obtain sequence blocks in different time regions, and then passes through the spatiotemporal attention module to extract the time dimension features of the data and learn the correlation relationship between the variable dimensions;
[0094] S2.9: The spatiotemporal features learned by the encoder module and the features learned by the spatiotemporal attention in the decoder module are integrated through the spatiotemporal cross attention module. At the same time, the time dimension feature law and the variable dimension correlation relationship are used for reasoning. After a fully connected layer, the prediction sequences of different components are obtained and added to get the final prediction result.
[0095] Step 3: Model training and reasoning: Training and testing based on the constructed SPTFormer deep learning model to predict the grounding current at different grounding points;
[0096] The predicted results of grounding point a and grounding point b are as follows Figure 6 , 7 As shown in the figure, through analysis, it can be seen that the model can better predict the future trend changes of ground current.
[0097] Step 4: Analysis of ground current prediction results.
[0098] As shown in Table 1, the performance of the method SPTFormer in the present invention is compared with other mainstream time series prediction methods in ground current prediction tasks of different lengths. It can be found that the prediction performance of the SPTFormer method in the present invention is significantly better than other comparison methods. Compared with the FEDformer model, the mean square error MSE is reduced by an average of 4.7% and the mean absolute error MAE is reduced by an average of 6.2%.
[0099] Table 1. Experimental results of ground current dataset model comparison
[0100]
[0101] As shown in Table 2, the actual gains of the model prediction performance of the optimal frequency domain decomposition module, data slicing and embedding module, and spatiotemporal attention module are compared. The control variable method is used in the experiment to verify the gain effect of each module. The experimental results show that compared with the optimal frequency domain decomposition module and data slicing and embedding module, the spatiotemporal attention mechanism has the greatest effect on improving the model prediction performance. This is because for multivariate prediction tasks, the spatiotemporal attention mechanism can better extract the implicit correlation information between the time dimension and the variable dimension of the time series data.
[0102] Table 2 Ablation experiment
[0103]
[0104] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technical personnel in the field, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.
Claims
1. A ground current prediction method based on spatiotemporal attention mechanism, characterized in that: The method comprises the following steps: Step 1: Build a ground current dataset, and perform training and testing on the ground current dataset; Step 2: Build the SPTFormer deep learning model including the optimal frequency domain decomposition module, Encoder module, and Decoder module; Step 3: Model training and reasoning: Training and testing based on the constructed SPTFormer deep learning model to predict the grounding current at different grounding points; Step 4: Analysis of ground current prediction results.
2. According to claim 1, a ground current prediction method based on spatiotemporal attention mechanism is characterized in that: The step 2 constructs an SPTFormer deep learning model including an optimal frequency domain decomposition module, an Encoder module, and a Decoder module; wherein: Optimal frequency domain decomposition module: obtains high- and low-frequency component data containing different component features to enhance the features of time series data; Encoder module: First, the local features of time series data are extracted through data slicing and embedding modules, and then the dependency between the time dimension and variable dimension of time series data is captured through the spatiotemporal attention mechanism to improve the feature extraction capability of the model; Decoder module: Aggregates the data features obtained by the Encoder module through the spatiotemporal cross attention mechanism, and superimposes them to obtain the predicted grounding current values at different grounding points.
3. A ground current prediction method based on spatiotemporal attention mechanism according to claim 2, characterized in that: Step 2: Construct an SPTFormer deep learning model including the optimal frequency domain decomposition module, Encoder module, and Decoder module. The specific operations of the optimal frequency domain decomposition module are as follows: S2.1: The input time series X is decomposed into low-frequency component data Z by the optimal frequency domain decomposition module low and high frequency component data Z high ; In the optimal frequency domain decomposition module, the input time series X is first subjected to Fourier transform to obtain the frequency domain value F, and then different time domain component data are mapped by selecting different frequency domain demarcation points f. The specific calculation process is as follows: F=FFT(X) Z Lf =iFFT(F[:f]) Z Hf =iFFT(F[f+1:]) Among them, FFT stands for fast Fourier transform, F is the frequency domain sequence obtained after Fourier transform; iFFT is the inverse Fourier transform, Z Lf , Z Hf They represent the low-frequency time domain component and the high-frequency time domain component at the dividing point f, respectively. [:f] means slicing the frequency domain sequence F, starting from the first element and ending at the f-th element of the sequence. [f+1:] means slicing the frequency domain sequence F, starting from the f+1-th element and ending at the end of the sequence. S2.2: The optimal dividing point between high and low frequencies is obtained by minimizing the difference between the correlation coefficients of high and low frequency components and the original data; the formula for minimizing the objective function is defined as: O=argmin|L f -H f In the above formula, L f , H f They represent the correlation coefficient between the low-frequency component and the original data, and the correlation coefficient between the high-frequency component and the original data at the dividing point f respectively; O is the objective function value. When the objective function reaches the minimum value, the correlation coefficient between the low-frequency component and the original data, and the correlation coefficient between the high-frequency component and the original data reach the best balance.
4. A ground current prediction method based on spatiotemporal attention mechanism according to claim 3, characterized in that: Step 2: construct an SPTFormer deep learning model including an optimal frequency domain decomposition module, an Encoder module, and a Decoder module, wherein the specific operation of the Encoder module is as follows: S2.3: High frequency component data Z high and low frequency component data Z low After the feature enhancement of the optimal frequency domain decomposition module, the data enters the data slicing and embedding module in the Encoder module. First, the component data is extended to ensure that the sequence length after segmentation is consistent; then the extended data is sliced to obtain sliced data of the same length; finally, the segmented sequence is value-embedded and position-embedded, and stacked to obtain the embedded vector e out , the specific calculation process is as follows: In the above formula, Z d represents the input sequence of the dth dimension, represents the slicing result of the i-th sequence block in the d-th dimension, unfold represents slicing the sequence, padding represents extending the sequence, L represents the total length of the sequence, L s represents the segment length, D represents the total dimension of the variable, valueEmbedding represents value embedding, and positionEmbedding represents position embedding; S2.4: When the embedded vector e out After multi-head mapping in the time dimension, we get the query matrix Q t , key matrix K t , value matrix V t , the specific calculation process is as follows: In the above formula, d k represents the model depth, n is the number of attention heads; S2.5: Then calculate the query matrix Q t Instead of translating the lagged sequence key matrix K backward by τ time points t The autocorrelation coefficient between Next, we obtain the k translation lengths with the largest autocorrelation coefficients, and use softmax normalization to obtain the attention weights S between sequences under different translation lengths. j ; Finally, based on the k translation lengths obtained, vector V t Shift backward and multiply it by its attention weight to obtain the time dimension feature Z after delayed aggregation time , the specific calculation process is as follows: In the above formula, FFT * The representative represents that the input vector is first FFTed and then its conjugate vector is calculated; argTopk Indicates obtaining k maximum translation lengths; Roll is the operation of shifting the input sequence backward; j∈[0,k] indicates the jth translation length; S2.6: When the embedded vector e out After variable dimension multi-head mapping, the query matrix Q corresponding to the input vector is obtained d , key matrix K d Sum value matrix V d ; Then the query matrix Q d With the key matrix K d Perform dot product operation to obtain the attention weight score A between variables, and normalize it with the value matrix V after softmax activation function normalization. d Perform product operation to obtain the high-dimensional feature Z of the variable dimension dim , the specific calculation process is as follows: In the formula, Indicates taking the square root of the dimension value d, which is used to normalize the vector; S2.7: After obtaining the time dimension feature Z of the input vector time and high-dimensional features Z of variable dimensions dim After that, for the vector Z dim Transform the dimension with vector Z time Dimensions are aligned, then with Z dim Directly concatenate, then pass through a linear projection layer and softmax function, and get the weight distributions h1 and h2 corresponding to the two attention modules. Based on this distribution, we get the output result X of the spatiotemporal attention mechanism. att ; The specific calculation process is as follows: G=M·Concat(Z dim ,Z time )+b h1,h2=softmax(G) X att =Concat(h1×Z dim ,h2×Z time ) In the formula, M and b represent weight matrices, G represents the features obtained by the linear projection layer, and Concat represents the vector concatenation operation.
5. A ground current prediction method based on spatiotemporal attention mechanism according to claim 4, characterized in that: Step 2: construct an SPTFormer deep learning model including an optimal frequency domain decomposition module, an Encoder module, and a Decoder module, wherein the specific operation of the Decoder module is as follows: S2.8: After the decoder module is initialized, it first passes through the data slicing and embedding module to obtain sequence blocks in different time regions, and then passes through the spatiotemporal attention module to extract the time dimension features of the data and learn the correlation relationship between the variable dimensions; S2.9: The time series features learned by the Encoder module and the features learned by the time and space attention module in the Decoder are integrated through the time and space cross attention module. At the same time, reasoning is performed using the time dimension feature rules and the variable dimension correlation relationship. After a fully connected layer, the prediction sequences of different components are obtained and added together to obtain the final prediction result.
Citation Information
Patent Citations
Deep foundation pit deformation displacement prediction method based on VMD-FEDform network
CN117932429A
Current load decomposition method based on time sequence deep analysis
CN118094139A
Photovoltaic power generation power prediction method based on multivariable time sequence decomposition and multiple models
CN118657243A
Cited By
Power equipment fault diagnosis method based on multi-dimensional feature attention enhancement
CN119622318A