Training method of transformer fault diagnosis model and transformer fault diagnosis method

By combining random forest, recursive feature elimination and XGBoost algorithm, and combining sparrow search algorithm to optimize hyperparameters, the problem of low accuracy in transformer fault diagnosis is solved, and higher diagnostic accuracy and efficiency are achieved.

CN120046050APending Publication Date: 2025-05-27STATE GRID LIAONING ELECTRIC POWER CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411994843.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The prior art is difficult to accurately diagnose transformer failures, resulting in low diagnostic accuracy.

Method used

The initial transformer fault diagnosis model is constructed by combining the random forest algorithm, recursive feature elimination algorithm and XGBoost algorithm, and the hyperparameters of the model are optimized through the multi-strategy improved sparrow search algorithm.

Benefits of technology

Through feature redundancy elimination and hyperparameter optimization, the accuracy and diagnostic efficiency of the transformer fault diagnosis model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046050A_ABST
    Figure CN120046050A_ABST
Patent Text Reader

Abstract

The invention provides a training method of a transformer fault diagnosis model and a transformer fault diagnosis method, and relates to the technical field of transformer fault diagnosis, and the training method of the transformer fault diagnosis model comprises the steps: obtaining the sample fault data of a transformer, and first fault features under different fault types; training by using the first fault feature and the sample fault data to obtain an initial transformer fault diagnosis model, and in the training process of the initial transformer fault diagnosis model, deleting redundant features in the first fault feature by using a random forest algorithm and a recursive feature elimination algorithm to obtain a second fault feature; and performing fault classification based on the second fault feature and the sample fault data by using an XGBoost algorithm, and optimizing hyper-parameters of the initial transformer fault diagnosis model based on a multi-strategy improved sparrow search algorithm to obtain a final transformer fault diagnosis model. According to the invention, the accuracy of transformer fault diagnosis can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of transformer fault diagnosis, and particularly to a method for training a transformer fault diagnosis model and a transformer fault diagnosis method. Background Art

[0002] As a hub-type node device connecting various voltage levels in the power grid, the stable and healthy operation of a transformer plays a crucial role in the development of the power system. Its operating state is related to the reliability of the power supply system. Transformer faults not only affect the national economy but also endanger public safety. Therefore, real-time monitoring of the operating state of transformers and timely detection of latent faults are of great significance for ensuring the safe and stable operation of the power grid.

[0003] Currently, the accident rate of transformers in the power system being forced to stop work for maintenance due to abnormal states or faults is increasing continuously. With the increase in the input time of transformers, the continuous increase in electricity consumption, and the intervention of a large number of intelligent devices and sensors, the past causal relationship models based on theoretical analysis and the like have become difficult to process the current multi-dimensional data information. They cannot accurately extract the fault characteristics of transformers, thereby resulting in a low accuracy of transformer fault diagnosis. Summary of the Invention

[0004] The present invention provides a method for training a transformer fault diagnosis model and a transformer fault diagnosis method, which can improve the accuracy of transformer fault diagnosis.

[0005] In a first aspect, a method for training a transformer fault diagnosis model is provided, including:

[0006] Obtaining sample fault data of a transformer and first fault characteristics under different fault types;

[0007] Training an initial transformer fault diagnosis model by using the first fault characteristics and the sample fault data, wherein the initial transformer fault diagnosis model is a transformer fault diagnosis model constructed by combining a random forest algorithm, a recursive feature elimination algorithm, and an XGBoost algorithm; during the training process of the initial transformer fault diagnosis model, redundant features in the first fault characteristics are deleted by using the random forest algorithm and the recursive feature elimination algorithm to obtain second fault characteristics; and fault classification is performed by using the XGBoost algorithm based on the second fault characteristics and the sample fault data;

[0008] Optimizing the hyperparameters of the initial transformer fault diagnosis model based on a multi-strategy improved sparrow search algorithm to obtain a final transformer fault diagnosis model.

[0009] In a second aspect, a transformer fault diagnosis method is provided, including:

[0010] Obtain the target fault data of the transformer to be fault diagnosed;

[0011] Input the target fault data into the above-mentioned transformer fault diagnosis model to obtain the transformer fault diagnosis result, where the transformer fault diagnosis result at least includes the fault type to which the transformer belongs.

[0012] In a third aspect, a training device for a transformer fault diagnosis model is provided, including:

[0013] A first acquisition module, configured to acquire the sample fault data of the transformer and the first fault features under different fault types;

[0014] A training module, configured to train an initial transformer fault diagnosis model by using the first fault features and the sample fault data, where the initial transformer fault diagnosis model is a transformer fault diagnosis model constructed by combining the random forest algorithm, the recursive feature elimination algorithm, and the XGBoost algorithm; during the training process of the initial transformer fault diagnosis model, the random forest algorithm and the recursive feature elimination algorithm are used to delete the redundant features in the first fault features to obtain the second fault features; and the XGBoost algorithm is used to perform fault classification based on the second fault features and the sample fault data;

[0015] An optimization module, configured to optimize the hyperparameters of the initial transformer fault diagnosis model based on the multi-strategy improved sparrow search algorithm to obtain the final transformer fault diagnosis model.

[0016] In a fourth aspect, a transformer fault diagnosis device is provided, including:

[0017] A second acquisition module, configured to acquire the target fault data of the transformer to be fault diagnosed;

[0018] An input module, configured to input the target fault data into the above-mentioned transformer fault diagnosis model to obtain the transformer fault diagnosis result, where the transformer fault diagnosis result at least includes the fault type to which the transformer belongs.

[0019] In a fifth aspect, an electronic device is provided, including: a processor and a memory, where the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or the second aspect.

[0020] In a sixth aspect, a computer-readable storage medium is provided, used to store a computer program, and the computer program enables a computer to execute the method in the first aspect or the second aspect.

[0021] Through the technical solution provided by the present invention, after obtaining the sample fault data of the transformer and the first fault characteristics under different fault types, the initial transformer fault diagnosis model can be trained by using the first fault characteristics and the sample fault data. During the training process of the initial transformer fault diagnosis model, the redundant features in the first fault characteristics can be deleted by using the random forest algorithm and the recursive feature elimination algorithm to obtain the second fault characteristics. Further, the dimension-reduced second fault characteristics and the sample fault data are used as the training basis for XGBoost fault diagnosis, avoiding the problem of redundant feature vectors, reducing the complexity of the transformer fault diagnosis model, and improving the training speed and diagnosis accuracy. However, most of the commonly used optimization methods for XGBoost parameters have problems such as slow convergence speed and easy to fall into local optimum. Therefore, in this application, the multi-strategy improved sparrow search algorithm can be used to optimize the hyperparameters of the initial transformer fault diagnosis model to obtain the final transformer fault diagnosis model. In this way, the convergence speed of the transformer fault diagnosis model can be further improved, and the accuracy and diagnosis efficiency of transformer fault diagnosis can be ensured.

[0022] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit this application. Other features and advantages of this application will be described in detail in the subsequent specific implementation part. Brief Description of the Drawings

[0023] In order to more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0024] Figure 1 It is an application scenario diagram provided by an embodiment of this application;

[0025] Figure 2 It is a schematic flowchart of a training method for a transformer fault diagnosis model provided by an embodiment of this application;

[0026] Figure 3 It is a schematic diagram of a Laplace density function curve provided by an embodiment of this application;

[0027] Figure 4 It is a schematic flowchart of a transformer fault diagnosis method provided by an embodiment of this application;

[0028] Figure 5 It is a schematic flowchart of a training device for a transformer fault diagnosis model provided by an embodiment of this application;

[0029] Figure 6 Schematic flowchart of a transformer fault diagnosis device provided by an embodiment of the present application;

