Terminal and electric energy meter power line harmonic content fusion algorithm based on phase difference method and Prony algorithm

By integrating the phase difference method with the Prony algorithm, and combining signal preprocessing and adaptive fusion technology, the shortcomings of traditional harmonic detection methods in terms of accuracy and speed are solved, achieving efficient and accurate harmonic detection, adapting to different load characteristics, and improving the accuracy and efficiency of power line harmonic detection.

CN120993044AActive Publication Date: 2025-11-21SHENZHEN YINJUN TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511536810.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2025-11-21
Estimated Expiration
2045-10-27

AI Technical Summary

Technical Problem

Existing harmonic detection methods such as FFT, phase difference method and Prony algorithm have insufficient detection accuracy in asynchronous sampling or frequency fluctuation scenarios, especially in the limited ability to identify higher harmonics or interharmonics, and there is a problem that speed and accuracy cannot be achieved at the same time.

Method used

A fusion terminal based on the phase difference method and the Prony algorithm is adopted. Through a four-level progressive architecture of signal preprocessing, initial detection by the phase difference method, fine calibration by the Prony algorithm, and adaptive fusion output, combined with technologies such as synchronous signal acquisition, dual threshold zero-crossing detection, Hilbert transform, Hankel matrix and SVD decomposition, weights are dynamically allocated to achieve high-precision and efficient harmonic detection.

Benefits of technology

It achieves high-precision harmonic detection under different load characteristics, shortens the calculation time, improves the detection efficiency, ensures the accuracy and real-time performance of the detection results, and solves the problems of insufficient accuracy and speed of traditional single algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120993044A_ABST
    Figure CN120993044A_ABST
Patent Text Reader

Abstract

The invention discloses a phase difference method and Prony algorithm-based fusion terminal and electric energy meter power line harmonic content algorithm, and relates to the technical field of electric energy quality monitoring, and the method comprises the steps: S1, signal synchronous collection and preprocessing: a fusion terminal collects a signal through controlling an electric energy meter, and eliminates a DC component and high-frequency noise; s2, phase difference method initial detection is carried out, a fundamental wave period is positioned through double-threshold zero-crossing detection, the phase difference of adjacent periods is calculated through Hilbert transform, and the fundamental wave frequency is deduced; s3, carrying out fine calibration through a Prony algorithm, constructing a Prony model, and solving through a Hankel matrix, SVD (Singular Value Decomposition) and a characteristic equation; and S4, carrying out adaptive fusion and output. According to the method, a four-stage progressive framework of signal preprocessing, phase difference method initial detection, Prony algorithm fine correction and self-adaptive fusion output is adopted, the Prony algorithm is used for accurately correcting an initial detection result, the defects of the phase difference method in the aspects of higher harmonics and interference resistance are overcome, and unification of speed and precision is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power quality monitoring technology, and in particular to a power line harmonic content algorithm for a fusion terminal and power meter based on the phase difference method and the Prony algorithm. Background Technology

[0002] Harmonic pollution in power systems has become a key factor affecting power quality and the safe and stable operation of the power grid. With the widespread integration of nonlinear loads (such as frequency converters, electric arc furnaces, and new energy power generation equipment), the harmonic composition in the power grid is becoming increasingly complex. This not only leads to increased line losses, equipment overheating, and protection malfunctions, but also interferes with the normal operation of precision instruments. Therefore, accurate and rapid harmonic detection of power lines is a necessary prerequisite for achieving refined management of smart grids and ensuring power supply reliability.

[0003] Traditional harmonic detection methods, such as the Fast Fourier Transform (FFT), are widely used due to their high computational efficiency and simple implementation. However, the FFT method is limited by spectral leakage and the picket fence effect, resulting in a significant decrease in detection accuracy under asynchronous sampling or frequency fluctuation scenarios, especially in terms of limited ability to identify higher harmonics or interharmonics. The phase difference method, based on the zero-crossing point and phase information of the time-domain signal, has the advantages of fast speed and reasonable noise resistance for preliminary estimation of the fundamental and major harmonic frequencies, but its accuracy is easily affected by noise and signal distortion, and its ability to detect weak higher harmonics is insufficient. The Prony algorithm is sensitive to noise, easily gets trapped in local optima or introduces spurious components during the solution process, and its convergence is heavily dependent on the initial parameters, resulting in a trade-off between accuracy and speed in existing detection methods. Summary of the Invention

[0004] The purpose of this invention is to provide a harmonic content algorithm for power lines in a fusion terminal and energy meter based on the phase difference method and the Prony algorithm, so as to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a harmonic content algorithm for power lines in a fusion terminal and energy meter based on the phase difference method and the Prony algorithm, comprising the following specific steps: Step S1: Synchronous signal acquisition and preprocessing. The fusion terminal acquires signals by controlling the electricity meter, eliminates DC components and high-frequency noise, and ensures a signal-to-noise ratio ≥30dB through SNR verification. Step S2: Initial detection using the phase difference method. The fundamental frequency period is located by using double threshold zero-crossing detection. The phase difference between adjacent periods is calculated by Hilbert transform to derive the fundamental frequency. The initial parameters of the harmonics are estimated based on the integer multiple relationship of the fundamental frequency. Step S3: Prony algorithm refinement. Using the initial detection results as constraints, a Prony model is constructed. Through Hankel matrix, SVD decomposition and solving the characteristic equation, the harmonic parameters are iteratively optimized to improve the detection accuracy of higher harmonics. Step S4: Adaptive fusion and output. The weights are dynamically allocated according to the signal-to-noise ratio and harmonic order, the advantages of the two algorithms are combined, and the final parameters are output.

