An efficient and accurate power grid super-harmonic detection method and device based on compressed sensing and LSTM reconstruction

By using compressed sensing and LSTM reconstruction, the sampling rate is reduced and the accuracy and real-time performance of power grid superharmonic detection are improved, solving the problems of high sampling rate and high cost, and realizing efficient and accurate power grid superharmonic detection.

CN122109613APending Publication Date: 2026-05-29ZHENGZHOU UNIVERSITY OF LIGHT INDUSTRY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHENGZHOU UNIVERSITY OF LIGHT INDUSTRY
Filing Date
2026-02-13
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing power grid superharmonic detection technologies face challenges such as high sampling rate requirements leading to large data volumes and high hardware costs. Furthermore, traditional compressed sensing reconstruction algorithms have limited reconstruction accuracy in complex noise environments, making it difficult to meet real-time monitoring needs.

Method used

A method based on compressed sensing and LSTM reconstruction is adopted. By using low-speed ADC sampling and LSTM network to predict sparse coefficients, combined with optimization algorithms, the superharmonic signal is recovered, reducing the sampling rate and improving reconstruction accuracy and noise resistance.

Benefits of technology

It enables efficient, accurate, and real-time detection of superharmonic waves in the power grid at extremely low sampling rates, significantly reducing hardware costs and computational complexity, improving reconstruction accuracy and noise resistance, and meeting the needs of online monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122109613A_ABST
    Figure CN122109613A_ABST
Patent Text Reader

Abstract

The application discloses a power grid super-harmonic efficient and accurate detection method and device based on compressed sensing and LSTM reconstruction, and relates to the technical field of power system power quality monitoring and signal processing. The method comprises the following steps: constructing a power grid super-harmonic data set; preprocessing the power grid super-harmonic data set and dividing the power grid super-harmonic data set into a training set and a verification set according to a certain proportion; constructing a power grid super-harmonic sparse coefficient vector prediction model based on an LSTM network; training the model through the training set data; verifying the trained model through the verification set data; compressively sampling real-time signals of power grid voltage or current; predicting the predicted sparse coefficient at the current time; obtaining the optimal sparse coefficient through an optimization solver; restoring the original super-harmonic signal and extracting the frequency and amplitude characteristics. The application reduces the sampling rate and hardware cost, improves the reconstruction accuracy and noise immunity by using the time series prediction capability of the LSTM, and realizes efficient, accurate and real-time detection of the power grid super-harmonic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system power quality monitoring and signal processing technology, and in particular to a method and device for efficient and accurate detection of superharmonics in power grids based on compressed sensing and LSTM reconstruction. Background Technology

[0002] With the widespread application of power electronic equipment, the problem of superharmonic pollution in power grids is becoming increasingly prominent. Superharmonics generally refer to harmonic components with frequencies in the range of 2kHz to 150kHz, and their detection is crucial for power quality assessment and safe equipment operation.

[0003] Current power grid superharmonic detection technologies mainly face the following problems: High sampling rate requirements: According to the Nyquist sampling theorem, to detect 100kHz superharmonics without distortion, the sampling frequency needs to reach at least 200kHz. This results in a huge amount of data, putting heavy pressure on data storage, transmission, and real-time processing; Conflict between reconstruction accuracy and real-time performance: Traditional compressed sensing reconstruction algorithms, such as orthogonal matching pursuit or basis pursuit algorithms, are a "blind reconstruction" process that does not fully utilize the temporal correlation of the superharmonic signal itself. In complex power grid noise environments, the reconstruction accuracy of such algorithms is limited, and the computation time is long, making it difficult to meet the needs of online real-time monitoring; High hardware costs: To achieve high-speed sampling, high-performance analog-to-digital converters and high-performance processors are required, increasing the overall cost of the monitoring device.