[0030] Figure 7 Schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0031] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server including a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0033] As a hub-type node device connecting various voltage levels in the power grid, the stable and healthy operation of the transformer plays a crucial role in the development of the power system. Its operating state is related to the reliability of the power supply system. Transformer faults not only affect the national economy but also endanger public safety. Therefore, real-time monitoring of the transformer operating state and timely detection of latent faults are of great significance for ensuring the safe and stable operation of the power grid.

[0034] With the implementation of the national comprehensive energy power grid construction, power transformers are replaced with higher voltage levels and capacities due to the needs of the times. If a transformer fails, it will directly have an adverse impact on the power grid and users. Therefore, researching the automatic detection and fault diagnosis technology of transformers and improving the level of operation and maintenance have practical value and practical significance for the entire power grid.

[0035] Implementing fault diagnosis and data processing of transformers is of great significance for transformer maintenance. At present, the accident rate of transformers in the power system being forced to stop work for maintenance due to abnormal states or faults is increasing continuously. With the increase in the input time of transformers, the continuous increase in power consumption, and the intervention of a large number of intelligent devices and sensors, it has become difficult to process the current multi-dimensional data information based on the past causal relationship models such as theoretical analysis. With the rapid development of artificial intelligence, it provides new solutions and technical means for parameter prediction and fault diagnosis of power transformers.

[0036] To solve the above technical problems, the inventive concept of the present invention is that an initial transformer fault diagnosis model can be constructed by combining the random forest algorithm, the recursive feature elimination algorithm, and the XGBoost algorithm. During the training process of the initial transformer fault diagnosis model, the random forest algorithm and the recursive feature elimination algorithm are used to delete redundant features in the first fault features to obtain the second fault features; the XGBoost algorithm is used for fault classification based on the second fault features and sample fault data. By means of fusing multiple algorithms, the problem of redundant feature vectors can be avoided, the complexity of the transformer fault diagnosis model can be reduced, and the training speed and diagnosis accuracy can be improved. Further, the multi-strategy improved sparrow search algorithm is used to optimize the hyperparameters of the initial transformer fault diagnosis model to obtain the final transformer fault diagnosis model, which can further improve the convergence speed of the transformer fault diagnosis model and ensure the accuracy of transformer fault diagnosis.

[0037] It should be understood that the technical solution of the present application can be applied to the following scenarios, but is not limited to:

[0038] In some implementable ways, Figure 1 For an application scenario diagram provided by an embodiment of the present application, as Figure 1 shown, this application scenario may include an electronic device 110 and a network device 120. The electronic device 110 can establish a connection with the network device 120 through a wired network or a wireless network.

[0039] Exemplarily, the electronic device 110 can be a desktop computer, a laptop computer, a tablet computer, etc., but is not limited thereto. The network device 120 can be a terminal device or a server, but is not limited thereto. In an embodiment of the present application, the electronic device 110 can send a request message to the network device 120, and this request message can be used to request to obtain the sample fault data of the transformer and the first fault features corresponding to different fault types. Further, the electronic device 110 can receive a response message sent by the network device 120, and this response message includes the sample fault data of the transformer and the first fault features corresponding to different fault types.

[0040] In addition, Figure 1Exemplarily, an electronic device 110 and a network device 120 are given. In fact, other numbers of electronic devices and network devices may be included, and this application places no restrictions thereon.

[0041] In some other implementable manners, the technical solution of this application may also be executed by the above-mentioned electronic device 110, or the technical solution of this application may also be executed by the above-mentioned network device 120, and this application places no restrictions thereon.

[0042] After introducing the application scenarios of the embodiments of this application, the technical solution of this application will be elaborated in detail below:

[0043] Figure 2 It is a flowchart of a method for training a transformer fault diagnosis model provided for an embodiment of this application. This method may be executed by an electronic device 110 as shown in Figure 1 but is not limited thereto. As shown in Figure 2 , this method may include the following steps:

[0044] Step 210, obtain sample fault data of a transformer and first fault features under different fault types.

[0045] Among them, the transformer may be an oil-filled power transformer, and the corresponding sample fault data may include transformer operation data, fault description data, characteristic gas data in oil, etc. The fault modes inside an oil-filled power transformer are mainly three types: mechanical, thermal, and electrical, with the latter two being the main ones. Mechanical faults often manifest in the form of thermal or electrical faults. Overheating faults and high-energy discharge faults are the main types of transformer faults during operation, followed by overheating and high-energy discharge faults, spark discharge faults, and moisture or partial discharge faults. According to the causes and severity of faults, the typical faults of transformers are divided into six fault types, including partial discharge, low-energy discharge, high-energy discharge, low-temperature overheating, medium-temperature overheating, and high-temperature overheating. The first fault features corresponding to different fault types may be gas features generated under the corresponding fault types. According to experimental research, when there is an arc discharge, the transformer oil mainly decomposes into acetylene, hydrogen, and a small amount of methane; when there is a partial discharge, the transformer oil mainly decomposes into hydrogen and methane; when the transformer oil is overheated, it decomposes into hydrogen, methane, ethylene, propylene, etc.; when paper and some insulating materials are overheated, gases such as carbon monoxide and carbon dioxide are also decomposed. The current "Guide for the Analysis and Judgment of Dissolved Gases in Transformer Oil" (GB / T7252-2001) in China summarizes the characteristic gases generated by different fault types into Table 1.

[0046] Table 1. Characteristic gases generated by different fault types

[0047]

[0048] Furthermore, according to the characteristic gases generated by different fault types, for H 2 、CH 4 、C 2 H 2 、C 2 H 4 、C 2 H 6 and the total hydrocarbon TH, these six gas data are paired two by two to generate the dissolved gas analysis (DGA) ratios that may be used for transformer fault diagnosis. Furthermore, the DGA ratios are used as the first fault characteristics corresponding to different fault types. Since the volume fraction ratios of two of the same gas, such as H 2 / CH 4 and CH 4 / H 2 , provide the same discriminability to the classifier, only 15 gas proportion combinations shown in Table 2 are listed.

[0049] Table 2. Dissolved gas ratios in oil

[0050]

[0051] Step 220: Using the first fault characteristics and sample fault data, train an initial transformer fault diagnosis model.

[0052] Among them, the initial transformer fault diagnosis model is a transformer fault diagnosis model constructed by combining the random forest algorithm, the recursive feature elimination algorithm, and the XGBoost algorithm; during the training process of the initial transformer fault diagnosis model, the random forest algorithm and the recursive feature elimination algorithm are used to delete the redundant features in the first fault characteristics to obtain the second fault characteristics; and the XGBoost algorithm is used to perform fault classification based on the second fault characteristics and the sample fault data. The second fault characteristics can be the remaining part of the first fault characteristics after deleting the redundant features in the first fault characteristics. By using the random forest algorithm and the recursive feature elimination method to continuously eliminate the redundant features that are irrelevant to the classification of transformer fault data and leaving the second fault characteristics that affect the classification results, the arbitrariness of artificially selecting fault characteristics and the problem that some feature parameters have a weak correlation with the fault state and increase the difficulty of fault diagnosis can be avoided.

[0053] In a specific application scenario, an initial transformer fault diagnosis model based on the combination of random forest and recursive feature elimination algorithm (RFRFE) and XGBoost can be established. The initial transformer fault diagnosis model takes the XGBoost decision as the core, and RFRFE as the pre - algorithm. First, use the random forest algorithm and the recursive feature elimination algorithm to optimize the feature parameters of the first fault feature and remove redundant features. Then, the second fault feature after dimensionality reduction and the sample fault data are used as the training basis for the XGBoost transformer fault diagnosis model, avoiding the problem of redundant feature vectors, reducing the complexity of the XGBoost transformer fault diagnosis model, and improving the training speed and diagnosis accuracy.

