A voltage transformer fault diagnosis method based on DTW-KNN-LSTM algorithm
The DTW-KNN-LSTM algorithm is used to diagnose faults of voltage transformers, which solves the problem of insufficient capture of nonlinear relationships in existing methods and realizes fast and accurate fault diagnosis and temperature trend warning of voltage transformers.
Patent Information
- Application Number
- CN202410960655.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-07-17
AI Technical Summary
Existing voltage transformer fault diagnosis methods such as ARIMA and RNN cannot effectively capture nonlinear relationships, resulting in inaccurate fault diagnosis and the existence of gradient vanishing and explosion problems.
A voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm is adopted. The sequences are aligned using the dynamic time warping (DTW) algorithm, and the K-nearest neighbor (KNN) algorithm and the long short-term memory network (LSTM) are combined for fault sample matching and classification, realizing online and offline analysis of PT temperature measurement data.
It achieves fast and accurate fault diagnosis of voltage transformers, can provide real-time warning of abnormal temperature, and discover temperature trends through vertical and horizontal comparisons, thus improving the accuracy and efficiency of fault warning.
Smart Images

Figure CN119046784B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power equipment fault diagnosis, and in particular to a voltage transformer fault diagnosis method based on a DTW-KNN-LSTM algorithm. Background Art
[0002] Voltage transformer (hereinafter referred to as PT) is a device for converting voltage. It is mainly used to supply power to the measuring instruments and relay protection devices equipped in the generator set. It can be used to measure line voltage, power and electric energy parameters, and can also protect important equipment in the line when a line fault occurs.
[0003] Most faults and accidents in power equipment manifest as temperature anomalies. When a device fails or experiences an anomaly, the temperature rise at the corresponding fault point will be extremely obvious. Therefore, the temperature information of these components can be used as a reliable basis for power equipment status detection.
[0004] Thermal imaging temperature measurement uses non-contact technology to monitor the temperature and operating status of running equipment. It allows for simple, safe, intuitive, and accurate identification and diagnosis of equipment overheating faults, enabling prompt action to prevent electrical accidents. As a crucial component of a generator set, timely detection of internal defects is crucial to ensuring safe and reliable operation.
[0005] Currently, the autoregressive moving average (ARIMA) model and recurrent neural networks (RNN) are the primary methods used for voltage transformer fault diagnosis. However, ARIMA is a single-input, single-output prediction method that may overlook correlations between technical features. This method is unable to capture nonlinear relationships in the time series of relay protection device failure rates. Furthermore, RNNs, due to their simple neuron structure, suffer from severe vanishing and exploding gradient problems during training, making them incapable of accurately describing long-span nonlinear relationships. Summary of the Invention
[0006] The present invention aims to provide a method for diagnosing voltage transformer faults based on the DTW-KNN-LSTM algorithm, enabling faster, more efficient, and more effective online and offline analysis of PT temperature measurement data. This method not only provides real-time warnings of abnormal temperatures, but also compares three-phase PT temperature data at the same time vertically and historical data at the same temperature measurement point horizontally to form a temperature curve. This allows for better identification of temperature trends at specific PT points or regions, and provides early warnings of abnormal temperature trends.
[0007] In order to achieve the above technical features, the purpose of the present invention is achieved as follows:
[0008] A voltage transformer fault diagnosis method based on DTW-KNN-LSTM algorithm includes an interface layer, a service layer and a data layer;
[0009] The data layer uses a relational database for data storage;
[0010] The service layer interacts with the data layer, providing the required data to the service layer through the data layer, and performing data exchange with the service layer;
[0011] The interface layer is connected to the service layer, and the service layer feeds back calculation results to the interface layer and provides corresponding diagnosis and analysis results to users.
[0012] Preferably, the data layer is used to store a time series data table and a fault sample record table;
[0013] The time series data table stores the PT temperature measurement data, ambient temperature and ambient humidity data of each phase of the motor cabinet at each moment;
[0014] The fault sample record table stores the start time and end time of each fault sample, so that each standard fault sample can be quickly queried in the time series data table; at the same time, the fault type corresponding to each fault sample is stored in the table for algorithm comparison.
[0015] Preferably, the interface layer is provided with four request modules, including a historical model acquisition module, a fault editing module, a fault diagnosis module and a model retraining module;
[0016] The historical model acquisition module obtains each fault data sequence corresponding to the fault type expected by the user through the fault sample record table;
[0017] The fault editing module inputs a data sequence and a fault label edited by the user, and stores it in the fault sample record table;
[0018] The fault diagnosis module is divided into two modules: online fault diagnosis and offline fault diagnosis. The online fault diagnosis module receives real-time incoming data and comprehensively diagnoses whether there is a fault based on data from a past period of time. The offline fault diagnosis module performs a more detailed diagnosis based on the user-specified time interval data, and provides various possible faults and their probabilities, using the corresponding closest standard fault sample data as the analysis basis.
[0019] The model retraining module retrains and updates the online diagnosis model through the accumulated fault sample data.
[0020] Preferably, the service layer is divided into a basic business module and an algorithm module;
[0021] The basic business processing is to add, delete, modify and query data, realizing two major functions: data storage and data query;
[0022] The algorithm modules correspond to the different requirements of online and offline fault detection scenarios, respectively, and deploy different algorithm models to achieve corresponding functions; a supervised model is used for online fault diagnosis, and the model applicability and accuracy are continuously improved through regular training and updates.
[0023] Preferably, since fault diagnosis requires analyzing and returning the fault sample that is most similar to the test data, an algorithm is required to measure the distance between sequences, that is, the degree of similarity. Furthermore, considering that the sequence lengths of the fault sample and the test data often differ, the algorithm module uses the dynamic time warping (DTW) algorithm to fit two sample segments of different sequence lengths and measures their similarity based on this.
[0024] When comparing examples, there may be situations where two sequences have similar-shaped segments as a whole, but these segments are not aligned on the time axis. Based on this, before calculating the sequence distance, it is necessary to transform them on the time axis to achieve the alignment effect.
[0025] Preferably, the DTW algorithm calculates the similarity between the overall shapes of two time series by extending and shortening the time series. The cumulative distance between the two sequences a and b is calculated by the following recursive formula:
[0026] γ(i,j)=d(a i ,b j )+min{γ(i-1,j-1),γ(i-1,j),γ(i,j-1)};
[0027] Where d represents the distance between two points. Therefore, a regular path can be solved by the dynamic programming algorithm to minimize the cumulative distance of all corresponding points; i is the time sequence number of sequence a; j is the time sequence number of sequence b; γ(i, j) is the matching distance corresponding to the best matching path.
[0028] Preferably, considering the time complexity, the DTW algorithm uses the FastDTW algorithm to calculate the sequence distance. The FastDTW algorithm reduces the time complexity from O(n) to O(n) by a similar method of coarsening the granularity while keeping the calculation error at the percentile level. 2 ) is reduced to O(n) to improve the system response speed.
[0029] Preferably, the offline fault diagnosis module uses the KNN classification algorithm to calculate the fault category of each abnormal fragment in the data to be tested and the standard fault sample that is closest to it. The KNN algorithm does not require a model learning process. It uses the training data to divide the feature vector space and uses the division result as the final algorithm model. It only needs to maintain a sample data set to quickly calculate the correspondence between each data and its corresponding category, and then quickly feedback is provided for new faults edited by the user.
[0030] Preferably, considering the requirements of real-time online fault diagnosis on algorithm efficiency and fault accuracy, the online fault diagnosis module uses a classification algorithm based on the long short-term memory network (LSTM);
[0031] LSTM adds the states of neurons to the hidden layer, allowing the model to "memorize" historical inputs. The resulting feature vector covers important information of the entire time series data segment. Each neuron in the network uses three gating units to decide which information to pass backward: the forget gate uses the sigmoid layer to decide which information to "forget" based on the new input and the output of the previous moment, thereby preventing a large amount of outdated historical information from affecting the current processing. The input gate extracts valid information from the input data at the current moment and controls which parts of it should be added to the neuron. The output gate combines the neuron state and the current input to determine which information to output at the current moment.
[0032] Preferably, in the LSTM, h t-1 ,C t-1 Represent the output and neuron state of the previous moment respectively, h, C are initialized to zero; (W f ,b f ),(W i ,b f ),(W o ,b o ) represent the parameter matrices of the forget gate, input gate, and output gate, respectively. W, b are initialized with orthogonal initialization and zero initialization, respectively. The characteristic parameters f of historical information and current information are calculated. t ,i t , and calculate the current state feature C through the tanh layer t :
[0033] f t =σ(W f ·[h t-1 ,x t ]+b f );
[0034] i t =σ(W i ·[h t-1 ,x t ]+b i );
[0035] C t =f t ×C t-1 +i t ×tanh(W C ·[h t-1 ,x t ]+bC );
[0036] In the output gate, the output h at the current moment is calculated based on the current state and input features t :
[0037] h t =σ(W o ·[h t-1 ,x t ]+b o )×tanh(C t );
[0038] The LSTM feature encoder encodes the temporal features of the data into a feature vector, which is then classified by the Softmax multi-classifier to diagnose the device status. The cross-entropy loss function is used to measure the diagnosis result:
[0039]
[0040] Where: N is the number of samples per training round, K is the fault category, which measures the difference between the model output and the actual distribution and trains the model; loss(Y,P) is the diagnosis result, which is a cross entropy function; y ik is the actual probability distribution; p ik is the reference probability distribution.
[0041] The present invention has the following beneficial effects:
[0042] This invention utilizes a voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm to more quickly and efficiently analyze PT temperature measurement data both online and offline. This method not only provides real-time warnings of abnormal temperatures, but also compares three-phase PT temperature data at the same time vertically and historical data at the same temperature measurement point horizontally to form a temperature curve. This allows for better identification of temperature trends at specific PT points or regions, providing early warnings of abnormal temperature trends. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 This is a system structure diagram of the present invention.
[0045] Figure 2 This is a diagram of the dynamic time warping (DTW) algorithm of the present invention.
[0046] Figure 3 This is a flow chart of the offline fault diagnosis algorithm of the present invention.
[0047] Figure 4 This is the overall framework diagram of the real-time online fault diagnosis algorithm of the present invention.
[0048] Figure 5 This is a structural diagram of the real-time online fault diagnosis algorithm model of the present invention.
[0049] Figure 6 This is a structural diagram of the real-time online and offline models of the present invention.
[0050] Figure 7 This is a diagram of the simulation data training process of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0052] Example 1:
[0053] Referring to the figure, the present invention provides a voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm, including an interface layer, a service layer and a data layer; the data layer uses a relational database for data storage; the service layer is connected to the data layer, provides the required data to the service layer through the data layer, and exchanges data with the service layer; the interface layer is connected to the service layer, feeds back calculation results to the interface layer through the service layer, and provides corresponding diagnostic analysis results to the user.
[0054] Furthermore, the data layer is used to store a time series data table and a fault sample record table. The time series data table stores the PT temperature measurement data, ambient temperature, and ambient humidity data of each phase of the motor cabinet at each moment; the fault sample record table stores the start and end time of each fault sample, allowing for quick query of each standard fault sample in the time series data table. The table also stores the fault type corresponding to each fault sample for algorithm comparison.
[0055] Furthermore, the interface layer is provided with four request modules, including a historical model acquisition module, a fault editing module, a fault diagnosis module and a model retraining module.
[0056] Among them, the historical model acquisition module obtains each fault data sequence corresponding to the user's expected fault type through the fault sample record table; the fault editing module inputs a data sequence and the fault label edited by the user, and stores it in the fault sample record table; the fault diagnosis module is divided into two modules: online fault diagnosis and offline fault diagnosis. The online fault diagnosis module receives the real-time incoming data and comprehensively diagnoses whether there is a fault based on the data of the past period; the offline fault diagnosis module performs a more detailed diagnosis based on the time interval data specified by the user, and gives various possible faults and their probabilities, with the corresponding closest standard fault sample data as the analysis basis; the model retraining module retrains and updates the online diagnosis model through the accumulated fault sample data.
[0057] Furthermore, the service layer is divided into a basic business module and an algorithm module. The basic business module handles the addition, deletion, modification, and query of data, implementing two major functions: data storage and data query. The algorithm module responds to the different needs of online and offline fault detection scenarios, deploying different algorithm models to achieve the corresponding functions. For online fault diagnosis, a supervised model is used, and the model's applicability and accuracy are continuously improved through regular training and updates.
[0058] Example 2:
[0059] Because fault diagnosis requires analyzing and returning the fault samples most similar to the test data, an algorithm is required to measure the distance (degree of similarity) between sequences. Given that the sequence lengths of fault samples and test data often differ, the algorithm module uses the Dynamic Time Warping (DTW) algorithm to fit two sample segments of different sequence lengths and use this to measure their similarity.
[0060] See also Figure 2 Because two sequences may have similarly shaped segments during instance comparison, but these segments may not align on the time axis, they must be transformed on the time axis before calculating the sequence distance to achieve better alignment. DTW is an effective method for implementing this transformation. It calculates the similarity between the overall shapes of two time series by stretching and shortening them. The cumulative distance between two sequences a and b can be calculated using the following recursive formula:
[0061] γ(i,j)=d(a i ,b j )+min{γ(i-1,j-1),γ(i-1,j),γ(i,j-1)};
[0062] Where d represents the distance between two points. Therefore, a regular path can be solved by the dynamic programming algorithm to minimize the cumulative distance of all corresponding points; i is the time sequence number of sequence a; j is the time sequence number of sequence b; γ(i, j) is the matching distance corresponding to the best matching path.
[0063] Considering the time complexity, the FastDTW algorithm is used in the actual system to calculate the sequence distance. It uses a similar method of coarsening the granularity to reduce the time complexity from O(n 2 ) is reduced to O(n) to improve the system response speed.
[0064] Example 3:
[0065] Offline fault diagnosis uses the KNN classification algorithm to calculate the fault category and the most similar standard fault sample for each abnormal segment in the test data. The KNN algorithm does not have a general model learning process. It uses training data to divide the feature vector space and uses the division result as the final algorithm model. Therefore, only one sample data set needs to be maintained to quickly calculate the corresponding relationship between each data and its classification, so it can quickly provide feedback on new faults edited by users. The algorithm process is as follows Figure 3 shown.
[0066] Example 4:
[0067] See also Figure 4 , which is the overall framework diagram of the real-time online fault diagnosis algorithm. Considering the requirements of real-time online fault diagnosis for algorithm efficiency and fault accuracy, this module uses a classification algorithm based on the long short-term memory network (LSTM). LSTM adds the state of neurons in the hidden layer, so that the model can "memorize" historical inputs, and the obtained feature vector covers the important information of the entire time series data segment. Each neuron in the network decides which information needs to be passed backward through three gating units: the forget gate decides which information to "forget" through the sigmoid layer based on the new input and the output of the previous moment, thereby avoiding the influence of a large amount of outdated historical information on the current processing; the input gate extracts the valid information of the input data at the current moment, and controls which parts of it should be added to the neuron; the output gate combines the neuron state and the current input to decide which information to output at the current moment. Its model structure is as follows Figure 5 shown.
[0068] Preferably, in the LSTM, h t-1 ,C t-1 Represent the output and neuron state of the previous moment respectively, h, C are initialized to zero; (W f ,b f ),(W i,b f ),(W o ,b o ) represent the parameter matrices of the forget gate, input gate, and output gate, respectively. W, b are initialized with orthogonal initialization and zero initialization, respectively. The characteristic parameters f of historical information and current information are calculated. t ,i t , and calculate the current state feature C through the tanh layer t :
[0069] f t =σ(W f ·[h t-1 ,x t ]+b f );
[0070] i t =σ(W i ·[h t-1 ,x t ]+b i );
[0071] C t =f t ×C t-1 +i t ×tanh(W C ·[h t-1 ,x t ]+b C );
[0072] In the output gate, the output h at the current moment is calculated based on the current state and input features t :
[0073] h t =σ(W o ·[h t-1 ,x t ]+b o )×tanh(C t );
[0074] The LSTM feature encoder encodes the temporal features of the data into a feature vector, which is then classified by the Softmax multi-classifier to diagnose the device status. The cross-entropy loss function is used to measure the diagnosis result:
[0075]
[0076] Where: N is the number of samples per training round, K is the fault category, which measures the difference between the model output and the actual distribution and trains the model; loss(Y,P) is the diagnosis result, which is a cross entropy function; y ik is the actual probability distribution; p ikis the reference probability distribution. The real-time and offline combined model update mechanism is as follows Figure 6 shown.
[0077] Example 5:
[0078] Algorithm performance verification:
[0079] Based on the simulated data, the accuracy of real-time and offline fault diagnosis is tested. For real-time fault diagnosis, 2000 simulated data (4 types, 500 each) are randomly divided into training set, validation set and test set according to the ratio of 8:1:1. The model parameters are updated by RMSprop optimizer, with the initial learning rate set to 0.001 and batch_size set to 32. The training epoch is set to 200, and the training process is as follows: Figure 7 As shown:
[0080] The final model achieved an accuracy of 97.50% on the validation set. The model classification accuracy was verified on the test set, and the results are shown in Table 1 below. The columns represent the actual categories, and the rows represent the model output categories:
[0081] Table 1. Classification accuracy statistics of test set models
[0082] True category\model prediction normal Point Abnormality Linear fluctuation Sudden fluctuations total normal 46 0 0 0 46 Point Abnormality 0 53 0 0 53 Linear fluctuation anomaly 1 1 44 0 46 Abnormal sudden fluctuations 0 0 4 51 55 total 47 54 48 51 200
[0083] From this, we can calculate the model's precision, recall, and F1 score for each category:
[0084] Table 2 Statistics of the precision, recall and F1 score of the test set model
[0085] Indicator\Category normal Point Abnormality Linear fluctuation anomaly Abnormal sudden fluctuations total Precision Rate (PR) 97.87% 98.15% 91.67% 100% 96.92% Recall 100% 100% 95.65% 92.73% 97.10% F1 Score 98.92% 99.07% 93.62% 96.23% 97.00%
[0086] The results show that only 6 of the 200 test set data have classification deviations, and the diagnostic accuracy rate reaches 97%.
[0087] The experiment was conducted on 5 test data with different distributions. The results are shown in the following table. Each column in the table is the probability that the model diagnosed the sample as belonging to that type:
[0088] Table 3 Test data model diagnostic sample probability statistics
[0089] Sample\Category normal Point Abnormality Linear fluctuation anomaly Abnormal sudden fluctuations Sample 1 0.00143837 0.00160454 0.00566246 0.9912947 Sample 2 0.00143933 0.00160601 0.00566247 0.9912922 Sample 3 0.00143895 0.00160521 0.00566317 0.99129266 Sample 4 0.00143891 0.00160514 0.0056642 0.9912917 Sample 5 0.00143879 0.00160472 0.00566281 0.9912937
[0090] The results show that the test data was classified as sudden fluctuation anomaly with extremely high confidence, and the diagnostic accuracy reached 100%. It can be seen that the model can identify the category features in simulated data with different distributions and has good discrimination between normal and fault conditions.
[0091] For offline fault diagnosis, 40 simulated data points (4 types, 10 points per class) were randomly sampled as a sample library, and 576 simulated data points (4 types, 144 points per class) were used to test the diagnostic performance of the FastDTW-based KNN classification algorithm. The classification results are shown in the following table (the columns of the table represent the actual categories, and the rows represent the model output categories):
[0092] Table 4 Offline fault diagnosis data statistics
[0093] True category\model prediction normal Point Abnormality Linear fluctuation Sudden fluctuations total normal 144 0 0 0 144 Point Abnormality 23 111 10 0 144 Linear fluctuation anomaly 6 49 89 0 144 Abnormal sudden fluctuations 0 16 59 69 144 total 173 176 158 69 576
[0094] From this, we can calculate the model's precision, recall, and F1 score for each category:
[0095] Table 5 Statistics of precision, recall and F1 score of offline fault diagnosis data
[0096] Indicator\Category normal Point Abnormality Linear fluctuation anomaly Abnormal sudden fluctuations total Precision Rate (PR) 83.24% 63.07% 56.33% 100% 75.66% Recall rate RC 100% 77.08% 61.81% 47.92% 71.70% F1 Score 90.85% 69.37% 58.94% 64.79% 70.99%
[0097] The results show that the overall diagnostic accuracy of the test set reached 70.99%, and the recall rate of the normal category reached 100%, achieving zero false positives. The results show that the algorithm achieves good discrimination between normal and abnormal samples.
[0098] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A voltage transformer fault diagnosis method based on DTW-KNN-LSTM algorithm, characterized in that: Includes interface layer, service layer and data layer; The data layer uses a relational database for data storage; The service layer interacts with the data layer, providing the required data to the service layer through the data layer, and performing data exchange with the service layer; The interface layer is connected to the service layer, and the service layer feeds back calculation results to the interface layer and provides corresponding diagnostic analysis results to users; The data layer is used to store the time series data table and the fault sample record table; The time series data table stores the PT temperature measurement data, ambient temperature and ambient humidity data of each phase of the motor cabinet at each moment; The fault sample record table stores the start time and end time of each fault sample, so that each standard fault sample can be quickly queried in the time series data table; at the same time, the fault type corresponding to each fault sample is stored in the table for algorithm comparison; The interface layer is equipped with four request modules, including a historical model acquisition module, a fault editing module, a fault diagnosis module, and a model retraining module; The fault diagnosis module is divided into two modules: online fault diagnosis and offline fault diagnosis. The online fault diagnosis module receives real-time incoming data and comprehensively diagnoses whether there is a fault based on data from a past period of time. The offline fault diagnosis module performs a more detailed diagnosis based on the user-specified time interval data, and provides various possible faults and their probabilities, using the corresponding closest standard fault sample data as the analysis basis. The offline fault diagnosis module uses the KNN classification algorithm to calculate the fault category and the most similar standard fault sample for each abnormal segment in the test data. The KNN algorithm does not require a model learning process. It uses the training data to partition the feature vector space and uses the partitioning result as the final algorithm model. Only one sample data set needs to be maintained to quickly calculate the correspondence between each data point and its corresponding category, thereby providing rapid feedback on new faults edited by the user. Considering the requirements of real-time online fault diagnosis on algorithm efficiency and fault accuracy, the online fault diagnosis module uses a classification algorithm based on long short-term memory network; LSTM enables the model to "remember" historical inputs by adding neuron states to the hidden layer. The resulting feature vector contains important information from the entire time series data segment. Each neuron in the network uses three gating units to decide which information to pass backward: the forget gate uses the sigmoid layer to determine which information to "forget" based on the new input and the previous output, thereby preventing a large amount of outdated historical information from influencing current processing. The input gate extracts valid information from the current input data and controls which parts of it should be added to the neuron. The output gate combines the neuron state and the current input to decide what information to output at the current moment.
2. The voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm according to claim 1, characterized in that: The historical model acquisition module obtains each fault data sequence corresponding to the fault type expected by the user through the fault sample record table; The fault editing module inputs a data sequence and a fault label edited by the user, and stores it in the fault sample record table; The model retraining module retrains and updates the online diagnosis model through the accumulated fault sample data.
3. The voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm according to claim 2 is characterized in that: The service layer is divided into a basic business module and an algorithm module; The basic business processing is to add, delete, modify and query data, realizing two major functions: data storage and data query; The algorithm modules correspond to the different requirements of online and offline fault detection scenarios, respectively, and deploy different algorithm models to achieve corresponding functions; a supervised model is used for online fault diagnosis, and the model applicability and accuracy are continuously improved through regular training and updates.
4. The voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm according to claim 3 is characterized in that: Fault diagnosis requires analyzing and returning the fault sample that is most similar to the test data. Therefore, an algorithm is needed to measure the distance between sequences, that is, the degree of similarity. Furthermore, considering that the sequence lengths of fault samples and test data often differ, the algorithm module uses a dynamic time warping algorithm to fit two sample segments of different sequence lengths and measures their similarity based on this. When comparing examples, there may be situations where two sequences have similar-shaped segments as a whole, but these segments are not aligned on the time axis. Based on this, before calculating the sequence distance, it is necessary to transform them on the time axis to achieve the alignment effect.
5. The voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm according to claim 4 is characterized in that: The dynamic time warping (DTW) algorithm calculates the similarity between the overall shapes of two time series by stretching and shortening the time series. The cumulative distance between two series a and b is calculated using the following recursive formula: ; In the formula, d represents the distance between two points, so a regular path can be solved by dynamic programming algorithm to minimize the cumulative distance of all corresponding points; is the time sequence number of sequence a; j is the time sequence number of sequence b; is the matching distance corresponding to the best matching path.
6. The voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm according to claim 5, characterized in that: Considering the time complexity, the DTW algorithm uses the FastDTW algorithm to calculate the sequence distance. The FastDTW algorithm reduces the time complexity from O(n) to O(n) by a similar method of coarsening the granularity while keeping the calculation error at the percentile level. 2 ) is reduced to O(n) to improve the system response speed.
7. The voltage transformer fault diagnosis method based on the DTW-KNN-LSTM algorithm according to claim 6, characterized in that: In the LSTM, Represent the output and neuron state of the previous moment respectively, All are initialized with zero; by Represent the parameter matrices of the forget gate, input gate, and output gate respectively, Orthogonal initialization and zero initialization are used to calculate the characteristic parameters of historical information and current information , and calculate the current state features through the tanh layer : ; ; ; In the output gate, the output at the current moment is calculated based on the current state and input features : ; The LSTM feature encoder encodes the temporal features of the data into a feature vector, which is then classified by the Softmax multi-classifier to diagnose the device status. The cross-entropy loss function is used to measure the diagnosis result: ; Where: N is the number of samples in each round of training, K is the fault category, which measures the difference between the model output and the actual distribution and trains the model; For the diagnosis result, it is a cross entropy function; is the actual probability distribution; is the reference probability distribution.
Citation Information
Patent Citations
Steam feed pump state monitoring system based on data mining
CN113719446A