[0006] Preferably, step S1 is as follows: S11: Signal Acquisition. The fusion terminal controls the energy meter to acquire 3-cycle voltage or current signals at a sampling frequency of 2560Hz. The raw voltage or current discrete signals acquired by the energy meter are then processed... express; S12: DC component removal, using a sliding window averaging method to remove DC components, used to eliminate DC... To mitigate interference in phase calculation, the sliding window averaging method uses a sliding window of 64 points per cycle to calculate the DC component in real time and remove it from the original signal. The calculation method is as follows:

[0007]

[0008] When k < 63, the window is filled with historical data from the previous cycle to ensure the validity of the DC component calculation for the first cycle. The original signal with the DC component removed; S13: Anti-aliasing FIR filter, suppressing high-frequency noise through an 8th-order Hanning window FIR filter, FIR filter cutoff frequency. The filter has a passband ripple of ≤0.1dB and a stopband attenuation of ≥60dB, covering the 50th harmonic at 2500Hz, with a 100Hz guard band reserved. Specific parameters are as follows: Unit impulse response for:

[0009] Filtering Implementation: Based on FPGA parallel convolution operation, the convolution operation works synchronously through 8 multipliers. The filtering formula is as follows:

[0010] Implemented using FPGA-based parallel convolution, with a processing latency of ≤4μs; S14: Verification. Signal verification is performed using SNR. After verifying the signal's validity, a definite denoised and DC-DC-removed signal is obtained. This provides a clean input signal with a signal-to-noise ratio of ≥30dB for subsequent algorithms.

[0011] Preferably, the SNR verification step in step S14 is as follows: S141: Preliminary Fitting of Fundamental Frequency: Assuming the fundamental frequency is 50Hz, the fitting expression is:

[0012] That Pick 0.707 times the maximum value; 0.707 times is the effective value estimate. S142: Power Calculation

[0013] S143: Signal-to-noise ratio calculation:

[0014] S143: Exception handling. The exception handling mechanism is as follows: If SNR < 30dB, then send a resampling command; If the SNR < 30dB is not met for three consecutive times, a device abnormality alarm will be triggered, and the alarm information will be uploaded to the main station via the 4G module and the event record will be stored in the database.

[0015] Preferably, in step S2, the initial detection using the phase difference method is based on the linear change characteristic of the signal phase, locking the fundamental frequency and initial harmonic parameters to provide initial constraints for the Prony algorithm. The detection steps are as follows: S21: Input signal after preprocessing and filtering ; S22: Time-domain zero-crossing detection and period calculation, the detection process is as follows: Threshold setting for dual-threshold zero-crossing detection: positive zero-crossing threshold Negative zero-crossing threshold ; Calculation of zero-crossing time using linear interpolation: when zero-crossing time is detected... When the exact zero-crossing time is calculated, the formula is:

[0016] in, It is the time of zero crossing; Period calculation: Take two adjacent positive zero-crossing moments , The fundamental period is ; Effectiveness constraints are applied to the fundamental period T1: If the value exceeds the range, expand the detection window to an average of 5 cycles to ensure the reliability of the cycle calculation. S23: Hilbert Transform and Analytic Signal Construction, the Hilbert transform equation is:

[0017] The Hilbert transform is accelerated using the FFT to reduce computational complexity. Analytical signal and instantaneous phase extraction:

[0018] Where A(k) is the instantaneous amplitude, It is the instantaneous phase; The phase expansion formula is:

[0019] Fundamental frequency calculation: Take the phase difference between adjacent periods. Then the fundamental frequency is:

[0020] The fundamental frequency resolution is ≤0.01Hz; S24: Parameter estimation. Based on the derivation of power grid harmonic characteristics, the initial harmonic parameters are estimated to achieve integer multiple frequency installation. The installation process is as follows: The initial frequency of the harmonic is calculated as follows: ; The initial amplitude of harmonics is calculated based on the statistical analysis of massive measured data from the State Grid Corporation of China, with the following general scenarios set... ,in The initial amplitude of the harmonics is used to estimate the effective value of the fundamental wave; S25: Output the results, output the initial test parameters to the Prony module.

[0021] Preferably, step S3 includes the following steps: S31: Prony model construction, building a model using initial detection parameters as constraints, and inputting filtered signals. Initial parameters detected by phase difference method , Construct a Prony model of order P=50, and establish the model formula as follows: Where p is the model order, For complex amplitude values, For fitting residuals; S32: Hankel matrix and SVD decomposition. The construction of the Hankel matrix involves selecting the first 2p points of the filtered signal to construct the Hankel matrix, as shown below:

[0022]

[0023]

[0024]

[0025] Singular Value Decomposition (SVD) is the solution of the characteristic equation of the Prony model. The solution of the characteristic equation is achieved by calling the `dgesvd` function from the LAPACK library to perform matrix decomposition, separating the effective signal from noise. The decomposition formula is as follows:

[0026] in It is a diagonal matrix, retaining the first p non-zero singular values ​​and removing small singular values ​​corresponding to noise; S33: Solving the characteristic equation and iterating the parameters to extract accurate harmonic parameters; S34: Parameter accuracy verification, 1st-13th harmonic amplitude error ≤3%, 21st-50th harmonic error ≤12%.

[0027] Preferably, the step of extracting precise harmonic parameters in step S33 is as follows: S331: Extract the coefficient vector from... Extracting coefficients from the last column of the matrix Construct the characteristic equation ; S332: Identification of eigenvalues: The eigenvalues ​​are obtained using a polynomial root-finding algorithm. for:

[0028] There is no attenuation, therefore ; S333: Parameter update, performing calculations of frequency, complex amplitude, and amplitude and phase, where frequency... The calculation formula is:

[0029] Complex amplitude values ​​are used to construct the Vandermonde matrix. Solve using the least squares method ; Amplitude Phase is ; S334: Iterative optimization of harmonic parameters, with the iteration termination condition being... Or the number of iterations is ≥30.

[0030] Preferably, step S4 includes the following steps: S41: Input initial detection parameters for phase difference method and and Prony calibration parameters , and ; S42: Weight Calculation. Calculates the signal-to-noise ratio (SNR) weighting factor. Valid when SNR ≥ 20dB. The formula for calculating the SNR weighting factor is:

[0031] The higher the SNR, the stronger the reliability of the phase difference method and the greater its weight; when SNR=40dB =0.67, SNR=25dB ; The formula for calculating the harmonic order weighting factor is as follows:

[0032] The larger n is, the weaker the harmonic signal, the more obvious the noise resistance advantage of the Prony algorithm, and the larger the weight. The final weights consist of the phase difference method weights and the Prony algorithm weights. The formula for calculating the phase difference method weights is as follows:

[0033] The formula for calculating the weights in the Prony algorithm is:

[0034] S43: Weighted fusion calculation, which, through connection with weight calculation, achieves the output of optimal parameters. The calculation method is as follows:

[0035]

[0036]

[0037] in, Initially set to 0, and gradually corrected through iterations, the phase accuracy after fusion is ≤ ±0.5°. S44: Post-processing parameter output, harmonic content. The calculation method is as follows:

[0038] Among them Special treatment is required when hour, Record it as 0.00% and mark it as not detected.

[0039] Preferably, the total harmonic distortion rate in S44 The calculation method is as follows:

[0040] The results of total harmonic distortion rate and harmonic content rate are retained to two decimal places. The total harmonic distortion (THD) and harmonic content data are uploaded via a 4G module at regular 1-minute intervals according to the specified format. Real-time upload after exceeding time limit is used for data security.

[0041] A fusion terminal for the above-mentioned algorithm includes a main controller, a memory, a 2500V isolated RS485 interface, an ME909s-8214G module, and a BeiDou / GPS dual-mode timing module, with an operating temperature range of -40℃ to 85℃.

[0042] The smart energy meter, used in conjunction with the aforementioned converged terminal, employs an STM32F407 microprocessor, an AD7606-16 ADC chip, a 1000:1 voltage divider network, and a Rogowski coil current sensor. The energy meter integrates DS18B20 temperature compensation and supports 2560Hz synchronous sampling.

[0043] The technical effects and advantages of this invention are as follows: (1) The present invention adopts a four-level progressive architecture of signal preprocessing, initial detection by phase difference method, fine correction by Prony algorithm and adaptive fusion output. The phase difference method provides the Prony algorithm with an initial constraint close to the true value, which effectively avoids the problem that the Prony algorithm gets stuck in local optima and converges slowly due to large initial value deviation. The Prony algorithm accurately corrects the initial detection result, which makes up for the shortcomings of the phase difference method in high harmonics and anti-interference. The two work together to achieve the unity of speed and accuracy and solve the problem of insufficient detection capability of traditional single algorithm. (2) This invention precisely controls sampling synchronization through protocol and adopts preprocessing steps such as sliding window averaging to remove DC, anti-aliasing FIR filtering and SNR verification to provide high-quality, high signal-to-noise ratio input signals for subsequent analysis, ensuring detection accuracy from the source. The phase difference method initial detection obtains high-precision fundamental frequency through double threshold zero-crossing detection and Hilbert transform, and sets the initial amplitude of harmonics based on the integer multiple frequency assumption and measured data statistics, controlling the initial parameter deviation of the Prony algorithm within 5%, improving the convergence probability of the Prony algorithm, reducing the number of iterations, and significantly shortening the calculation time. (3) This invention innovatively introduces a dynamic weight allocation mechanism based on signal-to-noise ratio and harmonic order. In high signal-to-noise ratio and low harmonic scenarios, the phase difference method is given higher weight to ensure speed. In low signal-to-noise ratio and high harmonic scenarios, the Prony algorithm is given higher weight to ensure accuracy. This mechanism enables the algorithm to adapt to different load characteristics and output the optimal harmonic parameters. The accuracy of the harmonic parameters after fusion processing is improved. Attached Figure Description

[0044] Figure 1This is a logic diagram of the present invention.

[0045] Figure 2 This is a detailed flowchart of the preprocessing process of the present invention.

[0046] Figure 3 This is a flowchart of the phase difference method detection process of the present invention.

[0047] Figure 4 This is a flowchart of the time-domain zero-crossing detection and period calculation of the present invention.

[0048] Figure 5 This is a flowchart of the Hilbert transform and analytic signal construction process of the present invention.

[0049] Figure 6 This is a flowchart of the frequency calculation and parameter estimation process of the present invention.

[0050] Figure 7 This is a flowchart of the Prony algorithm correction process of the present invention.

[0051] Figure 8 This is a diagram illustrating the fine-tuning steps of the Prony algorithm in this invention.

[0052] Figure 9 This is a diagram illustrating the output and processing steps of the present invention.

[0053] Figure 10 This is a flowchart of the overall adaptive fusion process of the present invention. Detailed Implementation

[0054] 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.

