Electric energy quality disturbance classification method and system based on multistage optimization time-frequency analysis

Through multi-level optimization time-frequency analysis methods, including mean filtering envelope extreme value method and sparrow search algorithm to optimize VMD parameters, combined with multi-resolution S transformation and multi-channel convolutional neural network model, the shortcomings of traditional methods in extracting complex power quality disturbance signal characteristics are solved, and high-precision identification and classification of power quality disturbances are achieved.

CN119989058APending Publication Date: 2025-05-13SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510151121.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

Traditional power quality disturbance detection methods are difficult to extract multi-scale characteristics of complex power quality disturbance signals, and feature extraction is inaccurate in low signal-to-noise ratio environments.

Method used

The multi-level optimization time-frequency analysis method is used to initially determine the parameter range of VMD for variational modal decomposition VMD through the mean filtering envelope extreme value method, and then the VMD parameters are optimized by the sparrow search algorithm to achieve more accurate signal decomposition. Then, the time-frequency features are extracted using multi-resolution S transformation, and finally the precise identification and classification of power mass perturbations are realized through the multi-channel convolutional neural network model.

Benefits of technology

It improves the accuracy and stability of signal decomposition, enhances the accuracy and noise resistance of time-frequency feature extraction, and realizes high-precision identification and classification of power quality disturbances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119989058A_ABST
    Figure CN119989058A_ABST
Patent Text Reader

Abstract

The invention discloses a power quality disturbance classification method and system based on multistage optimization time-frequency analysis, and relates to the technical field of power quality disturbance classification, and the method comprises the steps: obtaining a power quality disturbance signal; a mean filtering envelope extremum method is adopted to determine the number of main frequency points of a signal so as to determine the range of a decomposition level and a penalty factor in variational mode decomposition VMD, then a sparrow search algorithm is utilized, a composite evaluation index based on a VMD mode component envelope entropy value and a minimum energy loss ratio is used as a fitness function of the sparrow search algorithm, and a VMD model component envelope entropy value is calculated. Carrying out adaptive optimization on the decomposition level and penalty factor of the VMD, determining an optimal parameter, and carrying out VMD decomposition on the power quality disturbance signal to obtain a plurality of IMF components; and obtaining a plurality of time-frequency characteristic patterns of different scales through multi-resolution S transformation, inputting the time-frequency characteristic patterns into the MCNN-AT model, and outputting a final power quality disturbance classification result. According to the invention, accurate identification and classification of power quality disturbance can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power quality disturbance classification, and in particular to a power quality disturbance classification method and system based on multi-level optimized time-frequency analysis. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] In recent years, with the transformation of energy structure to low-carbon, the development and utilization of new renewable energy (such as wind energy, solar energy, etc.) has expanded rapidly. These new renewable energy sources are connected to the power grid through distributed power sources, which significantly increases the complexity and variability of the power grid. At the same time, the widespread application of power electronic equipment has also made the disturbance signals in the power grid more complex, which in turn causes serious power quality problems, such as harmonics, voltage sag, voltage swell, frequency fluctuations, etc. These power quality disturbances will not only seriously reduce the efficiency of power use, but also endanger the safety of power equipment and affect people's production and life. Therefore, the detection and classification of power quality disturbances is one of the important prerequisites for ensuring the safe and normal operation of the power grid.

[0004] Traditional power quality disturbance detection methods usually combine signal processing methods with artificial intelligence technology. The detection process includes two steps: time-frequency analysis, feature extraction, and disturbance classification. When processing complex power quality disturbance signals, traditional methods still have the following problems:

[0005] (1) Since complex power quality disturbance signals are usually composed of multiple single transient and steady-state disturbances, and the disturbances affect each other, it is difficult for traditional methods to extract the multi-scale features of the signal; the existing VMD decomposition (variational mode decomposition) is difficult to directly find the optimal parameter combination, which leads to problems such as incomplete signal decomposition or over-decomposition; the existing S transform (stockwell-trandform) method is easy to identify pseudo-frequency points when processing low signal-to-noise ratio signals, resulting in inaccurate feature extraction.

[0006] (2) Regarding disturbance feature extraction and disturbance classification, with the rapid development of convolutional neural networks in recent years, the powerful automatic learning and feature mining capabilities of neural networks can be used for feature extraction and classification, avoiding the subjective problems of traditional manual feature selection. Currently commonly used classifiers include decision trees, support vector machines, random forests, extreme learning machines, etc. However, these classifiers still require manual extraction of time, amplitude, frequency and other aspects of time-frequency features. Summary of the invention

[0007] In order to solve the shortcomings of the above-mentioned prior art, the present invention provides a power quality disturbance classification method and system based on multi-level optimization time-frequency analysis, which adopts an improved multi-level optimization adaptive time-frequency analysis method, that is, the parameter range of variational mode decomposition (VMD) is preliminarily determined by the mean filter envelope extremum method, and then the VMD parameters are optimized by using the Sparrow Search Algorithm (SSA) to achieve more accurate and stable signal decomposition, and then the time-frequency features of the decomposition model are extracted by using the multiresolution S-transform, and finally a multi-channel convolution neural network (MCNN) model is combined to realize accurate identification and classification of power quality disturbances.

