Method and apparatus for classifying power quality disturbances, and electronic device
Patent Information
- Application Number
- CN202610998847.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-06
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]本发明实施例提供了一种电能质量扰动的分类方法、装置以及电子设备,以至少解决相关技术中,难以准确确定电能质量扰动的分类结果的技术问题
[0015]在本发明实施例中,获取电能质量扰动对应的扰动时序信号;确定与扰动时序信号对应的初始时序张量;将初始时序张量输入至目标模型的降噪自编码器模块,得到降噪时序张量,其中,目标模型中还包括局部特征提取模块,全局特征建模模块,分类输出模块;将降噪时序张量输入至局部特征提取模块,得到目标局部特征张量,其中,目标局部特征张量对应的序列长度小于降噪时序张量对应的序列长度;将目标局部特征张量输入至全局特征建模模块,得到全局时序关联张量;将全局时序关联张量输入至分类输出模块,得到扰动类别概率分布,其中,扰动类别概率分布为表示多种电能质量扰动类别分别对应的概率分布;确定扰动类别概率分布中最大值对应的扰动类别为与扰动时序信号对应的扰动分类结果。采用降噪自编码器、局部特征提取、全局特征建模与分类输出模块依次串联处理的方式,通过初始时序张量依次经降噪处理分离噪声与扰动特征、局部特征提取缩短序列长度并抓取关键特征、全局时序关联捕捉整合时序规律及输出扰动类别概率分布的分步处理,达到了准确识别电能质量扰动类别的目的,进而解决了相关技术中,难以准确确定电能质量扰动的分类结果的技术问题。
Smart Images

