Power system harmonic detection method, system, equipment, medium and program product

Through the combination of k-nearest neighbor algorithm and conjugate gradient method, a de-rank matrix is constructed to perform compression sensing recovery of harmonic signals, solving the problem of insufficient high-frequency harmonic detection efficiency, and achieving high resolution and high robustness harmonic detection, which is suitable for real-time applications.

CN120490600APending Publication Date: 2025-08-15CHENGDU POWER SUPPLY COMPANY OF STATE GRID SICHUAN ELECTRIC POWER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510878871.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing harmonic detection technology has insufficient detection efficiency in high-frequency harmonic detection, which is difficult to meet the needs of low latency, low computing resources, and high measurement accuracy. Especially in intelligent power distribution systems, traditional methods have spectrum leakage problems, and the existing compression perception algorithms have failed to effectively utilize the internal structural characteristics of the signal.

Method used

The k-nearest neighbor algorithm is used to search for harmonic signal spectrum phasor clustering, and the de-rank matrix and Gaussian noise matrix are constructed. The low-rank data matrix is solved by optimization functions, and iteratively solves iteratively with the conjugate gradient method to realize the compression-conscious recovery of harmonic signals.

Benefits of technology

It improves the resolution of high-frequency harmonic components in dense spectral areas, improves the consistency and robustness of signal reconstruction, and is suitable for real-time or embedded application scenarios, with faster convergence speed and lower computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120490600A_ABST
    Figure CN120490600A_ABST
Patent Text Reader

Abstract

The invention discloses a power system harmonic detection method, system and device, a medium and a product, and relates to power harmonic detection, and the method comprises the steps: obtaining a power signal of a to-be-detected power system; constructing at least one sample patch, performing proximity search on the harmonic signal according to each sample patch to obtain a position set of similar blocks, and determining a data matrix of the blocks according to the position set; constructing a reduced-rank matrix and a Gaussian noise matrix based on the data matrix, and establishing an optimization function for solving the reduced-rank matrix; solving the optimization function to obtain a low-rank data matrix; according to the power signal, the under-sampling Fourier transform function and the low-rank data matrix, constructing an objective function for compressed sensing recovery of the harmonic signal; and carrying out iterative solution on the harmonic signal of the target function and the minimum low-rank data matrix to obtain a harmonic detection result of the to-be-detected power system. According to the invention, the problem of insufficient detection efficiency during harmonic signal detection by the existing compressed sensing technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to power harmonic detection, and more particularly to a power system harmonic detection method, system, equipment, medium and product. Background Art

[0002] With the large-scale integration of new power electronic devices, frequency converters, photovoltaic inverters, and renewable energy grid-connected equipment into intelligent power distribution systems, harmonic pollution has become a prominent problem. High-frequency harmonics (also known as subharmonics and superharmonics) in the 2kHz to 150kHz frequency range are particularly prominent. These frequencies are much higher than the range of concern in traditional harmonic analysis (<2kHz). As a result, they have stronger propagation capabilities and more complex electromagnetic interference characteristics within intelligent power distribution systems.

[0003] These high-frequency harmonics originate from a wide range of sources, including electric vehicle charging stations, LED lighting equipment, variable-frequency air conditioners, wind turbines, and grid-connected photovoltaic inverters. Their high-frequency switching operations generate large amounts of high-frequency electromagnetic waves, creating complex waveform distortions. These harmonics not only disrupt power quality but can also cause relay protection misoperation in intelligent power distribution systems, equipment overheating and damage, communication interruptions, and even generate common-mode voltage and radio frequency interference.

[0004] Current standards, such as IEC 61000-4-7, propose a measurement method for the 2-9 kHz frequency band, using a 200 Hz frequency band aggregation method to cover the entire frequency band. Although this method has wide coverage, it results in a large amount of data and heavy processing pressure, making it difficult to apply in real-time online applications. IEC 61000-4-30 recommends the use of a 32-segment equally spaced sampling method within the 9-150 kHz frequency band. While this method reduces sampling overhead, its frequency domain resolution is limited, making it ineffective in distinguishing emitters close to the frequency point.