[0004] Therefore, proposing an efficient and accurate method and device for detecting superharmonic waves in power grids based on compressed sensing and LSTM reconstruction to solve the difficulties existing in the prior art is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the present invention provides a method and apparatus for efficient and accurate detection of superharmonic waves in power grids based on compressed sensing and LSTM reconstruction, which can reduce the sampling rate and hardware cost, improve the reconstruction accuracy and noise resistance by utilizing the time prediction capability of LSTM, and realize efficient, accurate and real-time detection of superharmonic waves in power grids.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: An efficient and accurate method for detecting superharmonic waves in power grids based on compressed sensing and LSTM reconstruction includes: S1. Obtain voltage or current waveform data from historical power grid operation data and construct a power grid superharmonic dataset; S2. Preprocess the power grid superharmonic dataset and divide it into training and validation sets according to a certain ratio; S3. Construct a power grid superharmonic sparse coefficient vector prediction model based on LSTM network; S4. Train the LSTM-based superharmonic sparse coefficient vector prediction model of the power grid using the training set data to obtain the trained LSTM-based superharmonic sparse coefficient vector prediction model of the power grid. S5. The trained LSTM-based power grid superharmonic sparse coefficient vector prediction model is validated using validation set data to obtain the validated LSTM-based power grid superharmonic sparse coefficient vector prediction model. S6. Real-time acquisition of the original superharmonic signal x of grid voltage or current, non-uniform downsampling of high-frequency signal using random observation matrix Φ, and output of low-dimensional measurement vector y; S7. Retrieve data from the database before the current time. T The sequence of sparse coefficient vectors of superharmonic signals in each cycle under the sparse basis Ψ is input into a validated LSTM-based power grid superharmonic sparse coefficient vector prediction model, and the predicted sparse coefficient vector at the current time is output. S8. Input the low-dimensional measurement vector y and the predicted sparse coefficient vector at the current time into the optimization solver to obtain the optimal sparse coefficients. S9. Perform inverse transform using the optimal sparse coefficients and sparse basis Ψ to recover the time-domain signal of the original superharmonic signal, and perform fast Fourier transform on the recovered time-domain signal of the original superharmonic signal to extract frequency and amplitude features.

[0007] Optionally, in the above method, the voltage or current waveform data in the historical power grid operation data in S1 includes: Voltage or current waveform data under normal operating conditions, typical interference, and load switching conditions; The data comes from actual monitoring devices, digital simulation models, or a combination of both.

[0008] Optionally, in S2 of the above method, the power grid superharmonic data set is preprocessed, specifically as follows: The original waveform data is synchronously divided into segments of fixed length. For each data segment, a high sampling rate ADC with a sampling rate higher than the Nyquist sampling law is used for sampling to obtain a high-resolution reference signal. For each high-resolution reference signal, a sparse transform is performed, and it is projected onto a selected sparse basis Ψ to obtain its sparse coefficient vector. The sparse coefficient vectors of the T+1 consecutive periods are arranged in chronological order to form training samples. The sparse coefficient vector sequence of the first T periods is used as the input features of the LSTM network, and the sparse coefficient vector of the T+1 period is used as the training label.

[0009] Optionally, in S3 of the above method, a sparse coefficient vector prediction model for power grid superharmonics based on an LSTM network is constructed, specifically as follows: A power grid superharmonic sparse coefficient vector prediction model based on LSTM network, wherein the input layer dimension is consistent with the length of the sparse coefficient vector, and the input sequence length is T; The model contains one or more LSTM hidden layers, each containing a forget gate, an input gate, and an output gate. Finally, a fully connected output layer is connected. The output layer has the same dimension as the length of the sparse coefficient vector and is used to generate the prediction vector of the sparse coefficients at the current time step. The mean squared error loss function is used to measure the difference between the predicted vector of sparse coefficients at the current time and the training labels in the training samples.

[0010] Optionally, in the above method, in S4, a power grid superharmonic sparse coefficient vector prediction model based on an LSTM network is trained using the training set data, specifically as follows: Using the training set data, the backpropagation algorithm and Adam optimizer are used to iteratively optimize the network weights until the model converges.

[0011] Optionally, in S5 of the above method, the trained LSTM-based power grid superharmonic sparse coefficient vector prediction model is validated using validation set data. Specifically: Using validation set evaluation data, the prediction accuracy of the model is evaluated. When the prediction error reaches the preset requirements, the final network weights and structural parameters are saved to obtain a validated LSTM-based power grid superharmonic sparse coefficient vector prediction model. If the prediction error does not meet the preset requirements, the LSTM-based power grid superharmonic sparse coefficient vector prediction model will be retrained.