[0008] In a first aspect, the present invention provides a method for classifying power quality disturbances based on multi-level optimized time-frequency analysis.

[0009] A method for classifying power quality disturbances based on multi-level optimized time-frequency analysis, comprising:

[0010] Obtain power quality disturbance signals;

[0011] The mean filter envelope extreme value method is used to determine the number of main frequency points of the power quality disturbance signal;

[0012] According to the number of main frequency points, the range of decomposition level and penalty factor in variational mode decomposition VMD is determined, and then the sparrow search algorithm SSA is used to adaptively optimize the decomposition level and penalty factor of VMD by taking the composite evaluation index based on the VMD modal component envelope entropy value and the minimum energy loss ratio as the fitness function of the SSA algorithm to determine the optimal parameters.

[0013] Based on the optimal decomposition level and penalty factor, VMD decomposition is performed on the power quality disturbance signal to obtain multiple IMF components;

[0014] Perform multi-resolution S transform on multiple IMF components in sequence to obtain multiple time-frequency feature maps of different scales;

[0015] Multiple time-frequency feature maps of different scales are input into the MCNN-AT model to output the final power quality disturbance classification results.

[0016] In a second aspect, the present invention provides a power quality disturbance classification system based on multi-level optimized time-frequency analysis.

[0017] A power quality disturbance classification system based on multi-level optimized time-frequency analysis, comprising:

[0018] A signal acquisition module, used for acquiring power quality disturbance signals;

[0019] The VMD parameter determination module is used to determine the number of main frequency points of the power quality disturbance signal by using the mean filter envelope extreme value method; according to the number of main frequency points, the range of the decomposition level and the penalty factor in the variational mode decomposition VMD is determined, and then the sparrow search algorithm SSA is used to adaptively optimize the decomposition level and penalty factor of VMD by taking the composite evaluation index based on the VMD modal component envelope entropy value and the minimum energy loss ratio as the fitness function of the SSA algorithm to determine the optimal parameters;

[0020] A signal decomposition module is used to perform VMD decomposition on the power quality disturbance signal based on the optimal decomposition level and penalty factor to obtain multiple IMF components;

[0021] The time-frequency feature extraction module is used to perform multi-resolution S transform on multiple IMF components in sequence to obtain multiple time-frequency feature maps of different scales;

[0022] The classification module is used to input multiple time-frequency feature maps of different scales into the MCNN-AT model and output the final power quality disturbance classification results.

[0023] In a third aspect, the present invention further provides an electronic device, comprising: a memory for storing executable instructions; and a processor for implementing the above-mentioned power quality disturbance classification method based on multi-level optimized time-frequency analysis when executing the executable instructions stored in the memory.

[0024] In a fourth aspect, the present invention further provides a computer-readable storage medium storing executable instructions for causing a processor to execute the executable instructions to implement the above-mentioned power quality disturbance classification method based on multi-level optimized time-frequency analysis.

[0025] In a fifth aspect, the present invention also provides a computer program product, which includes executable instructions stored in a computer-readable storage medium; wherein, when a processor of an electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the above-mentioned power quality disturbance classification method based on multi-level optimized time-frequency analysis is implemented.

[0026] One or more of the above technical solutions have the following beneficial effects:

[0027] 1. The present invention provides a method and system for classifying power quality disturbances based on multi-level optimized time-frequency analysis. The method adopts an improved multi-level optimized adaptive time-frequency analysis method, that is, the parameter range of the variational mode decomposition (VMD) is preliminarily determined by the mean filter envelope extremum method, and then the VMD parameters are optimized by the sparrow search algorithm (SSA) to achieve more accurate and stable signal decomposition, and then the multi-resolution S transform is used to extract the time-frequency features of the decomposition model, and finally a multi-channel attention convolutional neural network model is combined to achieve accurate identification and classification of power quality disturbances.

[0028] 2. The present invention optimizes the traditional envelope extreme value method through the mean filtering envelope extreme value method, effectively reduces the pseudo-frequency points in the low signal-to-noise ratio environment, and improves the recognition ability of low-amplitude frequency points, so that when the signal contains high noise, the key time-frequency features can still be accurately extracted, the feature extraction accuracy is improved, and the inaccuracy of the traditional method in the feature extraction stage is avoided; on this basis, the decomposition level k and the penalty factor α are preliminarily limited according to the obtained main frequency points, so as to further improve the algorithm operation efficiency and robustness.

[0029] 3. The present invention uses a composite evaluation index based on the envelope entropy function and the energy loss ratio as the fitness function, and adopts the sparrow search algorithm SSA to adaptively optimize the decomposition level k and the penalty factor α of the variational mode decomposition VMD, so as to achieve the optimization of VMD parameters. The signal is decomposed by VMD using the optimal VMD parameters to ensure the accuracy and stability of the signal decomposition. Subsequently, the envelope entropy value is used to calculate and remove the noise component, thereby further improving the noise resistance.

[0030] 4. Based on the generalized S transform, the present invention introduces a multi-resolution S transform, that is, different Gaussian parameters are selected according to different frequency ranges to perform S transform. In this way, since the present invention performs S transform on the modal components after VMD decomposition, each mode corresponds to only one main frequency, so it can achieve higher time resolution in the low-frequency area and higher frequency resolution in the high-frequency area, so as to better meet the time-frequency requirements for power quality disturbance (Power Quality Disturbances, PQD) analysis. This method greatly improves the accuracy, resolution and noise resistance of time-frequency feature extraction.