[0005] Traditional harmonic detection methods are mainly based on the discrete Fourier transform (DFT) or its improved versions (windowed FFT, interpolated FFT, etc.). These methods are effective for low-frequency, steady-state signals, but have serious spectrum leakage problems for non-integer-periodic, non-stationary signals and high-frequency fluctuating signals, resulting in large errors in harmonic amplitude estimation, especially extremely poor resolution at frequencies that are not integer multiples of 200 Hz.

[0006] Compressed sensing (CS) technology has been introduced in recent years to the field of harmonic detection. By reconstructing sparse signals, it achieves high-resolution estimation at low sampling rates. However, most existing CS algorithms use general sparse reconstruction models and fail to exploit internal structural features of the signal, such as block correlation or similarity in spectral distribution. Furthermore, CS algorithms place high demands on measurement matrix design, reconstruction algorithm stability, and noise tolerance.

[0007] Therefore, in actual engineering environments, especially those requiring low latency, low computing resources, and high measurement accuracy, existing harmonic detection technologies are difficult to meet the comprehensive needs of high-frequency harmonic online detection. Summary of the Invention

[0008] The purpose of the present invention is to provide a method, system, device, medium and product for detecting harmonics in a power system, which solves the problem of insufficient detection efficiency when performing harmonic signal detection using existing compressed sensing technology.

[0009] The above technical objectives of the present invention are achieved through the following technical solutions: A first aspect of the present invention provides a method for detecting harmonics in a power system, the method comprising: Acquire a power signal of the power system to be detected; wherein the power signal includes a product result of an undersampled Fourier transform function and a harmonic signal and a normal noise distribution; Constructing at least one sample patch, performing a neighbor search on the harmonic signal according to each sample patch to obtain a position set of similar blocks, and determining a data matrix of the blocks according to the position set; Construct a reduced rank matrix and a Gaussian noise matrix based on the data matrix, and establish an optimization function for solving the reduced rank matrix; Solve the optimization function to obtain a low-rank data matrix; Based on the power signal, undersampled Fourier transform function and low-rank data matrix, the objective function for compressed sensing recovery of harmonic signals is constructed; The harmonic signal and low-rank data matrix of the objective function are minimized and solved iteratively to obtain the harmonic detection results of the power system to be detected.

[0010] In one implementation, a proximity search is performed on the power signal based on each sample patch to obtain a set of similar block locations, specifically: Preset the threshold for stopping the proximity search; For each sample patch, a neighbor search is performed within a k-neighbor local window in the harmonic signal until a threshold is met, thereby obtaining a set of locations of blocks similar to each sample patch.

[0011] In one implementation, the size of the sample patch can be adjusted according to the sampling rate of the power signal.

[0012] In one implementation, the optimization function is expressed as: ,in, represents the Frobenious norm, represents the variance of the noise, represents the data matrix of the i-th sample patch, Represents the reduced rank data matrix, and rank() represents finding the rank of the matrix.

[0013] In one implementation, the low-rank data matrix is expressed as: ,in, represents the regularization parameter, for The rank substitution function, represents a very small constant value greater than zero, represents the identity matrix, represents a diagonal matrix.

[0014] In one implementation, the objective function is expressed as: ,in, represents the balance weight, represents the undersampled Fourier transform, represents the harmonic signal, Indicates an electric power signal.

[0015] A second aspect of the present invention provides a power system harmonic detection system for executing a power system harmonic detection method as provided in the first aspect of the present invention, characterized in that the system comprises: Acquire a power signal of the power system to be detected; wherein the power signal includes a product result of an undersampled Fourier transform function and a harmonic signal and a normal noise distribution; Constructing at least one sample patch, performing a neighbor search on the harmonic signal according to each sample patch to obtain a position set of similar blocks, and determining a data matrix of the blocks according to the position set; Construct a reduced rank matrix and a Gaussian noise matrix based on the data matrix, and establish an optimization function for solving the reduced rank matrix; Solve the optimization function to obtain a low-rank data matrix; Based on the power signal, undersampled Fourier transform function and low-rank data matrix, the objective function for compressed sensing recovery of harmonic signals is constructed; The harmonic signal and low-rank data matrix of the objective function are minimized and solved iteratively to obtain the harmonic detection results of the power system to be detected.

