Diagnosis method and device of circuit breaker, electronic equipment and storage medium
By collecting the angular displacement signal of the circuit breaker and combining wavelet transformation and random forest algorithm, the particle swarm algorithm is optimized and the fault diagnosis model is built, which solves the problem of low accuracy of circuit breaker diagnosis and improves the accuracy and reliability of circuit breaker fault diagnosis , ensuring the safe operation of the power system.
Patent Information
- Application Number
- CN202411580677.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2024-12-20
AI Technical Summary
The existing circuit breaker diagnostic methods have low accuracy and are prone to false alarms or rejection, which affects the safety and stability of the power system.
The electromagnetic sensor collects the angular displacement power signal of the circuit breaker, performs wavelet transformation filtering and feature extraction, generates angular displacement training samples and test samples, uses the random forest algorithm to weight processing and optimize the particle swarm algorithm to build the final fault diagnosis model and output the circuit breaker fault diagnosis results of the device.
It improves the accuracy and reliability of circuit breaker diagnosis, reduces the complexity of signal acquisition and data processing, enhances classification accuracy, and ensures the safe operation of the power system.
Smart Images

Figure CN119165345A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of diagnosis of electrical equipment, and in particular to a diagnosis method, device, electronic equipment and storage medium for a circuit breaker. Background Art
[0002] As a switching device, the circuit breaker plays a dual role of control and protection. When a short circuit or other abnormality occurs in the circuit, it can immediately disconnect the faulty circuit to protect the safety of the power system. If the circuit breaker fails to operate, it will cause abnormal power supply in the power system, and even cause power fires, burn power equipment, and cause major failures. Therefore, as a key device in the control of the power system, the reliability of the circuit breaker's operation directly affects the safety and stability of the power system.
[0003] At present, the fault diagnosis of circuit breakers is usually based on the analysis of the vibration signals of circuit breakers. With the development of intelligent technology, the BP artificial neural network algorithm is used for mechanical fault diagnosis of circuit breakers. However, this method often faces problems such as low accuracy, false alarms or refusal of alarms of circuit breakers. Therefore, a high-accuracy circuit breaker diagnosis method is urgently needed. Summary of the invention
[0004] In view of this, an object of the present invention is to overcome the deficiency of inaccurate circuit breaker diagnosis in the prior art and to provide a circuit breaker diagnosis method, device, electronic device and readable storage medium.
[0005] The present invention provides the following technical solutions:
[0006] In a first aspect, an embodiment of the present disclosure provides a circuit breaker diagnosis method, the method comprising:
[0007] Collecting the electrical quantity signal of the angular displacement of the circuit breaker by means of an electromagnetic sensor, and converting the electrical quantity signal into angular displacement data;
[0008] Preprocessing the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples;
[0009] Performing weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model;
[0010] Optimizing the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain a final fault diagnosis model;
[0011] The angular displacement test sample is input into the final fault diagnosis model, and the fault diagnosis result of the circuit breaker is output.
[0012] According to a specific implementation method disclosed in the present application, the step of preprocessing the angular displacement data by wavelet transform-based filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples includes:
[0013] The angular displacement data includes a travel curve, and a velocity characteristic value in the travel curve is extracted;
[0014] At least one group of the velocity feature values is obtained, and at least one group of the velocity feature values is randomly selected to obtain the angular displacement training samples and the angular displacement test samples.
[0015] According to a specific embodiment disclosed in the present application, the speed characteristic value includes the descending speed, maximum descending speed, fastest descending speed and minimum speed of the travel curve, the descending speed is the average speed between the descending critical point and a point above the point where the absolute value of the descending speed is the maximum in the travel curve, the maximum descending speed is the average speed between two points above and below the point where the absolute value of the descending speed is the maximum in the travel curve, the fastest descending speed is the average speed between the fastest descending point and the point where the absolute value of the speed just reaches the minimum in the travel curve, and the minimum speed is the average speed between the point where the absolute value of the speed just reaches the minimum and the minimum point in the travel curve.
[0016] According to a specific implementation method disclosed in the present application, the step of performing weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model includes:
[0017] Randomly setting the number of decision trees and weighted ratios of the random forest, performing sampling with replacement from the angular displacement training samples, and generating a sub-training set corresponding to the number of decision trees;
[0018] Generate a decision tree according to the sub-training set, and select m attributes from all classification attributes as decision attributes of nodes;
[0019] According to the loss function formula Calculate the loss function of the root node, and prune the decision tree when the loss function reaches the minimum value, where Gini is the Gini coefficient, T t For any subtree in the pruning process, Gini(T t ) is the Gini coefficient of the t node in the pruning process, t is any internal node of the decision tree, Gini(t) is the Gini coefficient of the t node, |T t | is the number of leaf nodes of the subtree;
[0020] Determine whether the pruning process is completed according to the number of sub-training sets contained in the root node of the decision tree, and if the pruning process is completed, return the classification result and cast a vote for the decision tree;
[0021] The weight of the decision tree is calculated based on the angular displacement training samples and the votes of the decision tree.
[0022] According to a specific implementation method disclosed in the present application, the step of generating a decision tree according to the sub-training set and selecting m attributes from all classification attributes as decision attributes of the node includes:
[0023] Putting the sub-training set into the root node, and obtaining a random variable according to the angular displacement training sample;
[0024] The sub-training set in the root node is split according to the random variable and the Gini coefficient is calculated according to the formula Calculate the Gini coefficient of the root node, where X is a random variable, is a root node sample, N1 and N2 are split leaf nodes of the root node based on the random variable condition, Gini(T1) is the Gini coefficient of the N1 node subtree, Gini(T2) is the Gini coefficient of the N2 node subtree, T1 is the N1 node subtree, and T2 is the N2 node subtree;
[0025] Determine whether the Gini coefficient is less than a preset value under the decision attribute;
[0026] If the Gini coefficient is less than the preset value, the decision attribute is determined to be the optimal split point and the splitting is stopped to become a leaf node;
[0027] If the Gini coefficient is greater than the preset value, the node is split as an intermediate node to the optimal splitting point.
[0028] According to a specific implementation method disclosed in the present application, the step of calculating the weight of the decision tree according to the angular displacement training samples and the votes of the decision tree includes:
[0029] Calculating the classification accuracy and weighted ratio of the decision tree according to the angular displacement training samples;
[0030] According to the weighted proportion calculation formula l is the weight for calculating the decision tree, where: is the number of correctly classified samples of the lth tree in the test sample, S L is the total number of test samples, Z l is the correct classification rate of the lth tree, and Z l The weight of the decision tree is determined, and the vote cast by the decision tree in the initial fault diagnosis model is the product of the current vote and the weight of the decision tree.
[0031] According to a specific implementation method disclosed in the present application, the step of optimizing the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain the final fault diagnosis model includes:
[0032] Input the particle's decision tree parameters, weighted ratio parameters, number of iterations, and iteration termination conditions, and randomly assign an initial position and velocity to each particle;
[0033] Calculating the fitness value, optimal position, global optimal fitness value, and global optimal position of the particle;
[0034] According to the particle velocity formula v i =wv i +r1c1+r2c2×(p g -x i ) and the particle position formula x i =x i +v i Update the position and velocity of the particle, where w is the inertia weight factor and v i is the particle velocity, x i is the spatial position, c1 is a non-negative constant, c2 is the acceleration factor, p g is the optimal position of particles in the group, r1 and r2 are random numbers between 0 and 1;
[0035] Determine whether the particle satisfies the termination condition according to the iteration termination condition;
[0036] If the particle meets the termination condition, the optimal decision tree parameters and the optimal weighted ratio parameters are output;
[0037] If the particle does not meet the termination condition, the process returns to the step of calculating the fitness value, the optimal position, the global optimal fitness value, and the global optimal position of the particle.
[0038] In a second aspect, an embodiment of the present disclosure provides a diagnostic device for a circuit breaker, the device comprising:
[0039] A collection module, used to collect the electrical quantity signal of the angular displacement of the circuit breaker through an electromagnetic sensor, and convert the electrical quantity signal into angular displacement data;
[0040] A processing module, used for preprocessing the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples;
[0041] A weighting module, used for performing weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model;
[0042] An optimization module, used for optimizing the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on a particle swarm algorithm to obtain a final fault diagnosis model;
[0043] The diagnosis module is used to input the angular displacement test sample into the final fault diagnosis model and output the fault diagnosis result of the circuit breaker.
[0044] In a third aspect, an electronic device is provided in an embodiment of the present disclosure, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the circuit breaker diagnosis method in the first aspect when executing the computer program.
[0045] In a fourth aspect, a computer-readable storage medium is provided in an embodiment of the present disclosure, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the circuit breaker diagnosis method in the first aspect are implemented.
[0046] The circuit breaker diagnosis method provided by the present application collects the electrical quantity signal of the angular displacement of the circuit breaker through an electromagnetic sensor, converts the electrical quantity signal into angular displacement data, pre-processes the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples, performs weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model, optimizes the decision tree tree parameters and weighted proportion parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain a final fault diagnosis model, inputs the angular displacement test sample into the final fault diagnosis model, and outputs the fault diagnosis result of the circuit breaker. By using angular displacement data, the complexity of signal acquisition and data processing can be greatly reduced, and the characteristic value is obvious and the reliability is high. The decision tree tree parameters and weighted proportion parameters are optimized by the particle swarm algorithm, which improves the classification accuracy and makes the diagnosis of the circuit breaker more accurate.
[0047] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work. In each of the drawings, similar components are numbered similarly.
[0049] Figure 1 A schematic flow chart of a circuit breaker diagnosis method provided by an embodiment of the present application is shown;
[0050] Figure 2The stroke curve of the operating mechanism of the circuit breaker provided in the embodiment of the present application when the circuit breaker is opened is shown, wherein (a) is a schematic diagram of the stroke curve when the operating mechanism is opened, (b) is a schematic diagram of the acceleration curve when the operating mechanism is opened, and (c) is a schematic diagram of the acceleration change rate curve when the operating mechanism is opened;
[0051] Figure 3 The stroke curve of the operating mechanism of the circuit breaker provided in the embodiment of the present application when closing the circuit breaker is shown, wherein (a) is a schematic diagram of the stroke curve when the operating mechanism is closing the circuit breaker, (b) is a schematic diagram of the acceleration curve when the operating mechanism is closing the circuit breaker, and (c) is a schematic diagram of the acceleration change rate curve when the operating mechanism is closing the circuit breaker;
[0052] Figure 4 A schematic diagram of a process for optimizing a decision tree parameter and a weighted ratio parameter provided in an embodiment of the present application is shown;
[0053] Figure 5 A schematic diagram showing the effect of the number of decision trees provided in an embodiment of the present application on classification accuracy is shown;
[0054] Figure 6 A schematic diagram showing the influence of the weighted ratio on the classification accuracy provided in the embodiment of the present application is shown;
[0055] Figure 7 A schematic structural diagram of a circuit breaker diagnostic device provided in an embodiment of the present application is shown;
[0056] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0057] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0058] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. In contrast, when an element is referred to as being "directly on" another element, there is no intermediate element. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0059] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0060] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0062] Example 1
[0063] See also Figure 1 , Figure 1 A schematic diagram of a circuit breaker diagnostic method provided in an embodiment of the present application. Figure 1 As shown, the method includes:
[0064] Step S101: collecting an electrical quantity signal of an angular displacement of a circuit breaker through an electromagnetic sensor, and converting the electrical quantity signal into angular displacement data.
[0065] Specifically, a circuit breaker is a switch control device that can close, carry and disconnect load current in a normal circuit. When a short circuit or other abnormality occurs in the circuit, it can immediately disconnect the fault circuit to protect the safety of normal loads. Since the mechanical mechanism of the circuit breaker is relatively complex, the opening and closing actions will change its mechanical structure and characteristics, resulting in abnormal operation. The operating mechanism is one of the important components of the circuit breaker, which can realize functions such as opening and closing, reclosing, keeping closed, free tripping, preventing jumping, resetting and interlocking. Monitoring the mechanical state of the circuit breaker's operating mechanism is an important task required to improve the reliability of the power grid, and angular displacement is the main parameter to characterize the mechanical state of the circuit breaker operating mechanism.
[0066] Furthermore, data is transmitted based on a preset protocol polling mechanism, and the microprocessor in each electromagnetic sensor stores the angular displacement data in a single-channel annular storage area. The host computer broadcasts a transmission frame to multiple electromagnetic sensors, and each electromagnetic sensor parses the transmission frame after receiving it. If the device address is the address of the local sensor, it determines whether an action occurs. If it occurs, the collected data is returned, and if it does not occur, a normal code is returned. By transmitting data through a preset protocol polling mechanism, data from multiple different electromagnetic sensors can be collected, allowing the host computer to collect and process multi-sensor data simultaneously. Collecting angular displacement data through non-contact electromagnetic sensors can greatly reduce the complexity of signal acquisition and data processing, and the feature quantity is easy to extract. It is less affected by the equipment operating environment, and the reliability of the data is improved.
[0067] Step S102, preprocessing the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples.
[0068] Specifically, the wavelet transform filtering is a transform analysis method, which can highlight the characteristics of the problem through transformation, can perform localized analysis of time and frequency, and gradually perform multi-scale refinement of the signal through scaling and translation operations, ultimately achieving time subdivision at high frequencies and frequency subdivision at low frequencies, and can automatically adapt to the requirements of time-frequency signal analysis, thereby being specific to any details of the signal.
[0069] In one embodiment, the step of preprocessing the angular displacement data by wavelet transform-based filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples includes:
[0070] The angular displacement data includes a travel curve, and a velocity characteristic value in the travel curve is extracted;
[0071] At least one group of the velocity feature values is obtained, and at least one group of the velocity feature values is randomly selected to obtain the angular displacement training samples and the angular displacement test samples.
[0072] In one embodiment, the speed characteristic value includes the descending speed, maximum descending speed, fastest descending speed and minimum speed of the travel curve, the descending speed is the average speed between the descending critical point and a point above the point where the absolute value of the descending speed is the maximum in the travel curve, the maximum descending speed is the average speed between two points above and below the point where the maximum descending speed is in the travel curve, the fastest descending speed is the average speed between the fastest descending point and the point where the absolute value of the speed just reaches the minimum in the travel curve, and the minimum speed is the average speed between the point where the absolute value of the speed just reaches the minimum and the minimum point in the travel curve.
[0073] See also Figure 2 and Figure 3 , Figure 2 The stroke curve of the operating mechanism of the circuit breaker provided in the embodiment of the present application when opening the circuit breaker, Figure 3 A stroke curve of the operating mechanism of the circuit breaker provided in an embodiment of the present application when closing the circuit breaker. Figure 2 (a) is a schematic diagram of the stroke curve when the operating mechanism is opened, (b) is a schematic diagram of the acceleration curve when the operating mechanism is opened, and (c) is a schematic diagram of the acceleration change rate curve when the operating mechanism is opened. Figure 3 (a) is a schematic diagram of the stroke curve when the operating mechanism is closed, (b) is a schematic diagram of the acceleration curve when the operating mechanism is closed, and (c) is a schematic diagram of the acceleration change rate curve when the operating mechanism is closed. The operating mechanism of the circuit breaker will rotate during the process of opening or closing the circuit breaker, thereby generating angular displacement data. The angular displacement data is the angle value of the current state of the operating mechanism.
[0074] The descending speed, maximum descending speed, fastest descending speed and minimum speed are all speed quantities, which are calculated by dividing the travel of the section by the time of the section. Each time the circuit breaker operating mechanism operates, a travel curve can be collected, and a set of speed characteristic values can be obtained.
[0075] Step S103, performing weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model.
[0076] In one embodiment, the step of performing weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model includes:
[0077] Randomly setting the number of decision trees and weighted ratios of the random forest, performing sampling with replacement from the angular displacement training samples, and generating a sub-training set corresponding to the number of decision trees;
[0078] Generate a decision tree according to the sub-training set, and select m attributes from all classification attributes as decision attributes of nodes;
[0079] According to the loss function formula Calculate the loss function of the root node, and prune the decision tree when the loss function reaches the minimum value, where Gini is the Gini coefficient, T t For any subtree in the pruning process, Gini(T t ) is the Gini coefficient of the t node in the pruning process, t is any internal node of the decision tree, Gini(t) is the Gini coefficient of the t node, |T t | is the number of leaf nodes of the subtree;
[0080] Determine whether the pruning process is completed according to the number of sub-training sets contained in the root node of the decision tree, and if the pruning process is completed, return the classification result and cast a vote for the decision tree;
[0081] The weight of the decision tree is calculated based on the angular displacement training samples and the votes of the decision tree.
[0082] Specifically, the pruning process refers to deleting a portion of nodes and their branches in the decision tree, which plays a role in preventing the decision tree from having too many branches and causing data overfitting.
[0083] In a specific implementation, the step of generating a decision tree according to the sub-training set and selecting m attributes from all classification attributes as decision attributes of nodes includes:
[0084] Putting the sub-training set into the root node, and obtaining a random variable according to the angular displacement training sample;
[0085] The sub-training set in the root node is split according to the random variable and the Gini coefficient is calculated according to the formula Calculate the Gini coefficient of the root node, where X is a random variable, is a root node sample, N1 and N2 are split leaf nodes of the root node based on the random variable condition, Gini(T1) is the Gini coefficient of the N1 node subtree, Gini(T2) is the Gini coefficient of the N2 node subtree, T1 is the N1 node subtree, and T2 is the N2 node subtree;
[0086] Determine whether the Gini coefficient is less than a preset value under the decision attribute;
[0087] If the Gini coefficient is less than the preset value, the decision attribute is determined to be the optimal split point and the splitting is stopped to become a leaf node;
[0088] If the Gini coefficient is greater than the preset value, the node is split as an intermediate node to the optimal splitting point.
[0089] Furthermore, the random variable refers to a subset of a set of any characteristic value, and this embodiment uses a binary tree method for splitting, that is, each split divides the current sample into two sub-samples.
[0090] In a specific implementation, the step of calculating the weight of the decision tree based on the angular displacement training samples and the votes of the decision tree includes:
[0091] Calculating the classification accuracy and weighted ratio of the decision tree according to the angular displacement training samples;
[0092] According to the weighted proportion calculation formula l is the weight for calculating the decision tree, where: is the number of correctly classified samples of the lth tree in the test sample, S L is the total number of test samples, Z lis the correct classification rate of the lth tree, and Z l The weight of the decision tree is determined, and the vote cast by the decision tree in the initial fault diagnosis model is the product of the current vote and the weight of the decision tree.
[0093] Specifically, the weight of each decision tree in the traditional random forest algorithm is consistent when voting on the split result, but in the specific implementation, since the classification accuracy of each tree is different, the decision tree with poor classification effect will have an adverse effect on the result, reducing the classification ability of the random forest. In this embodiment, the classification ability of the random forest is improved by increasing the voting weight of the decision tree with high accuracy and reducing the voting weight of the decision tree with low accuracy.
[0094] It can be understood that the angular displacement training samples are divided into a first sample and a second sample, the first sample is directly used to train the random forest model, and the second training sample is used to solve the classification accuracy of each decision tree in the random forest model, and the weighted ratio is obtained by calculating the ratio of the second sample to the angular displacement training samples.
[0095] Step S104, optimizing the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain a final fault diagnosis model.
[0096] It can be understood that the optimal values of the decision tree parameters and weighted ratio parameters in the initial fault diagnosis model are solved through the iterative algorithm of particle swarm optimization to obtain the optimal decision tree parameters and the optimal weighted ratio parameters. The initial fault diagnosis model is optimized based on the optimal decision tree parameters and the optimal weighted ratio parameters to obtain the final fault diagnosis model, thereby improving the classification accuracy of the final fault diagnosis model.
[0097] See also Figure 4 , Figure 4 A flow chart of optimizing the tree parameters and weighted ratio parameters of a decision tree provided in the embodiment of the present application. Figure 4 As shown, the step of optimizing the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain the final fault diagnosis model includes:
[0098] Step S1041, input the decision tree parameters and weighted ratio parameters, iteration times and iteration termination conditions of the particle, and randomly assign an initial position and speed to each particle;
[0099] Step S1042, calculating the fitness value, optimal position, global optimal fitness value, and global optimal position of the particle;
[0100] Step S1043, according to the particle velocity formula v i =wvi +r1c1+r2c2×(p g -x i ) and the particle position formula x i =x i +v i Update the position and velocity of the particle, where w is the inertia weight factor and v i is the particle velocity, x i is the spatial position, c1 is a non-negative constant, c2 is the acceleration factor, p g is the optimal position of particles in the group, r1 and r2 are random numbers between 0 and 1;
[0101] Step S1044, judging whether the particle satisfies the termination condition according to the iteration termination condition;
[0102] Step S1045, if the particle meets the termination condition, then output the optimal decision tree parameters and the optimal weighted ratio parameters;
[0103] Step S1046, if the particle does not meet the termination condition, return to the step of calculating the fitness value, optimal position, global optimal fitness value, and global optimal position of the particle.
[0104] Specifically, the iteration termination condition includes the minimum difference between two iteration fitness values. The fitness value is the classification accuracy value of the model represented by the particle at this position. The optimal position of each particle is obtained by comparing the fitness value of the position after the particle moves and the fitness value of the position before the movement. The position with the highest fitness value is determined as the optimal position of the particle. The global optimal fitness value is the maximum fitness value among all particles, and the global optimal position is the position of the particle.
[0105] Step S105: input the angular displacement test sample into the final fault diagnosis model, and output the fault diagnosis result of the circuit breaker.
[0106] As shown in Table 1, Table 1 shows typical values of characteristic values. By collecting the stroke curves of the operating mechanism under different states, n experimental samples are obtained, and the characteristic values of each experimental sample are extracted:
[0107] Table 1
[0108] Fault type <![CDATA[k1]]> <![CDATA[k2]]> <![CDATA[k3]]> <![CDATA[k4]]> Label Closing is normal 0.1 0.27 2.63 2.55 1 Control voltage high 0.61 1.39 2.76 2.36 2 Control voltage low 0.27 0.61 2.8 2.48 3
[0109] See also Figure 5 and Figure 6 , Figure 5 A schematic diagram showing the effect of the number of decision trees on classification accuracy provided in an embodiment of the present application. Figure 6A schematic diagram of the influence of the weighted ratio on the classification accuracy provided in the embodiment of the present application, wherein the optimal decision tree parameter is selected as 70, and the optimal weighted ratio parameter is selected as 0.15. The optimal decision tree parameter and the optimal weighted ratio parameter are input into the initial fault model for optimization to obtain the final fault model, and the collected n experimental samples are input into the final fault model. The circuit breaker fault diagnosis can be performed according to the label output by the final fault model.
[0110] The circuit breaker diagnosis method provided in the embodiment of the present application collects the electrical quantity signal of the angular displacement of the circuit breaker through an electromagnetic sensor, converts the electrical quantity signal into angular displacement data, pre-processes the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples, performs weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model, optimizes the decision tree tree parameters and weighted proportion parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain a final fault diagnosis model, inputs the angular displacement test sample into the final fault diagnosis model, and outputs the fault diagnosis result of the circuit breaker. By using angular displacement data, the complexity of signal acquisition and data processing can be greatly reduced, and the characteristic value is obvious and the reliability is high. The decision tree tree parameters and weighted proportion parameters are optimized by the particle swarm algorithm, thereby improving the classification accuracy and making the diagnosis of the circuit breaker more accurate.
[0111] Example 2
[0112] like Figure 7 As shown, the embodiment of the present application further discloses a schematic diagram of a circuit breaker diagnostic device 700, wherein the circuit breaker diagnostic device 700 comprises:
[0113] The acquisition module 701 is used to acquire the electrical quantity signal of the angular displacement of the circuit breaker through an electromagnetic sensor, and convert the electrical quantity signal into angular displacement data;
[0114] A processing module 702 is used to pre-process the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples;
[0115] A weighting module 703 is used to perform weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model;
[0116] An optimization module 704 is used to optimize the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on a particle swarm algorithm to obtain a final fault diagnosis model;
[0117] The diagnosis module 705 is used to input the angular displacement test sample into the final fault diagnosis model and output the fault diagnosis result of the circuit breaker.
[0118] The circuit breaker diagnosis device 700 provided in this embodiment can implement the circuit breaker diagnosis method shown in Embodiment 1, and will not be described again to avoid repetition.
[0119] The circuit breaker diagnostic device provided in the embodiment of the present application collects the electrical quantity signal of the angular displacement of the circuit breaker through an electromagnetic sensor, converts the electrical quantity signal into angular displacement data, pre-processes the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples, performs weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model, optimizes the decision tree tree parameters and weighted proportion parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain a final fault diagnosis model, inputs the angular displacement test sample into the final fault diagnosis model, and outputs the fault diagnosis result of the circuit breaker. By using angular displacement data, the complexity of signal acquisition and data processing can be greatly reduced, and the characteristic value is obvious and the reliability is high. The decision tree tree parameters and weighted proportion parameters are optimized by the particle swarm algorithm, thereby improving the classification accuracy and making the diagnosis of the circuit breaker more accurate.
[0120] Example 3
[0121] In addition, an embodiment of the present disclosure provides an electronic device 800, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the circuit breaker diagnosis method provided in the above-mentioned embodiment 1 is executed.
[0122] For details, see Figure 8 The electronic device 800 includes: a receiver 801, a bus interface and a processor 802.
[0123] In the embodiment of the present invention, the electronic device 800 further includes a memory 803. Figure 8 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 802 and memory represented by memory 803. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The receiver 801 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 802 is responsible for managing the bus architecture and general processing, and the memory 803 may store data used by the processor 802 when performing operations.
[0124] The electronic device 800 provided in the embodiment of the present invention can implement the circuit breaker diagnosis method shown in Embodiment 1, which will not be described again to avoid repetition.
[0125] Example 4
[0126] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the circuit breaker diagnosis method provided in the above embodiment is implemented.
[0127] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0128] The computer-readable storage medium provided in this embodiment can implement the circuit breaker diagnosis method shown in Embodiment 1, and will not be described again here to avoid repetition.
[0129] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow chart, and the combination of boxes in the structure diagram and / or the flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0131] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0132] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A circuit breaker diagnosis method, characterized in that: The method comprises: Collecting the electrical quantity signal of the angular displacement of the circuit breaker by means of an electromagnetic sensor, and converting the electrical quantity signal into angular displacement data; Preprocessing the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples; Performing weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model; Optimizing the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain a final fault diagnosis model; The angular displacement test sample is input into the final fault diagnosis model, and the fault diagnosis result of the circuit breaker is output.
2. The circuit breaker diagnosis method according to claim 1, characterized in that: The step of preprocessing the angular displacement data by filtering and feature extraction based on wavelet transform to obtain angular displacement training samples and angular displacement test samples includes: The angular displacement data includes a travel curve, and a velocity characteristic value in the travel curve is extracted; At least one group of the velocity feature values is obtained, and at least one group of the velocity feature values is randomly selected to obtain the angular displacement training samples and the angular displacement test samples.
3. The circuit breaker diagnosis method according to claim 2, characterized in that: The speed characteristic value includes the descending speed, maximum descending speed, fastest descending speed and minimum speed of the stroke curve. The descending speed is the average speed between the descending critical point and a point above the point with the maximum absolute value of the descending speed in the stroke curve. The maximum descending speed is the average speed between two points above and below the point with the maximum descending speed in the stroke curve. The fastest descending speed is the average speed between the fastest descending point and the point where the absolute value of the speed just reaches the minimum value in the stroke curve. The minimum speed is the average speed between the point where the absolute value of the speed just reaches the minimum value and the minimum value point in the stroke curve.
4. The circuit breaker diagnosis method according to claim 1, characterized in that: The step of performing weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model comprises: Randomly setting the number of decision trees and weighted ratios of the random forest, performing sampling with replacement from the angular displacement training samples, and generating a sub-training set corresponding to the number of decision trees; Generate a decision tree according to the sub-training set, and select m attributes from all classification attributes as decision attributes of nodes; According to the loss function formula Calculate the loss function of the root node, and prune the decision tree when the loss function reaches the minimum value, where Gini is the Gini coefficient, T t For any subtree in the pruning process, Gini(T t ) is the Gini coefficient of the t node in the pruning process, t is any internal node of the decision tree, Gini(t) is the Gini coefficient of the t node, |T t | is the number of leaf nodes of the subtree; Determine whether the pruning process is completed according to the number of sub-training sets contained in the root node of the decision tree, and if the pruning process is completed, return the classification result and cast a vote for the decision tree; The weight of the decision tree is calculated based on the angular displacement training samples and the votes of the decision tree.
5. The circuit breaker diagnosis method according to claim 4, characterized in that: The step of generating a decision tree according to the sub-training set and selecting m attributes from all classification attributes as decision attributes of the node comprises: Putting the sub-training set into the root node, and obtaining a random variable according to the angular displacement training sample; The sub-training set in the root node is split according to the random variable and the Gini coefficient is calculated according to the formula Calculate the Gini coefficient of the root node, where X is a random variable, N is a root node sample, N1 and N2 are split leaf nodes of the root node based on the random variable condition, Gin(T1) is the Gini coefficient of the N1 node subtree, Gini(T2) is the Gini coefficient of the N2 node subtree, T1 is the N1 node subtree, and T2 is the N2 node subtree; Determine whether the Gini coefficient is less than a preset value under the decision attribute; If the Gini coefficient is less than the preset value, the decision attribute is determined to be the optimal split point and the splitting is stopped to become a leaf node; If the Gini coefficient is greater than the preset value, the node is split as an intermediate node to the optimal splitting point.
6. The circuit breaker diagnosis method according to claim 4, characterized in that: The step of calculating the weight of the decision tree according to the angular displacement training samples and the votes of the decision tree comprises: Calculating the classification accuracy and weighted ratio of the decision tree according to the angular displacement training samples; According to the weighted proportion calculation formula 1 is to calculate the weight of the decision tree, where: is the number of correctly classified samples of the lth tree in the test sample, S L is the total number of test samples, Z l is the correct classification rate of the lth tree, and Z l The weight of the decision tree is determined, and the vote cast by the decision tree in the initial fault diagnosis model is the product of the current vote and the weight of the decision tree.
7. The circuit breaker diagnosis method according to claim 1, characterized in that: The step of optimizing the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on the particle swarm algorithm to obtain the final fault diagnosis model includes: Input the particle's decision tree parameters, weighted ratio parameters, number of iterations, and iteration termination conditions, and randomly assign an initial position and velocity to each particle; Calculating the fitness value, optimal position, global optimal fitness value, and global optimal position of the particle; According to the particle velocity formula v i =wv i +r1c1+r2c2×(p g -x i ) and the particle position formula x i =x i +V i Update the position and velocity of the particle, where w is the inertia weight factor and v i is the particle velocity, x i is the spatial position, c1 is a non-negative constant, c2 is the acceleration factor, p g is the optimal position of particles in the group, r1 and r2 are random numbers between 0 and 1; Determine whether the particle satisfies the termination condition according to the iteration termination condition; If the particle meets the termination condition, the optimal decision tree parameters and the optimal weighted ratio parameters are output; If the particle does not meet the termination condition, it returns to calculating the fitness value of the particle, the maximum 20 The steps of optimal position, global optimal fitness value, and global optimal position.
8. A diagnostic device for a circuit breaker, characterized in that: The device comprises: A collection module, used to collect the electrical quantity signal of the angular displacement of the circuit breaker through an electromagnetic sensor, and convert the electrical quantity signal into angular displacement data; A processing module, used for preprocessing the angular displacement data based on wavelet transform filtering and feature extraction to obtain angular displacement training samples and angular displacement test samples; A weighting module, used for performing weighted processing on the random forest algorithm according to the angular displacement training samples to obtain an initial fault diagnosis model; An optimization module, used for optimizing the decision tree parameters and weighted ratio parameters of the initial fault diagnosis model based on a particle swarm algorithm to obtain a final fault diagnosis model; The diagnosis module is used to input the angular displacement test sample into the final fault diagnosis model and output the fault diagnosis result of the circuit breaker.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the circuit breaker diagnosis method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the circuit breaker diagnosis method according to any one of claims 1 to 7 are implemented.