[0031] 5. The MCNN-AT model constructed by the present invention can process different types of input feature maps through a multi-channel structure and make full use of the information of multimodal data. Each channel contains multiple convolutional layers, which can extract features of different levels and scales and enhance the model's understanding of complex data. By calculating the importance weight of each feature map, more attention is allocated to key feature areas, effectively improving the classification accuracy of the model. The channel fusion layer splices the feature maps of multiple channels into a high-dimensional feature map, making full use of the information of different channels, reducing the interference of background noise, further improving the classification accuracy and robustness, and providing strong support for the stable and safe operation of the power system.

[0032] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0034] Figure 1 It is a flow chart of the power quality disturbance classification method based on multi-level optimized time-frequency analysis according to an embodiment of the present invention;

[0035] Figure 2 It is a flow chart of a multi-level optimized adaptive time-frequency analysis method according to an embodiment of the present invention;

[0036] Figure 3 Schematic diagram of the structure of a multi-channel attention mechanism convolutional neural network model in an embodiment of the present invention;

[0037] Figure 4 A convergence curve diagram of the simulation training accuracy of the method according to the embodiment of the present invention;

[0038] Figure 5 This is a confusion matrix diagram of the simulation classification effect of the method described in the embodiment of the present invention. DETAILED DESCRIPTION

[0039] It should be noted that the following detailed descriptions are exemplary only, are intended to describe specific embodiments, are intended to provide further explanation of the present invention, and are not intended to limit exemplary embodiments according to the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those of ordinary skill in the art to which the present invention belongs. In addition, it should also be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0040] Embodiment 1

[0041] In order to solve the problems existing in the prior art, this embodiment provides a power quality disturbance classification method based on multi-level optimized time-frequency analysis. First, the mean filtering envelope extreme value method is used to optimize the traditional envelope extreme value method. By iterative mean filtering for multiple times, the pseudo frequency points in the low signal-to-noise ratio signal are reduced, and the recognition ability of low-amplitude frequency points is improved. The number of main frequency points G is obtained, and the selection range of the decomposition level k and the penalty factor α is preliminarily limited according to the number of main frequency points G; then, a composite evaluation index is designed as the fitness function of the SSA algorithm, and the SSA algorithm is used to adaptively optimize the decomposition level k and the penalty factor α of the VMD, so as to improve the accuracy and robustness of the signal decomposition, and then the noise component is filtered out by the envelope entropy function for the next step of analysis; then, on the basis of the generalized S transform, a multi-resolution S transform is adopted, and different Gaussian window functions are selected for different frequency ranges to improve the accuracy and anti-noise performance of time-frequency feature extraction; finally, a multi-channel convolutional neural network model is proposed to classify the extracted time-frequency feature graphs to achieve high-precision recognition of power quality disturbances.

[0042] The present embodiment proposes a method for classifying power quality disturbances based on multi-level optimized time-frequency analysis, such as Figure 1 As shown, the specific steps include:

[0043] Step S1: Acquire a power quality disturbance signal.

[0044] In this embodiment, the power quality signal x(t) is obtained. To further reflect the complexity of the disturbance signal, Gaussian white noise is added to the signal, and its signal-to-noise ratio (SNR) is set to 20 dB to obtain the power quality disturbance signal x n (t).

[0045] Step S2: using the mean filter envelope extreme value method to determine the number of main frequency points of the power quality disturbance signal.

[0046] Step S2.1: for the acquired power quality disturbance signal x n , after Fourier transform FFT, we get the spectrum X. Assuming the length of the spectrum is N, we take half of the length of the spectrum and let N h =N / 2, take the spectrum amplitude and perform normalization, which can be expressed as:

[0047] X = FFT(x n );

[0048] X0(k)=|X(k)| / N h ;

[0049] In the above formula, k is the frequency domain index of FFT, k = 0, 1, ..., N h-1, the true frequency is k / (NT), T represents time, and for the sake of simplicity, X(k) will be used to represent the amplitude at the kth point.

[0050] Step S2.2, perform multiple iterative mean filtering on the normalized spectrum X0, set X1=X0, that is, the spectrum before the first round of filtering is X0, and perform normalization again on the filtered spectrum.

[0051] Among them, the spectrum X0 is subjected to multiple iterative mean filtering, which can be expressed as:

[0052]

[0053] In the above formula, X i (k) represents the spectrum value after the i-th iteration. The number of iterations i can be adjusted according to actual conditions. In this embodiment, i=3 is selected.

[0054] Afterwards, the spectrum X obtained by multiple iterative mean filtering is i After normalization, it can be expressed as:

[0055]

[0056] Step S2.3, use the local maximum detection method to determine the maximum points in the spectrum, collect them into a maximum index set Y1, and construct the maximum envelope Y2 based on the maximum points, which can be expressed as:

[0057] Y1={k|X i ′(k)>X i ′(k±1),k=1,…,N h -2};

[0058]

[0059] In the above formula, k s and k e They represent the indexes of two consecutive maximum points, Y2 is the maximum envelope obtained, l is the number of difference steps, l = 0, 1, ..., (k e -k s ).

