TCN-SA-BiLSTM model-based microgrid fault diagnosis method and system
By using the TCN-SA-BiLSTM model, combined with wavelet transform and self-attention mechanism, the problem of insufficient accuracy of traditional microgrid fault diagnosis methods in small sample cases is solved. This enables efficient fault feature extraction and accurate classification of multi-source signals in microgrids, improving the accuracy and robustness of fault diagnosis.
Patent Information
- Application Number
- CN202511089461.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-11-21
AI Technical Summary
Traditional microgrid fault diagnosis methods are not accurate enough in small sample cases, have difficulty effectively extracting time-series feature differences, and lack adaptive capabilities, resulting in low fault diagnosis accuracy in complex multi-source heterogeneous environments.
A microgrid fault diagnosis method based on the TCN-SA-BiLSTM model is adopted. A multi-dimensional time-frequency domain feature set is constructed by wavelet transform and discrete Fourier transform. Multi-scale time-series features are extracted by combining a time convolutional network with self-attention mechanism (TCN-SA). The BiLSTM model is used to capture the time-series feature dependencies to achieve accurate classification of fault types.
It significantly improves the completeness and response speed of fault features, increases the attention to key fault features, and enhances the model's ability to identify microgrid faults, especially demonstrating excellent diagnostic performance in high-frequency signal and strong electromagnetic interference environments.
Smart Images