[0016] A third aspect of the present invention provides an electronic device, comprising a memory and a processor; a memory for storing a computer program, wherein the computer program includes program instructions; The processor is configured to execute the program instructions so as to enable the electronic device to perform the steps of a power system harmonic detection method provided by the first aspect of the present invention.

[0017] A fourth aspect of the present invention provides a computer program product comprising program instructions, which, when executed by an electronic device, enables the electronic device to execute the steps of a power system harmonic detection method provided in the first aspect of the present invention.

[0018] According to a fifth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a computer program. When the computer program is executed by one or more processors, the computer program implements a power system harmonic detection method provided in the first aspect of the present invention.

[0019] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention proposes to use the k-nearest neighbor algorithm to perform cluster search on the spectral phasors of the harmonic signal, identify similar frequency patterns of the harmonic signal, and thus determine the block data matrix. The data matrix is constructed through the similarity between time-frequency blocks, satisfying the structural sparsity and local low-rank characteristics; secondly, when solving the reduced rank matrix constructed by the data matrix, different from the traditional nuclear norm constraint, the present invention introduces logdet as an alternative to the rank constraint, and obtains an estimation accuracy closer to the actual rank function on the basis of maintaining the optimization solvability, which effectively improves the resolution of the harmonic component in the spectral dense area.

[0020] 2. The present invention uses singular value decomposition and weighted reconstruction for each block to achieve sparse optimization; the reconstruction results are aggregated to the full spectrum domain through the position mapping matrix to achieve multi-block consistency recovery, which can improve the consistency and robustness of signal reconstruction and the smoothness of the boundary area.

[0021] 3. When solving the objective function for compressed sensing recovery of harmonic signals, the present invention converts signal reconstruction into a constrained optimization problem and adopts the conjugate gradient method for efficient iteration, thereby achieving faster convergence speed and lower computational complexity, and is suitable for real-time or embedded application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings: Figure 1 A schematic diagram of a flow chart of a method for detecting harmonics in a power system provided by an embodiment of the present invention; Figure 2 A diagram showing the reconstruction effect and running time as parameters change according to an embodiment of the present invention; FIG3 (a) is a comparison diagram of ME under noise interference of different algorithms provided by an embodiment of the present invention; FIG3( b ) is a comparison diagram of TE under noise interference of different algorithms provided by an embodiment of the present invention; Figure 4 The time-frequency distribution and detection result diagram of the dynamic signal (frequency / amplitude time-varying) provided by the embodiment of the present invention; Figure 5 This is a diagram of the error calculation results of each algorithm under different test environments provided by the embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with examples and drawings. The exemplary embodiments of the present invention and their descriptions are only used to explain the present invention and are not intended to limit the present invention.

[0024] It should be noted that the terms "include" or "may include" used in various embodiments of the present application indicate the presence of the claimed function, operation or element, and do not limit the addition of one or more functions, operations or elements. In addition, as used in various embodiments of the present application, the terms "include", "have" and their cognates are only intended to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the presence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.

[0025] It should be understood that terms such as "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0026] Please refer to Figure 1 , Figure 1 A flow chart of a method for detecting harmonics in a power system provided by an embodiment of the present invention is shown as follows: Figure 1 As shown, the method includes: S101 , obtaining a power signal of a power system to be detected; wherein the power signal includes a product result of an under-sampled Fourier transform function and a harmonic signal and a normal noise distribution.

[0027] The mathematical model of the power signal of the power system to be detected can be described as: (1), where represents the undersampled Fourier transform, represents the harmonic signal, Indicates the power signal, n represents the normal noise distribution, nrepresents the harmonic order, and T represents the number of sampling time points.

[0028] S102 , constructing at least one sample patch, performing a neighbor search on the harmonic signal according to each sample patch to obtain a position set of similar blocks, and determining a data matrix of the blocks according to the position set.

[0029] To address the inefficiency of current compressed sensing algorithms for harmonic detection, this embodiment utilizes a regularized sparse reduced-rank matrix to solve a sparse regularization problem, yielding harmonic detection results. Specifically, the proposed regularization model consists of two components: a sample patch grouping for characterizing the non-local redundancy of harmonic signals and a low-rank approximation method for sparsity enforcement.

