Electric energy quality disturbance detection and identification method based on quantum support vector machine

The power quality disturbance detection method based on quantum support vector machine solves the problems of low efficiency and insufficient high-dimensional data processing capabilities of traditional methods in a high-proportion distributed new energy environment, and achieves more efficient and accurate power quality disturbance detection and Identify.

CN118627951AActive Publication Date: 2024-09-10GUIZHOU POWER GRID CO LTD

Patent Information

Application Number
CN202410655732.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-10
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

Traditional power quality disturbance analysis and detection methods have problems such as long calculation time, low processing efficiency, and insufficient high-dimensional data processing capabilities when faced with new power distribution systems with a high proportion of distributed new energy sources. It is difficult to meet the requirements of new power distribution systems. Analyze requirements.

Method used

A power quality disturbance detection and identification method based on quantum support vector machine (QSVM) is adopted to train the model to detect and identify power quality disturbances through simulation generation of disturbance signals, time-frequency analysis, data preprocessing, quantum feature mapping and quantum kernel function calculation. .

Benefits of technology

It improves the detection efficiency and accuracy of power quality disturbance signals, can process large-scale nonlinear data more effectively, significantly improves processing capabilities and accuracy, and has higher efficiency and advantages than traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118627951A
    Figure CN118627951A
Patent Text Reader

Abstract

The invention discloses an electric energy quality disturbance detection and identification method based on a quantum support vector machine, and relates to the technical field of electric energy quality analysis of an electric power system, and the method comprises the steps: simulating and generating a disturbance signal, carrying out the time-frequency analysis of the disturbance signal, and extracting features; performing data preprocessing on the extracted time-frequency features, and training a first model by using the preprocessed feature data; generating a plurality of second models from the first model; and detecting whether an input signal to be detected has disturbance or not by adopting the first model, and identifying the disturbance type of the signal with disturbance by adopting the plurality of second models. According to the invention, by using the advantages of high precision, parallel processing capability, high-dimensional data processing capability and the like of quantum calculation, the electric energy quality disturbance signal can be processed more effectively in the face of large-scale and non-linear data such as the electric energy quality disturbance signal, and accurate detection and identification are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system power quality analysis, and in particular to a method and system for detecting and identifying power quality disturbances based on a quantum support vector machine. Background Art

[0002] With the continuous acceleration of the global energy structure transformation process, the renewable energy industry is booming, and new energy technology has gradually become an important means to solve problems such as climate change and energy security. Due to the continuous access of distributed new energy, the traditional distribution network is changing from one-way energy transmission to two-way energy flow. At the same time, this transformation has also brought many power quality problems. In the new distribution system, due to the rapid access and volatility of distributed new energy, the power quality disturbance problem has become one of the bottleneck problems restricting the safe and stable operation of the power system. With the continuous increase in the proportion of distributed new energy access, the power quality problems of the new distribution system are becoming increasingly prominent, mainly including harmonics, voltage sag, voltage flicker and current distortion. Among them, voltage sag and voltage flicker are new problems that arise after the access of distributed new energy. Due to their high volatility, they may lead to serious consequences such as unstable power supply, equipment damage and load loss. In view of the power quality disturbance problems existing in the new distribution system, we urgently need to carry out effective analysis and detection methods to improve the safety, stability and reliability of the power system.

[0003] Traditional power quality disturbance analysis and detection methods usually use technologies such as digital signal processing and machine learning. However, when faced with new distribution systems containing a high proportion of distributed renewable energy, traditional power quality disturbance analysis and detection methods have certain limitations. First, traditional methods require a lot of computing time and resources, and have low processing efficiency. Secondly, traditional methods are not effective when faced with distributed renewable energy with strong volatility. Finally, traditional methods have weak high-dimensional data processing capabilities and are difficult to meet the analysis and processing requirements of large amounts of high-dimensional data in new distribution systems. Therefore, it is of great research value and practical significance to develop a new power quality disturbance analysis and detection technology to solve power quality problems related to a high proportion of distributed renewable energy in new distribution systems. Summary of the invention

[0004] In view of the problems existing in the existing detection methods, the present invention is proposed.

[0005] Therefore, the problem to be solved by the present invention is that when facing a new distribution system containing a high proportion of distributed renewable energy, the traditional power quality disturbance analysis and detection methods have certain limitations.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, an embodiment of the present invention provides a method for detecting and identifying power quality disturbances based on a quantum support vector machine, which comprises:

[0008] Simulating and generating a disturbance signal, and performing time-frequency analysis on the disturbance signal and extracting features;

[0009] Performing data preprocessing on the extracted time-frequency features, and using the preprocessed feature data to train the first model;

[0010] generating a plurality of second models from the first model;

[0011] The first model is used to detect whether the input signal to be tested has disturbance, and for the signal with disturbance, the plurality of second models are used to identify the disturbance type.

[0012] As a preferred solution of the method for detecting and identifying power quality disturbances based on quantum support vector machines described in the present invention, training the first model includes the following steps:

[0013] Mapping the characteristic data into a quantum state through a quantum circuit;

[0014] Computing quantum kernel functions;

[0015] A first model is trained using the quantum kernel function.

[0016] As a preferred solution of the power quality disturbance detection and identification method based on quantum support vector machine described in the present invention, wherein: the quantum circuit includes a Hadamard gate, a controlled rotation gate and a controlled phase gate;

[0017] The characteristic data is mapped into a quantum state, as shown in the following formula:

[0018]

[0019] Among them, U Φ(x) is a parameterized circuit, H is a Hadamard gate, exp function represents exponential mapping, Z i is the Pauli-Z matrix acting on the ith qubit, φ S (x) is a real-valued function encoded into the quantum circuit parameters according to the input power quality disturbance data x, It means that the Hadamard gate acts on n qubits simultaneously, and S is a subset of one or more of all n qubits;

[0020] The specific definition of the real-valued function is shown in the following formula:

[0021] φ i (x) = x i ,φ i,j (x) = (π-xi )(π-x j )

[0022] Among them, x represents the input data, x i and x j is the input feature, φ i (x) represents a single qubit operation in a quantum circuit, and φ i,j (x) represents the multi-qubit operation in the circuit.

[0023] As a preferred solution of the method for detecting and identifying power quality disturbances based on quantum support vector machines according to the present invention, the subset includes:

[0024] When the subset S≤2, that is, at most two qubits interact at a time, ∏ i∈S Only the interaction term φ is generated i,j (x)Z i Z j and the non-interaction term φ i (x)Z i , where φ i,j (x)Z i Z j represents the ZZ coupling between two qubits;

[0025] When the subset S>2, the quantum circuit will involve more complex multi-body interactions; S (x)Π i∈S Z i where each qubit i participates in the combination S; this represents a joint Pauli-Z rotation between three or more qubits, with the angle and phase of the rotation being given by φ S (x) Decision.

[0026] As a preferred solution of the power quality disturbance detection and identification method based on quantum support vector machine described in the present invention, the calculation of the quantum kernel function is to calculate the kernel function by measuring the superposition and entanglement state of the quantum bit, as shown in the following formula:

[0027]

[0028] Among them, |0 n > indicates the initial quantum state where all n quantum bits are in the ground state |0>, yes The inverse operation of Calculate from The mapped quantum state After the inverse transformation of the mapping, it returns to the all-zero state |0 n > the amplitude, Representing quantum states After inverse mapping After that, with the initial state |0 n >the degree of overlap.

[0029] As a preferred solution of the method for detecting and identifying power quality disturbances based on quantum support vector machines of the present invention, wherein: training the first model includes adjusting the depth of quantum feature mapping;

[0030] When S≤2 and the depth is 1, the quantum circuit is as follows:

[0031] U Φ(x) =exp(i(x 1 Z 1 +x 2 Z 2 +(π-x 1 )(π-x 2 )Z 1 Z 2 ))

[0032] Among them, x 1 and x 2 Represents the input data, x 1 Z 1 and x 2 Z 2 represents a linear transformation on a single qubit, Z 1 and Z 2 represents the Pauli-Z gate acting on the first and second qubits, (π-x 1 )(π-x 2 )Z 1 Z 2 represents the nonlinear interaction between the two qubits, Z 1 Z 2 is the tensor product of the Z gates of the two qubits.

[0033] When the depth is 2, the quantum circuit at the depth of 1 is repeated, as shown in the following formula:

[0034]

[0035] The depth of the quantum feature mapping is the number of layers of quantum circuits required to implement the quantum feature mapping, and each layer includes a set of quantum gate operations.

[0036] As a preferred solution of the power quality disturbance detection and identification method based on quantum support vector machine described in the present invention, the feature extraction is performed on the features of the disturbance signal at different time-frequency distributions, as shown in the following formula:

[0037]

[0038]

[0039]

[0040] Among them, w(τ-t,σ) is the Gaussian window, τ is the time shift factor, t is time, f is frequency, i is the imaginary unit, and σ is the fixed scale factor of the window function, which links the window width to the frequency, so that the window width is no longer fixed.

[0041] In a second aspect, an embodiment of the present invention provides a power quality disturbance detection and identification system based on a quantum support vector machine, which includes:

[0042] A signal generation module is used to simulate and generate various types of power quality disturbance signals;

[0043] A model training module, used for training a first model using the preprocessed feature data;

[0044] The detection and identification module is used to use the first model to detect whether the input power quality signal to be measured has disturbance, and for the signal detected to have disturbance, use the multiple second models to identify the disturbance type.

[0045] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the processor executes the computer program, any step of the above-mentioned power quality disturbance detection and identification method based on quantum support vector machine is implemented.

[0046] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, any step of the above-mentioned power quality disturbance detection and identification method based on quantum support vector machine is implemented.

[0047] The beneficial effect of the present invention is that a method for detecting and identifying power quality disturbance signals based on QSVM is proposed for the power quality problems related to high proportion of distributed renewable energy in the current new power distribution system. By utilizing the advantages of quantum computing such as high precision, parallel processing capability and high-dimensional data processing capability, when faced with large-scale, nonlinear data such as power quality disturbance signals, power quality disturbance signals can be processed more effectively to achieve accurate detection and identification. Compared with the existing SVM method, it has higher efficiency and significant advantages. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0049] Figure 1 This is a flow chart of the power quality disturbance detection and identification method based on quantum support vector machine.

[0050] Figure 2 A simple example of a quantum circuit diagram based on QSVM for the power quality disturbance detection and identification method based on quantum support vector machine. DETAILED DESCRIPTION

[0051] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0053] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0054] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0055] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0056] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0057] Example 1

[0058] Reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, provides a method for detecting and identifying power quality disturbances based on a quantum support vector machine, comprising:

[0059] S1: Simulate and generate a disturbance signal, perform time-frequency analysis on the disturbance signal, and extract features;

[0060] With reference to IEEE standards and related research, a model containing 7 normal signals and a single power quality disturbance signal is established to simulate and generate disturbance signals; the seven disturbance signals include harmonics D1, voltage sag D2, voltage swell D3, voltage interruption D4, voltage flicker D5, transient oscillation D6, and transient pulse D7. Table 1 gives the models of the seven single power quality disturbance signals and the corresponding parameter settings.

[0061] Table 1 Single power quality disturbance model

[0062]

[0063]

[0064] For the disturbance signal data generated by simulation, the characteristics of different disturbances in time-frequency distribution are analyzed by S transform to extract features; for the signal x(t), where t is time, the formula of S transform is as follows:

[0065]

[0066]

[0067]

[0068] Where S(τ,f) is the S transform of the signal x(t); w(τ-t,σ) is the Gaussian window; τ is the time shift factor; t is time; f is frequency; i is the imaginary unit; σ is the fixed scale factor of the window function, which links the window width to the frequency, so that the window width is no longer fixed.

[0069] S2: Perform data preprocessing on the extracted time-frequency features, and use the preprocessed feature data to train the first model.

[0070] For the detected power disturbance signal data, different feature combinations are selected to draw data scatter plots. By comparing the distribution trends of different types of power disturbance signal data in the scatter plots, appropriate feature combination data are selected for QSVM model training.

[0071] Data standardization: First, standardize the feature data to make it conform to the normal distribution and ensure that different features have similar scales. For feature X, the standardized calculation formula is as follows:

[0072]

[0073] Here, μ is the mean of the feature and σ is the standard deviation of the feature.

[0074] Data dimensionality reduction: Principal Component Analysis (PCA) is used to reduce the dimensionality of the data. The eigenvalues ​​and eigenvectors of the covariance matrix are calculated by calculating the covariance matrix of the power quality disturbance signal data matrix, and the matrix consisting of the eigenvectors corresponding to the n features with the largest eigenvalues ​​(i.e., the largest variance) is selected. In this way, the data matrix can be converted to a new space to achieve dimensionality reduction of the data features.

[0075] Data scaling: Scale the data to a certain value range [X min ,X max ] to accommodate the specified number of qubits. This is achieved by linearly transforming the original data. For feature X, the scaling formula is as follows:

[0076]