[0060] Step S2.4: based on the maximum envelope Y2, find the local maximum extreme value point of the maximum envelope Y2 (apply local maximum value detection), perform threshold screening on all the extreme value points found, and calculate the number of main frequency points M2.

[0061] Specifically, assuming that local maximum detection is applied to obtain M1 candidate peak points (i.e., extreme value points), and threshold screening is applied to these candidate peak points, which can be expressed as:

[0062]

[0063] In the above formula, k m is the set of all indexes that meet the conditions, β is the threshold set for the pseudo extreme point generated by noise, and M2 is the number of main frequency points output.

[0064] Step S3: Determine the range of the decomposition level and penalty factor in the variational mode decomposition VMD according to the number of main frequency points, and then use the sparrow search algorithm SSA, with the composite evaluation index based on the VMD modal component envelope entropy value and the minimum energy loss ratio as the fitness function of the SSA algorithm, to adaptively optimize the decomposition level and penalty factor of VMD and determine the optimal parameters. Figure 2 As shown, specifically including:

[0065] Step S3.1, according to the number of main frequency points and combined with experience, determine the range of decomposition level k and penalty factor α in variational mode decomposition VMD, as shown in Table 1 below. Taking G=4 as an example, the range of k is [4,6], and the range of α is [300,1000]. This can reduce the optimization iteration time and improve the optimization efficiency.

[0066] Table 1 The range of decomposition level k and penalty factor α corresponding to different main frequency points

[0067] Main frequency points 1 2 3 4 5 K Value [2,3] [2,4] [3.5] [4,6] [5,7] Alpha value [1000,3000] [800,2000] [500,1500] [300,1000] [100,700]

[0068] In this embodiment, the transient disturbance with an amplitude of only 0.1 pu in a 20 dB noise environment can be accurately identified by the above method, which greatly improves the noise resistance of signal processing.

[0069] Step S3.2, using the sparrow search algorithm SSA, with the composite evaluation index based on the VMD modal component envelope entropy value and the minimum energy loss ratio as the fitness function of the SSA algorithm, the decomposition level and penalty factor of VMD are adaptively optimized to determine the optimal parameters of VMD.

[0070] In this embodiment, a composite evaluation index of the VMD modal component envelope entropy value and the minimum energy loss ratio is constructed, and the composite evaluation index is used as the fitness function of the SSA algorithm, which can effectively improve the stability and accuracy of the optimization decomposition. Among them, the envelope entropy value is used to calculate the degree of signal regularity, and the envelope entropy value function is:

[0071]

[0072] In the above formula, j is the number of modal components, j = 1, 2, 3, ..., N; a(j) is the envelope signal of the modal component, p j is the normalized result of the envelope signal.

[0073] The signal energy loss ratio is used to calculate the degree of VMD decomposition of the disturbance signal. The function expression of the signal energy loss ratio is:

[0074]

[0075] In the above formula, y(t) is the PQD signal and δ is the energy loss ratio.

[0076] On the basis of the above, a composite evaluation index is constructed to achieve the complementary advantages and disadvantages of the two methods by combining the envelope entropy function and the energy loss ratio. Its expression is:

[0077] P=γE p +δ;

[0078] In the above formula, P is the fitness value, and γ is the weight coefficient, which is set to 10 in this embodiment.

[0079] Furthermore, the SSA algorithm used in this embodiment can quickly find the optimal parameter combination through the synergy of discoverers, joiners and watchdogs (also called danger warnings, dangerous ones). Among them, discoverers usually account for a small number (for example, 10% to 20%), which are individuals with better fitness in the population, responsible for "exploring food sources" in a wider range, and their task is to find the optimal solution; joiners account for most of the remaining population, tend to follow the sparrows with better performance (i.e., discoverers or the current global optimum) and conduct local searches around them, thereby gradually "approaching the optimal solution"; dangerous ones help the algorithm jump out of the local optimal solution, prevent the algorithm from converging to the local optimal solution too early, and improve the global search capability. For example, in some iterations, if the algorithm detects a global or local "predation risk" or falls into a local optimum, some sparrows will randomly bounce or change their positions significantly to "escape from the dangerous area."

[0080] Among them, the discoverer's position update formula is:

[0081]

[0082] In the above formula, is the position of the i-th discoverer; t is the current iteration number; α is a random number in [0,1]; Q is a random number that obeys the normal distribution; L is a matrix with elements of 1×d; R2 and ST are the alarm value and safety threshold respectively.

[0083] The position update formula of the joiner is:

[0084]

[0085] In the above formula, is the optimal position of the producer; Xt w is the current global worst position; A is a 1×d matrix, and the elements are randomly assigned to 1 or -1. + =A T (AA T ) -1 ; i is the index of the sparrow in the population; n is the total number of sparrows in the population.

[0086] The position update formula of the danger warning is:

[0087]

[0088] In the above formula, is the current global optimal position; β is the step size control parameter; k∈[0,1] represents the moving direction of the sparrow; f i is the fitness value of the current sparrow; f b 、f w are the current global best and worst fitness values ​​respectively; ε is the smallest constant to avoid zero division error.

[0089] In this embodiment, the sparrow search algorithm SSA is used to optimize the decomposition level and penalty factor of the variational mode decomposition VMD, which specifically includes the following steps:

[0090] Step S3.2.1, set the number of sparrow populations and the number of iterations, and initialize the position of the sparrow population. Each individual sparrow in the population corresponds to a multidimensional "solution vector", that is, to the two VMD parameters of decomposition level k and penalty factor α, and the position of each individual sparrow is a two-dimensional vector. The population data represents the number of candidate solutions of the two-dimensional vector. In this embodiment, the population size is set to 50, the number of iterations is set to 20, and the position of the sparrow population is randomly initialized.

[0091] Step S3.2.2, during the iteration process, first perform VMD decomposition on the power quality disturbance signal according to the current sparrow population position to obtain several IMF components, calculate the current fitness function values ​​of all IMF components according to the fitness function of the SSA algorithm and sort them, select a certain proportion of discoverers, and the joiners follow the discoverer (or the global optimal solution) and make small random disturbances around the local area; then combine the above-mentioned position update formulas for discoverers and joiners, update the positions of discoverers and joiners respectively, that is, update the parameter values ​​of the decomposition level k and the penalty factor α, and determine whether a danger warning is triggered, where if triggered, the position of the corresponding sparrow is updated according to the above-mentioned danger warning position update formula; after the position update is completed, perform VMD decomposition according to the updated population position (that is, the position of k and α) to obtain several IMF components, and calculate the fitness function values ​​of all IMF components according to the fitness function to proceed to the next round of iteration.

[0092] Step S3.2.3: After continuous iterations, until the set number of iterations is reached, the optimal parameter values ​​of the VMD decomposition level and the penalty factor are output.

[0093] Step S4: Based on the optimal decomposition level k and the penalty factor α, perform VMD decomposition on the power quality disturbance signal to obtain multiple IMF components, namely u k Among them, the modal function and the center frequency of each mode are continuously updated according to the k value, which can be expressed as:

[0094]

[0095] Among them, u k ={u1,u2,...,u k} is the function of each mode (component), ω k ={ω1,ω2,...,ω k} is the center frequency of each mode function.

[0096] Preferably, each IMF component u is calculated k The envelope entropy value is calculated, and the calculated envelope entropy value is compared with the set threshold, and finally multiple IMF components are screened out to remove irregular noise components, realize signal noise reduction, and improve the noise resistance of the system.

[0097] Step S5: perform multi-resolution S transform on multiple IMF components in sequence to obtain multiple time-frequency feature maps of different scales.

[0098] In this embodiment, the multi-resolution S transform is performed on the IMF component, which is: dividing the signal frequency into a plurality of different frequency ranges, and selecting different Gaussian parameters according to different frequency ranges to perform the S transform on the IMF component.

[0099] Specifically, after the above operation, since each modal component that undergoes S transformation corresponds to only one known center frequency, the Gaussian window function can be adjusted to the maximum extent to achieve a higher time resolution in the low-frequency region and a higher frequency resolution in the high-frequency region. Therefore, in order to accurately extract the time-frequency feature vector of the power quality disturbance signal, this embodiment, based on the generalized S transformation, introduces the adjustment parameters into two bands, which are divided into 1Hz≤f<75Hz (baseband) and f≥75Hz according to the fundamental frequency characteristics of the signal. Different Gaussian parameters are used in these two windows to perform PQD analysis, thereby obtaining a higher time-frequency resolution and detection accuracy, and the expression is:

[0100]

[0101] In the above formula, τ is the time shift factor, f is the signal frequency, σ is the function standard deviation, and a, b, c, and λ are all adjustment parameters.

[0102] Through the above method, the power quality disturbance signal is divided into two parts in the time-frequency domain according to the signal frequency: when f≤75Hz, it is a low-frequency signal area; when f>75Hz, it is a high-frequency signal area.

[0103] Preferably, the noise resistance and feature extraction accuracy of the multi-resolution S transform can be verified through experiments in different noise environments to ensure its effectiveness and reliability in practical applications.

[0104] Step S6: input multiple time-frequency feature maps of different scales into the MCNN-AT model, and output the final power quality disturbance classification result.

[0105] The MCNN-AT model proposed in this embodiment is a multi-channel convolution neural network and attention (MCNN-AT) model, which combines a multi-channel convolution module and an attention mechanism to improve the classification accuracy and robustness of power quality disturbance signals. Multiple time-frequency feature maps of different scales are input into the MCNN-AT model, and the final power quality disturbance classification results are output, such as Figure 3 As shown, including:

[0106] First, multiple time-frequency feature maps of different scales are input through multiple channels, and each channel corresponds to an input time-frequency feature map. That is, the multiple time-frequency feature maps of different scales obtained above are input into the MCNN model, each time-frequency feature map corresponds to a specific frequency range, and feature information is extracted through the convolution layer. Multi-channel input can make full use of the features of different frequency ranges and improve the accuracy of classification.

[0107] Specifically, the input frequency spectrum is set to a fixed 7-channel 2D feature map, and the input feature map size of each channel is H×W×1 (201×401×1 in this embodiment). Correspondingly, if the number of frequency spectrum maps is less than 7, the remaining channels are filled with zeros, and the formula is:

[0108]