[0030] For the non-locally redundant sample patch grouping part of the harmonic signal, first, construct at least one sample patch And the patch size is , here . Adjust the size (h and l) of the sample patch when the sampling rate is different.

[0031] For each sample patch, a neighbor search is performed within the k-neighbor local window until the threshold is met and a set of similar block positions is obtained, i.e. (2), where Th represents the threshold at which the neighbor search stops, G i Represents block The location set of each sample patch is obtained after block division. The data matrix ,in , k represents the number of similar sample patches.

[0032] The present invention proposes to use the k-nearest neighbor algorithm to perform cluster search on the spectral phasors of the harmonic signal, identify similar frequency patterns of the harmonic signal, and thus determine the block data matrix. The data matrix is constructed by the similarity between time-frequency blocks and meets the structural sparsity and local low-rank characteristics. S103: constructing a reduced-rank matrix and a Gaussian noise matrix based on the data matrix, and establishing an optimization function for solving the reduced-rank matrix.

[0033] In this embodiment, the low-rank approximation method for sparsity is implemented. Since the image blocks have similar structures, the data matrix It is a reduced rank, and the data matrix can be It is constructed as a reduced rank matrix and a Gaussian noise matrix, that is, ,in, and Denote the reduced rank matrix and Gaussian noise matrix respectively. The reduced rank matrix can be restored by solving the following optimization problem : (3), where represents the Frobenious norm, represents the variance of the noise, represents the data matrix of the i-th sample patch, represents a low-rank data matrix, Represents a reduced rank matrix, and rank() represents finding the rank of the matrix.

[0034] S104, solving the optimization function to obtain a low-rank data matrix.

[0035] Specifically, the process of solving the optimization function (3) proposed in step S103 is as follows: In general, the nuclear norm can be used as a convex proxy for rank to obtain an approximate solution to Equation (3). By using the properties of the nuclear norm and kernel function, the above constrained optimization problem is transformed into a new problem: (4), where is replaced by a smooth but non-convex proxy for the rank. For symmetric positive semidefinite matrices The rank minimization problem can be solved by using the function The rank of is used as a smooth rank to replace the rank of the symmetric positive semidefinite matrix Z. The results show that the replacement function It can approximate the rank better than the nuclear norm.

[0036] In general, a low-rank data matrix is neither square nor positive semidefinite, so the matrix for: (5), where is a diagonal matrix whose diagonal elements are reduced rank matrices The singular values of can be interpreted as a small constant value. Therefore, yes Rank substitution function, then we can get the following rank reduction problem to solve the low rank data matrix ,as follows: (6), represents the regularization parameter, for The rank substitution function, represents a very small constant value greater than zero, represents the identity matrix, represents a diagonal matrix.

[0037] When solving the reduced rank matrix constructed from the data matrix, this embodiment introduces logdet as an alternative to the rank constraint, unlike the traditional nuclear norm constraint. It obtains an estimation accuracy closer to the actual rank function while maintaining the optimization solvability, and effectively improves the resolution of the harmonic component in the spectrally dense area.

[0038] S105 , constructing an objective function for compressed sensing recovery of harmonic signals based on the power signal, the undersampled Fourier transform function, and the low-rank data matrix.

[0039] In this embodiment, based on the non-local low-rank regularization term model proposed in the above embodiment, an objective function for compressed sensing restoration of harmonic signals is proposed, which is expressed as follows: (7), where represents the balance weight, represents the undersampled Fourier transform, represents the harmonic signal, Indicates the power signal, .

[0040] in, Represents a matrix formed by the set of locations of blocks similar to each sample patch The regularization method fully exploits the non-local redundancy of similar blocks and the non-convexity of rank minimization, thus achieving better detection efficiency than previous methods.

[0041] S106, iteratively solving the minimum harmonic signal and low-rank data matrix of the objective function to obtain the harmonic detection result of the power system to be detected.

