Self-adaptive algorithm for fault diagnosis of water conservancy power distribution transformer
The GP-connection network model is constructed through the series genetic algorithm and the particle swarm algorithm, and combined with the dissolved gas analysis method in oil, the problem of insufficient timeliness and targetedness in the fault diagnosis of distribution transformers is solved, and the fault diagnosis effect with high accuracy and short optimization time is achieved.
Patent Information
- Application Number
- CN202510007828.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-06-06
AI Technical Summary
The prior art has insufficient timeliness and targetedness in the fault diagnosis of distribution transformers, and lacks the pattern recognition function and global optimization ability of the comprehensive connection model.
The GP-connection network model is constructed by using tandem genetic algorithm and particle swarm algorithm. By optimizing the initial weight and critical value of the connection network, combined with the dissolved gas analysis method in oil, a complete connection model is established for fault diagnosis.
It realizes timely and accurate diagnosis of distribution transformer faults, has high identification accuracy and short optimization time, can effectively avoid misjudgment and misjudgment, and ensures the safety and stability of the power system.
Smart Images

Figure CN120105856A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a fault diagnosis algorithm for a hydroelectric power distribution transformer, and more particularly to an adaptive algorithm for fault diagnosis of a hydroelectric power distribution transformer, belonging to the technical field of fault diagnosis of distribution transformers. Background Art
[0002] Distribution transformers are important equipment in the power system and hydropower industry. Together with step-up and step-down transformers, they complete the transmission and distribution of electric energy from power plants to users. Overload operation, three-phase load imbalance, insulation aging, moisture, personnel misoperation, inadequate maintenance, external force damage or natural disasters can cause distribution transformer failures, which have a significant impact on social production and people's lives. Timely and accurate diagnosis of distribution transformer failures can eliminate hidden faults in advance, handle faulty equipment in a timely manner, and ensure the safety and stability of the power system, which is of great value.
[0003] Due to the complex and changeable working environment of distribution transformers, the types of faults that occur tend to be diversified, concurrent and hidden. It is increasingly difficult to accurately and timely determine the type and cause of faults, and the difficulty of maintenance increases accordingly. The traditional maintenance method of distribution transformers is regular maintenance of equipment, but it is impossible to make timely diagnosis of faults that occur during operation or between maintenance intervals, which has great limitations and ignores the economic efficiency of maintenance. With the development of the power system, the number of distribution transformers has gradually increased, and the regular maintenance method has gradually exposed problems such as blind maintenance and serious missed inspections, which not only increases the workload of power companies, but also has very low maintenance efficiency. After the implementation of condition maintenance, the control of distribution transformers has been significantly strengthened, and the pertinence and effectiveness of maintenance have also been greatly improved. Frequent power outages and disassembly are no longer required, which not only extends the service life of distribution transformers, but also reduces the waste of manpower and material resources.
[0004] This application studies the fault diagnosis technology of distribution transformers. Based on the collected status information, the operating status and fault type of the transformer are judged to provide algorithm support for online monitoring and fault diagnosis of distribution transformers.
[0005] The problems that need to be solved by the prior art distribution transformer fault diagnosis technology and the key technical difficulties of this application include:
[0006] (1) The existing preventive electrical test is an offline diagnosis and is not predictive, so its application scope is relatively limited. Although the IEC three-ratio method is widely used, it still has the following disadvantages: 1) Blind use of the IEC three-ratio method. According to DL / T722-2000 "Guidelines for Analysis and Judgment of Dissolved Gases in Transformer Oil", when the characteristic gas concentration reaches the attention value in the guideline, or the gas growth rate reaches the attention value, it can be determined that the transformer has a latent fault, and the IEC three-ratio method can be used at this time. If the IEC three-ratio method is directly calculated regardless of whether the gas concentration or gas growth rate reaches the attention value, it is very likely to cause misjudgment. 2) In the process of using the IEC three-ratio method, there will be situations that exceed the known coding combination, such as the coding combination 011. At this time, it is impossible to determine what type of fault it is. 3) There is controversy over the setting of the boundaries of the IEC three-ratio method. The strict division is too absolute, and the accuracy and timeliness are relatively poor.
[0007] (2) The existing intelligent diagnosis method based on expert system has some inherent defects. There are many types of distribution transformers, and it is difficult to record the fault cases of transformers. It is difficult for the expert knowledge base to cover all fault problems. If there are defects in the expert knowledge base, it will directly affect the accuracy of the diagnosis. In order to expand the way of knowledge acquisition, an artificial connection model can be introduced, and the learning ability of the connection model can be used to make up for the lack of expert experience. However, the integration of other intelligent algorithms will greatly change the knowledge layer of the knowledge base, making the structure more complex and maintenance more difficult. At present, the artificial connection model itself also has some shortcomings: excessive reliance on sample data, large randomness of the algorithm, and easy to fall into local extreme values. How to improve these defects, integrate other intelligent algorithms, and create a connection model with stronger recognition ability and shorter training time is an urgent problem to be solved in this application.
[0008] (3) The fault diagnosis of distribution transformers in the existing technology lacks timeliness and pertinence, and has coding loopholes. It lacks analysis of the structure and fault type of oil-immersed transformers, lacks the pattern recognition function of the comprehensive connection model, the global optimization ability of genetic algorithm and particle swarm algorithm, lacks a transformer fault diagnosis method that integrates multiple intelligent algorithms, and lacks a complete connection model based on the correspondence between transformer fault type and characteristic gas; it is impossible to use the particle swarm algorithm to optimize the initial weight critical value of the connection network, and it is impossible to use MATLAB to implement PSO-connection network; it is impossible to use the genetic algorithm to optimize the initial weight critical value of the connection network, and it is impossible to use MATLAB to implement GA-connection network; it is impossible to integrate genetic algorithm and particle swarm algorithm in series to complement each other, lack GP-connection network, and it is impossible to use MATLAB to implement such a fusion network; the algorithm has poor diagnostic effect, cannot timely and accurately diagnose distribution transformer faults, and cannot handle faulty equipment in time, which is not conducive to ensuring the safety and stability of the power system. Summary of the invention
[0009] This application connects the genetic algorithm and the particle swarm algorithm in series, which can effectively complement each other. On the one hand, it uses the good global search ability of the genetic algorithm to expand the search range and jump out of the local extreme value; on the other hand, it uses the fast convergence characteristics of the particle swarm algorithm to quickly approach the optimal solution. Through the simulation experiments and comparisons in this chapter, it is proved that the GP-connection network can guarantee a very high recognition accuracy rate. At the same time, the requirements for the population size are small, the optimization time is short, and it is convenient to update the connection network in time. Finally, it is determined to use the GP-connection network and apply it to the work of distribution transformer fault diagnosis, and a complete Java client is designed. Compared with traditional diagnostic methods, the diagnostic algorithm proposed in this application is timely, predictive and universal. It does not require offline detection and can be completed online; compared with the commonly used IEC three-ratio method, the diagnostic algorithm proposed in this application is more targeted and innovative. It can collect data and train the network for a specific substation or transformer to obtain the corresponding connection network, and can refer to historical operation data to effectively avoid the occurrence of misjudgment and missed judgment.
[0010] In order to achieve the above technical effects, the technical solutions adopted in this application are as follows:
[0011] Adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer, establish distribution transformer fault diagnosis method based on artificial connection model and characteristic gas method, construct 5-12-1 connection network model, build a time-varying learning rate connection network model with fast convergence speed; optimize the initial weight critical value of the connection network based on particle swarm algorithm, propose PSO-connection network model, and find a gradient descent time-varying inertia factor; optimize the initial weight critical value of the connection network based on genetic algorithm, propose GA-connection network model, introduce elimination operator, retain the global optimal solution, when the population size is small to a certain extent, the performance of GA-connection network drops sharply, as the population size increases, the accuracy of GA-connection network gradually improves, and when the population is large enough, the global optimal solution is found; integrate genetic algorithm and particle swarm algorithm in series, propose GP-connection network model, and develop distribution transformer fault diagnosis client based on GP-connection network model;
[0012] 1) Transformer fault diagnosis based on connection model: Establish a relationship model between dissolved gas in oil and fault type, analyze the establishment process of the connection model, and gradually determine the number of hidden layer neurons, activation function, training function and learning rate of the connection network;
[0013] 2) Transformer fault diagnosis based on PSO-connection network: Calculate the critical value of the weight of the connection network optimized by the particle swarm algorithm, establish the process of optimizing the connection network by the particle swarm algorithm, and analyze the setting of the inertia factor;
[0014] 3) Transformer fault diagnosis based on GA-connection network: Calculate the critical value of the weight of the connection network optimized by genetic algorithm, establish the process of optimizing the connection network by genetic algorithm, and construct an elimination operation method;
[0015] 4) Fusion optimization of GP-connected network: Based on the changing trends of the performance of GA-connected network and PSO-connected network under different population sizes, the population size of the optimization algorithm is optimized, a method architecture that integrates genetic algorithm and particle swarm algorithm is established, a fusion optimization GP-connected network algorithm is constructed, the implementation steps and processes of the GP-connected network are established, and a Java client with transformer diagnosis function is developed to realize simple calculation, batch calculation and retraining.
[0016] Preferably, the relationship model between dissolved gas in oil and fault type is:
[0017] 1) The characteristic gas component of overheating failure is CH 4 and C 2 H 4 , as the temperature increases, CH 4 and C 2 H 4 The concentration and gas production rate increase sharply. Only when a certain temperature is reached, a small amount of C 2 H 6 , H 2 and C 2 H 2 ;
[0018] 2) The characteristic gas component of discharge failure is H 2 and C 2 H 2 When the discharge energy is large, CH 4 , C 2 H 6 , C 2 H 4 ;
[0019] 3) When solid insulation is overheated or has a discharge fault, a large amount of CO and CO are generated. 2 .
[0020] Preferably, a connection diagnosis model is established: the dissolved gas method in oil is combined with the artificial connection model to determine the transformer fault type:
[0021] 1-Select sample data: When selecting sample data, select representative data after certain screening;
[0022] 2- Select input vector: When using the connection model, only CH 4 , C 2 H 4 , C 2H 6 , C 2 H 2 , H 2 5 kinds of gases meet the training requirements and obtain good judgment results. The number of input layer nodes of the connection model is 5;
[0023] 3- Selection of output vector: The output vector of the connection model is the identification target, i.e., the transformer fault type. A single-node output layer is used to represent the fault type with different codes;
[0024] Overheating faults are divided into low-temperature overheating, medium-temperature overheating and high-temperature overheating according to the fault temperature. Low-temperature overheating is below 300℃, high-temperature overheating is above 700℃, and medium-temperature overheating is between 300 and 700℃. Discharge faults are subdivided into partial discharge, low-energy discharge and high-energy discharge according to the discharge energy. Low-energy discharge refers to relatively weak spark discharge, and high-energy discharge refers to arc discharge and relatively strong spark discharge. There are also trace amounts of characteristic gases in the normal operation of the transformer. With the increase of discharge energy, CH 2 As the superheat temperature increases, CH 4 and C 2 H 4 The content of gradually increases, and it is determined that there is a simple increasing relationship between the fault type and the output vector code, and the output code is set to 0 to 6; the relationship between the fault type and the output vector is: normal-0, low temperature overheating-1, medium temperature overheating-2, high temperature overheating-3, partial discharge-4, low energy discharge-5, high energy discharge-6;
[0025] 4- Normalization: Compare the contents of 5 characteristic gases, H 2 The content of C 2 H 2 The content of gas is small, so the gas content is normalized and input in percentage form. The normalization formula is as follows:
[0026]
[0027] Where i=1,2,3,4,5,j represents the jth sample input, v ij is the concentration of the jth sample of gas i, X ij is the normalized content percentage of the jth sample of gas i. After normalization, the gas concentration is converted into a dimensionless percentage, and the influence weights of the five gases are consistent;
[0028] 5-Select the evaluation criteria: focus on the accuracy and error of the judgment. The error is calculated as follows:
[0029]
[0030] In the formula, yk is the simulation result, y k * is the expected result, E is the error;
[0031] To calculate the accuracy, first round the simulation result to an integer result, then compare it with the expected result. The output vector is a code from 0 to 6, and the expected result is also an integer from 0 to 6. Use the for loop statement in MATLAB to complete the comparison of 100 sets of simulation results and expected results, compare whether the simulation results and expected results are the same and count them, and finally divide the number of the same results by the total number to get the accuracy.
[0032] Preferably, the fault diagnosis model of the PSO-connected network: the particle swarm algorithm and the connection model are combined to form a PSO-connected fusion network, and the PSO-connected network is used to perform fault diagnosis of the distribution transformer;
[0033] The particle swarm algorithm is used to optimize the weights and critical values of the connection network:
[0034] 1) Map the initial weights and appearance of the connection network to particles, regard each particle as a possible solution, and randomly generate an initial population consisting of multiple particles;
[0035] 2) The particle swarm follows the predation law of birds and searches for the optimal solution by simulating the predation process of birds. After multiple iterative searches, the combination of weight critical values with the highest fitness is obtained. This group of values makes the error of the connection model tend to the global minimum;
[0036] 3) Use the above weight critical values as the initial weights and critical values of the connection network for training and simulation.
[0037] Preferably, the construction of a PSO-connected network:
[0038] 1- Design of connection model
[0039] A three-layer connection network is used, the number of hidden layer nodes is 12, the activation function of the input layer-hidden layer is the tansig function, the activation function of the hidden layer-output layer is the purelin function, the training function is trainlm, and the learning rate is the adaptive learning rate 50e- 0.1T ;
[0040] 2- Generate the initial population
[0041] The particle swarm P is composed of N particles and moves in the D-dimensional search space. The connection model has 72 weights and 13 critical values. D is 72+13=85. The search effect is best when the number of particles is 30. N=30, and the i-th particle is represented by an 85-dimensional vector:
[0042] X i =(xi1 , x i2 ...x i85 ), i=1, 2..., 30 Equation 3
[0043] The particle value range is set to [-3,3], and the particle movement speed V i It is expressed as:
[0044] V i =(v i1 , v i2 ...v i85 ), i=1, 2..., 30 Equation 4
[0045] The particle velocity range is set to [-0.6, 0.6], and the learning factor c 1 and c 2 They are used to control the movement of particles to their own best historical position and the global best historical position, respectively. 1 and c 2 Take a fixed value, c 1 =c 2 =2;
[0046] 3- Design of fitness function
[0047] The error E of the fitness function is:
[0048]
[0049] The smaller the error, the better, and the greater the fitness, the better. The fitness function is rewritten as:
[0050]
[0051] After calculation, the fitness of the i-th particle X is f i During the search process, each particle needs to learn from its own historical best position, and needs to record the historical best fitness of the particle and the individual extreme point. The historical best fitness of the i-th particle is recorded as f best (i), the individual extreme point is denoted as p best (i) At the same time, each particle still needs to learn from the global best historical position, record the global best historical fitness and the global extreme point, and the global best historical fitness is recorded as f best , the global extreme point is denoted as g best After calculating the fitness of each generation population, the global historical best fitness and global extreme point are updated, and the historical best fitness and individual extreme point of each particle are updated;
[0052] 4- Adjustment strategy design
[0053] After the global extreme value and individual extreme value are updated, all particles must adjust their speed in order to search for the best position. All particles will gather to the historical best position of themselves and the entire population, and learn from the historical best. The expression of the adjustment strategy is:
[0054]
[0055] Where t is the number of iterations, V i t Indicates the movement speed of this generation, V i t+1 represents the adjusted speed, w represents the inertia factor, and wV i t represents the inertia of the particle motion, c 1 is the learning factor for the particle to learn from its best historical position, α 1 is a random number between (0,1), c 1 α 1 ·(p besd (i)-X i t ) represents the adjustment of the particle to its historical best position, c 2 is the learning factor for the particle to learn from the global best historical position, α 2 is also a random number between (0,1), c 2 α 2 ·(g best -X i t ) represents the adjustment of the particle to the global best historical position;
[0056] 5- Design of inertia factor
[0057] A time-varying inertia factor is used. The inertia factor decreases monotonically with the increase of the number of iterations. In the early stage of the search, the inertia factor is large, and the global search ability is strong, which helps to find the vicinity of the optimal solution. As the number of iterations increases, the inertia factor gradually decreases, the global search ability weakens, but the local development ability is enhanced, and the convergence speed is accelerated. The calculation formula of the inertia factor w is:
[0058]
[0059] In the formula, w max represents the maximum inertia factor, that is, the initial inertia factor, and takes w max =0.9; w min represents the minimum inertia factor, that is, the termination inertia factor, and takes w min =0.4; t is the number of iterations, T max Indicates the maximum number of iterations.
[0060] Preferably, the implementation process of the PSO-connected network is:
[0061] 1) Initialize the particle swarm P, determine the population size N, dimension D, and learning factor c 1 and c 2 , randomly select the position X of each particle i and speed V i , at this time t=1;
[0062] 2) Set the particle position X as the initial weight and critical value of the connection network, then input the training sample to start training and simulation, and output the simulation results; calculate the fitness f of particle i according to the fitness function i t , the fitness of each particle is calculated in this way;
[0063] 3) Update the historical best fitness and individual extreme point of each particle, using f i t and f best (i) Compare, if f i t >f best (i), then use f i t Replace f best (i) Use X i t Replace p best (i);
[0064] 4) Update the global historical best fitness and global extreme point, using f i t and f best Compare, if f i t >f best , then use f i t Replace f best , use X i t Replace g best ;
[0065] 5) Update the movement speed V of each particle according to the adjustment strategy i t+1 ;
[0066] 6) Update the position X of each particle according to the execution strategy i t+1 , let t = t + 1;
[0067] 7) Assign the new population individuals to the connection network and calculate the fitness of each particle again;
[0068] 8) If t≠100, continue with the next generation operation and go to step 3);
[0069] 9) If t = 100, output the optimization result g best , g best The initial weights and critical values of the connection network model are trained until the error accuracy requirements are met, and the trained connection network is saved.
[0070] Preferably, the construction of the GA-connected network:
[0071] 1-Choice of encoding method
[0072] Each chromosome of the genetic algorithm of the present application consists of four parts: the weight between the input layer and the hidden layer, the critical value of the hidden layer, the weight between the hidden layer and the output layer, and the critical value of the output layer;
[0073] Assume that each chromosome in the population contains D genes, and the calculation formula is: D = N·M+M+M·Q+Q, where N, M, and Q are the number of neurons in the input layer, hidden layer, and output layer respectively;
[0074] The three-layer connection network has N=5, M=12, Q=1, D=85, and the total number of weights is 5×12+12×1=72; the total number of critical values is 12+1=13. The real number coding converts the one-dimensional vector composed of the weight critical values into a chromosome. The length of each chromosome is the total number of genes and the sum of the number of critical values of the connection network weights. The chromosome length is 85, and the genetic algorithm needs to optimize a total of 85 parameters.
[0075] 2-Generation of initial population
[0076] The gene value range is [-3,3]. The longer the chromosome, the larger the population size required. The larger the population size, the more iterations are needed to fully search, and the optimization time is correspondingly extended. When N=50, the optimization effect is good, the connection network recognition rate is high, and the optimization time is moderate;
[0077] 3-Select the design of the operation
[0078] The selection probability distribution adopts the fitness ratio distribution. The probability P of each individual being selected is the ratio of the individual's own fitness to the sum of the fitness of all individuals in the population. i , whose fitness is f i , the population size is P, and the probability P of this individual being selected is:
[0079]
[0080] Calculate the cumulative probability Q by selecting the probability P i :
[0081]
[0082] Each selection starts with a random constant X in the range [0,1], and uses X as a selection pointer to find the selected individual. The selection process imitates the roulette wheel: if X < Q, select individual 1; if Q i-1 ≤X<Q i , then select individual i;
[0083] When selecting, individuals are selected in a random and equidistant manner. The population dimension is N, then the cumulative probability of each individual being selected is Q i is 1 / N, and then the selection is carried out in the same way as the roulette wheel, except that individuals with different fitness have an equal chance of being selected;
[0084] 4- Design of crossover operation
[0085] The parent individual X of the tth generation a t and X b t Perform arithmetic crossover between them, and the two new individuals after crossover are:
[0086]
[0087]
[0088] Among them, α∈(0,1) is a randomly generated number during the crossover operation. In each generation of crossover operation, N rounds of crossover operations are performed, N is the population dimension, and the two parent chromosomes for crossover are randomly selected from the population. Whether to crossover is determined by the crossover probability P c Determine, in this application the crossover probability P c =0.7, the specific operation is as follows:
[0089] 1) Randomly select two chromosomes X in the tth generation population a t and X b t As a crossover parent;
[0090] 2) Randomly generate a number (0,1) rand. If it is less than the crossover probability, rand<P c , then the subsequent crossover operation is performed, otherwise no crossover operation occurs in this round;
[0091] 3) If a crossover operation occurs, a random number α (0,1) is used to perform arithmetic crossover according to the above formula;
[0092] 4) Each round can only carry out one crossover at most. After the crossover operation is completed, it will automatically enter the next round. Each generation will carry out N rounds of crossover in total.
[0093] 5- Design of mutation operation
[0094] Individual X of generation t k t Gene x m t If a mutation occurs, the new individual after the mutation is:
[0095] x m ′=x min +r·(x max -x min ) Formula 12
[0096] Among them, r∈(0,1) is the random number generated by the mutation operation, x max is the maximum value of the gene, x min is the minimum value of the gene, x max =3,x min =-3. In each generation of mutation operation, all chromosomes participate in the mutation operation one by one. From the first gene to the last gene in the chromosome, each gene is judged whether it has mutated. The occurrence of mutation is determined by the mutation probability P. m Determine, the mutation probability P in this application m =0.045, the specific operation is as follows:
[0097] 1) Select chromosomes one by one in the t-th generation population. Suppose the m-th chromosome X is selected. mt ;
[0098] 2) Starting from the first gene, determine whether a mutation has occurred one by one, and randomly select a number (0,1) rand. If it is less than the mutation probability, rand < P m , then it is determined that the gene at that position has mutated, otherwise it jumps to the next gene;
[0099] 3) After determining that a mutation has occurred, a random number r (0,1) is used to perform uniform mutation according to the above formula;
[0100] 4) Each chromosome can undergo one or more gene mutations. m t After all genes on the chromosome are judged, the chromosome X m+1 t The mutation operation is repeated until all chromosomes have completed the mutation operation;
[0101] 6- Design of elimination operation
[0102] The elimination operation starts from the second generation and occurs after the fitness calculation. After the fitness calculation of all individuals in the tth generation population is completed, the individuals with the largest and smallest fitness are recorded, which are X and max t and Xmin t , the fitness is f max t and f min t , the best fitness recorded in the previous generation is f best t-1 , individual is X best t-1 , the specific method is as follows:
[0103] 1) If f min t <f best t-1 , eliminate the individual Xmin with the smallest fitness in the tth generation t , using the best individual X of the previous generation best t-1 Instead; otherwise, Xmin t remain unchanged;
[0104] 2) After elimination, if f best t-1 <f max t , then the best fitness and the best individual recorded are the best fitness of this generation f max t and the optimal individual X max t Make a replacement, otherwise, the global optimal individual remains unchanged;
[0105] Eliminate the last one, retain the best individual in the world, ensure the superiority of the population, and ensure global convergence;
[0106] 7- Setting of stopping criteria
[0107] Use the maximum number of iterations method and iterate to the maximum number of iterations T max When , stop iterating and output the optimization results. After several experiments, determine T max =100, at this time the genetic algorithm fully searches the entire search space and converges.
[0108] Preferably, the implementation process of the GA-connected network is:
[0109] 1) Population P initialization, including population size N, crossover rate P c , mutation rate P m , chromosomes are coded with real numbers;
[0110] 2) After encoding, the chromosome gene is used as the initial weight and critical value of the connection network, and then the training sample is input to start training and simulation, and the results are output; the fitness f of individual i is calculated according to the fitness function i t, use this method to calculate the fitness of each individual; record the individual with the highest fitness X best t and the best fitness f best t ;
[0111] 3) Calculate the selection probability P of each individual according to the fitness ratio distribution formula i , and then perform the selection operation by the roulette method;
[0112] 4) For a random individual X in generation t a t and X b t Perform arithmetic crossover to generate new offspring individuals X' and X. Individuals that are not selected for crossover operation are directly copied, and a total of N rounds of crossover operation are performed;
[0113] (5) Perform mutation operations on individuals of generation t one by one, judge the genes of the selected individuals one by one, perform uniform mutation operations on the mutated genes, and directly copy the genes that have not mutated;
[0114] (6) After the mutation operation is completed, let t = t + 1, assign the new population individuals to the connection network respectively, and calculate the fitness of each individual again;
[0115] (7) Find the individual X with the minimum fitness min t , and the best individual X of the previous generation best t-1 For comparison, if the fitness f min t <f best t-1 , eliminate the individual X with the smallest fitness min t , replaced by the best individual X of the previous generation best t-1 , the elimination operation is performed 99 times in total; then the individual X with the highest global fitness is updated best t and the best fitness f best t ;
[0116] (8) If t≠100, continue genetic operation and go to step 3);
[0117] (9) If t = 100, stop the genetic operation and output the optimization result X best , X best The initial weights and critical values of the connection network are used for training until the error accuracy requirements are met, and the trained connection network is saved.
[0118] Preferably, a fusion optimization GP-connection network algorithm is constructed: both the genetic algorithm and the particle swarm algorithm are based on the population as the operation basis, and both use a single population. The population is composed of several individuals, each individual corresponds to a possible solution or potential solution, and the individual is a feature set. The individual of the genetic algorithm is the chromosome, and the feature is the gene; the individual of the particle swarm algorithm is the particle, and the feature is the particle coordinate;
[0119] Genetic algorithm and particle swarm algorithm are both evolutionary algorithms, and both generally include five steps of evolution:
[0120] 1) Initialize the population. The initial population of both algorithms is randomly generated.
[0121] 2) Calculate fitness. Both algorithms determine the search direction by fitness, and the fitness function is derived from the objective function;
[0122] 3) Stopping criterion, both algorithms use the stopping criterion of the maximum number of iterations;
[0123] 4) Population selection: Genetic algorithm uses roulette wheel selection method, while particle swarm selects the entire population;
[0124] 5) Evolutionary operation: The operations of genetic algorithm include crossover, mutation and elimination, while the operation of particle swarm is the update of speed and coordinates, recording and updating individual extreme points and global extreme points;
[0125] This application adds selection, crossover, mutation, and elimination operations similar to genetic algorithms on the basis of the original operations of particle swarm optimization to enhance population diversity, integrates the four operations of real-coded genetic algorithms into particle swarm optimization, constructs a fusion algorithm that integrates the characteristics of two optimization algorithms, and uses the fusion algorithm to optimize the connection network;
[0126] The genetic algorithm and particle swarm algorithm are fused with equal status, and the fused algorithm GA-PSO is combined with the connection network to form the GP-connection network.
[0127] Preferably, the implementation process of the GP-connection network is:
[0128] 1) Initialize the particle swarm P, including the population size N, dimension D, and crossover rate P c , mutation rate P m , learning factor c 1 and c 2 , using real number coding, randomly output the position X of each particle i and speed V i , at this time t=1;
[0129] 2) Set the particle position X iSet as the initial weight and critical value of the connection network, then input the training sample to start training and simulation, and output the results; calculate the fitness f of particle i according to the fitness function i t , the fitness of each particle is calculated in this way;
[0130] 3) Update the historical best fitness and individual extreme point of each particle, using f i t and f best (i) Compare, if f i t >f best (i), then use f i t Replace f best (i) Use X i t Replace p best (i);
[0131] 4) Update the global historical best fitness and global extreme point, using f i t and f best (i) Compare, if f i t >f best , then use f i t Replace f best , use X i t Replace g best ;
[0132] 5) Assign the position parameters of the particles to the chromosomes, which are also encoded using real numbers;
[0133] 6) Calculate the selection probability P of each individual according to the fitness ratio distribution formula i , and then perform the selection operation by the roulette method;
[0134] 7) For the randomly selected individual X of generation t a t and X b t Perform arithmetic crossover to produce new offspring individuals X a t+1 and X b t+1 , the individuals that are not selected are directly copied, and a total of N rounds of crossover operations are performed;
[0135] 8) Perform mutation operations on individuals of generation t one by one, judge the genes of the selected individuals one by one, perform uniform mutation operations on the mutated genes, and directly copy the genes that have not mutated;
[0136] 9) Assigning the genetic parameters of the chromosome to the particles to obtain a new particle population;
[0137] 10) Update the movement speed V of each particle according to the adjustment strategy i t+1 ;
[0138] 11) Update the position X of each particle according to the execution strategy i t+1 , let t = t + 1;
[0139] 12) After the particle position is updated, the new population individuals are assigned to the connection network and the fitness of each particle is calculated again;
[0140] 13) Find the individual X with the minimum fitness min t , and the best individual X of the previous generation best t-1 For comparison, if the fitness f min t <f best t-1 , eliminate the individual X with the smallest fitness min t , replaced by the best individual X of the previous generation best t-1 , the elimination operation is performed 99 times in total; then the individual X with the highest global fitness is updated best t and the best fitness f best t ;
[0141] 14) If t≠100, continue with the next generation operation and go to step 3);
[0142] 15) If t = 100, output the optimization result g best , g best The connection model is trained as the initial weights and critical values until the error accuracy requirements are met, and the trained connection network is saved.
[0143] Compared with the prior art, the innovations and advantages of this application are:
[0144] (1) This application analyzes the structure and fault type of oil-immersed transformers. Based on the dissolved gas analysis method in oil, the recognition accuracy and global error are used as the evaluation criteria. The pattern recognition function of the connection model, the global optimization ability of the genetic algorithm and the particle swarm algorithm are integrated to propose a transformer fault diagnosis method GP-connection network that integrates multiple intelligent algorithms. Through the analysis of the transformer diagnosis algorithm, the diagnosis effect of different intelligent algorithms is discussed. Based on the corresponding relationship between the transformer fault type and the characteristic gas, a complete connection model is established. The training and test simulation of the connection network are realized by MATLAB; the initial weight critical value of the connection network is optimized by the particle swarm algorithm, and the PSO-connection network is realized by MATLAB; the initial weight critical value of the connection network is optimized by the genetic algorithm, and the GA-connection network is realized by MATLAB; the genetic algorithm and the particle swarm algorithm are integrated in series to learn from each other and propose the GP-connection network. This fusion network is realized by MATLAB and compared with the previous connection network; an original diagnosis algorithm is proposed to make it both accurate and timely, making up for the shortcomings of the IEC three-ratio method. The transformer fault diagnosis client is developed using Java to implement the connection network proposed in this application, which can perform simple calculations, batch calculations and network retraining.
[0145] (2) This application establishes a distribution transformer fault diagnosis model based on an artificial connection model and a characteristic gas method, and adopts a combination of multiple optimization algorithms and a connection network. Through a simple comparison of the diagnosis effects of the connection network and the RBF network, it is proved that the connection network has a higher accuracy rate. A 5-12-1 connection network model was established, and a time-varying learning rate with fast convergence speed was found. The accuracy of the connection network model can reach 83%. The particle swarm algorithm was used to optimize the initial weight critical value of the connection network, and a PSO-connection network model was proposed. A gradient descent time-varying inertia factor was found. The recognition accuracy of the PSO-connection network can reach 86%, and the network stability is also significantly improved. The genetic algorithm was used to optimize the initial weight critical value of the connection network, and a GA-connection network model was proposed. The elimination operator was introduced to retain the global optimal solution. The recognition accuracy of the GA-connection network is as high as 93%, but the optimization time is relatively long. It is proved that the convergence speed of the PSO-connection network is better than that of the GA-connection network. When the population size is small to a certain extent, the performance of the GA-connected network drops sharply. As the population size increases, the accuracy of the GA-connected network gradually increases. When the population is large enough, the global optimal solution can be found. The genetic algorithm and the particle swarm algorithm are integrated in series to propose a GP-connected network model, which has a recognition accuracy of up to 96%, and a relatively small population size. The optimization time is between the GA-connected network and the PSO-connected network. It can timely and accurately diagnose distribution transformer faults, eliminate potential faults in advance, and handle faulty equipment in a timely manner to ensure the safety and stability of the power system, which is of great value.
[0146] (3) This application connects the genetic algorithm and the particle swarm algorithm in series, which can effectively complement each other. On the one hand, it uses the good global search ability of the genetic algorithm to expand the search range and jump out of the local extreme value; on the other hand, it uses the fast convergence characteristics of the particle swarm algorithm to quickly approach the optimal solution. Through the simulation experiments and comparisons in this chapter, it is proved that the GP-connection network can guarantee a very high recognition accuracy. At the same time, the population size requirement is small, the optimization time is short, and it is convenient to update the connection network in time. Finally, it is determined to use the GP-connection network and apply it to the work of distribution transformer fault diagnosis, and a complete Java client is designed. Compared with traditional diagnostic methods, the diagnostic algorithm proposed in this application is timely, predictive and universal. It does not require offline detection and can be completed online. Compared with the commonly used IEC three-ratio method, the diagnostic algorithm proposed in this application is more targeted and innovative. It can collect data and train the network for a specific substation or transformer to obtain the corresponding connection network, and can refer to historical operation data to effectively avoid the occurrence of misjudgment and missed judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0147] Figure 1 This is a comparison chart of transformer fault types and characteristic gases.
[0148] Figure 2 It is a comparison chart of characteristic gas content at different superheat temperatures.
[0149] Figure 3 It is the implementation flow chart of PSO-connected network.
[0150] Figure 4 It is the implementation flow chart of GA-connected network.
[0151] Figure 5 This is a schematic diagram of the relationship between the scale inhibition rate of the copolymer and the amount of initiator used.
[0152] Figure 6 This is a display diagram of the best diagnostic effects of the four connection networks in this application. DETAILED DESCRIPTION
[0153] The following, in conjunction with the accompanying drawings, further describes the technical solution of the adaptive algorithm for fault diagnosis of hydraulic power distribution transformers provided in the present application, so that those skilled in the art can better understand the present application and implement it.
[0154] The fault diagnosis of distribution transformers should be accurate and timely. The most commonly used method in power companies is the dissolved gas analysis method in oil, and the diagnostic rule is the IEC three-ratio method. Although the three-ratio method has a certain degree of accuracy, it lacks timeliness and pertinence, and there are coding loopholes. In order to improve the above-mentioned drawbacks, this application first analyzes the structure and fault type of oil-immersed transformers, based on the dissolved gas analysis method in oil, using the recognition accuracy and global error as the evaluation criteria, and comprehensively connecting the pattern recognition function of the model, the global optimization ability of the genetic algorithm and the particle swarm algorithm, and proposes a transformer fault diagnosis method GP-connection network that integrates multiple intelligent algorithms. Through the study of transformer diagnosis algorithms, the diagnostic effects of different intelligent algorithms are explored, and an original diagnosis algorithm is proposed to make it both accurate and timely, making up for the shortcomings of the IEC three-ratio method.
[0155] 1) Transformer fault diagnosis based on connection model: Establish a relationship model between dissolved gas in oil and fault type, analyze the establishment process of the connection model, and gradually determine the number of hidden layer neurons, activation function, training function and learning rate of the connection network;
[0156] 2) Transformer fault diagnosis based on PSO-connection network: Calculate the critical value of the weight of the connection network optimized by the particle swarm algorithm, establish the process of optimizing the connection network by the particle swarm algorithm, and analyze the setting of the inertia factor;
[0157] 3) Transformer fault diagnosis based on GA-connection network: Calculate the critical value of the weight of the connection network optimized by genetic algorithm, establish the process of optimizing the connection network by genetic algorithm, and construct an elimination operation method;
[0158] 4) Fusion optimization of GP-connected network: Based on the changing trends of the performance of GA-connected network and PSO-connected network under different population sizes, the population size of the optimization algorithm is optimized, a method architecture that integrates genetic algorithm and particle swarm algorithm is established, a fusion optimization GP-connected network algorithm is constructed, the implementation steps and processes of the GP-connected network are established, and a Java client with transformer diagnosis function is developed to realize simple calculation, batch calculation and retraining.
[0159] 1. Transformer fault diagnosis based on connection model
[0160] (I) Relationship model between dissolved gas in oil and fault type
[0161] The characteristic gas in DGA comes from the insulating material. The distribution transformer adopts oil-immersed transformer, whose insulating materials are insulating oil and solid insulation.
[0162] The transformer insulating oil is composed of CH compounds, with carbon and hydrogen accounting for 95 to 99%. When a transformer fails, the CH bonds or CC bonds of the CH compounds will break under the action of heat and electricity, producing alkanes, alkenes, alkynes and coke in turn. Solid insulation includes insulating boards and insulating paper, which are composed of cellulose and contain a large number of CO bonds. Similar to insulating oil, when a transformer fails, various hydrocarbon gases and H 2 , accompanied by CO and CO 2 Mass generation of .
[0163] When the transformer is operating normally, the content of several characteristic gases is stable, but when there are latent faults, especially overheating faults and discharge faults, the content and gas production rate of characteristic gases increase significantly. There is a corresponding relationship between different fault types of transformers and the types of characteristic gases, such as Figure 1 shown.
[0164] Overheating faults and discharge faults will cause the rapid generation of characteristic gases. The most produced gas in discharge faults is H 2 , the most common cause of overheating failure is CH 4 , the decomposed characteristic gas components are the same as the temperature changes. At different temperatures, the contents of the five characteristic gases are as follows Figure 2 .
[0165] When the temperature is low, CO is produced 2 and CH 4 ; When the temperature rises to 500℃, C begins to be generated 2 H 6 , C 2 H 4 and H 2 , but with the increase of temperature, C 2 H 4 The content gradually exceeds C 2 H 6 and H 2 ; When the temperature rises to 800℃, a small amount of C 2 H 2 .
[0166] In summary, three conclusions can be drawn:
[0167] 1) The characteristic gas component of overheating failure is CH 4 and C 2 H 4 , as the temperature increases, CH 4 and C 2 H 4 The concentration and gas production rate increase sharply. Only when a certain temperature is reached, a small amount of C 2 H 6 , H 2 and C2 H 2 ;
[0168] 2) The characteristic gas component of discharge failure is H 2 and C 2 H 2 When the discharge energy is large, CH 4 , C 2 H 6 , C 2 H 4 ;
[0169] 3) When solid insulation is overheated or has a discharge fault, a large amount of CO and CO are generated. 2 .
[0170] (II) Establishing a connection diagnosis model
[0171] This application combines the dissolved gas in oil method with the artificial connection model, and replaces the IEC three-ratio method with the connection model to make a more accurate and targeted transformer fault type determination.
[0172] 1. Select sample data: When selecting sample data, select representative data after certain screening.
[0173] 2. Select input vector: When using the connection model, only CH 4 , C 2 H 4 , C 2 H 6 , C 2 H 2 , H 2 5 kinds of gases meet the training requirements and obtain good judgment results. The number of input layer nodes of the connection model is 5.
[0174] 3. Selection of output vector: The output vector of the connection model is the identification target, i.e., the transformer fault type. A single-node output layer is used to represent the fault type with different codes;
[0175] Overheating faults are divided into low-temperature overheating, medium-temperature overheating and high-temperature overheating according to the fault temperature. Low-temperature overheating is below 300℃, high-temperature overheating is above 700℃, and medium-temperature overheating is between 300 and 700℃. Discharge faults are subdivided into partial discharge, low-energy discharge and high-energy discharge according to the discharge energy. Low-energy discharge refers to relatively weak spark discharge, and high-energy discharge refers to arc discharge and relatively strong spark discharge. There are also trace amounts of characteristic gases in the normal operation of the transformer. With the increase of discharge energy, CH 2 As the superheat temperature increases, CH 4 and C 2 H 4The content of the fault gradually increases, and it is determined that there is a simple increasing relationship between the fault type and the output vector code, and the output code is set to 0 to 6. The relationship between the fault type and the output vector is: normal-0, low temperature overheating-1, medium temperature overheating-2, high temperature overheating-3, partial discharge-4, low energy discharge-5, high energy discharge-6.
[0176] 4. Normalization: Compare the contents of 5 characteristic gases, H 2 The content of C 2 H 2 The content of gas is small, so the gas content is normalized and input in percentage form. The normalization formula is as follows:
[0177]
[0178] Where i=1,2,3,4,5,j represents the jth sample input, v ij is the concentration of the jth sample of gas i, X ij is the normalized content percentage of the jth sample of gas i. After normalization, the gas concentration is converted into a dimensionless percentage, and the influence weights of the five gases are consistent.
[0179] 5. Select the evaluation criteria: focus on the accuracy and error of the judgment. The error is calculated as follows:
[0180]
[0181] In the formula, y k is the simulation result, y k * is the expected result, E is the error;
[0182] To calculate the accuracy, first round the simulation result to an integer result, then compare it with the expected result. The output vector is a code from 0 to 6, and the expected result is also an integer from 0 to 6. Use the for loop statement in MATLAB to complete the comparison of 100 sets of simulation results and expected results, compare whether the simulation results and expected results are the same and count them, and finally divide the number of the same results by the total number to get the accuracy.
[0183] 2. Transformer Fault Diagnosis Based on PSO-Connected Network
[0184] (I) Fault diagnosis model of PSO-connected network
[0185] The training algorithm of the connection network itself does not have the ability to search globally, and it is difficult to jump out of the local minimum area during the training process. In addition, the initial weights and critical values of the connection network are randomly generated, which makes the stability of the connection network poor. Giving the connection model excellent initial weights and critical values can further reduce errors and improve training speed and recognition accuracy.
[0186] The particle swarm optimization algorithm and the connection model are combined to form a PSO-connection fusion network, and the PSO-connection network is used to perform fault diagnosis of distribution transformers.
[0187] The particle swarm algorithm is used to optimize the weights and critical values of the connection network:
[0188] 1) Map the initial weights and appearance of the connection network to particles, regard each particle as a possible solution, and randomly generate an initial population consisting of multiple particles;
[0189] 2) The particle swarm follows the predation law of birds and searches for the optimal solution by simulating the predation process of birds. After multiple iterative searches, the combination of weight critical values with the highest fitness is obtained. This group of values makes the error of the connection model tend to the global minimum;
[0190] 3) Use the above weight critical values as the initial weights and critical values of the connection network for training and simulation.
[0191] (II) Construction of PSO-connection network
[0192] 1- Design of connection model
[0193] A three-layer connection network is used, the number of hidden layer nodes is 12, the activation function of the input layer-hidden layer is the tansig function, the activation function of the hidden layer-output layer is the purelin function, the training function is trainlm, and the learning rate is the adaptive learning rate 50e- 0.1T .
[0194] 2- Generate the initial population
[0195] The particle swarm P is composed of N particles and moves in the D-dimensional search space. The connection model has 72 weights and 13 critical values. D is 72+13=85. The search effect is best when the number of particles is 30. N=30, and the i-th particle is represented by an 85-dimensional vector:
[0196] X i =(x i1 , x i2 …x i85 ), i=1, 2…, 30 Equation 3
[0197] The particle value range is set to [-3,3], and the particle movement speed V i It is expressed as:
[0198] V i =(v i1 , vi2…v i85 ), i=1, 2…, 30 Equation 4
[0199] The particle velocity range is set to [-0.6, 0.6], and the learning factor c 1 and c 2 They are used to control the movement of particles to their own best historical position and the global best historical position, respectively. 1 and c 2 Take a fixed value, c 1 =c 2 =2.
[0200] 3- Design of fitness function
[0201] The error E of the fitness function is:
[0202]
[0203] The smaller the error, the better, and the greater the fitness, the better. The fitness function is rewritten as:
[0204]
[0205] After calculation, the fitness of the i-th particle X is f i During the search process, each particle needs to learn from its own historical best position, and needs to record the historical best fitness of the particle and the individual extreme point. The historical best fitness of the i-th particle is recorded as f best (i), the individual extreme point is denoted as p best (i) At the same time, each particle still needs to learn from the global best historical position, record the global best historical fitness and the global extreme point, and the global best historical fitness is recorded as f best , the global extreme point is denoted as g best After calculating the fitness of each generation of population, the global historical best fitness and global extreme point are updated, and the historical best fitness and individual extreme point of each particle are updated.
[0206] 4- Adjustment strategy design
[0207] After the global extreme value and individual extreme value are updated, all particles must adjust their speed in order to search for the best position. All particles will gather to the historical best position of themselves and the entire population, and learn from the historical best. The expression of the adjustment strategy is:
[0208]
[0209] Where t is the number of iterations, V it Indicates the movement speed of this generation, V i t+1 represents the adjusted speed, w represents the inertia factor, and wV i t represents the inertia of the particle motion, c 1 is the learning factor for the particle to learn from its best historical position, α 1 is a random number between (0,1), c 1 α 1 ·(p best (i)-X i r ) represents the adjustment of the particle to its historical best position, c 2 is the learning factor for the particle to learn from the global best historical position, α 2 is also a random number between (0,1), c 2 α 2 ·(g best -X i t ) represents the adjustment of the particle to the global best historical position.
[0210] 5- Design of inertia factor
[0211] A time-varying inertia factor is used. The inertia factor decreases monotonically with the increase of the number of iterations. In the early stage of the search, the inertia factor is large, and the global search ability is strong, which helps to find the vicinity of the optimal solution. As the number of iterations increases, the inertia factor gradually decreases, the global search ability weakens, but the local development ability is enhanced, and the convergence speed is accelerated. The calculation formula of the inertia factor w is:
[0212]
[0213] In the formula, w max represents the maximum inertia factor, that is, the initial inertia factor, and takes w max =0.9; w min represents the minimum inertia factor, that is, the termination inertia factor, and takes w min =0.4; t is the number of iterations, T max Indicates the maximum number of iterations.
[0214] 6- Design of execution strategy
[0215] ParticlesX i Go straight ahead at the calculated speed, X i t+1 =X i t +V i t+1 ·t * , t *Iteration time, in this application, t * = 0.5, limiting the range of particle movement. i The position parameter x ij If the setting range [-3,3] is exceeded, the position parameter xi j Modify to the nearest boundary value.
[0216] 7- Setting of stopping criteria
[0217] Use the maximum number of iterations method and iterate to the maximum number of iterations T max When the optimization result is output, the iteration is stopped. This application determines T max =100, at this time the particle swarm algorithm fully searches the entire search space and converges.
[0218] (III) Implementation process of PSO-connected network
[0219] The implementation process of PSO-connected network is as follows Figure 3 ,The specific steps of PSO-connected network are as follows:
[0220] 1) Initialize the particle swarm P, determine the population size N, dimension D, and learning factor c 1 and c 2 , randomly select the position X of each particle i and speed V i , at this time t=1;
[0221] 2) Set the particle position X as the initial weight and critical value of the connection network, then input the training sample to start training and simulation, and output the simulation results; calculate the fitness f of particle i according to the fitness function i t , the fitness of each particle is calculated in this way;
[0222] 3) Update the historical best fitness and individual extreme point of each particle, using f i t and f best (i) Compare, if f i t >f best (i), then use f i t Replace f best (i) Use X i t Replace p best (i);
[0223] 4) Update the global historical best fitness and global extreme point, using f i t and f best Compare, if f it >f best , then use f i t Replace f best , use X i t Replace g best ;
[0224] 5) Update the movement speed V of each particle according to the adjustment strategy i t+1 ;
[0225] 6) Update the position X of each particle according to the execution strategy i t+1 , let t = t + 1;
[0226] 7) Assign the new population individuals to the connection network and calculate the fitness of each particle again;
[0227] 8) If t≠100, continue with the next generation operation and go to step 3);
[0228] 9) If t = 100, output the optimization result g best , g best The initial weights and critical values of the connection network model are trained until the error accuracy requirements are met, and the trained connection network is saved.
[0229] 3. Transformer Fault Diagnosis Based on GA-Connected Network
[0230] (I) GA-connected network fault diagnosis model
[0231] Although the particle swarm algorithm has a certain global search capability, in the later stage of the search, the particles gather and the position changes very little. If they gather around the local minimum point, they will not be able to jump out. In addition, although the particle swarm algorithm shares global information, the algorithm structure is relatively simple, lacks diversity, and the search range is relatively narrow, so the possibility of falling into the local minimum is still relatively large. Compared with the particle swarm algorithm, the genetic algorithm rules are more complex, and operations such as crossover and mutation greatly improve the diversity of the algorithm. In the later stage of the search, it is still able to jump out of the local minimum. Therefore, the genetic algorithm and the connection model are combined to form a GA-connection fusion network, and the GA-connection network is used for distribution transformer fault diagnosis.
[0232] Genetic algorithm method to optimize the initial weights and critical values of the connection network:
[0233] 1) Map the initial weights and critical values of the connection network to chromosomes through encoding. Each chromosome is equivalent to a possible solution, and an initial population consisting of multiple chromosomes is randomly generated;
[0234] 2) According to the genetic principle, simulate the genetic evolution process of natural organisms, gradually retain excellent individuals, and after multiple iterations of evolution, select the weight critical value combination with the highest fitness. This group of values makes the error of the connection model tend to the global minimum;
[0235] 3) Use the above weight critical values as the initial weights and critical values of the connection network for training and simulation.
[0236] (II) Construction of GA-connectivity network
[0237] 1-Choice of encoding method
[0238] Each chromosome of the genetic algorithm of the present application consists of four parts: the weight between the input layer and the hidden layer, the critical value of the hidden layer, the weight between the hidden layer and the output layer, and the critical value of the output layer;
[0239] Assume that each chromosome in the population contains D genes, and the calculation formula is: D = N·M+M+M·Q+Q, where N, M, and Q are the number of neurons in the input layer, hidden layer, and output layer respectively;
[0240] The three-layer connection network has N=5, M=12, Q=1, D=85, and the total number of weights is 5×12+12×1=72; the total number of critical values is 12+1=13. The real number coding converts the one-dimensional vector composed of the weight critical values into a chromosome. The length of each chromosome is the total number of genes and the sum of the number of critical values of the connection network weights. The chromosome length is 85. The genetic algorithm needs to optimize a total of 85 parameters.
[0241] 2-Generation of initial population
[0242] The gene value range is [-3,3]. The longer the chromosome, the larger the population size required. The larger the population size, the more iterations are needed to fully search, and the optimization time is correspondingly extended. When N=50, the optimization effect is good, the connection network recognition rate is high, and the optimization time is moderate.
[0243] 3-Select the design of the operation
[0244] The selection probability distribution adopts the fitness ratio distribution. The probability P of each individual being selected is the ratio of the individual's own fitness to the sum of the fitness of all individuals in the population. i , whose fitness is f i , the population size is P, and the probability P of this individual being selected is:
[0245]
[0246] Calculate the cumulative probability Q by selecting the probability P i :
[0247]
[0248] Each selection starts with a random constant X in the range [0,1], and uses X as a selection pointer to find the selected individual. The selection process imitates the roulette wheel: if X < Q, select individual 1; if Q i-1 ≤X<Q i , then select individual i;
[0249] When selecting, individuals are selected in a random and equidistant manner. The population dimension is N, then the cumulative probability of each individual being selected is Q i is 1 / N, and then the selection is made in the same way as roulette, except that individuals with different fitness have equal chances of being selected.
[0250] 4- Design of crossover operation
[0251] The parent individual X of the tth generation a t and X b t Perform arithmetic crossover between them, and the two new individuals after crossover are:
[0252]
[0253]
[0254] Among them, α∈(0,1) is a randomly generated number during the crossover operation. In each generation of crossover operation, N rounds of crossover operations are performed, N is the population dimension, and the two parent chromosomes for crossover are randomly selected from the population. Whether to crossover is determined by the crossover probability P c Determine, in this application the crossover probability P c =0.7, the specific operation is as follows:
[0255] 1) Randomly select two chromosomes X in the tth generation population a t and X b t As a crossover parent;
[0256] 2) Randomly generate a number (0,1) rand. If it is less than the crossover probability, rand<P c , then the subsequent crossover operation is performed, otherwise no crossover operation occurs in this round;
[0257] 3) If a crossover operation occurs, a random number α (0,1) is used to perform arithmetic crossover according to the above formula;
[0258] 4) Each round performs at most one crossover. After the crossover operation is completed, it automatically enters the next round. A total of N rounds of crossover are performed in each generation.
[0259] 5- Design of mutation operation
[0260] Individual X of generation t k t Gene x m t If a mutation occurs, the new individual after the mutation is:
[0261] x m ′=x min +r·(x max -x min ) Formula 12
[0262] Among them, r∈(0,1) is the random number generated by the mutation operation, x max is the maximum value of the gene, x min is the minimum value of the gene, x max =3,x min =-3. In each generation of mutation operation, all chromosomes participate in the mutation operation one by one. From the first gene to the last gene in the chromosome, each gene is judged whether it has mutated. The occurrence of mutation is determined by the mutation probability P. m Determine, the mutation probability P in this application m =0.045, the specific operation is as follows:
[0263] 1) Select chromosomes one by one in the t-th generation population. Suppose the m-th chromosome X is selected. mt ;
[0264] 2) Starting from the first gene, determine whether a mutation has occurred one by one, and randomly select a number (0,1) rand. If it is less than the mutation probability, rand < P m , then it is determined that the gene at that position has mutated, otherwise it jumps to the next gene;
[0265] 3) After determining that a mutation has occurred, a random number r (0,1) is used to perform uniform mutation according to the above formula;
[0266] 4) Each chromosome can undergo one or more gene mutations. m t After all genes on the chromosome are judged, the chromosome X m+1 t The mutation operation is repeated until all chromosomes have completed the mutation operation.
[0267] 6- Design of elimination operation
[0268] The elimination operation starts from the second generation and occurs after the fitness calculation. After the fitness calculation of all individuals in the tth generation population is completed, the individuals with the largest and smallest fitness are recorded, which are X and max t and X mint , the fitness is f max t and f min t , the best fitness recorded in the previous generation is f best t-1 , individual is X best t-1 , the specific method is as follows:
[0269] 1) If f min t <f best t-1 , eliminate the individual Xmin with the smallest fitness in the tth generation t , using the best individual X of the previous generation best t-1 Instead; otherwise, Xmin t remain unchanged;
[0270] 2) After elimination, if f best t-1 <f max t , then the best fitness and the best individual recorded are the best fitness of this generation f max t and the optimal individual X max t Make a replacement, otherwise, the global optimal individual remains unchanged;
[0271] The last-place individuals are eliminated to retain the global optimal individuals, ensuring the superiority of the population and ensuring global convergence.
[0272] 7- Setting of stopping criteria
[0273] Use the maximum number of iterations method and iterate to the maximum number of iterations T max When , stop iterating and output the optimization results. After several experiments, determine T max =100, at this time the genetic algorithm fully searches the entire search space and converges.
[0274] (III) GA-Connect Network Implementation Process
[0275] According to the process Figure 4 , the specific steps of GA-connecting the network are as follows:
[0276] 1) Population P initialization, including population size N, crossover rate P c , mutation rate P m , chromosomes are coded with real numbers;
[0277] 2) After encoding, the chromosome gene is used as the initial weight and critical value of the connection network, and then the training sample is input to start training and simulation, and the results are output; the fitness f of individual i is calculated according to the fitness function i t , use this method to calculate the fitness of each individual; record the individual with the highest fitness X best t and the best fitness f best t ;
[0278] 3) Calculate the selection probability P of each individual according to the fitness ratio distribution formula i , and then perform the selection operation by the roulette method;
[0279] 4) For a random individual X in generation t a t and X b t Perform arithmetic crossover to generate new offspring individuals X' and X. Individuals that are not selected for crossover operation are directly copied, and a total of N rounds of crossover operation are performed;
[0280] (5) Perform mutation operations on individuals of generation t one by one, judge the genes of the selected individuals one by one, perform uniform mutation operations on the mutated genes, and directly copy the genes that have not mutated;
[0281] (6) After the mutation operation is completed, let t = t + 1, assign the new population individuals to the connection network respectively, and calculate the fitness of each individual again;
[0282] (7) Find the individual X with the minimum fitness min t , and the best individual X of the previous generation best t-1 For comparison, if the fitness f min t <f best t-1 , eliminate the individual X with the smallest fitness min t , replaced by the best individual X of the previous generation best t-1 , the elimination operation is performed 99 times in total; then the individual X with the highest global fitness is updated best t and the best fitness f best t ;
[0283] (8) If t≠100, continue genetic operation and go to step 3);
[0284] (9) If t = 100, stop the genetic operation and output the optimization result Xbest , X best The initial weights and critical values of the connection network are used for training until the error accuracy requirements are met, and the trained connection network is saved.
[0285] 4. Fusion Optimization GP-Connection Network
[0286] 1. Population size of optimization algorithm
[0287] 1) The computation time of PSO-connected networks is less than that of GA-connected networks, and the convergence speed is faster;
[0288] 2) When the population size is small to a certain extent, the performance of the GA-connected network drops sharply;
[0289] 3) As the population size increases, the accuracy of the GA-connected network steadily increases and the error gradually decreases. When the population size is large enough and the number of iterations is large enough, the global optimum can be found;
[0290] 4) For PSO-connected networks, increasing the population size does not significantly improve network performance;
[0291] Genetic algorithms simulate the genetic evolution process of organisms in nature, introduce genetic operations such as selection, crossover, mutation, and elimination, and adopt the strategy of retaining excellent chromosomes. Individuals with high fitness can be retained in the calculation with a relatively high probability. The particle swarm algorithm simulates the group behavior of bird flocks in nature, adopts two search strategies: adaptive speed adjustment and neighborhood approximation, and each particle movement directly refers to the position of the best particle in history. In comparison, the search method of the particle swarm algorithm is more direct, and the parameters of its best individual will directly affect other individuals in the population, which has a strong directionality; while the genetic algorithm finds the best individual by retaining excellent individuals through the survival of the fittest. It is an indirect optimization method of step-by-step screening, and the optimization process is relatively slow. This is why the particle swarm algorithm converges faster than the genetic algorithm.
[0292] The fault diagnosis of distribution transformers should be based on accuracy as the final criterion. To a certain extent, the accuracy of the connection network can be improved by increasing the population size. However, as the monitoring equipment collects new characteristic gas data, it is necessary to regularly update the neural network training samples and retrain the BP neural network to make the diagnosis of the BP network timely. If the population size is too large, a lot of time will be wasted. After meeting the accuracy requirements, the population size should be reduced as much as possible to shorten the optimization time.
[0293] (II) Constructing a Fusion Optimization GP-Connection Network Algorithm
[0294] A fusion algorithm that integrates the optimization of genetic algorithm and particle swarm algorithm is constructed. On the one hand, the fusion algorithm has a very high recognition accuracy, and on the other hand, the optimization time is minimized. The fusion algorithm is used to optimize the connection network and obtain a connection network with excellent performance in all aspects. The fusion is based on the population characteristics and operation steps of the genetic algorithm and particle swarm algorithm.
[0295] Both genetic algorithm and particle swarm algorithm are based on population operation. Both use a single population, which is composed of several individuals. Each individual corresponds to a possible solution or potential solution. The individual is a feature set. The individuals of the genetic algorithm are chromosomes and the features are genes; the individuals of the particle swarm algorithm are particles and the features are particle coordinates.
[0296] Genetic algorithm and particle swarm algorithm are both evolutionary algorithms, and both generally include five steps of evolution:
[0297] 1) Initialize the population. The initial population of both algorithms is randomly generated.
[0298] 2) Calculate fitness. Both algorithms determine the search direction by fitness, and the fitness function is derived from the objective function;
[0299] 3) Stopping criterion, both algorithms use the stopping criterion of the maximum number of iterations;
[0300] 4) Population selection: Genetic algorithm uses roulette wheel selection method, while particle swarm selects the entire population;
[0301] 5) Evolutionary operations: The operations of genetic algorithms include crossover, mutation, and elimination, and the operations of particle swarms are speed and coordinate updates, recording and updating individual extreme points and global extreme points.
[0302] The two optimization algorithms have many similarities. Although one is genetic evolution and the other is bird flock predation, the operation steps of the two optimization algorithms are similar, the individuals of the population can be transformed into each other, the fitness function and the stopping criteria are the same, and the genetic algorithm in this application uses real number coding, which is completely consistent with the particle swarm algorithm. Therefore, this application adds selection, crossover, mutation, and elimination operations similar to the genetic algorithm on the basis of the original operation of the particle swarm, enhances the diversity of the population, integrates the four operations of the real number coding genetic algorithm into the particle swarm algorithm, constructs a fusion algorithm that integrates the characteristics of the two optimization algorithms, and uses the fusion algorithm to optimize the connection network.
[0303] The genetic algorithm and particle swarm algorithm are fused with equal status, and the fused algorithm GA-PSO is combined with the connection network to form the GP-connection network.
[0304] (III) Implementation process of GP-connected network
[0305] The implementation flow chart of GP-connection network is as follows Figure 5 As shown: The steps of fusion algorithm to optimize the connection network are as follows:
[0306] 1) Initialize the particle swarm P, including the population size N, dimension D, and crossover rate P c , mutation rate P m , learning factor c 1 and c 2 , using real number coding, randomly output the position X of each particle i and speed V i , at this time t=1;
[0307] 2) Set the particle position X i Set as the initial weight and critical value of the connection network, then input the training sample to start training and simulation, and output the results; calculate the fitness f of particle i according to the fitness function i t , the fitness of each particle is calculated in this way;
[0308] 3) Update the historical best fitness and individual extreme point of each particle, using f i t and f best (i) Compare, if f i t >f best (i), then use f i t Replace f best (i) Use X i t Replace p best (i);
[0309] 4) Update the global historical best fitness and global extreme point, using f i t and f best (i) Compare, if f i t >f best , then use f i t Replace f best , use X i t Replace g best ;
[0310] 5) Assign the position parameters of the particles to the chromosomes, which are also encoded using real numbers;
[0311] 6) Calculate the selection probability P of each individual according to the fitness ratio distribution formula i , and then perform the selection operation by the roulette method;
[0312] 7) For the randomly selected individual X of generation ta t and X b t Perform arithmetic crossover to produce new offspring individuals X a t+1 and X b t+1 , the individuals that are not selected are directly copied, and a total of N rounds of crossover operations are performed;
[0313] 8) Perform mutation operations on individuals of generation t one by one, judge the genes of the selected individuals one by one, perform uniform mutation operations on the mutated genes, and directly copy the genes that have not mutated;
[0314] 9) Assigning the genetic parameters of the chromosome to the particles to obtain a new particle population;
[0315] 10) Update the movement speed V of each particle according to the adjustment strategy i t+1 ;
[0316] 11) Update the position X of each particle according to the execution strategy i t+1 , let t = t + 1;
[0317] 12) After the particle position is updated, the new population individuals are assigned to the connection network and the fitness of each particle is calculated again;
[0318] 13) Find the individual X with the minimum fitness min t , and the best individual X of the previous generation best t-1 For comparison, if the fitness f min t <f best t-1 , eliminate the individual X with the smallest fitness min t , replaced by the best individual X of the previous generation best t-1 , the elimination operation is performed 99 times in total; then the individual X with the highest global fitness is updated best t and the best fitness f best t ;
[0319] 14) If t≠100, continue with the next generation operation and go to step 3);
[0320] 15) If t = 100, output the optimization result g best , g bestThe connection model is trained as the initial weights and critical values until the error accuracy requirements are met, and the trained connection network is saved.
[0321] (IV) Experiment and results analysis
[0322] After multiple simulation tests, the best diagnostic effects of the four connection networks mentioned in this application are shown as follows:
[0323] Depend on Figure 6 It can be seen that the recognition effects of the four connection networks are ranked in the following order: GP-connection network, GA-connection network, PSO-connection network, and connection network; the optimization time of the three fusion networks is ranked in the following order: GA-connection network, GP-connection network, and PSO-connection network. Among the above three connection fusion networks, although the GP-connection network is the most complex, its optimization time is not the longest. This is because in the calculation process of MATLAB, the fitness calculation process takes the longest time. The fitness calculation of each individual requires a connection network training and test, so the optimization time is determined by the fitness calculation time of all individuals in the population. The fitness calculation speed of all individuals in the population can be reflected by the average fitness. The larger the average fitness, the better the convergence of the connection network corresponding to the individual, and the shorter the calculation time.
[0324] The PSO-connected network can quickly gather near the optimal solution. After the 18th generation, the average fitness of the population is maintained at about 41.5. The connection network corresponding to each individual converges quickly, so it takes less time. The average fitness of the GA-connected network is not high in the early stage of the search. It was not until the 59th generation that the average fitness reached 40, so the connection network corresponding to each individual converged slowly in the early stage and took more time. The population fitness of the GP-connected network is maintained at about 47.5 after the 37th generation, but the average fitness before the 37th generation is low, so the optimization time of the GP-connected network is between the GA-connected network and the PSO-connected network.
[0325] This application connects the genetic algorithm and the particle swarm algorithm in series, which can effectively complement each other. On the one hand, it uses the good global search ability of the genetic algorithm to expand the search range and jump out of the local extreme value; on the other hand, it uses the fast convergence characteristics of the particle swarm algorithm to quickly approach the optimal solution. Through the simulation experiments and comparisons in this chapter, it is proved that the GP-connection network can guarantee a very high recognition accuracy rate. At the same time, the requirements for the population size are small, the optimization time is short, and it is easy to update the connection network in time. Therefore, this application finally selects the GP-connection network as the distribution transformer fault diagnosis algorithm.
Claims
1. An adaptive algorithm for fault diagnosis of hydroelectric power distribution transformers, characterized in that: Establish a distribution transformer fault diagnosis method based on artificial connection model and characteristic gas method, construct a 5-12-1 connection network model, and build a time-varying learning rate connection network model with fast convergence speed; optimize the initial weight critical value of the connection network based on the particle swarm algorithm, propose a PSO-connection network model, and find a gradient descent time-varying inertia factor; optimize the initial weight critical value of the connection network based on the genetic algorithm, propose a GA-connection network model, introduce the elimination operator, and retain the global optimal solution. When the population size is small to a certain extent, the performance of the GA-connection network drops sharply. As the population size increases, the accuracy of the GA-connection network gradually increases. When the population is large enough, the global optimal solution is found; the genetic algorithm and the particle swarm algorithm are integrated in series, the GP-connection network model is proposed, and a distribution transformer fault diagnosis client based on the GP-connection network model is developed; 1) Transformer fault diagnosis based on connection model: Establish a relationship model between dissolved gas in oil and fault type, analyze the establishment process of the connection model, and gradually determine the number of hidden layer neurons, activation function, training function and learning rate of the connection network; 2) Transformer fault diagnosis based on PSO-connection network: Calculate the critical value of the weight of the connection network optimized by the particle swarm algorithm, establish the process of optimizing the connection network by the particle swarm algorithm, and analyze the setting of the inertia factor; 3) Transformer fault diagnosis based on GA-connection network: Calculate the critical value of the weight of the connection network optimized by genetic algorithm, establish the process of optimizing the connection network by genetic algorithm, and construct an elimination operation method; 4) Fusion optimization of GP-connected network: Based on the changing trends of the performance of GA-connected network and PSO-connected network under different population sizes, the population size of the optimization algorithm is optimized, a method architecture that integrates genetic algorithm and particle swarm algorithm is established, a fusion optimization GP-connected network algorithm is constructed, the implementation steps and processes of the GP-connected network are established, and a Java client with transformer diagnosis function is developed to realize simple calculation, batch calculation and retraining.
2. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: Relationship model between dissolved gas in oil and fault type: 1) The characteristic gas components of overheating failure are CH4 and C2H4. As the temperature rises, the concentration and gas production rate of CH4 and C2H4 increase sharply. Only when a certain temperature is reached will a small amount of C2H6, H2 and C2H2 be produced; 2) The characteristic gas components of discharge fault are H2 and C2H2. When the discharge energy is large, CH4, C2H6 and C2H4 are also produced; 3) When solid insulation is overheated or has a discharge fault, a large amount of CO and CO2 is generated.
3. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: Establish a connection diagnosis model: Combine the dissolved gas in oil method with the artificial connection model to determine the transformer fault type: 1-Select sample data: When selecting sample data, select representative data after certain screening; 2-Select input vector: When using the connection model, only CH4, C2H4, C2H6, C2H2, H25 gases are used to meet the training requirements and obtain better judgment results. The number of input layer nodes of the connection model is 5; 3- Selection of output vector: The output vector of the connection model is the identification target, i.e., the transformer fault type. A single-node output layer is used to represent the fault type with different codes; Overheating faults are divided into low-temperature overheating, medium-temperature overheating and high-temperature overheating according to the fault temperature. Low-temperature overheating is below 300℃, high-temperature overheating is above 700℃, and medium-temperature overheating is between 300 and 700℃. Discharge faults are subdivided into partial discharge, low-energy discharge and high-energy discharge according to the discharge energy. Low-energy discharge refers to relatively weak spark discharge, and high-energy discharge refers to arc discharge and relatively strong spark discharge. There are also trace characteristic gases in the normal operation of the transformer. With the increase of discharge energy, the content of CH2 increases accordingly; and with the increase of overheating temperature, the content of CH4 and C2H4 gradually increases. It is determined that there is a simple increasing relationship between the fault type and the output vector code, and the output code is set to 0 to 6; the relationship between the fault type and the output vector is: normal-0, low-temperature overheating-1, medium-temperature overheating-2, high-temperature overheating-3, partial discharge-4, low-energy discharge-5, high-energy discharge-6; 4- Normalization: Comparing the contents of the five characteristic gases, the content of H2 is larger, while the content of C2H2 is smaller. The gas content is normalized and the gas content is input in the form of percentage. The normalization formula is as follows: Where i=1,2,3,4,5,j represents the jth sample input, v ij is the concentration of the jth sample of gas i, X ij is the normalized content percentage of the jth sample of gas i. After normalization, the gas concentration is converted into a dimensionless percentage, and the influence weights of the five gases are consistent; 5-Select the evaluation criteria: focus on the accuracy and error of the judgment. The error is calculated as: In the formula, y k is the simulation result, y k * is the expected result, E is the error; To calculate the accuracy, first round the simulation result to an integer result, then compare it with the expected result. The output vector is a code from 0 to 6, and the expected result is also an integer from 0 to 6. Use the for loop statement in MATLAB to complete the comparison of 100 sets of simulation results and expected results, compare whether the simulation results and expected results are the same and count them, and finally divide the number of the same results by the total number to get the accuracy.
4. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: Fault diagnosis model of PSO-connected network: PSO-connected fusion network is formed by combining particle swarm optimization and connection model, and the PSO-connected network is used to diagnose the fault of distribution transformers; The particle swarm algorithm is used to optimize the weights and critical values of the connection network: 1) Map the initial weights and appearance of the connection network to particles, regard each particle as a possible solution, and randomly generate an initial population consisting of multiple particles; 2) The particle swarm follows the predation law of birds and searches for the optimal solution by simulating the predation process of birds. After multiple iterative searches, the combination of weight critical values with the highest fitness is obtained. This group of values makes the error of the connection model tend to the global minimum; 3) Use the above weight critical values as the initial weights and critical values of the connection network for training and simulation.
5. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: Construction of PSO-connected network: 1- Design of connection model A three-layer connection network is used, the number of hidden layer nodes is 12, the activation function of the input layer-hidden layer is the tansig function, the activation function of the hidden layer-output layer is the purelin function, the training function is trainlm, and the learning rate is the adaptive learning rate 50e- 0.1T ; 2- Generate the initial population The particle swarm P is composed of N particles and moves in the D-dimensional search space. The connection model has 72 weights and 13 critical values. D is 72+13=85. The search effect is best when the number of particles is 30. N=30, and the i-th particle is represented by an 85-dimensional vector: X i =(x i1 , x i2 ...x i85 ),i=1,2...,30 Equation 3 The particle value range is set to [-3,3], and the particle movement speed V i It is expressed as: V i =(v i1 , v i2 ... v i85 ), i = 1, 2..., 30 Equation 4 The particle movement speed range is set to [-0.6, 0.6]. The learning factors c1 and c2 are used to control the particle to move to its own best historical position and the global best historical position, respectively. c1 and c2 take fixed values, c1 = c2 = 2. 3- Design of fitness function The error E of the fitness function is: The smaller the error, the better, and the greater the fitness, the better. The fitness function is rewritten as: After calculation, the fitness of the i-th particle X is f i During the search process, each particle needs to learn from its own historical best position, and needs to record the historical best fitness of the particle and the individual extreme point. The historical best fitness of the i-th particle is recorded as f best (i), the individual extreme point is denoted as p best (i) At the same time, each particle still needs to learn from the global best historical position, record the global best historical fitness and the global extreme point, and the global best historical fitness is recorded as f best , the global extreme point is denoted as g best After calculating the fitness of each generation population, the global historical best fitness and global extreme point are updated, and the historical best fitness and individual extreme point of each particle are updated; 4- Adjustment strategy design After the global extreme value and individual extreme value are updated, all particles must adjust their speed in order to search for the best position. All particles will gather to the historical best position of themselves and the entire population, and learn from the historical best. The expression of the adjustment strategy is: Where t is the number of iterations, V i t Indicates the movement speed of this generation, V i t+1 represents the adjusted speed, w represents the inertia factor, and wV i t represents the inertia of the particle's motion, c1 is the learning factor for the particle to learn from its historical best position, α1 is a random number between (0,1), c1·α1·(p best -X i t ) represents the adjustment of the particle to its own historical best position, c2 is the learning factor of the particle to learn the global historical best position, α2 is also a random number between (0,1), c2·α2·(g best -X i t ) represents the adjustment of the particle to the global best historical position; 5- Design of inertia factor A time-varying inertia factor is used. The inertia factor decreases monotonically with the increase of the number of iterations. In the early stage of the search, the inertia factor is large, and the global search ability is strong, which helps to find the vicinity of the optimal solution. As the number of iterations increases, the inertia factor gradually decreases, the global search ability weakens, but the local development ability is enhanced, and the convergence speed is accelerated. The calculation formula of the inertia factor w is: In the formula, w max represents the maximum inertia factor, that is, the initial inertia factor, and takes w max =0.9; w min represents the minimum inertia factor, that is, the termination inertia factor, and takes w min =0.4; t is the number of iterations, T max Indicates the maximum number of iterations.
6. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: The implementation process of PSO-connected network: 1) Initialize the particle swarm P, determine the population size N, dimension D, learning factors c1 and c2, and randomly select the position X of each particle i and speed V i , at this time t = 1; 2) Set the particle position X, as the initial weight and critical value of the connection network, then input the training sample to start training and simulation, and output the simulation results; Calculate the fitness f of particle i according to the fitness function i t , the fitness of each particle is calculated in this way; 3) Update the historical best fitness and individual extreme point of each particle, using f i t and f best (i) Compare, if f i t >f best (i), then use f i t Replace f best (i) Use X i t Replace p best (i); 4) Update the global historical best fitness and global extreme point, using f i t and f best Compare, if f i t >f best , then use f i t Replace f best , use X i t Replace g best ; 5) Update the movement speed V of each particle according to the adjustment strategy i t+1 ; 6) Update the position X of each particle according to the execution strategy i t+1 , let t = t + 1; 7) Assign the new population individuals to the connection network and calculate the fitness of each particle again; 8) If t≠100, continue with the next generation operation and go to step 3); 9) If t = 100, output the optimization result g best , g best The initial weights and critical values of the connection network model are trained until the error accuracy requirements are met, and the trained connection network is saved.
7. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: GA-connected network construction: 1-Choice of encoding method Each chromosome of the genetic algorithm of the present application consists of four parts: the weight between the input layer and the hidden layer, the critical value of the hidden layer, the weight between the hidden layer and the output layer, and the critical value of the output layer; Assume that each chromosome in the population contains D genes, and the calculation formula is: D = N·M+M+M·Q+Q, where N, M, and Q are the number of neurons in the input layer, hidden layer, and output layer respectively; The three-layer connection network has N=5, M=12, Q=1, D=85, and the total number of weights is 5×12+12×1=72; the total number of critical values is 12+1=13. The real number coding converts the one-dimensional vector composed of the weight critical values into a chromosome. The length of each chromosome is the total number of genes and the sum of the number of critical values of the connection network weights. The chromosome length is 85, and the genetic algorithm needs to optimize a total of 85 parameters. 2-Generation of initial population The gene value range is [-3,3]. The longer the chromosome, the larger the population size required. The larger the population size, the more iterations are needed to fully search, and the optimization time is correspondingly extended. When N=50, the optimization effect is good, the connection network recognition rate is high, and the optimization time is moderate; 3-Select the design of the operation The selection probability distribution adopts the fitness ratio distribution. The probability P of each individual being selected is the ratio of the individual's own fitness to the sum of the fitness of all individuals in the population. i , whose fitness is f i , the population size is P, and the probability P of this individual being selected is: Calculate the cumulative probability Q by selecting the probability P i : Each selection starts with a random constant X in the range [0,1], and uses X as a selection pointer to find the selected individual. The selection process imitates the roulette wheel: if X < Q, select individual 1; if Q i-1 ≤X<Q i , then select individual i; When selecting, individuals are selected in a random and equidistant manner. The population dimension is N, then the cumulative probability of each individual being selected is Q i is 1 / N, and then the selection is carried out in the same way as the roulette wheel, except that individuals with different fitness have an equal chance of being selected; 4- Design of crossover operation The parent individual X of the tth generation a t and X b t Perform arithmetic crossover between them, and the two new individuals after crossover are: Among them, α∈(0,1) is a randomly generated number during the crossover operation. In each generation of crossover operation, N rounds of crossover operations are performed, N is the population dimension, and the two parent chromosomes for crossover are randomly selected from the population. Whether to crossover is determined by the crossover probability P c Determine, in this application, the crossover probability P c =0.7, the specific operation is as follows: 1) Randomly select two chromosomes X in the tth generation population a t and X b t As a crossover parent; 2) Randomly generate a number (0,1) rand. If it is less than the crossover probability, rand<P c , then the subsequent crossover operation is performed, otherwise no crossover operation occurs in this round; 3) If a crossover operation occurs, a random number α (0,1) is used to perform arithmetic crossover according to the above formula; 4) Each round can only carry out one crossover at most. After the crossover operation is completed, it will automatically enter the next round. Each generation will carry out N rounds of crossover in total. 5- Design of mutation operation Individual X of generation t k t Gene x m t If a mutation occurs, the new individual after the mutation is: x m t =x min +r·(x max -x min ) Formula 12 Among them, r∈(0,1) is the random number generated by the mutation operation, x max is the maximum value of the gene, x min is the minimum value of the gene, x max =3,x min =-3. In each generation of mutation operation, all chromosomes participate in the mutation operation one by one. From the first gene to the last gene in the chromosome, each gene is judged whether it has mutated. The occurrence of mutation is determined by the mutation probability P. m Determine, the mutation probability P in this application m =0.045, the specific operation is as follows: 1) Select chromosomes one by one in the t-th generation population. Suppose the m-th chromosome X is selected. mt ; 2) Starting from the first gene, determine whether a mutation has occurred one by one, and randomly select a number (0,1) rand. If it is less than the mutation probability, rand < P m , then it is determined that the gene at that position has mutated, otherwise it jumps to the next gene; 3) After determining that a mutation has occurred, a random number r (0,1) is used to perform uniform mutation according to the above formula; 4) Each chromosome can undergo one or more gene mutations. m t After all genes on the chromosome are judged, the chromosome X m+1 t The mutation operation is repeated until all chromosomes have completed the mutation operation; 6- Design of elimination operation The elimination operation starts from the second generation and occurs after the fitness calculation. After the fitness calculation of all individuals in the tth generation population is completed, the individuals with the largest and smallest fitness are recorded, which are X and max t and X min t , the fitness is f max t and f min t , the best fitness recorded in the previous generation is f best t-1 , individual is X best t-1 , the specific method is as follows: 1) If f min t <f best t-1 , eliminate the individual Xmin with the smallest fitness in the tth generation t , using the best individual X of the previous generation best t-1 Instead; otherwise, Xmin t remain unchanged; 2) After elimination, if f best t-1 <f max t , then the best fitness and the best individual recorded are the best fitness of this generation f max t and the optimal individual X max t Make a replacement, otherwise, the global optimal individual remains unchanged; Eliminate the last one, retain the best individual in the world, ensure the superiority of the population, and ensure global convergence; 7- Setting of stopping criteria Use the maximum number of iterations method and iterate to the maximum number of iterations T max When , stop iterating and output the optimization results. After several experiments, determine T max =100, at which point the genetic algorithm fully searches the entire search space and converges.
8. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: GA-Connect Network Implementation Process: 1) Population P initialization, including population size N, crossover rate P c , mutation rate P m , chromosomes are coded with real numbers; 2) After encoding, the chromosome genes are used as the initial weights and critical values of the connection network, and then the training samples are input to start training and simulation, and the results are output; Calculate the fitness f of individual i according to the fitness function i t , use this method to calculate the fitness of each individual; record the individual with the highest fitness X best t and the best fitness f best t ; 3) Calculate the selection probability P of each individual according to the fitness ratio distribution formula i , and then perform the selection operation by the roulette method; 4) For a random individual X in generation t a t and X b t Perform arithmetic crossover to generate new offspring individuals X' and X. Individuals that are not selected for crossover operation are directly copied, and a total of N rounds of crossover operation are performed; (5) Perform mutation operations on individuals of generation t one by one, judge the genes of the selected individuals one by one, perform uniform mutation operations on the mutated genes, and directly copy the genes that have not mutated; (6) After the mutation operation is completed, let t = t + 1, assign the new population individuals to the connection network respectively, and calculate the fitness of each individual again; (7) Find the individual X with the minimum fitness min t , and the best individual X of the previous generation best t-1 For comparison, if the fitness f min t <f best t-1 , eliminate the individual X with the smallest fitness min t , replaced by the best individual X of the previous generation best t-1 , the elimination operation is performed 99 times in total; then the individual X with the highest global fitness is updated best t and the best fitness f best t ; (8) If t≠100, continue genetic operation and go to step 3); (9) If t = 100, stop the genetic operation and output the optimization result X best , X best The initial weights and critical values of the connection network are used for training until the error accuracy requirements are met, and the trained connection network is saved.
9. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: Constructing a fusion optimization GP-connection network algorithm: Both genetic algorithm and particle swarm algorithm are based on the population as the operation basis, and both use a single population. The population is composed of several individuals, each individual corresponds to a possible solution or potential solution. The individual is a feature set. The individual of the genetic algorithm is the chromosome, and the feature is the gene; the individual of the particle swarm algorithm is the particle, and the feature is the particle coordinates; Genetic algorithm and particle swarm algorithm are both evolutionary algorithms, and both generally include five steps of evolution: 1) Initialize the population. The initial population of both algorithms is randomly generated. 2) Calculate fitness. Both algorithms determine the search direction by fitness, and the fitness function is derived from the objective function; 3) Stopping criterion, both algorithms use the stopping criterion of the maximum number of iterations; 4) Population selection: Genetic algorithm uses roulette wheel selection method, while particle swarm selects the entire population; 5) Evolutionary operation: The operations of genetic algorithm include crossover, mutation and elimination, while the operation of particle swarm is the update of speed and coordinates, recording and updating individual extreme points and global extreme points; This application adds selection, crossover, mutation, and elimination operations similar to genetic algorithms on the basis of the original operations of particle swarm optimization to enhance population diversity, integrates the four operations of real-coded genetic algorithms into particle swarm optimization, constructs a fusion algorithm that integrates the characteristics of two optimization algorithms, and uses the fusion algorithm to optimize the connection network; The genetic algorithm and particle swarm algorithm are fused with equal status, and the fused algorithm GA-PSO is combined with the connection network to form the GP-connection network.
10. The adaptive algorithm for fault diagnosis of water conservancy and power distribution transformer according to claim 1 is characterized in that: GP-connection network implementation process: 1) Initialize the particle swarm P, including the population size N, dimension D, and crossover rate P c , mutation rate P m , learning factors c1 and c2, using real number coding, and randomly outputting the position X of each particle i and speed V i , at this time t=1; 2) Set the particle position X i Set as the initial weight and critical value of the connection network, then input the training sample to start training and simulation, and output the results; calculate the fitness f of particle i according to the fitness function i t , the fitness of each particle is calculated in this way; 3) Update the historical best fitness and individual extreme point of each particle, using f i t and f best (i) Compare, if f i t >f best (i), then use f i t Replace f best (i) Use X i t Replace p best (i); 4) Update the global historical best fitness and global extreme point, using f i t and f best (i) Compare, if f i t >f best , then use f i t Replace f best , use X i t Replace g best ; 5) Assign the position parameters of the particles to the chromosomes, which are also encoded using real numbers; 6) Calculate the selection probability P of each individual according to the fitness ratio distribution formula i , and then perform the selection operation by the roulette method; 7) For the randomly selected individual X of generation t a t and X b t Perform arithmetic crossover to produce new individuals X a t+1 and X b t+1 , the individuals that are not selected are directly copied, and a total of N rounds of crossover operations are performed; 8) Perform mutation operations on individuals of generation t one by one, judge the genes of the selected individuals one by one, perform uniform mutation operations on the mutated genes, and directly copy the genes that have not mutated; 9) Assigning the genetic parameters of the chromosome to the particles to obtain a new particle population; 10) Update the movement speed V of each particle according to the adjustment strategy i t+1 ; 11) Update the position X of each particle according to the execution strategy i t+1 , let t = t + 1; 12) After the particle position is updated, the new population individuals are assigned to the connection network and the fitness of each particle is calculated again; 13) Find the individual X with the minimum fitness min t , and the best individual X of the previous generation best t-1 For comparison, if the fitness f min t <f best t-1 , eliminate the individual X with the smallest fitness min t , replaced by the best individual X of the previous generation best t-1 , the elimination operation is performed 99 times in total; then the individual X with the highest global fitness is updated best t and the best fitness f best t ; 14) If t≠100, continue with the next generation operation and go to step 3); 15) If t = 100, output the optimization result g best , g best The connection model is trained as the initial weights and critical values until the error accuracy requirements are met, and the trained connection network is saved.