A Method for Abnormal Behavior Detection and Fault Prediction of Electromechanical Equipment Based on Causal Spatiotemporal Transformer

By using a causal spatiotemporal Transformer model, combined with the causal graph and the self-attention mechanism of the Transformer model, the problem of difficulty in modeling causal relationships and spatiotemporal cross-scale fault propagation laws in anomaly detection of electromechanical equipment is solved, and efficient anomaly detection and fault prediction are achieved.

CN120705784BActive Publication Date: 2025-10-28中国水利水电第七工程局有限公司 +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511197144.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-10-28
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

Existing technologies for anomaly detection and fault prediction in electromechanical equipment are insufficient to effectively capture the causal relationships between equipment and the spatiotemporal cross-scale fault propagation patterns. Traditional methods suffer from high noise and difficulty in feature extraction when dealing with complex electromechanical systems, while deep learning methods have shortcomings in terms of sample imbalance and model interpretability.

Method used

A causal spatiotemporal Transformer-based approach is adopted. An initial causal graph is constructed and corrected based on historical operating data. The causal graph is introduced as prior information into the Transformer model. Fault prediction is performed by combining the spatiotemporal attention mechanism. Component-level anomaly identification is performed by utilizing the causal graph and the self-attention mechanism of the Transformer model.

Benefits of technology

It improves the accuracy of anomaly detection and the flexibility of fault prediction in electromechanical equipment, enabling timely response to equipment failures, reducing potential losses, and enhancing sensitivity to minor anomaly fluctuations and the ability to detect a few anomaly categories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705784B_ABST
    Figure CN120705784B_ABST
Patent Text Reader

Abstract

This invention discloses a method for detecting abnormal behavior and predicting faults in electromechanical equipment based on a causal spatiotemporal Transformer, belonging to the field of electromechanical equipment anomaly detection technology. The method includes: S1, constructing an initial causal graph based on the physical structure and causal relationships between functional components of the electromechanical equipment; S2, correcting the initial causal graph based on historical operating data of the electromechanical equipment to generate a new causal graph; S3, introducing the causal graph as prior information into a Transformer model, and using the trained Transformer model to predict sensor time-series data of the electromechanical equipment to be detected, outputting the corresponding high-dimensional feature representation; S4, calculating the anomaly weight of each component based on the high-dimensional feature representation, and performing component-level anomaly identification and fault prediction. This invention overcomes the limitations of traditional time-series model-based electromechanical equipment anomaly detection, which only fits data correlations while ignoring causal relationships. By integrating causal inference mechanisms and feature modeling, it achieves explicit modeling of the chain propagation mechanism of equipment faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electromechanical equipment anomaly detection technology, specifically involving a method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer. Background Technology

[0002] Existing technologies for anomaly detection and fault prediction in electromechanical equipment primarily rely on traditional signal processing and statistical models. These methods, including time-domain analysis, frequency-domain analysis, and threshold-based alarm mechanisms, can identify some abnormal behaviors. However, due to the complex dynamic characteristics and variable operating conditions of electromechanical systems, signal noise is high, and effective feature extraction is difficult. Traditional statistical models, such as ARIMA (Autoregressive Integral Moving Average), often perform poorly when processing non-stationary time-series signals because they cannot model long-range dependencies. Furthermore, current deep learning methods also face challenges when processing equipment monitoring data, such as imbalanced samples, poor model interpretability, and insufficient cross-device generalization ability.

[0003] To address these issues in the health management of electromechanical equipment, recent studies have attempted to utilize machine learning techniques such as convolutional neural networks (CNNs), long short-term memory networks (LSTMs), and isolated forests. However, these methods have limitations in capturing the causal relationships between equipment anomalies and failures, and they struggle to model the spatiotemporal cross-scale failure propagation patterns. Summary of the Invention

[0004] To address the aforementioned shortcomings in existing technologies, the present invention provides a method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer. This method overcomes the limitations of traditional time-series model-based electromechanical equipment anomaly detection, which only fits data correlations while ignoring causal relationships. By integrating causal reasoning mechanisms and feature modeling, it achieves explicit modeling of the chain propagation mechanism of equipment faults.

[0005] To achieve the aforementioned objectives, the present invention employs the following technical solution: a method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer, comprising the following steps:

[0006] S1. Construct an initial cause-effect graph based on the physical structure and causal relationships between functional components of electromechanical equipment;