[0054] Correspondingly, for the embodiments of the present disclosure, using the first fault feature and the sample fault data in step 220 of the embodiment to train and obtain the initial transformer fault diagnosis model may include the following steps:

[0055] Step 220 - 1: Use the random forest algorithm and the recursive feature elimination algorithm to perform fault classification processing on the sample fault data based on the first fault feature, obtain the first diagnostic data and the corresponding first error value, and delete the redundant features in the first fault feature to obtain the second fault feature.

[0056] For the embodiments of the present disclosure, the steps of the embodiment may include: using the random forest algorithm to perform fault classification on the sample fault data based on the current first fault feature to obtain the first diagnostic data corresponding to each first fault feature; based on the first diagnostic data, using the support vector regression algorithm and the recursive feature elimination algorithm to delete the redundant features in the first fault feature; repeating the above process until it is determined that the classification accuracy corresponding to the first diagnostic data is greater than the second preset threshold, obtaining the final first diagnostic data, the first error value corresponding to the first diagnostic data, and the second fault feature retained after deleting the redundant features in the first fault feature, where the second preset threshold is less than the first preset threshold.

[0057] Correspondingly, when using the random forest algorithm to perform fault classification on the sample fault data based on the current first fault feature to obtain the first diagnostic data corresponding to each first fault feature, assuming there are bootstrap samples n = 1, 2, 3…N, where N is the number of sample fault data, the sample fault data is fault - classified according to the following steps:

[0058] STEP1: Initialize n as 1, and construct a decision tree T corresponding to each first fault feature based on the sample fault data n , and mark the out - of - bag data as ;

[0059] STEP2: Extract the sample fault data at each node of the decision tree For each feature, calculate the amount of information contained in each feature, and split the node using the feature with the best classification ability. Each decision tree is not pruned.

[0060] STEP3: Repeat steps STEP1 to STEP3 a total of N (7) times to generate a random forest containing N (7) decision trees.

[0061] STEP4: For the first fault feature (j = 1, 2,... 7), For the features in Perturb the values, and the perturbed data is denoted as , and use T n To Classify to obtain the first diagnostic data corresponding to each first fault feature.

[0062] Correspondingly, the steps of the embodiment may include: generating a decision tree corresponding to each first fault feature based on the sample fault data, and determining the out-of-bag data corresponding to the decision tree in the sample fault data; performing perturbation processing on the out-of-bag data using each first fault feature; using the decision tree to classify the perturbed out-of-bag data to obtain the first diagnostic data.

[0063] In a specific application scenario, when deleting redundant features in the first fault features using the support vector regression algorithm and the recursive feature elimination algorithm based on the first diagnostic data:

[0064] As a possible implementation, the recursive feature elimination algorithm (Recursive feature elimination, RFE) can be used to continuously eliminate features irrelevant to classification, leaving the second fault features that affect the classification result, and a heuristic feature sorting criterion is adopted to ensure the execution of the algorithm. The principle of the recursive feature is to repeatedly construct a machine learning model, sort the first fault features according to a certain feature evaluation criterion, delete the feature with the lowest importance each time, and the earlier deleted feature is considered to have the least importance and is ranked at the back. Repeat this process until the last feature, thereby realizing the sorting of feature factors and obtaining the optimal feature subset. Combining random and recursive feature elimination methods can better optimize transformer fault features. The algorithm process is as follows: Feature importance sorting: Build a random forest classifier model based on the sample fault data, and use the random forest classifier model to calculate and sort the importance of each first fault feature. Recursive feature elimination: Delete the fault feature with the lowest importance, and retest the classification accuracy of the random forest classifier model for the remaining fault features. Iterate successively until all feature sequences are searched, and finally obtain a transformer fault feature set with fewer features and higher classification accuracy. The transformer fault feature set contains all the remaining second fault features.

[0065] Further, the fault feature set of the transformer can be further optimized by the Support Vector Regression (SVR) algorithm. The main idea of Support Vector Machine Regression (SVR) is that all sample points are arranged on a hyperplane, and the optimal regression hyperplane is found with the goal of minimizing the distance between the sample points and the hyperplane. SVR uses an error control function ε (insensitive loss function), and the model loss is calculated only when the deviation between the model output value f(x) and the true value y is greater than ε. Under the control of the insensitive loss function ε, by introducing the penalty parameter C and the relaxation factor , , the hyperplane is solved. This model is based on statistical learning theory, has a simple structure, high classification accuracy, and strong generalization ability. Since the RFE algorithm combines well with SVR itself, and the constructed feature subset is closely related to the support vector machine, it can bring higher learning ability. Therefore, the two are combined to construct a Recursive Feature Elimination algorithm based on Support Vector Regression (SVR-RFE) to sort the influencing factors (i.e., the first fault features) to obtain the optimal combination of influencing factors. If the hyperplane is expressed as , then the SVM-RFE feature screening model sorts according to the weight vector of each influencing factor on the hyperplane. The greater the weight value of the feature factor, the greater its influence on the objective function, the more discriminant information it has, and the greater its contribution to the hyperplane. Sort all the first fault features in this way. Each time the algorithm iterates, it will delete the smallest feature, and then iterate again until all features are sorted. Finally, a transformer fault feature set with the fewest features and the highest classification accuracy is obtained, and all the remaining second fault features are included in the transformer fault feature set. By using the SVR-RFE algorithm to further optimize the transformer fault feature set, all sample points are arranged on a hyperplane, and the optimal regression hyperplane is found with the goal of minimizing the distance between the sample points and the hyperplane. Sort according to the weight vector of each feature factor on the hyperplane, and delete the smallest feature, and iterate multiple times. Finally, a transformer fault feature set with the fewest features and the highest classification accuracy can be obtained.

[0066] Step 220-2: Use the XGBoost algorithm to perform fault classification on the sample fault data based on the second fault features, and obtain the second diagnostic data and the corresponding second error value.

[0067] XGBoost is essentially an ensemble algorithm model that transforms weak learners into strong learners by leveraging the boosting algorithm. It is an improvement on the Gradient Boosting Decision Tree (GBDT) algorithm model. In this ensemble algorithm, the optional weak learner has an additional linear classifier compared to GBDT, but in this application, the Classification and Regression Tree (CART) model is selected for use. XGBoost is an extension of the boosting idea based on the gradient boosting decision tree. Its basic idea is to integrate multiple base classifiers with relatively low classification accuracy into an accurate and reliable ensemble classifier to improve its prediction speed and accuracy.

[0068] Assume the sample fault dataset is , where , there are n samples and m features. The sample fault data in the sample fault dataset corresponds to the label , then the final prediction result of K regression trees (CART) is (without considering the learning rate here):

[0069]

[0070] In the formula, each function is an independent regression tree, and F is the set composed of CART, that is, the tree space; The predicted value of the data sample set i on the Kth CART; Represents the final prediction result of XGBoost (i.e., the second diagnostic data). The XGBoost objective function, which is the superposition of the loss function and the penalty function, is defined as:

[0071]

[0072]

[0073] In the formula, Represents the second fault feature under the corresponding fault type of the sample fault data, Represents the loss function, Is the regularization term, Is the regularization term parameter, used to avoid the overfitting phenomenon of the model; T represents the number of leaf nodes, Represents the leaf weight of the jth leaf node; And Are penalty terms, suppressing the model from becoming more complex as the number of leaf nodes increases.

[0074] Let is the predicted value in the t-th iteration, adding a new function Greedy optimization of the objective function to improve the prediction accuracy. When training the K-th tree, the regularization terms and tree structures of the previous K - 1 trees are known constants and can be ignored for convenience in subsequent differentiation. Then the objective function of the learning model in the t-th iteration is:[[]]