[0042] In this embodiment, the objective function can be effectively solved by the alternating minimization method, as follows: First, for each Solve the following minimization problem: (8) because , equation (8) can be rewritten as: (9), where ,and express of For simplicity, the singular values Replace with , then the function is a non-convex function, and since it is smooth on the positive definite cone, it can be minimized (locally) using a local minimization method. Let ,but It can be approximated using a first-order Taylor expansion: (10), where yes Therefore, ignoring the constant in equation (10), equation (9) can be solved by iteration: (11), where . Note that due to the singular values are sorted in descending order, so the weight The present invention uses singular value decomposition and weighted reconstruction for each block to achieve sparse optimization. The reconstruction results are aggregated into the full spectrum domain through the position mapping matrix to achieve multi-block consistency recovery, which can improve the consistency and robustness of signal reconstruction and the smoothness of boundary areas.

[0043] In the case of real matrices, the weighted nuclear norm is a convex function only when the weights are decreasing. Therefore, equation (11) is not convex. So we only want to find its local minimum. However, it can still be shown that a minimization equation can be obtained. Equation (11) is obtained by using the weighted singular value threshold (SVT). Based on this theorem, it can be obtained by The reconstructed matrix in iterations: (12), set .

[0044] In the update Afterwards, the entire signal can be reconstructed by solving the following minimization problem: (13), Equation (13) can be calculated by using the conjugate gradient (CG) algorithm. Such a process is iterated until convergence.

[0045] It can be seen that when solving the objective function for compressed sensing recovery of harmonic signals, the present invention converts signal reconstruction into a constrained optimization problem and adopts the conjugate gradient method for efficient iteration, thereby having faster convergence speed and lower computational complexity, and is suitable for real-time or embedded application scenarios.

[0046] In order to test the steady-state performance of the algorithm proposed in the above embodiment, the present invention also constructs a power signal model containing harmonic components as shown in formula (14), that is, (14), among which, f 1 is the fundamental frequency, which is set to 50Hz here. 、 Represent the fundamental wave and each harmonic phase angle respectively. The range takes a certain value. shThe high-frequency harmonics are 195, 197, 199, 201, 203, and 205, respectively. Their frequencies are set to conform to the harmonic distribution pattern, and the sampling frequency is set to 10 kHz. To avoid mutual interference between the harmonics, six sets of single-frequency sinusoidal signals with constant amplitude are used to verify the detection accuracy of each algorithm.

[0047] One of the core contents of the reduced rank compressed sensing algorithm used in this invention is the construction of the reduced rank matrix. The reduced rank matrix is formed by expanding and aggregating all similar points in the sample in columns. The matching method based on the similarity of the selected Euclidean distance is that the smaller the Euclidean distance, the higher the similarity. When using the reduced rank compressed sensing algorithm, are initialized to all zero matrices, and the regularization parameters =2.5. Let the number of data points in the similarity matrix be M , the search radius is w In the process of similar matrix block division, if there are too many similar blocks, there will inevitably be data points in the similar block array that are less similar to the current sample point; on the contrary, if there are too few similar blocks, it will not be enough to construct the similar matrix, which will also affect the rank reduction of the data matrix. Most of the similar data points are distributed in the vicinity of the sample point, so k - The search window of the nearest neighbor clustering algorithm is set to the current sample point as the center. M 、 w Under the change condition, the reconstruction effect and algorithm running time are analyzed, and the results are as follows Figure 2 shown.

[0048] Depend on Figure 2 It can be seen that with the parameter M and w As increases, the error of the aggregated value decreases gradually, but the running time of the algorithm increases continuously. When the search radius is within the range, changing the search radius has little effect on the time change and the reconstruction effect gradually becomes stable. Considering the comprehensive reconstruction performance and operation complexity, the proposed algorithm parameters are set to M =300, search radius w =0.06. MCS-OMP, CS-TFM, M1, and M2 were selected as comparison algorithms. The ME and TE index estimation results of the present invention and the comparison algorithms are shown in Table 1.

[0049] Table 1 Error estimation results of each algorithm

[0050] As can be seen from Table 1, the algorithm ME proposed in this invention max 0.08%, TE maxis 0, indicating that the algorithm of the present invention has a good detection effect on the harmonic components under steady-state conditions, and the phasor estimation has the highest accuracy. The MCS-OMP phasor estimation result is relatively close to the CS-TFM algorithm. The CS-TFM method uses a second-order Taylor series to fit the signal components. However, the Taylor signal model has a large model error, and its accuracy is also limited. Increasing the order of the Taylor model can reduce the model error, but a higher order may make the passband performance of the filter worse. The MCS-OMP algorithm has poor estimation results for high-frequency harmonics that are not integer multiples of 200Hz, with a frequency error of up to 18.5%. This is because the frequency resolution of the MCS-OMP algorithm after interpolation is 200Hz. Although MCS-OMP improves the resolution by an order of magnitude compared to method M2, the solution obtained by directly using the OMP algorithm to reconstruct the signal is extremely unstable, which seriously affects the reconstruction performance.