Figure CN122885647A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power quality monitoring and artificial intelligence, and more specifically, to a method, apparatus, and electronic device for classifying power quality disturbances. Background Technology
[0002] With the expansion of new energy grid connection and the widespread application of nonlinear loads, power quality disturbances such as voltage sags and harmonics are becoming increasingly prominent, easily leading to failures in precision equipment and disruptions in production processes. Accurate identification of disturbance types has become a core aspect of power grid management. Existing technologies have significant shortcomings: traditional methods rely on manual feature extraction techniques such as Fourier transforms, which are significantly limited by experience and have low accuracy in identifying complex disturbances; convolutional neural network-based models can only capture local features and lack the ability to capture global temporal correlations; in low signal-to-noise ratio scenarios, conventional noise reduction modules easily lose weak disturbance features, leading to a significant decrease in classification accuracy; most deep learning models have large parameter counts and high computational complexity, making them difficult to deploy in resource-constrained scenarios such as edge computing devices. These deficiencies result in technical problems in related technologies, making it difficult to accurately determine the classification results of power quality disturbances.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides a method, apparatus, and electronic device for classifying power quality disturbances, in order to at least solve the technical problem in the related art that it is difficult to accurately determine the classification results of power quality disturbances.
[0005] According to one aspect of the present invention, a method for classifying power quality disturbances is provided, comprising: acquiring a disturbance time-series signal corresponding to a power quality disturbance; determining an initial time-series tensor corresponding to the disturbance time-series signal; inputting the initial time-series tensor into a denoising autoencoder module of a target model to obtain a denoised time-series tensor, wherein the target model further includes a local feature extraction module, a global feature modeling module, and a classification output module; inputting the denoised time-series tensor into the local feature extraction module to obtain a target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the denoised time-series tensor; inputting the target local feature tensor into the global feature modeling module to obtain a global time-series correlation tensor; inputting the global time-series correlation tensor into the classification output module to obtain a disturbance category probability distribution, wherein the disturbance category probability distribution represents the probability distributions corresponding to various power quality disturbance categories respectively; and determining the disturbance category corresponding to the maximum value in the disturbance category probability distribution as the disturbance classification result corresponding to the disturbance time-series signal.
[0006] Optionally, inputting the initial temporal tensor into the denoising autoencoder module of the target model to obtain a denoised temporal tensor includes: inputting the initial temporal tensor into the encoder module of the denoising autoencoder module to obtain an encoded temporal tensor, wherein the sequence length corresponding to the encoded temporal tensor is less than the length corresponding to the initial temporal tensor, and the number of channels corresponding to the encoded temporal tensor is greater than the number of channels corresponding to the initial temporal tensor; and inputting the encoded temporal tensor into the decoder module of the denoising autoencoder module based on a first reconstruction loss function to obtain a denoised temporal tensor, wherein the sequence length corresponding to the denoised temporal tensor is equal to the length corresponding to the initial temporal tensor, and the number of channels corresponding to the denoised temporal tensor is equal to the number of channels corresponding to the initial temporal tensor, wherein the first reconstruction loss function is used to constrain the consistency between the denoised temporal tensor and the initial temporal tensor.
[0007] Optionally, inputting the denoised temporal tensor into a local feature extraction module to obtain a target local feature tensor includes: performing a depthwise convolution operation on the denoised temporal tensor in the local feature extraction module to obtain initial local feature tensors corresponding to multiple channels respectively; performing a pointwise convolution operation on the initial local feature tensors corresponding to multiple channels respectively to obtain a fused local feature tensor; and performing a pooling operation on the fused local feature tensor to obtain a target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the fused local feature tensor.
[0008] Optionally, the target local feature tensor is input into the global feature modeling module to obtain a global temporal correlation tensor, including: performing a dimension adaptation operation on the target local feature tensor in the global feature modeling module to obtain a feature tensor in a predetermined format, wherein the predetermined format feature tensor is a feature tensor in a sequence embedding dimension format; performing a multi-head self-attention operation on the predetermined format feature tensor to obtain an attention feature tensor; and performing residual connection and multilayer perceptron transformation operations on the attention feature tensor to obtain the global temporal correlation tensor.
[0009] Optionally, inputting the global temporal correlation tensor into the classification output module to obtain the perturbation category probability distribution includes: in the classification output module, performing average pooling on the global temporal correlation tensor to obtain a global trend feature tensor, and performing max pooling on the global temporal correlation tensor to obtain a local trend feature tensor; concatenating the global trend feature tensor and the local trend feature tensor to obtain a fused feature vector; and performing linear mapping and probability transformation operations on the fused feature vector to obtain the perturbation category probability distribution.
[0010] Optionally, before inputting the initial temporal tensor into the denoising autoencoder module of the target model to obtain the denoising temporal tensor, the method further includes: training the initial autoencoder module using corresponding sample data based on the first reconstruction loss function to obtain the intermediate autoencoder module; and training the initial model using corresponding sample data based on the joint loss function to obtain the target model, wherein the joint loss function includes a weighted sum of the second reconstruction loss function and the classification loss function, and the initial model includes the intermediate autoencoder module.
[0011] Optionally, determining the initial time series tensor corresponding to the perturbed time series signal includes: performing a validity check on the perturbed time series signal to obtain a validity check result; if the validity check result is passed, normalizing the perturbed time series signal using a normalization method to obtain a normalized time series signal; and performing a dimension transformation on the normalized time series signal to obtain the initial time series tensor.
[0012] According to one aspect of the present invention, a power quality disturbance classification device is provided, comprising: an acquisition module for acquiring a disturbance time series signal corresponding to the power quality disturbance; a first determination module for determining an initial time series tensor corresponding to the disturbance time series signal; a first input module for inputting the initial time series tensor into a denoising autoencoder module of a target model to obtain a denoised time series tensor, wherein the target model further comprises a local feature extraction module, a global feature modeling module, and a classification output module; and a second input module for inputting the denoised time series tensor into the local feature extraction module to obtain a target local feature tensor. Wherein, the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the denoising time series tensor; the third input module is used to input the target local feature tensor into the global feature modeling module to obtain a global time series correlation tensor; the fourth input module is used to input the global time series correlation tensor into the classification output module to obtain a disturbance category probability distribution, wherein the disturbance category probability distribution represents the probability distribution corresponding to various power quality disturbance categories respectively; the second determination module is used to determine the disturbance category corresponding to the maximum value in the disturbance category probability distribution as the disturbance classification result corresponding to the disturbance time series signal.
[0013] According to one aspect of the present invention, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the power quality disturbance classification method described in any of the preceding claims.
[0014] According to one aspect of the present invention, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the power quality disturbance classification method described in any of the preceding claims.
[0015] In this embodiment of the invention, the following steps are taken: First, a disturbance time-series signal corresponding to a power quality disturbance is acquired. Second, an initial time-series tensor corresponding to the disturbance time-series signal is determined. Third, the initial time-series tensor is input into the denoising autoencoder module of the target model to obtain a denoised time-series tensor. The target model further includes a local feature extraction module, a global feature modeling module, and a classification output module. Fourth, the denoised time-series tensor is input into the local feature extraction module to obtain a target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the denoised time-series tensor. Fifth, the target local feature tensor is input into the global feature modeling module to obtain a global time-series correlation tensor. Sixth, the global time-series correlation tensor is input into the classification output module to obtain a disturbance category probability distribution, wherein the disturbance category probability distribution represents the probability distribution corresponding to various power quality disturbance categories. Finally, the disturbance category corresponding to the maximum value in the disturbance category probability distribution is determined as the disturbance classification result corresponding to the disturbance time-series signal. By employing a sequential processing approach involving a noise-reducing autoencoder, local feature extraction, global feature modeling, and classification output modules, the method achieves accurate identification of power quality disturbance categories. This approach addresses the technical challenge of accurately determining the classification results of power quality disturbances in related technologies. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0017] Figure 1 This is a flowchart of a method for classifying power quality disturbances according to an embodiment of the present invention;
[0018] Figure 2 This is a flowchart of the perturbation classification algorithm provided by an optional embodiment of the present invention;
[0019] Figure 3 This is a structural block diagram of a power quality disturbance classification device according to an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] Example 1
[0023] According to an embodiment of the present invention, an embodiment of a method for classifying power quality disturbances is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0024] Figure 1 This is a flowchart of a power quality disturbance classification method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0025] Step S102: Obtain the disturbance timing signal corresponding to the power quality disturbance;
[0026] Among them, power quality disturbances refer to abnormal phenomena in the power system, such as voltage and current, that deviate from the standard operating values. They can reflect the operating health status of the power grid, such as voltage sags, voltage swells, harmonics, and oscillations.
[0027] Among them, the disturbance time sequence signal refers to the sequence of electrical parameter data related to power quality disturbances collected in time order, which can record the change process of disturbance characteristics over time, such as continuous sampling data of voltage amplitude within a certain period of time.
[0028] In this step, the operation of acquiring the disturbance timing signal corresponding to the power quality disturbance is performed.
[0029] This step obtains the raw data required by the algorithm, providing the foundation for subsequent tensor transformations and model processing, and ensuring the authenticity and integrity of the data source.
[0030] Step S104: Determine the initial time series tensor corresponding to the perturbation time series signal;
[0031] The initial temporal tensor refers to a multidimensional numerical array obtained after processing the perturbed temporal signal, such as standardization and dimension transformation, which can adapt to the input format of the target model, such as a tensor with dimensions Cpre×Lpre.
[0032] In this step, the perturbation time series signal is processed to determine the corresponding initial time series tensor.
[0033] This step transforms unstructured time-series data into structured tensor form, facilitating mathematical operations by the model and eliminating dimensional differences between different monitoring dimensions, thereby improving model training efficiency.
[0034] Step S106: Input the initial temporal tensor into the denoising autoencoder module of the target model to obtain the denoising temporal tensor. The target model also includes a local feature extraction module, a global feature modeling module, and a classification output module.
[0035] Among them, the noise reduction autoencoder module refers to the feature purification module composed of an encoder and a decoder, which can separate noise and core features in the perturbed signal. For example, a module containing a two-stage 1D convolutional encoder and a two-stage transposed convolutional decoder.
[0036] Among them, the denoised temporal tensor refers to the tensor output after being processed by the denoised autoencoder module, which can retain the core features of the disturbance and filter out noise, such as the tensor Xdae with the same dimension as the initial temporal tensor.
[0037] In this step, the initial temporal tensor is input into the denoising autoencoder module of the target model to obtain the denoised temporal tensor.
[0038] This step separates noise from perturbation features, purifies core perturbation features, prevents noise from masking weak perturbation features, lays a clean data foundation for subsequent feature extraction, and improves classification accuracy.
[0039] Step S108: Input the denoised temporal tensor into the local feature extraction module to obtain the target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the denoised temporal tensor.
[0040] The local feature extraction module refers to a feature extraction module with depthwise separable convolution as its core, which can extract local key features of the denoised signal, such as a series of sub-modules containing depthwise convolution, pointwise convolution and pooling layers.
[0041] The target local feature tensor refers to the tensor output after processing by the local feature extraction module. Its sequence length is smaller than that of the denoised temporal tensor, which can preserve the perturbed local key features, such as the tensor Xcnn with dimension Cout×Lcnn.
[0042] In this step, the denoised temporal tensor is input into the local feature extraction module to obtain a target local feature tensor with a shorter sequence length.
[0043] This step accurately captures key local features of the disturbance, while downsampling reduces the sequence length, thereby reducing the computational load of subsequent global feature modeling and achieving model lightweighting.
[0044] Step S110: Input the target local feature tensor into the global feature modeling module to obtain the global temporal correlation tensor;
[0045] Among them, the global feature modeling module refers to the feature modeling module based on the simplified Transformer, which can capture the global temporal correlation of perturbation signals. For example, it includes modules such as dimension adaptation layers and simplified multi-head self-attention layers.
[0046] Among them, the global temporal correlation tensor refers to the tensor output after processing by the global feature modeling module, which can integrate the global temporal patterns of local features, such as the tensor Xtrans with dimensions Lin,trans×demb,out.
[0047] In this step, the target local feature tensor is input into the global feature modeling module to obtain the global temporal correlation tensor.
[0048] This step compensates for the lack of a global perspective in local feature extraction, captures the temporal superposition pattern of complex perturbations, and improves the recognition capability in complex perturbation scenarios.
[0049] Step S112: Input the global time series correlation tensor into the classification output module to obtain the disturbance category probability distribution, wherein the disturbance category probability distribution represents the probability distribution corresponding to various power quality disturbance categories respectively;
[0050] The classification output module can refer to a classification module that includes dual pooling feature fusion and Softmax, which can map global features to perturbation class probabilities. For example, it can include a module that includes average pooling, max pooling, and linear classification layers.
[0051] Among them, the probability distribution of disturbance categories refers to the set of probability values corresponding to various power quality disturbance categories, which can intuitively show the prediction confidence of each category, such as the distribution results of voltage sag probability 0.92 and harmonic probability 0.05.
[0052] In this step, the global time-series correlation tensor is input into the classification output module to obtain the probability distributions corresponding to various power quality disturbance categories.
[0053] This step enables the output of accurate category probability distributions, providing an interpretable basis for the final classification results.
[0054] Step S114: Determine the disturbance category corresponding to the maximum value in the disturbance category probability distribution as the disturbance classification result corresponding to the disturbance time series signal.
[0055] Among them, the disturbance classification result refers to the category corresponding to the maximum value selected from the probability distribution of disturbance categories, which can clearly identify the specific type of power quality disturbance, such as determining it as a voltage sag disturbance.
[0056] In this step, the perturbation category corresponding to the maximum value in the probability distribution of perturbation categories is selected as the perturbation classification result of the perturbation time series signal.
[0057] This step determines the classification result based on a high-confidence probability value, ensuring the accuracy of the classification and solving the technical problem of accurately identifying power quality disturbances in low signal-to-noise ratio scenarios.
[0058] Through the above steps S102-S110, the disturbance time series signal corresponding to the power quality disturbance is obtained; the initial time series tensor corresponding to the disturbance time series signal is determined; the initial time series tensor is input into the denoising autoencoder module of the target model to obtain the denoised time series tensor, wherein the target model also includes a local feature extraction module, a global feature modeling module, and a classification output module; the denoised time series tensor is input into the local feature extraction module to obtain the target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the denoised time series tensor; the target local feature tensor is input into the global feature modeling module to obtain the global time series correlation tensor; the global time series correlation tensor is input into the classification output module to obtain the disturbance category probability distribution, wherein the disturbance category probability distribution represents the probability distribution corresponding to various power quality disturbance categories respectively; the disturbance category corresponding to the maximum value in the disturbance category probability distribution is determined as the disturbance classification result corresponding to the disturbance time series signal. By employing a sequential processing approach involving a noise-reducing autoencoder, local feature extraction, global feature modeling, and classification output modules, the method achieves accurate identification of power quality disturbance categories. This approach addresses the technical challenge of accurately determining the classification results of power quality disturbances in related technologies.
[0059] As an optional embodiment, the initial temporal tensor is input into the denoising autoencoder module of the target model to obtain a denoised temporal tensor, including: inputting the initial temporal tensor into the encoder module of the denoising autoencoder module to obtain an encoded temporal tensor, wherein the sequence length corresponding to the encoded temporal tensor is less than the length corresponding to the initial temporal tensor, and the number of channels corresponding to the encoded temporal tensor is greater than the number of channels corresponding to the initial temporal tensor; based on a first reconstruction loss function, the encoded temporal tensor is input into the decoder module of the denoising autoencoder module to obtain a denoised temporal tensor, wherein the sequence length corresponding to the denoised temporal tensor is equal to the length corresponding to the initial temporal tensor, and the number of channels corresponding to the denoised temporal tensor is equal to the number of channels corresponding to the initial temporal tensor, and the first reconstruction loss function is used to constrain the consistency between the denoised temporal tensor and the initial temporal tensor.
[0060] The encoder module refers to the feature compression sub-module in the noise reduction autoencoder module that uses two-level 1D convolutional layers. It can reduce the sequence length and increase the number of channels, and force the learning of noise-independent perturbation core features. For example, it includes a sub-module with two-level 1D convolutional layers with a kernel size of 3 and a stride of 2.
[0061] Here, the encoded temporal tensor refers to the tensor output after the initial temporal tensor has been processed by the encoder module. Its sequence length is less than that of the initial temporal tensor, and its number of channels is greater than that of the initial temporal tensor. For example, it has dimensions of Cent × Lenc, and Lenc...<Lpre、Cenc> Cpre tensors.
[0062] The first reconstruction loss function refers to the L2 loss function used to constrain the consistency between the denoised temporal tensor and the initial temporal tensor, which can drive the decoder module to accurately reconstruct the perturbation signal. The formula is as follows.
[0063] The decoder module refers to the signal reconstruction submodule in the noise reduction autoencoder module that uses two levels of 1D transposed convolutional layers. It can recover the original sequence length and number of channels of the tensor. For example, it includes a submodule with two levels of transposed convolutional layers with a transposed convolutional kernel size of 3 and a stride of 2.
[0064] In this embodiment, the initial temporal tensor is input into the encoder module of the denoising autoencoder module, and after 1D convolution, batch normalization, activation function and dropout operation, a coded temporal tensor with a shorter sequence length and more channels is obtained; then based on the first reconstruction loss function, the coded temporal tensor is input into the decoder module, and after transpose convolution and batch normalization operation, a denoising temporal tensor with the same dimension as the initial temporal tensor is obtained.
[0065] In this approach, the encoder module can compress redundant noise information and enhance the core features of disturbances such as voltage sags and harmonics, while the decoder module can accurately recover the dimensions of the disturbance signal. The first reconstruction loss function ensures that the denoised tensor is highly consistent with the original disturbance features. Compared to the shortcomings of existing soft-threshold denoising modules that easily lose weak disturbance features, the DAE denoising scheme in this embodiment can effectively separate noise and disturbance features in low signal-to-noise ratio scenarios with SNR≤20dB, avoiding the masking of weak disturbance features by noise and providing a clean data foundation for subsequent feature extraction. At the same time, the symmetric convolutional structure of the encoder and decoder has fewer parameters, which significantly reduces computational complexity compared to traditional autoencoders based on fully connected layers, adapting to the computing power requirements of edge computing devices.
[0066] As an optional embodiment, the denoised temporal tensor is input into the local feature extraction module to obtain the target local feature tensor, including: in the local feature extraction module, performing a depthwise convolution operation on the denoised temporal tensor to obtain initial local feature tensors corresponding to multiple channels respectively; performing a pointwise convolution operation on the initial local feature tensors corresponding to multiple channels respectively to obtain a fused local feature tensor; and performing a pooling operation on the fused local feature tensor to obtain the target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the fused local feature tensor.
[0067] Among them, depthwise convolution operation refers to the convolution operation performed independently on each channel of the input tensor, which can extract local perturbation features within a single channel, such as convolution operations performed on voltage, current, and phase difference channels respectively.
[0068] The initial local feature tensor refers to the tensor output after the denoising temporal tensor undergoes depthwise convolution, which can carry the independent local features of each channel, such as a tensor with the same number of input channels.
[0069] Pointwise convolution refers to cross-channel feature fusion operations implemented through a 1×1 convolution kernel, which can improve the expressive power of local features, such as the operation of fusing the amplitude change features of the voltage channel with the harmonic features of the current channel.
[0070] Among them, the fused local feature tensor refers to the tensor output after the initial local feature tensor undergoes pointwise convolution operation, which can carry the local features after multi-channel fusion, such as a tensor with dimensions Ctemp×Lin.
[0071] Pooling operations refer to feature aggregation operations used to shorten sequence lengths, which can reduce the computational complexity of subsequent modules, such as adaptive pooling and max pooling operations.
[0072] In this embodiment, within the local feature extraction module, a depthwise convolution operation is first performed on the denoised temporal tensor to obtain an initial local feature tensor corresponding to multiple channels; then a pointwise convolution operation is performed on the initial local feature tensor to obtain a fused local feature tensor; finally, a pooling operation is performed on the fused local feature tensor to obtain a target local feature tensor with a shorter sequence length.
[0073] This approach allows for the precise extraction of local perturbation features from each monitoring channel through depthwise convolution, avoiding interference between signals from different channels. Pointwise convolution achieves cross-channel feature fusion with minimal parameters, reducing the number of parameters to approximately 1 / 9 of that of ordinary convolutional layers, thus achieving model lightweighting. Pooling operations shorten the sequence length while preserving key information in local features, reducing the computational burden on subsequent Transformer modules. This module addresses the shortcomings of existing CNN models, such as parameter redundancy and insufficient local feature extraction. It can accurately capture features such as sudden changes in local amplitude of voltage surges and periodic fluctuations of oscillations, while also meeting the computational limitations of edge devices, balancing feature extraction accuracy with lightweight design requirements.
[0074] As an optional embodiment, the target local feature tensor is input into the global feature modeling module to obtain a global temporal correlation tensor, including: in the global feature modeling module, performing a dimension adaptation operation on the target local feature tensor to obtain a feature tensor of a predetermined format, wherein the feature tensor of the predetermined format is a feature tensor of a sequence embedding dimension format; performing a multi-head self-attention operation on the feature tensor of the predetermined format to obtain an attention feature tensor; and performing residual connection and multilayer perceptron transformation operations on the attention feature tensor to obtain a global temporal correlation tensor.
[0075] Among them, the dimension adaptation operation refers to the operation of converting a channel-sequence format tensor into a sequence-embedding dimension format, which enables local features to adapt to the computational requirements of the self-attention mechanism. For example, the operation of converting a Cout×Lcnn tensor into an Lcnn×demb tensor through a 1×1 convolution.
[0076] Among them, the predefined format feature tensor refers to the tensor output after the target local feature tensor undergoes dimension adaptation operation, and its format is a sequence embedding dimension, such as a tensor with dimensions Lin,trans×demb.
[0077] Among them, the sequence embedding dimension format refers to a tensor format with the sequence length as the first dimension and the embedding dimension as the second dimension. It can be adapted to multi-head self-attention operations, such as the standard input format of Transformer.
[0078] Among them, multi-head self-attention operation refers to the operation of capturing global temporal correlations in parallel by multiple sets of attention heads, which can improve the global representation ability of features, such as the calculation operation of multiple sets of QKV matrices.
[0079] Among them, the attention feature tensor refers to the tensor output after a predefined format feature tensor undergoes multi-head self-attention operation, which can carry global temporal correlation information, such as a tensor that fuses the results of multiple attention heads.
[0080] Among them, residual connection refers to the operation of superimposing the module input with the intermediate output, which can alleviate the gradient vanishing problem in deep networks, such as the operation of superimposing the attention feature tensor with the feature tensor of a predetermined format.
[0081] Among them, the multilayer perceptron transformation operation refers to the nonlinear feature enhancement operation implemented through linear layers and activation functions, which can improve the expressive power of features, such as the MLP operation containing two linear layers.
[0082] In this embodiment, within the global feature modeling module, a dimension adaptation operation is first performed on the target local feature tensor to obtain a feature tensor with a predetermined format; then, a multi-head self-attention operation is performed on the feature tensor with the predetermined format to obtain an attention feature tensor; finally, a residual connection and multilayer perceptron transformation operation is performed on the attention feature tensor to obtain a global temporal correlation tensor.
[0083] This approach addresses the format compatibility issue between local feature tensors and self-attention mechanisms, ensuring smooth global feature modeling. Simplified multi-head self-attention operations enable parallel capture of global temporal patterns across different dimensions, such as the timing correlation of voltage sags and the superposition of harmonic and sag disturbances. Compared to the inability of traditional LSTM models to perform parallel computations, this significantly reduces inference time. Residual connections and MLP transformations enhance feature representation capabilities and alleviate the gradient vanishing problem in deep networks. This module compensates for the lack of a global perspective in existing CNN models, accurately identifying the temporal superposition features of complex disturbances. Simultaneously, the simplified attention head design reduces the number of parameters, avoiding the parameter redundancy problem of Transformer models, achieving a balance between global feature capture capability and lightweight characteristics.
[0084] As an optional embodiment, the global temporal correlation tensor is input into the classification output module to obtain the probability distribution of the perturbation category, including: in the classification output module, performing an average pooling operation on the global temporal correlation tensor to obtain a global trend feature tensor, and performing a max pooling operation on the global temporal correlation tensor to obtain a local trend feature tensor; concatenating the global trend feature tensor and the local trend feature tensor to obtain a fused feature vector; and performing linear mapping and probability transformation operations on the fused feature vector to obtain the probability distribution of the perturbation category.
[0085] Among them, the average pooling operation refers to the pooling operation that calculates the global mean of a tensor. It can extract the global trend features of the disturbance signal, such as calculating the mean at each position of the global time-series correlation tensor to capture the amplitude change trend of the entire voltage sag.
[0086] Among them, the global trend feature tensor refers to the tensor output by the global temporal correlation tensor after the average pooling operation, which can carry the global change law of the disturbance signal, such as the one-dimensional mean feature tensor.
[0087] Max pooling is a pooling operation that calculates the global maximum value of a tensor. It can extract local salient features of perturbation signals, such as calculating the maximum value at each position of a global time-series correlation tensor to capture the peak features of oscillating signals.
[0088] Among them, the local trend feature tensor refers to the tensor output by the global temporal correlation tensor after the max pooling operation, which can carry the local abrupt change features of the perturbation signal, such as the one-dimensional maximum feature tensor.
[0089] Among them, the concatenation operation refers to the operation of combining multiple tensors according to their dimensions, which can achieve feature complementarity, such as concatenating the global trend feature tensor and the local trend feature tensor into a one-dimensional vector.
[0090] Among them, the fused feature vector refers to the vector output after concatenating the global trend feature tensor and the local trend feature tensor. It can carry comprehensive perturbation features, such as a one-dimensional vector whose dimension is the sum of the dimensions of the two types of features.
[0091] Linear mapping refers to a linear transformation operation that maps the fused feature vector to the category space. It can establish a correspondence between features and perturbation categories. For example, a fully connected layer can be used to map the fused vector to a dimension that matches the number of perturbation categories.
[0092] Among them, probability transformation operation refers to the operation of converting the result of linear mapping into a probability distribution, which can output the confidence level of various perturbations, such as the Softmax function operation.
[0093] In this embodiment, within the classification output module, average pooling and max pooling operations are performed on the global temporal correlation tensor to obtain a global trend feature tensor and a local trend feature tensor; then, a concatenation operation is performed on the two feature tensors to obtain a fused feature vector; finally, linear mapping and probability transformation operations are performed on the fused feature vector in sequence to obtain the perturbation category probability distribution.
[0094] This approach utilizes dual pooling to simultaneously extract global trends and local salient features, overcoming the limitation of incomplete features in existing classification modules that rely on single pooling. For example, average pooling captures the trend of zero amplitude throughout a voltage interruption, while max pooling captures the instantaneous peak features of an impact disturbance. The concatenation of these two methods provides a more comprehensive classification basis. Linear mapping and probability transformation establish a precise mapping from features to categories, and the output probability distribution visually demonstrates the confidence level of various disturbances, improving the interpretability of the classification results. Compared to traditional support vector machine-based classification methods, the classification module in this embodiment does not require manual feature design and can adaptively complete the feature-to-category mapping. It improves classification accuracy by more than 10% in low signal-to-noise ratio scenarios, with a particularly significant improvement in the accuracy of recognizing complex disturbances.
[0095] As an optional embodiment, before inputting the initial temporal tensor into the denoising autoencoder module of the target model to obtain the denoising temporal tensor, the method further includes: training the initial autoencoder module using the corresponding sample data based on the first reconstruction loss function to obtain the intermediate autoencoder module; and training the initial model using the corresponding sample data based on the joint loss function to obtain the target model. The joint loss function includes a weighted sum of the second reconstruction loss function and the classification loss function, and the initial model includes the intermediate autoencoder module.
[0096] Among them, sample data refers to power quality disturbance signal data containing labeled information, which can be used for model training and optimization, such as time-series signal data labeled as a composite disturbance of voltage sag harmonics and voltage rise.
[0097] The initial autoencoder module refers to the denoising autoencoder module that has not been trained, but can acquire noise separation capability through training, such as the initially built encoder-decoder symmetric convolution structure.
[0098] The intermediate autoencoder module refers to the denoising autoencoder module trained by the first reconstruction loss function, which can achieve stable separation of noise and perturbation features, such as the DAE module with effective noise reduction capability in the SNR=10dB scenario.
[0099] The joint loss function refers to the loss function obtained by weighting the second reconstruction loss function and the classification loss function. It can balance the noise reduction effect and classification accuracy of the model. For example, Ljoint=αLrec+βLcls.
[0100] The second reconstruction loss function refers to the loss function used to constrain the noise reduction effect during the joint training phase. It can maintain the noise separation capability of the DAE module, such as the same L2 loss as the first reconstruction loss function.
[0101] Among them, the classification loss function refers to the loss function used to constrain the classification accuracy of the model, which can drive the model to output accurate class probabilities, such as the cross-entropy loss function.
[0102] The initial model refers to the model to be trained, which includes an intermediate autoencoder module and can be trained to obtain the target model through a joint loss function, such as the initial concatenation structure of DAE-CNN-Transformer.
[0103] In this embodiment, an initial autoencoder module is first trained using sample data based on a first reconstruction loss function to obtain an intermediate autoencoder module with noise reduction capability; then, the intermediate autoencoder module is combined with the remaining modules to form an initial model, and the initial model is trained using sample data based on a joint loss function to obtain the target model.
[0104] This approach ensures the noise separation capability of the DAE module through separate pre-training, preventing the denoising function from being weakened by the classification task during subsequent joint training, thus solving the problem of denoising and classification imbalance in existing models. The joint loss function balances denoising effect and classification accuracy through weight coefficients α and β, and the weights can be flexibly adjusted according to different signal-to-noise ratio scenarios. For example, increasing the weight of α in low signal-to-noise ratio scenarios enhances denoising capability. Meanwhile, Dropout and L2 regularization introduced during training effectively prevent model overfitting, while the early stopping mechanism saves optimal parameters based on validation set accuracy, avoiding overtraining. This training strategy addresses the low accuracy of existing models in low signal-to-noise ratio scenarios, maintaining a classification accuracy of over 90% even with SNR ≤ 20dB, while also considering the model's generalization ability.
[0105] As an optional embodiment, determining the initial time series tensor corresponding to the perturbation time series signal includes: performing a validity check on the perturbation time series signal to obtain a validity check result; if the validity check result is passed, normalizing the perturbation time series signal using a standardization method to obtain a normalized time series signal; and performing a dimension transformation on the normalized time series signal to obtain the initial time series tensor.
[0106] Among them, validity verification refers to the quality inspection operation performed on the perturbed time-series signal, which can remove abnormal data, such as removing samples with signal truncation, missing metadata, or amplitude exceeding the normal range.
[0107] Among them, the validity verification result refers to the judgment conclusion of the validity verification, which can screen out qualified disturbance timing signals, such as the detection result of passing or failing.
[0108] Standardization methods refer to normalization methods used to eliminate differences in data units, which can improve the training efficiency of models, such as the Z-Score standardization method.
[0109] Normalization refers to the numerical adjustment operation performed on the perturbed time-series signal using a standardization method, which can unify the data distribution, such as mapping voltage and current data to a numerical range with a mean of 0 and a standard deviation of 1.
[0110] Normalized time series signals refer to the signals output after the perturbation time series signals have been normalized, which can adapt to dimension transformation operations, such as time series signals with a mean of 0 and a standard deviation of 1.
[0111] Dimension transformation refers to the operation of reconstructing a normalized time series signal into a multidimensional tensor, which enables the data to adapt to the model input format, such as the operation of converting a one-dimensional time series signal into a Cpre×Lpre tensor.
[0112] In this embodiment, the perturbation time-series signal is first validated to obtain a validation result. If the validation result is satisfactory, the perturbation time-series signal is normalized using a standardization method to obtain a normalized time-series signal. Finally, the normalized time-series signal undergoes dimensionality transformation to obtain an initial time-series tensor. This method allows for the elimination of outlier samples, ensuring the quality of input data and preventing model training bias caused by signal truncation, abnormal amplitude, etc., thus addressing the shortcomings of existing non-standard data preprocessing. Normalization eliminates the dimensional differences between different monitoring dimensions, such as the difference between the kV unit of voltage and the A unit of current, unifying data distribution and accelerating model training convergence. Dimensional transformation converts unstructured time-series signals into structured tensors, adapting to the model's input format and laying the foundation for subsequent module operations. This preprocessing process improves the purity and reliability of the training dataset, enabling the model to have stronger adaptability in different power grid monitoring scenarios. Simultaneously, the standardized data format shortens the model training cycle and improves training efficiency.
[0113] Based on the above embodiments and optional embodiments, an optional implementation method is provided, which is described in detail below.
[0114] In related technologies, with the expansion of grid connection of new energy sources such as wind and solar power, and the widespread application of nonlinear loads such as new energy vehicles and power electronic equipment, power quality disturbances such as voltage dips, voltage swells, harmonics, and oscillations in power systems are becoming increasingly prominent. PQDs can not only cause failures in precision equipment and interruptions in production processes, but may also result in large-scale power losses. Therefore, rapid and accurate identification of PQDs is a core aspect of power quality management.
[0115] Existing PQDs identification technology has the following key shortcomings:
[0116] 1. Limitations of traditional methods
[0117] Relying on manual feature extraction methods such as Fourier transform and wavelet transform, and combining them with classifiers such as support vector machines and decision trees, there are problems such as feature design relying on experience, easy loss of weak disturbance features, and low accuracy in recognizing complex disturbances, making it difficult to adapt to complex power grid environments.
[0118] 2. Deficiencies of Deep Learning Models
[0119] While existing CNN-based models can adaptively extract local features, they lack the ability to capture global temporal correlations; LSTM-based hybrid models have redundant parameters and cannot be parallelized for acceleration, resulting in long inference times; recognition methods that convert temporal signals into images require additional data conversion steps, increasing computational complexity and processing time.
[0120] 3. Poor adaptability to low signal-to-noise ratio.
[0121] In strong noise environments with SNR≤20dB, commonly used noise reduction modules such as soft threshold modules are prone to losing weak disturbance features due to threshold calculation deviations, resulting in a significant drop in recognition accuracy and making it difficult to meet the needs of complex noise scenarios in actual power grids.
[0122] 4. Insufficient lightweight design
[0123] Most deep learning models have more than 100,000 parameters and 100,000 floating-point operations (FLOPs). 7 The limited computing power and limited memory and computing power of edge computing devices restrict the scope of engineering applications.
[0124] In view of this, an optional embodiment of the present invention provides a classification method for power quality disturbances, which can also be called a lightweight power quality disturbance classification algorithm based on deep learning and suitable for low signal-to-noise ratio. It preprocesses the original PQDs time-series signal by using a DAE to denoise and separate noise from the core disturbance features, thus refining the signal representation. Then, an improved CNN module is used to extract local key features of the denoised signal. Simultaneously, downsampling operations through multiple modules are used to shorten the signal sequence length, reducing the computational pressure of subsequent global feature modeling. Finally, a simplified Transformer module is used to capture the global temporal correlation of the signal. Combined with dual-pooling feature fusion and Softmax classification, accurate identification of power quality disturbances is achieved, balancing the model's noise robustness, lightweight characteristics, and real-time recognition. It overcomes the shortcomings of existing PQDs recognition models, such as low accuracy, large parameter count, and long inference time at low signal-to-noise ratios, providing a lightweight model based on DAE-CNN-Transformer, achieving high recognition accuracy while meeting the deployment requirements of resource-constrained scenarios. Figure 2 This is a flowchart of the perturbation classification algorithm provided by an optional embodiment of the present invention, such as... Figure 2 As shown, it will be introduced below:
[0125] The mathematical derivation of the core modules of the model in this invention revolves around the signal flow direction, and the module dimensions and weights, the inputs and outputs of each module, and the key intermediate operation logic are detailed below:
[0126] 1) DAE noise reduction module
[0127] Assuming the input of the perturbation signal is V(t), the input of the DAE denoising module is the multi-channel power quality perturbation (PQDs) time series tensor after the perturbation signal has undergone normalization and dimensionality transformation preprocessing. (Same as above for determining the initial time series tensor corresponding to the perturbation time series signal), output the denoised multi-channel time series tensor. (Similar to the above, the initial temporal tensor is input into the denoising autoencoder module of the target model to obtain the denoised temporal tensor).
[0128] in Indicates the number of input channels. This indicates the length of the preprocessed sequence.
[0129] The DAE noise reduction module achieves noise separation through encoder compression and decoder reconstruction. The core calculation process is as follows:
[0130] 1. Encoder Feature Compression
[0131] By employing two-stage 1D convolutional layers to successively reduce sequence length and increase the number of channels, the model is forced to learn noise-independent core perturbation features. (Similar to the encoder module above, which inputs the initial temporal tensor into the denoising autoencoder module to obtain the encoded temporal tensor), the formula is:
[0132]
[0133] in, These are the weight matrices for the first and second convolutional layers, respectively. , These are the corresponding bias terms; This represents a 1D convolution operation; For batch normalization function; These are activation functions, such as ReLU and SiLU, used to introduce nonlinear feature maps; This is a random deactivation operation used to enhance the model's ability to generalize to noise; , The number of encoder output channels. This specifies the length of the encoder output sequence.
[0134] 2. Decoder signal reconstruction
[0135] Two-stage 1D transposed convolutional layers are used to recover the sequence dimension, and the output is the denoised feature (similar to the decoder module that inputs the encoded temporal tensor into the denoised autoencoder module to obtain the denoised temporal tensor), formula:
[0136]
[0137] in, , These are the weight matrices for the first and second transposed convolutional layers, respectively. , These are the corresponding bias terms; This indicates a 1D transpose convolution operation, used to recover the sequence length; Output dimension and input Consistency is ensured to guarantee compatibility of input formats in subsequent modules.
[0138] 3. Reconstruction loss constraints (same as the first reconstruction loss function above)
[0139] by The loss ensures the consistency between the denoised signal and the original perturbation characteristics, as shown in the formula:
[0140]
[0141] in, for Norm, The reconstruction loss is used to optimize the noise reduction effect of DAE.
[0142] 2) CNN Local Feature Extraction Module
[0143] The input to the CNN module is the tensor output by the DAE denoising module. ,in This indicates the number of input channels for the CNN module. This represents the length of the input sequence to the CNN module. The output is a local feature tensor. (As mentioned above, the denoising temporal tensor is input into the local feature extraction module to obtain the target local feature tensor).
[0144] A single CNN submodule uses depthwise separable convolution-activation-pooling as its core to achieve local feature extraction and sequence downsampling. When multiple submodules are cascaded, the output of the previous submodule becomes the input of the next submodule, with consistent computational logic. The core computational formula is as follows:
[0145]
[0146] in, , These are the weight matrix and bias term for each depthwise convolutional layer. This indicates a depthwise convolution operation (independent convolution of each input channel to extract local features within the channel) (similar to performing a depthwise convolution operation on the denoising temporal tensor to obtain initial local feature tensors corresponding to multiple channels). , These are the weight matrix and bias term of the pointwise convolutional layer, respectively. This indicates a pointwise convolution operation, which uses a 1×1 convolution kernel to achieve feature fusion between channels and improve feature representation capability (similar to the pointwise convolution operation performed on the initial local feature tensors corresponding to multiple channels to obtain the fused local feature tensor). Activation functions (such as SiLU, ReLU, etc.) For batch normalization function (unifying feature distribution and accelerating model training); Pooling operations (such as adaptive pooling, max pooling, etc.) are used to shorten the sequence length (i.e., , (The output sequence length of the CNN module is calculated by pooling the fused local feature tensor as described above to obtain the target local feature tensor, where the sequence length of the target local feature tensor is less than the sequence length of the fused local feature tensor), thus reducing the computational complexity of subsequent modules. , This represents the number of output channels for the CNN module.
[0147] 3) Transformer Global Feature Modeling Module
[0148] The input to the Transformer module is the tensor output by the CNN local feature extraction module. ,in This indicates the number of input channels for the Transformer module. This indicates the length of the input sequence for the Transformer module. The output is a global feature tensor. ,in Keep the length consistent with the input sequence. The embedding dimension of the final global feature (similar to the above, inputting the target local feature tensor Xcnn into the global feature modeling module to obtain the global temporal correlation tensor).
[0149] A single Transformer submodule is based on dimensionality adaptation, simplified multi-head self-attention, residual connections, and multilayer perceptron (MLP) to achieve global temporal feature capture. When multiple submodules are connected in series, the output of the previous submodule becomes the input of the next submodule, and the operation logic is consistent. The core operation integration formula is as follows:
[0150]
[0151] The definitions of each parameter and operation are as follows:
[0152] 1. Dimensional adaptation
[0153] The channel-sequence format tensor output by the CNN is converted into the sequence-embedding dimension format required by the self-attention mechanism (similar to the dimension adaptation operation performed on the target local feature tensor XCNN above, to obtain a feature tensor of a predetermined format, where the feature tensor of the predetermined format is a feature tensor of sequence embedding dimension format). The formula is as follows:
[0154] ;
[0155] in, , These are the weight matrix and bias term of the dimension adaptation layer, respectively. For the dimension-adapted sequence tensor, , For the embedding dimension of the Transformer module; This is a 1D convolution operation used to adjust the number of channels to the embedding dimension.
[0156] 2. Streamlined multi-head self-attention
[0157] Global correlations are captured in parallel by multiple attention heads, and then concatenated and fused to improve feature representation capabilities (similar to the above-mentioned multi-head self-attention operation on a predefined format feature tensor to obtain an attention feature tensor):
[0158] , , The first The query, key, and value matrix of each attention head is composed of... The linear transformation yields the following formula: , , ;
[0159] , , , , , : These are the linear transformation weights and bias terms of the query, key, and value matrices, respectively; For the dimension of a single attention head, , For the number of attention heads; It is a normalization operation used to generate attention weights for each sequence position; It is a splicing operation of the results of multi-head attention; These represent the weight matrix and bias term of the attention output layer, respectively, used to unify the feature dimensions after multi-head concatenation.
[0160] 3. Residual Connections and MLP
[0161] Gradient vanishing is mitigated through residual feedback, and nonlinear feature extraction is enhanced through MLP (similar to the above operation of residual connection and multilayer perceptron transformation on the attention feature tensor to obtain the global temporal correlation tensor):
[0162]
[0163] in, It is a batch normalization function used to unify feature distribution and accelerate model training; It is a residual connection operation that superimposes the module input with the intermediate output to preserve the original feature information; , , , These are the weights and bias terms of the two linear transformation layers of the MLP, respectively; These are activation functions (such as ReLU, GELU, etc.) used to introduce non-linear feature maps; It is the output tensor of the Transformer submodule. , Embed the dimension into the output of the Transformer module.
[0164] (III) Disturbance Classification Method
[0165] This invention provides a lightweight power quality disturbance classification algorithm based on deep learning, suitable for low signal-to-noise ratio scenarios. The method for classifying power quality disturbances includes: First, collecting a large number of power quality disturbance samples and labeling their types. Then, pre-training a DAE module to minimize reconstruction loss and separate noise and disturbance features; next, concatenating the pre-trained DAE module with a CNN local feature extraction module, a Transformer global feature modeling module, and a classification output module; and training the overall model end-to-end using a joint loss function (a weighted sum of reconstruction loss and classification loss); finally, inputting the fused features into a classification layer, and outputting the probability distribution of various disturbances using a Softmax function.
[0166] 1) Data collection and labeling
[0167] During the data acquisition and labeling phase, high-precision power quality monitoring equipment is used to collect PQDs signals in the power grid during operation. Each PQDs sample must include key parameters such as signal duration, disturbance start and end times, and amplitude variation range to ensure the traceability of the samples and the authenticity of the scenario. Then, experts in the field label the disturbance type.
[0168] 2) DAE noise reduction
[0169] The DAE noise reduction module separates noise and perturbation features through encoder compression-decoder reconstruction, providing a clean signal for subsequent feature extraction. The specific steps are as follows:
[0170] Encoder feature compression: The preprocessed PQDs tensor is sequentially subjected to 1D convolution, batch normalization, and activation function operation. The sequence length is reduced and the number of channels is increased through two-level convolution. At the same time, Dropout operation is introduced to randomly deactivate some neurons, forcing the model to learn core perturbation features that are independent of noise.
[0171] Decoder signal reconstruction: A 1D transposed convolutional layer is used to restore the dimension of the compressed features output by the encoder. The sequence length and the original number of channels are gradually restored through two levels of transposed convolution. Batch normalization and activation functions are combined in the process to ensure the consistency between the reconstructed signal and the original perturbation features.
[0172] Loss optimization: The difference between the preprocessed signal and the reconstructed signal is calculated using the reconstruction loss function. The weight parameters of the encoder and decoder are iteratively optimized through backpropagation, so that the DAE has stable noise suppression capability.
[0173] 3) CNN Local Feature Extraction
[0174] The CNN local feature extraction module extracts key local features of the denoised PQDs signal and shortens the sequence length through depthwise separable convolution and pooling operations. The specific steps are as follows:
[0175] Depthwise separable convolution: Each input channel is independently convolved through depthwise convolution to extract local perturbation features within the channel; then, feature fusion between different channels is achieved through pointwise convolution to improve feature representation capability.
[0176] Nonlinear activation: An activation function is introduced after pointwise convolution to enhance the model's ability to capture complex perturbation features through nonlinear transformation, avoiding the linear limitations of feature mapping.
[0177] Pooling dimensionality reduction: Adaptive pooling or max pooling operations are used to shorten the sequence length to reduce the computational complexity of subsequent modules, while preserving key information in local features.
[0178] 4) Transformer global feature modeling
[0179] The Transformer global feature modeling module captures the global temporal correlation of PQDs signals through dimension adaptation, self-attention, and residual optimization. The specific steps are as follows:
[0180] Dimensional adaptation: The channel-sequence format tensor output by the CNN is converted into the sequence-embedding dimension format required by the self-attention mechanism through a 1×1 convolutional layer, ensuring that the input format matches the computational requirements of the Transformer;
[0181] Simplified multi-head self-attention: The adapted sequence tensor is linearly mapped to a query (Q), key (K), value (V) matrix. After splitting according to the preset number of attention heads, the single-head attention weight is calculated (normalized by Softmax) and weighted summation is performed. The multi-head attention results are then concatenated and the feature dimensions are unified through a linear layer to achieve parallel capture of global temporal correlations.
[0182] Residual connections and MLP optimization: Residual connections are introduced after the self-attention output (superimposing the module input and the self-attention output) to alleviate the gradient vanishing problem in deep networks; then, nonlinear feature enhancement is performed through multilayer perceptron (MLP), and batch normalization is combined to unify the feature distribution and improve the representation ability of global features.
[0183] 5) Classified output
[0184] The classification output module accurately determines the category of PQDs through feature fusion and probability calculation. The specific steps are as follows:
[0185] Feature fusion: Average pooling and max pooling operations are performed on the global feature tensor output by the Transformer, and the results of the double pooling are concatenated into a one-dimensional feature vector to achieve global-local feature complementarity (similar to the above operation of average pooling on the global temporal correlation tensor Xtrans to obtain the global trend feature tensor, and max pooling on the global temporal correlation tensor Xtrans to obtain the local trend feature tensor; the global trend feature tensor and the local trend feature tensor are concatenated to obtain the fused feature vector).
[0186] Linear layer mapping: The fused one-dimensional feature vector is mapped to a dimension that matches the number of PQDs categories through a linear layer, completing the initial feature-category mapping;
[0187] Probability output: The Softmax activation function is introduced to convert the category scores output by the linear layer into the probability distribution of various perturbations. The category corresponding to the maximum probability is taken as the final PQDs recognition result to ensure the interpretability of the classification result (similar to the above linear mapping and probability transformation operation on the fused feature vector to obtain the probability distribution of perturbation categories).
[0188] Specifically, for example:
[0189] 1. Data Preparation
[0190] We collect samples of power quality disturbances (PQDs) covering both single and composite types, and complete accurate annotations to provide high-quality data support for model training and validation.
[0191] (I) Dataset Construction
[0192] The dataset of this invention is constructed through field collection. The sample types cover typical power grid disturbance scenarios, including various single disturbances and compound disturbances. Each sample contains metadata such as signal duration, disturbance start and end time, amplitude deviation range, and noise level (if noise is present), ensuring data traceability and scenario authenticity.
[0193] (II) Labeling Process
[0194] The annotation work of the dataset in this invention is carried out by professionals in the field of power quality monitoring. The standardized process is followed to ensure the accuracy and consistency of the annotation. The annotation results need to be reviewed at three levels. After the initial annotation personnel complete the classification, the senior engineers will re-annotate it. Finally, the annotation results are confirmed through cross-validation, and abnormal annotation samples are removed.
[0195] 2. Model Building
[0196] Based on the aforementioned theoretical framework, a PQDs recognition model was built. The design of each core module followed the principles of noise reduction priority, lightweight design, and performance balance, as detailed below:
[0197] (I) Design of DAE Noise Reduction Module
[0198] The DAE noise reduction module adopts a convolutional noise reduction autoencoder (CDAE) structure. Its core design focuses on noise separation and signal reconstruction, and the steps are as follows:
[0199] Input layer: Defines the dimensions of the preprocessed multichannel PQDs tensor to adapt to the input format of the subsequent encoder;
[0200] Encoder design: Set appropriate number of convolutional layers, kernel size, and stride;
[0201] Decoder design: Set appropriate number of convolutional layers, kernel size and stride to gradually restore sequence length and original number of channels, ensuring that the output dimension is consistent with the input;
[0202] Dropout layer: Appropriately sets the neuron inactivation probability, randomly blocks some feature maps, and prevents the model from overfitting noisy features;
[0203] Activation and Normalization: Both the encoder and decoder use a batch normalization layer (BN) and an activation function (such as ReLU) in series. BN is used to unify the feature distribution, and the activation function introduces nonlinearity to improve noise reduction capability.
[0204] (II) Design of CNN Local Feature Extraction Module
[0205] The core of CNN module design is lightweight extraction of local perturbation features and shortening of sequence length. The key steps are as follows:
[0206] Depthwise separable convolutional layers: Set appropriate depthwise convolutional kernel size and pointwise convolutional output channel number to accurately extract local features while significantly reducing the number of parameters and computational complexity;
[0207] Pooling layer: Set appropriate pooling kernel size, stride and pooling method to shorten the signal sequence length, reduce the computational pressure of subsequent Transformer modules, and preserve local key features;
[0208] Activation function layer: Set an appropriate activation function type and introduce nonlinear transformation.
[0209] (III) Design of Transformer Global Feature Modeling Module
[0210] The core design principle of the Transformer module is to efficiently capture global temporal correlations. The key steps are as follows:
[0211] Dimension adaptation layer: Set the convolution kernel size and output dimension of the adaptation layer appropriately to ensure that the input format matches the global feature modeling requirements;
[0212] Multi-head self-attention layer: Set an appropriate number of attention heads and embedding dimension splitting method;
[0213] Residual Connectivity and Layer Normalization: Set appropriate residual connect locations and layer normalization methods;
[0214] MLP layer: Set appropriate hidden layer dimensions and activation function types.
[0215] (iv) Classification Output Module Design
[0216] The core design of the classification output module is to achieve feature fusion and accurate category mapping. The key steps are as follows:
[0217] Pooling fusion layer: Set appropriate combinations of pooling methods, such as average pooling plus max pooling. The pooling kernel size also needs to be set reasonably to achieve global-local information complementarity and improve the completeness of classification criteria.
[0218] Linear layer: By setting appropriate input and output dimensions, the fused feature vectors are fully mapped to the PQDs class space, avoiding classification bias caused by dimension mismatch.
[0219] Softmax layer: Set an appropriate probability normalization method
[0220] 3. Training and Validation
[0221] The network model is trained end-to-end using the constructed dataset, and its performance is evaluated on independent validation and test sets to optimize the model parameters.
[0222] (I) Training Parameter Settings
[0223] The training process uses hyperparameter optimization to ensure model convergence and lightweight characteristics. The specific settings are as follows:
[0224] Basic parameters: Set the batch size as needed to balance training speed and memory usage, and select a suitable optimizer to speed up convergence efficiency;
[0225] Learning rate strategy: Choose an appropriate learning rate strategy to accelerate convergence while preventing getting trapped in local optima;
[0226] Regularization and early stopping: Use appropriate regularization techniques, such as Dropout and L2 regularization, to prevent overfitting. At the same time, you can combine them with an early stopping mechanism to save the optimal model parameters.
[0227] Loss function: A joint loss function is used as the reconstruction loss weight to balance the DAE noise reduction effect and classification accuracy.
[0228] (II) Selection of Verification Indicators
[0229] Select validation metrics from the following three dimensions to comprehensively evaluate model performance:
[0230] Classification performance metrics: Accuracy (the proportion of samples correctly predicted globally), Precision (the proportion of samples predicted as positive in a certain class that are actually positive), Recall (the proportion of samples that are actually positive in a certain class that are correctly predicted), F1 score (the harmonic mean of precision and recall, which comprehensively measures class-level performance).
[0231] Noise robustness metrics: classification accuracy at different signal-to-noise ratios (e.g., 10dB, 20dB, 30dB, 40dB) to evaluate the model's adaptability in noisy environments;
[0232] Lightweight metrics: number of model parameters (measuring memory usage), number of floating-point operations (FLOPs, measuring computational complexity), and inference time (prediction time for a single sample or batch of samples, assessing real-time performance).
[0233] (III) Results Analysis
[0234] The training and validation results were analyzed from multiple dimensions to optimize the model and verify its effectiveness, as detailed below:
[0235] Training curve analysis: Plot the curves of loss and accuracy on the training and validation sets as a function of the number of iterations. If the accuracy on the training set continues to rise while the accuracy on the validation set stagnates, it is considered overfitting and the regularization parameter or model complexity needs to be adjusted.
[0236] Confusion matrix analysis: Plotting a confusion matrix to visually display the model's prediction bias across various PQDs, and designing optimization modules for high-confusion categories;
[0237] Noise robustness analysis: Compare the accuracy difference between the model and existing models under different signal-to-noise ratios to verify the noise reduction effect of the DAE module;
[0238] Lightweight analysis: Compare the model with existing models in terms of parameter count, FLOPs, and inference time to verify the lightweight characteristics and ensure adaptability to resource-constrained scenarios.
[0239] Optionally, the deep learning-based lightweight power quality disturbance classification algorithm suitable for low signal-to-noise ratio may include the following steps:
[0240] a. Collect PQDs signal samples and label all samples with perturbation categories, and then perform standardization and dimension adaptation preprocessing on the samples;
[0241] b. Construct a classification model consisting of a noise reduction autoencoder (DAE) module, a convolutional neural network (CNN) local feature extraction module, a Transformer global feature modeling module, and a classification output module connected in series.
[0242] c. Model training optimization: First, pre-train the denoising autoencoder (DAE) module separately to optimize the noise separation capability. Then, connect the pre-trained DAE module with the other modules and use a joint loss function that combines denoising effect and classification accuracy to perform end-to-end training on the overall model. Combine learning rate adjustment and early stopping mechanism to optimize model parameters.
[0243] d. Classification and inference for low signal-to-noise ratio scenes: Perform the preprocessing operation of step a on the low signal-to-noise ratio PQDs signal to be identified, input the trained model, and after processing by each module in sequence, the classification output module outputs the probability distribution of the perturbation category, and takes the category corresponding to the maximum probability as the final classification result.
[0244] Optionally, the PQDs signal samples in step a include single disturbance samples and composite disturbance samples. The single disturbance includes, but is not limited to, voltage sags, swells, interruptions, oscillations, impulses, cuts, flicker, and harmonics. The composite disturbance is a superposition combination of two or more single disturbances.
[0245] Optionally, the noise reduction autoencoder (DAE) noise reduction module in step b has an encoder containing at least two levels of convolutional layers and a decoder containing at least two levels of transposed convolutional layers. The convolutional structures of the encoder and decoder are symmetrically designed, and each convolutional layer is followed by a batch normalization layer and an activation function.
[0246] Optionally, the local feature extraction module of the convolutional neural network (CNN) in step b includes multiple cascaded convolutional neural network (CNN) sub-modules. Each sub-module is configured with depthwise convolutional layers, pointwise convolutional layers, activation function layers and pooling layers in sequence, and lightweight local feature extraction is achieved through depthwise separable convolution.
[0247] Optionally, the Transformer global feature modeling module in step b includes a dimension adaptation layer and a simplified multi-head self-attention layer. The dimension adaptation layer realizes feature format conversion, and the multi-head self-attention layer captures global temporal correlations of different dimensions in parallel. The module is also configured with residual connections and batch normalization layers to improve training stability.
[0248] Optionally, the joint loss function in step c includes the reconstruction loss of the denoising autoencoder (DAE) module and the classification loss of the classification module. The influence ratio of the two losses is adjusted by the weight coefficients. Regularization is also introduced during training to prevent the model from overfitting.
[0249] Optionally, the classification output module in step b adopts dual-pooling feature fusion, linear mapping, and a Softmax structure. Dual pooling extracts global trends and local key features respectively, the linear mapping layer realizes the transformation from features to the class space, and the Softmax layer outputs the class probability distribution.
[0250] Optionally, the sample preprocessing in step a also includes data cleaning operations, which improve the purity and reliability of the training dataset by removing abnormal samples with truncated signals, missing metadata, and duplicate samples.
[0251] Optionally, the deep learning model is lightweight, and through structural designs such as depthwise separable convolution and simplified multi-head self-attention, the number of model parameters and computational complexity are reduced, making it adaptable to the deployment requirements of edge computing devices and power distribution terminals.
[0252] Optionally, the learning rate adjustment in step c adopts a dynamic adaptation strategy, which adjusts the learning rate in real time according to the performance changes of the validation set to accelerate convergence. The early stopping mechanism uses the validation set accuracy as the core judgment indicator to avoid model overfitting and save the optimal parameters.
[0253] Optionally, it also includes a model evaluation step, using accuracy, precision, recall and F1 score as core evaluation metrics, combined with confusion matrix and noise robustness test, to comprehensively measure the classification performance of the model in low signal-to-noise ratio scenarios.
[0254] Optionally, step a also includes data augmentation operations, which expand the size of the training dataset and improve the model's ability to adapt to different morphological perturbations by performing transformations such as time-series flipping, amplitude scaling, and phase shifting on the PQDs samples.
[0255] Optionally, it supports transfer learning adaptation. When applied to new power grid scenarios, it can be fine-tuned based on pre-trained model parameters without having to train from scratch, thus shortening the model deployment cycle in new scenarios.
[0256] Optionally, the deployment also includes a model performance monitoring step to track changes in classification accuracy in real time. When the performance drops to a preset threshold, it triggers a model readjustment or parameter update process to ensure long-term classification reliability.
[0257] Optionally, it also includes data security protection steps, such as desensitizing PQDs samples containing sensitive information about electricity customers, and using encryption methods during data storage and model training to prevent the leakage of sensitive data.
[0258] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0259] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0260] Example 2
[0261] According to embodiments of the present invention, an apparatus for implementing the above-described classification method for power quality disturbances is also provided. Figure 3 This is a structural block diagram of a power quality disturbance classification device according to an embodiment of the present invention, such as... Figure 3 As shown, the device includes: an acquisition module 302, a first determination module 304, a first input module 306, a second input module 308, a third input module 310, a fourth input module 312, and a second determination module 314. The device will be described in detail below.
[0262] The acquisition module 302 is used to acquire the disturbance time-series signal corresponding to the power quality disturbance; the first determination module 304, connected to the acquisition module 302, is used to determine the initial time-series tensor corresponding to the disturbance time-series signal; the first input module 306, connected to the first determination module 304, is used to input the initial time-series tensor into the denoising autoencoder module of the target model to obtain the denoised time-series tensor, wherein the target model also includes a local feature extraction module, a global feature modeling module, and a classification output module; the second input module 308, connected to the first input module 306, is used to input the denoised time-series tensor into the local feature extraction module to obtain the target local feature tensor, wherein the target local feature tensor is... The corresponding sequence length is less than the sequence length corresponding to the denoising time series tensor; the third input module 310, connected to the second input module 308, is used to input the target local feature tensor to the global feature modeling module to obtain the global time series correlation tensor; the fourth input module 312, connected to the third input module 310, is used to input the global time series correlation tensor to the classification output module to obtain the disturbance category probability distribution, wherein the disturbance category probability distribution represents the probability distribution corresponding to various power quality disturbance categories respectively; the second determination module 314, connected to the fourth input module 312, is used to determine the disturbance category corresponding to the maximum value in the disturbance category probability distribution as the disturbance classification result corresponding to the disturbance time series signal.
[0263] It should be noted that the above-mentioned acquisition module 302, first determination module 304, first input module 306, second input module 308, third input module 310, fourth input module 312 and second determination module 314 correspond to steps S102 to S114 in the classification method for implementing power quality disturbances. The multiple modules and the corresponding steps are the same in terms of implementation instances and application scenarios, but are not limited to the content disclosed in the above embodiment 1.
[0264] Example 3
[0265] According to another aspect of the present invention, an electronic device is also provided, comprising: a processor; and a memory for storing processor-executable instructions, wherein the processor is configured to execute instructions to implement the power quality disturbance classification method of any of the above embodiments.
[0266] Example 4
[0267] According to another aspect of the present invention, a computer-readable storage medium is also provided, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform any of the above-described power quality disturbance classification methods.
[0268] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0269] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0270] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0271] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0272] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0273] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0274] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for classifying power quality disturbances, characterized in that, include: Acquire the disturbance time sequence signal corresponding to the power quality disturbance; Determine the initial time-series tensor corresponding to the perturbation time-series signal; The initial temporal tensor is input into the denoising autoencoder module of the target model to obtain the denoised temporal tensor. The target model also includes a local feature extraction module, a global feature modeling module, and a classification output module. The denoising temporal tensor is input into the local feature extraction module to obtain the target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the denoising temporal tensor; The target local feature tensor is input into the global feature modeling module to obtain the global temporal correlation tensor; The global time-series correlation tensor is input to the classification output module to obtain the disturbance category probability distribution, wherein the disturbance category probability distribution represents the probability distribution corresponding to various power quality disturbance categories respectively; The disturbance category corresponding to the maximum value in the disturbance category probability distribution is determined as the disturbance classification result corresponding to the disturbance time series signal.
2. The method according to claim 1, characterized in that, The initial temporal tensor is input into the denoising autoencoder module of the target model to obtain the denoising temporal tensor, including: The initial temporal tensor is input into the encoder module of the noise reduction autoencoder module to obtain the encoded temporal tensor, wherein the sequence length corresponding to the encoded temporal tensor is less than the length corresponding to the initial temporal tensor, and the number of channels corresponding to the encoded temporal tensor is greater than the number of channels corresponding to the initial temporal tensor. Based on the first reconstruction loss function, the encoded temporal tensor is input to the decoder module of the denoising autoencoder module to obtain a denoised temporal tensor, wherein the sequence length corresponding to the denoised temporal tensor is equal to the length corresponding to the initial temporal tensor, and the number of channels corresponding to the denoised temporal tensor is equal to the number of channels corresponding to the initial temporal tensor. The first reconstruction loss function is used to constrain the consistency between the denoised temporal tensor and the initial temporal tensor.
3. The method according to claim 1, characterized in that, The denoising temporal tensor is input into the local feature extraction module to obtain the target local feature tensor, including: In the local feature extraction module, the denoising temporal tensor is subjected to depthwise convolution to obtain initial local feature tensors corresponding to multiple channels respectively; Perform pointwise convolution operations on the initial local feature tensors corresponding to multiple channels respectively to obtain the fused local feature tensor; A pooling operation is performed on the fused local feature tensor to obtain a target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the fused local feature tensor.
4. The method according to claim 1, characterized in that, The target local feature tensor is input into the global feature modeling module to obtain a global temporal correlation tensor, including: In the global feature modeling module, a dimension adaptation operation is performed on the target local feature tensor to obtain a feature tensor in a predetermined format, wherein the feature tensor in the predetermined format is a feature tensor in a sequence embedding dimension format. Perform multi-head self-attention operation on the predetermined format feature tensor to obtain an attention feature tensor; The attention feature tensor is subjected to residual connection and multilayer perceptron transformation operations to obtain the global temporal correlation tensor.
5. The method according to claim 1, characterized in that, The global temporal correlation tensor is input into the classification output module to obtain the perturbation category probability distribution, including: In the classification output module, the global temporal correlation tensor is subjected to average pooling to obtain a global trend feature tensor, and the global temporal correlation tensor is subjected to max pooling to obtain a local trend feature tensor. The global trend feature tensor and the local trend feature tensor are concatenated to obtain a fused feature vector. The fused feature vector is subjected to linear mapping and probability transformation operations to obtain the probability distribution of the perturbation category.
6. The method according to claim 1, characterized in that, Before inputting the initial temporal tensor into the denoising autoencoder module of the target model to obtain the denoised temporal tensor, the process further includes: Based on the first reconstruction loss function, the initial autoencoder module is trained using the corresponding sample data to obtain the intermediate autoencoder module. Based on the joint loss function, the initial model is trained using the corresponding sample data to obtain the target model. The joint loss function is obtained by weighting the second reconstruction loss function and the classification loss function. The initial model includes the intermediate autoencoder module.
7. The method according to any one of claims 1 to 6, characterized in that, Determining the initial time-series tensor corresponding to the perturbation time-series signal includes: The validity of the disturbed timing signal is verified to obtain the validity verification result; If the validity check result is passed, the perturbation time series signal is normalized using a standardization method to obtain a normalized time series signal. The normalized time series signal is subjected to dimensionality transformation to obtain the initial time series tensor.
8. A power quality disturbance classification device, characterized in that, include: The acquisition module is used to acquire the disturbance timing signal corresponding to the power quality disturbance; The first determining module is used to determine the initial time tensor corresponding to the perturbation time series signal; The first input module is used to input the initial temporal tensor into the denoising autoencoder module of the target model to obtain the denoised temporal tensor. The target model further includes a local feature extraction module, a global feature modeling module, and a classification output module. The second input module is used to input the denoising time series tensor into the local feature extraction module to obtain the target local feature tensor, wherein the sequence length corresponding to the target local feature tensor is less than the sequence length corresponding to the denoising time series tensor; The third input module is used to input the target local feature tensor into the global feature modeling module to obtain the global temporal correlation tensor; The fourth input module is used to input the global time-series correlation tensor into the classification output module to obtain the disturbance category probability distribution, wherein the disturbance category probability distribution represents the probability distribution corresponding to various power quality disturbance categories respectively; The second determining module is used to determine the disturbance category corresponding to the maximum value in the disturbance category probability distribution as the disturbance classification result corresponding to the disturbance time series signal.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the power quality disturbance classification method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the power quality disturbance classification method as described in any one of claims 1 to 7.