[0109] Secondly, each channel contains multiple 2D convolutional layers, activation layers, and pooling layers that are set in sequence. The time-frequency feature map is convolved through multiple 2D convolutional layers to extract feature maps at different levels; the feature map is then ReLU activated through the activation layer and converted into a nonlinear feature map, so that the neural network can fit complex functions; the nonlinear feature map is downsampled through the maximum pooling operation of the pooling layer to reduce the spatial dimension of the feature map, thereby reducing the amount of calculation and preventing overfitting, and finally outputting the pooled feature map of the channel. The above process is specifically as follows:

[0110] (1) Each channel contains multiple 2D convolutional layers to extract features at different levels. The convolution kernel size, stride, and padding of each convolutional layer are set to k×k (5×5 in this embodiment), s, and p, respectively. s and p use two convolutional layers, and the convolution operation is expressed as:

[0111] C i =X i *K;

[0112] Among them, * represents the convolution operation.

[0113] The size of the feature map after the convolution operation is:

[0114]

[0115] (2) The activation layer of each channel uses the ReLU function to transform the convolutional feature map C i Converted to nonlinear feature map A i , which can be expressed as: A i =max(0,C i ).

[0116] (3) In the pooling stage, the maximum pooling function pool l The vector is downsampled by removing all values ​​except the maximum value in the pool of consecutive length l. For a vector M of length N, it can be expressed as:

[0117]

[0118] P i =max_pool(A i );

[0119] Then, the pooled feature maps of multi-channel outputs are spliced ​​and fused to obtain a high-dimensional feature map, that is, the pooled feature map P of all channels i Concatenate into a high-dimensional feature map P and output it.

[0120] After that, the attention mechanism is introduced to calculate the importance weight of each feature map, generate an attention map, and then perform weighted fusion based on the attention map and the high-dimensional feature map to obtain the final feature map. By introducing the attention mechanism, the model's attention to important features is further enhanced, improving the accuracy of classification.

[0121] Specifically, based on the MCNN model, an attention mechanism is introduced to allocate more attention to the key feature area by calculating the importance weight of each feature map. The attention map A is generated through a convolution layer, and then the attention map is applied to the feature map P after channel fusion, which can be expressed as:

[0122] A=sigmoid(P*K A );

[0123] Then, the feature maps are weighted fused, and the calculated attention weights are applied to the feature maps to perform weighted fusion on the feature maps: att =P⊙A, where ⊙ represents element-by-element multiplication. The weighted fusion feature map can more accurately reflect the key features of the signal, reduce the impact of background noise, and improve classification accuracy.

[0124] Finally, based on the final feature map, the extracted feature map is mapped to the output space through the fully connected layer. Each neuron in the fully connected layer is connected to the neurons in the first layer for classification or regression tasks. After that, the probability that the signal belongs to different types of power quality disturbance is determined through the Softmax layer, and the final power quality disturbance classification result is output.

[0125] Specifically, based on the feature map processed by the attention mechanism, a fully connected layer is added to convert the feature map P processed by the attention mechanism into att The Softmax layer is used to convert the feature vector F′ output by the fully connected layer into a probability distribution Y to determine the probability that the signal belongs to different types of power quality disturbances. The expression is:

[0126] Y = softmax(F′);

[0127]

[0128] Among them, S is the number of categories, Y j represents the probability of the jth category.

[0129] Preferably, the model parameters are optimized through multiple iterations to ensure that the model has good classification performance on the training set; further, the performance of the model is evaluated on the validation set, and the hyperparameters of the model, such as learning rate, batch size, etc., are adjusted through grid search or random search to improve the generalization ability and robustness of the model. In addition, the classification performance of the MCNN-AT model is verified by the test set, which contains power quality disturbance signals of different types and different signal-to-noise ratio environments, to verify its advantages in classification accuracy and robustness.

[0130] In order to further verify the superiority of the method proposed in this embodiment, it is tested and verified through the following examples.

[0131] Specifically, Matlab is used to simulate and generate power quality disturbance signals according to the IEEE 1159 standard to construct a disturbance signal data set. In this embodiment, the data set contains 25 types of single and composite power quality disturbances: C1 includes harmonics, C2 voltage sag, C3 voltage swell, C4 voltage interruption, C5 voltage flicker, C6 transient oscillation, C7 transient pulse, C8 notch, C9 voltage sag + harmonics, C10 voltage swell + harmonics, C11 voltage interruption + harmonics, C12 voltage flicker + harmonics, C13 voltage sag + transient oscillation, C14 voltage C15 voltage flicker + transient oscillation, C16 voltage sag + notch, C17 voltage swell + notch, C18 voltage interruption + notch, C19 voltage flicker + notch, C20 harmonic + transient oscillation, C21 harmonic + notch, C22 transient oscillation + notch, C23 voltage sag + harmonic + transient oscillation, C24 voltage swell + harmonic + transient oscillation, C25 voltage flicker + harmonic + transient oscillation, etc. Among them, each type of disturbance generates 400 samples according to 20dB, 30dB, 50dB and no noise, totaling 10,000 samples, with a sampling frequency of 2kHz, a signal frequency of 50Hz, and 400 sampling points.

[0132] Furthermore, 10,000 samples are divided into training set, validation set and test set in a ratio of 7:1.5:1.5, the neural network initialization learning rate is set to 0.001, and the MCNN model is trained using the cross-entropy loss function (Cross-Entropy Loss) and Adam optimizer. For a sample (X, y), where X is the input feature map and y is the label, the loss function can be expressed as:

