Arc fault detection method and related device based on adaptive feature selection
By optimizing discrete wavelet transform with adaptive feature selection and particle swarm optimization algorithm, the problem of low accuracy in low-voltage series arc fault detection is solved, and more efficient arc fault identification is achieved.
Patent Information
- Application Number
- CN202510897636.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-07-01
AI Technical Summary
In low-voltage series arc fault detection, it is difficult to determine the optimal wavelet parameters in existing technologies, resulting in low accuracy of arc fault detection.
An adaptive feature selection method is adopted to optimize the decomposition parameters and feature selection of discrete wavelet transform through the particle swarm optimization algorithm, and the arc fault signal characteristics under different electrical scenarios and equipment working conditions are separated. The preset classification model is used for training to obtain multiple target classification models to improve the detection accuracy.
By dividing the training data into multiple data sets, the complexity of feature selection is reduced, the accuracy of arc fault detection is improved, and more accurate arc fault identification is achieved.
Smart Images

Figure CN120408205B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of power fault identification, and in particular to an arc fault detection method and related devices using adaptive feature selection. Background Art
[0002] During electrical system operation, an arc fault instantly releases intense heat, which can easily cause electrical fires and severe damage to surrounding equipment, posing a significant threat to personal safety and the stable operation of the electrical system. Therefore, efficient and accurate arc fault detection is crucial for protecting life and property and maintaining the normal operation of electrical systems.
[0003] Currently, in the field of low-voltage series arc fault detection, discrete wavelet transform (DWT) is widely used for current signal feature extraction due to its excellent time-frequency analysis characteristics. By analyzing the extracted features, the arc fault state and normal operating state can be distinguished. However, due to the differences in arc fault signal characteristics under different electrical scenarios and equipment operating conditions, it is difficult to determine the optimal wavelet parameters, resulting in low accuracy of arc fault detection. Therefore, the problem of how to improve the accuracy of arc fault detection needs to be solved urgently. Summary of the Invention
[0004] The embodiments of the present application provide an arc fault detection method and related devices with adaptive feature selection, which improve the accuracy of arc fault detection.
[0005] In a first aspect, an embodiment of the present application provides an arc fault detection method with adaptive feature selection, comprising:
[0006] Acquire a training data set and a test data set; the data in the training data set and the test data set are current data of the power grid equipment in the target power system;
[0007] Classify the data in the training data set to obtain three types of data sets;
[0008] The preset PSO algorithm is used to optimize the DWT decomposition parameters and perform feature selection on the three types of data sets, obtaining three sets of optimal DWT decomposition parameters and three feature subsets; each type of data set corresponds to a set of optimal DWT decomposition parameters and a feature subset;
[0009] Based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters and the three feature subsets, the preset classification models are trained respectively to obtain three target classification models;
[0010] Acquire data to be identified; the data to be identified is current data of a power grid device in the target power system;
[0011] Determining a target load type corresponding to the data to be identified;
[0012] Determine a target classification model corresponding to the target load type among the three target classification models to obtain a first target classification model;
[0013] The data to be identified is identified by using the first target classification model to obtain a target fault detection result; the target fault detection result includes whether an arc fault exists or does not exist.
[0014] In a second aspect, an embodiment of the present application provides an arc fault detection device with adaptive feature selection, which is applied to an electronic device connected to a target power system. The device includes: an acquisition module, a model training module, and a fault detection module, wherein:
[0015] The acquisition module is used to acquire a training data set and a test data set; the data in the training data set and the test data set are current data of the power grid equipment in the target power system;
[0016] The model training module is used to classify the data in the training data set to obtain three types of data sets; optimize the DWT decomposition parameters of the three types of data sets using a preset PSO algorithm and perform feature selection to obtain three sets of optimal DWT decomposition parameters and three feature subsets; each type of data set corresponds to a set of optimal DWT decomposition parameters and a feature subset; and train the preset classification models based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters, and the three feature subsets to obtain three target classification models;
[0017] The fault detection module is used to obtain data to be identified; the data to be identified is current data for the power grid equipment in the target power system; determine the target load type corresponding to the data to be identified; determine the target classification model corresponding to the target load type among the three target classification models to obtain a first target classification model; identify the data to be identified through the first target classification model to obtain a target fault detection result; the target fault detection result includes the presence or absence of an arc fault.
[0018] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the above-mentioned computer-readable storage medium stores a computer program for electronic data exchange, wherein the above-mentioned computer program enables a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application.
[0020] In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
[0021] The implementation of this application has the following beneficial effects:
[0022] It can be seen that the arc fault detection method with adaptive feature selection described in this application divides the training data into three types of data sets to avoid interference between data of different load types in the same feature space, thereby reducing the complexity of feature selection. Then, the preset classification models are trained respectively with these three types of data sets to obtain three target classification models, thereby converting the global generalization problem into multiple local precise classification problems. The training data of each model is purer and the feature space is more compact, thereby improving the model classification accuracy, that is, improving the accuracy of arc fault detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0024] Figure 1 This is an application scenario diagram of an electronic device provided in an embodiment of the present application;
[0025] Figure 2 is a structural diagram of a target power system provided in an embodiment of the present application;
[0026] Figure 3 This is a flow chart of an arc fault detection method for adaptive feature selection provided by an embodiment of the present application;
[0027] Figure 4 This is a flow chart of a data classification method provided in an embodiment of the present application;
[0028] Figure 5 This is a flowchart of a preset PSO algorithm provided in an embodiment of the present application;
[0029] Figure 6 This is a flow chart for identifying data to be identified provided by an embodiment of the present application;
[0030] Figure 7 This is a block diagram of the functional modules of an arc fault detection device with adaptive feature selection provided by an embodiment of the present application;
[0031] Figure 8 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0033] The terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0034] It should be understood that the term "and / or" in this document is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document indicates that the associated objects are in an "or" relationship. The "plurality" appearing in the embodiments of this application refers to two or more.
[0035] In the embodiments of the present application, "at least one item" or similar expressions refers to any combination of these items, including any combination of single items or plural items, and refers to one or more, and multiple refers to two or more. For example, at least one item (item) of a, b, or c can represent the following seven situations: a, b, c, a and b, a and c, b and c, a, b, and c. Among them, each of a, b, and c can be an element or a set containing one or more elements.
[0036] The "connection" appearing in the embodiments of the present application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not impose any limitations on this.
[0037] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0038] The electronic devices described in the embodiments of the present application may include smart phones (such as Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, PDAs, laptops, video matrices, monitoring platforms, mobile internet devices (MIDs) or wearable devices, etc. The above are only examples and not exhaustive, including but not limited to the above devices.
[0039] Of course, the above-mentioned electronic device can also be a server, for example, a cloud server.
[0040] The following describes the relevant contents, concepts, meanings, technical issues, technical solutions, beneficial effects, etc. involved in the embodiments of this application.
[0041] First, some professional terms involved in this application are explained:
[0042] Power system: An electric energy production and consumption system consisting of power generation, transmission, transformation, distribution and consumption. Its core is to achieve safe, reliable and economical transmission and conversion of electric energy from production to use through reasonable architecture and equipment.
[0043] Arc fault: In power systems, insulation breakdown or poor contact between conductors causes current to flow through air gaps, resulting in continuous discharge. The high temperature (up to 3,000 degrees Celsius) generated by the arc can ignite surrounding combustible materials and is the main cause of electrical fires. It can also interfere with the normal operation of power equipment and generate electromagnetic interference.
[0044] Particle Swarm Optimization (PSO) is a metaheuristic optimization algorithm inspired by the foraging behavior of bird flocks. It simulates the collaborative movement of particles in a search space to find the optimal solution. Each particle represents a potential solution, represented by its position (decision variable) and velocity (movement direction). Particles update their velocity and position based on their own historical optimal position (individual experience) and the global optimal position (group experience). The iterative process gradually converges to the global optimal or near-optimal solution.
[0045] Discrete Wavelet Transform (DWT): A time-frequency analysis tool that decomposes a signal into sub-signals (wavelet coefficients) of varying scales and frequencies. It is suitable for processing nonstationary signals. DWT decomposition parameters include the wavelet basis functions (e.g., db1, db2, sym3, sym4) and the number of decomposition levels. The wavelet basis functions determine the time-frequency characteristics of the DWT decomposition; a greater number of decomposition levels results in finer frequency band division.
[0046] Adaptive feature selection: Automatically selects the most discriminative feature subset based on data characteristics, avoiding the "curse of dimensionality" and redundant feature interference. The feature selection process depends on the distribution and characteristics of the specific dataset. It can dynamically adjust the feature subset for different scenarios (such as different load types) and optimizes model performance (such as classification accuracy).
[0047] The SCADA module (Supervisory Control and Data Acquisition) is a distributed monitoring system based on computer, communication, and control technologies. It is used to collect data from remote devices or production processes, provide real-time monitoring, provide fault warnings, and adjust parameters. It is widely used in fields such as power generation, oil and gas, water treatment, and manufacturing, and is a core component of industrial automation.
[0048] Artificial Neural Network (ANN) classification model: It is a computational model that simulates the structure and function of the biological nervous system. It consists of a large number of artificial neurons (nodes) connected to each other to form a network, and classifies input data through multi-layer information transmission and processing.
[0049] ReLU (Rectified Linear Unit): It is a commonly used activation function in neural networks. It can introduce nonlinear capabilities to neural network models, enabling the model to learn complex patterns (without the activation function, a multi-layer network is equivalent to a single-layer linear model).
[0050] Sigmoid activation function: An activation function whose output value is mapped in the (0, 1) interval and is often used in the last layer of a binary classification problem.
[0051] Binary cross entropy: It is a loss function that measures the difference between the prediction results of a binary classification model and the true label. The smaller the value, the more accurate the model prediction.
[0052] Adam optimizer: It is one of the most commonly used optimization algorithms in deep learning and is a first-order gradient optimization method (updating parameters based on gradient information). It combines the advantages of momentum and adaptive learning rate, and can dynamically adjust the learning rate of each parameter to achieve efficient model training.
[0053] See also Figure 1 , Figure 1 This is an application scenario diagram of an electronic device provided in an embodiment of the present application. It can be seen that the electronic device is physically or communicatively connected to the target power system. When arc fault detection is required, the electronic device can obtain current data or other relevant data of the target power system. Then, the electronic device can execute the arc fault detection method with adaptive feature selection provided in an embodiment of the present application to identify the current data of the target power system and determine whether the current data of the target power system contains an arc fault. The specific steps are as follows:
[0054] Acquire a training data set and a test data set; the data in the training data set and the test data set are current data of the power grid equipment in the target power system;
[0055] Classify the data in the training data set to obtain three types of data sets;
[0056] The preset PSO algorithm is used to optimize the DWT decomposition parameters and perform feature selection on the three types of data sets, obtaining three sets of optimal DWT decomposition parameters and three feature subsets; each type of data set corresponds to a set of optimal DWT decomposition parameters and a feature subset;
[0057] Based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters and the three feature subsets, the preset classification models are trained respectively to obtain three target classification models;
[0058] Acquire data to be identified; the data to be identified is current data of a power grid device in the target power system;
[0059] Determining a target load type corresponding to the data to be identified;
[0060] Determine a target classification model corresponding to the target load type among the three target classification models to obtain a first target classification model;
[0061] The data to be identified is identified by using the first target classification model to obtain a target fault detection result; the target fault detection result includes whether an arc fault exists or does not exist.
[0062] It should be explained that the above-mentioned electronic device can execute part or all of the steps of the arc fault detection method with adaptive feature selection provided in the embodiment of the present application.
[0063] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a target power system provided in an embodiment of the present application. It can be seen that the target power system may include: a controller, a fan, lighting equipment, a charging pile, etc., which are not limited here; wherein:
[0064] The controller may include a SCADA module, through which the controller can collect power system parameters (such as voltage, current, and frequency), output control signals after algorithm processing, and adjust the operating status of the equipment (such as start and stop, power adjustment). The controller usually contains a switching power supply (such as a DC / DC converter, an MCU power supply module), which needs to convert the input AC power into DC power through a rectifier element. It is a rectifier load type.
[0065] The SCADA module collects various grid operation data in real time or periodically, including voltage and current data, power data, power generation and consumption data, and transaction data. For example, through sensors installed at substations, power plants, and user terminals, the SCADA module can obtain real-time voltage and current values at each node in the target power system, as well as information such as the power generated by power generation equipment and the power consumption of users. This data forms the basis for building classification models.
[0066] A fan uses an electric motor to drive the blades to rotate, achieving ventilation, heat dissipation, or gas transportation (such as cooling fans in data centers and cooling fans in wind turbines). The core of the fan is an asynchronous motor or a permanent magnet synchronous motor. When working, the current lags behind the voltage, and reactive power is consumed. There is an inrush current at startup, and it is a typical inductive load (i.e., a motor load type).
[0067] Lighting equipment converts electrical energy into light energy and is used for indoor and outdoor lighting (such as LED lamps, fluorescent lamps, and high-pressure sodium lamps). Different lighting equipment has different load types. For example, LED lamps or fluorescent lamps contain electronic ballasts or driver power supplies and work through rectification and inversion links, which are rectifier load types. For example, incandescent lamps or halogen lamps generate heat and light through resistance wires, and the current and voltage are in phase, which are resistive load types.
[0068] Charging piles transmit grid power to the batteries of electric vehicles and are divided into AC charging piles and DC charging piles. Among them, DC charging piles convert AC power into DC power through a high-power rectifier inside. They are high-power rectification load types, with obvious harmonic pollution and require filtering devices. AC charging piles only provide AC power, which is rectified by the on-board charger of the electric vehicle. Therefore, the charging pile itself is a resistive load type.
[0069] See also Figure 3 , Figure 3This is a flow chart of an arc fault detection method for adaptive feature selection provided by an embodiment of the present application; the method is applied to an electronic device connected to a target power system (hereinafter referred to as the system), and includes but is not limited to the following steps:
[0070] S301 , obtaining a training data set and a test data set; data in the training data set and the test data set are all current data for power grid equipment in the target power system.
[0071] In the embodiment of the present application, the structure of the target power system can be as follows: Figure 2 As shown in, including SCADA module.
[0072] In a specific embodiment, system operation data can be collected through the SCADA module in the target power system. For example, the collection frequency can be set according to the importance and change characteristics of different data. For data with high real-time requirements and fast changes, such as voltage and current, a higher collection frequency can be set, such as once per second or once per minute. For some data that changes relatively slowly, such as the cumulative power generation of power generation equipment and the traded power, a lower collection frequency can be set, such as once per hour. Data is collected through devices such as voltage sensors, current sensors, and generator monitoring systems installed in locations such as substations and power grid lines to obtain system operation data. Since the electronic device has a physical or communication connection with the system, the system can transmit the system operation data to the electronic device, and the electronic device can extract the current data from the system operation data to obtain the target current data. Then, the electronic device can divide the target current data into a training data set and a test data set. For example, all data in the target current data can be sorted by timestamp (e.g., by collection time from early to late). Then, a division point is set (e.g., 80% of the total data volume as the boundary), with the first 80% of the data as the training set and the last 20% of the data as the test set.
[0073] S302: Classify the data in the training data set to obtain three types of data sets.
[0074] In the embodiment of the present application, classification can be performed based on the data characteristics in the training data set, and data with the same data characteristics can be divided into the same category, thereby obtaining three categories of data sets.
[0075] Optionally, the training data set includes n data, where n is an integer greater than 3; see Figure 4 , Figure 4 This is a flow chart of a data classification method provided by an embodiment of the present application. It can be seen that in step S302, the data in the training data set are classified to obtain three types of data sets, which may include: Figure 4 Steps shown:
[0076] S21, performing Fourier transform on the n data in the training data set to obtain n frequency domain data;
[0077] S22. Perform feature extraction based on the n frequency domain data to obtain n feature data; each feature data includes at least one of the following: fundamental wave, harmonic amplitude ratio, total harmonic distortion rate, and energy distribution characteristics;
[0078] S23, processing the n characteristic data using a preset classification algorithm to determine a load type corresponding to each of the n data, thereby obtaining n load types; each load type includes one of the following: a rectifier load type, a resistive load type, and a motor load type;
[0079] S24. Determine the three types of data sets according to the n load types and the n data.
[0080] In the embodiment of the present application, the preset classification algorithm can be preset or defaulted in advance.
[0081] In a specific embodiment, Fourier transform can be performed on each of the above-mentioned n data to obtain n frequency domain data; then, feature extraction can be performed based on the n frequency domain data to obtain n feature data. Taking the first frequency domain data as an example, if the feature data includes a fundamental wave, the main frequency component of the first frequency domain data (such as the industrial frequency 50Hz or 60Hz) can be extracted to obtain the first main frequency component (that is, the fundamental wave of the first frequency domain data). If the feature data includes a harmonic amplitude ratio, the amplitude of each harmonic in the first frequency domain data can be calculated to obtain at least one amplitude. Then, the at least one amplitude can be divided by the fundamental wave amplitude to obtain at least one harmonic amplitude ratio, and then, the feature data corresponding to the first frequency domain data can be obtained.
[0082] Then, a preset classification algorithm can be used to process the n feature data to determine the load type corresponding to each of the n data, and obtain n load types. Specifically, the preset classification algorithm can be one of the following: vector machine, K-means clustering method, etc., which is not limited here. For example, assuming that the preset classification algorithm is the K-means clustering method, the number of clusters k can be set to 3, corresponding to three load types. Then, the n feature data can be clustered to obtain 3 clusters, and the centroid eigenvalue of each cluster is calculated. The load type corresponding to each cluster is determined based on its physical meaning, thereby determining the n load types corresponding to the n data. For example, if the centroid of a cluster is power factor PF=0.95 and harmonic distortion rate THD=2%, it can be determined that the load type corresponding to the cluster is a motor load type.
[0083] Finally, three types of data sets are determined according to the n load types and the n data. Specifically, data with the same load type among the n data can be divided into the same type according to the n load types, thereby obtaining three types of data sets.
[0084] In this way, by extracting frequency domain features such as fundamental waves and harmonics, the system can automatically identify the load type without manual intervention, thereby improving classification efficiency.
[0085] S303 , using a preset PSO algorithm to optimize the DWT decomposition parameters and perform feature selection on the three types of data sets, to obtain three sets of optimal DWT decomposition parameters and three feature subsets; each type of data set corresponds to a set of optimal DWT decomposition parameters and a feature subset.
[0086] In the embodiment of the present application, the preset PSO algorithm can be preset in advance or defaulted.
[0087] In a specific embodiment, the DWT decomposition parameters of the three types of data sets can be optimized respectively by using a preset PSO algorithm, and feature selection can be performed, thereby obtaining three sets of optimal DWT decomposition parameters and three feature subsets.
[0088] It should be noted that these features are not directly derived from the original signal, but are secondary extractions based on the signal representation after DWT. For example, under resistive load, the 10th layer detail component is used to extract the fundamental phase and relative energy ratio of its higher harmonics to highlight the subtle spectral changes caused by arc disturbances.
[0089] For example, three sets of optimal DWT decomposition parameters and three feature subsets can be shown in Table 1:
[0090]
[0091] Optionally, the preset PSO algorithm is a binary particle swarm optimization algorithm, see Figure 5 , Figure 5 This is a flowchart of a preset PSO algorithm provided in an embodiment of the present application. It can be seen that in step S303, the preset PSO algorithm is used to optimize the DWT decomposition parameters and perform feature selection on the three types of data sets to obtain three sets of optimal DWT decomposition parameters and three feature subsets, which may include: Figure 5 Steps shown:
[0092] A1. Obtain a first type of data set; the first type of data set is any one of the three types of data sets;
[0093] A2. Initialize the particle swarm and the initial position and initial velocity of each particle to obtain the first particle swarm; the position of each particle is composed of a DWT decomposition parameter code and a feature selection mask;
[0094] A3. Define the first fitness function;
[0095] A4. Iteratively update the first particle swarm and determine an optimal particle based on the first fitness function; determine a target DWT decomposition parameter code and a target feature selection mask corresponding to the optimal particle; determine an optimal DWT decomposition parameter corresponding to the first type of data set based on the target DWT decomposition parameter code, and determine a feature subset corresponding to the first type of data set based on the target feature selection mask.
[0096] In an embodiment of the present application, a first type of data set can be obtained; then, a particle swarm and an initial position and an initial velocity of each particle can be initialized to obtain a first particle swarm. Specifically, random initialization can be used to randomly generate an initial position and an initial velocity of each particle.
[0097] For example, for the first particle (any particle in the first particle group), assuming that the first position corresponding to the first particle can be a binary number, there are generally four types of wavelet functions, which require 3 bits of binary to represent. The specific mapping relationship can be shown in Table 2:
[0098]
[0099] In addition, the value range of the wavelet decomposition layer is 1~10, which requires 4 binary bits to represent (if you need to represent a value greater than 10, you can appropriately increase the number of coding bits corresponding to the wavelet decomposition layer). There are two types of wavelet decomposition components, approximate components and detail components, which require 1 binary bit to represent. Specifically, 0 can represent the approximate component (A, low-frequency part, reflecting the signal trend), and 1 represents the detail component (D, high-frequency part, reflecting signal mutation or noise). The feature selection mask requires n-bit binary representation. Each bit of the n-bit binary corresponds to a feature, 1 indicates that the corresponding feature is selected, and 0 indicates that the corresponding feature is removed. Where n is the total number of features corresponding to the first type of data set. For example, assuming there are 8 features (root mean square value, energy entropy, kurtosis, skewness, local variance, zero crossing rate, maximum value of wavelet coefficient, decomposition layer energy ratio), the mask: 10101100 indicates that the 1st, 3rd, 5th, and 6th features (root mean square value, kurtosis, local variance, zero crossing rate) are selected. Therefore, the total number of bits in the first position is 3+4+1+n.
[0100] Then, a first fitness function can be defined. Specifically, the accuracy of the preset classification model on the test data set can be used as the first fitness function. Then, the first particle swarm can be iteratively updated, and the optimal particle can be determined according to the first fitness function. Then, the optimal position corresponding to the optimal particle can be obtained, and the target DWT decomposition parameter code and the target feature selection mask can be determined according to the optimal position. The optimal DWT decomposition parameter corresponding to the first type of data set is determined according to the target DWT decomposition parameter code, and the feature subset corresponding to the first type of data set is determined according to the target feature selection mask. For example, assuming that the total number of features corresponding to the first type of data set is 5, namely root mean square value, energy entropy, kurtosis, skewness, and local variance, and assuming that the optimal position is "1000110111010", the first 8 bits "10001101" represent the target DWT decomposition parameter code, and its corresponding optimal DWT decomposition parameters are: wavelet function sym4, decomposition level number equal to 6, and detail component extraction; the last 5 bits "11010" represent the target feature selection mask, and its corresponding feature subset is: root mean square value, energy entropy, and skewness.
[0101] In this way, by integrating the two key links of feature engineering (feature generation and feature selection) into a unified optimization problem, the global optimal balance of data characteristics, computing efficiency and model performance is achieved through the preset PSO algorithm. Compared with the traditional empirical model of step-by-step parameter adjustment, the embodiment of the present application breaks the independent optimization barriers of decomposition parameters and feature selection, uses the coupling between the two to improve the overall efficiency, and explores the optimal combination of "decomposition parameters-feature subsets" on a global scale to avoid suboptimal solutions caused by mutual constraints between parameters.
[0102] Optionally, step A4, iteratively updating the first particle swarm and determining the optimal particle according to the first fitness function, may include the following steps:
[0103] B1. Update the particles in the first particle group according to a preset update formula to obtain a second particle group; the second particle group includes m particles; m is an integer greater than 1;
[0104] B2. Determine the target number of iterations corresponding to the second particle swarm;
[0105] B3. Calculating the fitness values corresponding to the m particles according to the first fitness function to obtain m fitness values;
[0106] B4, determining the optimal fitness value among the m fitness values, and recording the optimal fitness value as the global optimal fitness value;
[0107] B5. When the global optimal fitness value satisfies a preset convergence condition, or when the target number of iterations is greater than a first maximum number of iterations, determining the particle corresponding to the global optimal fitness value as the optimal particle;
[0108] B6. When the global optimal fitness value does not satisfy the preset convergence condition and the target number of iterations is not greater than the first maximum number of iterations, continue to iteratively update the second particle swarm until the optimal particle is determined.
[0109] In the embodiment of the present application, the preset update formula and the preset convergence condition can be preset in advance or defaulted.
[0110] In a specific embodiment, the particles in the first particle swarm can be updated according to a preset update formula to obtain a second particle swarm. Specifically, since the update process of the particle swarm is a conventional technology, it will not be described in detail here. Then, the target number of iterations corresponding to the second particle swarm can be determined. Specifically, when the preset PSO algorithm is run for the first time, a variable j=0 can be defined. Whenever the particle swarm is updated, the value of the variable j is increased by 1. The variable j corresponding to the second particle swarm can be obtained, and the target number of iterations can be determined according to the value of the variable j.
[0111] Then, the fitness values corresponding to the m particles can be calculated according to the first fitness function to obtain m fitness values. Specifically, the first type of data set can be processed according to the DWT decomposition parameters and feature subsets corresponding to each of the m particles to obtain m first feature data. The preset classification models can be trained using the m first feature data to obtain m trained preset classification models. The accuracy of the m trained preset classification models can be determined to obtain m accuracy rates, that is, m fitness values.
[0112] Next, the maximum value among the m fitness values, that is, the optimal fitness value, can be determined. Then, the optimal fitness value can be recorded as the global optimal fitness value. When the global optimal fitness value meets the preset convergence condition, or the target number of iterations is greater than the first maximum number of iterations, the particle corresponding to the global optimal fitness value is determined to be the optimal particle.
[0113] When the global optimal fitness value does not meet the preset convergence condition and the target number of iterations is not greater than the first maximum number of iterations, the second particle swarm is continuously iterated and updated until the optimal particle is determined.
[0114] It should be explained that the preset convergence condition may be: the global optimal fitness value no longer significantly increases in multiple consecutive iterations.
[0115] In this way, particle performance is quantified through a primary fitness function (such as classification accuracy), transforming the optimization objective into computable numerical feedback. In each iteration, particles update their position and velocity based on their historical optimal solution (individual extremum) and the global optimal solution (group extremum), forming a closed loop of "evaluate → update → re-evaluate," ensuring that the search direction always converges toward high-performance areas, ultimately yielding the optimal particle.
[0116] Optionally, the method further includes:
[0117] C1. Obtain historical operation data of the preset PSO algorithm for DWT decomposition parameters;
[0118] C2. Determine the number of iterations and the global optimal fitness value of each operation of the preset PSO algorithm to convergence in the historical operation data, and obtain i number of iterations and i global optimal fitness values; i is an integer greater than 1;
[0119] C3. Draw a target convergence curve according to the i number of iterations and the i global optimal fitness values; the abscissa of the target convergence curve is the fitness value, and the ordinate is the number of iterations;
[0120] C4. Determine the number of iterations corresponding to the preset fitness value in the target convergence curve to obtain a reference number of iterations;
[0121] C5. Obtain a first data volume and a first load type corresponding to the first type of data set;
[0122] C6. Determine a first adjustment factor corresponding to the first data volume;
[0123] C7. Determine a second adjustment factor corresponding to the first load type;
[0124] C8. Determine the first maximum number of iterations according to the first adjustment factor, the second adjustment factor, and the reference number of iterations.
[0125] In the embodiment of the present application, the preset fitness value can be preset in advance or defaulted.
[0126] In a specific embodiment, historical operation data of the preset PSO algorithm for the DWT decomposition parameters can be obtained first. Specifically, all operation data of the preset PSO algorithm can be obtained from the database of the electronic device. Then, data for determining the optimal DWT decomposition parameters can be extracted from these operation data to obtain historical operation data; then, the number of iterations and the global optimal fitness value of each operation of the preset PSO algorithm to convergence in the historical operation data can be recorded, thereby obtaining i number of iterations and i global optimal fitness values.
[0127] Then, a target convergence curve can be drawn according to the i number of iterations and the i global optimal fitness values. Specifically, the i number of iterations and the corresponding global optimal fitness values among the i global optimal fitness values can be combined into coordinate points to obtain multiple coordinate points. Then, a curve fitting method (for example, a polynomial fitting method, a spline method, etc.) can be used to fit these multiple coordinate points to obtain a target convergence curve; then, the number of iterations corresponding to the preset fitness value in the target convergence curve can be determined to obtain a reference number of iterations. For example, the curve equation corresponding to the target convergence curve can be obtained first, and the preset fitness value can be substituted into the equation to solve for the reference number of iterations.
[0128] Furthermore, the first load type corresponding to the first type of data set can be determined first, and then the first type of data set can be traversed. Each time a data is traversed, the data volume is increased by 1 until the traversal is completed to obtain the first data volume; then, the first adjustment factor corresponding to the first data volume can be determined, for example, a mapping relationship between a preset data volume and an adjustment factor can be pre-stored, and the first adjustment factor corresponding to the first data volume is determined based on the mapping relationship; then, the second adjustment factor corresponding to the first load type can be determined, similarly, a mapping relationship between a preset load type and an adjustment factor can be pre-stored, and the second adjustment factor corresponding to the first load type is determined based on the mapping relationship, wherein the value range of the first adjustment factor and the second adjustment factor can both be -0.5~0.5; finally, the reference number of iterations can be adjusted according to the first adjustment factor and the second adjustment factor to obtain the first maximum number of iterations.
[0129] In this way, by analyzing the historical running data of the preset PSO algorithm in the DWT decomposition parameter optimization task, extracting the number of iterations and the global optimal fitness value for each run to convergence, it is possible to explore the algorithm's own rules and reveal how many iterations the algorithm usually requires to reach a stable convergence state in similar problems, avoiding blindly setting a fixed iteration upper limit, so that the algorithm can quickly locate a reasonable iteration range in similar problems and reduce the waste of computing resources.
[0130] Optionally, step C8, determining the first maximum number of iterations according to the first adjustment factor, the second adjustment factor, and the reference number of iterations, may include the following steps:
[0131] D1. Determine a second maximum number of iterations according to the first adjustment factor, the second adjustment factor, and the reference number of iterations;
[0132] D2. When the second maximum number of iterations is less than a preset maximum number of iterations, determining the first maximum number of iterations according to the second maximum number of iterations;
[0133] D3. When the second maximum number of iterations is not less than the preset maximum number of iterations, determine the deviation between the second maximum number of iterations and the preset maximum number of iterations to obtain a target deviation; determine a target attenuation factor corresponding to the target deviation; adjust the second maximum number of iterations according to the target attenuation factor to obtain the first maximum number of iterations.
[0134] In the embodiment of the present application, the preset maximum number of iterations can be preset in advance or defaulted.
[0135] In a specific embodiment, the second maximum number of iterations may be determined based on the first adjustment factor, the second adjustment factor, and the reference number of iterations, as follows:
[0136] First reference iteration number = reference iteration number × (1 + first adjustment factor) × (1 + second adjustment factor);
[0137] According to the above formula, the first reference number of iterations can be obtained. Then, it can be determined whether the first reference number of iterations is an integer. If it is an integer, the first reference number of iterations is used as the second maximum number of iterations. If it is not an integer, the first reference number of iterations is rounded up to obtain the second maximum number of iterations. For example, assuming that the first reference number of iterations is 8.5, it is rounded up to 9, that is, the second maximum number of iterations is equal to 9.
[0138] When the second maximum number of iterations is less than the preset maximum number of iterations, the second maximum number of iterations may be directly used as the first maximum number of iterations.
[0139] When the second maximum number of iterations is not less than the preset maximum number of iterations, the deviation between the second maximum number of iterations and the preset maximum number of iterations may be determined. The specific calculation formula is as follows:
[0140] Target deviation = (second maximum number of iterations - preset maximum number of iterations) / preset maximum number of iterations × 100%;
[0141] According to the above formula, the target deviation can be obtained; then, the target attenuation factor corresponding to the target deviation can be determined. Specifically, a mapping relationship between a preset deviation and an attenuation factor can be pre-stored, and the target attenuation factor corresponding to the target deviation can be determined based on the mapping relationship, wherein the target attenuation factor can range from -0.3 to 0; finally, the second maximum number of iterations can be adjusted according to the target attenuation factor, as follows:
[0142] Reference first maximum number of iterations = second maximum number of iterations × (1 + target attenuation factor);
[0143] According to the above formula, the reference first maximum number of iterations can be obtained. Then, it can be determined whether the reference first maximum number of iterations is an integer. If it is an integer, the reference first maximum number of iterations is used as the first maximum number of iterations. If it is not an integer, the reference first maximum number of iterations is rounded up to obtain the first maximum number of iterations.
[0144] In this way, when the second maximum number of iterations exceeds the preset maximum number of iterations, the "excessive degree" of the number of iterations is converted into a measurable numerical indicator by calculating the target deviation, so that the adjustment strategy has a clear logical basis. The higher the target deviation, the greater the target attenuation factor, forcing the algorithm to converge to the suboptimal solution within a limited number of iterations rather than failing directly due to resource exhaustion, thereby improving resource utilization.
[0145] S304 , training the preset classification models based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters, and the three feature subsets to obtain three target classification models.
[0146] Optionally, step S304, training the preset classification models based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters, and the three feature subsets to obtain three target classification models, may include the following steps:
[0147] S41, obtaining a second type of data set, and a target optimal DWT decomposition parameter and a target feature subset corresponding to the second type of data set; the second type of data set is any one of the three types of data sets;
[0148] S42, determining the target model control parameters corresponding to the target feature subset;
[0149] S43, performing DWT decomposition on the data in the second type of data set based on the target optimal DWT decomposition parameter to obtain target decomposition data;
[0150] S44, performing feature extraction on the target decomposition data based on the target feature subset to obtain target feature data;
[0151] S45, adjusting the model control parameters of the preset classification model to the target model control parameters to obtain a first classification model;
[0152] S46. Training the first classification model using the target feature data to obtain a second classification model;
[0153] S47. Input the test data set into the second classification model to obtain a first test result, and determine a first accuracy rate based on the first test result;
[0154] S48. When the first accuracy rate is greater than a preset accuracy rate, determining a target classification model corresponding to the second type of data set according to the second classification model;
[0155] S49. When the first accuracy rate is not greater than the preset accuracy rate, new feature data is obtained, and the second classification model is continued to be trained using the new feature data until the accuracy rate of the second classification model is greater than the preset accuracy rate, and the target classification model corresponding to the second type of data set is determined based on the second classification model.
[0156] In an embodiment of the present application, the preset accuracy rate can be preset or defaulted in advance; the target model control parameters may include at least one of the following: input layer dimension, number of hidden layers, learning rate, batch size, etc., which are not limited here.
[0157] In a specific embodiment, the second type of data set, as well as the target optimal DWT decomposition parameters and target feature subset corresponding to the second type of data set can be obtained first; then, the target model control parameters corresponding to the target feature subset can be determined. Specifically, the target model control parameters can be the input layer dimension, and the input layer dimension can be equal to the number of features of the target feature subset. For example, if the number of features of the target feature subset is 4, the input layer dimension is also 4.
[0158] Next, the data in the second type of data set can be decomposed by DWT based on the target optimal DWT decomposition parameters to obtain target decomposition data. For example, assuming that the target optimal DWT decomposition parameters are: wavelet function sym4, the number of decomposition layers is equal to 6, and detail components are extracted, then the wavelet function sym4 can be used to decompose the data in the second type of data set into 6 layers, and the detail components of each layer are retained, thereby obtaining the target decomposition data; then, feature extraction can be performed on the target decomposition data based on the target feature subset to obtain target feature data. For example, assuming that the target feature subset is: root mean square value and energy entropy, the root mean square value and energy entropy in the target decomposition data can be extracted to obtain target feature data.
[0159] Then, the model control parameters of the preset classification model can be adjusted to the target model control parameters to obtain a first classification model; then, the first classification model can be trained using the target feature data to obtain a second classification model; further, the test data set can be input into the second classification model to obtain a first test result, and then, the first accuracy rate can be determined based on the first test result. Specifically, the number of correct tests in the first test result can be determined first to obtain a first number, and then, the total number of the first test results can be determined, and the first accuracy rate can be obtained by dividing the first number by the total number; when the first accuracy rate is greater than the preset accuracy rate, the second classification model can be directly determined as the target classification model corresponding to the second type of data set.
[0160] When the first accuracy is not greater than the preset accuracy, new feature data can be obtained, and the second classification model can be further trained using the new feature data until the accuracy of the second classification model is greater than the preset accuracy, and then the second classification model is determined as the target classification model corresponding to the second type of data set.
[0161] For example, the preset classification model belongs to the ANN classification model. Its structure is a single hidden layer multi-layer perceptron. Its network structure and training parameter configuration are as follows:
[0162] Input layer dimension: This is determined by the number of features extracted after wavelet transform of the load type. For example, assuming the model corresponds to a rectifier load type, the number of features is 4, and the input feature vector includes: {root mean square, kurtosis, short-term energy, spectral entropy};
[0163] Number of hidden layers: 1;
[0164] Number of hidden layer nodes: 10 neurons;
[0165] Activation function: ReLU function, used to improve nonlinear modeling capabilities;
[0166] Output layer structure: 1 node, using sigmoid activation function, outputs a probability value between 0 and 1, indicating the possibility of arc existence;
[0167] Loss function: Binary Cross-Entropy is used as the loss function, which is suitable for binary classification tasks;
[0168] Optimization algorithm: Use the Adam optimizer to adaptively adjust the learning rate to improve the training convergence speed;
[0169] Initial learning rate: 0.001;
[0170] Batch size: 32;
[0171] Number of training rounds: 100 rounds;
[0172] Data partitioning strategy: Use 80% training set and 20% validation set to ensure the model has generalization ability.
[0173] During training, the model continuously updates its weight parameters using a backpropagation algorithm to minimize the error between the predicted results and the true labels. After training, the model can classify the input feature vectors in real time and output a judgment on whether an arc fault exists. Through training, the model is able to judge the input signal and output a binary classification result, for example, 0 indicates the absence of an arc fault and 1 indicates the presence of an arc fault.
[0174] In this way, the model parameter space is constrained in advance (such as limiting the input layer dimension and convolution kernel size) by targeting the optimal DWT decomposition parameters and feature subsets, avoiding the blindness of traditional grid search or random search. For example, if the feature subset has been determined to be a 32-dimensional DWT coefficient, the number of input layer neurons can be directly set to 32 without trying other dimensions, saving more than 90% of the invalid parameter combination verification time and improving the efficiency of model training.
[0175] S305 , obtaining data to be identified; the data to be identified is current data of power grid equipment in the target power system.
[0176] In the embodiment of the present application, the target power system may actively send the data to be identified to the electronic device, or the electronic device may read the data to be identified from a database of the target power system.
[0177] S306: Determine the target load type corresponding to the data to be identified.
[0178] In the embodiment of the present application, a preset classification algorithm can be used to process the data to be identified to obtain the target load type.
[0179] S307: Determine a target classification model corresponding to the target load type among the three target classification models to obtain a first target classification model.
[0180] In the embodiment of the present application, a target classification model corresponding to the target load type can be found among the three target classification models to obtain a first target classification model.
[0181] S308. Identify the data to be identified using the first target classification model to obtain a target fault detection result; the target fault detection result includes whether an arc fault exists or does not exist.
[0182] In the embodiment of the present application, the data to be identified is input into the first target classification model to obtain a target fault detection result.
[0183] For an example, see Figure 6 , Figure 6 This is a flow chart for identifying data to be identified provided by an embodiment of the present application, which is as follows:
[0184] 1. Start: The process starts.
[0185] 2. Obtain the data to be identified: Obtain the data to be analyzed and processed from the data source (i.e., the target power system). This is the starting data input for the entire process.
[0186] 3. Preprocess the data to be identified: Perform preprocessing operations on the original data to be identified, such as removing noise, filling missing values, and normalizing data, in order to improve the accuracy and reliability of subsequent analysis.
[0187] 4. Calculate the normalized fundamental wave content H: Calculate the normalized fundamental wave content H of the preprocessed data, which is a key indicator for determining the load type.
[0188] 5. Determine the load type:
[0189] If H > 0.996, the load type of the data to be identified is determined to be a rectifier load. A rectifier load will cause significant distortion of the current waveform, with a relatively high fundamental wave content.
[0190] If 0.996>H>0.985, the load type of the data to be identified is determined to be a resistive load type. The current and voltage of a resistive load are basically linearly related, and the fundamental wave content is in the middle range.
[0191] If H < 0.985, the load type of the data to be identified is determined to be a motor load. Due to its electromagnetic characteristics, motor loads will cause the current waveform to be distorted, and the fundamental wave content is relatively low.
[0192] 6. Select the target classification model:
[0193] When the load type is determined to be a rectifier load type, the data to be identified is input into the target classification model a (ie, the target classification model corresponding to the rectifier load type).
[0194] When the load type is determined to be a resistive load type, the data to be identified is input into the target classification model b (ie, the target classification model corresponding to the resistive load type).
[0195] When the load type is determined to be a motor load type, the data to be identified is input into the target classification model c (i.e., the target classification model corresponding to the motor load type). This is because different load types have different electrical characteristics and failure modes, so different classification models are needed for fault detection.
[0196] 7. Output target fault detection results: Analyze and process the data to be identified through the corresponding target classification model, and output the final fault detection results.
[0197] 8. End: The process ends.
[0198] It can be seen that the arc fault detection method with adaptive feature selection described in this application divides the training data into three types of data sets to avoid interference between data of different load types in the same feature space, thereby reducing the complexity of feature selection. Then, the preset classification models are trained respectively with these three types of data sets to obtain three target classification models, thereby converting the global generalization problem into multiple local precise classification problems. The training data of each model is purer and the feature space is more compact, thereby improving the model classification accuracy, that is, improving the accuracy of arc fault detection.
[0199] See also Figure 7 , Figure 7 This is a block diagram of the functional modules of an arc fault detection device 700 with adaptive feature selection provided in an embodiment of the present application. The arc fault detection device 700 with adaptive feature selection can be applied to an electronic device connected to a target power system. The arc fault detection device 700 with adaptive feature selection includes: an acquisition module 701, a model training module 702, and a fault detection module 703, wherein:
[0200] The acquisition module 701 is used to acquire a training data set and a test data set; the data in the training data set and the test data set are current data of the power grid equipment in the target power system;
[0201] The model training module 702 is used to classify the data in the training data set to obtain three types of data sets; optimize the DWT decomposition parameters of the three types of data sets using a preset PSO algorithm and perform feature selection to obtain three sets of optimal DWT decomposition parameters and three feature subsets; each type of data set corresponds to a set of optimal DWT decomposition parameters and a feature subset; and train the preset classification models based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters, and the three feature subsets to obtain three target classification models;
[0202] The fault detection module 703 is used to obtain data to be identified; the data to be identified is current data for the power grid equipment in the target power system; determine the target load type corresponding to the data to be identified; determine the target classification model corresponding to the target load type among the three target classification models to obtain a first target classification model; identify the data to be identified through the first target classification model to obtain a target fault detection result; the target fault detection result includes the presence or absence of an arc fault.
[0203] In a specific implementation, the arc fault detection device 700 with adaptive feature selection described in the embodiment of the present invention may also execute other implementations described in the arc fault detection method with adaptive feature selection provided in the above embodiment of the present invention, which will not be described in detail here.
[0204] See also Figure 8 , Figure 8 This is a structural diagram of an electronic device provided in an embodiment of the present application. The electronic device may include a processor, a memory, a communication interface and one or more programs. The processor, memory and communication interface may be interconnected through a bus; the above one or more programs are stored in the above memory and are configured to be executed by the above processor; in an embodiment of the present application, the above program includes enabling the electronic device to execute part or all of the steps of any method recorded in the above method embodiment.
[0205] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.
[0206] The present application also provides a computer program product comprising a non-transitory computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may comprise an electronic device.
[0207] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0208] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0209] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0210] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0211] The steps of the method or algorithm described in the embodiments of the present application can be implemented in hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (EEPROM), registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device or a management device. Of course, the processor and storage medium can also exist as discrete components in the terminal device or the management device.
[0212] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part through software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.
[0213] The aforementioned computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium accessible by a computer or a data storage device such as a server or data center that integrates one or more available media.
[0214] The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0215] The modules / units included in the various devices and products described in the above embodiments may be software modules / units, hardware modules / units, or partly software modules / units and partly hardware modules / units. For example, for various devices and products applied to or integrated into a chip, the modules / units included therein may all be implemented in the form of hardware such as circuits, or at least part of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated into a chip module, the modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module, or at least part of the modules / units may be It is implemented in the form of a software program, which runs on the processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal equipment, or at least some modules / units can be implemented in the form of a software program, which runs on the processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits.
[0216] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only a specific implementation method of the embodiments of the present application and is not intended to limit the scope of protection of the embodiments of the present application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the scope of protection of the embodiments of the present application.
Claims
1. An arc fault detection method with adaptive feature selection, characterized in that: Applied to electronic equipment, the electronic equipment is connected to a target power system, comprising: Acquire a training data set and a test data set; the data in the training data set and the test data set are current data of the power grid equipment in the target power system; Classify the data in the training data set to obtain three types of data sets; The preset PSO algorithm is used to optimize the DWT decomposition parameters and perform feature selection on the three types of data sets, obtaining three sets of optimal DWT decomposition parameters and three feature subsets; each type of data set corresponds to a set of optimal DWT decomposition parameters and a feature subset; Based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters and the three feature subsets, the preset classification models are trained respectively to obtain three target classification models; Acquire data to be identified; the data to be identified is current data of a power grid device in the target power system; Determining a target load type corresponding to the data to be identified; Determine a target classification model corresponding to the target load type among the three target classification models to obtain a first target classification model; Identify the data to be identified by using the first target classification model to obtain a target fault detection result; the target fault detection result includes whether an arc fault exists or does not exist; The preset PSO algorithm is a binary particle swarm optimization algorithm. The preset PSO algorithm is used to optimize the DWT decomposition parameters and perform feature selection on the three types of data sets to obtain three sets of optimal DWT decomposition parameters and three feature subsets, including: Obtain a first type of data set; the first type of data set is any one of the three types of data sets; Initialize the particle swarm and the initial position and initial velocity of each particle to obtain the first particle swarm; the position of each particle is composed of a DWT decomposition parameter code and a feature selection mask; Define the first fitness function; Iteratively update the first particle swarm and determine the optimal particle according to the first fitness function; determine the target DWT decomposition parameter code and the target feature selection mask corresponding to the optimal particle; determine the optimal DWT decomposition parameter corresponding to the first type of data set according to the target DWT decomposition parameter code, and determine the feature subset corresponding to the first type of data set according to the target feature selection mask.
2. The method according to claim 1, wherein The training data set includes n data, where n is an integer greater than 3; the data in the training data set are classified to obtain three types of data sets, including: Performing Fourier transform on the n data in the training data set to obtain n frequency domain data; Performing feature extraction based on the n frequency domain data to obtain n feature data; each feature data includes at least one of the following: fundamental wave, harmonic amplitude ratio, total harmonic distortion rate, and energy distribution characteristics; The n characteristic data are processed using a preset classification algorithm to determine a load type corresponding to each of the n data, thereby obtaining n load types; each load type includes one of the following: a rectifier load type, a resistive load type, and a motor load type; The three types of data sets are determined according to the n load types and the n data.
3. The method according to claim 1, wherein The iterative updating of the first particle swarm and determining the optimal particle according to the first fitness function includes: The particles in the first particle group are updated according to a preset update formula to obtain a second particle group; the second particle group includes m particles; m is an integer greater than 1; Determining a target number of iterations corresponding to the second particle swarm; Calculating the fitness values corresponding to the m particles according to the first fitness function to obtain m fitness values; Determine the optimal fitness value among the m fitness values, and record the optimal fitness value as the global optimal fitness value; When the global optimal fitness value satisfies a preset convergence condition, or the target number of iterations is greater than a first maximum number of iterations, determining the particle corresponding to the global optimal fitness value as the optimal particle; When the global optimal fitness value does not satisfy the preset convergence condition and the target number of iterations is not greater than the first maximum number of iterations, the second particle swarm is continuously iterated and updated until the optimal particle is determined.
4. The method according to claim 3, wherein The method further comprises: Obtain historical operation data of the preset PSO algorithm for DWT decomposition parameters; Determine the number of iterations and the global optimal fitness value of each operation of the preset PSO algorithm to convergence in the historical operation data, and obtain i number of iterations and i global optimal fitness values; i is an integer greater than 1; Draw a target convergence curve according to the i number of iterations and the i global optimal fitness values; the abscissa of the target convergence curve is the fitness value, and the ordinate is the number of iterations; Determine the number of iterations corresponding to the preset fitness value in the target convergence curve to obtain a reference number of iterations; Obtaining a first data volume and a first load type corresponding to the first type of data set; determining a first adjustment factor corresponding to the first data amount; determining a second adjustment factor corresponding to the first load type; The first maximum number of iterations is determined according to the first adjustment factor, the second adjustment factor, and the reference number of iterations.
5. The method according to claim 4, wherein The determining the first maximum number of iterations according to the first adjustment factor, the second adjustment factor, and the reference number of iterations includes: determining a second maximum number of iterations according to the first adjustment factor, the second adjustment factor, and the reference number of iterations; When the second maximum number of iterations is less than a preset maximum number of iterations, determining the first maximum number of iterations according to the second maximum number of iterations; When the second maximum number of iterations is not less than the preset maximum number of iterations, determine the deviation between the second maximum number of iterations and the preset maximum number of iterations to obtain the target deviation; determine the target attenuation factor corresponding to the target deviation; adjust the second maximum number of iterations according to the target attenuation factor to obtain the first maximum number of iterations.
6. The method according to claim 1 or 2, wherein: The preset classification models are trained based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters and the three feature subsets to obtain three target classification models, including: Obtain a second type of data set, and a target optimal DWT decomposition parameter and a target feature subset corresponding to the second type of data set; the second type of data set is any one of the three types of data sets; Determining target model control parameters corresponding to the target feature subset; Performing DWT decomposition on the data in the second type of data set based on the target optimal DWT decomposition parameter to obtain target decomposition data; Performing feature extraction on the target decomposition data based on the target feature subset to obtain target feature data; Adjusting the model control parameters of the preset classification model to the target model control parameters to obtain a first classification model; Training the first classification model using the target feature data to obtain a second classification model; Inputting the test data set into the second classification model to obtain a first test result, and determining a first accuracy rate according to the first test result; When the first accuracy rate is greater than a preset accuracy rate, determining a target classification model corresponding to the second type of data set according to the second classification model; When the first accuracy is not greater than the preset accuracy, new feature data is obtained, and the second classification model is continued to be trained using the new feature data until the accuracy of the second classification model is greater than the preset accuracy, and the target classification model corresponding to the second type of data set is determined based on the second classification model.
7. An arc fault detection device with adaptive feature selection, characterized in that: Applied to electronic equipment, the electronic equipment is connected to a target power system, the device comprises: an acquisition module, a model training module, and a fault detection module, wherein: The acquisition module is used to acquire a training data set and a test data set; the data in the training data set and the test data set are current data of the power grid equipment in the target power system; The model training module is used to classify the data in the training data set to obtain three types of data sets; optimize the DWT decomposition parameters of the three types of data sets using a preset PSO algorithm and perform feature selection to obtain three sets of optimal DWT decomposition parameters and three feature subsets; each type of data set corresponds to a set of optimal DWT decomposition parameters and a feature subset; and train the preset classification models based on the test data set, the three types of data sets, the three sets of optimal DWT decomposition parameters, and the three feature subsets to obtain three target classification models; The fault detection module is configured to obtain data to be identified; the data to be identified is current data of a power grid device in the target power system; determine a target load type corresponding to the data to be identified; determine a target classification model corresponding to the target load type among the three target classification models to obtain a first target classification model; identify the data to be identified using the first target classification model to obtain a target fault detection result; the target fault detection result includes whether an arc fault exists or does not exist; The preset PSO algorithm is a binary particle swarm optimization algorithm. In the aspect of using the preset PSO algorithm to optimize the DWT decomposition parameters and perform feature selection on the three types of data sets to obtain three sets of optimal DWT decomposition parameters and three feature subsets, the model training module is specifically used to: Obtain a first type of data set; the first type of data set is any one of the three types of data sets; Initialize the particle swarm and the initial position and initial velocity of each particle to obtain the first particle swarm; the position of each particle is composed of a DWT decomposition parameter code and a feature selection mask; Define the first fitness function; Iteratively update the first particle swarm and determine the optimal particle according to the first fitness function; determine the target DWT decomposition parameter code and the target feature selection mask corresponding to the optimal particle; determine the optimal DWT decomposition parameter corresponding to the first type of data set according to the target DWT decomposition parameter code, and determine the feature subset corresponding to the first type of data set according to the target feature selection mask.
8. An electronic device, characterized in that: include: a processor, a memory, a communication interface, and one or more programs; The one or more programs are stored in the memory and configured to be executed by the processor, wherein the programs include instructions for executing the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Arc fault identification method, device and equipment
CN116451080A
Fault classification method and device for arc current signal, and storage medium
CN119128702A