A deep learning-based power signal harmonic detection and suppression method and system

By using deep learning-based frequency channel filtering and phase stability analysis, the stability problems of spectrum calculation and phase calculation in traditional power signal harmonic detection are solved, achieving higher accuracy in harmonic frequency positioning and stable power quality regulation.

CN122203266APending Publication Date: 2026-06-12NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610652011.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-13
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Traditional power signal harmonic detection methods suffer from aliasing and stability issues in spectrum and phase calculations, leading to a decrease in the accuracy of harmonic identification and compensation control, especially affecting the power grid's power quality regulation capabilities under complex load environments.

Method used

By employing a deep learning-based approach, frequency channel screening and phase stability analysis are used to identify stable harmonic frequency channels. The screening results are then used in frequency domain calculations to form a continuous phase angle sequence. Furthermore, by using weights to distinguish between stable and disturbed phase differences, harmonic compensation control commands are generated.

Benefits of technology

It improves the accuracy of harmonic frequency positioning, stabilizes phase calculation, enhances the matching degree between harmonic compensation current and actual harmonic components, and improves the stability and response capability of power quality regulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122203266A_ABST
    Figure CN122203266A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of harmonic analysis, in particular to a power signal harmonic detection and suppression method and system based on deep learning, comprising the following steps: power distribution line voltage and current transformer output signal, analog-to-digital conversion sampling and time sorting, convolution frequency activation and harmonic channel screening, harmonic phase difference calculation, matching frequency index to generate harmonic compensation control instruction set.In the present application, the change value of adjacent window frequency activation is compared to identify the stable frequency channel, the influence of transient interference is weakened, the harmonic frequency positioning accuracy is improved, the screening result participates in the frequency domain calculation to form a phase angle sequence, the phase difference of adjacent windows forms a continuous change relationship, the stable phase difference and the disturbance phase difference are distinguished by weight and accumulated to form phase evolution data, the frequency information and the phase evolution relationship jointly participate in the compensation current calculation, the harmonic compensation current and the actual harmonic component maintain a high matching degree, and the power quality regulation stability and response capability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of harmonic analysis technology, and in particular to a method and system for detecting and suppressing harmonics in power signals based on deep learning. Background Technology

[0002] The field of harmonic analysis technology mainly involves the detection, identification, and analysis of harmonic components in voltage and current signals in power systems. Its core aspects include sampling power signals, performing spectral decomposition on the sampled signals, and determining the amplitude and phase of each harmonic. Harmonic components are extracted and analyzed by mathematically modeling and frequency domain calculations of voltage and current waveforms collected during power grid operation. In power system operation monitoring and power quality assessment, harmonic components are obtained by discretely sampling power grid signals and calculating the signal's spectral distribution using Discrete Fourier Transform, or by using Fast Fourier Transform to perform frequency domain decomposition on the sampled sequence, or by using detection methods based on instantaneous reactive power theory through coordinate transformation and low-pass filtering to obtain harmonic components, thereby analyzing and identifying harmonics of various orders in the power system. Traditional deep learning-based methods for detecting and suppressing harmonics in power signals address the problem of detecting and suppressing harmonic components caused by nonlinear loads and power electronic devices in power systems. These methods involve constructing a neural network model with a convolutional neural network or long short-term memory network structure to extract features and recognize patterns from the voltage and current time series sampled from the power system. Based on the network output, harmonic component information is determined. Then, combined with the harmonic current compensation control method of an active power filter, the method calculates a compensation current reference value and uses a pulse width modulation inverter to generate the corresponding compensation current to suppress grid harmonics.

[0003] The harmonic detection process in power systems relies on single-sample sequences for spectrum calculation. The sampled data is directly fed into the frequency domain decomposition step, but the continuous time structure lacks a segmented representation during the calculation. When voltage and current signals fluctuate at different time intervals, aliasing can easily occur in the spectrum results. For example, when there are frequent load switching in distribution lines, the instantaneous current waveform fluctuates, and the overall spectrum calculation result often includes both stable harmonics and transient interference components, making misjudgment in the harmonic identification process prone to occur. Traditional spectrum analysis processes rely heavily on single-frequency domain amplitude judgments for harmonic frequency positioning. Frequency energy lacks continuous reference during time-varying processes, and frequency channels may fluctuate at different sampling times, affecting the stability of harmonic identification. The phase calculation stage determines phase information based on single-window calculation results. Phase data lacks cross-time period correlation analysis. When there are short-term disturbances or noise interference in the power grid, the phase calculation results may jump. For example, when nonlinear loads are connected or power electronic devices switch on, the harmonic phase may shift temporarily. The compensation control system generates compensation current commands based on the instantaneous phase, but the direction of the compensation current may deviate from the actual harmonic components. The compensation current calculation process directly generates control commands based on instantaneous detection results. Frequency and phase information lack time evolution references. Short-term anomaly detection results directly participate in the compensation calculation, which can easily cause compensation current oscillations. Under complex load conditions, the compensation stability decreases, and the power grid's power quality regulation capability is affected. Summary of the Invention

[0004] To achieve the above objectives, the present invention adopts the following technical solution: a method for detecting and suppressing harmonics in power signals based on deep learning, comprising the following steps: S1: The voltage transformer of the distribution line outputs an analog voltage signal and transmits it to the distribution line monitoring terminal. The current transformer of the distribution line outputs an analog current signal and transmits it to the distribution line monitoring terminal. The analog-to-digital converter samples the analog voltage signal and analog current signal according to the sampling frequency and quantization bit number and records the sampling time sequence. The distribution line monitoring terminal calls the sampling buffer to sample data in segments according to a fixed sampling window and arranges the sampled data in the sampling time sequence to generate a set of power signal window sequences. S2: Read the power signal window sequence set, call the preset convolution kernel weight convolution sampling window signal to generate a convolution response sequence, arrange the convolution response sequence according to the frequency channel to generate a frequency activation matrix, calculate the activation change value of adjacent sampling windows and compare the energy level change threshold, and filter the frequency channel that meets the energy level change threshold to generate a harmonic frequency channel sequence. S3: Read the harmonic frequency channel sequence identifier sampling window signal and perform discrete Fourier transform, calculate the harmonic phase angle of the sampling window and arrange the harmonic phase angles in the sampling time order to generate a phase angle sequence, calculate the phase difference of the phase angle of adjacent sampling windows and arrange the phase difference in the sampling time order to generate a harmonic phase difference sequence; S4: Read the harmonic phase difference sequence, set the phase stability threshold and compare the changes in adjacent phase differences, assign a stability weight to the phase differences that meet the phase stability threshold, assign a disturbance weight to the phase differences that do not meet the phase stability threshold, and accumulate the weights and phase differences to generate a harmonic phase evolution sequence arranged in the order of sampling time. S5: Read the harmonic frequency channel sequence and the harmonic phase evolution sequence, establish a frequency index and match the phase evolution data, calculate the harmonic compensation current amplitude and harmonic compensation current phase, and arrange the control data in the order of sampling time to generate a harmonic compensation control instruction set.