[0133]

[0134] The model is trained using the training set, and the trained model is verified using the validation set. The accuracy and loss rate iteration curves of the training process are shown in Figure 2. Figure 4 shown.

[0135] In order to verify the actual performance of the method proposed in this embodiment on the classification of power quality disturbances, the test sets under different noises are input into the trained model, and the accuracy is shown in Table 2 below, where the confusion matrix of the power quality disturbance classification under 20dB noise is as follows: Figure 5 shown.

[0136] Table 2 Accuracy of power quality disturbance classification under different noises

[0137] Model Methods Noise-free 50dB 30dB 20dB This model 99.86 99.84 99.65 99.13 ST-MCNN-AT 99.51 99.02 98.69 97.36 ST-SVM 97.76 97.53 97.16 95.37 This paper uses time-frequency method + SVM 98.64 98.60 98.08 97.22

[0138] It can be seen from Table 2 that the accuracy of the method proposed in this embodiment is better than other methods in classification accuracy under different noise levels. The multi-level optimized adaptive time-frequency analysis method in this embodiment can effectively improve the noise resistance of the system and improve the recognition accuracy under low signal-to-noise ratio conditions. The convolutional neural network model with the multi-channel attention mechanism in this embodiment has an overall higher classification accuracy than SVM, which further verifies the effectiveness of the method proposed in this embodiment.

[0139] Embodiment 2

[0140] This embodiment provides a power quality disturbance classification system based on multi-level optimized time-frequency analysis, including:

[0141] A signal acquisition module, used for acquiring power quality disturbance signals;

[0142] The VMD parameter determination module is used to determine the number of main frequency points of the power quality disturbance signal by using the mean filter envelope extreme value method; according to the number of main frequency points, the range of the decomposition level and the penalty factor in the variational mode decomposition VMD is determined, and then the sparrow search algorithm SSA is used to adaptively optimize the decomposition level and penalty factor of VMD by taking the composite evaluation index based on the VMD modal component envelope entropy value and the minimum energy loss ratio as the fitness function of the SSA algorithm to determine the optimal parameters;

[0143] A signal decomposition module is used to perform VMD decomposition on the power quality disturbance signal based on the optimal decomposition level and penalty factor to obtain multiple IMF components;

[0144] The time-frequency feature extraction module is used to perform multi-resolution S transform on multiple IMF components in sequence to obtain multiple time-frequency feature maps of different scales;

[0145] The classification module is used to input multiple time-frequency feature maps of different scales into the MCNN-AT model and output the final power quality disturbance classification results.

[0146] Embodiment 3

[0147] This embodiment provides an electronic device, including: a memory, used to store executable instructions; a processor, used to implement the above method provided by this embodiment when executing the executable instructions stored in the memory.

[0148] Embodiment 4

[0149] This embodiment also provides a computer-readable storage medium storing executable instructions. When the executable instructions are executed by a processor, the processor will be caused to execute the above method provided in this embodiment.

[0150] Embodiment 5

[0151] This embodiment provides a computer program product, which includes an executable instruction, which is a computer instruction; the executable instruction is stored in a computer-readable storage medium. When a processor of an electronic device reads the executable instruction from the computer-readable storage medium and the processor executes the executable instruction, the electronic device executes the above method provided in this embodiment.

[0152] The steps involved in the above embodiments 2 to 5 correspond to the method embodiment 1. For the specific implementation, please refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.

[0153] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.

[0154] The above description is only a preferred embodiment of the present invention. Although the specific implementation mode of the present invention is described in conjunction with the accompanying drawings, it is not a limitation of the protection scope of the present invention. Those skilled in the art should understand that on the basis of the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the protection scope of the present invention.

Claims

1. A method for classifying power quality disturbances based on multi-level optimized time-frequency analysis, characterized in that: include: Obtain power quality disturbance signals; The mean filter envelope extreme value method is used to determine the number of main frequency points of the power quality disturbance signal; According to the number of main frequency points, the range of decomposition level and penalty factor in variational mode decomposition VMD is determined, and then the sparrow search algorithm SSA is used to adaptively optimize the decomposition level and penalty factor of VMD by taking the composite evaluation index based on the VMD modal component envelope entropy value and the minimum energy loss ratio as the fitness function of the SSA algorithm to determine the optimal parameters. Based on the optimal decomposition level and penalty factor, VMD decomposition is performed on the power quality disturbance signal to obtain multiple IMF components; Perform multi-resolution S transform on multiple IMF components in sequence to obtain multiple time-frequency feature maps of different scales; Multiple time-frequency feature maps of different scales are input into the MCNN-AT model to output the final power quality disturbance classification results.

2. A method for classifying power quality disturbances based on multi-level optimized time-frequency analysis as claimed in claim 1, characterized in that: The mean filter envelope extreme value method is used to determine the number of main frequency points of the power quality disturbance signal, including: For the acquired power quality disturbance signal, the spectrum is obtained after Fourier transformation, and the spectrum amplitude is taken and normalized; Perform multiple iterations of mean filtering on the normalized spectrum, and then perform normalization on the filtered spectrum; The local maximum detection method is used to determine the maximum point in the spectrum, and the maximum envelope is constructed based on the maximum point; Find the local maximum extreme point of the maximum envelope, perform threshold screening on all the extreme points found, and calculate the number of main frequency points.

