Current transformer fault diagnosis method and system
By adopting the CNN-LSTM model in the fault diagnosis of current transformer and fusing the timing attention mechanism, the problem of insufficient feature extraction in the prior art is solved, and the recognition accuracy of complex faults is improved.
Patent Information
- Application Number
- CN202411875016.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art is difficult to fully extract features in the diagnosis of current transformer faults, especially the identification accuracy of complex drift faults and noise faults is insufficient.
Using a current sensor fault diagnosis method based on the new CNN series LSTM and fused the timing attention mechanism, the spatial characteristics of three-phase current are extracted through two-dimensional CNN, and the LSTM extracts the timing relationship between the output feature maps of the convolutional neural network, and finally the characteristics of each time step are weighted through the timing attention mechanism.
Improve the accuracy of current transformer fault diagnosis, especially in identifying complex drift faults and noise faults, and enhance the feature extraction capability of complex three-phase current fault waveforms.
Smart Images

Figure CN119828061A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power detection, and in particular to a current transformer fault diagnosis method and system thereof. Background Art
[0002] The residual current detection device is an electrical protection device widely used in power systems to detect the residual current that may exist in the circuit to protect personnel from electric shock accidents caused by leakage of electrical equipment and effectively avoid electrical safety hazards such as fire. The residual current detection device usually uses a current transformer to detect the current imbalance in the circuit. As the core component of the residual current detection device, the current transformer is prone to various faults after long-term use. These state types mainly include: open circuit fault, drift fault, noise fault, etc. The occurrence of each fault will have different degrees of impact on the performance of the current transformer, thereby affecting the accuracy and reliability of the residual current detection device.
[0003] The fault diagnosis methods of current transformers mainly include model-based methods and data-driven methods. The model-based method mainly relies on the mathematical model of the current transformer detection object. By establishing accurate physical and electrical models, its working principle and possible failure mode are deduced, and then the fault is identified by comparing with the actual measurement results. However, the model-based method needs to establish different mathematical models for different detection objects. The complexity of these models varies, which greatly increases the difficulty of implementation. The data-driven method mainly relies on extracting rules and features from a large amount of historical data or real-time data through technologies such as big data analysis and machine learning, and then identifying the faults of current transformers. In the context of the continuous development of big data and artificial intelligence technology, data-driven methods have gradually become the mainstream choice in the field of current transformer fault diagnosis due to their advantages of less dependence on physical models, strong adaptability, and ability to handle unknown fault modes. For example, the Chinese invention patent application with publication number CN117972561A, "A current sensor fault diagnosis method based on multi-channel convolutional neural network", includes: first, establishing a mathematical model of the current sensor under four fault modes of open circuit, hysteresis, gain, and offset, and then obtaining the original three-phase current data under normal mode and four typical fault modes to form a data set, constructing a three-channel global pooling one-dimensional convolutional neural network, taking the three-phase current data as the input layer, and the predicted classification of the input data as the output, using the cross entropy cost function as the evaluation index to adjust the network structure and hyperparameters, selecting the optimal network, and realizing four current sensor fault diagnosis. However, the above scheme only considers four fault types of open circuit, hysteresis gain, and offset, and only uses the convolutional neural network to extract spatial features from the original three-phase current, which may lose the time series features. Summary of the invention
[0004] The technical problem to be solved by the present invention is how to fully perform feature extraction to improve the accuracy of current transformer fault diagnosis.
[0005] The present invention adopts the following technical solutions to solve the above technical problems:
[0006] In view of the defects of the prior art, the present invention further considers more complex drift faults and noise faults, and proposes a current sensor fault diagnosis method based on a new CNN in series with LSTM and fusion of a temporal attention mechanism. The spatial features of the three-phase current are extracted by a two-dimensional CNN, and the temporal relationship between the feature graphs output by the convolutional neural network is extracted by LSTM. Finally, the features of each time step are weighted and output by the temporal attention mechanism, which enhances the feature extraction capability for complex three-phase current fault waveforms and improves the fault diagnosis accuracy. The method comprises the following steps:
[0007] S1. Establish four current transformer state models;
[0008] S2. Collect three-phase current data under different state types, assign labels to each data sample, create a current transformer state data set, divide the data set into a training set, a validation set, and a test set according to a fixed ratio, and complete the data standardization process;
[0009] S3. Construct a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism, train the model through the training set, and obtain the current transformer fault diagnosis model to be tested;
[0010] S4. Test the accuracy of the current transformer fault diagnosis model to be tested through the test set to verify the generalization performance of the model.
[0011] Furthermore, the current transformer state type model described in step S1 includes: normal state, open circuit fault state, drift fault state and noise fault state; the state type model is specifically:
[0012] Assume i x ,x=a,b,c is the current data of one phase of the three-phase current output by the current transformer, i nor is the output current in normal state, t is the current time point, t f is the failure time point;
[0013] When an open circuit fault occurs in the current transformer, the measured value is constant at zero, as shown below:
[0014]
[0015] When a current transformer drifts, a function that changes linearly with time is superimposed on the measured value, as shown below:
[0016]
[0017] Where a is an arbitrary constant, indicating the severity of the drift fault;
[0018] When a noise fault occurs in the current transformer, a white noise function is superimposed on the measured value, which is expressed as follows:
[0019]
[0020] Where δ(t) is a typical uniformly distributed white noise function.
[0021] Furthermore, the step S2 comprises the following steps:
[0022] S21, setting different load values, collecting three-phase current data under different state types at a sampling frequency of 10 kHz, and each group of collected data is a time series of 1 second in length;
[0023] S22. Create a current transformer state data set, randomly select an initial point from a 1-second time series, sequentially intercept 400 data points as a sample, the size of each sample is (3,400), and divide the corresponding labels, repeating 200 times;
[0024] S23, divide the data into training set, validation set and test set, of which 60% is used as training set, 20% is used as validation set and 20% is used as test set;
[0025] S24. Standardize all samples in the column dimension so that the mean is 0 and the standard deviation is 1. The calculation formula is as follows:
[0026]
[0027] In the formula, x is the data before standardization, is the standardized data, X is a set of data for each sample in the column dimension, mean(X) is the mean of X, and std(X) is the standard deviation of X.
[0028] Furthermore, step S3 includes the following steps:
[0029] S31. Build a CNN model, including 2 convolutional layers, 2 maximum pooling layers, and 2 batch normalization layers. The size of the convolution kernel is 2×2, and the number of output feature maps is 20.
[0030] S32, build LSTM model, time step is 20, input m t , t=1,2…,20 is of shape (100,1), output h t, the shape size of t=1,2…,20 is (1,1000);
[0031] S33, build a temporal attention mechanism layer, and pay attention to the output h of LSTM's 20 time steps t Perform dynamic weighting;
[0032] S34, generating a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism according to the CNN model, the LSTM model, the temporal attention mechanism layer, and the fully connected layer connection model;
[0033] S35. Train the current transformer fault diagnosis model through the training set, use the three-phase current data as the input vector group, and the probability of the current transformer state type corresponding to the label as the output vector. After the training is completed, the current transformer fault diagnosis model to be tested is obtained.
[0034] Furthermore, the step S33 includes the following steps:
[0035] S331, define a query matrix Q, whose shape and size are (1000, 1), which is a trainable parameter; construct a two-dimensional matrix H with a shape and size of (20, 1000) from the outputs of 20 time steps;
[0036] S332. Calculate the attention score matrix K of each time step, the shape size is (20,1), and the calculation formula is as follows:
[0037] K=HQ
[0038] Where K = [k1, k2...k t ,...k 20 ],k t is the attention score at the tth time step;
[0039] S333. The attention scores of each time step are normalized by the softmax activation function to obtain the weight W of each time step, with a shape size of (20,1). The calculation formula is as follows:
[0040] W = softmax(K)
[0041] S334. Calculate the output Y of the temporal attention mechanism layer after weighting each time step. The shape size is (1,1000). The calculation formula is as follows:
[0042] Y=W T H
[0043] The present invention also provides a current transformer fault diagnosis system, wherein the system adopts the above method when it is running, including:
[0044] A state establishment module is used to establish four current transformer state models;
[0045] The data processing module is used to collect three-phase current data under different state types, assign labels to each data sample, produce a current transformer state data set, divide the data set into a training set, a validation set, and a test set according to a fixed ratio, and complete the data standardization processing;
[0046] The model building module is used to build a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism, and train the model through the training set to obtain the current transformer fault diagnosis model to be tested;
[0047] The verification module is used to test the accuracy of the current transformer fault diagnosis model to be tested through a test set to verify the generalization performance of the model.
[0048] Furthermore, the specific execution mode of the state establishment module is:
[0049] Classified according to normal state, open circuit fault state, drift fault state and noise fault state; the state type model is specifically:
[0050] Assume i x ,x=a,b,c is the current data of one phase of the three-phase current output by the current transformer, i nor is the output current in normal state, t is the current time point, t f is the failure time point;
[0051] When an open circuit fault occurs in the current transformer, the measured value is constant at zero, as shown below:
[0052]
[0053] When a current transformer drifts, a function that changes linearly with time is superimposed on the measured value, as shown below:
[0054]
[0055] Where a is an arbitrary constant, indicating the severity of the drift fault;
[0056] When a noise fault occurs in the current transformer, a white noise function is superimposed on the measured value, which is expressed as follows:
[0057]
[0058] Where δ(t) is a typical uniformly distributed white noise function.
[0059] Furthermore, the data processing module includes the following units:
[0060] The data acquisition unit is used to set different load values and collect three-phase current data under different state types at a sampling frequency of 10kHz. Each set of collected data is a time series of 1 second in length.
[0061] The label assignment unit is used to make the current transformer state data set. The initial point is randomly selected from the time series of 1 second in length, and 400 data points are sequentially intercepted as a sample. The size of each sample is (3,400), and the corresponding labels are divided. This is repeated 200 times.
[0062] A data partitioning unit is used to divide the data into a training set, a validation set, and a test set, where 60% of the data is used as a training set, 20% as a validation set, and 20% as a test set;
[0063] The standardization processing unit is used to standardize all samples in the column dimension so that the mean is 0 and the standard deviation is 1. The calculation formula is as follows:
[0064]
[0065] In the formula, x is the data before standardization, is the standardized data, X is a set of data for each sample in the column dimension, mean(X) is the mean of X, and std(X) is the standard deviation of X.
[0066] Furthermore, the model building module includes the following units:
[0067] CNN model construction unit, used to construct a CNN model, including 2 convolutional layers, 2 maximum pooling layers, and 2 batch normalization layers. The size of the convolution kernel is 2×2, and the number of output feature maps is 20;
[0068] LSTM model building unit, used to build LSTM model, with 20 time steps and input m t , t=1,2…,20 is of shape (100,1), output h t , the shape size of t=1,2...,20 is (1,1000);
[0069] The attention mechanism layer construction unit is used to construct the temporal attention mechanism layer for the 20 time steps of the LSTM output h t Perform dynamic weighting;
[0070] A model combination unit is used to generate a CNN-LSTM current transformer fault diagnosis model integrating a temporal attention mechanism according to the CNN model, the LSTM model, the temporal attention mechanism layer, and the fully connected layer connection model;
[0071] The model training unit is used to train the current transformer fault diagnosis model through the training set, with the three-phase current data as the input vector group and the probability of the current transformer state type corresponding label as the output vector. After the training is completed, the current transformer fault diagnosis model to be tested is obtained.
[0072] Furthermore, the attention mechanism layer building unit includes the following components:
[0073] The query matrix component is used to define the query matrix Q, which has a shape of (1000, 1) and is a trainable parameter. The output of 20 time steps is formed into a two-dimensional matrix H, which has a shape of (20, 1000).
[0074] The score matrix calculation component is used to calculate the attention score matrix K of each time step. The shape size is (20,1) and the calculation formula is as follows:
[0075] K=HQ
[0076] Where K = [k1, k2...k t ,...k 20 ],k t is the attention score at the tth time step;
[0077] The weight calculation component is used to normalize the attention scores of each time step through the softmax activation function to obtain the weight W of each time step. The shape and size are (20,1). The calculation formula is as follows:
[0078] W = softmax(K)
[0079] The output component is used to calculate the output Y of the temporal attention mechanism layer after weighting each time step. The shape size is (1,1000) and the calculation formula is as follows:
[0080] Y=W T H.
[0081] The present invention has the following advantages:
[0082] (1) The present invention takes into account the drift fault and noise fault of the current transformer which are rarely considered in the prior art. The CNN-LSTM model proposed in the present invention sets each time step of the LSTM as the feature map output of the CNN, which can better extract the temporal dependency between the feature maps output by the CNN.
[0083] (2) The present invention dynamically weights the output of each time step of LSTM through the temporal attention mechanism, thereby enhancing the model's feature extraction capability for complex micro signals and improving the accuracy of fault diagnosis.
[0084] (3) Compared with the traditional CNN-LSTM model, the CNN-LSTM current transformer fault diagnosis method integrated with the temporal attention mechanism proposed in the present invention can identify some difficult-to-distinguish current transformer drift faults, and the probability of fault error reporting is lower. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] Figure 1 This is a flow chart of a current transformer fault diagnosis method according to Embodiment 1 of the present invention;
[0086] Figure 2 This is a schematic diagram of the overall structure of the CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism according to Example 1 of the present invention;
[0087] Figure 3 Schematic diagram of the temporal attention mechanism structure of embodiment 1 of the present invention;
[0088] Figure 4 It is a training curve of the CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism according to Example 1 of the present invention;
[0089] Figure 5 The test set confusion matrix of the traditional CNN-LSTM current transformer fault diagnosis model in Example 1 of the present invention;
[0090] Figure 6 This is the test set confusion matrix of the CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism in Example 1 of the present invention. DETAILED DESCRIPTION
[0091] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0092] Example 1
[0093] This embodiment provides a current transformer fault diagnosis method, such as Figure 1 As shown, the following steps are included:
[0094] S1. Establish a current transformer state type model; the current transformer state type model includes: normal state, open circuit fault state, drift fault state and noise fault state; the state type model is specifically:
[0095] Assume i x,x=a,b,c is the current data of one phase of the three-phase current output by the current transformer, i nor is the output current in normal state, t is the current time point, t f is the failure time point;
[0096] When an open circuit fault occurs in the current transformer, the measured value is constant at zero, as shown below:
[0097]
[0098] When a current transformer drifts, a function that changes linearly with time is superimposed on the measured value, as shown below:
[0099]
[0100] Where a is an arbitrary constant, indicating the severity of the drift fault;
[0101] When a noise fault occurs in the current transformer, a white noise function is superimposed on the measured value, which is expressed as follows:
[0102]
[0103] Where δ(t) is a typical uniformly distributed white noise function.
[0104] S2, collecting three-phase current data under different state types, assigning labels to each data sample, making a current transformer state data set, dividing the data set into a training set, a validation set and a test set according to a fixed ratio, and completing the data standardization processing; specifically including the following steps:
[0105] S21, set different load values, collect three-phase current data under different state types at a sampling frequency of 10kHz, and each group of collected data has a time series of 1 second in length;
[0106] S22. Create a current transformer fault data set, randomly select an initial point from a 1-second time series, sequentially intercept 400 data points as a sample, the shape size of each sample is (3,400), and divide the corresponding labels, repeat 200 times;
[0107] S23, divide the data into training set, validation set and test set, of which 60% is used as training set, 20% is used as validation set and 20% is used as test set;
[0108] S24. Standardize all samples in the column dimension so that the mean is 0 and the standard deviation is 1. The calculation formula is as follows:
[0109]
[0110] In the formula, x is the data before standardization, is the standardized data, X is a set of data for each sample in the column dimension, mean(X) is the mean of X, and std(X) is the standard deviation of X.
[0111] S3. Construct a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism, train the model through the training set, and obtain the current transformer fault diagnosis model to be tested; Figure 2 As shown, the specific steps include:
[0112] S31. Build a CNN model, including 2 convolutional layers, 2 maximum pooling layers, and 2 batch normalization layers. The size of the convolution kernel is 2×2, and the number of output feature maps is 20.
[0113] S32, build LSTM model, time step is 20, input m t , t=1,2...,20 is of shape (100,1), output h t , the shape size of t=1,2…,20 is (1,1000);
[0114] S33, build a temporal attention mechanism layer, and pay attention to the output h of LSTM's 20 time steps t Perform dynamic weighting; Figure 3 As shown, the step S33 further includes the following steps:
[0115] S331, define a query matrix Q, whose shape and size are (1000, 1), which is a trainable parameter, and form a two-dimensional matrix H with a shape and size of (20, 1000) from the outputs of 20 time steps;
[0116] S332. Calculate the attention score matrix K of each time step, the shape size is (20,1), and the calculation formula is as follows:
[0117] K=HQ
[0118] Where K = [k1, k2...k t ,...k 20 ],k t is the attention score at the tth time step;
[0119] S333. The attention scores of each time step are normalized by the softmax activation function to obtain the weight W of each time step, with a shape size of (20,1). The calculation formula is as follows:
[0120] W = softmax(K)
[0121] S334. Calculate the output Y of the temporal attention mechanism layer after weighting each time step. The shape size is (1,1000). The calculation formula is as follows:
[0122] Y=W T H
[0123] The output Y of the temporal attention mechanism layer is input to the subsequent fully connected layer, and the fully connected layer outputs the current transformer fault classification result.
[0124] S34, generating a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism according to the CNN model, the LSTM model, the temporal attention mechanism layer, and the fully connected layer connection model;
[0125] S35, training a current transformer fault diagnosis model through a training set, using three-phase current data as an input vector group, and the probability of the current transformer state type corresponding to the label as an output vector, and obtaining a current transformer fault diagnosis model to be tested after the training is completed;
[0126] S4. Test the accuracy of the current transformer fault diagnosis model to be tested through the test set to verify the generalization performance of the model.
[0127] In this embodiment, in order to verify the effectiveness of the method, the accuracy of the current transformer fault diagnosis method proposed in the present invention was tested, and a comparative test was performed with the traditional CNN-LSTM model.
[0128] The current transformer status type labels are shown in Table 1:
[0129] Table 1
[0130] Status Type Label Normal state 0 A, B, C phase open circuit fault 1、2、3 A, B, C phase drift fault 4、5、6 A, B, C phase noise fault 7、8、9
[0131] like Figure 4 As shown, the CNN-LSTM current transformer fault diagnosis model integrated with the temporal attention mechanism provided by the present invention was trained for 100 rounds and converged in about 70 rounds. The accuracy of the test set reached 98.7%, which is higher than the traditional CNN-LSTM model.
[0132] like Figure 5 The test set confusion matrix of the traditional CNN-LSTM current transformer fault diagnosis model shown in Figure 6The test set confusion matrix of the CNN-LSTM current transformer fault diagnosis model with integrated timing attention mechanism is shown. By comparison, it can be seen that the accuracy of the two methods is consistent in normal state, open circuit fault and noise fault. Since the drift coefficient of a part of the samples is small, it is very easy to be confused with the normal working condition. Therefore, the error of the two methods mainly appears between the drift fault and the normal state. By comparison, it can be seen that the CNN-LSTM current transformer fault diagnosis method with integrated timing attention mechanism proposed in the present invention can identify a part of the current transformer drift faults that are difficult to distinguish, and the probability of fault error reporting is smaller than that of the traditional CNN-LSTM model, which proves that the method described in the present invention is more accurate in extracting and identifying fault timing features, enhances the feature extraction capability for complex three-phase current fault waveforms, and improves the diagnostic accuracy of current transformer faults.
[0133] Example 2
[0134] Based on the same inventive concept, this embodiment further provides a current transformer fault diagnosis system, and the method described in the embodiment is used when the system is running, including:
[0135] The state establishment module is used to establish four current transformer state models; the specific execution mode of the state establishment module is as follows:
[0136] Classified according to normal state, open circuit fault state, drift fault state and noise fault state; the state type model is specifically:
[0137] Assume i x ,x=a,b,c is the current data of one phase of the three-phase current output by the current transformer, i nor is the output current in normal state, t is the current time point, t f is the failure time point;
[0138] When an open circuit fault occurs in the current transformer, the measured value is constant at zero, as shown below:
[0139]
[0140] When a current transformer drifts, a function that changes linearly with time is superimposed on the measured value, as shown below:
[0141]
[0142] Where a is an arbitrary constant, indicating the severity of the drift fault;
[0143] When a noise fault occurs in the current transformer, a white noise function is superimposed on the measured value, which is expressed as follows:
[0144]
[0145] Where δ(t) is a typical uniformly distributed white noise function.
[0146] The data processing module is used to collect three-phase current data under different state types, assign labels to each data sample, produce a current transformer state data set, divide the data set into a training set, a validation set and a test set according to a fixed ratio, and complete the data standardization processing; the data processing module includes the following units:
[0147] The data acquisition unit is used to set different load values and collect three-phase current data under different state types at a sampling frequency of 10kHz. Each set of collected data is a time series of 1 second in length.
[0148] The label assignment unit is used to make the current transformer state data set. The initial point is randomly selected from the time series of 1 second in length, and 400 data points are sequentially intercepted as a sample. The size of each sample is (3,400), and the corresponding labels are divided. This is repeated 200 times.
[0149] A data partitioning unit is used to divide the data into a training set, a validation set, and a test set, where 60% of the data is used as a training set, 20% as a validation set, and 20% as a test set;
[0150] The standardization processing unit is used to standardize all samples in the column dimension so that the mean is 0 and the standard deviation is 1. The calculation formula is as follows:
[0151]
[0152] In the formula, x is the data before standardization, is the standardized data, X is a set of data for each sample in the column dimension, mean(X) is the mean of X, and std(X) is the standard deviation of X.
[0153] The model building module is used to build a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism, and train the model through the training set to obtain the current transformer fault diagnosis model to be tested; the model building module includes the following units:
[0154] CNN model construction unit, used to construct a CNN model, including 2 convolutional layers, 2 maximum pooling layers, and 2 batch normalization layers. The size of the convolution kernel is 2×2, and the number of output feature maps is 20;
[0155] LSTM model building unit, used to build LSTM model, with 20 time steps and input m t , t=1,2...,20 is of shape (100,1), output ht , the shape size of t=1,2...,20 is (1,1000);
[0156] The attention mechanism layer construction unit is used to construct the temporal attention mechanism layer for the 20 time steps of the LSTM output h t Dynamic weighting is performed; the attention mechanism layer construction unit includes the following components:
[0157] The query matrix component is used to define the query matrix Q, which has a shape of (1000, 1) and is a trainable parameter. The output of 20 time steps is formed into a two-dimensional matrix H, which has a shape of (20, 1000).
[0158] The score matrix calculation component is used to calculate the attention score matrix K of each time step. The shape size is (20,1) and the calculation formula is as follows:
[0159] K=HQ
[0160] Where K = [k1, k2...k t ,...k 20 ],k t is the attention score at the tth time step;
[0161] The weight calculation component is used to normalize the attention scores of each time step through the softmax activation function to obtain the weight W of each time step. The shape and size are (20,1). The calculation formula is as follows:
[0162] W = softmax(K)
[0163] The output component is used to calculate the output Y of the temporal attention mechanism layer after weighting each time step. The shape size is (1,1000) and the calculation formula is as follows:
[0164] Y=W T H.
[0165] A model combination unit is used to generate a CNN-LSTM current transformer fault diagnosis model integrating a temporal attention mechanism according to the CNN model, the LSTM model, the temporal attention mechanism layer, and the fully connected layer connection model;
[0166] The model training unit is used to train the current transformer fault diagnosis model through the training set, with the three-phase current data as the input vector group and the probability of the current transformer state type corresponding label as the output vector. After the training is completed, the current transformer fault diagnosis model to be tested is obtained.
[0167] The verification module is used to test the accuracy of the current transformer fault diagnosis model to be tested through a test set to verify the generalization performance of the model.
[0168] 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 the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. 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 embodiments of the present invention.
Claims
1. A current transformer fault diagnosis method, characterized in that: The following steps are involved: S1. Establish four current transformer state models; S2. Collect three-phase current data under different state types, assign labels to each data sample, create a current transformer state data set, divide the data set into a training set, a validation set, and a test set according to a fixed ratio, and complete the data standardization process; S3. Construct a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism, train the model through the training set, and obtain the current transformer fault diagnosis model to be tested; S4. Test the accuracy of the current transformer fault diagnosis model to be tested through the test set to verify the generalization performance of the model.
2. A current transformer fault diagnosis method according to claim 1, characterized in that: The current transformer state type model described in step S1 includes: normal state, open circuit fault state, drift fault state and noise fault state; the state type model is specifically: Assume i x ,x=a,b,c is the current data of one phase of the three-phase current output by the current transformer, i nor is the output current in normal state, t is the current time point, t f is the failure time point; When an open circuit fault occurs in the current transformer, the measured value is constant at zero, as shown below: When a current transformer drifts, a function that changes linearly with time is superimposed on the measured value, as shown below: Where a is an arbitrary constant, indicating the severity of the drift fault; When a noise fault occurs in the current transformer, a white noise function is superimposed on the measured value, which is expressed as follows: Where δ(t) is a typical uniformly distributed white noise function.
3. A current transformer fault diagnosis method according to claim 1, characterized in that: The step S2 comprises the following steps: S21, setting different load values, collecting three-phase current data under different state types at a sampling frequency of 10 kHz, and each group of collected data is a time series of 1 second in length; S22. Create a current transformer state data set, randomly select an initial point from a 1-second time series, sequentially intercept 400 data points as a sample, the size of each sample is (3,400), and divide the corresponding labels, repeating 200 times; S23, divide the data into training set, validation set and test set, of which 60% is used as training set, 20% is used as validation set and 20% is used as test set; S24. Standardize all samples in the column dimension so that the mean is 0 and the standard deviation is 1. The calculation formula is as follows: In the formula, x is the data before standardization, is the standardized data, X is a set of data for each sample in the column dimension, mean(X) is the mean of X, and std(X) is the standard deviation of X.
4. A current transformer fault diagnosis method according to claim 1, wherein step S3 comprises the following steps: S31. Build a CNN model, including 2 convolutional layers, 2 maximum pooling layers, and 2 batch normalization layers. The size of the convolution kernel is 2×2, and the number of output feature maps is 20. S32, build LSTM model, time step is 20, input m t , t=1,2...,20 is of shape (100,1), output h t , the shape size of t=1,2...,20 is (1,1000); S33, build a temporal attention mechanism layer, and pay attention to the output h of LSTM's 20 time steps t Perform dynamic weighting; S34, generating a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism according to the CNN model, the LSTM model, the temporal attention mechanism layer, and the fully connected layer connection model; S35. Train the current transformer fault diagnosis model through the training set, use the three-phase current data as the input vector group, and the probability of the current transformer state type corresponding to the label as the output vector. After the training is completed, the current transformer fault diagnosis model to be tested is obtained.
5. A current transformer fault diagnosis method according to claim 4, wherein step S33 comprises the following steps: S331, define a query matrix Q, whose shape and size are (1000, 1), which is a trainable parameter; construct a two-dimensional matrix H with a shape and size of (20, 1000) from the outputs of 20 time steps; S332. Calculate the attention score matrix K of each time step, the shape size is (20,1), and the calculation formula is as follows: K=HQ Where K = [k1, k2...k t ,...k 20 ],k t is the attention score at the tth time step; S333. The attention scores of each time step are normalized by the softmax activation function to obtain the weight W of each time step, with a shape size of (20,1). The calculation formula is as follows: W = softmax(K) S334. Calculate the output Y of the temporal attention mechanism layer after weighting each time step. The shape size is (1,1000). The calculation formula is as follows: Y=W T H。 6. A current transformer fault diagnosis system, characterized in that: include: A state establishment module is used to establish four current transformer state models; The data processing module is used to collect three-phase current data under different state types, assign labels to each data sample, produce a current transformer state data set, divide the data set into a training set, a validation set, and a test set according to a fixed ratio, and complete the data standardization processing; The model building module is used to build a CNN-LSTM current transformer fault diagnosis model integrating the temporal attention mechanism, and train the model through the training set to obtain the current transformer fault diagnosis model to be tested; The verification module is used to test the accuracy of the current transformer fault diagnosis model to be tested through a test set to verify the generalization performance of the model.
7. A current transformer fault diagnosis system according to claim 6, characterized in that: The specific execution mode of the state establishment module is: Classified according to normal state, open circuit fault state, drift fault state and noise fault state; the state type model is specifically: Assume i x ,x=a,b,c is the current data of one phase of the three-phase current output by the current transformer, i nor is the output current in normal state, t is the current time point, t f is the failure time point; When an open circuit fault occurs in the current transformer, the measured value is constant at zero, as shown below: When a current transformer drifts, a function that changes linearly with time is superimposed on the measured value, as shown below: Where a is an arbitrary constant, indicating the severity of the drift fault; When a noise fault occurs in the current transformer, a white noise function is superimposed on the measured value, which is expressed as follows: Where δ(t) is a typical uniformly distributed white noise function.
8. A current transformer fault diagnosis system according to claim 6, characterized in that: The data processing module includes the following units: The data acquisition unit is used to set different load values and collect three-phase current data under different state types at a sampling frequency of 10kHz. Each set of collected data is a time series of 1 second in length. The label assignment unit is used to make the current transformer state data set. The initial point is randomly selected from the time series of 1 second in length, and 400 data points are sequentially intercepted as a sample. The size of each sample is (3,400), and the corresponding labels are divided. This is repeated 200 times. A data partitioning unit is used to divide the data into a training set, a validation set, and a test set, where 60% of the data is used as a training set, 20% as a validation set, and 20% as a test set; The standardization processing unit is used to standardize all samples in the column dimension so that the mean is 0 and the standard deviation is 1. The calculation formula is as follows: In the formula, x is the data before standardization, is the standardized data, X is a set of data for each sample in the column dimension, mean(X) is the mean of X, and std(X) is the standard deviation of X.
9. A current transformer fault diagnosis system according to claim 6, characterized in that: The model building module includes the following units: CNN model construction unit, used to construct a CNN model, including 2 convolutional layers, 2 maximum pooling layers, and 2 batch normalization layers. The size of the convolution kernel is 2×2, and the number of output feature maps is 20; LSTM model building unit, used to build LSTM model, with 20 time steps and input m t , t=1,2...,20 is of shape (100,1), output h t , the shape size of t=1,2...,20 is (1,1000); The attention mechanism layer construction unit is used to construct the temporal attention mechanism layer for the 20 time steps of the LSTM output h t Perform dynamic weighting; A model combination unit is used to generate a CNN-LSTM current transformer fault diagnosis model integrating a temporal attention mechanism according to the CNN model, the LSTM model, the temporal attention mechanism layer, and the fully connected layer connection model; The model training unit is used to train the current transformer fault diagnosis model through the training set, with the three-phase current data as the input vector group and the probability of the current transformer state type corresponding label as the output vector. After the training is completed, the current transformer fault diagnosis model to be tested is obtained.
10. A current transformer fault diagnosis system according to claim 9, characterized in that: The attention mechanism layer building unit includes the following components: The query matrix component is used to define the query matrix Q, which has a shape of (1000, 1) and is a trainable parameter. The output of 20 time steps is formed into a two-dimensional matrix H, which has a shape of (20, 1000). The score matrix calculation component is used to calculate the attention score matrix K of each time step. The shape size is (20,1) and the calculation formula is as follows: K=HQ Where K = [k1, k2...k t ,…k 20 ],k t is the attention score at the tth time step; The weight calculation component is used to normalize the attention scores of each time step through the softmax activation function to obtain the weight W of each time step. The shape and size are (20,1). The calculation formula is as follows: W = softmax(K) The output component is used to calculate the output Y of the temporal attention mechanism layer after weighting each time step. The shape size is (1,1000) and the calculation formula is as follows: Y=W T H。
Citation Information
Patent Citations
Current sensor fault diagnosis method based on multi-channel convolutional neural network
CN117972561A
Cited By
Current phase sequence automatic identification method and system
CN120632741A
Fluidized bed caking and wear fault parallel prediction method and device based on GATT-CNN-LSTM
CN120822136A
Fan fault prediction method and device, electronic equipment and storage medium
CN121092942A
Fan fault prediction method and device, electronic equipment and storage medium
CN121092942B