[0012] In the above method, optionally, in S6, the random observation matrix Φ is a Gaussian random matrix, and the sampling rate of non-uniform downsampling is 25% to 30% of the Nyquist sampling rate.

[0013] Optionally, in the above method, in S8, the low-dimensional measurement vector y and the predicted sparse coefficient vector at the current time are simultaneously input into the optimization solver to obtain the optimal sparse coefficients, specifically as follows: The optimal sparsity coefficients are obtained by using the FISTA or ADMM joint optimization algorithm and by weighting the L1 sparsity term and the L2 sparsity term deviation term.

[0014] A high-efficiency and accurate power grid superharmonic detection device based on compressed sensing and LSTM reconstruction, executing the high-efficiency and accurate power grid superharmonic detection method based on compressed sensing and LSTM reconstruction described above, characterized in that it includes: The signal sampling module is equipped with a low-speed analog-to-digital converter, which is used to perform non-uniform random sampling of the original superharmonic signal of the power grid according to the random observation matrix Φ, and output a low-dimensional measurement vector y. The prediction module includes a memory and a processor. The memory is used to store the sparse coefficient vector sequence of historical superharmonic signals and the trained LSTM-based power grid superharmonic sparse coefficient vector prediction model. The processor is used to run the LSTM-based power grid superharmonic sparse coefficient vector prediction model and output the predicted sparse coefficient vector at the current time based on the historical sparse coefficient vector sequence. The optimization and reconstruction module is connected to the signal sampling module and the prediction module respectively. It is used to receive the low-dimensional measurement vector y and the predicted sparse coefficient vector. By solving the composite optimization objective function, the optimal sparse coefficient vector estimate is obtained. The signal recovery and analysis module, connected to the optimization and reconstruction module, is used to recover the time-domain signal based on the optimal sparse coefficient vector estimate and sparse basis Ψ, and to perform spectral analysis to extract superharmonic features. The communication module, connected to the signal recovery and analysis module, is used to output the detection results.

[0015] Optionally, the signal sampling module of the aforementioned device can be connected to the power grid via the secondary side of a voltage transformer or a current transformer.

[0016] As can be seen from the above technical solutions, compared with the prior art, the present invention provides a method and device for efficient and accurate detection of superharmonic waves in power grids based on compressed sensing and LSTM reconstruction, which has the following beneficial effects: Based on compressed sensing theory, the present invention can use a low-speed ADC to capture high-frequency superharmonic signals, with a sampling rate of only 25%~30% of the traditional method, which greatly reduces hardware requirements and data volume hardware costs; by introducing the time-series prior information predicted by LSTM as L2 norm constraint, the sparse coefficient deviation caused by random noise is effectively corrected. In low signal-to-noise ratio environments, the recognition accuracy of weak superharmonic waves is improved compared with the traditional compressed sensing method, with stronger robustness, significantly improving reconstruction accuracy and anti-noise capability; the predicted value provided by LSTM provides high-quality "hot-start" initial values ​​for the optimization algorithm, which greatly reduces the search space, accelerates the iteration convergence speed, significantly speeds up the reconstruction speed, and better meets the needs of real-time monitoring; at extremely low sampling rates, the present invention, through the synergy of intelligent algorithms, makes the final reconstruction accuracy approach the level of full sampling (Nyquist sampling), achieving the goal of efficient and accurate detection without reducing accuracy by "downsampling". Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0018] Figure 1A flowchart of an efficient and accurate method for detecting superharmonic waves in power grids based on compressed sensing and LSTM reconstruction provided by the present invention; Figure 2 The logical structure diagram of the LSTM network-based sparse coefficient vector prediction model for power grid superharmonics provided by this invention is shown below. Figure 3 is a logical structure diagram of the LSTM hidden layer in the power grid superharmonic sparse coefficient vector prediction model based on LSTM network provided by the present invention. Figure 4 is a comparison curve of the accuracy of the method provided by the present invention with that of traditional Nyquist detection and conventional CS detection. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.