3. The method for classifying power quality disturbances based on multi-level optimized time-frequency analysis according to claim 1, characterized in that: The sparrow search algorithm SSA is used to optimize the decomposition level and penalty factor of the variational mode decomposition VMD and determine the optimal parameters, including: Set the number of sparrow populations and the number of iterations, and initialize the position of the sparrow population; In the iterative process, according to the current position of the sparrow population, the power quality disturbance signal is decomposed by VMD to obtain several IMF components. The current fitness function values ​​of all IMF components are calculated and sorted according to the fitness function of the SSA algorithm, and a set proportion of discoverers are selected from them. The joiners follow the discoverers and perform random disturbances around the local area; based on the position update formula of the discoverer and the joiner, the position of the discoverer and the joiner is updated respectively, that is, the parameter values ​​of the decomposition level and the penalty factor are updated, and it is determined whether the danger warning is triggered. If triggered, the position of the corresponding sparrow is updated according to the danger warning position update formula; after the position update is completed, VMD decomposition is performed according to the updated sparrow population position to obtain several IMF components, and the fitness function values ​​of all IMF components are calculated according to the fitness function to carry out the next round of iteration; After continuous iterations, until the set number of iterations is reached, the optimal parameter values ​​of the VMD decomposition level and penalty factor are output.

4. The method for classifying power quality disturbances based on multi-level optimized time-frequency analysis according to claim 1, characterized in that: Based on the optimal decomposition level and penalty factor, the power quality disturbance signal is decomposed by VMD to obtain multiple IMF components, and the envelope entropy value of each IMF component is calculated. The calculated envelope entropy value is compared with the set threshold to remove irregular noise components, and finally multiple IMF components are screened out.

5. The method for classifying power quality disturbances based on multi-level optimized time-frequency analysis according to claim 1, characterized in that: Perform multi-resolution S transform on the IMF components, including: The signal frequency is divided into multiple different frequency ranges, and different Gaussian parameters are selected according to different frequency ranges to perform S-transform of the IMF component.

6. The method for classifying power quality disturbances based on multi-level optimized time-frequency analysis according to claim 1, characterized in that: The MCNN-AT model is a multi-channel attention mechanism convolutional neural network model. Multiple time-frequency feature maps of different scales are input into the MCNN-AT model to output the final power quality disturbance classification results, including: Multiple time-frequency feature maps of different scales are input through multiple channels, and each channel corresponds to an input of a time-frequency feature map; Each channel contains multiple 2D convolutional layers, activation layers, and pooling layers. The time-frequency feature map is convolved through multiple 2D convolutional layers to extract feature maps at different levels. The feature map is then activated by ReLU through the activation layer and converted into a nonlinear feature map. The nonlinear feature map is downsampled through the maximum pooling operation of the pooling layer and the pooled feature map is output. The pooled feature maps of multi-channel outputs are concatenated to obtain a high-dimensional feature map; Introduce the attention mechanism, calculate the importance weight of each feature map, and generate the attention map; perform weighted fusion based on the attention map and the high-dimensional feature map to obtain the final feature map; Based on the final feature map, the probability that the signal belongs to different types of power quality disturbances is determined through the fully connected layer and the Softmax layer, and the final power quality disturbance classification result is output.

7. A power quality disturbance classification system based on multi-level optimized time-frequency analysis, characterized in that: include: A signal acquisition module, used for acquiring power quality disturbance signals; The VMD parameter determination module is used to determine the number of main frequency points of the power quality disturbance signal by using the mean filter envelope extreme value method; according to the number of main frequency points, the range of the decomposition level and the penalty factor in the variational mode decomposition VMD is determined, and then the sparrow search algorithm SSA is used to adaptively optimize the decomposition level and penalty factor of VMD by taking the composite evaluation index based on the VMD modal component envelope entropy value and the minimum energy loss ratio as the fitness function of the SSA algorithm to determine the optimal parameters; A signal decomposition module is used to perform VMD decomposition on the power quality disturbance signal based on the optimal decomposition level and penalty factor to obtain multiple IMF components; The time-frequency feature extraction module is used to perform multi-resolution S transform on multiple IMF components in sequence to obtain multiple time-frequency feature maps of different scales; The classification module is used to input multiple time-frequency feature maps of different scales into the MCNN-AT model and output the final power quality disturbance classification results.

8. An electronic device, characterized in that: include: A memory for storing executable instructions; The processor is used to implement the power quality disturbance classification method based on multi-level optimized time-frequency analysis as described in any one of claims 1 to 6 when executing the executable instructions stored in the memory.

9. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to cause a processor to execute the executable instructions to implement a power quality disturbance classification method based on multi-level optimized time-frequency analysis as described in any one of claims 1-6.

10. A computer program product, characterized in that The computer program product includes executable instructions stored in a computer-readable storage medium; When the processor of the electronic device reads the executable instructions from the computer-readable storage medium and executes the executable instructions, the power quality disturbance classification method based on multi-level optimized time-frequency analysis described in any one of claims 1 to 6 is implemented.