[0007] S2. Based on the historical operating data of the electromechanical equipment, the initial cause-effect graph is corrected to generate a new cause-effect graph;

[0008] S3. Introduce the causal graph as prior information into the Transformer model, and use the trained Transformer model to predict the sensor time series data of the electromechanical equipment to be detected, and output the corresponding high-dimensional feature representation.

[0009] S4. Based on the high-dimensional feature representation, calculate the anomaly weight of each component, and perform component-level anomaly identification and fault prediction.

[0010] Furthermore, in step S1, in the initial causal graph A(V,E), node V represents the key mechanical component of the electromechanical equipment, and edge E represents the fault propagation path;

[0011] In the initial causal graph A(V,E), components To components edge weight for:

[0012]

[0013] For the implicit causal relationships in the initial causal graph A(V,E), the corresponding components To components Hidden edge weights for:

[0014]

[0015] In the formula, This represents the adjustment factor for the initial edge weights. This indicates the component identified based on historical operating data X. Existing data and components Existing data The actual strength of fault transmission, Each represents a component and components The existing data, Indicates components To components The initial edge weights, This represents the weight adjustment factor for the initial implicit edges. This indicates the component identified based on historical operating data X. Existing data and components Existing data The strength of the implicit causal relationship, Indicates components To components The initial implicit edge weights.

[0016] Furthermore, in step S2, based on the historical operating data of the electromechanical equipment, statistical methods are used to correct the edge weights in the initial causal graph, thereby obtaining the causal graph;

[0017] The statistical methods include Granger causality test, mutual information calculation, and partial correlation calculation.

[0018] Furthermore, in the causal diagram, the corrected component To components edge weight for:

[0019]

[0020] In the formula, Represents components in the initial causal graph To components edge weights, This represents the Granger causality weighting coefficient. Indicates components Existing data and components Existing data The control function for Granger causality is defined as follows: a value of 1 indicates the existence of Granger causality, and a value of 0 indicates the absence of Granger causality. This represents the mutual information weight adjustment coefficient. Indicates components Existing data and components Existing data mutual information, The weighted adjustment coefficient represents the partial correlation coefficient. Indicates components Existing data and components Existing data The partial correlation coefficient, Weighting adjustment coefficients representing implicit causal relationships. This indicates the component identified based on historical operating data X. Existing data and components Existing data The strength of the implicit causal relationship.

[0021] Furthermore, in step S3, the Transformer model's processing of the input sensor time-series data specifically involves:

[0022] S31. The sensor time-series data is mapped to a high-dimensional feature space through the embedding layer, and position encoding is introduced to obtain the initial input representation;

[0023] S32. In each layer of the multi-head self-attention mechanism, the initial input representation is mapped to a query vector, a key vector, and a value vector, respectively.

[0024] S33. Calculate attention weights based on query vector, key vector, and value vector, and calculate attention weights based on the mask matrix constructed from the causal graph;

[0025] S34. Based on attention weights, multiple attention heads are computed in parallel, concatenated, and output after linear mapping;

[0026] S35. Input the output after linear mapping into the feedforward neural network for processing, and output the corresponding high-dimensional feature representation through residual connections and layer normalization.

[0027] Furthermore, in step S33, attention weights for:

[0028]

[0029] In the formula, Represents the query vector. Represents the key vector. Represents a value vector. This represents a mask matrix constructed based on the causal graph, used to control the attention path. This represents the dimension of the key vector K. This represents element-wise multiplication. express Activation function.

[0030] Furthermore, the loss function of the Transformer model for:

[0031]

[0032] In the formula, This represents the actual annotation results. This represents the model output value. This represents the weighting factor adjusted based on sample imbalance. Represents a logarithmic function.

[0033] Furthermore, step S4 includes the following sub-steps:

[0034] S41. Normalize the high-dimensional feature representation output by the Transformer model;

[0035] The high-dimensional feature is represented as The matrix, where n represents the number of parts and m represents the feature dimension;

[0036] S42. Based on the normalized high-dimensional feature representation, calculate the anomaly score for each component. ;

[0037] S43. Response to Abnormal Scores After Z-score standardization, abnormal components are identified through binary judgment, and the propagation path of the abnormal component is determined by combining the cause-effect graph to extrapolate the scope of the fault impact, thereby realizing anomaly identification and fault prediction.

[0038] Furthermore, in step S42, the anomaly score for each component... for:

[0039]

[0040] In the formula, This represents the set of adjacent components associated with component i. This represents the corrected component in the cause-effect graph. To components edge weights, This represents the feature vector of component j. This function represents the calculation of the anomaly score for component j. , Represents norm calculation.

[0041] Furthermore, in step S43, the formula for determining the abnormal component is:

[0042]

[0043] In the formula, Indicates components The corresponding standardized outlier scores, This indicates that a threshold for judging abnormal components has been set. Indicates components Abnormal weights, when hour, Indicates components This is an abnormal component. hour, Indicates components This is a normal component;

[0044] When components When the component is faulty, the scope of its failure impact is as follows:

[0045]

[0046] In the formula, This represents the feature vector within the affected area of ​​the fault. This represents the matrix of causal relationships between components in a cause-effect graph.

[0047] The beneficial effects of this invention are as follows:

[0048] (1) In this invention, by combining time series data and causal graphs, the spatiotemporal Transformer can simultaneously handle dynamic changes and spatial dependencies in time series. This integration enables the model to fully capture the complexity of device operating states, thereby improving the accuracy of anomaly detection.

[0049] (2) In this invention, a causal masking mechanism is introduced in the attention calculation of the Transformer model to ensure that the model follows the causal relationship when processing time series data and avoids interference from future information on the current state. This mechanism enables the model to more realistically reflect the fault propagation process and improve the sensitivity to small abnormal fluctuations.

[0050] (3) In this invention, the self-attention mechanism of the Transformer model also allows the model to dynamically focus on important features in the input data. By calculating the high-dimensional feature representation of each component, it automatically identifies key factors related to abnormal states. This feature extraction capability enables the model to adapt to the operating modes of different devices and enhances the flexibility of fault prediction.

[0051] (4) In terms of abnormal weight calculation, based on the features extracted by the Transformer model, the abnormal weight of each mechanical component can be calculated in real time, and abnormal judgment can be made according to the set threshold. This real-time update capability enables the model to respond to equipment failures in a timely manner and reduce potential losses.

[0052] (5) The cross-entropy loss function is used to optimize the model in this invention, which can effectively handle imbalanced data and improve the detection capability of a few abnormal categories; through the backpropagation algorithm, the model continuously adjusts the parameters to further improve the accuracy of anomaly detection. Attached Figure Description

[0053] Figure 1 This invention provides a method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer. Detailed Implementation

[0054] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.

[0055] This invention, based on a model architecture that fuses causal graphs and spatiotemporal Transformers, aims to improve the detection of abnormal behavior and fault prediction capabilities of electromechanical equipment under complex operating conditions. Traditional equipment condition monitoring methods often rely on signal threshold settings or time series models, making it difficult to capture potential causal relationships between multiple components and fault propagation paths. Therefore, this invention introduces a fusion path of explicit modeling and a spatiotemporal attention mechanism during the modeling process; for example... Figure 1 As shown, the method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer in this invention is characterized by comprising the following steps:

[0056] S1. Construct an initial cause-effect graph based on the physical structure and causal relationships between functional components of electromechanical equipment;

[0057] S2. Based on the historical operating data of the electromechanical equipment, the initial cause-effect graph is corrected to generate a new cause-effect graph;

[0058] S3. Introduce the causal graph as prior information into the Transformer model, and use the trained Transformer model to predict the sensor time series data of the electromechanical equipment to be detected, and output the corresponding high-dimensional feature representation.

[0059] S4. Based on the high-dimensional feature representation, calculate the anomaly weight of each component, and perform component-level anomaly identification and fault prediction.

[0060] In step S1 of this embodiment of the invention, an initial causal graph is first defined based on the physical structure of the electromechanical equipment and the topological relationship between the functional components. In the initial causal graph A(V,E), node V represents the key mechanical components of the electromechanical equipment (such as spindle, bearing, cooling pump, winding, etc.), and edge E represents the fault propagation path (such as "bearing wear → increased vibration → increased motor temperature"). This initial causal graph reflects the understanding of the equipment operation logic at the design level, but it does not fully include all potential dynamic interaction relationships, especially in complex or aging equipment where there may be hidden causal paths.

[0061] In the initial causal graph A(V,E), components To components edge weight for:

[0062]

[0063] For the implicit causal relationships in the initial causal graph A(V,E), the corresponding components To components Hidden edge weights for:

[0064]

[0065] In the formula, This represents the adjustment factor for the initial edge weights. This indicates the component identified based on historical operating data X. Existing data and components Existing data The actual strength of fault transmission, Each represents a component and components The existing data, Indicates components To components The initial edge weights, This represents the weight adjustment factor for the initial implicit edges. This indicates the component identified based on historical operating data X. Existing data and components Existing data The strength of the implicit causal relationship, Indicates components To components The initial implicit edge weights.

[0066] In step S2 of this embodiment, in order to overcome the limitations of ideal physical connection, a data-driven causal inference mechanism is introduced. By collecting a large amount of historical operating data of electromechanical equipment under normal and abnormal conditions, statistical processing is performed on the data, and then the edge weights in the initial causal graph are corrected.

[0067] In this embodiment, based on the historical operating data of electromechanical equipment, statistical methods are used to correct the edge weights in the initial causal graph, thereby obtaining the causal graph; the statistical methods include Granger causality test, mutual information calculation, and partial correlation calculation.

[0068] In a specific example of this invention, an implicit causal relationship may exist in actual working conditions: "lubricating oil contamination → bearing overheating → motor failure." This relationship cannot be directly modeled through physical structure and needs to be mined from data. The resulting corrected causal graph has a structure that better reflects the actual operating logic of the equipment.

[0069] In this embodiment, in the initial causal graph A(V,E), the components To components edge weight It can be set using expert knowledge or physical models.

[0070] In this embodiment, the edge weights are corrected using the following statistical method:

[0071] Granger causality test: Determines whether one time series can successfully predict another time series.

[0072] Mutual information: used to measure the dependency between two random variables.

[0073] Partial correlation coefficient: used to measure the linear relationship between two variables when other variables are controlled for.

[0074] Furthermore, in actual operating conditions, there may be some implicit causal relationships, such as "lubricating oil contamination → bearing overheating → motor failure". To identify these implicit relationships, we can define an implicit causal graph. And its edge weights are expressed as:

[0075]

[0076] Where, Weighting adjustment coefficients representing implicit causal relationships. This indicates the component identified based on historical operating data X. Existing data and components Existing data The strength of the implicit causal relationship.

[0077] Based on the above correction method, the corrected edge weights in the causal graph... for:

[0078]

[0079] Where, Represents components in the initial causal graph To components edge weights, This represents the Granger causality weighting coefficient. Indicates components Existing data and components Existing data The control function for Granger causality is defined as follows: a value of 1 indicates the existence of Granger causality, and a value of 0 indicates the absence of Granger causality. This represents the mutual information weight adjustment coefficient. Indicates components Existing data and components Existing data mutual information, The weighted adjustment coefficient represents the partial correlation coefficient. Indicates components Existing data and components Existing data The partial correlation coefficient, Weighting adjustment coefficients representing implicit causal relationships. This indicates the component identified based on historical operating data X. Existing data and components Existing data The strength of the implicit causal relationship.

[0080] In step S3 of this embodiment, the modified causal graph is introduced as prior structural information into the Transformer model to jointly model the temporal sequence of the electromechanical equipment's sensing data. Specifically, the attention mechanism of the Transformer model... The adjacency matrix of the causal graph is introduced during the computation process to construct a causal mask attention mechanism. This mechanism calculates attention weights only between nodes with causal edges, thereby improving the modeling ability of fault propagation paths. This mechanism not only preserves the Transformer's strong representation ability of temporal patterns but also introduces causal constraints in the spatial dimension, making the model more physically interpretable.

[0081] In this embodiment, deeply embedding the physical characteristics and fault mechanisms of electromechanical equipment into the model architecture is the core of improving the accuracy of fault prediction and engineering practicality. In the encoder stage, a graph attention mechanism based on equipment topology is constructed to encode the propagation paths of typical failure modes such as bearing wear and gear meshing faults into causal adjacency matrices, guiding the model to learn potential representations that conform to the laws of mechanical transmission. In the spatiotemporal decoder stage, physical constraint loss functions are constructed using equipment dynamic equations (such as rotor unbalance force equations and gear vibration transfer functions) to ensure that the reconstructed vibration signal satisfies the energy conservation characteristics of the mechanical system. Furthermore, operating parameters (load, speed, etc.) recorded by the SCADA system are introduced as conditional variables, and a multi-head attention mechanism is used to achieve adaptive fault feature decoupling based on operating state.