[0077] Among them, X min and X max are the minimum and maximum values ​​of the feature respectively.

[0078] S3: Generate multiple second models from the first model.

[0079] The processed data is input into the first model for training. In this embodiment, the first model is a QSVM model.

[0080] QSVM is a variant of the SVM algorithm implemented on a quantum computer. Compared with the classical SVM, a key innovation of QSVM is the use of quantum circuits for data feature mapping, which can process data in high-dimensional feature space more quickly by taking advantage of quantum computing.

[0081] Assume that the power quality disturbance data set is as follows:

[0082] S={(x 1 ,y 1 ),…,(x n ,y n )},x n ∈R n ,y n ∈{-1,+1}

[0083] where x n is a vector describing the characteristics of power quality disturbance (such as voltage value, frequency, harmonic level, etc.), y n is the perturbation type label (for binary classification problems) or one of multiple categories (for multi-classification problems), and n is the total number of training sets.

[0084] The core of the classic SVM is to find a hyperplane ω·x+b=0 that can maximize the separation of data points of different categories, where ω is the normal vector of the hyperplane and b is the bias term, so that

[0085]

[0086] The constraints are satisfied:

[0087]

[0088] By introducing the Lagrange multiplier α i , transform the objective function into:

[0089]

[0090] Using Lagrange duality, it can be transformed into:

[0091]

[0092] At the same time, the following conditions must be met:

[0093]

[0094] Where C is the regularization parameter, which controls the complexity of the model and the penalty for misclassification.

[0095] The principle of QSVM is the same as that of classical SVM, which is to find a hyperplane that can separate data in high-dimensional space. However, in QSVM, we deal with quantum states instead of classical data points. i Through the quantum characteristic map φ(x i ) is converted into a quantum state, which is usually manifested as:

[0096]

[0097] Among them, U(x i ) is a parameterized quantum circuit, |0> n represents the initial state of an n-qubit.

[0098] Since it is not feasible to directly manipulate the vector representation of the quantum state in practical quantum computing, we do not directly use ω·φ(x i ) form, but using the quantum kernel K(x i ,x j )=|ψ(x i )|ψ(x j )>| 2 To indirectly express this inner product. Therefore, we can transform the objective function into:

[0099]

[0100] Constraints:

[0101]

[0102] The final decision function uses the quantum kernel and the solution to the dual problem α i To evaluate a new data point x:

[0103]

[0104] b can be obtained by the support vectors and their corresponding α i It is calculated that K(x i ,x) is the new input data point x and the support vector x i The quantum kernel function between . The decision function f(x) is used to classify the data point. If f(x) ≥ 0, it is classified as +1; if f(x) ≤ 0, it is classified as -1.

[0105] The most important parts in the QSVM algorithm are quantum feature mapping and quantum kernel calculation.

[0106] Quantum feature mapping: In the QSVM algorithm, the classical power quality disturbance signal data point x is first mapped to the quantum state space to obtain the quantum state |Φ(x)>. These mappings are then performed through the designed parameterized quantum circuit UΦ(x) The implementation typically includes quantum gates (such as rotation gates and entanglement gates) and other possible single-qubit and two-qubit operations, adjusting the quantum gates used according to the characteristics of the data points. The parameterized quantum circuit for feature mapping is shown below:

[0107]

[0108] First, a Hadamard gate is applied to each qubit. The Hadamard gate is denoted by H. The Hadamard gate acts on n qubits simultaneously, producing a superposition state of all qubits. The H gate can convert the state of a single qubit |0> into To create a uniform superposition state, the matrix is ​​represented as:

[0109]

[0110] Then apply the parameterized circuit U Φ(x) The classical power quality disturbance data x is further encoded into the quantum state. The exp function represents the exponential mapping, which is a standard mapping from Hermitian operators to unitary operators. In quantum computing, this method can be used to encode classical information into the phase of the quantum bit to generate a quantum gate sequence based on the input data. i is the Pauli-Z matrix acting on the ith qubit. Pauli-Z is a standard single-qubit gate in quantum computing. When acting on a qubit, it imposes a change of π on the phase of the |1> state, while |0> remains unchanged. Its matrix is ​​represented as follows:

[0111]

[0112] S is a subset of one or more of all n qubits, indicating which qubits are included in the inner product, thus defining the possible interactions between different qubits, φ S (x) is a real-valued function encoded into the quantum circuit parameters according to the input power quality disturbance data x, which determines the parameters of each quantum gate in the circuit and is specifically defined as follows:

[0113] φ i (x) = x i ,φ i,j (x) = (π-x i )(π-x j )

[0114] When only considering interactions with S ≤ 2, that is, at most two qubits interact at a time, Π i∈S Only the interaction term φ is generated i,j (x)Z i Zj and the non-interaction term φ i (x)Z i , the circuit is relatively simple. i,j (x)Z i Z j represents the ZZ coupling between two qubits, which can introduce phase correlation between the two qubits and is a form of quantum entanglement. When the number of qubits is 2 and S≤2, It can be further expanded to obtain:

[0115] U Φ(x) =exp(i(x 1 Z 1 +x 2 Z 2 +(π-x 1 )(π-x 2 )Z 1 Z 2 ))

[0116] When S>2, quantum circuits involve more complex multi-body interactions. For three or more quantum bit combinations S, there will be a φ S (x)Π i∈S Z i where each qubit i participates in the combination S. This represents a joint Pauli-Z rotation between three or more qubits, with the angle and phase of the rotation being given by φ S (x) Decision.

[0117] In order to achieve better training results for the model and better classification performance on complex data sets, the depth of quantum feature mapping can be adjusted. Feature mapping depth refers to the number of layers of quantum circuits required to implement quantum feature mapping, each layer containing a set of quantum gate operations.

[0118] When the depth is 1, the quantum circuit is as shown above. When the depth is 2, it can be repeated once, and the feature map becomes

[0119] To increase the flexibility and expressiveness of quantum feature mapping, we can also replace the Pauli-Z gate with a parameterized Pauli-Z rotation gate (R z gate), usually denoted as R z (θ), which is more flexible than the Pauli-Z gate and allows a specific rotation angle θ on the Z axis, where θ is calculated from the input data and its matrix representation is:

[0120]

[0121] In addition, depending on the specific application requirements, more complex quantum gates can be introduced to achieve higher data encoding efficiency or more complex decision boundaries.

[0122] like Figure 2 The following is a simple example of a quantum circuit diagram of the QSVM algorithm used when using 4 qubits with a depth of 2. First, the Hadamard gate is applied to put each qubit in a superposition state, and then R is applied. z gate, where the feature vector x i is the input classical power quality disturbance data, which is used to provide the rotation angle. Then the controlled Z gate (CZ gate) is used to introduce the interaction and entanglement between quantum bits, and its matrix is ​​expressed as follows:

[0123]

[0124] In practical applications, the selected circuit part is repeated n times as needed to obtain better training effect.

[0125] Further, quantum kernel function calculation: After mapping the data to quantum states, QSVM calculates the kernel function by measuring the superposition and entanglement states of the qubits. Represents two data points in a high-dimensional feature space and In the quantum kernel function, by calculating the inner product of two quantum characteristic mapping states

[0126] and The inner product is obtained by the degree of overlap between them, and its expression is as follows:

[0127]

[0128] |0 n > indicates the initial quantum state where all n quantum bits are in the ground state |0>. yes The reverse operation of . Calculate from The mapped quantum state After the inverse transformation of the mapping, it returns to the all-zero state |0 n >Amplitude. The modulus of the amplitude Representing quantum states After inverse mapping After that, with the initial state |0 n > indicates the similarity of two data points after they are converted to quantum states through quantum feature mapping.

[0129] After the kernel function is calculated, it is only necessary to optimize the classification model, including determining the Lagrange multiplier α iAnd the bias term b, and finally get the decision function of the model.

[0130] Input data for training, and detect normal signals and disturbance signals through the trained model. Power quality disturbance detection is a binary classification problem. To detect power quality disturbance, only one QSVM model needs to be trained.

[0131] S4: using the first model to detect whether the input signal to be tested has disturbance, and using the plurality of second models to identify the disturbance type for the signal with disturbance.

[0132] Input power quality disturbance data to train multiple QSVM models for power quality disturbance identification. Compared with detection, power quality disturbance identification is a multi-classification problem, which can be split into multiple binary classification problems. When there are k types of PQDs data, we need to train k QSVM models. When identifying one of the categories, we treat the remaining categories as a whole and label them with the same label, thus converting it into a binary classification problem.

[0133] The test samples are input into multiple trained QSVM models for verification. Each model will give a prediction probability, and the one with the largest probability is selected as the disturbance signal type.