[0075]

[0076] Since the base learner of the XGBoost algorithm is a decision tree, in the formula are the sample fault data. After training, the sample fault data will fall on the leaf nodes of the decision tree, so the final objective function can be obtained as:[[]]

[0077]

[0078]

[0079]

[0080] In the formula represents the sample set of the j-th leaf node,[[]] is a quadratic function. Assuming the tree structure q is fixed, the optimal objective value is obtained:[[]]

[0081]

[0082] Generally, it is impossible to list all possible CART structures q. Therefore, an exact greedy algorithm is adopted, starting from a single leaf node and iteratively adding branches to the tree.[[]]

[0083] The decrease in loss after splitting is shown in the following formula, which can be used to evaluate candidate split points.[[]]

[0084]

[0085] In the training of transformer fault diagnosis using XGBoost this time, the key issue is to find the best split point according to the above formula. For this purpose, the exact greedy algorithm is used to enumerate all possible split points of all features in all sample fault data. Traversing all possible split points of continuous features requires high computing power. To improve the computing efficiency, the exact greedy algorithm must first sort all the data of each feature and access the data in order to obtain the gradient data of the structure score shown in the above formula.[[]]

[0086] For the embodiments of the present disclosure, after obtaining the second fault feature with redundant features removed through step 220-1 of the embodiment, the sample fault data can be normalized, and the training sample set and the test sample set can be divided. And corresponding training labels are configured for the training sample set, where the training labels are the second fault features under the fault types to which the sample fault data belong. Further, the training sample set with the configured training labels is used to train the network of the XGBoost transformer fault diagnosis model with default parameters, and the test sample set is used to test the fault diagnosis accuracy of the model. When it is determined that the fault diagnosis accuracy is greater than a set value, the final second diagnosis data and the corresponding second error value are obtained.

[0087] Step 220-3: Based on the error reciprocal method and the first error value and the second error value, perform weighted combination on the first diagnosis data and the second diagnosis data to obtain the target diagnosis data.

[0088] For the embodiments of the present disclosure, according to the first error value and the second error value, the weighted weights of the RFRFE algorithm and the XGBoost algorithm can be calculated first:

[0089]

[0090]

[0091] In the formula, is the weighted weight of the RFRFE algorithm, is the weighted weight of the XGBoost algorithm, is the first error value of the RFRFE algorithm, is the second error value of the XGBoost algorithm. It can be seen from the above formula that this method will assign a larger weight coefficient to the model with a smaller error, so that the error of the entire combined model tends to decrease, obtaining a predicted value with a smaller error, and achieving the effect of improving the overall prediction accuracy.

[0092] Furthermore, based on the weighted weights of the RFRFE algorithm and the XGBoost algorithm, the first diagnosis data and the second diagnosis data can be weighted combined to obtain the target diagnosis data:

[0093]

[0094] In the formula, is the target diagnosis data, is the weighted weight of the RFRFE algorithm, is the weighted weight of the XGBoost algorithm, is the first diagnosis data of the RFRFE algorithm, is the second diagnosis data of the XGBoost algorithm.

[0095] Repeat the above steps from 220-1 to 220-3 until it is determined that the diagnostic accuracy of the target diagnostic data is greater than the first preset threshold or the number of iterations is equal to the preset number, and the initial transformer fault diagnosis model after training is obtained.

[0096] To ensure that the model has good universality and generalization ability, 505 groups of valid data can be randomly selected from the transformer monitoring data, and simulation experiments can be carried out using Python in the Anaconda3 integrated environment to verify the accuracy and feasibility of the initial transformer fault diagnosis model in transformer fault diagnosis. Specifically, 101 groups can be randomly selected from the 505 groups of fault data as the test set, and the rest are the training set. The fault data is normalized. The 101 groups of test sample data are used to test the diagnostic accuracy of the initial transformer fault diagnosis model after training, and the accuracy rate is shown in Table 3 below.

[0097] Table 3. Diagnostic accuracy of the initial transformer fault diagnosis model

[0098]

[0099] Step 230: Optimize the hyperparameters of the initial transformer fault diagnosis model based on the multi-strategy improved Sparrow Search Algorithm to obtain the final transformer fault diagnosis model.

[0100] In the Sparrow Search Algorithm (SSA), the position corresponding to each sparrow may be an optimal solution to the optimization problem. Assume that the population size of the standard SSA algorithm is N, and the optimal solution is searched in the D-dimensional region. The population composed of n sparrows can be expressed as follows:

[0101]

[0102] Among them, d represents the dimension and n represents the number of sparrows. Therefore, the fitness values of all sparrows are as follows:

[0103]

[0104] In the formula, f represents the fitness value.

[0105] During the iteration process, the position update formula of the discoverer is shown as follows:

[0106]

[0107] In the formula, t is the current iteration number; T is the maximum iteration number; is a uniform random number between (0, 1]; Q is a random number subject to the standard normal distribution; L is a matrix of size 1×d with all elements being 1; and are the warning value and the safety value respectively. When When the population does not detect the presence of predators or other dangers, the search environment is safe, and the discoverer can search widely to guide the population to obtain higher fitness; when When the scouting sparrow discovers a predator and immediately releases a danger signal, the population immediately performs anti-predation behavior, adjusts the search strategy, and quickly moves closer to the safe area.

[0108] Except for the discoverer, the remaining sparrows are all joiners, and their positions are updated according to the formula:

[0109]

[0110] In the formula, represents the global worst position, represents the best position occupied by the joiner; represents the position of the individual with the best fitness in the (t + 1)-th iteration; A is a 1*d matrix, and each element is randomly copied as 1 or -1, and .

[0111] In the study, it is assumed that the proportion of sparrows that perceive danger is 10% to 20%. The starting positions of this part of the sparrows are randomly generated in the group, which can be represented by the following formula:

[0112]

[0113] In the formula, represents the current global optimal position; is the step size control frequency, a random number obeying the normal distribution with a mean of 0 and a variance of 1; K is a random number in the range [-1, 1]; is the fitness value of the current sparrow; is the fitness value of the current global optimum; represents the fitness value of the current global worst; is the smallest constant to satisfy the condition that the denominator is not equal to 0; K represents the movement direction of the sparrow, that is, the step size control parameter. For convenience of representation, when is satisfied, the sparrow is at the edge of the group and is vulnerable to attack by predators, indicates that the position of the sparrow is the safest at this time. When is satisfied, it means that the sparrow in the middle perceives the crisis at this time, and it approaches the sparrow in the safe position to prevent the risk of being captured.

[0114] To improve the performance of the sparrow search algorithm, before using the sparrow search algorithm to optimize the hyperparameters of the initial transformer fault diagnosis model, multiple strategies can be used to optimize the sparrow search algorithm first. The multiple strategies can be at least two of Gaussian chaotic mapping, Tent chaotic mapping, golden sine strategy optimization, dynamic Laplacian operator, and adaptive t-distribution. The following introduces each optimization strategy for the sparrow search algorithm separately:

[0115] I. Introduce Gaussian chaotic mapping to optimize the sparrow search algorithm

[0116] For the initialization of the sparrow population position, Gaussian chaotic mapping is introduced to make the population position more random, thereby expanding the search range. The position of the discoverer sparrows needs to be updated by the following formula in each iteration of the algorithm:

[0117]

[0118]

[0119] In the formula, mod is the remainder function, k is the number of bits of the sparrow, [] represents taking the integer, is the chaotic sequence generated by the Gaussian mapping.

[0120] The follower sparrows are restricted by the above formula. Here, the convergence factor is redefined to change the position update rule of the follower sparrows.

[0121]

[0122] As the number of iterations increases from 2 to 0, t is the current number of iterations, is the maximum number of iterations. The followers update their positions according to the following formula:

[0123]

[0124] where r is a random number in [0, 1]; represents the optimal solution at the current iteration; represents the fitness value of the i-th sparrow; represents the current position of the i-th sparrow.

[0125] II. Introduce Tent chaotic mapping to optimize the sparrow search algorithm

[0126] Research shows that Tent chaotic mapping has better ergodic uniformity and faster search speed than Logisitic chaotic mapping. The non-uniformity of Logistic chaotic mapping has a greater impact on the optimization speed and accuracy, affecting the rate and accuracy of the algorithm in the optimization process.

[0127] Chaotic mappings possess characteristics such as randomness and ergodicity, which can accelerate the convergence speed and to a certain extent avoid the algorithm falling into local optimal solutions. In this invention, by introducing the Tent chaotic mapping, the initialization process of the sparrow search algorithm is optimized, and the randomness of population individuals is enhanced, thereby improving the convergence speed and accuracy of the algorithm.

[0128] The expression of the Tent chaotic mapping is as follows:

[0129]

[0130] After Bernoulli displacement transformation, the Tent chaotic mapping is expressed as follows:

[0131]

[0132] Analyzing the Tent chaotic iteration sequence, it can be found that the sequence has small cycles and unstable periodic points. To avoid the Tent chaotic sequence falling into small periodic points and unstable periodic points during iteration, a random variable is introduced into the original Tent chaotic mapping expression, and the improved Tent chaotic mapping expression is as follows:

[0133]

[0134] The transformed expression is:

[0135]

[0136] where: N is the number of particles in the sequence, is a random number in the range [0, 1]. Introducing the random variable not only still maintains the randomness, ergodicity, and regularity of the Tent chaotic mapping, but also can effectively avoid the iteration falling into small periodic points and unstable periodic points. The random variable introduced in the algorithm of this invention not only maintains randomness but also controls the random value within a certain range, ensuring the regularity of the Tent chaos. According to the characteristics of the Tent chaotic mapping, this invention uses the improved Tent chaotic mapping expression to generate a Tent chaotic sequence in the feasible region, and the steps are as follows:

[0137] Step1: Randomly take an initial value in the interval (0, 1), that is, i = 0;

[0138] Step2: Perform iterative calculations according to the formula to generate an X sequence of transformer fault data, and i is incremented by 1 each time;

[0139] Step3: Stop the iteration when i is equal to the maximum number of iterations, and save the generated X sequence.

[0140] III. Introducing the Golden Sine Strategy to Optimize the Sparrow Search Algorithm

[0141] The golden sine strategy is an iterative optimization method based on the sine function, which is often used to search for the extreme points of a function in a two-dimensional space. The golden sine strategy is introduced to improve the position update formula of sparrows, thereby enhancing the global search ability of the sparrow optimization algorithm. Its mathematical expression is as follows:

[0142]

[0143] In the formula is the current individual optimal position; is a random number that determines the moving distance of the sparrow individual; is a random number that determines the position update direction of the sparrow individual; is the golden ratio; , are the coefficients containing the golden ratio.

[0144] IV. Introducing the Dynamic Laplacian Operator to Optimize the Sparrow Search Algorithm

[0145] In the exploitation stage of the sparrow population, the step size is relatively small, making it difficult to break free from the bondage of local extrema. Therefore, a dynamic Laplacian crossover operator is introduced to help the participants break free from the shackles of local optimal solutions and avoid premature convergence of the SSA algorithm. The density function of the Laplacian crossover operator distribution is as follows:

[0146]

[0147] In the formula, a is the position parameter, b is the proportional parameter; u ∈ [0,1] is a uniformly distributed random number, generating a random number

[0148]

[0149] Figure 3 represents the difference in the Laplacian crossover density function curves for different b values. Vertically, the peak dotted line near the center value is higher than the solid line, and the peak at both ends is smaller than the solid line; horizontally, the solid line descends more slowly at both ends near the horizontal axis, and the dotted line approaches both ends of the horizontal axis. From Figure 3 the Laplacian density function curve, it can be seen that when b = 1, the distribution range of f(x) is relatively wide, avoiding the algorithm from falling into local optimal solutions. Its formula description is as follows:

[0150]

[0151] When b = 0.5, the middle part of f(x) is higher, and the probability of generating random numbers is large. This enables sparrow individuals to move around with a smaller step size during the later stage of local development to achieve fine search and better converge to the global optimal solution. Its formula description is as follows:

[0152]

[0153] In the formula, r is a random number and r ∈ [0, 1], t represents the current iteration number, is the maximum iteration number, 1 - t / ∈ [0, 1] and is monotonically decreasing. In the early stage of iteration, the value of t is small. Therefore, 1 - t / is large. When it is greater than r, the algorithm randomly selects a sparrow and the current optimal individual to perform a crossover operation according to the formula when b = 1. In the later stage of iteration, the value of t is large. Therefore, 1 - t / is small. When it is less than r, the algorithm randomly selects a sparrow and the current optimal individual to perform a crossover operation according to the formula when b = 0.5. The dynamic Laplace crossover operation enables the generation of offspring far from the parent generation in the early stage of optimization, and can better explore the search space with a larger step size, increasing the probability of jumping out of local extrema, thereby helping the participants converge to the global optimum at a faster speed.

[0154] V. Introducing Adaptive t - Distribution Perturbation to Improve the Sparrow Search Algorithm

[0155] Aiming at the problem that the sparrow search algorithm is prone to falling into local optimum in the later stage due to the reduction of population diversity, an adaptive t - distribution strategy is adopted to perturb the positions of sparrow individuals, and the ability to jump out of the local optimal solution is proposed. The updated position of the sparrow individual after being perturbed by the adaptive t - distribution is:

[0156]

[0157] In the formula, is the position of the i - th sparrow individual after improvement; is the random perturbation term.

[0158] It should be noted that the optimization strategies for the sparrow search algorithm are not limited to this, and may also include other various achievable optimization strategies, which will not be enumerated here. When optimizing the sparrow search algorithm using the above - mentioned strategies, one or at least two strategies can be selected simultaneously for optimization. To ensure the optimization effect, in this application, at least two strategies are preferably used to optimize the sparrow search algorithm. When using at least two strategies to optimize the sparrow search algorithm, the optimization order of different strategies can be formulated according to the specific application scenario, which is not specifically limited here.

[0159] For the embodiments of the present disclosure, after optimizing the sparrow search algorithm using the above multiple strategies, the multi-strategy improved sparrow search algorithm (MISSA) can be used to optimize the hyperparameters of the initial transformer fault diagnosis model to obtain the final transformer fault diagnosis model. In this way, the convergence speed of the transformer fault diagnosis model can be further improved, and the accuracy and diagnosis efficiency of transformer fault diagnosis can be guaranteed. Among them, the process of optimizing the hyperparameters of the initial transformer fault diagnosis model using the multi-strategy improved sparrow search algorithm is as follows:

[0160] Step1: Use the RFRFE algorithm to optimize the feature parameters of the sample fault data, and then divide the training set and the test set according to the ratio of 8:2.

[0161] Step2: Set the population size N, the search space dimension D, and the maximum number of iterations T. Initialize the positions of the sparrows in the sparrow population.

[0162] Step3: Initialize the relevant hyperparameters of XGBoost (the number of trees n_estimators, the maximum depth of the tree max_depth, the learning rate eta, subsample), including the search range of the hyperparameters.

[0163] Step4: Calculate the optimal and worst fitness values of each sparrow under the current XGBoost hyperparameters, and record their positions.

[0164] Step5: Update the positions of the discoverer, joiner, and vigilant individuals, and then perform dynamic Laplacian operator crossover mutation on the joiner individuals, and generate a random number r, r 1 - t / 。