[0082] In step S3 of this embodiment, the Transformer model mainly consists of three core modules: an embedding layer, a multi-head self-attention mechanism, and a feed-forward network. Each module appears in the encoder or decoder in a stacked manner. Based on the above structure, the Transformer model models the long-term dependencies and spatiotemporal correlations in the input sensor time-series data (composed of multi-dimensional state vectors collected from the device sensors at different times) to achieve accurate prediction of abnormal behavior or future failures.

[0083] Based on the above model structure, the specific processing procedure for the input sensor time-series data in this embodiment is as follows:

[0084] S31. The sensor time-series data is mapped to a high-dimensional feature space through the embedding layer, and position encoding is introduced to obtain the initial input representation;

[0085] Specifically, the embedding layer maps the input sensor time-series data to a high-dimensional feature space to obtain an initial input representation. In order to preserve the temporal sequence information, positional encoding is introduced and added to the embedding features to form the final input sequence representation.

[0086] S32. In each layer of the multi-head self-attention mechanism, the input representation is mapped to a query vector, a key vector, and a value vector, respectively.

[0087] S33. Calculate attention weights based on query vector, key vector, and value vector, and calculate attention weights based on the mask matrix constructed from the causal graph;

[0088] Among them, attention weight for:

[0089]

[0090] In the formula, Represents the query vector. Represents the key vector. Represents a value vector. This represents a mask matrix constructed based on the causal graph, used to control the attention path. The dimension of the key vector K is the factor used to scale the attention weights. express Activation function This represents element-wise multiplication, used to multiply the attention weight matrix with the causal mask matrix M, thereby masking attention connections that do not conform to the causal structure.

[0091] The mask matrix in this embodiment ensures that attention calculations only occur between components with causal relationships;

[0092] S34. Based on attention weights, multiple attention heads are computed in parallel, concatenated, and output after linear mapping. , which is represented as;

[0093]

[0094] in, This represents the h-th attention head. This indicates the output linear mapping matrix. This indicates a splicing operation.

[0095] S35. Input the output after linear mapping into the feedforward neural network for processing, and output the corresponding high-dimensional feature representation through residual connections and layer normalization.

[0096] In this embodiment, the Transformer model architecture, through its unique self-attention mechanism, can effectively capture multi-level spatiotemporal features in equipment operation data. In the temporal dimension, the model automatically learns long-range dependencies in vibration signals using a multi-head self-attention mechanism, while simultaneously combining temporal position encoding technology to accurately preserve the temporal sequence characteristics of the signals. In the spatial dimension, by encoding the physical topology of the equipment into a causal graph structure, explicit modeling of fault propagation paths between mechanical components is achieved. This spatiotemporally coupled Transformer model architecture can not only simultaneously handle millisecond-level instantaneous vibration features and hourly-level progressive degradation patterns, but also establish dynamic relationships between the states of different components through a cross-attention mechanism, enabling the model to capture complex interaction patterns between any positions in the sequence.

[0097] In step S4 of this embodiment, for the high-dimensional feature representation output by the Transformer model, the feature vector of each component is normalized and the degree of anomaly is quantified, and its corresponding anomaly weight value is calculated. When the anomaly weight of a component within a certain time window is greater than a set threshold, it is determined that it may be in an abnormal state, and the possible scope of the fault impact is deduced and explained in combination with the propagation path in the causal graph.

[0098] Specifically, step S4 in this embodiment includes the following sub-steps:

[0099] S41. Normalize the high-dimensional feature representation output by the Transformer model;

[0100] High-dimensional features are represented as The matrix, where n represents the number of parts and m represents the feature dimension;

[0101] S42. Based on the normalized high-dimensional feature representation, calculate the anomaly score for each component. ;

[0102] The anomaly score for each component is calculated by multiplying the anomaly scores of all its neighboring components by the transit weights, resulting in the anomaly score for component i. for:

[0103]

[0104] In the formula, This represents the set of adjacent components associated with component i. This represents the corrected component in the cause-effect graph. To components edge weights, This represents the feature vector of component j. This function represents the calculation of the anomaly score for component j. , Represents norm calculation.

[0105] S43. Response to Abnormal Scores After Z-score standardization, abnormal components are identified through binary judgment, and the propagation path of the abnormal component is determined by combining the cause-effect graph to extrapolate the scope of the fault impact, thereby realizing anomaly identification and fault prediction.