[0020] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0021] Reference Figure 1 As shown, this invention discloses an efficient and accurate method for detecting superharmonic waves in power grids based on compressed sensing and LSTM reconstruction, comprising: S1. Obtain voltage or current waveform data from historical power grid operation data and construct a power grid superharmonic dataset; S2. Preprocess the power grid superharmonic dataset and divide it into training and validation sets according to a certain ratio; S3. Construct a power grid superharmonic sparse coefficient vector prediction model based on LSTM network; S4. Train the LSTM-based superharmonic sparse coefficient vector prediction model of the power grid using the training set data to obtain the trained LSTM-based superharmonic sparse coefficient vector prediction model of the power grid. S5. The trained LSTM-based power grid superharmonic sparse coefficient vector prediction model is validated using validation set data to obtain the validated LSTM-based power grid superharmonic sparse coefficient vector prediction model. S6. Real-time acquisition of the original superharmonic signal x of grid voltage or current, non-uniform downsampling of high-frequency signal using random observation matrix Φ, and output of low-dimensional measurement vector y; S7. Retrieve data from the database before the current time. T The sequence of sparse coefficient vectors of superharmonic signals in each cycle under the sparse basis Ψ is input into a validated LSTM-based power grid superharmonic sparse coefficient vector prediction model, and the predicted sparse coefficient vector at the current time is output. S8. Input the low-dimensional measurement vector y and the predicted sparse coefficient vector at the current time into the optimization solver to obtain the optimal sparse coefficients. S9. Perform inverse transform using the optimal sparse coefficients and sparse basis Ψ to recover the time-domain signal of the original superharmonic signal, and perform fast Fourier transform on the recovered time-domain signal of the original superharmonic signal to extract frequency and amplitude features.

[0022] Furthermore, in S1, the voltage or current waveform data from the historical power grid operation data includes: Voltage or current waveform data under normal operating conditions, typical interference, and load switching conditions; The data comes from actual monitoring devices, digital simulation models, or a combination of both.

[0023] Furthermore, in S2, the power grid superharmonic dataset is preprocessed, specifically as follows: The original waveform data is synchronously divided into segments of fixed length. For each data segment, a high sampling rate ADC with a sampling rate higher than the Nyquist sampling law is used for sampling to obtain a high-resolution reference signal. For each high-resolution reference signal, a sparse transform is performed, and it is projected onto a selected sparse basis Ψ to obtain its sparse coefficient vector. The sparse coefficient vectors of the T+1 consecutive periods are arranged in chronological order to form training samples. The sparse coefficient vector sequence of the first T periods is used as the input features of the LSTM network, and the sparse coefficient vector of the T+1 period is used as the training label.

[0024] Furthermore, refer to Figure 2 As shown in Figure S3, a power grid superharmonic sparse coefficient vector prediction model based on an LSTM network is constructed, specifically as follows: A power grid superharmonic sparse coefficient vector prediction model based on LSTM network, wherein the input layer dimension is consistent with the length of the sparse coefficient vector, and the input sequence length is T; The model contains one or more LSTM hidden layers, as shown in the figure. Figure 3 As shown, the LSTM hidden layer unit contains three core gates: a forget gate that determines how much irrelevant historical superharmonic fluctuation information is discarded, an input gate that determines how much of the measurement features of the current sampling period are stored in the unit state, and an output gate that controls the strength of the predicted features in the final output. The memory unit is responsible for transmitting long-term grid state features across time steps; Finally, a fully connected output layer is connected, with the output layer dimension having the same length as the sparse coefficient vector, which is used to generate the prediction vector of the sparse coefficients at the current time step. The mean squared error loss function is used to measure the difference between the predicted vector of sparse coefficients at the current time and the training labels in the training samples.

[0025] Furthermore, in S4, a power grid superharmonic sparse coefficient vector prediction model based on an LSTM network is trained using the training set data, specifically as follows: Using the training set data, the backpropagation algorithm and Adam optimizer are used to iteratively optimize the network weights until the model converges.

[0026] Furthermore, in S5, the trained LSTM-based power grid superharmonic sparse coefficient vector prediction model is validated using validation set data. Specifically: Using validation set evaluation data, the prediction accuracy of the model is evaluated. When the prediction error reaches the preset requirements, the final network weights and structural parameters are saved to obtain a validated LSTM-based power grid superharmonic sparse coefficient vector prediction model. If the prediction error does not meet the preset requirements, the LSTM-based power grid superharmonic sparse coefficient vector prediction model will be retrained.