[0005] As a further embodiment of the present invention, the power signal window sequence set includes a fundamental voltage sampling sequence, a line current sampling sequence, a time stamp sequence, and a sampling window number sequence; the harmonic frequency channel sequence includes a third harmonic frequency channel, a fifth harmonic frequency channel, a seventh harmonic frequency channel, and higher harmonic frequency channels; the harmonic phase difference sequence includes harmonic initial phase data, a phase change sequence, window phase offset data, and a time-aligned phase sequence; the harmonic phase evolution sequence includes a stable phase weight sequence, a disturbance phase weight sequence, phase accumulation evolution data, and phase trend identification data; the harmonic compensation control instruction set includes compensation current amplitude parameters, compensation current phase parameters, compensation frequency index parameters, and control time sequence parameters.

[0006] As a further aspect of the present invention, the comparison energy level change threshold includes retaining only the frequency channels in which the activation change values ​​of two consecutive adjacent sampling windows are not less than the energy level change threshold.

[0007] As a further aspect of the present invention, the comparison phase stability threshold includes assigning the stability weight to the corresponding phase difference when the change values ​​of two consecutive adjacent phase differences are not greater than the phase stability threshold, and accumulating the weighted phase differences one by one according to the sampling time sequence to generate the harmonic phase evolution sequence.

[0008] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Acquire the analog voltage signal output by the voltage transformer of the distribution line and collect the analog current signal output by the current transformer of the distribution line. Call the sampling frequency parameter and quantization bit parameter of the analog-to-digital converter to perform discrete sampling processing on the analog voltage signal and analog current signal. Record the time sequence of the sampling points and establish a time index sequence. Perform quantization level mapping processing on the amplitude of the discrete sampling points and form a time-series arranged sampling point set to generate a discrete sampling sequence of power signal. S102: Call the discrete sampling sequence of the power signal, perform time interval calculation on the sampling point time index according to the sampling frequency parameter, monitor the sampling point time marker and perform order consistency judgment, perform rearrangement processing on the sampling point index that does not conform to the order relationship, establish a continuous time marker arrangement sampling data column, and obtain the sampling time sequence marker data column; S103: Call the sampling buffer of the power distribution line monitoring terminal and perform fixed sampling window division processing according to the sampling time sequence identifier data column. Perform interval segmentation calculation on the time sequence sampling point sequence according to the sampling window length parameter, perform time sequence arrangement on the interval sampling data and establish a time period index set to obtain the power signal window sequence set.

[0009] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Based on the power signal window sequence set, the power harmonic detection convolution calculation unit is called to perform convolution operation on the sampling window signal by pre-setting the convolution kernel weight, monitor the amplitude sequence of the sampling window signal and perform sliding convolution processing according to the convolution kernel weight, record the response amplitude at the convolution position and establish a response arrangement sequence according to the sampling window order, perform unified structure encoding processing on the response amplitude sequence, and generate a convolution response sequence. S202: Call the convolutional response sequence and perform channel attribution judgment on the response amplitude according to the frequency channel identifier, perform channel aggregation and arrangement processing on the response amplitude with the same frequency channel identifier, and establish a matrix structure index according to the frequency channel order, and perform matrix position mapping processing on the channel response amplitude to obtain the frequency activation matrix; S203: Call the frequency activation matrix and monitor the frequency channel activation amplitude sequence in the matrix. Calculate the change value of the activation amplitude of the same frequency channel according to the sampling window time order. Compare and judge the activation change value with the energy level change threshold. Perform filtering and sorting processing on the frequency channel index that meets the energy level change threshold condition to obtain the harmonic frequency channel sequence.

[0010] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the harmonic frequency channel sequence, the active power filter device harmonic monitoring unit is called to read the corresponding sampling window signal sequence, monitor the sampling window signal amplitude sequence and establish the window signal arrangement structure, call the frequency channel identifier to perform frequency channel matching judgment on the window signal sequence, perform discrete Fourier transform processing on the matched channel signal sequence and record the frequency component amplitude and phase information, and generate a harmonic phase angle sequence. S302: Call the harmonic phase angle sequence and perform phase angle arrangement processing according to the sampling window time order, monitor the phase angle identifier corresponding to the sampling window and establish a time order index structure, perform phase difference calculation on adjacent phase angles of the time index and record the change value, and perform serialization arrangement processing on the change value according to the time index order to obtain the phase difference time data column; S303: Monitor the phase difference change relationship between adjacent sampling windows according to the phase difference time data series, perform sequential association and arrangement processing on the phase difference values ​​in the time series, establish a continuous sequence structure according to the sampling window time index, and perform time series encoding processing on the arranged phase difference values ​​to obtain the harmonic phase difference sequence.

[0011] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Based on the harmonic phase difference sequence, the active power filter control unit is called to set the phase stability threshold, monitor the change value of adjacent phase difference in the harmonic phase difference sequence and perform sorting processing according to the time index order, perform comparison and judgment on the change value of adjacent phase difference according to the phase stability threshold, record the stability mark for the phase difference that meets the stability judgment condition and establish the status mark sorting sequence to generate the phase stability judgment mark column. S402: Call the phase stability determination identifier column to monitor the stable state corresponding to the phase difference, assign a stability weight to the phase difference corresponding to the stability identifier according to the control unit weight configuration parameter, assign a disturbance weight to the phase difference of the unrecorded stable identifier, establish a weight-phase difference correspondence structure, and perform sequence arrangement processing according to the time index order to obtain the phase weight corresponding sequence. S403: Monitor the relationship between weight and phase difference according to the phase weight corresponding sequence, calculate the cumulative value of weight and corresponding phase difference according to time index order, and perform sequence arrangement processing according to time index order to establish a continuous time arrangement structure and obtain the harmonic phase evolution sequence.

[0012] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Based on the harmonic frequency channel sequence and the harmonic phase evolution sequence, the active power filter compensation control unit is called to establish the correspondence between frequency index and phase evolution data, monitor the frequency index identifier in the harmonic frequency channel sequence and extract the corresponding phase evolution data, perform frequency index and phase evolution data matching judgment, perform sequence arrangement processing according to the sampling time order of the matching results, establish the frequency index and phase evolution data association structure, and obtain the frequency phase association sequence; S502: Call the frequency phase correlation sequence to monitor the phase evolution data corresponding to the frequency index, perform harmonic compensation current amplitude calculation on the frequency index and phase evolution data according to the compensation control unit compensation parameter configuration, and perform harmonic compensation current phase calculation on the phase evolution data to establish the corresponding relationship structure between compensation current amplitude and compensation current phase, and perform sequence arrangement processing according to the time index order to obtain the compensation current parameter sequence; S503: Monitor the correspondence between the compensation current amplitude and the compensation current phase according to the compensation current parameter sequence, perform control data combination processing on the compensation current parameters according to the sampling time sequence, arrange the compensation current amplitude and the compensation current phase by execution time index and establish a control data set structure to obtain the harmonic compensation control instruction set.