[0106] The formula for identifying abnormal components is:

[0107]

[0108] Where, Indicates components The corresponding standardized outlier scores, This indicates that a threshold for judging abnormal components has been set. Indicates components Abnormal weights, when hour, Indicates components This is an abnormal component. hour, Indicates components This is a normal component;

[0109] When components When the component is faulty, the scope of its failure impact is as follows:

[0110]

[0111] Where, This represents the feature vector within the affected area of ​​the fault. This represents the matrix of causal relationships between components in a cause-effect graph.

[0112] In this embodiment, to achieve accurate classification of abnormal states for each component, the present invention employs a binary classification strategy based on the cross-entropy loss function to optimize component-level anomaly detection performance during the model training phase. The difference between the model output and the actual labeled results is measured and optimized through cross-entropy and backpropagation, effectively improving the model's sensitivity to minor anomaly fluctuations. Ultimately, this achieves time-period prediction and accurate diagnosis of key equipment components. Once the system detects an anomaly score consistently exceeding a threshold, it issues an early warning and precisely identifies the type of component with the anomaly and its potential propagation path.

[0113] In this embodiment, the model output value is set to... The actual annotation result is (Label, 0 or 1), due to the use of a binary classification strategy, therefore pass The function is obtained by taking the cross-entropy loss function. Defined as:

[0114]

[0115] In the formula, This represents the actual annotation results. This represents the model output value. Represents a logarithmic function.

[0116] During the model training phase, the training objective is to minimize the cross-entropy loss function. The gradient of the loss function with respect to the model parameters is calculated using the backpropagation algorithm, and then the model parameters are updated using gradient descent.

[0117] By optimizing the cross-entropy loss function, the model can better capture subtle anomalies. To improve the model's sensitivity to anomalies, a weighting factor can be introduced. Based on this, the loss function of the Transformer model in this embodiment is obtained. for:

[0118]

[0119] In the formula, This represents the actual annotation results. This represents the model output value. This represents the weighting factor adjusted based on sample imbalance. Represents a logarithmic function.

[0120] In this embodiment, addressing the problem that existing deep learning methods typically rely on massive amounts of training data, while key failure modes of electromechanical equipment (such as bearing breakage and motor winding short circuits) occur with extremely low frequency in actual operation, resulting in scarce and unevenly distributed abnormal samples, a causal spatiotemporal Transformer is introduced to construct a causal graph model of equipment failure under limited sample conditions. This distinguishes between genuine causal chains of failure (such as insufficient lubrication → bearing overheating → abnormal vibration spectrum) and spurious associations. By combining spatiotemporal attention mechanisms with causal intervention techniques, more physically interpretable feature representations can be learned from a small number of failure cases, significantly improving the model's generalization ability under unknown failure modes.

[0121] In this embodiment, the causal spatiotemporal Transformer, by decoupling the spatiotemporal confounding factors of multi-sensor data (such as the interference of ambient temperature on vibration signals), can more accurately capture the nonlinear causal effects in fault evolution (such as the directional influence of early microcracks on harmonic components), thereby improving the early warning capability for progressive faults. This provides a traceable and intervention-friendly intelligent diagnostic system for high-value electromechanical equipment (such as wind turbines and aero engines), and promotes the upgrade of industrial equipment health management from "correlation prediction" to "causal decision-making".

[0122] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

[0123] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.

Claims