[0055] This invention provides, for example Figures 1-10 The algorithm shown is a fusion terminal and power meter harmonic content algorithm based on phase difference method and Prony algorithm. The algorithm adopts a four-level progressive architecture of "signal preprocessing → initial detection by phase difference method → ​​fine calibration by Prony algorithm → adaptive fusion output". Each link is closely connected by mathematical model, including the following specific steps: Step S1: Synchronous signal acquisition and preprocessing. The fusion terminal acquires signals by controlling the electricity meter, eliminates DC components and high-frequency noise, and ensures a signal-to-noise ratio ≥30dB through SNR verification. Step S2: Initial detection using the phase difference method. The fundamental frequency period is located using double threshold zero-crossing detection. The phase difference between adjacent periods is calculated using Hilbert transform to derive the fundamental frequency. The initial parameters of the harmonics are estimated based on the integer multiple relationship of the fundamental frequency. The initial detection using the phase difference method provides initial constraints for the Prony algorithm, preventing it from getting trapped in local optima. Step S3: Prony algorithm refinement. Using the initial detection results as constraints, a Prony model is constructed. Through Hankel matrix, SVD decomposition and solving the characteristic equation, the harmonic parameters are iteratively optimized to improve the detection accuracy of higher harmonics. Step S4: Adaptive fusion and output. The weights are dynamically allocated according to the signal-to-noise ratio and harmonic order, the advantages of the two algorithms are combined, and the final parameters are output.

[0056] The specific steps of signal acquisition and preprocessing in step S1 are as follows: S11: Signal Acquisition. The fusion terminal controls the energy meter to acquire 3-cycle voltage or current signals at a sampling frequency of 2560Hz via the DL / T645-2007 protocol. The raw voltage or current discrete signals acquired by the energy meter are then processed... The signal acquisition process is as follows: Sampling control: The fusion terminal sends sampling instructions to the energy meter. The instructions include a UTC timestamp and are accurate to 1ms, ensuring that the sampling synchronization deviation of the entire network is ≤1ms. Sampling parameters: Sampling frequency Three consecutive collection cycles were conducted, with N=64 points sampled per cycle, and the sampling interval was [missing information]. The sampling frequency standard is based on Clause 5.2.2 of DL / T1475-2015; The raw signal of the acquired voltage or current signal. The expression is as follows:

[0057] in The fundamental amplitude / frequency / phase; For the nth harmonic parameters; This is the DC component; It is Gaussian white noise; =0,1,...,191.

[0058] S12: DC component removal, using a sliding window averaging method to remove DC components, used to eliminate DC... Interference to phase calculations, because the DC component can cause the baseline of phase difference calculation to shift, increasing the fundamental period positioning error by 3-5 times, must be removed first. The sliding window averaging method uses a sliding window of 64 points per cycle to calculate the DC component in real time and remove it from the original signal. The calculation method is as follows:

[0059]

[0060] When k < 63, the window is filled with historical data from the previous cycle to ensure the validity of the DC component calculation for the first cycle. To eliminate the DC component from the original signal, the sliding window averaging method reduces the fundamental phase detection error from ±5° to within ±0.5°, thus meeting the accuracy requirements for subsequent phase difference calculations.

[0061] S13: Anti-aliasing FIR filter. The anti-aliasing FIR filter is connected to the DC de-DC converter. It uses an 8th-order Hanning window FIR filter to suppress high-frequency noise and avoid spectral aliasing. The FIR filter cutoff frequency... The filter has a passband ripple of ≤0.1dB and a stopband attenuation of ≥60dB, covering the 50th harmonic at 2500Hz, with a 100Hz guard band reserved. Specific parameters are as follows: Unit impulse response for:

[0062] Filtering Implementation: Based on FPGA parallel convolution operation, the convolution operation works synchronously through 8 multipliers. The filtering formula is as follows:

[0063] The filtered signal is implemented using FPGA parallel convolution, with performance indicators of passband ripple ≤0.1dB (0-2500Hz), stopband attenuation ≥60dB (above 3000Hz), and processing delay ≤4μs. It has passed the anti-aliasing characteristic test of the State Grid Electric Power Research Institute.

[0064] S14: Verification. The SNR verification is connected to the filtering in S13 to improve the validity of the verification signal and avoid invalid calculations. The signal is verified by SNR. After verifying the validity of the signal, a definite denoised and DC-free signal is obtained. This provides a clean input signal with a signal-to-noise ratio of ≥30dB for subsequent algorithms.

[0065] The signal-to-noise ratio (SNR) is calculated using the fundamental frequency fitting residual. If the threshold is not met, resampling is triggered to ensure the quality of the input signal. The SNR verification steps are as follows: S141: Preliminary Fitting of Fundamental Frequency: Assuming the fundamental frequency is 50Hz, the fitting expression is:

[0066] That Pick 0.707 times the maximum value, where 0.707 times is the effective value estimate.

[0067] S142: Signal power calculation:

[0068] S143: Signal-to-noise ratio calculation:

[0069] S143: Exception handling. The exception handling mechanism is as follows: If SNR < 30dB, a resampling command is sent, and the resampling command can be resampled a maximum of 3 times; If the SNR < 30dB is not met for three consecutive times, a device abnormality alarm will be triggered, and the alarm information will be uploaded to the main station via the 4G module and the event record will be stored in the database. By analyzing the signal The noise reduction and DC removal facilitate the quality requirements of subsequent algorithms for the input signal, ensuring that its SNR is ≥30dB.

