Special load electric energy quality classification method based on bare bone firework algorithm
Through wavelet packet transformation and bare bone firework algorithm optimization of the nuclear parameters and punishment factors of the support vector machine, the problem of insufficient accuracy in the classification of power quality is solved, and higher classification accuracy and shorter classification time are achieved.
Patent Information
- Application Number
- CN202510528596.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
AI Technical Summary
The existing power quality classification methods have insufficient accuracy in feature extraction and classification identification, which is difficult to meet the classification needs in complex power grid environments.
The wavelet packet transformation is used for feature extraction, and the naked bone firework algorithm is used to optimize the nuclear parameters and punishment factors of the support vector machine to build a power quality classification model.
It improves the accuracy and efficiency of power quality classification, shortens the classification time, adapts to different proportions of training sets and test sets, and achieves higher classification accuracy.
Smart Images

Figure CN120448939A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power quality classification, and in particular to a special load power quality classification method based on a bare bones fireworks algorithm. Background Art
[0002] As loads connected to power systems become increasingly diverse and complex, nonlinear special loads in the grid, such as those in renewable energy, electrified railways, and metallurgical applications, are more likely to cause harmonics, voltage swells, sags, interruptions, and other power quality issues. These issues seriously endanger the security of the power grid and the national economy, as well as the daily quality of life of users.
[0003] Currently, power quality classification primarily involves feature extraction and classification. Key power quality feature extraction methods include fast Fourier transform (FFT), S-transform (ST), empirical mode decomposition (EMD), and wavelet transform (WT). However, these methods have their own limitations. For example, FFT can only analyze the signal in the frequency domain, but lacks time-domain analysis; ST has excellent noise immunity but takes a long time to compute; EMD is prone to generating false information during calculation; and WT can only decompose the low-frequency portion of the signal, but not the high-frequency portion. Key power quality classification methods include neural networks and support vector machines. However, neural networks converge slowly and are prone to falling into local optima, failing to achieve a global optimal solution and therefore failing to meet classification accuracy requirements. Summary of the Invention
[0004] The purpose of the present invention is to provide a special load power quality classification method based on the bare bones fireworks algorithm to improve the classification accuracy and efficiency and to address the deficiencies of the prior art.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A method for classifying special load power quality based on a bare bones fireworks algorithm comprises the following steps:
[0007] S1: Data preprocessing: Preprocess the collected power quality data, including data selection, data cleaning, and data transformation, to obtain a data set suitable for feature extraction;
[0008] S2: Feature extraction: Use wavelet packet transform to extract features from pre-processed data to obtain feature vectors that can reflect power quality issues;
[0009] S3: Model construction: Build a support vector machine classification model and use the bare bones fireworks algorithm (BBFWA) to optimize the kernel parameters and penalty factors of the support vector machine to improve classification accuracy.
[0010] S4: Classification and identification: The extracted feature vector is input into the optimized support vector machine classification model to perform power quality classification and identification.
[0011] Furthermore, the data selection in S1 includes collecting special load-related data, covering photovoltaic power station loads, wind farm loads, and electric vehicle charging station loads, while simulating a variety of different power quality indicators to conduct comparative experiments.
[0012] Furthermore, the data preprocessing method in S1 is as follows: 6 sets of data are simulated for each power quality indicator, totaling 36 sets, corresponding to different situations of voltage sag, voltage swell, voltage interruption, harmonics, harmonic swell and harmonic sag; then, the data are checked to eliminate the erroneous data such as singular values and zero values, and then the processed data are subjected to wavelet packet decomposition to extract eigenvalues.
[0013] Furthermore, the method of using wavelet packet transform to extract features from the preprocessed data in S2 is as follows:
[0014] S201: Wavelet packet transform: Using the three-layer wavelet packet decomposition method, the low-frequency and high-frequency parts of the power signal are finely decomposed to fully collect signal information;
[0015] S202: Feature vector extraction: Perform wavelet packet decomposition on each power quality disturbance in turn: Use the wavelet function "db4" to decompose each signal three times, reconstruct the 8 nodes separately through the reconstruction function "wprcoef", obtain the reconstruction coefficient, use the variance function "norm" to calculate the variance of the reconstruction coefficient in turn, record the characteristic data of each power quality indicator, and the characteristic vector is represented by T.
[0016] Furthermore, the bare bones fireworks algorithm (BBFWA) in S3 defines that only one type of fireworks is generated during an explosion. During the iteration process, the number of sparks generated by the explosion is set to a constant value C, and the explosion range is determined by a specific formula:
[0017]
[0018] Where, X j is the number of sparks and fireworks generated after j iterations; x j The fireworks generated in the jth iteration; f(x j ) is fireworks x j Fitness value; minf(x j ) is X j The minimum fitness in C a and C r is a constant, C a >1, C r <1.
[0019] Furthermore, the specific steps for building a support vector machine classification model in S3 are as follows:
[0020] S301: Divide the characteristic vectors T of each electric energy indicator obtained through simulation into two groups, as a training set and a test set respectively;
[0021] S302: Initialize the parameters of the Bare Bones Fireworks Algorithm (BBFWA) and set relevant parameter values;
[0022] S303: During the optimization process, fireworks explode to generate sparks. By comparing the fitness values of the fireworks and the sparks, the coordinates of the optimal fitness value are continuously updated;
[0023] S304: Iteratively update the parameter values of the Bare Bones Fireworks Algorithm (BBFWA);
[0024] S305: Determine whether the iteration reaches the termination condition, if not, continue the iteration, if so, stop the iteration;
[0025] S306: Output the optimal fitness value and the optimal fireworks position, i.e., the penalty factor and kernel parameter;
[0026] S307: The obtained optimal parameters are put into the support vector machine for training and testing, and finally a classification result graph is obtained.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] 1. The present invention's special load power quality classification method, based on the bare-bones fireworks algorithm, utilizes wavelet packet transform for feature extraction, enabling it to extract richer signal detail and provide more accurate feature vectors for the support vector machine. Compared to traditional feature extraction methods, the present invention significantly improves classification accuracy. By optimizing the support vector machine classification model based on the bare-bones fireworks algorithm and effectively optimizing the kernel parameters and penalty factors, the present invention's classification model demonstrates higher classification accuracy across training and test sets of varying proportions.
[0029] 2. The special load power quality classification method based on the bare-bones fireworks algorithm of the present invention uses the bare-bones fireworks algorithm as an efficient optimization algorithm. Compared with other complex optimization algorithms, it has a faster convergence speed in the process of optimizing support vector machine parameters, enabling the model to find the optimal parameter combination more quickly during training and testing, thereby shortening the classification time. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a flow chart of the present invention for optimizing support vector machine parameters based on the bare bones fireworks algorithm;
[0031] Figure 2This is the classification result diagram of the BBFWA-SVM model of the present invention;
[0032] Figure 3 This is the PSO-SVM classification result diagram of the present invention;
[0033] Figure 4 This is the CV-SVM classification result diagram of the present invention. DETAILED DESCRIPTION
[0034] 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 making creative efforts are within the scope of protection of the present invention.
[0035] An embodiment of the present invention provides a method for classifying special load power quality based on a bare bones fireworks algorithm, comprising the following steps:
[0036] S1: Data preprocessing: Preprocess the collected power quality data, including data selection, data cleaning, and data transformation, to obtain a data set suitable for feature extraction;
[0037] S2: Feature extraction: Use wavelet packet transform to extract features from pre-processed data to obtain feature vectors that can reflect power quality issues;
[0038] S3: Model construction: Build a support vector machine classification model and use the bare bones fireworks algorithm (BBFWA) to optimize the kernel parameters and penalty factors of the support vector machine to improve classification accuracy.
[0039] S4: Classification and identification: The extracted feature vector is input into the optimized support vector machine classification model to perform power quality classification and identification.
[0040] During the data collection process in S1 above, this embodiment comprehensively collects special load-related data based on the local power system environment. The focus is on photovoltaic power station load data, which includes information on relevant parameters such as the output power, light intensity, and temperature of photovoltaic cells. This data is crucial for analyzing the impact of photovoltaic power stations on power quality under different environmental conditions. At the same time, wind farm load data is collected, including wind speed, wind direction, and the output power of wind turbines. Wind speed and direction data can reflect the wind energy resource status of the wind farm, while output power data directly reflects the power injection of the wind farm into the power grid, which in turn affects power quality. It is also necessary to collect electric vehicle charging station load data, such as the charging power of the charging station, charging time distribution, and the number of vehicles connected. With the popularization of electric vehicles, their charging behavior has had a significant impact on the load characteristics of the power grid. This data helps to gain a deeper understanding of the mechanism by which electric vehicle charging loads affect power quality.
[0041] Subsequently, the above data was simulated and processed. To more comprehensively cover various power quality conditions, six sets of data for each power quality indicator were simulated, for a total of 36 sets. These indicators represent voltage sag, voltage swell, voltage interruption, harmonics, harmonic swell, and harmonic sag, respectively. During the simulation data generation process, reasonable parameter ranges and variation patterns were set based on relevant power system theory and practical experience. For example, for voltage sag simulations, different voltage drop amplitudes (e.g., 10%, 20%, 30%) and durations (e.g., 0.1, 0.2, 0.5 seconds) were considered. The collected actual and simulated data were carefully inspected and erroneous data, such as singular values and zero values, were removed. Singular values may be abnormal data points caused by measurement equipment failure, electromagnetic interference, or other factors, while zero values may be due to data recording errors or equipment malfunction. Data cleaning ensures data quality for subsequent analysis. After data cleaning, the processed data is subjected to wavelet packet decomposition to extract eigenvalues. Wavelet packet decomposition can decompose the signal at multiple levels, extract the potential characteristic information in the data, and provide strong support for subsequent power quality classification.
[0042] The feature extraction process for the above data is mainly as follows:
[0043] 1. Wavelet Packet Decomposition: A three-layer wavelet packet decomposition is performed on the signal to obtain the detail signal of the approximate signal. In the first layer of decomposition, the original signal is decomposed into low-frequency coefficients and high-frequency coefficients, labeled (1, 0) for the low-frequency coefficient S10 of the first layer of wavelet packet decomposition, and (1, 1) for the high-frequency coefficient S11 of the first layer of wavelet packet decomposition. The approximate signal (represented by S10) and the detail signal (represented by S11) are then further decomposed in the second layer. This multi-layer decomposition method allows for a more detailed analysis of the signal's internal structure, yielding richer feature information.
[0044] 2. Feature Vector Extraction: After three-layer wavelet packet decomposition, a series of coefficients are obtained, such as S30, S31, S32, S33, S34, S35, S36, and S37. S30, S32, S34, and S36 are low-frequency coefficients, while S31, S33, S35, and S37 are high-frequency coefficients. The [3,0] node of signal S is reconstructed, and the reconstructed coefficient S130 is obtained using a specific reconstruction algorithm. This reconstruction process is the inverse of wavelet packet decomposition, aiming to restore the signal information at specific nodes. The variance of the reconstructed coefficient S130 is then calculated, and the variance function is used to calculate the variance of the reconstructed coefficient S10. The variance reflects the degree of data dispersion and is used as a feature vector input into the support vector machine, providing effective discriminant information for the classification model.
[0045] The process of building and optimizing the above model is as follows:
[0046] 1. Support Vector Machine Model Construction: A support vector machine (SVM) model is constructed. This model is a machine learning method based on risk minimization. Its core principle is to use a kernel function to map the low-dimensional spatial features of some nonlinear problems to a high-dimensional space, thereby converting the originally inseparable problem into a linearly separable form for effective classification operations. In this invention, the radial basis function is selected as the kernel function. The radial basis function has good local approximation ability and generalization performance, and can well adapt to the complex data distribution in power quality classification problems.
[0047] 2. Bare-bone fireworks algorithm construction: Construct a bare-bone fireworks algorithm (BBFWA), which is a minimalist version of the fireworks algorithm. First of all, in the design of the algorithm, only one type of fireworks is produced during the explosion, which is different from the traditional fireworks algorithm that produces multiple fireworks, simplifying the complexity of the algorithm. During iteration, the number of sparks produced by the explosion is no longer updated and is set to a constant value C. This setting avoids the computational complexity and uncertainty caused by the dynamic change of the number of sparks. The selection strategy is changed to elite selection, that is, in each iteration, only individuals with higher fitness are selected as candidates for the next generation, thereby improving the convergence speed and optimization effect of the algorithm. The explosion range formula has also been changed and is calculated according to a specific formula:
[0048]
[0049] Where, X j is the number of sparks and fireworks generated after j iterations; x j The fireworks generated in the jth iteration; f(x j ) is fireworks x j Fitness value; minf(x j ) is X j The minimum fitness in C a and C r is a constant, C a >1, C r <1. This formula takes into account the fitness value of fireworks, the number of iterations, and some constant parameters, so that the algorithm can adjust the search range more reasonably in the process of searching for the optimal solution.
[0050] 3. BBFWA SVM model construction and optimization: BBFWA is used to optimize the kernel parameters and penalty factors in the support vector machine. The support vector machine classification accuracy is used as the fitness function of the bare bones fireworks algorithm to evaluate the performance of the algorithm during the optimization process. The specific construction process is as follows: Figure 1 As shown:
[0051] S301: Divide the feature vectors obtained through feature extraction into two groups, one for training and the other for testing. The training set is used to train the model so that the model can learn the inherent laws and characteristics of the data; the testing set is used to verify the generalization ability and classification accuracy of the model.
[0052] S302: Initialize BBFWA parameters and set relevant parameter values, such as the number of sparks C, constant parameters, etc. The reasonable setting of these parameters has an important impact on the performance and convergence speed of the algorithm.
[0053] S303: The optimization process begins. Fireworks explode, producing sparks. The fitness values of the fireworks and sparks are compared, and the coordinates of the optimal fitness value are continuously updated. During this process, the algorithm gradually approaches the optimal combination of kernel parameters and penalty factors through continuous search and comparison.
[0054] S304: Iteratively update the parameter values of BBFWA. According to the results of each iteration, the parameters are adjusted and optimized to improve the performance of the algorithm and the classification effect.
[0055] S305: Determine whether the iteration has reached a termination condition, such as setting a maximum number of iterations or reaching a satisfactory classification accuracy, etc. If the termination condition has not been reached, the iteration continues; if the termination condition has been reached, the iteration stops.
[0056] S306: Output the optimal fitness value and the optimal fireworks position, i.e., the optimal values of the penalty factor and kernel parameters. These optimal parameters are then put into the support vector machine for training and testing, thereby constructing the optimized BBFWA SVM model.
[0057] In the above embodiment, the specific method of classification identification and verification of the present invention is as follows:
[0058] 1. Data Labeling and Preprocessing: The extracted feature vector data is labeled sequentially. Labels are as follows: label "1" represents voltage sag; label "2" represents voltage swell; label "3" represents voltage interruption; label "4" represents harmonics; label "5" represents harmonic swell; and label "6" represents harmonic sag. The labeled data is divided into training and test sets and normalized. Normalization maps the data's eigenvalues to a specific interval, typically [0, 1]. This prevents large variations in data eigenvalues from negatively impacting the classification model, improving training efficiency and classification accuracy.
[0059] 2. Classification and Accuracy Recording: The processed data is divided into two groups: a training set and a test set. The training set data is fed into the optimized BBFWA SVM model for training, enabling the model to learn the characteristic patterns corresponding to different power quality indicators. The trained model is then tested using the test set data. The model performs classification predictions based on the input feature vectors and records the classification accuracy. Through repeated testing and statistical analysis, a relatively accurate classification accuracy result can be obtained, which is used to evaluate the model's classification performance.
[0060] 3. Model comparison and verification: The BBFWA-SVM classification model of the present invention is compared with the PSO-SVM and CV-SVM models, and the following results can be obtained:
[0061] 1): PSO-SVM optimization classification model:
[0062] Table 1: Training set (30) : Test set (6)
[0063]
[0064] 2): CV-SVM optimization classification model:
[0065] Table 2 Training set (30) : Test set (6)
[0066]
[0067] The classification results for PSO-SVM and CV-SVM above show that both models exhibited low accuracy during training. Furthermore, during testing, the PSO-SVM optimized classification model achieved a maximum accuracy of only 83.3333%, while the CV-SVM optimized classification model achieved a maximum accuracy of 100%, though most classification accuracies fell below 70%. Simulation times for both models were significantly longer than those for BBFWA-SVM. This indicates that the BBFWA-SVM optimized classification model significantly outperformed both the PSO-SVM and CV-SVM models in terms of simulation time, training, and testing accuracy.
[0068] like Figure 2-4 As shown in the figure, the BBFWA-SVM classification model was compared with the PSO-SVM and CV-SVM models. The PSO-SVM and CV-SVM models were subjected to the same methods for data processing, model construction, and classification. Using the same dataset and test conditions, the three models were compared based on performance metrics such as classification accuracy, training time, and testing time. The results show that the BBFWA-SVM optimized classification model significantly outperformed the PSO-SVM and CV-SVM models in terms of simulation time, training accuracy, and testing accuracy, thus validating the superiority of the proposed BBFWA-SVM model.
[0069] In summary, the present invention provides a special load power quality classification method based on the bare-bones fireworks algorithm. This method utilizes wavelet packet transform (WPT) for feature extraction, overcoming the limitations of traditional methods. It can meticulously decompose the high-frequency portion of the signal, avoiding the insufficient low-frequency decomposition of WT, as well as the frequency-domain analysis limitations, computational time, and false information issues of FFT, ST, and EMD, thereby improving feature extraction quality and efficiency. Furthermore, the present invention utilizes the bare-bones fireworks algorithm (BBFWA) to optimize support vector machines. BBFWA is a simplified version of the fireworks algorithm, featuring improved explosion mechanisms such as a single fireworks explosion, a fixed number of sparks, elite selection, and a variable explosion range formula. This method efficiently searches for the optimal solution and adaptively optimizes SVM parameters using classification accuracy as a fitness function, improving both model accuracy and efficiency. Furthermore, the present invention comprehensively optimizes classification accuracy and time. Compared to the PSO-SVM and CV-SVM models, the present invention achieves higher accuracy, reaching 100%, under various test conditions. Regarding classification time, the bare-bones fireworks algorithm achieves rapid model convergence and shortens the time required, offering significant advantages over comparable models and meeting high-real-time requirements.
[0070] In terms of economic benefits: This invention improves grid operational efficiency: Accurate power quality classification helps grid operators quickly identify the type and source of power quality issues, enabling them to take targeted measures to repair and improve them. For example, harmonics issues can be addressed by promptly deploying harmonic mitigation equipment; voltage sags can be addressed by quickly adjusting the grid's operating mode or activating backup power sources. This helps reduce equipment damage and production interruptions caused by power quality issues, lowering grid operating costs and improving overall grid efficiency.
[0071] Optimizing power resource allocation: By accurately classifying the power quality of specific loads, grid operators can better understand the impact of different loads on power quality and rationally plan power resource allocation. For example, regions or users with higher power quality requirements can be prioritized for higher-quality power resources. For specific loads that frequently cause power quality issues, appropriate restrictions or management measures can be implemented to ensure good overall power quality across the grid. This helps improve power resource utilization efficiency, avoid resource waste, and ultimately generate significant economic benefits.
[0072] In terms of social benefits: This invention ensures the normal use of electricity for electricity users. Power quality issues can damage users' electrical equipment and affect their normal work and life. The classification method of this invention can promptly and accurately identify power quality issues, helping grid operators take measures to ensure the quality of electricity for users. For example, for industrial users, it can prevent production line shutdowns caused by power quality issues; for residential users, it can ensure the normal use of household appliances, improving their quality of life and satisfaction.
[0073] Promoting sustainable development of power systems: With the continuous increase of special loads in power systems, power quality issues are becoming increasingly prominent. The classification method and model of this invention provides an effective technical means to solve the power quality classification problem, helping to promote the development of power systems in a more intelligent, efficient and sustainable direction.
[0074] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A special load power quality classification method based on the bare bones fireworks algorithm, characterized in that: The following steps are involved: S1: Data preprocessing: Preprocess the collected power quality data, including data selection, data cleaning, and data transformation, to obtain a data set suitable for feature extraction; S2: Feature extraction: Use wavelet packet transform to extract features from pre-processed data to obtain feature vectors that can reflect power quality issues; S3: Model construction: Build a support vector machine classification model and use the bare bones fireworks algorithm (BBFWA) to optimize the kernel parameters and penalty factors of the support vector machine to improve classification accuracy. S4: Classification and identification: The extracted feature vector is input into the optimized support vector machine classification model to perform power quality classification and identification.
2. The method for classifying special load power quality based on the bare bones fireworks algorithm according to claim 1, characterized in that: The data selection in S1 includes collecting special load-related data, covering photovoltaic power station loads, wind farm loads, and electric vehicle charging station loads, while simulating a variety of different power quality indicators to conduct comparative experiments.
3. The method for classifying special load power quality based on the bare bones fireworks algorithm according to claim 2, characterized in that: The data preprocessing method in S1 is as follows: for each power quality indicator, 6 sets of data are simulated to generate 36 sets in total, corresponding to different situations of voltage sag, voltage swell, voltage interruption, harmonics, harmonic swell and harmonic sag; then, the data is checked to eliminate the erroneous data such as singular values and zero values, and then the processed data is subjected to wavelet packet decomposition to extract eigenvalues.
4. The method for classifying special load power quality based on the bare bones fireworks algorithm according to claim 1, characterized in that: The method of using wavelet packet transform to extract features from preprocessed data in S2 is as follows: S201: Wavelet packet transform: Using the three-layer wavelet packet decomposition method, the low-frequency and high-frequency parts of the power signal are finely decomposed to fully collect signal information; S202: Feature vector extraction: perform wavelet packet decomposition on each power quality disturbance in turn: use the wavelet function "db4" to decompose each signal three times, and reconstruct the function "wprcoef" reconstructs each of the eight nodes to obtain the reconstruction coefficients. The variance function "norm" is used to calculate the variance of the reconstruction coefficients in turn. The characteristic data of each power quality indicator is recorded, and the characteristic vector is represented by T.
5. The method for classifying special load power quality based on the bare bones fireworks algorithm according to claim 1, characterized in that: The bare bones fireworks algorithm (BBFWA) in S3 defines that only one type of fireworks is generated during an explosion. During the iteration process, the number of sparks generated by the explosion is set to a constant value C, and the explosion range is determined by a specific formula: Where, X j is the number of sparks and fireworks generated after j iterations; x j The fireworks generated in the jth iteration; f(x j ) is fireworks x j Fitness value; minf(x j ) is X j The minimum fitness in C a and C r is a constant, C a >1, C r <1.
6. The method for classifying special load power quality based on the bare bones fireworks algorithm according to claim 5, characterized in that: The specific steps for building a support vector machine classification model in S3 are as follows: S301: Divide the characteristic vectors T of each electric energy indicator obtained through simulation into two groups, as a training set and a test set respectively; S302: Initialize the parameters of the Bare Bones Fireworks Algorithm (BBFWA) and set relevant parameter values; S303: During the optimization process, fireworks explode to generate sparks. By comparing the fitness values of the fireworks and the sparks, the coordinates of the optimal fitness value are continuously updated; S304: Iteratively update the parameter values of the Bare Bones Fireworks Algorithm (BBFWA); S305: Determine whether the iteration reaches the termination condition, if not, continue the iteration, if so, stop the iteration; S306: Output the optimal fitness value and the optimal fireworks position, i.e., the penalty factor and kernel parameter; S307: The obtained optimal parameters are put into the support vector machine for training and testing, and finally a classification result graph is obtained.