1. A method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer, characterized in that, Includes the following steps: S1. Construct an initial cause-effect graph based on the physical structure and causal relationships between functional components of electromechanical equipment; S2. Based on the historical operating data of the electromechanical equipment, the initial cause-effect graph is corrected to generate a new cause-effect graph; S3. Introduce the causal graph as prior information into the Transformer model, and use the trained Transformer model to predict the sensor time series data of the electromechanical equipment to be detected, and output the corresponding high-dimensional feature representation. S4. Based on the high-dimensional feature representation, calculate the anomaly weight of each component, and perform component-level anomaly identification and fault prediction. In step S1, in the initial causal graph A(V,E), node V represents the key mechanical component of the electromechanical equipment, and edge E represents the fault propagation path; In the initial causal graph A(V,E), components To components edge weight for: For the implicit causal relationships in the initial causal graph A(V,E), the corresponding components To components Hidden edge weights for: In the formula, This represents the adjustment factor for the initial edge weights. This indicates the component identified based on historical operating data X. Existing data and components Existing data The actual strength of fault transmission, Each represents a component and components The existing data, Indicates components To components The initial edge weights, This represents the weight adjustment factor for the initial implicit edges. This indicates the component identified based on historical operating data X. Existing data and components Existing data The strength of the implicit causal relationship, Indicates components To components The initial implicit edge weights; In step S3, the Transformer model processes the input sensor time-series data as follows: S31. The sensor time-series data is mapped to a high-dimensional feature space through the embedding layer, and position encoding is introduced to obtain the initial input representation; S32. In each layer of the multi-head self-attention mechanism, the initial input representation is mapped to a query vector, a key vector, and a value vector, respectively. S33. Calculate attention weights based on query vector, key vector, and value vector, and calculate attention weights based on the mask matrix constructed from the causal graph; S34. Based on attention weights, multiple attention heads are computed in parallel, concatenated, and output after linear mapping; S35. Input the output after linear mapping into the feedforward neural network for processing, and output the corresponding high-dimensional feature representation through residual connections and layer normalization.

2. The method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer according to claim 1, characterized in that, In step S2, based on the historical operating data of the electromechanical equipment, statistical methods are used to correct the edge weights in the initial causal graph, thereby obtaining the causal graph. The statistical methods include Granger causality test, mutual information calculation, and partial correlation calculation.

3. The method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer according to claim 2, characterized in that, In the causal diagram, the corrected component To components edge weight for: Where, Represents components in the initial causal graph To components edge weights, This represents the Granger causality weighting coefficient. Indicates components Existing data and components Existing data The control function for Granger causality is defined as follows: a value of 1 indicates the existence of Granger causality, and a value of 0 indicates the absence of Granger causality. This represents the mutual information weight adjustment coefficient. Indicates components Existing data and components Existing data mutual information, The weighted adjustment coefficient represents the partial correlation coefficient. Indicates components Existing data and components Existing data The partial correlation coefficient, Weighting adjustment coefficients representing implicit causal relationships. This indicates the component identified based on historical operating data X. Existing data and components Existing data The strength of the implicit causal relationship.

4. The method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer according to claim 1, characterized in that, In step S33, attention weights for: Where, Represents the query vector. Represents the key vector. Represents a value vector. This represents a mask matrix constructed based on the causal graph, used to control the attention path. This represents the dimension of the key vector K. This represents element-wise multiplication. express Activation function.

5. The method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer according to claim 1, characterized in that, The loss function of the Transformer model for: Where, This represents the actual annotation results. This represents the model output value. This represents the weighting factor adjusted based on sample imbalance. Represents a logarithmic function.

6. The method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer according to claim 1, characterized in that, Step S4 includes the following sub-steps: S41. Normalize the high-dimensional feature representation output by the Transformer model; The high-dimensional feature is represented as The matrix, where n represents the number of parts and m represents the feature dimension; S42. Based on the normalized high-dimensional feature representation, calculate the anomaly score for each component. ; S43. Response to Abnormal Scores After Z-score standardization, abnormal components are identified through binary judgment, and the propagation path of the abnormal component is determined by combining the cause-effect graph to extrapolate the scope of the fault impact, thereby realizing anomaly identification and fault prediction.

7. The method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer according to claim 6, characterized in that, In step S42, the anomaly score for each component. for: Where, This represents the set of adjacent components associated with component i. This represents the corrected component in the cause-effect graph. To components edge weights, This represents the feature vector of component j. This function represents the calculation of the anomaly score for component j. , Represents norm calculation.

8. The method for detecting abnormal behavior and predicting faults in electromechanical equipment based on causal spatiotemporal Transformer according to claim 7, characterized in that, In step S43, the formula for determining the abnormal component is: In the formula, Indicates components The corresponding standardized outlier scores, This indicates that a threshold for judging abnormal components has been set. Indicates components Abnormal weights, when hour, Indicates components This is an abnormal component. hour, Indicates components This is a normal component; When components When the component is faulty, the scope of its failure impact is as follows: In the formula, This represents the feature vector within the affected area of ​​the fault. This represents the matrix of causal relationships between components in a cause-effect graph.

Citation Information

Patent Citations

  • Transform-based method and device for constructing sample efficient world model

    CN119271974A

  • Charging pile operation state prediction system and method based on time series data analysis

    CN120338262A