[0013] A deep learning-based system for detecting and suppressing harmonics in power signals, comprising: The power sampling and acquisition module acquires the analog voltage signal output by the voltage transformer of the distribution line and collects the analog current signal output by the current transformer of the distribution line. It calls the analog-to-digital converter to perform discrete sampling processing on the analog signal by adjusting the sampling frequency and quantization bits and records the sampling time sequence. It calls the sampling buffer of the distribution line monitoring terminal to divide the sampled data into segments according to a fixed sampling window and form a time-arranged data set to obtain the power signal window sequence set. The frequency domain activation recognition module calls the power harmonic detection convolution calculation unit based on the power signal window sequence set to perform convolution operation on the sampling window signal by preset convolution kernel weights and generate a convolution response sequence. The convolution response sequence is arranged according to frequency channels to form a frequency activation matrix. The activation amplitude of the frequency channel in the activation matrix is ​​called and the activation change value of adjacent sampling windows is calculated. The activation change value is compared with the energy level change threshold and the frequency channels that meet the conditions are selected to obtain the harmonic frequency channel sequence. The harmonic phase calculation module calls the harmonic monitoring unit of the active power filter to read the corresponding sampling window signal sequence based on the harmonic frequency channel sequence and performs discrete Fourier transform processing. It calculates the harmonic phase angle corresponding to the sampling window and arranges the phase angle sequence in time order. It calculates the phase difference of the phase angle of adjacent sampling windows and forms time series data to obtain the harmonic phase difference sequence. The phase evolution evaluation module calls the active power filter control unit to set the phase stability threshold based on the harmonic phase difference sequence and compares and judges the changes in adjacent phase differences. It assigns a stability weight to phase differences that meet the stability judgment conditions and a disturbance weight to phase differences that do not meet the conditions. It calculates the cumulative sequence of the weights and the corresponding phase differences and forms time-arranged data to obtain the harmonic phase evolution sequence. The compensation control generation module calls the active power filter compensation control unit based on the harmonic frequency channel sequence and the harmonic phase evolution sequence to establish the correspondence between the frequency index and the phase evolution data, calculates the harmonic compensation current amplitude and harmonic compensation current phase, and forms a control data set according to the sampling time sequence to obtain the harmonic compensation control instruction set.