Figure CN120995336A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microgrid fault diagnosis technology, specifically to a microgrid fault diagnosis method and system based on the TCN-SA-BiLSTM model. Background Technology
[0002] With the rapid development of renewable energy and distributed generation technologies, microgrids, as an important component of new power systems, have shown great potential. However, microgrid systems include photovoltaic power generation, energy storage units, and various types of loads. Their operating data is characterized by multi-source heterogeneity, strong nonlinearity, high data complexity, and severe noise interference. Traditional single-signal analysis methods are insufficient to comprehensively capture fault characteristics during microgrid fault diagnosis. To address these issues, there is an urgent need to develop high-precision, robust intelligent diagnostic methods to ensure the safe operation of microgrids. Current microgrid fault diagnosis technologies mainly face the following key challenges: Existing methods for data acquisition and processing have significant shortcomings. Analysis models that rely solely on voltage signals cannot fully reflect the complex operating conditions of microgrids. It is particularly noteworthy that microgrid systems simultaneously include photovoltaic power generation units, electrical signal acquisition modules, and energy storage devices. This multi-source heterogeneous nature results in traditional single-signal-source fault diagnosis methods generally having an accuracy rate below 85%.
[0003] In terms of model architecture, current mainstream methods have significant shortcomings. First, traditional CNN models are limited by their local receptive field, making them insufficient for capturing long-term temporal dependencies in microgrid faults. Second, while RNN-like models have temporal processing capabilities, they suffer from the vanishing gradient problem, resulting in large fault location errors when processing high-frequency signals with sampling rates exceeding 10kHz. More seriously, existing models generally employ fixed parameter configurations, lacking the ability to adapt to individual differences, which could lead to catastrophic consequences in demanding microgrid scenarios.
[0004] Regarding feature processing mechanisms, existing single-signal preprocessing methods (such as using only Fourier transform or wavelet transform) lead to the loss of time-frequency domain information. Our experimental data show that this information loss reduces the identifiability of fault features by more than 40%. Furthermore, traditional methods lack effective feature weight allocation mechanisms, resulting in insufficient sensitivity for detecting key fault indicators (such as abrupt changes in insulation impedance and common-mode interference), which is particularly prominent in medical environments with strong electromagnetic interference.
[0005] In summary, traditional fault diagnosis methods suffer from insufficient accuracy in small sample situations and difficulty in effectively extracting temporal feature differences. Summary of the Invention
[0006] This invention aims to address the problems of insufficient accuracy and difficulty in effectively extracting temporal feature differences in traditional fault diagnosis methods when dealing with small samples.
[0007] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: Option 1: This invention proposes a microgrid fault diagnosis method based on the TCN-SA-BiLSTM model, which includes the following steps: Step 1: Process the multi-source signals of the microgrid using wavelet transform and discrete Fourier transform to construct a multi-dimensional time-frequency domain feature set; Step 2: Based on the multi-dimensional time-frequency domain feature set constructed in Step 1, a temporal convolutional network TCN-SA with a self-attention mechanism is used to extract multi-scale temporal features and adaptively learn the weights of key fault information. Step 3: Based on the multi-scale temporal features extracted in Step 2 and the weights of key fault information learned adaptively, the BiLSTM model is used to capture the dependencies of temporal features and achieve accurate classification of fault types.
[0008] Furthermore, a preferred embodiment is provided, wherein the BiLSTM model includes two inverse LSTM networks, each LSTM network including a transport band and three gate units, the three gate units including a forget gate, an input gate, and an output gate, and the remembered information is maintained and transmitted through the transport band.
[0009] Furthermore, a preferred embodiment is provided, wherein the operation steps of the LSTM network are as follows: S1. Utilize the hidden state of the previous unit and the current input. Calculate the forgetting factor The formula is as follows:
[0010] in, It is the sigmoid function, that is and The weights and biases for the forget gate; S2. Similarly, using ht-1 and xt, calculate the activation vector it and candidate value vector Ct of the input gate, as shown in the following formula:
[0011]
[0012] Where tanh(·) is the tanh activation function. ; S3, Updated Unit State C t Mainly determined by the cell state C of the previous momentt-1 The formula for obtaining forgetting and remembering is as follows:
[0013] S4. Calculate the output vector o of the output gate. t and hidden layer h t The formula is as follows:
[0014]
[0015] S5. Obtain the output of the LSTM network, and continue to pass it to the LSTM network state at the next time step.
[0016] Furthermore, a preferred embodiment is provided. The method for processing the multi-source signal of the microgrid through wavelet transform and discrete Fourier transform in step 1 is as follows: a 5-level decomposition and reconstruction algorithm based on db6 wavelet basis is used to remove the baseline drift caused by equipment movement or environmental changes, and all features are normalized to the [-1,1] interval by Z-score standardization.
[0017] Option 2: A microgrid fault diagnosis system based on the TCN-SA-BiLSTM model, the system comprising: The signal preprocessing module is used to process multi-source signals of the microgrid through wavelet transform and discrete Fourier transform to construct a multi-dimensional time-frequency domain feature set; The TCN-SA temporal feature extraction module is used to extract multi-scale temporal features and adaptively learn the weights of key fault information based on the multi-dimensional time-frequency domain feature set constructed by the signal preprocessing module and the temporal convolutional network TCN-SA with self-attention mechanism. The BiLSTM fault diagnosis module is used to capture the dependencies of time-series features extracted by the TCN-SA time-series feature extraction module and to adaptively learn the weights of key fault information. It uses the BiLSTM model to capture the dependencies of time-series features and achieve accurate classification of fault types.
[0018] Furthermore, a preferred embodiment is provided, wherein the TCN-SA temporal feature extraction module adopts a three-layer cascaded TCN block structure, and each TCN block includes an extended causal convolutional sub-network and a pre-activated residual connection; The dilated causal convolution achieves multi-scale temporal feature extraction through dilation coefficients d1=1, d2=2, and d3=4, while capturing short-term transient faults and long-term degradation trend features. The pre-activated residual connection is implemented using a BN-LeakyReLU-convolution structure, where the leakage rate α of the LeakyReLU activation function is set to 0.1.
[0019] Furthermore, a preferred embodiment is provided, wherein the dilated causal convolution introduces gaps or holes into the standard convolution, as shown in the formula:
[0020] In the formula, K It is the length of the convolution kernel. It is a time step t The output, Indicates time step t -( K - k ) d The input sequence, It is a location k The convolution kernel weights, d It is the expansion rate; The pre-activated residual, for any depth of n The residual module, if the input of the first layer of the residual network is The output is then represented as: .
[0021] Furthermore, a preferred embodiment is provided in which the TCN-SA temporal feature extraction module embeds a self-attention mechanism (SA), and sequentially achieves adaptive allocation of feature weights through a customized λ layer, a global average pooling layer, a BN layer, and a sigmoid-activated fully connected layer.
[0022] Option 3: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in Option 1.
[0023] Option 4: A computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the method described in Option 1.
[0024] The advantages of this invention are: The present invention discloses a microgrid fault diagnosis method based on the TCN-SA-BiLSTM model. It designs a multi-mode signal fusion acquisition system to simultaneously acquire multi-dimensional signals such as voltage and current. Through the coordinated processing of wavelet packet transform and Fourier transform, a multi-dimensional feature vector containing time-domain, frequency-domain and time-frequency-domain features is constructed.
[0025] This invention introduces the TCN-SA-BiLSTM architecture into the field of microgrid fault diagnosis, solving the inherent defects of traditional methods in time-series feature extraction; the proposed multi-modal feature fusion method significantly improves the completeness of fault features; and the adaptive weight allocation mechanism enables the system to respond to critical faults at the millisecond level.
[0026] This invention employs a Temporal Convolutional Network (TCN) with residual connections to achieve multi-scale feature extraction, which can effectively process long-term sequence data and overcome the shortcomings of CNN and RNN in time series modeling.
[0027] This invention dynamically allocates feature weights through a self-attention mechanism, increasing the weight of key fault features by up to 70% and improving the model's attention to key features.
[0028] This invention utilizes bidirectional LSTM to capture the temporal evolution of fault features, thus overcoming the limitations of TCN in bidirectional time-dependent modeling.
[0029] This invention is also applicable to microgrid scenarios with extremely high reliability requirements. Attached Figure Description
[0030] Figure 1 This is a schematic diagram of the LSTM node structure described in Implementation Method 1.
[0031] Figure 2 This is a schematic diagram of the BiLSTM network structure described in Implementation Method 1. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.
[0033] Implementation Method 1, see Figure 1 and Figure 2 This embodiment describes a microgrid fault diagnosis method based on the TCN-SA-BiLSTM model. The Temporal Convolutional Network (TCN) described in this embodiment is a variant of CNN. It uses causal convolution to avoid losing historical information and improves the performance in time series models. At the same time, dilated convolution and residual block structure can effectively solve the gradient vanishing problem, enabling the model to achieve better generalization.
[0034] In networks, causal convolution imposes constraints on the direction of information flow. This method ensures that each output in a convolutional layer depends only on past values in the input sequence and is unaffected by future values. Therefore, the expression for causal convolution of a one-dimensional sequence and a convolutional kernel w can be expressed as: (1-1) In the formula, K It is the length of the convolution kernel. It is the output of time step t. Indicates time step t - k The input sequence, Is the convolution kernel at position k The weight.
[0035] TCN employs dilated convolutions to expand the receptive field. Dilated convolutions introduce gaps or holes into standard convolutions to allow for a wider sampling range while maintaining sequence length. The mathematical expression is as follows: (1-2) In the formula, K It is the length of the convolution kernel. It is a time step t The output, Indicates time step t -( K - k ) d The input sequence, It is a location k The convolution kernel weights, d It is the expansion rate. Residual modules are used in TCN to solve the vanishing or exploding gradient problem. For any depth... n The residual module, if the input of the first layer of the residual network is The output can then be represented as: (1-3) BiLSTM can be viewed as a combination of two inverse LSTM networks. Long Short-Term Memory (LSTM) is a special type of recurrent neural network that evolved from traditional recurrent neural networks (RNNs). Compared to traditional RNNs, it solves the problem of long-term dependency in RNNs.
[0036] Compared to traditional RNN networks, LSTM incorporates a gate structure to control the transfer of memory information. A gate unit primarily consists of a sigmoid function and a dot product operation. As shown in the diagram, the sigmoid function mainly maps variables to the [0,1] interval.
[0037] (1-4) like Figure 1 As shown, LSTM mainly consists of a transport belt and three gate units: a forget gate, an input gate, and an output gate. The stored information is maintained and transferred through the transport belt. The transport belt, also called the cell state, allows information to flow in a relatively unchanged form. The forget gate is mainly used to determine which information should be discarded from the cell state. The input gate is mainly used to selectively add new information to the cell state. The output gate is used to determine which information in the cell state is output.
[0038] The operation steps of an LSTM network are as follows: (1) Forgetting. Utilize the hidden state of the previous unit. Input at the current time Calculate the forgetting factor The formula is as follows: (1-5) in, It is the sigmoid function, that is and The weights and biases of the forget gate.
[0039] (2) Input. Similarly, using ht-1 and xt, the activation vector it and candidate value vector Ct of the input gate are calculated, as follows: (1-6) (1-7) Where tanh(·) is the tanh activation function. .
[0040] (3) Update the cell state. The updated cell state C t Mainly determined by the cell state C of the previous moment t-1 The formula for obtaining forgetting and remembering is as follows: (1-8) (4) Output. Calculate the output vector o of the output gate. t and hidden layer h t The formula is as follows: (1-9) (1-10) Finally, the output of the LSTM is obtained, and it will continue to be passed to the LSTM cell state at the next time step.
[0041] In summary, standard LSTM networks transmit information unidirectionally, meaning they can only learn features from past moments and cannot learn features from future moments. To address this issue, this paper uses a Bidirectional Long Short-Term Memory (BiLSTM) network for network construction, as shown below. Figure 2 The diagram shows the structure of a BiLSTM network. BiLSTM can be viewed as a combination of two inverse LSTM networks. It has two inverse transmission bands that can transmit state information from both the front and back directions, while learning past and future features and performing recursion and feedback.
[0042] The self-attention (SA) mechanism described in this embodiment is designed as an adaptive thresholding method for processing noisy data and preserving useful features within the TCN framework. Its core idea is to learn key information from feature maps and dynamically adjust the threshold of each feature map, thereby achieving effective noise suppression and accurate extraction of useful features. Specifically, a specific threshold for each feature map is calculated by learning intermediate attention maps, and a non-linear mapping is performed on the feature maps based on these thresholds, preserving significant positive or negative values while setting features close to zero to zero.
[0043] The self-attention mechanism is implemented as follows: First, after a series of convolution operations, the dimensions of the input tensor change. Assume the current input tensor is... Its shape is N Column (i.e.) N (Each feature map). Next, a global average pooling layer is used to average the feature maps in each column, resulting in... Convert to shape 1× N row vectors .Then, After batch normalization and fully connected layers, a vector with invariant shape is generated. Finally, by... and Element-wise multiplication yields the final threshold vector. = [ k 1, k 2, ..., k N Threshold for each feature map. k iThrough this process, the feature map is adaptively learned and nonlinearly mapped according to the thresholding function (Equation 1-11).
[0044] (1-11) During the training process, k The value of is adaptively adjusted to minimize the difference between the model output and the true value through an optimization operation.
[0045] This invention proposes a microgrid fault diagnosis system based on a TCN-SA-BiLSTM model, which integrates a Temporal Convolutional Network (TCN) with a self-attention mechanism and a Bidirectional Long Short-Term Memory Network (BiLSTM). The system employs a three-level modular architecture, including a signal preprocessing module, a TCN-SA temporal feature extraction module, and a BiLSTM fault diagnosis module, enabling multi-scale feature extraction and accurate fault identification of the microgrid's operating status.
[0046] In the signal preprocessing module, the system first performs denoising and normalization on the acquired multi-source signals of the microgrid (including voltage, current, etc.). A wavelet threshold denoising algorithm is used to eliminate high-frequency noise interference, and the maximum-minimum normalization method is used to standardize the signals of each channel to a uniform dimension. Simultaneously, based on the time-domain features (such as mean, variance, kurtosis, etc.) and frequency-domain features (such as FFT spectral energy, wavelet packet energy entropy, etc.) of each sample, a comprehensive degenerate feature set containing D-dimensional features is constructed, laying the foundation for subsequent deep feature extraction.
[0047] The TCN-SA temporal feature extraction module is one of the core innovations of this invention. This module employs a three-layer cascaded TCN block structure, with each TCN block containing an dilated causal convolutional sub-network and pre-activated residual connections. The dilated causal convolution, through carefully designed dilation coefficients (d1=1, d2=2, d3=4), achieves multi-scale temporal feature extraction, simultaneously capturing short-term transient faults and long-term degradation trend features. The pre-activated residual connections adopt an innovative "BN-LeakyReLU-convolution" structure, where the leakage rate α of the LeakyReLU activation function is set to 0.1 to avoid the hard-zero sparsity problem of traditional ReLU. In particular, this invention innovatively embeds a self-attention mechanism (SA) into the TCN module, sequentially using a customized λ layer (calculating the absolute value of features), a global average pooling layer, a BN layer, and a sigmoid-activated fully connected layer to achieve adaptive allocation of feature weights, increasing the weight of key fault features by more than 65%.
[0048] The BiLSTM time series prediction module is responsible for the final fault diagnosis decision. This module receives high-level time series features from the TCN-SA module and a 14-dimensional degenerate feature set from the preprocessing module, and fully mines the long-term dependencies in the time series data through a bidirectional LSTM structure. The output of BiLSTM is fused through a fully connected layer, and finally outputs the probability distribution of the fault type.
[0049] The microgrid fault diagnosis method proposed in this embodiment achieves high-precision fault detection through multi-stage collaborative processing. This method innovatively combines deep temporal modeling technology with an adaptive feature selection mechanism, providing a complete intelligent diagnostic solution for microgrid systems. First, the system collects multi-source heterogeneous operating data of the microgrid in real time through a distributed sensor network. To ensure data quality, this raw data needs to undergo a strict preprocessing process: a 5-layer decomposition and reconstruction algorithm based on the db6 wavelet basis is used to remove baseline drift caused by equipment movement or environmental changes, and all features are Z-score standardized to the [-1,1] interval, laying a solid foundation for subsequent deep feature analysis.
[0050] In the TCN-SA time-series feature extraction module, the system extracts a comprehensive feature vector containing 32 feature dimensions from the preprocessed multi-source data. The typical fault feature set covers three key dimensions: time domain, frequency domain, and time-frequency domain. In the time domain, 14 statistical features with clear physical meaning are extracted, including conventional statistical indicators such as mean, variance, skewness, and kurtosis, as well as typical features that can reflect the dynamic characteristics of the signal, such as waveform factor, impulse factor, and margin factor. In the frequency domain, spectrum analysis is performed through FFT transformation, focusing on extracting the energy distribution characteristics of 10 characteristic frequency bands within the 0-5kHz frequency band. In the time-frequency domain, the S-transform algorithm with a time resolution of 1ms and a frequency resolution of 10Hz is used to obtain 8 time-frequency joint features, including time-frequency entropy and instantaneous frequency variance. This multi-dimensional feature extraction strategy ensures that various potential fault features are fully covered.
[0051] The core of the system is the innovative TCN-SA feature extraction module, which employs a four-layer temporal convolutional network (d=1,2,4,8) with exponentially growing dilation coefficients. Each layer is configured with 256 3×1 convolutional kernels. Through this specially designed dilated convolutional structure, the network can simultaneously capture multi-scale temporal features ranging from milliseconds to minutes. To improve model robustness, each layer integrates pre-activated residual blocks containing batch normalization (BN) and LeakyReLU (α=0.1), and a Dropout rate of 0.3 is set to prevent overfitting. More importantly, the module's innovative self-attention mechanism operates in parallel through eight independent attention heads, each with a key value dimension dk set to 64. Combined with an absolute value activated λ layer, it achieves dynamic weighting of key fault features and intelligent suppression of noise features. This design improves the model's sensitivity to weak fault features by more than 70%.
[0052] The BiLSTM fault diagnosis module is the decision-making center of the entire system. It receives high-level features extracted by the TCN-SA module and fully captures the dependencies between time series data through bidirectional LSTM layers of 128 units each. To improve diagnostic accuracy, a Softmax attention layer with a temperature coefficient τ=0.5 is specially designed in the module, which can adaptively adjust the smoothness of the probability distribution of each category. During the model training phase, a cosine decay learning rate strategy with an initial value of 0.001 is adopted, along with a batch size of 64 and an early stopping threshold of 20 epochs, which effectively prevents model overfitting while ensuring training efficiency.
[0053] In this embodiment, the effectiveness of the invention is tested using a power microgrid fault dataset. This dataset is generated by simulating fault scenarios in a single-phase AC microgrid system, simulating a small-scale microgrid model including solar panels, a battery energy storage system, loads, and the AC power grid. We observe spikes in the Isec plot as indicators of faults. These faults are generated by manually opening each circuit breaker at different times of the day. Furthermore, faults are studied by maintaining and isolating the battery controller. Sampling parameters: Data is collected every 60 minutes for 24 hours, totaling 96 data points.
[0054] Key features that can be captured during the fault detection phase include: 1. Secondary current (Isec): A transient spike occurs during a fault.
[0055] 2. Load power (PLPL): drops significantly during a fault.
[0056] 3. Timestamp: Records the time of fault occurrence (0-23 hours), used to analyze the impact of battery controller status (activated / inactive) on fault characteristics.
[0057] The detected faults include: 1. Line-to-Line fault: Two conductors coming into contact causes a short circuit.
[0058] 2. Line-to-Ground faults (accounting for over 80%): Conductor and grounding faults, simulating lightning or equipment failure scenarios.
[0059] 3. Short circuit fault in photovoltaic power generation module 4. Photovoltaic power generation module open circuit fault 5. Short circuit fault in wind turbine generator circuit module 6. Open circuit fault in wind turbine generator circuit module Data is generated at different times of the day to train the model of this invention. With new power, Isec, and time-of-day data, we can predict whether a fault exists, and if so, pinpoint its location very accurately. The verification experimental results are shown in Table 1. Compared with existing methods, this invention achieves the highest fault diagnosis accuracy across all tasks, effectively improving the accuracy of microgrid fault diagnosis in multimodal scenarios.
[0060] Table 1 Experimental Results
[0061] Those skilled in the art will understand that the above description is merely a preferred embodiment of the present invention, and the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. This is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0062] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and modifications of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and modifications.
Claims
1. A microgrid fault diagnosis method based on the TCN-SA-BiLSTM model, characterized in that, The microgrid fault diagnosis method includes the following steps: Step 1: Process the multi-source signals of the microgrid using wavelet transform and discrete Fourier transform to construct a multi-dimensional time-frequency domain feature set; Step 2: Based on the multi-dimensional time-frequency domain feature set constructed in Step 1, a temporal convolutional network TCN-SA with a self-attention mechanism is used to extract multi-scale temporal features and adaptively learn the weights of key fault information. Step 3: Based on the multi-scale temporal features extracted in Step 2 and the weights of key fault information learned adaptively, the BiLSTM model is used to capture the dependencies of temporal features and achieve accurate classification of fault types.
2. The microgrid fault diagnosis method based on the TCN-SA-BiLSTM model according to claim 1, characterized in that, The BiLSTM model includes two inverse LSTM networks. Each LSTM network includes a transport band and three gate units, namely a forget gate, an input gate, and an output gate. The memorized information is maintained and transmitted through the transport band.
3. The microgrid fault diagnosis method based on the TCN-SA-BiLSTM model according to claim 2, characterized in that, The operation steps of the LSTM network are as follows: S1. Utilize the hidden state of the previous unit. Input at the current time Calculate the forgetting factor The formula is: in, It is the sigmoid function, that is and The weights and biases for the forget gate; S2, also using h t-1 and x t Calculate the activation vector i of the input gate t and candidate value vector C t The formula is: Where tanh(·) is the tanh activation function. ; S3, Updated Unit State C t Mainly determined by the cell state C of the previous moment t-1 The formula for obtaining forgetting and remembering is as follows: S4. Calculate the output vector ot of the output gate and the hidden layer h. t The formula is: S5. Finally, the output of the LSTM network is obtained and will continue to be passed to the LSTM network state at the next time step.
4. The microgrid fault diagnosis method based on the TCN-SA-BiLSTM model according to claim 1, characterized in that, The method for processing multi-source signals of microgrids in step 1 using wavelet transform and discrete Fourier transform is as follows: a 5-level decomposition and reconstruction algorithm based on db6 wavelet basis is used to remove baseline drift caused by equipment movement or environmental changes, and all features are normalized to the [-1,1] interval by Z-score standardization.
5. A microgrid fault diagnosis system based on the TCN-SA-BiLSTM model, characterized in that, The system includes: The signal preprocessing module is used to process multi-source signals of the microgrid through wavelet transform and discrete Fourier transform to construct a multi-dimensional time-frequency domain feature set; The TCN-SA temporal feature extraction module is used to extract multi-scale temporal features and adaptively learn the weights of key fault information based on the multi-dimensional time-frequency domain feature set constructed by the signal preprocessing module and the temporal convolutional network TCN-SA with self-attention mechanism. The BiLSTM fault diagnosis module is used to capture the dependencies of time-series features extracted by the TCN-SA time-series feature extraction module and to adaptively learn the weights of key fault information. It uses the BiLSTM model to capture the dependencies of time-series features and achieve accurate classification of fault types.
6. The microgrid fault diagnosis system based on the TCN-SA-BiLSTM model according to claim 5, characterized in that, The TCN-SA temporal feature extraction module adopts a three-layer cascaded TCN block structure, with each TCN block containing an extended causal convolutional sub-network and a pre-activated residual connection; The dilated causal convolution achieves multi-scale temporal feature extraction through dilation coefficients d1=1, d2=2, and d3=4, while capturing short-term transient faults and long-term degradation trend features. The pre-activated residual connection is implemented using a BN-LeakyReLU-convolution structure, where the leakage rate α of the LeakyReLU activation function is set to 0.
1.
7. The microgrid fault diagnosis system based on the TCN-SA-BiLSTM model according to claim 6, characterized in that, The dilated causal convolution introduces gaps or holes into the standard convolution, as shown in the formula: In the formula, K It is the length of the convolution kernel. It is a time step t The output, Indicates time step t -( K - k ) d The input sequence, It is a location k The convolution kernel weights, d It is the expansion rate; The pre-activated residual, for any depth of n The residual module, if the input of the first layer of the residual network is The output is then represented as: 。 8. The microgrid fault diagnosis system based on the TCN-SA-BiLSTM model according to claim 6, characterized in that, The TCN-SA temporal feature extraction module embeds a self-attention mechanism (SA), which sequentially passes through a customized... The system employs layers including global average pooling, batch normalization (BN), and sigmoid-activated fully connected layers to achieve adaptive allocation of feature weights.
9. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-4.
10. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the method of any one of claims 1-4.
Citation Information
Patent Citations
Island DC microgrid fault diagnosis method based on wavelet sliding window energy
CN113702767A
Early fault diagnosis method for rolling bearing of packaging machine based on migration self-coding network
CN116628587A