[0165] Step6: Calculate the fitness value of the sparrow. If the former is better, keep the original individual unchanged, and update the optimal and worst fitness values and their positions experienced by the sparrow.

[0166] Step7: Determine whether the iteration termination condition (r = 1 - t / ) is satisfied. If it is satisfied, assign the optimal hyperparameters to the initial transformer fault diagnosis model to obtain the best transformer fault diagnosis model. If not, return to Step5 to continue the iteration.

[0167] Step8: Construct the MISSA-XGBoost fault diagnosis model (i.e., the final transformer fault diagnosis model) using the optimal hyperparameters optimized by the MISSA algorithm.

[0168] Correspondingly, for the embodiments of the present disclosure, the embodiment steps may include: determining the initial hyperparameters of the initial transformer fault diagnosis model, where the initial hyperparameters at least include the number of trees, the maximum depth of the trees, and the learning rate. Here, the trees may refer to the decision trees corresponding to the random forest algorithm in the initial transformer fault diagnosis model, or the classification and regression trees corresponding to the XGBoost algorithm in the initial transformer fault diagnosis model; calculating the fitness value of each sparrow in the sparrow population under each initial hyperparameter; based on the fitness value, using the sparrow search algorithm improved by multiple strategies to update the positions of the discoverers, joiners, and guards in the sparrow population, and performing cross-mutation on the joiners using the dynamic Laplacian operator to obtain the updated sparrow population. The sparrow search algorithm improved by multiple strategies is an algorithm obtained by optimizing the initial sparrow search algorithm multiple times using at least two of Gaussian chaotic mapping, Tent chaotic mapping, golden sine strategy optimization, dynamic Laplacian operator, and adaptive t-distribution; repeating the above update process until it is determined that the number of repetitions is equal to the maximum number of iterations, then determining the target hyperparameters of the initial transformer fault diagnosis model according to the finally updated sparrow population, and updating the initial hyperparameters of the initial transformer fault diagnosis model to the target hyperparameters to obtain the final transformer fault diagnosis model.

[0169] Under the environment of Inter (R) Core (TM) i5, 2.70GHz, and 8GB of memory, programming is carried out using python3, and the proposed model is trained by inputting preset parameters and training samples. The fault diagnosis results of the oil-immersed transformer based on the transformer fault diagnosis model are shown in Table 4 below. The data shows that all the fault samples representing medium-temperature overheating, high-temperature overheating, partial discharge, and high-energy discharge in the test samples are correctly identified; 1 fault sample of low-temperature overheating is misjudged; 4 normal state samples are misjudged; and 1 fault sample of low-energy discharge is misjudged. Except for the normal state, the diagnostic accuracy of the method in this paper is relatively high and stable under different fault types.

[0170] Table 4. Diagnostic Results of Transformer Fault Diagnosis Model

[0171]

[0172] Select five mainstream supervised learning models, namely Linear Discriminant Analysis (LDA), K-Nearest Neighbor (KNN), Support Vector Machine (SVM), Random Forest (RF), and Gradient Boosting Decision Tree (GBDT), and train them under empirical parameters. Then compare the test results with the XGBoost model optimized by sparrow algorithm (i.e., the final transformer fault diagnosis model). The results are shown in Table 5 below. As can be seen from Table 5, the diagnostic accuracy of the XGBoost model optimized by sparrow algorithm is the highest among the six models, and it also has good performance in the state of low classification accuracy rate.

[0173] Table 5. Diagnostic results of different models

[0174]

[0175] To illustrate the computational stability of XGBoost optimized by sparrow algorithm, a sample set composed of 547 samples is randomly sampled 100 times continuously. Each time, 20% of the samples are taken as the test set, and the remaining 80% of the samples are taken as the training set. Use the obtained training samples to train different models and count the diagnostic results. The results are shown in Table 6. As can be seen from the table, the average correct rate of 100 diagnoses of the transformer fault diagnosis model based on XGBoost is 0.917, and the mean square error of the correct rate is 0.018. Compared with the five mainstream supervised learning models, the transformer fault diagnosis model based on XGBoost has the highest average correct rate, and the mean square error of the correct rate is smaller compared with the RF and GBDT models with higher accuracy rates, indicating that the method proposed in this paper can stably maintain high-precision computational output.

[0176] Table 6. Diagnostic results of repeated training of different models

[0177]

[0178] In summary, according to the training method of the transformer fault diagnosis model provided by the present invention, after obtaining the sample fault data of the transformer and the first fault features corresponding to different fault types, the initial transformer fault diagnosis model can be trained by using the first fault features and the sample fault data. During the training process of the initial transformer fault diagnosis model, the redundant features in the first fault features can be deleted by using the random forest algorithm and the recursive feature elimination algorithm to obtain the second fault features. Further, the dimension-reduced second fault features and the sample fault data are used as the training basis for XGBoost fault diagnosis, avoiding the problem of redundant feature vectors, reducing the complexity of the transformer fault diagnosis model, and improving the training speed and diagnosis accuracy. However, most of the commonly used optimization methods for XGBoost parameters have problems such as slow convergence speed and easy to fall into local optimum. Therefore, in this application, the multi-strategy improved sparrow search algorithm can be used to optimize the hyperparameters of the initial transformer fault diagnosis model to obtain the final transformer fault diagnosis model. In this way, the convergence speed of the transformer fault diagnosis model can be further improved, and the accuracy of transformer fault diagnosis can be guaranteed.

[0179] Figure 4 FIG. 4 is a flowchart of a transformer fault diagnosis method according to an embodiment of the present invention. This method can be executed by an electronic device 110 as shown in Figure 1 FIG. 4, but is not limited thereto. As shown in Figure 4 FIG. 4, the method may include the following steps:

[0180] Step 410: Obtain target fault data of the transformer to be fault-diagnosed.

[0181] Among them, the target fault data may be transformer operation data and fault description data. The difference between it and the sample fault data is that the target fault data is the scenario diagnosis data to be fault-diagnosed and the specific fault type has not been determined, while the sample fault data is the training data marked with specific fault types.

[0182] Step 420: Input the target fault data into the transformer fault diagnosis model to obtain a transformer fault diagnosis result, where the transformer fault diagnosis result at least includes the fault type to which the transformer belongs.

[0183] Among them, for the training process of the transformer fault diagnosis model, reference can be made to the relevant descriptions in steps 220 to 230 of the embodiment. Specifically, the random forest algorithm, the recursive feature elimination algorithm, and the XGBoost algorithm can be combined to construct an initial transformer fault diagnosis model. During the training process of the initial transformer fault diagnosis model, the random forest algorithm and the recursive feature elimination algorithm are used to delete redundant features in the first fault features to obtain the second fault features; and the XGBoost algorithm is used to perform fault classification based on the second fault features and the sample fault data. Then, the hyperparameters of the initial transformer fault diagnosis model are optimized based on the multi-strategy improved sparrow search algorithm to obtain the final transformer fault diagnosis model.

[0184] In summary, the present application can input the target fault data into the transformer fault diagnosis model to obtain the transformer fault diagnosis result. Since the transformer fault diagnosis model is constructed based on the combination of the random forest algorithm, the recursive feature elimination algorithm, and the XGBoost algorithm, and the hyperparameters are optimized based on the multi-strategy improved sparrow search algorithm, the accuracy of the transformer fault diagnosis can be guaranteed.

[0185] Based on the above Figure 2 specific description of the training method of the provided transformer fault diagnosis model, as Figure 5 shown, Figure 5 is a block diagram of a training device for a transformer fault diagnosis model shown according to an exemplary embodiment. As Figure 5 shown, the device includes:

[0186] A first acquisition module 51, which can be used to acquire the sample fault data of the transformer and the first fault features under different fault types;

[0187] A training module 52, which can be used to train an initial transformer fault diagnosis model by using the first fault features and the sample fault data, where the initial transformer fault diagnosis model is a transformer fault diagnosis model constructed based on the combination of the random forest algorithm, the recursive feature elimination algorithm, and the XGBoost algorithm; during the training process of the initial transformer fault diagnosis model, the random forest algorithm and the recursive feature elimination algorithm are used to delete redundant features in the first fault features to obtain the second fault features; and the XGBoost algorithm is used to perform fault classification based on the second fault features and the sample fault data;

[0188] An optimization module 53, which can be used to optimize the hyperparameters of the initial transformer fault diagnosis model based on the multi-strategy improved sparrow search algorithm to obtain the final transformer fault diagnosis model.

[0189] In some embodiments of the present application, the training module 52 can be specifically used to perform fault classification processing on the sample fault data based on the first fault features by using the random forest algorithm and the recursive feature elimination algorithm, obtain the first diagnostic data and the corresponding first error value, and delete the redundant features in the first fault features to obtain the second fault features; perform fault classification processing on the sample fault data based on the second fault features by using the XGBoost algorithm, obtain the second diagnostic data and the corresponding second error value; perform weighted combination on the first diagnostic data and the second diagnostic data based on the error reciprocal method and the first error value and the second error value to obtain the target diagnostic data; repeat the above process until it is determined that the diagnostic accuracy of the target diagnostic data is greater than the first preset threshold or the number of iterations is equal to the preset number of times, and obtain the initially trained transformer fault diagnosis model.

[0190] In some embodiments of the present application, when performing fault classification processing on the sample fault data based on the first fault features by using the random forest algorithm and the recursive feature elimination algorithm, obtaining the first diagnostic data and the corresponding first error value, and deleting the redundant features in the first fault features to obtain the second fault features, the training module 52 can be specifically used to perform fault classification on the sample fault data based on the current first fault features by using the random forest algorithm to obtain the first diagnostic data corresponding to each first fault feature; based on the first diagnostic data, use the support vector regression algorithm and the recursive feature elimination algorithm to delete the redundant features in the first fault features; repeat the above process until it is determined that the classification accuracy corresponding to the first diagnostic data is greater than the second preset threshold, and obtain the final first diagnostic data, the first error value corresponding to the first diagnostic data, and the second fault features remaining after deleting the redundant features in the first fault features, where the second preset threshold is less than the first preset threshold.

[0191] In some embodiments of the present application, when performing fault classification on the sample fault data based on the current first fault features by using the random forest algorithm to obtain the first diagnostic data corresponding to each first fault feature, the training module 52 can be specifically used to generate a decision tree corresponding to each first fault feature based on the sample fault data, and determine the out-of-bag data corresponding to the decision tree in the sample fault data; perform perturbation processing on the out-of-bag data by using each first fault feature; classify the perturbed out-of-bag data by using the decision tree to obtain the first diagnostic data.

[0192] In some embodiments of the present application, the optimization module 53 can be specifically used to determine the initial hyperparameters of the initial transformer fault diagnosis model. The initial hyperparameters at least include the number of trees, the maximum depth of the trees, and the learning rate. Calculate the fitness value of each sparrow in the sparrow population under each initial hyperparameter. Based on the fitness value, use the sparrow search algorithm improved by multiple strategies to update the positions of the discoverers, joiners, and guards in the sparrow population, and perform cross-mutation on the joiners using the dynamic Laplacian operator to obtain the updated sparrow population. Among them, the sparrow search algorithm improved by multiple strategies is an algorithm obtained by optimizing the initial sparrow search algorithm multiple times using at least two of Gaussian chaotic mapping, Tent chaotic mapping, golden sine strategy optimization, dynamic Laplacian operator, and adaptive t-distribution. Repeat the above update process until it is determined that the number of repetitions is equal to the maximum number of iterations. Then, determine the target hyperparameters of the initial transformer fault diagnosis model based on the finally updated sparrow population, and update the initial hyperparameters of the initial transformer fault diagnosis model to the target hyperparameters to obtain the final transformer fault diagnosis model.

[0193] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0194] In the embodiments of the present application, after obtaining the sample fault data of the transformer and the first fault features under different fault types, the initial transformer fault diagnosis model can be trained using the first fault features and the sample fault data. During the training process of the initial transformer fault diagnosis model, the redundant features in the first fault features can be deleted first using the random forest algorithm and the recursive feature elimination algorithm to obtain the second fault features. Further, the dimension-reduced second fault features and the sample fault data are used as the training basis for XGBoost fault diagnosis, avoiding the problem of redundant feature vectors, reducing the complexity of the transformer fault diagnosis model, and improving the training speed and diagnosis accuracy. However, most of the common hyperparameter optimization methods for XGBoost have problems such as slow convergence speed and easy to fall into local optimum. Therefore, in the present application, the sparrow search algorithm improved by multiple strategies can be used to optimize the hyperparameters of the initial transformer fault diagnosis model to obtain the final transformer fault diagnosis model. In this way, the convergence speed of the transformer fault diagnosis model can be further improved, and the accuracy and efficiency of transformer fault diagnosis can be ensured.

[0195] Based on the above Figure 3 specific description of the provided transformer fault diagnosis method, after training the transformer fault diagnosis model, the use of the transformer fault diagnosis model can refer to the use of a normal deep learning model. Specifically, a transformer fault diagnosis device is provided, such as Figure 6 shown, the device includes:

[0196] A second acquisition module 61, which can be used to acquire target fault data of a transformer to be fault-diagnosed;

[0197] An input module 62, which can be used to input the target fault data into the above-mentioned transformer fault diagnosis model to obtain a transformer fault diagnosis result, and the transformer fault diagnosis result at least includes the fault type to which the transformer belongs.

[0198] Regarding the device in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0199] In the embodiments of the present application, the target fault data can be input into the transformer fault diagnosis model to obtain a transformer fault diagnosis result. In view of the fact that the transformer fault diagnosis model is constructed by combining the random forest algorithm, the recursive feature elimination algorithm, and the XGBoost algorithm, and the hyperparameters are optimized based on the multi-strategy improved sparrow search algorithm, the accuracy of the transformer fault diagnosis can be guaranteed.

[0200] In the above, the training device and the transformer fault diagnosis device of the transformer fault diagnosis model according to the embodiments of the present invention have been described from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions in software, or in the form of a combination of hardware and software modules. Specifically, the steps of the transformer fault diagnosis model training method and the transformer fault diagnosis method embodiments in the embodiments of the present invention can be completed by the integrated logic circuit in the hardware in the processor and / or instructions in software form. The steps of the transformer fault diagnosis model training method and the transformer fault diagnosis method in combination with the present application of the embodiments of the present invention can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the above-mentioned transformer fault diagnosis model training method and transformer fault diagnosis method embodiments.

[0201] Figure 7 It is a schematic block diagram of an electronic device 700 according to an embodiment provided by the present invention.

[0202] As Figure 7 shown, the electronic device 700 may include:

[0203] A memory 710 and a processor 720, where the memory 710 is used to store a computer program and transmit the program code to the processor 720. In other words, the processor 720 can call and run the computer program from the memory 710 to implement the method in the embodiments of the present invention.

[0204] For example, the processor 720 can be used to execute the above method embodiments according to the instructions in the computer program.

[0205] In some embodiments of the present invention, the electronic device 720 may include, but is not limited to:

[0206] A general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like.

[0207] In some embodiments of the present invention, the memory 710 includes, but is not limited to:

[0208] A volatile memory and / or a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0209] In some embodiments of the present invention, the computer program may be divided into one or more modules, which are stored in the memory 710 and executed by the processor 720 to complete the method provided by the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the controller.