[0027] Furthermore, in S6, the random observation matrix Φ is a Gaussian random matrix, and the non-uniform downsampling sampling rate is 25% to 30% of the Nyquist sampling rate, which greatly alleviates the data pressure.

[0028] Furthermore, in S8, the low-dimensional measurement vector y and the predicted sparse coefficient vector at the current time are simultaneously input into the optimization solver to obtain the optimal sparse coefficients, specifically as follows: By using the FISTA or ADMM joint optimization algorithm, the optimal sparsity coefficients are obtained through weighted calculation of the L1 sparse term and the L2 sparse term deviation term; effectively combining the compressed sampling advantages of compressed sensing and the time-series prediction capabilities of LSTM.

[0029] Furthermore, refer to Figure 4As shown, the figure compares the accuracy of the present invention with that of traditional Nyquist detection and conventional CS detection. The figure shows the comparison of the accuracy (or reconstruction accuracy) of the superharmonic detection method with that of traditional Nyquist detection and conventional compressed sensing (CS) detection under different signal-to-noise ratios (SNR) or compression ratios. Curve A (traditional Nyquist detection) is a horizontal straight line (baseline) that is close to 100%, representing the ideal accuracy under high sampling rate conditions, but it comes with a huge amount of data and hardware costs; Curve B (conventional CS detection) has low accuracy at low signal-to-noise ratios. As the signal-to-noise ratio increases, the accuracy gradually increases. However, due to its "blind reconstruction" characteristic, its curve is always below curve A and fluctuates greatly in the high-noise region. Curve C (in this invention: CS + LSTM reconstruction) has a significantly higher starting position than curve B. Under low signal-to-noise ratio conditions, its accuracy is improved by approximately 15% compared to conventional CS. As the signal-to-noise ratio increases, this curve rapidly converges to curve A, exhibiting extremely strong robustness and high accuracy characteristics. As can be seen from the curves, conventional CS (Search Engine Response) tends to misidentify noise as signal components when noise levels are high. However, this invention utilizes the temporal prior information predicted by LSTM as a constraint, effectively filtering out irregular random noise and ensuring the recognition accuracy of weak superharmonic signals. With a sampling rate only 25% to 30% of the traditional method, this invention significantly reduces the reconstruction search space through LSTM's "warm-start" prediction, making the final reconstruction accuracy approach the level of full sampling (curve A).

[0030] A high-efficiency and accurate power grid superharmonic detection device based on compressed sensing and LSTM reconstruction, executing the high-efficiency and accurate power grid superharmonic detection method based on compressed sensing and LSTM reconstruction described above, characterized in that it includes: The signal sampling module is equipped with a low-speed analog-to-digital converter, which is used to perform non-uniform random sampling of the original superharmonic signal of the power grid according to the random observation matrix Φ, and output a low-dimensional measurement vector y. The prediction module includes a memory and a processor. The memory is used to store the sparse coefficient vector sequence of historical superharmonic signals and the trained LSTM-based power grid superharmonic sparse coefficient vector prediction model. The processor is used to run the LSTM-based power grid superharmonic sparse coefficient vector prediction model and output the predicted sparse coefficient vector at the current time based on the historical sparse coefficient vector sequence. The optimization and reconstruction module is connected to the signal sampling module and the prediction module respectively. It is used to receive the low-dimensional measurement vector y and the predicted sparse coefficient vector. By solving the composite optimization objective function, the optimal sparse coefficient vector estimate is obtained. The signal recovery and analysis module, connected to the optimization and reconstruction module, is used to recover the time-domain signal based on the optimal sparse coefficient vector estimate and sparse basis Ψ, and to perform spectral analysis to extract superharmonic features. The communication module, connected to the signal recovery and analysis module, is used to output the detection results.

[0031] Furthermore, the signal sampling module is connected to the power grid through the secondary side of a voltage transformer or a current transformer.

[0032] In one specific embodiment, taking the monitoring of superharmonic waves in a 10 kV substation as an example: A device containing a low-speed sampling ADC and a DSP processor is connected to the secondary side of the PT / CT, with a window length N = 512 and a measurement number M = 128. The LSTM buffers the sparse coefficients of the previous 10 cycles in real time. When a new cycle measurement y arrives, the LSTM immediately generates a prediction vector. The processor runs the Accelerated Proximal Gradient Strategy (FISTA) to solve the objective function. If the amplitude at 4kHz exceeds a preset threshold (e.g., 0.2% of the rated voltage), the device sends a warning signal via industrial Ethernet.

