Power action detection method and system based on time sequence causality and electronic equipment
By employing bidirectional causal scanning and masked attention mechanisms in power timing action detection, causality is explicitly modeled, solving the positioning error problem caused by ignoring causality and achieving higher detection accuracy.
Patent Information
- Application Number
- CN202511199208.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-11-21
AI Technical Summary
Existing power timing action detection methods fail to fully consider the causality of action boundaries, leading to positioning errors and affecting detection accuracy.
By employing bidirectional causal scanning and masked attention mechanisms, causality in videos is explicitly modeled. By constructing a temporal causal model, forward and backward sequence dependency information is distinguished and fused to improve the accuracy of action category recognition and start-end boundary localization.
It effectively improves the accuracy of class identification and start/end boundary positioning of power operation actions, solves the positioning deviation problem caused by causal neglect, and achieves higher detection accuracy.
Smart Images

Figure CN120997738A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent safety monitoring of power systems, and particularly relates to a method, system and electronic equipment for detecting power actions based on time-series causality. Background Technology
[0002] Temporal Action Detection (TAD) is an important task in the fields of computer vision and video understanding. It aims to automatically identify and locate the time range (i.e., the start and end boundaries of the action) of specific actions in unedited long videos, and simultaneously determine the action category. This technology has significant application value in scenarios such as power safety production monitoring.
[0003] However, existing network architectures typically treat past and future information equally when modeling temporal information, failing to fully consider the essential nature of action boundary changes—that is, their "causality." For example, the existing technology ActionFormer uses a bidirectional self-attention mechanism to model past and future information of video sequences without distinction (i.e., the current moment can simultaneously focus on past and future frames), leading to positioning errors in power operation actions (such as the sequential dependence from 'climbing' to 'hanging the grounding wire') due to neglecting the causality of action boundaries.
[0004] Specifically, the temporal evolution of actions essentially follows the causal law of "the past influencing the future," but existing methods do not adequately model this temporal causal relationship, which has become a key factor restricting the improvement of detection accuracy. Summary of the Invention
[0005] This application addresses the problem of positioning deviation caused by ignoring the causality of action boundaries in existing technologies. It proposes a power action detection method, system, and electronic device based on temporal causality. By using bidirectional causal scanning and masked attention to achieve explicit causal modeling, the method improves the accuracy of category recognition and start / end boundary positioning for power operation actions (such as voltage testing and grounding) in videos. This solves the positioning deviation problem caused by ignoring the causality of action boundaries in existing methods and achieves higher detection accuracy in power safety monitoring scenarios.
[0006] To achieve the above objectives, this application provides the following technical solution: a power action detection method based on temporal causality, comprising the following steps: constructing a feature sequence segmentation layer based on action categories and start-end boundaries in historical power operation videos; constructing a temporal causal model based on the output value of the feature sequence segmentation layer, combined with a causal structured state space and causal self-attention; inputting historical power equipment operation video data into the temporal causal model to obtain initial temporal feature data; calculating the initial temporal feature data according to the self-attention mechanism to obtain multi-scale temporal feature data; and obtaining power equipment operation detection results based on real-time power equipment operation video data and the multi-scale temporal feature data.
[0007] Optionally, the following steps are performed in the feature sequence segmentation layer: obtain the detection target based on the action category and start and end boundaries, and perform feature sequence segmentation of the power equipment operation video data based on the detection target.
[0008] Optionally, the temporal causal model includes: a local temporal information mapping layer, which performs hidden dimension mapping based on the feature sequence partitioning layer output values to obtain initial input features, and uses the initial input features as input to the causal structured state space module and the causal self-attention module.
[0009] Optionally, based on the output values of the feature sequence-divided layers, and combining the causal structured state space and causal self-attention, a temporal causal model is constructed, including: performing a fully connected mapping on the initial input features and performing a dimensionality increase operation to obtain video features; inputting the video features into the causal structured state space to obtain information-efficient feature data; and inputting the video features into the causal self-attention to obtain information-separated feature data. Both the causal structured state space and the causal self-attention are converter models.
[0010] Optionally, obtaining information-efficient feature data by inputting video features into a causal structured state space includes: projecting video features in both the forward and reverse directions, using shared state space parameters, and obtaining information-efficient feature data through bidirectional causal scanning.
[0011] Optionally, inputting video features into causal self-attention to obtain information separation feature data includes: separating the video features forward and / or backward according to the upper triangular and / or lower triangular mask matrix to obtain initial separation feature data; inputting the initial separation feature data into the projector to obtain information separation feature data.
[0012] Optionally, the initial time-series feature data obtained from historical power equipment operation video data based on the time-series causal model includes: performing splicing and fusion based on the channel dimension using efficient information feature data and information separation feature data; and performing dimensionality reduction and downsampling based on linear transformation to obtain the initial time-series feature data.
[0013] Optionally, calculating the initial temporal feature data based on the self-attention mechanism to obtain multi-scale temporal feature data includes: performing interpolation on the original upper-layer features in the initial temporal feature data according to the length of the original lower-layer features in the initial temporal feature data to obtain aligned upper and lower-layer features; inputting the aligned lower-layer features into a one-dimensional convolution to obtain a query vector; inputting the aligned upper-layer features into a one-dimensional convolution to split them into a key vector and a value vector; calculating the query vector, key vector, and value vector based on the attention matrix to obtain an attention weighting value; and obtaining multi-scale temporal feature data based on the original lower-layer features and the attention weighting value.
[0014] Another technical solution provided in this application is an electronic device, which includes a memory, a processor, and a battery module; the memory is used to store a program; the battery module is used to power the memory; and the processor is used to execute the program and implement the above-described time-series causality-based power action detection method when executing the program.
[0015] Another technical solution provided in this application is a computer-readable storage medium storing a computer program or instructions, which, when executed by a processing device, implements the above-described power action detection method based on time-series causality.
[0016] The beneficial effects of this application are as follows:
[0017] 1. By combining state-space modeling with causal self-attention mechanisms, we can effectively distinguish and integrate forward and backward sequence dependency information, and achieve in-depth mining of multi-scale temporal features.
[0018] 2. By employing bidirectional causal scanning and masked attention to achieve explicit causal modeling, the accuracy of category recognition and start / end boundary localization for power operation actions (such as voltage testing and grounding wire installation) in videos is improved, effectively enhancing the accuracy of action localization in complex scenarios. This solves the localization bias problem caused by neglecting the causality of action boundaries in existing methods, achieving higher detection accuracy in power safety monitoring scenarios. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the overall framework of a power timing action detection method based on causal timing modeling in one embodiment of this application.
[0020] Figure 2 This is a schematic diagram of the overall framework of a power timing action detection method based on causal timing modeling in one embodiment of this application.
[0021] Figure 3 This is a schematic diagram of a hybrid causal computation unit according to one embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description of this application is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely one preferred embodiment of this application and are only used to explain this application. They do not limit the scope of protection of this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] Example 1:
[0024] like Figure 1-3 As shown, a power action detection method based on time-series causality includes the following steps:
[0025] A feature sequence segmentation layer is constructed based on action categories and start / end boundaries in historical power operation videos. The start / end boundaries are represented as {s}. i ,e i ,a i};s i e is the start time of the action. i a is the end time of the action. i Action category;
[0026] Based on the output values of the feature sequence-divided layers, and combined with the causal structured state space and causal self-attention, a temporal causal model is constructed.
[0027] Historical video data of power equipment operation is input into a time-series causal model to obtain initial time-series feature data;
[0028] Initial temporal feature data is calculated based on the self-attention mechanism to obtain multi-scale temporal feature data;
[0029] The power equipment operation detection results are obtained based on real-time power equipment operation video data and multi-scale time series feature data.
[0030] The following steps are performed in the feature sequence segmentation layer: Detection targets are obtained based on action categories and start / end boundaries; feature sequence segmentation of the power equipment operation video data is then performed based on the detection targets. Specifically, the unedited video is divided into T consecutive non-overlapping video segments, each containing several video frames. These video segments are then fed into a pre-trained video feature extractor to construct the feature sequence segmentation layer, as shown in Formula 1 below:
[0031]
[0032] Where B is the batch size, L is the sequence length, and D is the sequence number. 0For the feature dimension, pre-trained video feature extractors include I3D or VideoMAE V2.
[0033] The temporal causal model includes a local temporal information mapping layer. This layer performs hidden dimension mapping based on the output value of the feature sequence partitioning layer to obtain initial input features. These initial input features are then used as input to the causal structured state space module and the causal self-attention module. Specifically, the extracted feature sequence partitioning layer is fed into a short-time convolutional module to complete the local modeling of temporal information, improve the sensitivity of the feature sequence to micro-temporal changes, and map the dimension of the feature sequence to the hidden dimension to obtain the initial input features, as shown in Formula 2 below.
[0034] X input =LeanerProj_Init(X 0 )∈R B×L×D (formula)(2);
[0035] Among them, LeanerProj_Init is a fully connected layer with an input dimension of D. 0 The output dimension is D.
[0036] Based on the output values of the feature sequence-divided layers, and combining the causal structured state space and causal self-attention, a temporal causal model is constructed, including: performing a fully connected mapping on the initial input features and performing a dimensionality increase operation to obtain video features; inputting the video features into the causal structured state space model and the causal self-attention module respectively to obtain causal modeling feature data. The causal structured state space is based on a state space model, and the causal self-attention is based on a Transformer. Specifically, the hybrid causal computation unit performs a dimensionality increase operation on the initial input features, then feeds the video features into the causal structured state space module and the causal self-attention block respectively, concatenates the output features of both in the channel dimension, and restores the original feature dimension through a linear transformation. Finally, a downsampling operation is performed on the features to obtain the temporal causal model.
[0037] Specifically, in the step of performing dimensionality upscaling based on the initial input features and obtaining the dimensionality-upgraded video feature sequence using the hybrid causal computation unit, a fully connected mapping is first performed on the initial input features to perform the dimensionality upscaling operation, as shown in Formula 3 below:
[0038] X' = LeanerProj_Up(X input )∈R B×L×4D (formula)(3);
[0039] Here, LeanerProj_Up is a fully connected layer with an input dimension of D and an output dimension of 4D; then, the upgraded features are divided into F... ssm-forward F ssm-backwardF attention-forward F attention-backward ∈R B×L×D After that, regarding F ssm-backward With F attention-backward Perform a flip operation along the time dimension; the final result is: F ssm-forward F ssm-backward To extract the temporal features of the forward and backward scans using a causal structured state-space module, F attention-forward F attention-backward Temporal features for forward and backward modeling using a causal self-attention module.
[0040] Furthermore, regarding the "directivity" of the sequence of actions and boundary changes in power operation scenarios, causal modeling feature data includes information-efficient feature data and information-separated feature data. The causal modeling feature data is obtained by inputting video features into a causal structured state-space model and a causal self-attention module. This includes projecting video features in both the forward and reverse directions using shared state-space parameters, and obtaining information-efficient feature data through bidirectional causal scanning. The causal structured state-space module refers to a module that uses a parallel scanning mechanism and a data-driven selective state-space layer to perform causal relationship feature mapping in both the forward (past → future) and reverse (future → past) directions of the input sequence.
[0041] The specific operation process is as follows: First, set F ssm-forward F ssm-backward The data is fed into the causal structured state space module, and parallel scanning is completed through a data-driven selective state space layer; F... attention-forward F attention-backward The causal self-attention block is fed in, and an attention mask matrix is constructed to achieve the separation modeling of past and future information, as shown in Formula 4 below:
[0042]
[0043] Among them, M ij The attention mask matrix is implemented using a typical lower triangular causal mask, which ensures that the features at position i can only focus on the features at the current position i and any position j to its left.
[0044] Furthermore, the video features are input into the causal structured state space model and the causal self-attention module respectively to obtain causal modeling feature data. This includes: separating the video features forward and / or backward according to the upper triangular and / or lower triangular mask matrices to obtain initial separated feature data; and inputting the initial separated feature data into the projector to obtain information separated feature data. The causal self-attention module only allows attention to itself and the content before (or after) this moment at the current time, achieving information separation modeling of the past and future. The specific operation process is as follows: first, the causal modeled F... ssm-backward With F attention-backward Perform the flip operation again in the time dimension, and with F ssm-forward F attention-forward The causal modeling feature F′ is obtained by concatenating the feature dimensions. causal ∈R B×L×4D Then, a dimensionality reduction operation is performed to obtain the features, as shown in Formula 5 below:
[0045] F causal =LeanerProj_Down(F′ causal )∈R B×L×D (formula)(5);
[0046] The LeanerProj_Down layer is a fully connected layer with an input dimension of 4D and an output dimension of D. This causal self-attention module sets separate input projectors for the forward and backward modeling directions, further enhancing the model's ability to distinguish different behavior patterns. At the same time, it shares the parameters used to generate the Q, K, and V matrices, enhancing generalization ability and reducing the risk of overfitting in small sample scenarios.
[0047] Furthermore, the initial temporal feature data obtained from historical power equipment operation video data based on the temporal causal model includes: performing splicing and fusion of information-efficient feature data and information-separated feature data based on the channel dimension; and performing dimensionality reduction and downsampling based on linear transformation to obtain the initial temporal feature data. Specifically, the features obtained through dimensionality reduction are then downsampled to obtain the input to the next layer of hybrid causal computation unit, as shown in Formula 6 below:
[0048]
[0049] In this configuration, `DownSample` is a one-dimensional convolution with a stride of 2 and a kernel size of 3. Finally, the above operations are repeated to obtain the initial temporal feature data. This achieves the information transfer between upper-level abstract features and lower-level detailed features.
[0050] The initial temporal feature data is calculated based on the self-attention mechanism to obtain multi-scale temporal feature data. This includes interpolating the original upper-layer features in the initial temporal feature data according to the length of the original lower-layer features in the initial temporal feature data to obtain aligned upper and lower-layer features; inputting the aligned lower-layer features into a one-dimensional convolution to obtain a query vector; inputting the aligned upper-layer features into a one-dimensional convolution to split them into key vectors and value vectors; calculating the query vector, key vector, and value vector based on the attention matrix to obtain an attention weight value; and obtaining multi-scale temporal feature data based on the original lower-layer features and the attention weight value. Specifically, the initial temporal feature data in the temporal causal model is fed into a multi-scale temporal feature enhancement module based on the self-attention mechanism. This module uses the attention mechanism to calculate the correlation weights between features, realizing the information transfer from upper-layer abstract features to lower-layer detailed features. The upper-to-lower-layer fusion process is as follows: the upper-layer features are interpolated and aligned to the lower-layer time scale, as shown in Formula 7 below.
[0051] X u2d =Interpolate(X) u size = length(X) d )) (Formula)(7)
[0052] Where Interpolate is the interpolation operation, making the upper-layer feature X... u Based on the lower layer feature X d length(X) d Perform interpolation, using nearest neighbor interpolation. Input the lower-layer features into a one-dimensional convolution to generate a query vector, Q = Conv1D_Query(X). d ), where Conv1D_Query is a one-dimensional convolution with kernel_size=1, and the number of input and output feature channels is set to D; the aligned feature input is convolved into a one-dimensional convolution and split into a key vector and a value vector, as shown in Formula 8 below:
[0053] K,V = Split(Conv1D_KeyValue(X) u2d )) (Formula)(8)
[0054] Where Conv1D_KeyValue is a one-dimensional convolution with kernel_size=1, the number of input feature channels is set to D, and the number of output feature channels is set to 2D.
[0055] The attention matrix is calculated as shown in Formula 9 below:
[0056]
[0057] Where Softmax is the normalization operation, A is the attention score matrix, Q and K are the key vectors and value vectors generated in the previous step, and D is the number of feature channels in the key-value vectors. Then, the lower-level features are updated from top to bottom, as shown in Equation 10 below:
[0058] X d′ =LayerNorm(X d +A·V)(Formula)(10) where LayerNorm performs layer normalization on the fused features to stabilize the feature distribution. Where X d′ The updated lower-layer features then act as upper-layer features in the next fusion process; the layer normalization function LayerNorm is implemented using standard PyTorch functions; X d The original lower-level features; V is the value vector generated in the previous steps; A·V is the weighted sum of the value vector V through the attention matrix A, which is used for the lower-level features X. d The updated part. The final result is multi-scale temporal feature data.
[0059] Multi-scale temporal feature data is fed into a multi-layer temporal convolutional classification and regression head to achieve action category discrimination and boundary position regression. Appropriate classification and regression loss functions are then set to train the model. The total loss function is defined as shown in Equation 11 below:
[0060] L total =λ cls L cls +λ reg L reg (formula)(11)
[0061] Among them, L cls For classification loss, Focal Loss is used to address the class imbalance problem. reg For bounding box loss, possible loss implementations include DIoU loss, λ cls and λ reg These are the weights for the bounding box loss and the classification loss, respectively.
[0062] Example 2:
[0063] As shown in Table 1, to verify the beneficial effects of this application, scientific demonstration was conducted through economic benefit calculations and simulation experiments. This embodiment conducted experiments on both existing traditional methods and the method of this embodiment. This embodiment selected a time-series action detection dataset for power operation scenarios. This dataset focuses on typical operational behaviors during power outage operations on utility poles, covering five key actions: voltage testing, grounding wire installation, grounding wire removal, climbing, and pole removal. The dataset contains 3,104 unedited original power operation site videos, along with complete annotation information. The average action duration is 59.08 seconds. The sample size and average duration for each type are as follows: climbing 3260 segments (56.22 seconds), pole removal 2827 segments (49.92 seconds), voltage testing 1432 segments (21.12 seconds, shortest), grounding wire installation 789 segments (110.49 seconds, longest), and grounding wire removal 1452 segments (81.61 seconds). Overall, the samples for climbing and descending poles were the most abundant, while the samples for attaching ground wires were relatively scarce. In terms of duration, the durations for attaching and removing ground wires were significantly longer than the overall average, while the durations for voltage detection were significantly shorter than the average. Specifically, the training set contained 2,787 video segments, and the test set contained 317 video segments, which can provide data support for research on related temporal action detection technologies.
[0064] In terms of comparison models, advanced temporal action detection algorithms in recent years were selected as the comparison baseline. To ensure that the model parameters do not become a bottleneck restricting the model's capabilities, in addition to following the model's default settings, the width and height of the model were scaled to ensure that the number of parameters of these advanced temporal action detection algorithms is consistent with the number of parameters of the model proposed in this invention, and the algorithm performance is reported together.
[0065] The proposed model configuration is as follows:
[0066] 1. The pre-trained video feature extractor uses VideoMAE V2;
[0067] 2. The upper bound of the weighting function is set to 5, the curvature is set to 0.4, and the number of discrete intervals is N. bin Set to 64, encoder layer number N encoder Set to 3, decoder layer number N decoder Set to 5, N is the number of one-dimensional convolutional layers for local feature modeling. embed Set to 3, N is the number of one-dimensional convolutional layers constructed from multi-scale features. branch Set to 4;
[0068] 3. The initial learning rate used during training is 1×10⁻⁶. -4 The Adam optimizer optimizes the model with a weight decay coefficient of 0.05.
[0069] This application uses the mAP (mean Average Precision) metric to evaluate model performance. mAP is a widely used evaluation standard in the field of temporal action detection, comprehensively reflecting the model's detection accuracy and recall across various action categories. Specifically, for each action category in the test set, the mean precision (AP) is first calculated, which is the area under the precision-recall curves at different confidence thresholds. Then, the arithmetic mean of the mean precision (AP) for all categories is taken to obtain the mAP metric. This metric effectively evaluates the model's overall performance in multi-class detection tasks, balancing accuracy and detection capability, and has strong representativeness. This application's performance evaluation based on the mAP metric comprehensively and objectively reflects the effectiveness of the proposed method in temporal action detection scenarios.
[0070] In a time-series action detection dataset for power operation scenarios, the model proposed in this application achieves a significantly higher mAP compared to state-of-the-art methods, indicating that the proposed model can obtain more accurate time-series action detection results. Furthermore, adjusting the number of parameters in the comparison models did not yield better results, proving that the number of parameters in the original comparison models is sufficient to support their respective maximum modeling capabilities.
[0071] Table 1: mAP of the model:
[0072]
[0073]
[0074] The results show that, through validation using a time-series action detection dataset for power operation scenarios, the mAP results of the model proposed in this application are superior to other models, proving that the model can obtain more accurate time-series action behavior detection results.
[0075] Example 3:
[0076] An electronic device includes a memory, a processor, and a battery module; the memory stores a program; the battery module powers the memory; the processor executes the program and, during program execution, implements the time-series causality-based power action detection method described above. The electronic device can be a personal computer, server, or network device, etc., and the memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0077] Example 4:
[0078] A computer-readable storage medium is provided for storing a computer program or instructions that, when executed by a processing device, implement the aforementioned time-series causality-based power action detection method. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives), etc. Similarly, in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0079] The above-described specific embodiments are preferred embodiments of a power action detection method, system, and electronic device based on time-series causality according to this application, and are not intended to limit the specific scope of this application. The scope of this application includes but is not limited to the specific embodiments described above. All equivalent changes made in accordance with the shape and structure of this application are within the protection scope of this application.
Claims
1. A method for detecting electrical actions based on time-series causality, characterized in that, Includes the following steps: A feature sequence segmentation layer is constructed based on the action categories and start and end boundaries in historical power operation videos; Based on the output values of the feature sequence partitioning layer, and combined with the causal structured state space and causal self-attention, a temporal causal model is constructed. Historical video data of power equipment operation is input into the time-series causal model to obtain initial time-series feature data; The initial temporal feature data is calculated based on the self-attention mechanism to obtain multi-scale temporal feature data; The power equipment operation detection results are obtained based on real-time power equipment operation video data and the multi-scale time-series feature data.
2. The power action detection method based on time-series causality according to claim 1, characterized in that, The following steps are performed in the feature sequence partitioning layer: The detection target is obtained based on the action category and start and end boundaries; Based on the detection target, feature sequence segmentation of the power equipment operation video data is performed.
3. The power action detection method based on time-series causality according to claim 1, characterized in that, The time-series causal model includes: The local temporal information mapping layer performs hidden dimension mapping based on the feature sequence division layer output value to obtain initial input features, which are then used as inputs to the causal structured state space module and the causal self-attention module.
4. The power action detection method based on time-series causality according to claim 3, characterized in that, The step of constructing a temporal causal model by dividing the layer based on the feature sequence output value, combining the causal structured state space and causal self-attention, includes: Perform a fully connected mapping on the initial input features and perform a dimensionality increase operation to obtain video features; The video features are input into a causal structured state space to obtain information-efficient feature data; The video features are input into causal self-attention to obtain information separation feature data.
5. The power action detection method based on time-series causality according to claim 4, characterized in that, The step of inputting the video features into a causal structured state space to obtain efficient feature data includes: By projecting the video features in both the forward and reverse directions, using shared state-space parameters, and through bidirectional causal scanning, efficient feature data is obtained.
6. The power action detection method based on time-series causality according to claim 5, characterized in that, The step of inputting the video features into causal self-attention to obtain information separation feature data includes: Based on the upper triangular and / or lower triangular mask matrix, the video features are separated forward and / or backward to obtain initial separated feature data; The initial separation feature data is input into the projector to obtain information separation feature data.
7. The power action detection method based on time-series causality according to claim 6, characterized in that, The initial time-series feature data obtained based on the time-series causal model from historical power equipment operation video data includes: Based on the channel dimension, the information efficient feature data and the information separation feature data are spliced and fused together; The initial time-series feature data are obtained by performing dimensionality reduction and downsampling based on linear transformation.
8. The power action detection method based on time-series causality according to claim 1, characterized in that, The calculation of the initial temporal feature data based on the self-attention mechanism to obtain multi-scale temporal feature data includes: The original upper-layer features in the initial temporal feature data are interpolated according to the length of the original lower-layer features in the initial temporal feature data to obtain aligned upper and lower-layer features; The aligned lower-level features are input into a one-dimensional convolution to obtain the query vector; The aligned upper-layer features are input into a one-dimensional convolution to split them, resulting in key vectors and value vectors. The attention weighting value is obtained by calculating the query vector, key vector, and value vector based on the attention matrix. Multi-scale temporal feature data is obtained based on the original lower-level features and the attention weighting values.
9. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a battery module; The memory is used to store programs; The battery module is used to power the memory; The processor is configured to execute the program and, when executing the program, implement the power action detection method based on time-series causality as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program or instructions, which, when executed by a processing device, implement the power action detection method based on time-series causality as described in any one of claims 1-8.