Arc fault detection method based on adaptive feature selection and related device
Through adaptive feature selection and particle swarm optimization algorithm to optimize the decomposition parameters and feature selection of discrete wavelet transform, the problem of low accuracy in low-voltage series arc fault detection is solved, and higher arc fault detection accuracy is achieved.
Patent Information
- Application Number
- CN202510897636.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-01
AI Technical Summary
In low-voltage series arc fault detection, it is difficult for the prior art to determine the optimal wavelet parameters, resulting in low accuracy of arc fault detection and ineffectively distinguishing the arc fault state from normal operation state.
Adaptive feature selection method is adopted, and the decomposition parameters and feature selection of discrete wavelet transform are optimized through particle swarm optimization algorithm. Classification models are trained into three types of data sets, which improves the accuracy of arc fault detection.
By transforming global generalization problems into multiple local precise classification problems, the complexity of feature selection is reduced and the accuracy of arc fault detection is improved.
Smart Images

Figure CN120408205A_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: 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 the target classification model corresponding to the target load type among the three target classification models to obtain the first target classification model; Identify the data to be recognized through the first target classification model to obtain a target fault detection result; the target fault detection result includes the existence or non-existence of an arc fault.
[0006] In a second aspect, an arc fault detection device with adaptive feature selection provided by an embodiment of the present application is applied to an electronic device, and the electronic device is connected to a target power system. The device includes: an acquisition module, a model training module, and a fault detection module, where: The acquisition module is configured to acquire a training data set and a test data set; the data in the training data set and the test data set are both current data of grid devices in the target power system; The model training module is configured to classify the data in the training data set to obtain three types of data sets; optimize the DWT decomposition parameters for 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; train a preset classification model 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 respectively to obtain three target classification models; The fault detection module is configured to acquire data to be recognized; the data to be recognized is current data of grid devices in the target power system; determine the target load type corresponding to the data to be recognized; determine the target classification model corresponding to the target load type among the three target classification models to obtain the first target classification model; identify the data to be recognized through the first target classification model to obtain a target fault detection result; the target fault detection result includes the existence or non-existence of an arc fault.
[0007] In a third aspect, an electronic device provided by an embodiment of the present application includes: a processor, a memory, a communication interface, and one or more programs. Among them, the above one or more programs are stored in the above memory and are configured to be executed by the above processor. The above programs include instructions for performing the steps in the first aspect of the embodiment of the present application.
[0008] In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present application stores a computer program for electronic data exchange. Among them, the above 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.
[0009] Fifth aspect, an embodiment of the present application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application. The computer program product can be a software installation package.
[0010] Implementing the present application has the following beneficial effects: It can be seen that in the adaptive feature selection-based arc fault detection method described in the present application, by dividing the training data into three types of data sets, it is possible to avoid the interference of data of different load types in the same feature space, reduce the complexity of feature selection, and then train a preset classification model through these three types of data sets respectively to obtain three target classification models, transforming the global generalization problem into multiple local accurate classification problems. The training data of each model is purer and the feature space is more compact, thereby improving the classification accuracy of the model, that is, improving the accuracy of arc fault detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the following will describe the drawings required to be used in the embodiments of the present application or the background art.
[0012] Figure 1 is an application scenario diagram of an electronic device provided by an embodiment of the present application; Figure 2 is a schematic structural diagram of a target power system provided by an embodiment of the present application; Figure 3 is a flowchart of an adaptive feature selection-based arc fault detection method provided by an embodiment of the present application; Figure 4 is a flowchart of a data classification method provided by an embodiment of the present application; Figure 5 is a flowchart of a preset PSO algorithm provided by an embodiment of the present application; Figure 6 is a flowchart for identifying data to be identified provided by an embodiment of the present application; Figure 7 is a functional module composition block diagram of an adaptive feature selection-based arc fault detection device provided by an embodiment of the present application; Figure 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0013] To enable those skilled in the art to better understand the solution of this application, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of this application.
[0014] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0015] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. 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 article indicates that the associated objects before and after are in an "or" relationship. The "plurality" that appears in the embodiments of this application refers to two or more.
[0016] The "at least one (item)" or its similar expression in the embodiments of this application refers to any combination of these items, including any combination of single items (pieces) or plural items (pieces), which means one or more, and plural means two or more. For example, at least one (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.
[0017] The "connection" that appears in the embodiments of this application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and this application does not make any limitations on this.
[0018] Referring to "embodiments" in this article means that the specific features, structures, or characteristics described in combination with the embodiments can be included in at least one embodiment of this application. The appearance of this phrase in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0019] 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, handheld computers, laptop computers, video matrices, monitoring platforms, mobile internet devices (MID), or wearable devices, etc. The above are only examples, not an exhaustive list, including but not limited to the above devices.
[0020] Of course, the above electronic device may also be a server, for example, a cloud server.
[0021] The following explains the relevant content, concepts, meanings, technical problems, technical solutions, beneficial effects, etc. involved in the embodiments of the present application.
[0022] First, some professional terms involved in the present application are explained: Power system: It is an electric energy production and consumption system composed of links such as power generation, transmission, transformation, distribution, and power consumption. Its core is to achieve safe, reliable, and economic transmission and conversion of electric energy from production to use through a reasonable architecture and equipment.
[0023] Arc fault: In a power system, due to insulation damage or poor contact between conductors, a phenomenon where current forms a continuous discharge through an air gap; the high temperature generated by the arc (up to over 3000 degrees Celsius) may ignite surrounding combustibles, which is the main cause of electrical fires; at the same time, it will interfere with the normal operation of power equipment and generate electromagnetic interference.
[0024] Particle Swarm Optimization (PSO) algorithm: A meta-heuristic optimization algorithm inspired by the foraging behavior of bird flocks, which finds the optimal solution by simulating the group cooperation of particles in the search space. Each particle represents a potential solution, represented by position (decision variable) and velocity (moving direction); particles update velocity and position according to their own historical optimal position (individual experience) and global optimal position (group experience); during the iteration process, it gradually converges to the global optimal or approximate optimal solution.
[0025] Discrete Wavelet Transform (DWT): A time-frequency analysis tool that decomposes a signal into sub-signals (wavelet coefficients) of different scales and frequencies, suitable for non-stationary signal processing. The DWT decomposition parameters include wavelet basis functions (such as db1, db2, sym3, sym4, etc.), decomposition levels, etc. Among them, the wavelet basis function determines the time-frequency characteristics of the DWT decomposition; the more decomposition levels, the finer the frequency band division.
[0026] Adaptive Feature Selection: Automatically selects the most discriminative feature subset according to the data characteristics, avoiding the "curse of dimensionality" and interference from redundant features; 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) with the optimization goal of improving model performance (such as classification accuracy).
[0027] SCADA Module (Supervisory Control And Data Acquisition): A distributed monitoring system based on computer technology, communication technology, and control technology, used for data acquisition, real-time monitoring, fault warning, parameter adjustment, etc. of remote devices or production processes. It is widely used in fields such as power, oil and gas, water treatment, manufacturing, etc., and is one of the core components of industrial automation.
[0028] Artificial Neural Network (ANN) Classification Model: A computational model that simulates the structure and function of the biological nervous system, consisting of a large number of artificial neurons (nodes) interconnected to form a network, and realizes the classification of input data through multi-layer information transmission and processing.
[0029] ReLU (Rectified Linear Unit): A commonly used activation function in neural networks, which can introduce non-linearity into the neural network model, enabling the model to learn complex patterns (without an activation function, a multi-layer network is equivalent to a single-layer linear model).
[0030] Sigmoid Activation Function: An activation function whose output value is mapped in the interval (0, 1), and is commonly used in the last layer of binary classification problems.
[0031] Binary Cross Entropy: A loss function that measures the difference between the prediction results of a binary classification model and the true labels, and the smaller its value, the more accurate the model prediction.
[0032] Adam Optimizer: One of the most commonly used optimization algorithms in deep learning, belonging to the first-order gradient optimization method (updating parameters based on gradient information); it combines the advantages of momentum and adaptive learning rate, can dynamically adjust the learning rate of each parameter, and realizes efficient model training.
[0033] Please refer to Figure 1 , Figure 1It is an application scenario diagram of an electronic device provided by 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 the 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 by the embodiment of the present application to identify the current data of the target power system and determine whether there is an arc fault in the current data of the target power system. The specific steps are as follows: Obtain a training data set and a test data set; the data in the training data set and the test data set are both current data of grid devices in the target power system; Classify the data in the training data set to obtain 3 data sets; Optimize the DWT decomposition parameters for the 3 data sets using a preset PSO algorithm and perform feature selection to obtain 3 sets of optimal DWT decomposition parameters and 3 feature subsets; each data set corresponds to a set of optimal DWT decomposition parameters and a feature subset; Train a preset classification model based on the test data set, the 3 data sets, the 3 sets of optimal DWT decomposition parameters, and the 3 feature subsets respectively to obtain 3 target classification models; Obtain data to be recognized; the data to be recognized is the current data of grid devices in the target power system; Determine the target load type corresponding to the data to be recognized; Determine the target classification model corresponding to the target load type among the 3 target classification models to obtain a first target classification model; Recognize the data to be recognized through the first target classification model to obtain a target fault detection result; the target fault detection result includes the existence or non-existence of an arc fault.
[0034] It should be noted that the above electronic device can execute some or all of the steps of the arc fault detection method with adaptive feature selection provided by the embodiment of the present application.
[0035] Please refer to Figure 2 , Figure 2 It is a schematic structural diagram of a target power system provided by 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 herein; among them: The controller may include a SCADA module. The controller can collect power system parameters (such as voltage, current, and frequency) through the SCADA module, and output control signals after algorithm processing to adjust the operating state of the device (such as start / stop, power adjustment). Inside the controller, there is usually a switching power supply (such as a DC / DC converter, MCU power supply module), and it is necessary to convert the input alternating current into direct current through rectifying elements, which belongs to the rectifying load type.
[0036] The SCADA module is used to collect various power grid operation data in real time or regularly, including voltage and current data, power data, power generation and consumption data, transaction data, etc. For example, through sensors installed at substations, power plants, and user terminals, the SCADA module can obtain the real-time values of voltage and current at each node in the target power system, as well as information such as the power generation power of power generation equipment and the power consumption power of users. These data are the basis for constructing the classification model.
[0037] The fan is driven by an electric motor to rotate the fan blades to achieve ventilation, heat dissipation, or gas transportation (such as the cooling fan in a data center, the heat dissipation fan of a wind turbine); the core of the fan is an asynchronous motor or a permanent magnet synchronous motor. When working, the current lags behind the voltage, and it is necessary to consume reactive power. There is an impact current during startup, which belongs to a typical inductive load (that is, the motor load type).
[0038] The lighting device converts electrical energy into light energy for indoor and outdoor lighting (such as LED lights, fluorescent lights, high-pressure sodium lamps). The load types of different lighting devices are also different. For example, LED lights or fluorescent lights contain an electronic ballast or a drive power supply inside and work through rectification and inversion links, belonging to the rectifying load type; for another example, incandescent lamps or halogen lamps emit light by heating the resistance wire, and the current is in phase with the voltage, belonging to the resistive load type.
[0039] The charging pile transmits the electrical energy of the power grid to the battery of the electric vehicle, which is divided into an AC charging pile and a DC charging pile. Among them, the DC charging pile converts alternating current into direct current through a high-power rectifier inside, belonging to a high-power rectifying load type, with obvious harmonic pollution, and a filtering device needs to be configured; the AC charging pile only provides alternating current, and the on-board charger of the electric vehicle completes the rectification. Therefore, the charging pile body belongs to the resistive load type.
[0040] Please refer to Figure 3 , Figure 3 which is a flowchart of an adaptive feature selection arc fault detection method provided by an embodiment of the present application; this method is applied to an electronic device, and the electronic device is connected to a target power system (hereinafter referred to as the system), including but not limited to the following steps: S301. Obtain a training data set and a test data set; the data in both the training data set and the test data set are current data of grid equipment in the target power system.
[0041] In the embodiments of the present application, the structure of the target power system may be as Figure 2 shown, including a SCADA module.
[0042] 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 relatively high 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 and transaction power of power generation equipment, a relatively low collection frequency can be set, such as once per hour. Data collection is performed through devices such as voltage sensors, current sensors, and monitoring systems of generators installed at substations, power grid lines, etc. to obtain system operation data. Since the electronic device is physically or communicatively connected to the system, the system can then transmit the system operation data to the electronic device. The electronic device extracts the current data from the system operation data to obtain 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 the data in the target current data can be sorted by timestamp (such as from earliest to latest collection time), and then a division point is set (such as at the 80% mark of the total data volume). The first 80% of the data is used as the training set, and the last 20% of the data is used as the test set.
[0043] S302. Classify the data in the training data set to obtain three types of data sets.
[0044] In the embodiments of the present application, classification can be performed according to the data characteristics in the training data set, and data with the same data characteristics are grouped into the same class, thereby obtaining three types of data sets.
[0045] Optionally, the training data set includes n data, where n is an integer greater than 3; please refer to Figure 4 , Figure 4 which is a flowchart of a data classification method provided by the embodiments of the present application. It can be seen that in step S302, the step of classifying the data in the training data set to obtain three types of data sets may include the steps as Figure 4 shown: S21. Perform Fourier transform on the n data in the training data set to obtain n frequency-domain data; S22. Extract features from 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, energy distribution characteristics; S23. Process the n feature data using a preset classification algorithm to determine the load type corresponding to each of the n data, obtaining n load types; each load type includes one of the following: rectifier load type, resistive load type, motor load type; S24. Determine the three types of data sets based on the n load types and the n data.
[0046] In the embodiments of the present application, the preset classification algorithm can be preset in advance or by default.
[0047] In a specific embodiment, Fourier transform can be performed on each of the above n data to obtain n frequency-domain data; then, features can be extracted from the n frequency-domain data to obtain n feature data. Taking the first frequency-domain data as an example, if the feature data includes the fundamental wave, the main frequency component (such as industrial frequency 50Hz or 60Hz) of the first frequency-domain data can be extracted to obtain the first main frequency component (i.e., the fundamental wave of the first frequency-domain data). If the feature data includes the harmonic amplitude ratio, the amplitudes of each harmonic in the first frequency-domain data can be calculated to obtain at least one amplitude. Then, at least one amplitude can be divided by the fundamental wave amplitude to obtain at least one harmonic amplitude ratio. Furthermore, the feature data corresponding to the first frequency-domain data can be obtained.
[0048] Next, the n feature data can be processed using a preset classification algorithm to determine the load type corresponding to each of the n data, obtaining n load types. Specifically, the preset classification algorithm can be one of the following: support vector machine, K-means clustering method, etc., which is not limited herein. For example, assuming 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 feature values of each cluster can be calculated. Combining their physical meanings, the load type corresponding to each cluster can be determined, thereby determining the n load types corresponding to the n data. For example, if the centroid of a certain cluster is power factor PF = 0.95 and total harmonic distortion rate THD = 2%, it can be determined that the load type corresponding to this cluster is the motor load type.
[0049] Finally, the three types of data sets are determined based on the n load types and the n data. Specifically, the data with the same load type among the n data can be divided into the same category according to the n load types, thereby obtaining three types of data sets.
[0050] In this way, by extracting frequency-domain features such as the fundamental wave and harmonics, the system can automatically identify the load type without manual intervention, thereby improving the classification efficiency.
[0051] S303. Optimize the DWT decomposition parameters for 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.
[0052] In the embodiments of the present application, the preset PSO algorithm can be preset in advance or by default.
[0053] In a specific embodiment, the DWT decomposition parameters of the three types of data sets can be optimized respectively by the preset PSO algorithm, and feature selection is performed, so as to obtain three sets of optimal DWT decomposition parameters and three feature subsets.
[0054] It should be noted that these features do not directly come from the original signal, but are extracted secondarily based on the signal representation after DWT. For example, under a resistive load, using the 10th layer of detail components, the fundamental wave phase and the relative energy ratio of high-order harmonics are extracted to highlight the subtle spectral changes brought by arc disturbances.
[0055] For example, the three sets of optimal DWT decomposition parameters and the three feature subsets can be as shown in Table 1:
[0056] Optionally, the preset PSO algorithm is a binary particle swarm optimization algorithm. Please refer to Figure 5 , Figure 5 is a flowchart of a preset PSO algorithm provided by the embodiments of the present application. It can be seen that in step S303, the optimizing the DWT decomposition parameters for the three types of data sets using the preset PSO algorithm and performing feature selection to obtain three sets of optimal DWT decomposition parameters and three feature subsets may include the steps as Figure 5 shown: A1. Obtain the first type of data set; the first type of data set is any one of the three types of data sets; A2. Initialize the particle swarm and the initial positions and initial velocities of each particle to obtain the first particle swarm; the position of each particle is composed of a DWT decomposition parameter encoding and a feature selection mask; A3. Define the first fitness function; A4. Iteratively update the first particle swarm, and determine the optimal particle according to the first fitness function; determine the target DWT decomposition parameter encoding and the target feature selection mask corresponding to the optimal particle; determine the optimal DWT decomposition parameters corresponding to the first type of data set according to the target DWT decomposition parameter encoding, and determine the feature subset corresponding to the first type of data set according to the target feature selection mask.
[0057] In the embodiments of the present application, a first type of data set can be obtained; then, the particle swarm and the initial positions and initial velocities of each particle can be initialized to obtain a first particle swarm. Specifically, random initialization can be adopted to randomly generate the initial positions and initial velocities of each particle.
[0058] For example, for the first particle (any particle in the first particle swarm), assume that the first position corresponding to the first particle can be a binary number. Generally, there are 4 types of wavelet functions, which require 3 bits of binary to represent. The specific mapping relationship can be shown in Table 2:
[0059] In addition, the value range of the wavelet decomposition level is 1 to 10, which requires 4 bits of binary to represent (if it is also necessary to represent values greater than 10, the number of encoding bits corresponding to the wavelet decomposition level can be appropriately increased). There are two cases for the component types of wavelet decomposition, the approximation component and the detail component, which require 1 bit of binary to represent. Specifically, it can be that 0 represents the approximation component (A, the low-frequency part, reflecting the signal trend), and 1 represents the detail component (D, the high-frequency part, reflecting signal mutations or noise). The feature selection mask requires n bits of binary to represent. Each bit of these n bits of binary corresponds to a feature. 1 represents selecting the corresponding feature, and 0 represents excluding the corresponding feature. Among them, n is the total number of features corresponding to the first type of data set. For example, assume that there are 8 features (root mean square value, energy entropy, kurtosis, skewness, local variance, zero crossing rate, maximum wavelet coefficient, energy ratio of decomposition layer). Then the mask: 10101100 represents selecting the 1st, 3rd, 5th, and 6th features (root mean square value, kurtosis, local variance, zero crossing rate). Therefore, the total number of bits of the first position is 3 + 4 + 1 + n.
[0060] Next, 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. Next, 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 encoding and the target feature selection mask can be determined according to the optimal position. According to the target DWT decomposition parameter encoding, the optimal DWT decomposition parameters corresponding to the first type of data set can be determined, and according to the target feature selection mask, the feature subset corresponding to the first type of data set can be determined. 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 the optimal position is "1000110111010", where the first 8 bits "10001101" represent the target DWT decomposition parameter encoding, and the corresponding optimal DWT decomposition parameters are: wavelet function sym4, decomposition level equal to 6, and extracting detail components; the last 5 bits "11010" represent the target feature selection mask, and the corresponding feature subset is: root mean square value, energy entropy, and skewness.
[0061] In this way, by integrating two key links of feature engineering (feature generation and feature selection) into a unified optimization problem, the global optimal balance of data characteristics, computational efficiency, and model performance is achieved through the preset PSO algorithm. Compared with the traditional empirical mode of step-by-step parameter tuning, the embodiment of the present application breaks the independent optimization barrier between decomposition parameters and feature selection, utilizes the coupling between the two to improve the overall efficiency, explores the optimal combination of "decomposition parameters - feature subset" globally, and avoids suboptimal solutions caused by mutual constraints between parameters.
[0062] Optionally, in step A4, the iteratively updating the first particle swarm and determining the optimal particle according to the first fitness function may include the following steps: B1. Update the particles in the first particle swarm according to a preset update formula to obtain a second particle swarm; the second particle swarm includes m particles; m is an integer greater than 1; B2. Determine the target iteration number corresponding to the second particle swarm; B3. Calculate the fitness values corresponding to the m particles according to the first fitness function to obtain m fitness values; B4. Determine the optimal fitness value among the m fitness values, and record this optimal fitness value as the global optimal fitness value; B5. When the global optimal fitness value satisfies a preset convergence condition, or when the target iteration number is greater than the first maximum iteration number, determine the particle corresponding to the global optimal fitness value as the optimal particle; B6. When the global optimal fitness value does not meet the preset convergence condition and the target iteration number is not greater than the first maximum iteration number, continue to iteratively update the second particle swarm until the optimal particle is determined.
[0063] In the embodiments of the present application, the preset update formula and the preset convergence condition can both be preset in advance or by default.
[0064] In a specific embodiment, the particles in the first particle swarm can be updated according to the 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 elaborated here; then, the target iteration number corresponding to the second particle swarm can be determined. Specifically, when the preset PSO algorithm runs for the first time, a variable j = 0 can be defined. Whenever the particle swarm is updated once, the value of the variable j is incremented by 1. The variable j corresponding to the second particle swarm can be obtained, and the target iteration number can be determined according to the value of the variable j.
[0065] 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 the feature subsets corresponding to each of the m particles to obtain m first feature data. The m first feature data are respectively used to train the preset classification model to obtain m trained preset classification models, and the accuracy rates of the m trained preset classification models are determined to obtain m accuracy rates, that is, m fitness values.
[0066] Then, the maximum value among the m fitness values, that is, the optimal fitness value, can be determined. Then, this optimal fitness value can be recorded as the global optimal fitness value; when the global optimal fitness value meets the preset convergence condition, or when the target iteration number is greater than the first maximum iteration number, the particle corresponding to the global optimal fitness value is determined as the optimal particle.
[0067] When the global optimal fitness value does not meet the preset convergence condition and the target iteration number is not greater than the first maximum iteration number, continue to iteratively update the second particle swarm until the optimal particle is determined.
[0068] It should be explained that the preset convergence condition can be that the global optimal fitness value no longer significantly improves in consecutive multiple iterations.
[0069] In this way, the performance of the particles is quantified by the first fitness function (such as classification accuracy), and the optimization goal is transformed into computable numerical feedback. In each round of iteration, the particles update their positions and velocities according to the historical optimal solution (personal extreme value) and the global optimal solution (group extreme value), forming a closed loop of "evaluation → update → re-evaluation" to ensure that the search direction always converges to the high-performance area, thereby obtaining the optimal particle.
[0070] Optionally, the method further includes: C1. Obtain the historical operation data of the preset PSO algorithm for DWT decomposition parameters; C2. Determine the number of iterations and the global optimal fitness value when the preset PSO algorithm converges each time in the historical operation data, and obtain i numbers of iterations and i global optimal fitness values; i is an integer greater than 1; C3. Draw a target convergence curve according to the i numbers 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; C4. Determine the number of iterations corresponding to the preset fitness value in the target convergence curve to obtain a reference number of iterations; C5. Obtain the first data volume and the first load type corresponding to the first type of data set; C6. Determine the first adjustment factor corresponding to the first data volume; C7. Determine the second adjustment factor corresponding to the first load type; C8. Determine the first maximum number of iterations according to the first adjustment factor, the second adjustment factor, and the reference number of iterations.
[0071] In the embodiments of the present application, the preset fitness value can be preset in advance or by default.
[0072] In a specific embodiment, the historical operation data of the preset PSO algorithm for DWT decomposition parameters can be obtained first. Specifically, all the operation data of the preset PSO algorithm can be obtained from the database of the electronic device, and then the data used to determine the optimal DWT decomposition parameters can be extracted from these operation data to obtain the historical operation data; then, the number of iterations and the global optimal fitness value when the preset PSO algorithm converges each time in the historical operation data can be recorded, so as to obtain i numbers of iterations and i global optimal fitness values.
[0073] Then, a target convergence curve can be drawn according to the i numbers of iterations and the i global optimal fitness values. Specifically, the corresponding global optimal fitness values in the i numbers of iterations and the i global optimal fitness values can be combined into coordinate points first to obtain multiple coordinate points, and then a curve fitting method (for example, polynomial fitting method, spline method, etc.) can be used to fit these multiple coordinate points to obtain the 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.
[0074] Further, the first load type corresponding to the first type of data set can be determined first. Then, the first type of data set can be traversed. For each piece of data traversed, its data volume is incremented by 1 until the traversal is completed to obtain the first data volume. Next, the first adjustment factor corresponding to the first data volume can be determined. For example, a mapping relationship between the preset data volume and the adjustment factor can be pre-stored, and the first adjustment factor corresponding to the first data volume can be determined based on this mapping relationship. Then, the second adjustment factor corresponding to the first load type can be determined. Similarly, a mapping relationship between the preset load type and the adjustment factor can be pre-stored, and the second adjustment factor corresponding to the first load type can be determined based on this mapping relationship. Herein, the value ranges of both the first adjustment factor and the second adjustment factor can be -0.5 to 0.5. Finally, the reference iteration count can be adjusted according to the first adjustment factor and the second adjustment factor to obtain the first maximum iteration count.
[0075] In this way, by analyzing the historical operation data of the preset PSO algorithm in the DWT decomposition parameter optimization task, extracting the iteration count and the global optimal fitness value for each run until convergence, the inherent law of the algorithm can be explored, revealing how many iterations the algorithm generally needs to reach a stable convergence state in similar problems, avoiding blindly setting a fixed iteration upper limit. Thus, the algorithm can quickly locate a reasonable iteration range in similar problems and reduce waste of computing resources.
[0076] Optionally, in step C8, the determining the first maximum iteration count according to the first adjustment factor, the second adjustment factor, and the reference iteration count may include the following steps: D1. Determine a second maximum iteration count according to the first adjustment factor, the second adjustment factor, and the reference iteration count; D2. When the second maximum iteration count is less than the preset maximum iteration count, determine the first maximum iteration count according to the second maximum iteration count; D3. When the second maximum iteration count is not less than the preset maximum iteration count, determine the deviation degree between the second maximum iteration count and the preset maximum iteration count to obtain a target deviation degree; determine a target attenuation factor corresponding to the target deviation degree; adjust the second maximum iteration count according to the target attenuation factor to obtain the first maximum iteration count.
[0077] In the embodiments of the present application, the preset maximum iteration count can be preset in advance or by default.
[0078] In a specific embodiment, the second maximum iteration count can be determined first according to the first adjustment factor, the second adjustment factor, and the reference iteration count, as follows: First reference iteration count = reference iteration count × (1 + first adjustment factor) × (1 + second adjustment factor); According to the above formula, the first reference iteration count can be obtained. Next, it can be determined whether the first reference iteration count is an integer. If it is an integer, the first reference iteration count is used as the second maximum iteration count. If it is not an integer, the first reference iteration count is rounded up to obtain the second maximum iteration count. For example, assume the first reference iteration count is 8.5, then rounding it up gives 9, that is, the second maximum iteration count is equal to 9.
[0079] When the second maximum iteration count is less than the preset maximum iteration count, the second maximum iteration count can be directly used as the first maximum iteration count.
[0080] When the second maximum iteration count is not less than the preset maximum iteration count, the deviation degree between the second maximum iteration count and the preset maximum iteration count can be determined. The specific calculation formula is as follows: Target deviation degree = (Second maximum iteration count - Preset maximum iteration count) / Preset maximum iteration count × 100%; According to the above formula, the target deviation degree can be obtained. Next, the target decay factor corresponding to the target deviation degree can be determined. Specifically, a mapping relationship between the preset deviation degree and the decay factor can be stored in advance, and the target decay factor corresponding to the target deviation degree is determined based on this mapping relationship. Among them, the value range of the target decay factor can be -0.3 to 0. Finally, the second maximum iteration count can be adjusted according to the target decay factor, as follows: Reference first maximum iteration count = Second maximum iteration count × (1 + Target decay factor); According to the above formula, the reference first maximum iteration count can be obtained. Next, it can be determined whether the reference first maximum iteration count is an integer. If it is an integer, the reference first maximum iteration count is used as the first maximum iteration count. If it is not an integer, the reference first maximum iteration count is rounded up to obtain the first maximum iteration count.
[0081] In this way, when the second maximum iteration count breaks through the preset maximum iteration count, by calculating the target deviation degree, the "exceeding degree" of the iteration count is converted into a measurable numerical index, making the adjustment strategy have a clear logical basis. The higher the target deviation degree, the greater the target decay factor, forcing the algorithm to preferentially converge to a sub-optimal solution within a limited number of iterations, rather than directly failing due to resource exhaustion. Thus, the resource utilization rate is improved.
[0082] S304. Based on the test data set, the 3-class data set, the 3 groups of optimal DWT decomposition parameters, and the 3 feature subsets, train the preset classification model respectively to obtain 3 target classification models.
[0083] Optionally, in step S304, training the preset classification model based on the test data set, the three types of data sets, the three groups of optimal DWT decomposition parameters, and the three feature subsets respectively to obtain three target classification models may include the following steps: S41. Obtain a second type of data set, as well as the corresponding target optimal DWT decomposition parameters and target feature subset of the second type of data set; the second type of data set is any one of the three types of data sets; S42. Determine the target model control parameters corresponding to the target feature subset; S43. Perform DWT decomposition on the data in the second type of data set based on the target optimal DWT decomposition parameters to obtain target decomposition data; S44. Extract features from the target decomposition data based on the target feature subset to obtain target feature data; S45. Adjust the model control parameters of the preset classification model to the target model control parameters to obtain a first classification model; S46. Train the first classification model with the target feature data to obtain a second classification model; S47. Input the test data set into the second classification model to obtain a first test result, and determine a first accuracy rate according to the first test result; S48. When the first accuracy rate is greater than the preset accuracy rate, determine the target classification model corresponding to the second type of data set according to the second classification model; S49. When the first accuracy rate is not greater than the preset accuracy rate, obtain new feature data, and continue to train the second classification model with the new feature data until the accuracy rate of the second classification model is greater than the preset accuracy rate, and determine the target classification model corresponding to the second type of data set according to the second classification model.
[0084] In the embodiment of the present application, the preset accuracy rate can be preset in advance or by default; 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 herein.
[0085] In a specific embodiment, a second type of data set, as well as the corresponding target optimal DWT decomposition parameters and target feature subset of 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 parameter 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.
[0086] Next, the data in the second type of dataset can be decomposed by DWT based on the target optimal DWT decomposition parameters to obtain the target decomposed data. For example, assuming that the target optimal DWT decomposition parameters are: wavelet function sym4, decomposition level equal to 6, and extracting detail components, then the data in the second type of dataset can be decomposed 6 times using the wavelet function sym4, and the detail components of each layer are retained, thereby obtaining the target decomposed data. Then, feature extraction can be performed on the target decomposed data based on the target feature subset to obtain the target feature data. For example, assuming that the target feature subset is: root mean square value, energy entropy, then the root mean square value and energy entropy in the target decomposed data can be extracted to obtain the target feature data.
[0087] Next, the model control parameters of the preset classification model can be adjusted to the target model control parameters to obtain the first classification model. Then, the first classification model can be trained using the target feature data to obtain the second classification model. Further, the test dataset can be input into the second classification model to obtain the first test result. Then, the first accuracy rate can be determined according to the first test result. Specifically, the number of correctly tested in the first test result can be determined first to obtain the first number. 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 dataset.
[0088] When the first accuracy rate is not greater than the preset accuracy rate, new feature data can be obtained, and the second classification model can be continuously trained using the new feature data until the accuracy rate of the second classification model is greater than the preset accuracy rate, and then the second classification model can be determined as the target classification model corresponding to the second type of dataset.
[0089] For example, the preset classification model belongs to the ANN classification model, and its structure is a single-hidden-layer multi-layer perceptron. Its network structure and training parameter configuration are as follows: Input layer dimension: determined according to the number of features extracted after wavelet transform for this type of load type. For example, assuming that this model corresponds to the rectifier load type and the number of features is 4, the input feature vector includes: {root mean square, kurtosis, short-term energy, spectral entropy}; Number of hidden layers: 1 layer; Number of hidden layer nodes: 10 neurons; Activation function: ReLU function, used to improve the non-linear modeling ability; Output layer structure: 1 node, using the sigmoid activation function, and outputting a probability value between 0 and 1, indicating the possibility of the existence of an arc; Loss function: Binary Cross-Entropy is used as the loss function, which is suitable for binary classification tasks; Optimization algorithm: The Adam optimizer is selected to adaptively adjust the learning rate and improve the training convergence speed; Initial learning rate: 0.001; Batch size: 32; Number of training epochs: 100 epochs; Data partitioning strategy: Use a partitioning method of 80% training set and 20% validation set to ensure the generalization ability of the model.
[0090] During the training process, the model continuously updates the weight parameters through the backpropagation algorithm to minimize the error between the prediction results and the true labels. After training, the model can classify the input feature vectors in real time and output the judgment result of whether there is an arc fault. Through training, the model can judge the input signal, and the output result is a binary classification. For example, 0 indicates that there is no arc fault, and 1 indicates that there is an arc fault.
[0091] In this way, by pre-constraining the model parameter space with the optimal DWT decomposition parameters and feature subsets of the target (such as limiting the input layer dimension and convolutional kernel size), the blindness of traditional grid search or random search is avoided. For example, if the feature subset is determined to be 32-dimensional DWT coefficients, the number of neurons in the input layer can be directly set to 32 without trying other dimensions, saving more than 90% of the verification time of invalid parameter combinations and improving the efficiency of model training.
[0092] S305. Obtain the data to be recognized; the data to be recognized is the current data of the grid equipment in the target power system.
[0093] In the embodiment of the present application, the target power system can actively send the data to be recognized to the electronic device, or the electronic device can read the data to be recognized from the database of the target power system.
[0094] S306. Determine the target load type corresponding to the data to be recognized.
[0095] In the embodiment of the present application, a preset classification algorithm can be used to process the data to be recognized to obtain the target load type.
[0096] S307. Determine the target classification model corresponding to the target load type among the 3 target classification models to obtain the first target classification model.
[0097] In the embodiment of the present application, the target classification model corresponding to the target load type among the 3 target classification models can be found to obtain the first target classification model.
[0098] S308. Identify the data to be recognized 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.
[0099] In the embodiments of the present application, by inputting the data to be recognized into the first target classification model, a target fault detection result can be obtained.
[0100] For example, please refer to Figure 6 , Figure 6 which is a flowchart for identifying data to be recognized provided by the embodiments of the present application, as follows: 1. Start: The process is initiated.
[0101] 2. Obtain data to be recognized: Obtain the data that needs to be analyzed and processed from the data source (i.e., the target power system), which is the initial data input for the entire process.
[0102] 3. Preprocess the data to be recognized: Perform preprocessing operations on the obtained original data to be recognized, such as removing noise, filling missing values, data normalization, etc., with the aim of improving the accuracy and reliability of subsequent analysis.
[0103] 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 judging the load type.
[0104] 5. Judge the load type: If H > 0.996, it is determined that the load type of the data to be recognized is a rectifier load type. The rectifier load will cause a large distortion of the current waveform, and the fundamental wave content is relatively high.
[0105] If 0.996 > H > 0.985, it is determined that the load type of the data to be recognized is a resistive load type. The current and voltage of the resistive load are basically linearly related, and the fundamental wave content is in the middle range.
[0106] If H < 0.985, it is determined that the load type of the data to be recognized is a motor load type. Due to its electromagnetic characteristics, the motor load will cause distortion of the current waveform, and the fundamental wave content is relatively low.
[0107] 6. Select the target classification model: When the load type is determined to be a rectifier load type, input the data to be recognized into the target classification model a (i.e., the target classification model corresponding to the rectifier load type).
[0108] When the load type is determined to be a resistive load type, input the data to be recognized into the target classification model b (i.e., the target classification model corresponding to the resistive load type).
[0109] When the load type is determined to be a motor load type, the data to be recognized 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 fault modes, so different classification models need to be used specifically for fault detection.
[0110] 7. Output the target fault detection result: Analyze and process the data to be recognized through the corresponding target classification model, and output the final fault detection result.
[0111] 8. End: The process ends.
[0112] It can be seen that in the arc fault detection method with adaptive feature selection described in this application, by dividing the training data into 3 types of data sets, it avoids the mutual interference of data of different load types in the same feature space, reduces the complexity of feature selection. Then, through these 3 types of data sets, the preset classification model is trained respectively to obtain 3 target classification models, transforming 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. Thus, the classification accuracy of the model is improved, that is, the accuracy of arc fault detection is improved.
[0113] Please refer to Figure 7 , Figure 7 which is a functional module composition block diagram of an arc fault detection device 700 with adaptive feature selection provided by an embodiment of this application. The arc fault detection device 700 with adaptive feature selection can be applied to an electronic device, and the electronic device is 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, where: 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 both current data of grid devices in the target power system; The model training module 702 is used to classify the data in the training data set to obtain 3 types of data sets; use the preset PSO algorithm to optimize the DWT decomposition parameters for the 3 types of data sets and perform feature selection to obtain 3 groups of optimal DWT decomposition parameters and 3 feature subsets; each type of data set corresponds to a group of optimal DWT decomposition parameters and a feature subset; based on the test data set, the 3 types of data sets, the 3 groups of optimal DWT decomposition parameters, and the 3 feature subsets, the preset classification model is trained respectively to obtain 3 target classification models; The fault detection module 703 is configured to obtain the data to be recognized; the data to be recognized is current data of grid equipment in the target power system; determine the target load type corresponding to the data to be recognized; 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 recognized 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.
[0114] In a specific implementation, the arc fault detection device 700 with adaptive feature selection described in the embodiments of the present invention can also perform other implementation manners described in the arc fault detection method with adaptive feature selection provided in the embodiments of the present invention, which will not be elaborated herein.
[0115] Please refer to Figure 8 , Figure 8 which is a schematic 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, the memory, and the 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 the embodiments of the present application, the above programs include parts or all of the steps that cause the electronic device to execute any method described in the method embodiments above.
[0116] The embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute parts or all of the steps of any method described in the method embodiments above. The above computer includes an electronic device.
[0117] The embodiments of the present application also provide a computer program product. The above computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the above computer program is operable to cause a computer to execute parts or all of the steps of any method described in the method embodiments above. The computer program product may be a software installation package, and the above computer includes an electronic device.
[0118] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0119] In the above embodiments, the descriptions of the respective embodiments each have their own emphasis. For parts not elaborated in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0120] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there may be other division methods. For example, 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 displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.
[0121] Those of ordinary skill in the art can understand all or part of the processes in the methods of the above embodiments. These processes can be completed by relevant hardware instructed by a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage medium includes: ROM or random access memory RAM, magnetic disk, or optical disk and other various media that can store program codes.
[0122] The steps of the methods or algorithms described in the embodiments of the present application can be implemented in a hardware manner or by a processor executing software instructions. The software instructions can be composed of corresponding software modules. The software modules 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 well-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 a component of the processor. The processor and the 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 the storage medium can also exist as discrete components in the terminal device or the management device.
[0123] Those skilled in the art should be able to realize 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 by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part.
[0124] The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media.
[0125] Among them, the available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0126] For each device and product described in the above embodiments, each module / unit included therein can be a software module / unit, a hardware module / unit, or can also be partially a software module / unit and partially a hardware module / unit. For example, for each device and product applied to or integrated into a chip, each module / unit included therein can be implemented in a hardware manner such as a circuit. Or, at least some of the modules / units can be implemented in the form of a software program that runs on a processor integrated inside the chip, and the remaining (if any) part of the modules / units can be implemented in a hardware manner such as a circuit; for each device and product applied to or integrated into a chip module, each module / unit included therein can be implemented in a hardware manner such as a circuit. Different modules / units can be located in the same component (such as a chip, circuit module, etc.) or different components of the chip module. Or, at least some of the modules / units can be implemented in the form of a software program that runs on a processor integrated inside the chip module, and the remaining (if any) part of the modules / units can be implemented in a hardware manner such as a circuit; for each device and product applied to or integrated into a terminal device, each module / unit included therein can be implemented in a hardware manner such as a circuit. Different modules / units can be located in the same component (such as a chip, circuit module, etc.) or different components inside the terminal device. Or, at least some of the modules / units can be implemented in the form of a software program that runs on a processor integrated inside the terminal device, and the remaining (if any) part of the modules / units can be implemented in a hardware manner such as a circuit.
[0127] The specific embodiments described above further elaborate on the objectives, technical solutions, and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific embodiments of the embodiments of the present application and is not used to limit the protection scope 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 shall be included within the protection scope of the embodiments of the present application.
Claims
1. An arc fault detection method based on adaptive feature selection, characterized in that Applied to an electronic device, the electronic device is connected to a target power system, and includes: Obtain a training data set and a test data set; the data in the training data set and the test data set are both current data of grid equipment in the target power system; Classify the data in the training data set to obtain three types of data sets; Use a preset PSO algorithm to optimize the DWT decomposition parameters for the three types of data sets 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; 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, train a preset classification model respectively to obtain three target classification models; Obtain data to be recognized; the data to be recognized is current data of grid equipment in the target power system; Determine the target load type corresponding to the data to be recognized; Determine the target classification model corresponding to the target load type among the three target classification models to obtain a first target classification model; Use the first target classification model to recognize the data to be recognized to obtain a target fault detection result; the target fault detection result includes the existence or non-existence of an arc fault.
2. The method according to claim 1, wherein The training data set includes n data, where n is an integer greater than 3; the classifying the data in the training data set to obtain three types of data sets includes: Perform Fourier transform on the n data in the training data set to obtain n frequency-domain data; Extract features according to 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, energy distribution characteristics; Use a preset classification algorithm to process the n feature data to determine the load type corresponding to each data in the n data to obtain n load types; each load type includes one of the following: rectifier load type, resistive load type, motor load type; Determine the three types of data sets according to the n load types and the n data.
3. The method according to claim 1 or 2, characterized in that, The preset PSO algorithm is a binary particle swarm optimization algorithm, and the using a preset PSO algorithm to optimize the DWT decomposition parameters for the three types of data sets and perform feature selection to obtain three sets of optimal DWT decomposition parameters and three feature subsets includes: 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 a first particle swarm; the position of each particle is composed of a DWT decomposition parameter encoding and a feature selection mask; Define a 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 encoding and the target feature selection mask corresponding to the optimal particle; determine the optimal DWT decomposition parameters corresponding to the first type of dataset according to the target DWT decomposition parameter encoding, and determine the feature subset corresponding to the first type of dataset according to the target feature selection mask.
4. The method according to claim 3, wherein The iteratively updating the first particle swarm and determining the optimal particle according to the first fitness function includes: Update the particles in the first particle swarm according to a preset update formula to obtain a second particle swarm; the second particle swarm includes m particles; m is an integer greater than 1; Determine the target iteration number corresponding to the second particle swarm; Calculate 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 this optimal fitness value as the global optimal fitness value; When the global optimal fitness value satisfies a preset convergence condition, or when the target iteration number is greater than the first maximum iteration number, determine 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 iteration number is not greater than the first maximum iteration number, continue to iteratively update the second particle swarm until the optimal particle is determined.
5. The method according to claim 4, characterized in that, The method further includes: Obtain the historical operation data of the preset PSO algorithm for DWT decomposition parameters; Determine the iteration numbers and global optimal fitness values when the preset PSO algorithm converges each time in the historical operation data to obtain i iteration numbers and i global optimal fitness values; i is an integer greater than 1; Draw a target convergence curve according to the i iteration numbers and the i global optimal fitness values; the abscissa of the target convergence curve is the fitness value, and the ordinate is the iteration number; Determine the iteration number corresponding to a preset fitness value in the target convergence curve to obtain a reference iteration number; Obtain the first data volume and the first load type corresponding to the first type of dataset; Determine the first adjustment factor corresponding to the first data volume; Determine the second adjustment factor corresponding to the first load type; Determine the first maximum iteration number according to the first adjustment factor, the second adjustment factor, and the reference iteration number.
6. The method according to claim 5, characterized in that, The determining the first maximum iteration number according to the first adjustment factor, the second adjustment factor, and the reference iteration number includes: Determine the second maximum iteration number according to the first adjustment factor, the second adjustment factor, and the reference iteration number; When the second maximum iteration number is less than the preset maximum iteration number, determine the first maximum iteration number according to the second maximum iteration number; 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.
7. The method according to claim 1 or 2, characterized in that, Training the preset classification model respectively based on the test data set, the three types of data sets, the three groups of optimal DWT decomposition parameters, and the three feature subsets to obtain three target classification models, including: Obtain a second type of data set, as well as the corresponding target optimal DWT decomposition parameters and target feature subset of the second type of data set; the second type of data set is any one of the three types of data sets; Determine the target model control parameters corresponding to the target feature subset; Perform DWT decomposition on the data in the second type of data set based on the target optimal DWT decomposition parameters to obtain target decomposed data; Extract features from the target decomposed data based on the target feature subset to obtain target feature data; Adjust the model control parameters of the preset classification model to the target model control parameters to obtain a first classification model; Train the first classification model with the target feature data to obtain a second classification model; Input the test data set into the second classification model to obtain a first test result, and determine a first accuracy rate according to the first test result; When the first accuracy rate is greater than the preset accuracy rate, determine the target classification model corresponding to the second type of data set according to the second classification model; When the first accuracy rate is not greater than the preset accuracy rate, obtain new feature data, and continue to train the second classification model with the new feature data until the accuracy rate of the second classification model is greater than the preset accuracy rate, and determine the target classification model corresponding to the second type of data set according to the second classification model.
8. An arc fault detection device with adaptive feature selection, characterized in that, Applied to an electronic device, the electronic device is connected to a target power system, and the device includes: an acquisition module, a model training module, and a fault detection module, where: 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 both current data of grid devices 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 and perform feature selection on the three types of data sets by using a preset PSO algorithm to obtain three groups of optimal DWT decomposition parameters and three feature subsets; each type of data set corresponds to a group of optimal DWT decomposition parameters and a feature subset; train the preset classification model respectively based on the test data set, the three types of data sets, the three groups of optimal DWT decomposition parameters, and the three feature subsets to obtain three target classification models; The fault detection module is used to obtain the data to be recognized; the data to be recognized is the current data of the grid equipment in the target power system; determine the target load type corresponding to the data to be recognized; determine the target classification model corresponding to the target load type among the three target classification models to obtain the first target classification model; identify the data to be recognized through the first target classification model to obtain the target fault detection result; the target fault detection result includes the existence or non-existence of an arc fault.
9. An electronic device, characterized in that, It includes: a processor, a memory, a communication interface, and one or more programs; The one or more programs are stored in the memory and are configured to be executed by the processor, and the programs include instructions for performing the steps in the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program for electronic data exchange is stored, wherein the computer program causes a computer to execute the method according to any one of claims 1-7.
Citation Information
Patent Citations
Arc fault identification method, device and equipment
CN116451080A
Fault arc detection method, device and equipment and readable storage medium
CN116520082A
Fault classification method and device for arc current signal, and storage medium
CN119128702A