[0051] Table 1 also shows that method M2 consistently outperforms method M1 in all metrics. Since method M1 has a 200ms analysis window, the time-domain waveform contains the richest information, resulting in a maximum ME error of only 0.1%. M2 suffers the most from spectrum leakage, with an amplitude error of 33.7%, and its TE measurement accuracy is also less than ideal. This is because each 2kHz bandwidth band encompasses ten 200Hz bandwidth bands. Due to resolution limitations, method M2 cannot accurately reflect the emission point at the corresponding frequency and can also cause sidebands at the same center frequency to enter nearby frequency bands. For reduced-rank compressed sensing, CS-TFM, MCS-OMP, and IEC methods M1 and M2, the aggregated value error remains below 3%.

[0052] Taking into account the influence of factors such as interference and uncertainty in the actual measurement process, a white noise signal with a signal-to-noise ratio (SNR) of 20 dB is superimposed on the test signal. The specific signal model is shown in Equation (15): (15), among which, f 1 is 50Hz, 、 Represent the fundamental wave and each harmonic phase angle respectively. The range takes a certain value, sh Indicates harmonic signals with values of 195, 197, 199, 201, 203, and 205. The performance of the reduced-rank compressed sensing, CS-TFM, MCS-OMP, M1, and M2 algorithms is compared. The test results of the indicators ME and TE are shown in (a) and (b) of Figure 3.

[0053] From Figure 3 (a) and (b), we can see that the proposed method has the following advantages when there is noise interference: max 0.26%, TE maxThe calculated results of all indicators of the proposed algorithm are superior to those of the two compressed sensing algorithms, CS-TFM and MCS-OMP. Because the reduced-rank compressed sensing algorithm models the reduced-rank matrix recovery problem as a matrix rank minimization optimization problem under linear constraints as shown in Equation (4), this model utilizes the group sparsity of similar block matrices and the non-convexity of the rank minimization problem, effectively improving the reconstruction performance of the algorithm.

[0054] Figures 3 (a) and (b) also show that the CS-TFM algorithm outperforms the MCS-OMP and M2 algorithms in estimating ME and TE under noise interference. This is because the CS-TFM algorithm, based on limited data points and the TFM model, can estimate the derivatives of high-frequency phasors, thus suppressing noise interference to a certain extent. The DFT-based M2 method, due to its severe spectrum leakage, is most susceptible to noise interference and has difficulty accurately estimating individual high-frequency components. Method M1 uses a 200ms measurement window. This gapless measurement method consumes too much data in the harmonic frequency band. Traditional CS reconstruction algorithms only utilize prior knowledge of the signal's sparsity in an orthogonal basis, but the signal's sparse coefficients still exhibit intercorrelated structures. Reduced-rank compressed sensing algorithms exploit the correlation between sparse coefficients to strengthen the normalization constraints of the reconstruction problem, narrow the solution space, and effectively suppress noise, resulting in the highest measurement accuracy.

[0055] The volatility of harmonic signals is primarily manifested in frequency and amplitude variations. For topologies incorporating active power factor correction circuits, the signal typically exhibits constant amplitude but varying frequency. For rectifiers employing pulse width modulation (PWM) technology, the amplitude varies but the frequency remains constant. For power factor correction (PFC) circuits incorporating boost converters, both the amplitude and frequency vary within the power frequency cycle.

[0056] In order to describe the three non-stationary harmonic signals mentioned above, the chirp function given in formula (16) is used to describe the linear change of the signal within a certain frequency range. Formula (17) represents the harmonic component f sh The amplitude time-varying signal caused by , Equation (18) is the superposition of the above two signals.