[0033] The LSTM network structure described in this invention employs a multi-layer architecture to process superharmonic sparse coefficient sequences of dimension N. The input layer receives a historical coefficient vector with a step size of T. The LSTM hidden layers learn the dynamic evolution characteristics of the superharmonic amplitude through their unique gating mechanism. The fully connected layers are responsible for linearly mapping the extracted temporal features to predicted coefficients with the same dimension as the input. This prediction significantly reduces the search radius of the subsequent joint optimization algorithm, resulting in a substantial improvement in reconstruction accuracy.

[0034] Simulation experiments show that, under complex power grid noise conditions (such as SNR < 10 dB), the detection accuracy of the method described in this invention is 15% higher than that of the conventional CS reconstruction algorithm. This invention utilizes LSTM to capture the continuous operation of the power grid, which significantly reduces the impact of noise fluctuations on detection accuracy, and its accuracy curve is stable and closer to the Nyquist sampling baseline. This invention maintains high-precision output that is basically consistent with traditional full-sampling detection while significantly reducing the hardware ADC sampling frequency and storage pressure, demonstrating the advanced nature of this technical solution in power grid superharmonic monitoring.

[0035] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. 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 network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0036] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for efficient and accurate detection of superharmonic waves in power grids based on compressed sensing and LSTM reconstruction, characterized in that, include: S1. Obtain voltage or current waveform data from historical power grid operation data and construct a power grid superharmonic dataset; S2. Preprocess the power grid superharmonic dataset and divide it into training and validation sets according to a certain ratio; S3. Construct a power grid superharmonic sparse coefficient vector prediction model based on LSTM network; S4. Train the LSTM-based sparse coefficient vector prediction model for power grid superharmonics using the training set data to obtain the trained LSTM-based sparse coefficient vector prediction model for power grid superharmonics. S5. The trained LSTM-based power grid superharmonic sparse coefficient vector prediction model is validated using validation set data to obtain the validated LSTM-based power grid superharmonic sparse coefficient vector prediction model. S6. Real-time acquisition of the original superharmonic signal x of grid voltage or current, non-uniform downsampling of high-frequency signal using random observation matrix Φ, and output of low-dimensional measurement vector y; S7. Retrieve data from the database before the current time. T The sequence of sparse coefficient vectors of superharmonic signals in each cycle under the sparse basis Ψ is input into a validated LSTM-based power grid superharmonic sparse coefficient vector prediction model, and the predicted sparse coefficient vector at the current time is output. S8. Input the low-dimensional measurement vector y and the predicted sparse coefficient vector at the current time into the optimization solver to obtain the optimal sparse coefficients. S9. Perform inverse transform using the optimal sparse coefficients and sparse basis Ψ to recover the time-domain signal of the original superharmonic signal, and perform fast Fourier transform on the recovered time-domain signal of the original superharmonic signal to extract frequency and amplitude features.

2. The efficient and accurate detection method for power grid superharmonics based on compressed sensing and LSTM reconstruction according to claim 1, characterized in that, In S1, the voltage or current waveform data from the historical power grid operation data includes: Voltage or current waveform data under normal operating conditions, typical interference, and load switching conditions; The data comes from actual monitoring devices, digital simulation models, or a combination of both.

3. The efficient and accurate detection method for power grid superharmonics based on compressed sensing and LSTM reconstruction according to claim 2, characterized in that, In S2, the power grid superharmonic data set is preprocessed, specifically as follows: The original waveform data is synchronously divided into segments of fixed length. For each data segment, a high sampling rate ADC with a sampling rate higher than the Nyquist sampling law is used for sampling to obtain a high-resolution reference signal. For each high-resolution reference signal, a sparse transform is performed, and it is projected onto a selected sparse basis Ψ to obtain its sparse coefficient vector. The sparse coefficient vectors of the T+1 consecutive periods are arranged in chronological order to form training samples. The sparse coefficient vector sequence of the first T periods is used as the input features of the LSTM network, and the sparse coefficient vector of the T+1 period is used as the training label.