[0210] As Figure 7 shown, the electronic device 700 may further include:

[0211] A transceiver 730, which may be connected to the processor 720 or the memory 710.

[0212] Among them, the processor 720 may control the transceiver 730 to communicate with other devices. Specifically, it may send information or data to other devices, or receive information or data sent by other devices. The transceiver 930 may include a transmitter and a receiver. The transceiver 730 may further include an antenna, and the number of antennas may be one or more.

[0213] It should be understood that the various components in the electronic device are connected through a bus system. Among them, the bus system includes not only a data bus, but also a power bus, a control bus, and a status signal bus.

[0214] The present invention also provides a computer storage medium, on which a computer program is stored. When the computer program is executed by the computer, the computer can execute the method of the above method embodiment. Or rather, an embodiment provided by the present invention also provides a computer program product containing instructions. When the instructions are executed by the computer, the computer executes the method of the above method embodiment.

[0215] When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a Digital Video Disc (DVD)), or a semiconductor medium (such as a Solid State Disk (SSD)), etc.

[0216] Those of ordinary skill in the art will realize that the modules and algorithm steps of the examples described in conjunction with the embodiments claimed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0217] In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or modules can be in an electrical, mechanical, or other form.

[0218] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. For example, in each embodiment of this application, each functional module can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0219] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A training method for a transformer fault diagnosis model, characterized in that: include: Acquire sample fault data of the transformer and first fault features under different fault types; Using the first fault feature and the sample fault data, an initial transformer fault diagnosis model is trained, wherein the initial transformer fault diagnosis model is a transformer fault diagnosis model constructed based on a combination of a random forest algorithm, a recursive feature elimination algorithm, and an XGBoost algorithm; during the training process of the initial transformer fault diagnosis model, the random forest algorithm and the recursive feature elimination algorithm are used to delete redundant features in the first fault feature to obtain a second fault feature; and the XGBoost algorithm is used to perform fault classification based on the second fault feature and the sample fault data; Based on the multi-strategy improved sparrow search algorithm, the hyperparameters of the initial transformer fault diagnosis model are optimized to obtain the final transformer fault diagnosis model.

2. The method according to claim 1, characterized in that The method of using the first fault feature and the sample fault data to train an initial transformer fault diagnosis model includes: Using the random forest algorithm and the recursive feature elimination algorithm, the sample fault data is subjected to fault classification processing based on the first fault feature to obtain first diagnostic data and a corresponding first error value, and redundant features in the first fault feature are deleted to obtain a second fault feature; Using the XGBoost algorithm to perform fault classification processing on the sample fault data based on the second fault feature to obtain second diagnostic data and a corresponding second error value; Based on the inverse error method and the first error value and the second error value, performing a weighted combination on the first diagnostic data and the second diagnostic data to obtain target diagnostic data; The above process is repeated until it is determined that the diagnostic accuracy of the target diagnostic data is greater than a first preset threshold or the number of iterations is equal to a preset number, thereby obtaining a trained initial transformer fault diagnosis model.

3. The method according to claim 2, characterized in that The method of using the random forest algorithm and the recursive feature elimination algorithm to perform fault classification processing on the sample fault data based on the first fault feature to obtain first diagnostic data and a corresponding first error value, and deleting redundant features in the first fault feature to obtain a second fault feature includes: Using the random forest algorithm to perform fault classification on the sample fault data based on the current first fault feature, to obtain first diagnostic data corresponding to each of the first fault features; Based on the first diagnostic data, using a support vector regression algorithm and the recursive feature elimination algorithm, deleting redundant features in the first fault features; The above process is repeated until it is determined that the classification accuracy corresponding to the first diagnostic data is greater than a second preset threshold, to obtain the final first diagnostic data, the first error value corresponding to the first diagnostic data, and the second fault feature retained after deleting the redundant feature from the first fault feature, wherein the second preset threshold is less than the first preset threshold.

4. The method according to claim 3, characterized in that The using the random forest algorithm to perform fault classification on the sample fault data based on the current first fault feature to obtain first diagnostic data corresponding to each first fault feature includes: generating a decision tree corresponding to each of the first fault features based on the sample fault data, and determining out-of-bag data corresponding to the decision tree in the sample fault data; Performing disturbance processing on the out-of-bag data using each of the first fault features; The decision tree is used to classify the out-of-bag data after disturbance processing to obtain first diagnostic data.

5. The method according to claim 1, characterized in that The multi-strategy-based improved sparrow search algorithm optimizes the hyperparameters of the initial transformer fault diagnosis model to obtain the final transformer fault diagnosis model, including: Determining initial hyperparameters of the initial transformer fault diagnosis model, wherein the initial hyperparameters include at least the number of trees, the maximum depth of the trees, and a learning rate; Calculate the fitness value of each sparrow in the sparrow population under each of the initial hyperparameters; Based on the fitness value, the positions of the discoverers, joiners and guards in the sparrow population are updated by using a multi-strategy improved sparrow search algorithm, and the joiners are subjected to crossover mutation using a dynamic Laplace operator to obtain an updated sparrow population, wherein the multi-strategy improved sparrow search algorithm is an algorithm obtained by optimizing the initial sparrow search algorithm multiple times using at least two of Gaussian chaos mapping, Tent chaos mapping, golden sine strategy optimization, dynamic Laplace operator and adaptive t distribution; Repeat the above updating process until the number of repetitions is equal to the maximum number of iterations, then determine the target hyperparameters of the initial transformer fault diagnosis model based on the finally updated sparrow population, update the initial hyperparameters of the initial transformer fault diagnosis model to the target hyperparameters, and obtain the final transformer fault diagnosis model.

6. A transformer fault diagnosis method, characterized in that: include: Acquire target fault data of the transformer to be diagnosed; The target fault data is input into the transformer fault diagnosis model according to any one of claims 1 to 5 to obtain a transformer fault diagnosis result, wherein the transformer fault diagnosis result at least includes the fault type to which the transformer belongs.

7. A training device for a transformer fault diagnosis model, characterized in that: include: A first acquisition module, used to acquire sample fault data of the transformer and first fault features under different fault types; A training module, used to train an initial transformer fault diagnosis model using the first fault feature and the sample fault data, wherein the initial transformer fault diagnosis model is a transformer fault diagnosis model constructed based on a combination of a random forest algorithm, a recursive feature elimination algorithm and an XGBoost algorithm; during the training process of the initial transformer fault diagnosis model, redundant features in the first fault feature are deleted using the random forest algorithm and the recursive feature elimination algorithm to obtain a second fault feature; and fault classification is performed based on the second fault feature and the sample fault data using the XGBoost algorithm; The optimization module is used to optimize the hyperparameters of the initial transformer fault diagnosis model based on a multi-strategy improved sparrow search algorithm to obtain a final transformer fault diagnosis model.

8. A transformer fault diagnosis device, characterized in that: include: The second acquisition module is used to acquire target fault data of the transformer to be diagnosed; An input module is used to input the target fault data into the transformer fault diagnosis model according to any one of claims 1 to 5 to obtain a transformer fault diagnosis result, wherein the transformer fault diagnosis result at least includes the fault type to which the transformer belongs.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the training method of the transformer fault diagnosis model according to any one of claims 1 to 5 or the transformer fault diagnosis method according to claim 6.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program enables a computer to execute the training method of a transformer fault diagnosis model according to any one of claims 1 to 5 or the transformer fault diagnosis method according to claim 6.

Citation Information

Cited By

  • Motor fault diagnosis method based on digital twinborn and improved random forest

    CN115481756A

  • A motor fault diagnosis method based on digital twinning and improved random forest

    CN115481756B