[0070] In step S2, the initial detection using the phase difference method is based on the linear change characteristic of the signal phase. It locks the fundamental frequency and initial parameters of the harmonics, providing initial constraints for the Prony algorithm and providing initial parameters close to the true values, thus shortening its convergence time. The initial detection steps of the phase difference method are as follows: S21: Input signal after preprocessing and filtering ; S22: Time-domain zero-crossing detection and period calculation. To address the misjudgment problem of a single threshold at low signal amplitudes, the detection process is as follows: Threshold setting for dual-threshold zero-crossing detection: positive zero-crossing threshold Negative zero-crossing threshold ; Calculation of zero-crossing time using linear interpolation: when zero-crossing time is detected... When the exact zero-crossing time is calculated, the formula is: ; Period calculation: Take two adjacent positive zero-crossing moments , The fundamental period is ; Effectiveness constraints are applied to the fundamental period T1: The validity constraint corresponds to the power grid frequency fluctuation range of 50Hz±2.5Hz; if it exceeds the range, the detection window is expanded to take the average of 5 cycles to ensure the reliability of the cycle calculation. The fundamental frequency is linked to the period positioning; the fundamental frequency calculation derives the accurate fundamental frequency through phase difference. ; S23: Hilbert Transform and Analytic Signal Construction, the Hilbert transform equation is:

[0071] The Hilbert transform is accelerated using the FFT to reduce computational complexity. Analytical signal and instantaneous phase extraction:

[0072] Where A(k) is the instantaneous amplitude, Instantaneous phase (range of values) ); The signal phase expansion formula is:

[0073] Signal phase is to be eliminated A jump is used to obtain a continuous phase curve; Fundamental frequency calculation: Take the phase difference between adjacent periods (64 points apart). Then the fundamental frequency is:

[0074] Fundamental frequency Resolution ≤0.01Hz, fundamental frequency The precision is retained to 4 decimal places, which meets the requirements of Clause 6.2 of DL / T1475-2015.

[0075] S24: Parameter estimation. Based on the derivation of power grid harmonic characteristics, the initial harmonic parameters are estimated to achieve integer multiple frequency setting. Integer multiple frequency setting conforms to the harmonic generation law of the power system. The harmonics generated by nonlinear loads are mostly integer multiples of the fundamental frequency. The process of integer multiple frequency setting is as follows: The initial frequency of the harmonic is calculated as follows: ; The initial amplitude of harmonics is calculated based on the statistical analysis of massive measured data from the State Grid Corporation of China, with the following general scenarios set... ,in The initial amplitude of the harmonics is used to estimate the effective value of the fundamental wave; The Prony algorithm is sensitive to initial values; if the initial value deviates from the true value by more than 20%, the convergence probability drops to 60%. This step controls the initial deviation to within 5%, increasing the convergence probability to 100%, reducing the number of iterations from 50 to less than 30, and reducing the computation time by 40%. Special scenario adaptation: In industrial loads containing frequency converters, the initial amplitudes of the 6th, 12th, and 18th characteristic harmonics are adjusted to... This improves the convergence speed of the Prony algorithm for characteristic harmonics. S25: Output the results. Output the initial test parameters to the Prony module and output the fundamental frequency. Initial amplitude of harmonics and frequency The fundamental frequency resolution provides an initial constraint for the Prony algorithm, reducing the number of iterations from 50 to less than 30.

[0076] Step S3, Prony algorithm precision correction, includes the following steps: S31: Prony model construction, building a model using initial detection parameters as constraints, and inputting filtered signals. Initial parameters detected by phase difference method , A Prony model of order P=50 was constructed, and the accurate harmonic amplitude was determined after precise correction using the Prony algorithm. ,frequency Phase The model is adapted to the steady-state harmonic characteristics of the power grid, and its characteristic is that the attenuation of power grid harmonics is extremely small, and the attenuation factor can be ignored. The established model formula is as follows: Where p is the model order, the model order p can be dynamically adjusted, and the base value of the model order p is 50, covering the 2nd to 50th harmonics; when At that time, the order increased to p=52 to deal with the third harmonic frequency division problem; The complex amplitude value contains the amplitude value. and phase information; and To fit the residuals, by To ensure fitting accuracy.

[0077] S32: Hankel matrix and SVD decomposition. The Hankel matrix is ​​connected with the Prony model, which facilitates the transformation of nonlinear problems into linear solutions. The Hankel matrix is ​​constructed by selecting the first 2p points of the filtered signal and constructing a p-order Hankel matrix. The construction of the Hankel matrix is ​​used to enhance the noise resistance of the signal, and the matrix is ​​shown below:

[0078]

[0079]

[0080]

[0081] Singular Value Decomposition (SVD) involves solving the characteristic equation of the Hankel matrix in the Prony model. This solution utilizes the `dgesvd` function from the LAPACK library to perform matrix decomposition, separating the effective signal from noise. The decomposition formula is as follows:

[0082] in It is a diagonal matrix with singular values ​​arranged in descending order. The first p non-zero singular values ​​are retained, and small singular values ​​corresponding to noise are removed.

[0083] S33: Solving the characteristic equation and parameter iteration, used to extract accurate harmonic parameters, and connected with SVD in step S32. The steps for extracting accurate harmonic parameters are as follows: S331: Extract the coefficient vector from... Extracting coefficients from the last column of the matrix Construct the characteristic equation: ; S332: Identification of eigenvalues: The eigenvalues ​​are obtained using a polynomial root-finding algorithm. for:

[0084] The eigenvalues ​​do not decay, therefore ; S333: Parameter update, performing calculations of frequency, complex amplitude, and amplitude and phase, where frequency... The calculation formula is:

[0085] Complex amplitude values ​​are used to construct the Vandermonde matrix. Solve using the least squares method ; The amplitude and phase are respectively , ; S334: Iterative optimization of harmonic parameters, with the iteration termination condition being... Or the number of iterations is ≥30, where the condition Used for frequency convergence, or for ≥30 iterations to avoid infinite iteration; S34: Parameter accuracy verification, the amplitude error of the 1st-13th harmonics is ≤3%, the error of the 21st-50th harmonics is ≤12%, and the accuracy of the harmonic parameters is better than the upper limit of error of "1st-13th harmonics ≤5%, 21st-50th harmonics ≤15%" specified in DL / T1475-2015.

[0086] The Prony algorithm is used to accurately correct and compensate for the weak anti-interference ability of the phase difference method, thereby improving the detection accuracy of high-order harmonics.

[0087] Step S4, adaptive fusion and output, includes the following steps: S41: Input initial detection parameters for phase difference method and and Prony calibration parameters , , ; S42: Weight calculation. Weight calculation dynamically allocates weights based on signal characteristics and is used to calculate the impact of signal-to-noise ratio and harmonic order on detection accuracy. The signal-to-noise ratio (SNR) weighting factor is effective when SNR ≥ 20dB. The formula for calculating the SNR weighting factor is:

[0088] The higher the SNR, the stronger the reliability of the phase difference method and the greater its weight; when SNR=40dB =0.67, SNR=25dB ; The formula for calculating the harmonic order weighting factor is as follows:

[0089] The larger n is, the weaker the harmonic signal, the more obvious the noise resistance advantage of the Prony algorithm, and the larger the weight; when n=3 =0.94, n=30 =0.55; The final weights consist of the phase difference method weights and the Prony algorithm weights. The formula for calculating the phase difference method weights is as follows:

[0090] The formula for calculating the weights in the Prony algorithm is:

[0091] in, For the phase difference method of harmonic signals, The Prony algorithm weights are used for harmonic signals.

[0092] Example 1 of phase difference weighting and Prony algorithm weighting: Residential load (SNR=40dB, n=3): , (Residential load is mainly determined by the phase difference method, while also taking speed into account); Industrial load (SNR=25dB, n=30): =0.17×0.55≈0.09, =0.91 (Industrial loads are primarily based on Prony to ensure accuracy).

[0093] S43: Weighted fusion calculation, which, through connection with weight calculation, achieves the output of optimal parameters. The calculation method is as follows:

[0094]

[0095]

[0096] in, Initially set to 0, and gradually corrected through iterations, the phase accuracy after fusion is ≤ ±0.5°. S44: Post-processing parameter output, used for harmonic content filtering calculation through weighted fusion, harmonic content rate. The calculation method is as follows:

[0097] Among them Special treatment is required when hour, Recorded as 0.00% and marked as not detected, in accordance with Clause 6.3.2 of Q / GDW11645-2016; Total Harmonic Distortion The calculation method is as follows:

[0098] The results of total harmonic distortion rate and harmonic content rate are retained to two decimal places.

[0099] Data such as total harmonic distortion (THD) and harmonic content are uploaded via a 4G module at regular intervals of 1 minute, conforming to the specified format (DL / T645-2007). Data identifiers are 0x0701 (voltage harmonics) and 0x0702 (current harmonics). Each harmonic point consists of 3 bytes, comprising 2 bytes of valid value and 1 byte of harmonic count. Total harmonic distortion (THD) is... Real-time upload beyond the time limit, using DL / T698.45 protocol + AES-128 encryption for data security, ensuring the data security of harmonic signals; Data storage involves storing the original data for 90 days and the fusion processing results for 365 days in a memory. Each record is appended with an SHA-1 checksum to ensure integrity.

[0100] A converged terminal for implementing the above algorithm includes a main controller TIAM3352, 1GB DDR3 + 8GB eMMC memory, a 2500V isolated RS485 interface, an ME909s-8214G module and a BeiDou / GPS dual-mode timing module, with an operating temperature range of -40℃ to 85℃.

[0101] The smart energy meter, used in conjunction with the converged terminal, employs an STM32F407 microprocessor, an AD7606-16ADC chip, a 1000:1 voltage divider network, and a Rogowski coil current sensor. The energy meter integrates DS18B20 temperature compensation and supports 2560Hz synchronous sampling.

[0102] Example 2, in which the hardware platform is configured with a converged terminal and a smart energy meter as follows: The fusion terminal is the core processing unit for the algorithm. Its specific configuration is shown in Table 1 below.

[0103] The smart energy meter is a signal acquisition unit. The specific configuration is shown in Table 2 below.

[0104] Example 3: Equipment debugging and standard procedures are as follows: a. Equipment calibration: the FLUKE6100A harmonic standard source is grade 0.05, and the Yokogawa WT3000 power analyzer is grade 0.1. b. Calibration point settings are as follows: Fundamental frequencies: 49.5Hz, 50.0Hz, 50.5Hz; Harmonic content: 2nd order 5%, 3rd order 3%, 5th order 2%, 7th order 1%; Temperature conditions: 25℃ (normal temperature), -25℃, +70℃ (extreme operating conditions); c. Calibration steps: Equipment preheating: Preheat the standard source for 1 hour, and preheat the device under test for 30 minutes; Data acquisition: Set the standard source output point by point, and collect 10 sets of data after stabilizing for 5 seconds; Error calculation: These are measured values. (Standard source output value); Coefficient update: If If the threshold is exceeded, update the temperature segment calibration coefficient table (each segment is 5℃) and achieve full temperature range compensation through linear interpolation; d. On-site commissioning; Communication debugging: Use DL / T645-2007 debugging software to send sampling commands and verify that the energy meter response time is ≤10ms and the data transmission packet loss rate is ≤0.1%.