4. The efficient and accurate detection method for power grid superharmonics based on compressed sensing and LSTM reconstruction according to claim 3, characterized in that, In S3, a power grid superharmonic sparse coefficient vector prediction model based on an LSTM network is constructed, specifically as follows: A power grid superharmonic sparse coefficient vector prediction model based on LSTM network, wherein the input layer dimension is consistent with the length of the sparse coefficient vector, and the input sequence length is T; The model contains one or more LSTM hidden layers, each containing a forget gate, an input gate, and an output gate. Finally, a fully connected output layer is connected. The output layer has the same dimension as the length of the sparse coefficient vector and is used to generate the prediction vector of the sparse coefficients at the current time step. The mean squared error loss function is used to measure the difference between the predicted vector of sparse coefficients at the current time and the training labels in the training samples.

5. The efficient and accurate detection method for power grid superharmonics based on compressed sensing and LSTM reconstruction according to claim 4, characterized in that, In S4, a power grid superharmonic sparse coefficient vector prediction model based on an LSTM network is trained using the training set data, specifically as follows: Using the training set data, the backpropagation algorithm and Adam optimizer are used to iteratively optimize the network weights until the model converges.

6. The efficient and accurate detection method for power grid superharmonics based on compressed sensing and LSTM reconstruction according to claim 5, characterized in that, In S5, the trained LSTM-based power grid superharmonic sparse coefficient vector prediction model is validated using validation set data. Specifically: Using validation set evaluation data, the prediction accuracy of the model is evaluated. When the prediction error reaches the preset requirements, the final network weights and structural parameters are saved to obtain a validated LSTM-based power grid superharmonic sparse coefficient vector prediction model. If the prediction error does not meet the preset requirements, the LSTM-based power grid superharmonic sparse coefficient vector prediction model will be retrained.

7. The efficient and accurate detection method for power grid superharmonics based on compressed sensing and LSTM reconstruction according to claim 6, characterized in that, In S6, the random observation matrix Φ is a Gaussian random matrix, and the sampling rate of non-uniform downsampling is 25% to 30% of the Nyquist sampling rate.

8. The efficient and accurate detection method for power grid superharmonics based on compressed sensing and LSTM reconstruction according to claim 7, characterized in that, In S8, the low-dimensional measurement vector y and the predicted sparse coefficient vector at the current time are simultaneously input into the optimization solver to obtain the optimal sparse coefficients, specifically as follows: The optimal sparsity coefficients are obtained by using the FISTA or ADMM joint optimization algorithm and by weighting the L1 sparsity term and the L2 sparsity term deviation term.

9. A high-efficiency and accurate power grid superharmonic detection device based on compressed sensing and LSTM reconstruction, executing the high-efficiency and accurate power grid superharmonic detection method based on compressed sensing and LSTM reconstruction as described in any one of claims 1-8, characterized in that, include: The signal sampling module is equipped with a low-speed analog-to-digital converter, which is used to perform non-uniform random sampling of the original superharmonic signal of the power grid according to the random observation matrix Φ, and output a low-dimensional measurement vector y. The prediction module includes a memory and a processor. The memory is used to store the sparse coefficient vector sequence of historical superharmonic signals and the trained LSTM-based power grid superharmonic sparse coefficient vector prediction model. The processor is used to run the LSTM-based power grid superharmonic sparse coefficient vector prediction model and output the predicted sparse coefficient vector at the current time based on the historical sparse coefficient vector sequence. The optimization and reconstruction module is connected to the signal sampling module and the prediction module respectively. It is used to receive the low-dimensional measurement vector y and the predicted sparse coefficient vector. By solving the composite optimization objective function, the optimal sparse coefficient vector estimate is obtained. The signal recovery and analysis module, connected to the optimization and reconstruction module, is used to recover the time-domain signal based on the optimal sparse coefficient vector estimate and sparse basis Ψ, and to perform spectral analysis to extract superharmonic features. The communication module, connected to the signal recovery and analysis module, is used to output the detection results.

10. The high-efficiency and accurate power grid superharmonic detection device based on compressed sensing and LSTM reconstruction according to claim 9, characterized in that, The signal sampling module is connected to the power grid through the secondary side of a voltage transformer or a current transformer.