[0057] (16) (17) (18), among which, , is a function of frequency varying with time, represents the initial frequency, To verify the detection effect of the proposed algorithm, this case conducted multiple tests at different frequency change intervals and different harmonic frequency points. The signal time-frequency distribution and the calculation results of various error indicators are shown as follows: Figure 4 、 Figure 5 As shown, in which Figure 4 middle, Figure 4 The measurement results of different types of time-varying signals are as follows: (a) A signal with constant amplitude and linear frequency variation, where =30kHz, =0.2; (b) constant frequency, time-varying amplitude signal, where f sh =30kHz; (c) Amplitude and frequency time-varying signal obtained by superimposing signals (a) and (b); (d) Amplitude constant, frequency linearly varying signal, where =30kHz, =0.4; (e), constant frequency, time-varying amplitude signal, where f sh =40kHz; (f), the superposition of signals (d) and (e) gives the amplitude and frequency time-varying signals. Figure 5 middle, Figure 5 Error calculation results of each algorithm under different test environments; (a) FE calculation results of the signal with constant amplitude and linear frequency variation; (b) FE calculation results of the signal with constant frequency and time-varying amplitude; (c) FE calculation results of the signal with simultaneous time-varying amplitude and frequency; (d) ME calculation results of the signal with constant amplitude and linear frequency variation; (e) ME calculation results of the signal with constant frequency and time-varying amplitude; (f) ME calculation results of the signal with simultaneous time-varying amplitude and frequency.

[0058] from Figure 5 The reduced-rank compressed sensing algorithm proposed in this paper achieves a maximum amplitude error of 4.1% in a time-varying environment. This result demonstrates that the algorithm maintains high detection accuracy even when the harmonic frequency range is wide and the linear frequency changes are rapid. The reduced-rank compressed sensing algorithm uses a short-time Fourier window to estimate the signal and incorporates the block sparsity of the harmonic frequency domain distribution to identify the most relevant signal components, significantly improving measurement accuracy.

[0059] from Figure 5It can also be seen that the error calculation results of the CS-TFM and MCS-OMP algorithms are far smaller than those of the IEC standard. CS-TFM is an estimation algorithm based on a multi-frequency model. The error characteristics of parameters such as phase angle and frequency are slightly less affected by frequency variations, but the measurement resolution still fails to meet the requirements. The MCS-OMP algorithm requires the sparsity of the estimated signal to be known, but in practice, it is difficult to obtain this sparsity information in advance, which to some extent limits the application of this algorithm. The performance of the IEC method is significantly affected by amplitude variations, indicating that the IEC-based method has very high uncertainty when analyzing fluctuating signals and cannot accurately reflect the amplitude and frequency variations of the measured signal.

[0060] An embodiment of the present invention further provides an electronic device. The electronic device includes a processor, a memory, a communication interface, and at least one communication bus for connecting the processor, the memory, and the communication interface. The memory includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (PROM), or a compact disc read-only memory (CD-ROM), and is used to store relevant instructions and data.

[0061] The communication interface is used to receive and send data. The processor can be one or more CPUs. When the processor is a CPU, the CPU can be a single-core CPU or a multi-core CPU. The processor in the electronic device is used to read one or more programs stored in the memory and perform the following operations: obtaining the power signal of the power system to be detected; wherein the power signal includes the product result of the undersampled Fourier transform function and the harmonic signal and the normal noise distribution; constructing at least one sample patch, performing a neighbor search on the harmonic signal based on each sample patch, obtaining a similar block position set, and determining the block data matrix based on the position set; constructing a reduced rank matrix and a Gaussian noise matrix based on the data matrix, and establishing an optimization function for solving the reduced rank matrix; solving the optimization function to obtain a low-rank data matrix; constructing an objective function for compressed sensing recovery of the harmonic signal based on the power signal, the undersampled Fourier transform function and the low-rank data matrix; iteratively solving the harmonic signal and the low-rank data matrix of the objective function to obtain the harmonic detection result of the power system to be detected.

[0062] It should be noted that the specific implementation of each operation can be as described above. Figure 1 The corresponding description of the method embodiment shown is that the electronic device can be used to execute a power system harmonic detection method of the above method embodiment of the present application, which will not be described in detail here.