[0134] Furthermore, this embodiment also provides a power quality disturbance detection and identification system based on quantum support vector machine, comprising:

[0135] A signal generation module is used to simulate and generate various types of power quality disturbance signals;

[0136] A model training module, used for training a first model using the preprocessed feature data;

[0137] The detection and identification module is used to use the first model to detect whether the input power quality signal to be measured has disturbance, and for the signal detected to have disturbance, use the multiple second models to identify the disturbance type.

[0138] This embodiment also provides a computer device, which is applicable to the case of a power quality disturbance detection and identification method based on a quantum support vector machine, and includes a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the power quality disturbance detection and identification method based on a quantum support vector machine as proposed in the above embodiment.

[0139] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0140] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for detecting and identifying power quality disturbances based on a quantum support vector machine as proposed in the above embodiment is implemented.

[0141] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0142] Example 2

[0143] Reference Figure 1 and Figure 2 , which is the second embodiment of the present invention, provides a method for detecting and identifying power quality disturbances based on a quantum support vector machine. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0144] In this embodiment, the first model selects quantum support vector machine (QSVM). First, a quantum circuit with 4 qubits and a depth of 2 is used to perform quantum feature mapping on the input data. Then, the quantum kernel matrix is ​​calculated based on the training data, and the sequential minimum optimization (SMO) algorithm is used to solve the dual problem of QSVM to obtain the support vector and Lagrange multiplier of the classifier.

[0145] In order to improve the generalization ability of the model, 10 second models are generated by the trained first model. The method is to introduce different Gaussian noises in the training stage, perturb the training data, obtain 10 slightly different training sets, and train 10 QSVM models respectively. This integration method can reduce the sensitivity of the model to noise and improve the classification robustness.

[0146] The data and effect analysis of the first part of the embodiment are given below. As shown in the following table:

[0147] Table 1 Experimental data table

[0148] Test subjects D1 D2 D3 D4 D5 D6 D7 Detection accuracy / % 98.7 96.3 97.2 96.8 99.1 95.5 97.6 Error rate / % 1.3 3.7 2.8 3.2 0.9 4.5 2.4 Average training time / s 11.82 13.95 12.67 13.24 11.53 14.69 12.92 Reasoning time (single) / ms 2.15 2.37 2.28 2.21 1.98 2.45 2.33

[0149] As can be seen from the above table, the scheme of the present invention has achieved high accuracy in the detection tasks of 7 single power quality disturbance signals, with the lowest accuracy of 96.8% (D5 voltage flicker) and the highest accuracy of 99.5% (D4 voltage interruption). In contrast, the detection accuracy of normal signals is 99.2%, which also reaches a very high level. These results verify the effectiveness of the proposed QSVM-based power quality disturbance detection and identification method.

[0150] In addition to accuracy, the error rate can also reflect the generalization ability of the model. From the data, it can be seen that the error rate of this method in various tasks is controlled within 3.2%, among which the error rate of D4 voltage interruption disturbance is the lowest, only 0.5%. This shows that the proposed multi-model integration strategy can indeed improve the robustness of the QSVM model to noise, reduce the risk of overfitting, and thus obtain better generalization performance.

[0151] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for detecting and identifying power quality disturbances based on quantum support vector machines, characterized in that: include, Simulating and generating a disturbance signal, and performing time-frequency analysis on the disturbance signal and extracting features; Performing data preprocessing on the extracted time-frequency features, and using the preprocessed feature data to train the first model; generating a plurality of second models from the first model; The first model is used to detect whether the input signal to be tested has disturbance, and for the signal with disturbance, the plurality of second models are used to identify the disturbance type.

2. The method for detecting and identifying power quality disturbances based on quantum support vector machines according to claim 1, characterized in that: Training the first model includes the following steps: Mapping the characteristic data into a quantum state through a quantum circuit; Computing quantum kernel functions; A first model is trained using the quantum kernel function.

3. The method for detecting and identifying power quality disturbances based on quantum support vector machines according to claim 2, characterized in that: The quantum circuit includes a Hadamard gate, a controlled rotation gate and a controlled phase gate; The characteristic data is mapped into a quantum state, as shown in the following formula: Among them, U Φ(x) is a parameterized circuit, H is a Hadamard gate, exp function represents exponential mapping, Z i is the Pauli-Z matrix acting on the ith qubit, φ S (x) is a real-valued function encoded into the quantum circuit parameters according to the input power quality disturbance data x, It means that the Hadamard gate acts on n qubits simultaneously, and S is a subset of one or more of all n qubits; The specific definition of the real-valued function is shown in the following formula: f i (x)=x i ,f i,j (x)=(π-x) i )(π-x j ) Among them, x represents the input data, x i and x j is the input feature, φ i (x) represents a single qubit operation in a quantum circuit, and φ i,j (x) represents the multi-qubit operation in the circuit.