[0105] Algorithm debugging: Test the number of Prony algorithm iterations in the industrial field (including frequency converters and electric arc furnaces) (target ≤ 30 times) to ensure that the single cycle processing time is ≤ 200ms.

[0106] Anomaly handling debugging: Simulate signal interruption (disconnect voltage / current wiring), verify that the device triggers an alarm within 1 second, and that the breakpoint resume function is normal (caching the most recent 1000 records).

[0107] e. Compliance and Performance Verification Report The standard compliance checklist is shown in Table 3 below:

[0108] The performance test results are shown in Table 4 below:

[0109] By using the phase difference method for initial detection, the Prony algorithm for fine calibration, and adaptive fusion and output, the problems of low accuracy, poor real-time performance, and weak anti-interference performance of traditional harmonic detection algorithms are solved, thereby improving detection accuracy and efficiency.

[0110] Finally, it should be noted that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A harmonic content algorithm for power lines in a fusion terminal and energy meter based on the phase difference method and the Prony algorithm, characterized in that, The specific steps include the following: Step S1: Synchronous signal acquisition and preprocessing. The fusion terminal acquires signals by controlling the energy meter, eliminates DC components and high-frequency noise, and ensures a signal-to-noise ratio ≥30dB through SNR verification. Step S2: Initial detection using the phase difference method. The fundamental frequency period is located by using double threshold zero-crossing detection. The phase difference between adjacent periods is calculated by Hilbert transform to derive the fundamental frequency. The initial parameters of the harmonics are estimated based on the integer multiple relationship of the fundamental frequency. Step S3: Prony algorithm refinement. Using the initial detection results as constraints, a Prony model is constructed. Through Hankel matrix, SVD decomposition and solving the characteristic equation, the harmonic parameters are iteratively optimized to improve the detection accuracy of higher harmonics. Step S4: Adaptive fusion and output. The weights are dynamically allocated according to the signal-to-noise ratio and harmonic order, the advantages of the two algorithms are combined, and the final parameters are output.

2. The harmonic content algorithm for power lines of a fusion terminal and energy meter based on the phase difference method and the Prony algorithm as described in claim 1, characterized in that, The steps of step S1 are as follows: S11: Signal Acquisition. The fusion terminal controls the energy meter to acquire 3-cycle voltage or current signals at a sampling frequency of 2560Hz. The raw voltage or current discrete signals acquired by the energy meter are then processed... express; S12: DC component removal, using a sliding window averaging method to remove DC components, used to eliminate DC... To mitigate interference in phase calculations, the sliding window averaging method uses a sliding window of 64 points per cycle to calculate the DC component in real time and remove it from the original signal. The calculation method is as follows: When k < 63, the window is filled with historical data from the previous cycle to ensure the validity of the DC component calculation for the first cycle. The original signal with the DC component removed; S13: Anti-aliasing FIR filter, suppressing high-frequency noise through an 8th-order Hanning window FIR filter, FIR filter cutoff frequency. The filter has a passband ripple of ≤0.1dB and a stopband attenuation of ≥60dB, covering the 50th harmonic at 2500Hz, with a 100Hz guard band reserved. Specific parameters are as follows: Unit impulse response for: Filtering Implementation: Based on FPGA parallel convolution operation, the convolution operation works synchronously through 8 multipliers. The filtering formula is as follows: Implemented using FPGA-based parallel convolution, with a processing latency of ≤4μs; S14: Verification. Signal verification is performed using SNR. After verifying the signal's validity, a definite denoised and DC-DC-removed signal is obtained. This provides a clean input signal with a signal-to-noise ratio of ≥30dB for subsequent algorithms.

3. The harmonic content algorithm for power lines of a fusion terminal and energy meter based on the phase difference method and the Prony algorithm as described in claim 2, characterized in that, The SNR verification step in step S14 is as follows: S141: Preliminary Fitting of Fundamental Frequency: Assuming the fundamental frequency is 50Hz, the fitting expression is: That Pick 0.707 times the maximum value; 0.707 times is the effective value estimate. S142: Power Calculation S143: Signal-to-noise ratio calculation: S143: Exception handling. The exception handling mechanism is as follows: If SNR < 30dB, then send a resampling command; If the SNR < 30dB is not met for three consecutive times, a device abnormality alarm will be triggered, and the alarm information will be uploaded to the main station via the 4G module and the event record will be stored in the database.

4. The harmonic content algorithm for power lines of a fusion terminal and energy meter based on the phase difference method and the Prony algorithm as described in claim 1, characterized in that, In step S2, the initial detection using the phase difference method is based on the linear change characteristic of the signal phase, locking the fundamental frequency and initial harmonic parameters to provide initial constraints for the Prony algorithm. The detection steps are as follows: S21: Input signal after preprocessing and filtering ; S22: Time-domain zero-crossing detection and period calculation, the detection process is as follows: Threshold setting for dual-threshold zero-crossing detection: positive zero-crossing threshold Negative zero-crossing threshold ; Calculation of zero-crossing time using linear interpolation: when zero-crossing time is detected... When the exact zero-crossing time is calculated, the formula is: in, The moment of zero crossing; Period calculation: Take two adjacent positive zero-crossing moments , The fundamental period is ; Effectiveness constraints are applied to the fundamental period T1: If the value exceeds the range, expand the detection window to an average of 5 cycles to ensure the reliability of the cycle calculation. S23: Hilbert Transform and Analytic Signal Construction, the Hilbert transform equation is: The Hilbert transform is accelerated using the FFT to reduce computational complexity. Analytical signal and instantaneous phase extraction: Where A(k) is the instantaneous amplitude, It is the instantaneous phase; The phase expansion formula is: Fundamental frequency calculation: Take the phase difference between adjacent periods. Then the fundamental frequency is: The fundamental frequency resolution is ≤0.01Hz; S24: Parameter estimation. Based on the derivation of power grid harmonic characteristics, the initial harmonic parameters are estimated to achieve integer multiple frequency installation. The installation process is as follows: The initial frequency of the harmonic is calculated as follows: ; The initial amplitude of harmonics is calculated based on the statistical analysis of massive measured data from the State Grid Corporation of China, with the following general scenarios set... ,in The initial amplitude of the harmonics is used to estimate the effective value of the fundamental wave; S25: Output the results, output the initial test parameters to the Prony module.

