Charging module fault diagnosis method and system based on time convolution network
By building a charging module fault diagnosis model based on time convolution network, combining multiple time scales and attention mechanisms, the problems of high computational complexity and insufficient feature extraction in traditional methods are solved, and more efficient and accurate fault diagnosis is achieved.
Patent Information
- Application Number
- CN202510504296.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-19
AI Technical Summary
The existing charging module fault diagnosis methods rely on precise system modeling and expert experience, and are difficult to adapt to complex operating environments. In addition, traditional CNNs have problems with high computational complexity and insufficient feature extraction when processing time series data.
The fault diagnosis method based on time convolution network (TCN) is adopted, combined with multi-time scales and attention mechanisms, and through the expansion convolution layer, compression excitation module, global average pooling, CBAM module and dropout layer, a charging module fault diagnosis model is built to realize automatic extraction and efficient classification of features.
It improves the accuracy of the charging module fault diagnosis, avoids the subjectivity of manual feature extraction, and can capture local details and global patterns in the time series data while maintaining efficient calculations, improving the comprehensiveness and accuracy of fault diagnosis.
Smart Images

Figure CN120508870A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of charging module fault diagnosis, and in particular to a charging module fault diagnosis method and system based on a temporal convolutional network. Background Art
[0002] DC power systems, known as the "hub of critical energy," play a vital role in key applications such as power systems, energy storage systems, communication networks, industrial control, rail transit, and data centers. As a core component of a DC power system, the reliability and stability of the charging module directly impact the performance of the entire system. However, charging modules can encounter various faults during operation, such as open-circuit failures of power switches. These faults can degrade power system performance and even cause system crashes, leading to power outages and significant economic losses and safety hazards. Therefore, real-time and accurate fault diagnosis of charging modules is crucial to ensuring the stable operation of DC power systems.
[0003] Traditional charging module fault diagnosis methods primarily rely on analytical models, which require precise system modeling and real-time data acquisition. However, as system complexity increases, even minor changes can necessitate remodeling, which is both time-consuming and costly. Furthermore, traditional fault diagnosis methods often rely on expert experience and specialized signal processing techniques, making them difficult to adapt to complex operating environments. Deep learning offers powerful data analysis and processing capabilities, particularly for mining and classifying data features.
[0004] Currently commonly used deep learning-based fault diagnosis models, such as CNNs, have shortcomings in processing time series data. Traditional CNNs have a limited receptive field, and learning long time series data requires deeper networks. Therefore, CNNs often increase their feature extraction capabilities by adding convolutional layers or increasing the size of the convolution kernel, which also increases computational complexity.
[0005] TCN uses convolutional neural networks to process time series data, enabling efficient parallel computing. Furthermore, to capture key features or avoid excessive inclusion of irrelevant features, attention mechanisms can be integrated into the model. However, existing deep learning models often only extract features at a single time scale and may not fully capture the diverse levels of information in charging module fault signals. Summary of the Invention
[0006] The technical problem to be solved by the present invention is how to improve the accuracy of charging module fault diagnosis.
[0007] The present invention solves the above technical problems through the following technical means:
[0008] The present invention provides a charging module fault diagnosis method based on a temporal convolutional network, comprising:
[0009] S1. Obtain a time series dataset of the three-phase AC voltage, DC voltage, and DC current of the charging module and preprocess the dataset;
[0010] S2. Construct a TCN fault diagnosis model based on multiple time scales and attention mechanism;
[0011] S3, training the fault diagnosis model based on the data preprocessed in S1;
[0012] S4. Based on the fault diagnosis model trained in S3, the charging module status is monitored in real time.
[0013] Furthermore, the S1 includes the following steps:
[0014] S11. Use the minimum-maximum normalization method to scale the time series data to the range of [0, 1]. The calculation formula is as follows:
[0015]
[0016] Among them, x is the original data, x′ is the normalized data, and x min is the minimum value in the data set, x max is the maximum value in the data set.
[0017] S12. Divide the normalized data samples into training set, validation set and test set in a ratio of 8:1:1.
[0018] Furthermore, the S2 includes the following steps:
[0019] S21. Construct four parallel dilated convolutional layers. After the input data passes through the dilated convolutional layers, they are concatenated according to the channel dimension to obtain a concatenated feature map.
[0020] S22, using the compression-excitation SE module to weight the spliced feature map to obtain a fused feature map;
[0021] S23, perform global average pooling on the weighted feature map and generate spatial attention weights through two layers of fully connected layers;
[0022] S24, performing a dot multiplication operation on the fused feature map and the spatial attention weight element by element to obtain the features after attention weighting of the multi-time scale feature information;
[0023] S25: Input the features obtained in S24 into two TCN layers to further extract time-dependent features, and then enhance the feature expression ability through the attention mechanism CBAM module;
[0024] S26. Pass the output of S25 through the dropout layer to make the neurons stop working randomly with a probability of 60%, and output the classification result through the fully connected layer.
[0025] Furthermore, the four parallel dilated convolutional layers described in S21 have different dilation rates, namely 1, 2, 4, and 8; the shape of their input data is (5, 160), that is, 5 channels, each channel has 160 data points; the output size of the dilated convolution is as follows:
[0026]
[0027] Where output_length is the output size, dilation is the dilation rate, kernel_size = 3, stride = 1, padding = 1;
[0028] The size of the feature map after splicing according to the channel dimension is (20,160).
[0029] Furthermore, the fused feature map described in S22 is as follows:
[0030]
[0031] Among them F 融合 Represents the fused feature map, F i Represents the i-th feature map, weight vector w=[w1,w2,w3,w4], w i represents the weight of the i-th feature map.
[0032] The present invention also provides a charging module fault diagnosis system based on a temporal convolutional network. When the system is running, the above method is executed, and the system includes the following modules:
[0033] A data processing module is used to obtain a time series data set of the three-phase AC voltage, DC voltage, and DC current of the charging module and preprocess the data set;
[0034] Model building module, used to build a TCN fault diagnosis model based on multiple time scales and attention mechanism;
[0035] A model training module is used to train a fault diagnosis model based on the data preprocessed by the data processing module;
[0036] The real-time monitoring module is used to monitor the status of the charging module in real time based on the fault diagnosis model trained by the model training module.
[0037] Furthermore, the specific execution mode of the data processing module includes:
[0038] (1) Use the minimum-maximum normalization method to scale the time series data to the range of [0, 1]. The calculation formula is as follows:
[0039]
[0040] Among them, x is the original data, x′ is the normalized data, and x min is the minimum value in the data set, x max is the maximum value in the data set.
[0041] (2) The normalized data samples are divided into training set, validation set and test set in the ratio of 8:1:1.
[0042] Furthermore, the model building module includes the following units:
[0043] The dilated convolutional layer unit is used to construct four parallel dilated convolutional layers. After the input data passes through the dilated convolutional layer, it is spliced according to the channel dimension to obtain the spliced feature map;
[0044] A compression excitation unit is used to weight the spliced feature maps using a compression excitation SE module to obtain a fused feature map;
[0045] The pooling layer unit is used to perform global average pooling on the weighted feature map and generate spatial attention weights through two fully connected layers;
[0046] The feature enhancement unit is used to perform element-wise multiplication of the fused feature map and the spatial attention weight to obtain the features after attention weighting of multi-time scale feature information;
[0047] The TCN layer unit is used to input the features obtained by the feature enhancement unit into two TCN layers, further extract the time-dependent features, and then enhance the feature expression ability through the attention mechanism CBAM module;
[0048] The output unit is used to pass the output of the TCN layer unit through the dropout layer, so that the neurons stop working randomly with a probability of 60%, and output the classification results through the fully connected layer.
[0049] Furthermore, the four parallel dilated convolutional layers described in the dilated convolutional layer unit have different dilation rates, namely 1, 2, 4, and 8; the shape of its input data is (5,160), that is, 5 channels, each channel has 160 data points; the output size of the dilated convolution is as follows:
[0050]
[0051] Where output_length is the output size, dilation is the dilation rate, kernel_size = 3, stride = 1, padding = 1;
[0052] The size of the feature map after splicing according to the channel dimension is (20,160).
[0053] Furthermore, the fused feature map of the compression excitation unit is as follows:
[0054]
[0055] Among them F 融合 Represents the fused feature map, F i Represents the i-th feature map, weight vector w=[w1,w2,w3,w4], w i represents the weight of the i-th feature map.
[0056] The advantages of the present invention are:
[0057] (1) The present invention does not require traditional signal processing technology to extract features. The TCN fault diagnosis model based on multiple time scales and attention mechanism can automatically extract features, improve the accuracy of charging module fault diagnosis, and avoid the subjectivity of manual feature extraction.
[0058] (2) The pyramid attention mechanism adopted by the present invention uses dilated convolutions with different dilation rates to replace the original standard convolution. Because dilated convolutions do not require additional parameters or computational complexity, they maintain computational efficiency while expanding the receptive field. This enables the model to improve feature extraction capabilities while maintaining high efficiency. Dilated convolution layers with different dilation rates can simultaneously capture local details and global patterns in time series data. This multi-scale feature extraction capability helps the model understand the data more comprehensively, thereby improving the accuracy of fault diagnosis.
[0059] (3) The present invention adds a CBAM module after the two TCN layers to further optimize feature expression by performing attention calculations in both channel and spatial dimensions. Channel attention can highlight important feature channels, and spatial attention can highlight important time points, thereby improving feature extraction capabilities and the accuracy of charging module fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 Schematic diagram of the flow of a charging module fault diagnosis method based on a temporal convolutional network according to an embodiment of the present invention;
[0061] Figure 2 This is a schematic diagram of the network architecture of the TCN fault diagnosis model based on multiple time scales and attention mechanism in an embodiment of the present invention;
[0062] Figure 3 Schematic diagram of the training curve of the TCN fault diagnosis model based on multiple time scales and attention mechanism in an embodiment of the present invention. DETAILED DESCRIPTION
[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0064] Example 1
[0065] This embodiment provides a charging module fault diagnosis method based on a temporal convolutional network. The specific implementation steps are as follows: Figure 1 Shown, including:
[0066] S1. Obtain the time series data set of the three-phase AC voltage, DC voltage, and DC current of the charging module and preprocess the data set. The specific implementation steps include the following:
[0067] S11. Use the minimum-maximum normalization method to scale the time series data to the range of [0, 1]. The calculation formula is as follows:
[0068]
[0069] Among them, x is the original data, x′ is the normalized data, and x min is the minimum value in the data set, x max is the maximum value in the data set.
[0070] S12. Divide the normalized data samples into a training set, a validation set, and a test set in a ratio of 8:1:1.
[0071] S2. Construct a TCN fault diagnosis model based on multiple time scales and attention mechanism. The TCN fault diagnosis model based on multiple time scales and attention mechanism includes a pyramid attention module based on multi-scale dilated convolution, a TCN network with two TCN layers, a CBAM module, and finally outputs the classification result through a fully connected layer. The model network architecture is as follows: Figure 2 As shown, the specific implementation steps include the following:
[0072] S21. Construct four parallel dilated convolutional layers. After the input data passes through the dilated convolutional layers, it is concatenated according to the channel dimension to obtain the concatenated feature map. The four parallel dilated convolutional layers have different dilation rates: 1, 2, 4, and 8. The shape of the input data is (5,160), that is, 5 channels, each channel has 160 data points. The output size of the dilated convolution is as follows:
[0073]
[0074] Where output_length is the output size, dilation is the dilation rate, kernel_size = 3, stride = 1, padding = 1;
[0075] The output feature maps of the four dilated convolutions are all of size (5,160), which are spliced together according to the channel dimension. The size of the spliced feature maps is (20,160).
[0076] S22. Use the compression-excitation SE module to weight the spliced feature map to obtain the fused feature map, as shown in the following formula:
[0077]
[0078] Among them F 融合 Represents the fused feature map, F i Represents the i-th feature map, weight vector w=[w1,w2,w3,w4], w i represents the weight of the i-th feature map.
[0079] S23, perform global average pooling on the weighted feature map and generate spatial attention weights through two layers of fully connected layers;
[0080] S24, performing a dot multiplication operation on the fused feature map and the spatial attention weight element by element to obtain the features after attention weighting of the multi-time scale feature information;
[0081] S25: Input the features obtained in S24 into two TCN layers to further extract time-dependent features, and then enhance the feature expression ability through the attention mechanism CBAM module;
[0082] S26. To prevent the model from overfitting and improve the generalization ability of the model, the output of S25 is passed through the dropout layer to make the neurons stop working randomly with a probability of 60%, and the classification results are output through the fully connected layer.
[0083] S3, training the fault diagnosis model based on the data preprocessed in S1;
[0084] S4. Based on the fault diagnosis model trained in S3, the charging module status is monitored in real time.
[0085] This embodiment also simulates and verifies the above method, using a TCN fault diagnosis model based on multiple time scales and attention mechanism for training. The learning rate is set to 0.0003, the batch size is set to 32, and the number of iterations is 50. The loss function uses the cross entropy loss function, the optimization algorithm uses the Adam optimizer, and the training curve is as follows: Figure 3 The training effect of the charging module fault diagnosis algorithm of this embodiment is better. The fault classification results are shown in Table 1 below. Compared with the fault classification results of classic methods such as convolutional neural networks (CNN) and temporal convolutional neural networks (TCN), the charging module fault diagnosis method of this embodiment is more accurate.
[0086] Table 1 Comparison of charging module fault classification results
[0087]
[0088] Example 2
[0089] It should be further explained that, based on the same inventive concept, this embodiment also provides a charging module fault diagnosis system based on a temporal convolutional network, characterized in that the system executes the method described in Example 1 during operation, including the following modules:
[0090] The data processing module is used to obtain the three-phase AC voltage, DC voltage and DC current data of the charging module and pre-process the data; the specific execution method of the data processing module includes:
[0091] (1) Use the minimum-maximum normalization method to scale the multi-sensor time series data to the range of [0, 1]. The calculation formula is as follows:
[0092]
[0093] Among them, x is the original data, x′ is the normalized data, and x min is the minimum value in the data set, x max is the maximum value in the data set.
[0094] (2) The normalized data samples are divided into training set, validation set and test set in the ratio of 8:1:1.
[0095] A model building module is used to build a TCN fault diagnosis model based on multiple time scales and attention mechanism; the model building module includes the following units:
[0096] The dilated convolution layer unit is used to construct four parallel dilated convolution layers. After the input data passes through the dilated convolution layers, it is spliced according to the channel dimension to obtain a spliced feature map. The four parallel dilated convolution layers have different dilation rates, namely 1, 2, 4, and 8. The shape of its input data is (5,160), that is, 5 channels, each channel has 160 data points. The output size of the dilated convolution is as follows:
[0097]
[0098] Where output_length is the output size, dilation is the dilation rate, kernel_size = 3, stride = 1, padding = 1;
[0099] The size of the feature map after splicing according to the channel dimension is (20,160).
[0100] The compression excitation unit is used to weight the spliced feature maps using the compression excitation SE module to obtain a fused feature map; the fused feature map is as follows:
[0101]
[0102] Among them F 融合 Represents the fused feature map, F i Represents the i-th feature map, weight vector w=[w1,w2,w3,w4], w i represents the weight of the i-th feature map.
[0103] The pooling layer unit is used to perform global average pooling on the weighted feature map and generate spatial attention weights through two fully connected layers;
[0104] The feature enhancement unit is used to perform element-wise multiplication of the fused feature map and the spatial attention weight to obtain the features after attention weighting of multi-time scale feature information;
[0105] The TCN layer unit is used to input the features obtained by the feature enhancement unit into two TCN layers, further extract the time-dependent features, and then enhance the feature expression ability through the attention mechanism CBAM module;
[0106] The output unit is used to pass the output of the TCN layer unit through the dropout layer, so that the neurons stop working randomly with a probability of 60%, and output the classification results through the fully connected layer.
[0107] A model training module is used to train a fault diagnosis model based on the data preprocessed by the data processing module;
[0108] The real-time monitoring module is used to monitor the status of the charging module in real time based on the fault diagnosis model trained by the model training module.
[0109] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A charging module fault diagnosis method based on temporal convolutional network, characterized in that: include: S1. Obtain a time series dataset of the three-phase AC voltage, DC voltage, and DC current of the charging module and preprocess the dataset; S2. Construct a TCN fault diagnosis model based on multiple time scales and attention mechanism; S3, training the fault diagnosis model based on the data preprocessed in S1; S4. Based on the fault diagnosis model trained in S3, the charging module status is monitored in real time.
2. A charging module fault diagnosis method based on a temporal convolutional network according to claim 1, characterized in that: Said S1 comprises the following steps: S11. Use the minimum-maximum normalization method to scale the time series data to the range of [0, 1]. The calculation formula is as follows: Among them, x is the original data, x′ is the normalized data, and x min is the minimum value in the data set, x max is the maximum value in the data set; S12. Divide the normalized data samples into a training set, a validation set, and a test set in a ratio of 8:1:
1.
3. The method for diagnosing charging module faults based on a temporal convolutional network according to claim 1, characterized in that: The S2 comprises the following steps: S21. Construct four parallel dilated convolutional layers. After the input data passes through the dilated convolutional layers, they are concatenated according to the channel dimension to obtain a concatenated feature map. S22, using the compression-excitation SE module to weight the spliced feature map to obtain a fused feature map; S23, perform global average pooling on the weighted feature map and generate spatial attention weights through two layers of fully connected layers; S24, performing a dot multiplication operation on the fused feature map and the spatial attention weight element by element to obtain the features after attention weighting of the multi-time scale feature information; S25: Input the features obtained in S24 into two TCN layers to further extract time-dependent features, and then enhance the feature expression ability through the attention mechanism CBAM module; S26. Pass the output of S25 through the dropout layer to make the neurons stop working randomly with a probability of 60%, and output the classification result through the fully connected layer.
4. A charging module fault diagnosis method based on a temporal convolutional network according to claim 3, characterized in that: The four parallel dilated convolutional layers described in S21 have different dilation rates, namely 1, 2, 4, and 8. The shape of their input data is (5, 160), that is, 5 channels, each channel has 160 data points. The output size of the dilated convolution is as follows: Where output_length is the output size, dilation is the dilation rate, kernel_size = 3, stride = 1, padding = 1; The size of the feature map after splicing according to the channel dimension is (20,160).
5. The method for diagnosing charging module faults based on a temporal convolutional network according to claim 3, characterized in that: The fused feature map described in S22 is as follows: Among them F 融合 Represents the fused feature map, F i Represents the i-th feature map, weight vector w=[w1,w2,w3,w4], w i represents the weight of the i-th feature map.
6. A charging module fault diagnosis system based on a temporal convolutional network, characterized in that: When the system is running, the method according to any one of claims 1 to 5 is executed, including the following modules: A data processing module is used to obtain a time series data set of the three-phase AC voltage, DC voltage, and DC current of the charging module and preprocess the data set; Model building module, used to build a TCN fault diagnosis model based on multiple time scales and attention mechanism; A model training module is used to train a fault diagnosis model based on the data preprocessed by the data processing module; The real-time monitoring module is used to monitor the status of the charging module in real time based on the fault diagnosis model trained by the model training module.
7. A charging module fault diagnosis system based on a temporal convolutional network according to claim 6, characterized in that: The specific execution method of the data processing module includes: (1) Use the minimum-maximum normalization method to scale the time series data to the range of [0, 1]. The calculation formula is as follows: Among them, x is the original data, x′ is the normalized data, and x min is the minimum value in the data set, x max is the maximum value in the data set; (2) The normalized data samples are divided into training set, validation set and test set in the ratio of 8:1:
1.
8. The charging module fault diagnosis system based on a temporal convolutional network according to claim 6, characterized in that: The model building module includes the following units: The dilated convolutional layer unit is used to construct four parallel dilated convolutional layers. After the input data passes through the dilated convolutional layer, it is spliced according to the channel dimension to obtain the spliced feature map; A compression excitation unit is used to weight the spliced feature maps using a compression excitation SE module to obtain a fused feature map; The pooling layer unit is used to perform global average pooling on the weighted feature map and generate spatial attention weights through two fully connected layers; The feature enhancement unit is used to perform element-wise multiplication of the fused feature map and the spatial attention weight to obtain the features after attention weighting of multi-time scale feature information; The TCN layer unit is used to input the features obtained by the feature enhancement unit into two TCN layers, further extract the time-dependent features, and then enhance the feature expression ability through the attention mechanism CBAM module; The output unit is used to pass the output of the TCN layer unit through the dropout layer, so that the neurons stop working randomly with a probability of 60%, and output the classification results through the fully connected layer.
9. The charging module fault diagnosis system based on a temporal convolutional network according to claim 8, characterized in that: The four parallel dilated convolutional layers described in the dilated convolutional layer unit have different dilation rates, namely 1, 2, 4, and 8; the shape of its input data is (5,160), that is, 5 channels, each channel has 160 data points; the output size of the dilated convolution is as follows: Where output_length is the output size, dilation is the dilation rate, kernel_size = 3, stride = 1, padding = 1; The size of the feature map after splicing according to the channel dimension is (20,160).
10. The charging module fault diagnosis system based on a temporal convolutional network according to claim 8, characterized in that: The fused feature map described in the compression excitation unit is as follows: Among them F 融合 Represents the fused feature map, F i Represents the i-th feature map, weight vector w=[w1,w2,w3,w4], w i represents the weight of the i-th feature map.