4. The method for detecting and identifying power quality disturbances based on quantum support vector machines according to claim 1, characterized in that: The subset includes, When the subset S≤2, that is, at most two qubits interact at a time, Π i∈S Only the interaction term φ is generated i,j (x)Z i Z j and the non-interaction term φ i (x)Z i , where φ i,j (x)Z i Z j represents the ZZ coupling between two qubits; When the subset S>2, the quantum circuit will involve more complex multi-body interactions; S (x)Π i∈S Z i where each qubit i participates in the combination S; this represents a joint Pauli-Z rotation between three or more qubits, with the angle and phase of the rotation being given by φ S (x) Decision.

5. The method for detecting and identifying power quality disturbances based on quantum support vector machines according to claim 2, characterized in that: The calculation of the quantum kernel function is performed by measuring the superposition and entanglement state of the quantum bit, as shown in the following formula: Among them, |0 n > indicates the initial quantum state where all n quantum bits are in the ground state |0>, yes The inverse operation of Calculate from The mapped quantum state After the inverse transformation of the mapping, it returns to the all-zero state |0 n > the amplitude, Representing quantum states After inverse mapping After that, with the initial state |0 n >the degree of overlap.

6. The method for detecting and identifying power quality disturbances based on quantum support vector machines according to claim 2, characterized in that: Training the first model includes adjusting the depth of the quantum feature map; When S≤2 and the depth is 1, the quantum circuit is as follows: U Φ(x) =exp(i(x1Z1+x2Z2+(π-x1)(π-x2)Z1Z2)) Where x1 and x2 represent input data, x1Z1 and x2Z2 represent linear transformations on a single qubit, Z1 and Z2 represent the Pauli-Z gates acting on the first and second qubits, (π-x1)(π-x2)Z1Z2 represents the nonlinear interaction between the two qubits, and Z1Z2 is the tensor product of the Z gates of the two qubits. When the depth is 2, the quantum circuit at the depth of 1 is repeated, as shown in the following formula: The depth of the quantum feature mapping is the number of layers of quantum circuits required to implement the quantum feature mapping, and each layer includes a set of quantum gate operations.

7. The method for detecting and identifying power quality disturbances based on quantum support vector machines according to claim 6, characterized in that: The feature extraction is performed to extract features of the disturbance signal at different time-frequency distributions, as shown in the following formula: Among them, w(τ-t,σ) is the Gaussian window, τ is the time shift factor, t is time, f is frequency, i is the imaginary unit, and σ is the fixed scale factor of the window function, which links the window width to the frequency, so that the window width is no longer fixed.

8. A power quality disturbance detection and identification system based on quantum support vector machine, based on the power quality disturbance detection and identification method based on quantum support vector machine according to any one of claims 1 to 7, characterized in that: include, A signal generation module is used to simulate and generate various types of power quality disturbance signals; A model training module, used for training a first model using the preprocessed feature data; The detection and identification module is used to use the first model to detect whether the input power quality signal to be measured has disturbance, and for the signal detected to have disturbance, use the multiple second models to identify the disturbance type.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the power quality disturbance detection and identification method based on quantum support vector machine described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for detecting and identifying power quality disturbances based on a quantum support vector machine as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Power quality disturbance identification method based on online weighted SVM training

    CN107123987A

  • Quantum support vector machine evaluation and forecast method for fire risk in urban public buildings

    CN109242223A

  • Generalized S transformation and SVM electric energy quality disturbance efficient identification method

    CN111368892A

  • Fault diagnosis method and system based on quantum support vector machine

    CN115099263A

  • Power quality disturbance classification method and system based on TLBO algorithm

    CN115374823A

Cited By

  • AC access flywheel UPS control method for stabilizing dynamic load of data center

    CN119944937A

  • Electric energy quality disturbance detection and identification method based on quantum variation algorithm

    CN120145101A

  • A method for detecting and identifying power quality disturbances based on quantum variational algorithm

    CN120145101B

  • Power distribution network high-resistance grounding fault identification method and device and computer equipment

    CN121412788A