5. The harmonic content algorithm for power lines of a fusion terminal and energy meter based on the phase difference method and the Prony algorithm as described in claim 1, characterized in that, Step S3 includes the following steps: S31: Prony model construction, building a model using initial detection parameters as constraints, and inputting filtered signals. Initial parameters detected by phase difference method , Construct a Prony model of order P=50, and establish the model formula as follows: Where p is the model order, For complex amplitude values, For fitting residuals; S32: Hankel matrix and SVD decomposition. The construction of the Hankel matrix involves selecting the first 2p points of the filtered signal to construct the Hankel matrix, as shown below: Singular Value Decomposition (SVD) is the solution of the characteristic equation of the Prony model. The solution of the characteristic equation is achieved by calling the `dgesvd` function from the LAPACK library to perform matrix decomposition, separating the effective signal from noise. The decomposition formula is as follows: in It is a diagonal matrix, retaining the first p non-zero singular values ​​and removing small singular values ​​corresponding to noise; S33: Solving the characteristic equation and iterating the parameters to extract accurate harmonic parameters; S34: Parameter accuracy verification, 1st-13th harmonic amplitude error ≤3%, 21st-50th harmonic error ≤12%.

6. The harmonic content algorithm for power lines of a fusion terminal and energy meter based on the phase difference method and the Prony algorithm as described in claim 4, characterized in that, The step of extracting precise harmonic parameters in step S33 is as follows: S331: Extract the coefficient vector from... Extracting coefficients from the last column of the matrix Construct the characteristic equation ; S332: Identification of eigenvalues: The eigenvalues ​​are obtained using a polynomial root-finding algorithm. for: There is no attenuation, therefore ; S333: Parameter update, performing calculations of frequency, complex amplitude, and amplitude and phase, where frequency... The calculation formula is: Complex amplitude values ​​are used to construct the Vandermonde matrix. Solve using the least squares method ; Amplitude Phase is ; S334: Iterative optimization of harmonic parameters, with the iteration termination condition being... Or the number of iterations is ≥30.

7. The harmonic content algorithm for power lines of a fusion terminal and energy meter based on the phase difference method and the Prony algorithm as described in claim 1, characterized in that, Step S4 includes the following steps: S41: Input initial detection parameters for phase difference method and and Prony calibration parameters , and ; S42: Weight Calculation. Calculates the signal-to-noise ratio (SNR) weighting factor. Valid when SNR ≥ 20dB. The formula for calculating the SNR weighting factor is: The higher the SNR, the stronger the reliability of the phase difference method and the greater its weight; when SNR=40dB =0.67, SNR=25dB ; The formula for calculating the harmonic order weighting factor is as follows: The larger n is, the weaker the harmonic signal, the more obvious the noise resistance advantage of the Prony algorithm, and the larger the weight. The final weights consist of the phase difference method weights and the Prony algorithm weights. The formula for calculating the phase difference method weights is as follows: The formula for calculating the weights in the Prony algorithm is: S43: Weighted fusion calculation, which, through connection with weight calculation, achieves the output of optimal parameters. The calculation method is as follows: in, Initially set to 0, and gradually corrected through iterations, the phase accuracy after fusion is ≤ ±0.5°. S44: Post-processing parameter output, harmonic content. The calculation method is as follows: Among them Special treatment is required when hour, Record it as 0.00% and mark it as not detected.

8. The harmonic content algorithm for power lines of a fusion terminal and energy meter based on the phase difference method and the Prony algorithm as described in claim 7, characterized in that, Total harmonic distortion in S44 The calculation method is as follows: The results of total harmonic distortion rate and harmonic content rate are retained to two decimal places. The total harmonic distortion (THD) and harmonic content data are uploaded via a 4G module at regular 1-minute intervals according to the specified format. Real-time upload after exceeding time limit is used for data security.

9. A fusion terminal for implementing the algorithm according to any one of claims 1-8, characterized in that, It includes a main controller, memory, 2500V isolated RS485 interface, ME909s-8214G module and Beidou / GPS dual-mode timing module, with an operating temperature range of -40℃ to 85℃.

10. A smart energy meter, used in conjunction with the fusion terminal as described in claim 9, characterized in that, It adopts an STM32F407 microprocessor, AD7606-16ADC chip, 1000:1 voltage divider network and Rogowski coil current sensor. The energy meter integrates DS18B20 temperature compensation and supports 2560Hz synchronous sampling.

Citation Information

Patent Citations

  • Method for accurately calculating power harmonic wave parameters through adopting time delay Fourier transform frequency measurement method

    CN102539915A

  • Harmonic and inter-harmonic analysis method based on windowing interpolation and Prony algorithm

    CN113032716A

  • Method, device and equipment for calculating harmonic content of power line based on FFT (Fast Fourier Transform)

    CN119246951A

  • Robust high resolution spectrum estimation method for accurate phasor, harmonic and interharmonic measurement in power systems

    US20130173189A1