[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, stable harmonic frequency channels are identified by comparing and filtering the frequency activation change values ​​between adjacent sampling windows, reducing the impact of transient interference on frequency detection results, improving the accuracy of harmonic frequency positioning, and the filtering results participate in frequency domain calculation to form a phase angle sequence. The phase difference between adjacent windows forms a continuous change relationship, and the stable phase difference and the disturbance phase difference are distinguished by weight and accumulated to form phase evolution data. Frequency information and phase evolution relationship jointly participate in the compensation current calculation, and the harmonic compensation current maintains a high degree of matching with the actual harmonic components, thereby improving the stability and response capability of power quality regulation. Attached Figure Description

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

[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4 This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention; Figure 7 This is a system module diagram of the present invention. Detailed Implementation

[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0018] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0019] Please see Figure 1This invention provides a deep learning-based method for detecting and suppressing harmonics in power signals, comprising the following steps: S1: Obtain the analog voltage signal output by the voltage transformer of the distribution line and collect the analog current signal output by the current transformer of the distribution line. Call the analog-to-digital converter to perform discrete sampling processing on the analog signal and record the sampling time sequence. Call the sampling buffer of the distribution line monitoring terminal to divide the sampled data into segments according to the fixed sampling window and form a time-arranged data set to obtain the power signal window sequence set. S2: Based on the set of power signal window sequences, the power harmonic detection convolution calculation unit is called to perform convolution operation on the sampling window signals by pre-setting the convolution kernel weights and generate a convolution response sequence. The convolution response sequence is arranged according to the frequency channel to form a frequency activation matrix. The activation amplitude of the frequency channel in the activation matrix is ​​called and the activation change value of adjacent sampling windows is calculated. The activation change value is compared with the energy level change threshold and the frequency channels that meet the conditions are selected to obtain the harmonic frequency channel sequence. S3: Based on the harmonic frequency channel sequence, the active power filter device harmonic monitoring unit reads the corresponding sampling window signal sequence and performs discrete Fourier transform processing, calculates the harmonic phase angle corresponding to the sampling window and arranges the phase angle sequence in time order, calculates the phase difference of the phase angle of adjacent sampling windows and forms time series data to obtain the harmonic phase difference sequence; S4: Based on the harmonic phase difference sequence, the active power filter control unit is called to set the phase stability threshold and compare the changes in adjacent phase differences. The phase difference that meets the stability judgment condition is assigned a stability weight, and the phase difference that does not meet the condition is assigned a disturbance weight. The weight and the corresponding phase difference are calculated to accumulate the sequence and form time-arranged data to obtain the harmonic phase evolution sequence. S5: Based on the harmonic frequency channel sequence and harmonic phase evolution sequence, the active power filter compensation control unit is called to establish the correspondence between frequency index and phase evolution data, calculate the harmonic compensation current amplitude and harmonic compensation current phase, and form a control data set according to the sampling time sequence to obtain the harmonic compensation control instruction set.

[0020] The power signal window sequence set includes the fundamental voltage sampling sequence, line current sampling sequence, time stamp sequence, and sampling window number sequence; the harmonic frequency channel sequence includes the third harmonic frequency channel, fifth harmonic frequency channel, seventh harmonic frequency channel, and higher harmonic frequency channel; the harmonic phase difference sequence includes harmonic initial phase data, phase change sequence, window phase offset data, and time-aligned phase sequence; the harmonic phase evolution sequence includes the stable phase weight sequence, disturbance phase weight sequence, phase accumulation evolution data, and phase trend identification data; the harmonic compensation control instruction set includes compensation current amplitude parameters, compensation current phase parameters, compensation frequency index parameters, and control time sequence parameters.

[0021] Please see Figure 2 The specific steps of S1 are as follows: S101: Acquire the analog voltage signal output by the voltage transformer of the distribution line and collect the analog current signal output by the current transformer of the distribution line. Call the sampling frequency parameter and quantization bit parameter of the analog-to-digital converter to perform discrete sampling processing on the analog voltage signal and analog current signal. Record the time sequence of the sampling points and establish a time index sequence. Perform quantization level mapping processing on the amplitude of the discrete sampling points and form a time-series arranged sampling point set to generate a discrete sampling sequence of power signal. The data acquisition process first reads continuous analog voltage signals from the output of the voltage transformer in the distribution line, and simultaneously reads continuous analog current signals from the output of the current transformer in the distribution line. The voltage transformer outputs a standard 220V AC secondary side signal in a 10kV distribution line, and the current transformer outputs a standard 5A AC current signal. The data acquisition process connects to an analog-to-digital converter (ADC) chip via a sampling interface, with the sampling frequency set to 12800 Hz and the quantization bit depth set to 16 bits. The ADC chip performs discrete sampling according to a fixed sampling period, with a single sampling time interval of 0.000078125 seconds. During the sampling process, the time sequence identifier corresponding to each sampling point is recorded. For example, the sampling time identifier is recorded as 0 seconds in the first sampling period, 0.000078125 seconds in the second sampling period, and 0.009999 seconds in the 128th sampling period, thus constructing a continuous time index sequence. The analog amplitude signals obtained from discrete sampling are converted into digital amplitude levels. Taking a 16-bit quantization bit as an example, the amplitude mapping range is from -32768 to +32767. If the voltage sampled by the voltage transformer in a certain sampling period is 212 volts, the corresponding quantization level is calculated to be 27853; if the current transformer samples a current of 4.6 amperes, the corresponding quantization level is 15073. All sampling points are arranged in the order of sampling time to form a time-series sampling point set. For example, in a continuous sampling time period of 0.02 seconds, a total of 256 sampling points are obtained. The voltage sampling point sequence is arranged as values ​​such as 27853, 28102, 28360, and 28495, and the current sampling point sequence is arranged as values ​​such as 15073, 15110, 15148, and 15192. The voltage and current sampling points are uniformly sorted according to the time identifier and written into the power signal discrete sampling sequence buffer structure to form a complete power signal discrete sampling sequence for subsequent time-series processing.

[0022] S102: Call the discrete sampling sequence of the power signal, calculate the time interval for the sampling point time index according to the sampling frequency parameter, monitor the sampling point time marker and perform order consistency judgment, perform rearrangement processing for sampling point indices that do not conform to the order relationship, establish a continuous time marker arrangement of sampling data column, and obtain the sampling time sequence marker data column; A time interval check is performed on the time index of each sampling point. The time interval is calculated based on the sampling frequency parameter of 12800 Hz, yielding a theoretical sampling period of 0.000078125 seconds. By reading the time identifier of each sampling point one by one and performing a time difference comparison, for example, if the time identifier of the 10th sampling point is 0.000703125 seconds and the time identifier of the 11th sampling point is also 0.00078125 seconds, the difference between the two is 0.000078125 seconds, which is consistent with the theoretical sampling period, and is therefore marked as normal sequence. If a time difference value is detected that does not conform to the sampling period, a sequence consistency check is performed on the sampling points. For example, in a certain sampling sequence, the time identifier of the 45th sampling point is 0.003515 seconds, and the time identifier of the 46th sampling point is recorded as 0.003420 seconds, which is less than the time identifier of the previous sampling point. This situation is marked as time misalignment data by sequence check. Misaligned sampling points enter the rearrangement process. By reading the time index and rearranging them according to their time magnitude, the sampling sequence is restored to a continuous sequence of 0.0034375 seconds, 0.003515 seconds, and 0.00359375 seconds. There are 6400 sampling points in the continuous 0.5-second sampling data; this sequence detection process detected 3 misaligned sampling points. After rearrangement, the continuous time identifier arrangement structure is reconstructed, and the time series is organized into 6400 time identifiers increasing by 0.000078125 seconds from 0 seconds to 0.5 seconds. The organized data column forms the sampling time sequence identifier data column, which is stored in a one-to-one correspondence with the corresponding voltage and current sampling amplitudes for subsequent sampling window division operations.

[0023] S103: Call the sampling buffer of the power distribution line monitoring terminal and perform fixed sampling window division processing according to the sampling time sequence identifier data column. Perform interval segmentation calculation on the time sequence sampling point sequence according to the sampling window length parameter. Perform time sequence arrangement on the interval sampling data and establish a time period index set to obtain the power signal window sequence set. The sampling time sequence identifier data column is loaded into the cache structure. The cache has a preset storage capacity of 65,536 sampling points, and the current sampling sequence length is 6,400 sampling points. The sampling data is divided into windows according to a fixed sampling window length parameter. The window length is set to 256 sampling points, corresponding to a time length of 0.02 seconds. The sampling sequence is divided into multiple intervals in chronological order. For example, the first sampling window contains 256 sampling points between time identifiers 0 seconds and 0.019921875 seconds, and the second sampling window contains 256 sampling points between time identifiers 0.02 seconds and 0.039921875 seconds. Interval segmentation is performed on the 6,400 sampling points according to this rule, resulting in 25 complete sampling windows. The data in each sampling window is rearranged in chronological order to form the window data structure. For example, the voltage sampling point set for the first window contains 256 values, such as 27853, 28102, 28360, and 28495, and the current sampling point set for the first window contains 256 values, such as 15073, 15110, 15148, and 15192. Each window is assigned an independent time period index number; for example, window number 1 corresponds to the time period from 0 seconds to 0.02 seconds, and window number 2 corresponds to the time period from 0.02 seconds to 0.04 seconds. A window sequence structure is established using the time period index set to generate a power signal window sequence set. In this embodiment, a total of 25 sampling windows are obtained, each containing 256 sets of voltage and current amplitude sampling data, providing data input for subsequent harmonic convolution detection.

[0024] Please see Figure 3 The specific steps of S2 are as follows: S201: Based on the set of power signal window sequences, the power harmonic detection convolution calculation unit is called to perform convolution operation on the sampling window signal by pre-setting the convolution kernel weights, monitors the amplitude sequence of the sampling window signal and performs sliding convolution processing according to the convolution kernel weights, records the response amplitude at the convolution position and establishes a response arrangement sequence according to the sampling window order, performs unified structure encoding processing on the response amplitude sequence, and generates a convolution response sequence. The system reads the sampling window signals one by one from the power signal window sequence set, and performs convolution calculations on the amplitude sequence in each window. The convolution calculation unit presets a convolution kernel weight matrix of 5 convolution kernels, each with a length of 8 sampling points. The convolution kernel weights are preset based on the harmonic frequency response; for example, the weight sequence for the first convolution kernel is 0.12, 0.18, 0.25, 0.31, 0.31, 0.25, 0.18, 0.12. When performing sliding convolution processing on the window signals, the response calculation is performed within a calculation interval of 8 consecutive sampling points in the window. For example, in window 1, the voltage sampling point sequence 27853, 28102, 28360, 28495, 28610, 28730, 28842, 28910 is read, and this sequence is multiplied item by item by the convolution kernel weights and summed to obtain a convolution response amplitude of approximately 28540. Then, one sampling point is slid, and 8 sampling points are read again to continue the same operation. A total of 249 convolution operations were performed on each window, and the response amplitude corresponding to each convolution position was recorded. A total of 6225 convolution response values ​​were obtained from the 25 sampling windows. All response values ​​were arranged in the order of the sampling windows to form a response amplitude sequence; for example, window 1 corresponds to response sequences 28540, 28610, 28705, etc. All response amplitude sequences were uniformly encoded into fixed-structure data segments, with each window's response sequence having a uniform length of 249 data points, generating a convolution response sequence for subsequent frequency channel attribution processing.

[0025] S202: Call the convolutional response sequence and perform channel attribution judgment on the response amplitude according to the frequency channel identifier. Perform channel aggregation and arrangement processing on the response amplitude with the same frequency channel identifier, and establish a matrix structure index according to the frequency channel order. Perform matrix position mapping processing on the channel response amplitude to obtain the frequency activation matrix. The response amplitude is assigned based on the frequency channel identifier. Since there are 5 convolutional kernels, 5 frequency channel identifiers are set, each corresponding to a different harmonic frequency range. Channel 1 corresponds to the 50 Hz fundamental frequency, channel 2 to the 150 Hz harmonic, channel 3 to the 250 Hz harmonic, channel 4 to the 350 Hz harmonic, and channel 5 to the 450 Hz harmonic. The output response value of each convolutional kernel is written to the corresponding frequency channel. For example, the response value of convolutional kernel 1 (28540) belongs to channel 1, and the response value of convolutional kernel 2 (16240) belongs to channel 2. All response values ​​are aggregated and arranged according to their channel numbers. A matrix structure index is then built according to the frequency channel order. The matrix rows represent the sampling window number, and the matrix columns represent the frequency channel number. For example, the response amplitude of channel 1 in window 1 is 28540, the response amplitude of channel 2 in window 1 is 16240, and the response amplitude of channel 3 in window 1 is 8120. These values ​​are then written to the corresponding matrix coordinates through matrix position mapping.

[0026] Table 1. Example of Frequency Activation Matrix

[0027] As shown in Table 1, the matrix structure completely records the activation amplitude data of each sampling window on each frequency channel, thus obtaining the frequency activation matrix.

[0028] S203: Call the frequency activation matrix and monitor the frequency channel activation amplitude sequence in the matrix. Calculate the change value of the activation amplitude of the same frequency channel according to the sampling window time order. Compare the activation change value with the energy level change threshold. Perform filtering and sorting on the frequency channel index that meets the energy level change threshold condition to obtain the harmonic frequency channel sequence. Time-varying amplitudes of active channels at the same frequency within the matrix are detected. Taking a 150 Hz channel as an example, window 1 has an amplitude of 16240, window 2 16850, and window 3 17240. Change values ​​are calculated between adjacent windows. For example, the change value from window 1 to window 2 is 610, and the change value from window 2 to window 3 is 390. These change values ​​are then compared to an energy level change threshold. The energy level change threshold is experimentally set to 500 amplitude units. This threshold is calculated based on 30 sets of harmonic test data from power distribution lines. During the tests, the average amplitude fluctuation under stable harmonic operation was 210 units, and the average under disturbed operation was 720 units. The midpoint between these two values ​​is set as 500. When a change value exceeds 500, it is considered a significant harmonic energy level change. For example, the change value of 610 from window 1 to window 2 is greater than 500, therefore it is identified as a valid harmonic change channel. The change value of 390 from window 2 to window 3 is less than 500, so it is not recorded as a change channel. The frequency channel indices that meet the threshold conditions are filtered and sorted to obtain the harmonic frequency channel sequence. For example, the 150 Hz and 250 Hz channels are detected as the main harmonic channels in 25 windows of data, and a harmonic frequency channel sequence is formed.

[0029] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the harmonic frequency channel sequence, the active power filter device harmonic monitoring unit reads the corresponding sampling window signal sequence, monitors the sampling window signal amplitude sequence and establishes the window signal arrangement structure, calls the frequency channel identifier to perform frequency channel matching judgment on the window signal sequence, performs discrete Fourier transform processing on the matched channel signal sequence and records the frequency component amplitude and phase information, and generates a harmonic phase angle sequence. First, sampling window signals are retrieved one by one from the power signal window sequence set. Each sampling window contains 256 amplitude data points, and the window signals are arranged in chronological order. For example, in the 6th sampling window, 256 amplitude data points of voltage sampling sequence 27890, 28150, 28395, 28620, etc., are read, and 256 amplitude data points of current sampling sequence 15210, 15265, 15302, 15380, etc., are read simultaneously. Then, frequency channel matching judgment is performed on the window signals, and the sampling window signals are checked against the previously screened harmonic frequency channel sequences, retaining only the data segments that match the harmonic frequency channels. After matching, discrete frequency component calculation is performed on the retained signal sequences. The calculation process is based on the discrete Fourier transform principle, performing point-by-point multiplication operations on the 256 sampling points in the sampling window with the reference cosine sequence and reference sine sequence corresponding to the target harmonic frequency, and summing the product results to obtain the real and imaginary parameters of the corresponding frequency components. For example, in window 6, the real amplitude corresponding to the 150 Hz harmonic frequency was measured to be 860 volts, and the imaginary amplitude was measured to be 415 volts. Subsequently, based on the ratio of the real to imaginary amplitudes, the harmonic phase angle for this window was approximately 64 degrees. The same processing was performed on window 7, yielding a real amplitude of 890 volts and an imaginary amplitude of 452 volts, corresponding to a phase angle of approximately 68 degrees. The phase angles calculated from each window were arranged according to the sampling window time sequence. For example, the phase angle sequence obtained from eight consecutive windows was 64 degrees, 68 degrees, 71 degrees, 74 degrees, 76 degrees, 78 degrees, 81 degrees, and 83 degrees. This phase angle sequence was arranged in a unified structure according to time sequence and written into the harmonic phase angle data set to form the harmonic phase angle sequence.

[0030] S302: Call the harmonic phase angle sequence and perform phase angle arrangement processing according to the sampling window time order, monitor the phase angle identifier corresponding to the sampling window and establish a time order index structure, perform phase difference calculation on adjacent phase angles of the time index and record the change value, and perform serialization arrangement processing on the change value according to the time index order to obtain the phase difference time data column; First, the phase angle data of consecutive windows is read, for example, window 6 has a phase angle of 64 degrees, window 7 has a phase angle of 68 degrees, window 8 has a phase angle of 71 degrees, and window 9 has a phase angle of 74 degrees. Then, the difference calculation operation is performed on the phase angle values ​​between adjacent windows. Specifically, the calculation process involves reading the phase angle corresponding to adjacent time indices one by one and performing the difference operation. For example, the phase angle change between windows 6 and 7 is 4 degrees, between windows 7 and 8 is 3 degrees, and between windows 8 and 9 is 3 degrees. All differences are recorded sequentially in time and written to the change record array. To ensure the integrity of the difference sequence, 24 phase difference values ​​are obtained from the 25 sampling window data. In the example calculation result, the first 10 phase differences are 4 degrees, 3 degrees, 3 degrees, 2 degrees, 4 degrees, 3 degrees, 5 degrees, 4 degrees, 3 degrees, and 2 degrees. All differences are serialized and arranged in time index order. After the arrangement is completed, a phase difference time data column is generated, which also includes the corresponding window number and sampling time information. For example, window 6 corresponds to a time of 0.12 seconds and a phase difference of 4 degrees; window 7 corresponds to a time of 0.14 seconds and a phase difference of 3 degrees. This method establishes the correspondence between the time index and the phase difference value, thus forming a complete phase difference time data column.

[0031] S303: Monitor the phase difference change relationship between adjacent sampling windows based on the phase difference time data column, perform sequential association and arrangement processing on the phase difference values ​​in the time series, establish a continuous sequence structure based on the sampling window time index, and perform time series encoding processing on the arranged phase difference values ​​to obtain the harmonic phase difference sequence; The time index information is read and the phase difference data is rearranged in ascending order to form a continuous time arrangement structure. For example, if the sampling window time series is 0.10 seconds, 0.12 seconds, 0.14 seconds, and 0.16 seconds, the corresponding phase difference data are 3 degrees, 4 degrees, 3 degrees, and 2 degrees. These phase difference data are then written into the continuous sequence structure according to their time indices, and a time series code is added to each phase difference data. For example, time index 0.10 seconds corresponds to phase difference number 1, and time index 0.12 seconds corresponds to phase difference number 2. This is how the time series encoding structure is established. In the example test, encoding processing was performed on 25 sampling window data to obtain 24 phase difference data encoding sequences. For example, the sequence data is arranged as follows: number 1 corresponds to 3 degrees, number 2 corresponds to 4 degrees, number 3 corresponds to 3 degrees, and number 4 corresponds to 2 degrees.

[0032] Table 2 Harmonic Phase Difference Time Series

[0033] As shown in Table 2, the phase difference data corresponding to each time node have been encoded and arranged in chronological order. Subsequently, the encoded phase difference values ​​are uniformly written into the time series structure to form a complete harmonic phase difference sequence, which is then used for subsequent phase stability analysis.

[0034] Please see Figure 5 The specific steps of S4 are as follows: S401: Based on the harmonic phase difference sequence, the active power filter control unit is called to set the phase stability threshold, monitor the change value of adjacent phase difference in the harmonic phase difference sequence and perform sorting processing according to the time index order, compare and judge the change value of adjacent phase difference according to the phase stability threshold, record the stability mark for the phase difference that meets the stability judgment condition and establish the status mark sorting sequence to generate the phase stability judgment mark column. A phase stability threshold was set, which was obtained through experimental statistics. In a harmonic monitoring experiment on an actual power distribution line, 40 sets of continuous operating data were collected, each set lasting 10 seconds, resulting in 480 phase difference samples. Statistical results showed that under stable operating conditions, the phase difference variation ranged from 1 to 4 degrees, with an average fluctuation of 2.6 degrees; under disturbed conditions, the phase difference variation ranged from 7 to 15 degrees, with an average of 9.4 degrees. Based on the midpoint between the two data ranges, a phase stability threshold of 5 degrees was set. Subsequently, adjacent values ​​in the phase difference time data column were read one by one and compared. For example, a phase difference of 3 degrees at 0.10 seconds and 4 degrees at 0.12 seconds were both less than 5 degrees, therefore recorded as a stable state; a phase difference of 7 degrees at 0.20 seconds was greater than the threshold of 5 degrees, therefore recorded as a disturbed state. Each judgment result was written into a state identifier sequence. A stable state was recorded as identifier 1, and a disturbed state as identifier 0. In this way, the state determination was completed for all 24 phase difference data points. For example, the first 10 state identifier sequences are 1, 1, 1, 1, 1, 1, 0, 1, 1, 1. After the determination is completed, a phase stability determination identifier column is formed. This identifier column is stored in one-to-one correspondence with the time index and phase difference data, providing basic data for subsequent weight calculation.

[0035] S402: Call the phase stability determination flag column to monitor the stable state corresponding to the phase difference, assign a stability weight to the phase difference corresponding to the stability flag according to the control unit weight configuration parameters, assign a disturbance weight to the phase difference of the unrecorded stable flag, establish a weight-phase difference correspondence structure, and perform sequence sorting processing according to the time index order to obtain the phase weight corresponding sequence. Weight values ​​are assigned to different states based on the control unit's weight configuration parameters. The weight settings are determined through statistical experimental data. Statistical analysis of the aforementioned 40 sets of operating samples showed that the average duration of phase changes during stable operation was 82%, and the duration during disturbances was 18%. Based on this, a stability weight of 0.8 and a disturbance weight of 0.2 are set. During weight assignment, state identifiers are read one by one. For example, a state identifier of 1 at 0.10 seconds corresponds to a stability weight of 0.8; a state identifier of 0 at 0.20 seconds corresponds to a disturbance weight of 0.2. A correspondence between weights and phase difference values ​​is then established. For example, a phase difference of 3 degrees corresponds to a weight of 0.8, and a phase difference of 7 degrees corresponds to a weight of 0.2. All correspondences are written into a sequence structure in time index order. An example sequence's first five items are: 3-degree phase difference weight 0.8, 4-degree phase difference weight 0.8, 3-degree phase difference weight 0.8, 2-degree phase difference weight 0.8, and 4-degree phase difference weight 0.8. This method forms a complete phase weight correspondence sequence for subsequent phase evolution calculations.

[0036] S403: Monitor the correspondence between weight and phase difference according to the phase weight corresponding sequence, calculate the cumulative value of weight and corresponding phase difference according to time index order, and perform sequence arrangement processing according to time index order to establish a continuous time arrangement structure and obtain the harmonic phase evolution sequence. First, the phase difference values ​​and their corresponding weights are read one by one, and a product calculation is performed to obtain the weighted phase value. For example, a phase difference of 3 degrees multiplied by a stability weight of 0.8 yields 2.4 degrees, a phase difference of 4 degrees multiplied by a stability weight of 0.8 yields 3.2 degrees, and a phase difference of 7 degrees multiplied by a perturbation weight of 0.2 yields 1.4 degrees. Then, the weighted phase values ​​are accumulated in chronological order. For example, the weighted values ​​for the first three windows are 2.4 degrees, 3.2 degrees, and 2.4 degrees, respectively, and the accumulated value is 8.0 degrees. The next window's weighted value of 3.2 degrees is then read and added to the previous 8.0 degrees to obtain 11.2 degrees. In this embodiment, the calculation is performed on 10 consecutive windows to obtain the evolution sequence of 2.4 degrees, 5.6 degrees, 8.0 degrees, 11.2 degrees, 14.4 degrees, 17.6 degrees, 19.0 degrees, 22.2 degrees, 24.6 degrees, and 26.2 degrees. All evolution values ​​are arranged in time index order and written into a continuous time structure to obtain a harmonic phase evolution sequence, which is used for subsequent compensation control data calculation.

[0037] Please see Figure 6 The specific steps of S5 are as follows: S501: Based on the harmonic frequency channel sequence and harmonic phase evolution sequence, the active power filter compensation control unit is called to establish the correspondence between frequency index and phase evolution data. The frequency index identifier in the harmonic frequency channel sequence is monitored and the corresponding phase evolution data is extracted. The frequency index and phase evolution data matching judgment is performed. The matching results are processed according to the sampling time order to establish the frequency index and phase evolution data association structure and obtain the frequency phase association sequence. Channel numbers are extracted from the harmonic frequency channel sequence; for example, the 150 Hz channel is numbered 2, and the 250 Hz channel is numbered 3. Then, the corresponding phase evolution sequence is read. For example, the phase evolution data for the 150 Hz channel are 11.2 degrees, 14.4 degrees, and 17.6 degrees; the phase evolution data for the 250 Hz channel are 9.6 degrees, 12.8 degrees, and 16.0 degrees. Matching is performed on each frequency channel individually, and the frequency index is associated with the phase evolution data. For example, a frequency of 150 Hz corresponds to a phase evolution of 11.2 degrees and a time index of 0.20 seconds; a frequency of 150 Hz corresponds to a phase evolution of 14.4 degrees and a time index of 0.22 seconds. All matched data are arranged in the order of sampling time, forming an association structure between the frequency index and the phase evolution data, resulting in a frequency-phase association sequence.

[0038] S502: Call the frequency phase correlation sequence to monitor the phase evolution data corresponding to the frequency index, perform harmonic compensation current amplitude calculation on the frequency index and phase evolution data according to the compensation control unit compensation parameter configuration, and perform harmonic compensation current phase calculation on the phase evolution data, establish the correspondence structure between compensation current amplitude and compensation current phase, and perform sequence arrangement processing according to the time index order to obtain the compensation current parameter sequence; The compensation current amplitude and phase are calculated for each frequency channel. The compensation amplitude is calculated based on the compensation ratio parameter. The compensation ratio is determined experimentally by comparing the equipment's rated capacity with the harmonic amplitude ratio. In the test, the device's rated current was 800 amps, and the average harmonic current amplitude was 870 amps, resulting in a compensation ratio of 0.65. For example, the measured amplitude of the 150 Hz harmonic current was 875 amps; multiplying this amplitude by the compensation ratio yielded a compensation current amplitude of 568 amps. Subsequently, phase evolution data was read, and the compensation current phase was calculated. For example, adding a 180-degree phase reversal value to a phase evolution value of 11.2 degrees yielded a compensation current phase of 191.2 degrees. This method establishes the correspondence between the compensation current amplitude and phase, and these parameters are arranged chronologically to form a sequence of compensation current parameters.

[0039] S503: Monitor the correspondence between the amplitude and phase of the compensation current according to the sequence of compensation current parameters, perform control data combination processing on the compensation current parameters according to the sampling time sequence, arrange the compensation current amplitude and phase by execution time index and establish a control data set structure to obtain the harmonic compensation control instruction set. The compensation current amplitude and phase are read at each time point. For example, a time of 0.22 seconds corresponds to a compensation current amplitude of 568 amperes and a compensation current phase of 191.2 degrees. The amplitude and phase are then combined according to the time index and written into the control data set. For example, the first control data record shows a time of 0.22 seconds, a compensation current of 568 amperes, and a phase of 191.2 degrees; the second control data record shows a time of 0.24 seconds, a compensation current of 574 amperes, and a phase of 194.4 degrees. All control data are arranged in chronological order to form a complete control data set structure. This results in a harmonic compensation control instruction set, which is then provided to the compensation actuator for real-time control.

[0040] Please see Figure 7 A deep learning-based system for detecting and suppressing harmonics in power signals, comprising: The power sampling and acquisition module acquires the analog voltage signal output by the voltage transformer of the distribution line and collects the analog current signal output by the current transformer of the distribution line. It calls the analog-to-digital converter to perform discrete sampling processing on the analog signal by adjusting the sampling frequency and quantization bits and records the sampling time sequence. It calls the sampling buffer of the distribution line monitoring terminal to divide the sampled data into segments according to a fixed sampling window and form a time-arranged data set to obtain the power signal window sequence set. The frequency domain activation recognition module calls the power harmonic detection convolution calculation unit based on the power signal window sequence set to perform convolution operation on the sampling window signal by preset convolution kernel weights and generate a convolution response sequence. The convolution response sequence is arranged according to frequency channels to form a frequency activation matrix. The activation amplitude of the frequency channel in the activation matrix is ​​called and the activation change value of adjacent sampling windows is calculated. The activation change value is compared with the energy level change threshold and the frequency channels that meet the conditions are selected to obtain the harmonic frequency channel sequence. The harmonic phase calculation module calls the harmonic monitoring unit of the active power filter to read the corresponding sampling window signal sequence based on the harmonic frequency channel sequence and performs discrete Fourier transform processing. It calculates the harmonic phase angle corresponding to the sampling window and arranges the phase angle sequence in time order. It calculates the phase difference of the phase angle of adjacent sampling windows and forms time series data to obtain the harmonic phase difference sequence. The phase evolution assessment module calls the active power filter control unit to set the phase stability threshold based on the harmonic phase difference sequence and compares the changes in adjacent phase differences. It assigns a stability weight to phase differences that meet the stability judgment conditions and a disturbance weight to phase differences that do not meet the conditions. It calculates the cumulative sequence of the weights and the corresponding phase differences and forms time-arranged data to obtain the harmonic phase evolution sequence. The compensation control generation module calls the active power filter compensation control unit based on the harmonic frequency channel sequence and harmonic phase evolution sequence to establish the correspondence between frequency index and phase evolution data, calculates the harmonic compensation current amplitude and harmonic compensation current phase, and forms a control data set according to the sampling time sequence to obtain the harmonic compensation control instruction set.

[0041] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for detecting and suppressing harmonics in power signals based on deep learning, characterized in that, Includes the following steps: S1: The voltage transformer of the distribution line outputs an analog voltage signal and transmits it to the distribution line monitoring terminal. The current transformer of the distribution line outputs an analog current signal and transmits it to the distribution line monitoring terminal. The analog-to-digital converter samples the analog voltage signal and analog current signal according to the sampling frequency and quantization bit number and records the sampling time sequence. The distribution line monitoring terminal calls the sampling buffer to sample data in segments according to a fixed sampling window and arranges the sampled data in the sampling time sequence to generate a set of power signal window sequences. S2: Read the power signal window sequence set, call the preset convolution kernel weight convolution sampling window signal to generate a convolution response sequence, arrange the convolution response sequence according to the frequency channel to generate a frequency activation matrix, calculate the activation change value of adjacent sampling windows and compare the energy level change threshold, and filter the frequency channel that meets the energy level change threshold to generate a harmonic frequency channel sequence. S3: Read the harmonic frequency channel sequence identifier sampling window signal and perform discrete Fourier transform, calculate the harmonic phase angle of the sampling window and arrange the harmonic phase angles in the sampling time order to generate a phase angle sequence, calculate the phase difference of the phase angle of adjacent sampling windows and arrange the phase difference in the sampling time order to generate a harmonic phase difference sequence; S4: Read the harmonic phase difference sequence, set the phase stability threshold and compare the changes in adjacent phase differences, assign a stability weight to the phase differences that meet the phase stability threshold, assign a disturbance weight to the phase differences that do not meet the phase stability threshold, and multiply the weights as coefficients with the phase differences and then accumulate them to generate a harmonic phase evolution sequence arranged in the order of sampling time. S5: Read the harmonic frequency channel sequence and the harmonic phase evolution sequence, establish a frequency index and match the phase evolution data, calculate the harmonic compensation current amplitude and harmonic compensation current phase, and arrange the control data in the order of sampling time to generate a harmonic compensation control instruction set.

2. The method for detecting and suppressing harmonics in power signals based on deep learning according to claim 1, characterized in that: The power signal window sequence set includes a fundamental voltage sampling sequence, a line current sampling sequence, a time stamp sequence, and a sampling window number sequence; the harmonic frequency channel sequence includes a third harmonic frequency channel, a fifth harmonic frequency channel, a seventh harmonic frequency channel, and higher harmonic frequency channels; the harmonic phase difference sequence includes harmonic initial phase data, a phase change sequence, window phase offset data, and a time-aligned phase sequence; the harmonic phase evolution sequence includes a stable phase weight sequence, a disturbance phase weight sequence, phase accumulation evolution data, and phase trend identification data; the harmonic compensation control instruction set includes compensation current amplitude parameters, compensation current phase parameters, compensation frequency index parameters, and control time sequence parameters.

3. The method for detecting and suppressing harmonics in power signals based on deep learning according to claim 1, characterized in that: The comparison energy level change threshold includes retaining only the frequency channels where the change value of two consecutive adjacent sampling windows is not less than the energy level change threshold.

4. The method for detecting and suppressing harmonics in power signals based on deep learning according to claim 1, characterized in that: The comparison phase stability threshold includes assigning the stability weight to the corresponding phase difference when the change values ​​of two consecutive adjacent phase differences are not greater than the phase stability threshold, and accumulating the weighted phase differences one by one in the order of sampling time to generate the harmonic phase evolution sequence.

5. The method for detecting and suppressing harmonics in power signals based on deep learning according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Acquire the analog voltage signal output by the voltage transformer of the distribution line and collect the analog current signal output by the current transformer of the distribution line. Call the sampling frequency parameter and quantization bit parameter of the analog-to-digital converter to perform discrete sampling processing on the analog voltage signal and analog current signal. Record the time sequence of the sampling points and establish a time index sequence. Perform quantization level mapping processing on the amplitude of the discrete sampling points and form a time-series arranged sampling point set to generate a discrete sampling sequence of power signal. S102: Call the discrete sampling sequence of the power signal, perform time interval calculation on the sampling point time index according to the sampling frequency parameter, monitor the sampling point time marker and perform order consistency judgment, perform rearrangement processing on the sampling point index that does not conform to the order relationship, establish a continuous time marker arrangement sampling data column, and obtain the sampling time sequence marker data column; S103: Call the sampling buffer of the power distribution line monitoring terminal and perform fixed sampling window division processing according to the sampling time sequence identifier data column. Perform interval segmentation calculation on the time sequence sampling point sequence according to the sampling window length parameter, perform time sequence arrangement on the interval sampling data and establish a time period index set to obtain the power signal window sequence set.

6. The method for detecting and suppressing harmonics in power signals based on deep learning according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Based on the power signal window sequence set, the power harmonic detection convolution calculation unit is called to perform convolution operation on the sampling window signal by pre-setting the convolution kernel weight, monitor the amplitude sequence of the sampling window signal and perform sliding convolution processing according to the convolution kernel weight, record the response amplitude at the convolution position and establish a response arrangement sequence according to the sampling window order, perform unified structure encoding processing on the response amplitude sequence, and generate a convolution response sequence. S202: Call the convolutional response sequence and perform channel attribution judgment on the response amplitude according to the frequency channel identifier, perform channel aggregation and arrangement processing on the response amplitude with the same frequency channel identifier, and establish a matrix structure index according to the frequency channel order, and perform matrix position mapping processing on the channel response amplitude to obtain the frequency activation matrix; S203: Call the frequency activation matrix and monitor the frequency channel activation amplitude sequence in the matrix. Calculate the change value of the activation amplitude of the same frequency channel according to the sampling window time order. Compare and judge the activation change value with the energy level change threshold. Perform filtering and sorting processing on the frequency channel index that meets the energy level change threshold condition to obtain the harmonic frequency channel sequence.

7. The method for detecting and suppressing harmonics in power signals based on deep learning according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: Based on the harmonic frequency channel sequence, the active power filter device harmonic monitoring unit is called to read the corresponding sampling window signal sequence, monitor the sampling window signal amplitude sequence and establish the window signal arrangement structure, call the frequency channel identifier to perform frequency channel matching judgment on the window signal sequence, perform discrete Fourier transform processing on the matched channel signal sequence and record the frequency component amplitude and phase information, and generate a harmonic phase angle sequence. S302: Call the harmonic phase angle sequence and perform phase angle arrangement processing according to the sampling window time order, monitor the phase angle identifier corresponding to the sampling window and establish a time order index structure, perform phase difference calculation on adjacent phase angles of the time index and record the change value, and perform serialization arrangement processing on the change value according to the time index order to obtain the phase difference time data column; S303: Monitor the phase difference change relationship between adjacent sampling windows according to the phase difference time data series, perform sequential association and arrangement processing on the phase difference values ​​in the time series, establish a continuous sequence structure according to the sampling window time index, and perform time series encoding processing on the arranged phase difference values ​​to obtain the harmonic phase difference sequence.

8. The method for detecting and suppressing harmonics in power signals based on deep learning according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Based on the harmonic phase difference sequence, the active power filter control unit is called to set the phase stability threshold, monitor the change value of adjacent phase difference in the harmonic phase difference sequence and perform sorting processing according to the time index order, perform comparison and judgment on the change value of adjacent phase difference according to the phase stability threshold, record the stability mark for the phase difference that meets the stability judgment condition and establish the status mark sorting sequence to generate the phase stability judgment mark column. S402: Call the phase stability determination identifier column to monitor the stable state corresponding to the phase difference, assign a stability weight to the phase difference corresponding to the stability identifier according to the control unit weight configuration parameter, assign a disturbance weight to the phase difference of the unrecorded stable identifier, establish a weight-phase difference correspondence structure, and perform sequence arrangement processing according to the time index order to obtain the phase weight corresponding sequence. S403: Based on the phase weight corresponding sequence, monitor the relationship between the weight and the phase difference, multiply the weight as a coefficient with the corresponding phase difference according to the time index order, perform the cumulative value calculation, and perform the sequence arrangement process according to the time index order to establish a continuous time arrangement structure and obtain the harmonic phase evolution sequence.

9. The method for detecting and suppressing harmonics in power signals based on deep learning according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Based on the harmonic frequency channel sequence and the harmonic phase evolution sequence, the active power filter compensation control unit is called to establish the correspondence between frequency index and phase evolution data, monitor the frequency index identifier in the harmonic frequency channel sequence and extract the corresponding phase evolution data, perform frequency index and phase evolution data matching judgment, perform sequence arrangement processing according to the sampling time order of the matching results, establish the frequency index and phase evolution data association structure, and obtain the frequency phase association sequence; S502: Call the frequency phase correlation sequence to monitor the phase evolution data corresponding to the frequency index, perform harmonic compensation current amplitude calculation on the frequency index and phase evolution data according to the compensation control unit compensation parameter configuration, and perform harmonic compensation current phase calculation on the phase evolution data to establish the corresponding relationship structure between compensation current amplitude and compensation current phase, and perform sequence arrangement processing according to the time index order to obtain the compensation current parameter sequence; S503: Monitor the correspondence between the compensation current amplitude and the compensation current phase according to the compensation current parameter sequence, perform control data combination processing on the compensation current parameters according to the sampling time sequence, arrange the compensation current amplitude and the compensation current phase by execution time index and establish a control data set structure to obtain the harmonic compensation control instruction set.

10. A power signal harmonic detection and suppression system based on deep learning, characterized in that, The system is used to implement the deep learning-based power signal harmonic detection and suppression method according to any one of claims 1-9, and the system comprises: The power sampling and acquisition module acquires the analog voltage signal output by the voltage transformer of the distribution line and collects the analog current signal output by the current transformer of the distribution line. It calls the analog-to-digital converter to perform discrete sampling processing on the analog signal by adjusting the sampling frequency and quantization bits and records the sampling time sequence. It calls the sampling buffer of the distribution line monitoring terminal to divide the sampled data into segments according to a fixed sampling window and form a time-arranged data set to obtain the power signal window sequence set. The frequency domain activation recognition module calls the power harmonic detection convolution calculation unit based on the power signal window sequence set to perform convolution operation on the sampling window signal by preset convolution kernel weights and generate a convolution response sequence. The convolution response sequence is arranged according to frequency channels to form a frequency activation matrix. The activation amplitude of the frequency channel in the activation matrix is ​​called and the activation change value of adjacent sampling windows is calculated. The activation change value is compared with the energy level change threshold and the frequency channels that meet the conditions are selected to obtain the harmonic frequency channel sequence. The harmonic phase calculation module calls the harmonic monitoring unit of the active power filter to read the corresponding sampling window signal sequence based on the harmonic frequency channel sequence and performs discrete Fourier transform processing. It calculates the harmonic phase angle corresponding to the sampling window and arranges the phase angle sequence in time order. It calculates the phase difference of the phase angle of adjacent sampling windows and forms time series data to obtain the harmonic phase difference sequence. The phase evolution evaluation module calls the active power filter control unit to set the phase stability threshold based on the harmonic phase difference sequence and compares and judges the changes in adjacent phase differences. It assigns a stability weight to phase differences that meet the stability judgment conditions and a disturbance weight to phase differences that do not meet the conditions. It calculates the cumulative sequence of corresponding phase differences multiplied by the weights and forms time-arranged data to obtain the harmonic phase evolution sequence. The compensation control generation module calls the active power filter compensation control unit based on the harmonic frequency channel sequence and the harmonic phase evolution sequence to establish the correspondence between the frequency index and the phase evolution data, calculates the harmonic compensation current amplitude and harmonic compensation current phase, and forms a control data set according to the sampling time sequence to obtain the harmonic compensation control instruction set.