[0063] An embodiment of the present invention further provides a computer-readable storage medium, which is a memory device in a computer device and is used to store programs and data. It is understood that the computer-readable storage medium herein may include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides storage space, which stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for being loaded and executed by a processor. These instructions may be one or more computer programs (including program code). It should be noted that the computer-readable storage medium herein may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. The processor may load and execute the one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the power system harmonic detection method described in the above-mentioned embodiment. Those skilled in the art will appreciate that the embodiments of the present invention may be provided as a method, system, or computer program product. Therefore, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0064] Embodiments of the present invention also provide a computer program product including program instructions. The computer program product may be software or a program product including program instructions that can be executed on a computing device or stored on any usable medium. When the computer program product is executed on at least one electronic device, the at least one electronic device executes a method for detecting power system harmonics.

[0065] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for detecting harmonics in a power system, characterized in that: Methods include: Acquire a power signal of the power system to be detected; wherein the power signal includes a product result of an undersampled Fourier transform function and a harmonic signal and a normal noise distribution; Constructing at least one sample patch, performing a neighbor search on the harmonic signal according to each sample patch to obtain a position set of similar blocks, and determining a data matrix of the blocks according to the position set; Construct a reduced rank matrix and a Gaussian noise matrix based on the data matrix, and establish an optimization function for solving the reduced rank matrix; Solve the optimization function to obtain a low-rank data matrix; Based on the power signal, undersampled Fourier transform function and low-rank data matrix, the objective function for compressed sensing recovery of harmonic signals is constructed; The harmonic signal and low-rank data matrix of the objective function are minimized and solved iteratively to obtain the harmonic detection results of the power system to be detected.

2. A method for detecting harmonics in a power system according to claim 1, characterized in that: Perform a neighbor search on the power signal based on each sample patch to obtain a set of similar block locations, specifically: Preset the threshold for stopping the proximity search; For each sample patch, a neighbor search is performed within a k-neighbor local window in the harmonic signal until a threshold is met, thereby obtaining a location set of blocks similar to each sample patch.

3. A method for detecting harmonics in a power system according to claim 2, characterized in that: The size of the sample patch can be adjusted according to the sampling rate of the power signal.

4. A method for detecting harmonics in a power system according to claim 1, characterized in that: The expression of the optimization function is: ,in, represents the Frobenious norm, represents the variance of the noise, represents the data matrix of the i-th sample patch, represents a low-rank data matrix, Represents a reduced rank matrix, and rank() represents finding the rank of the matrix.

5. A method for detecting harmonics in a power system according to claim 4, characterized in that: The expression of the low-rank data matrix is: ,in, represents the regularization parameter, for The rank substitution function, represents a very small constant value greater than zero, represents the identity matrix, represents a diagonal matrix.

6. A method for detecting harmonics in a power system according to claim 5, characterized in that: The expression of the objective function is: ,in, represents the balance weight, represents the undersampled Fourier transform, represents the harmonic signal, Indicates an electric power signal.

7. A power system harmonic detection system, configured to execute a power system harmonic detection method according to any one of claims 1 to 6, characterized in that: The system includes: Acquire a power signal of the power system to be detected; wherein the power signal includes a product result of an undersampled Fourier transform function and a harmonic signal and a normal noise distribution; Constructing at least one sample patch, performing a neighbor search on the harmonic signal according to each sample patch to obtain a position set of similar blocks, and determining a data matrix of the blocks according to the position set; Construct a reduced rank matrix and a Gaussian noise matrix based on the data matrix, and establish an optimization function for solving the reduced rank matrix; Solve the optimization function to obtain a low-rank data matrix; Based on the power signal, undersampled Fourier transform function and low-rank data matrix, the objective function for compressed sensing recovery of harmonic signals is constructed; The harmonic signal and low-rank data matrix of the objective function are minimized and solved iteratively to obtain the harmonic detection results of the power system to be detected.

8. An electronic device, characterized in that: including memory and processor; a memory for storing a computer program, wherein the computer program includes program instructions; The processor is configured to execute the program instructions so that the electronic device performs the steps of the power system harmonic detection method according to any one of claims 1 to 6.

9. A computer program product comprising program instructions, characterized in that When the program instructions are executed by an electronic device, the electronic device executes the steps of the power system harmonic detection method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a computer program, and when the computer program is executed by one or more processors, the computer program implements the power system harmonic detection method according to any one of claims 1 to 6.