Harmonic detection method based on dung beetle optimization algorithm, system equipment and terminal
By applying a method based on dung-optimization algorithm in the power system, using DFT and dung-optimal algorithms for harmonic detection, the problems of insufficient detection accuracy and window function selection in the existing technology are solved, efficient and accurate harmonic detection is achieved, and the stability of the power system is improved.
Patent Information
- Application Number
- CN202411609993.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art has insufficient harmonic detection accuracy in power systems, difficulties in selecting window functions, impact of harmonics on equipment stability, and filter design complexity.
The method based on the dung beetle optimization algorithm is used to determine whether there is an interharmonic through discrete Fourier transform (DFT), and the dung beetle algorithm is used to update the harmonic amplitude, frequency and phase.
It improves the accuracy and efficiency of harmonic detection, can more accurately identify harmonic and interharmonic components, significantly improving the stability of the power system and the reliability of equipment operation.
Smart Images

Figure CN119538151A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to but is not limited to the field of harmonic detection technology, and in particular relates to a harmonic detection method, system equipment and terminal based on a dung beetle optimization algorithm. Background Art
[0002] The degree of nonlinearity in power systems has been increasing due to the presence of large numbers of inverter-interfaced distributed generation (DGs), nonlinear loads, and power electronic devices. Nonlinearity, whether caused by the supply or the load, can result in harmonics and waveform distortion. In 2019, about 2,000 GW of renewable energy sources (RES) were installed worldwide, of which 62% and 30% were solar PV and wind, respectively. This was the largest annual increase in RES capacity ever, surpassing the global installation of fossil fuel and nuclear power plants. Power systems are shifting from centralized conventional generation to decentralized RES generation. This trend has the potential to provide higher reliability, better power quality, and more controllability of power systems. However, the positive impact of DGs will largely depend on their deployment planning and operation. The presence of DGs may introduce new power quality (PQ) and control issues and challenges to the network.
[0003] RES may significantly increase the harmonic levels in the power grid. Most DGs (solar and wind) use inverters to convert DC voltage to AC voltage synchronized with the grid and control the injection of power into the grid. These inverters, in turn, may introduce a large number of harmonics into the power system due to the use of high-frequency switching power electronic devices, and some harmonics may increase by 83% with the integration of electric vehicles and photovoltaic systems. Studies have shown that the carrying capacity of photovoltaic DGs may be reduced due to the increase in background harmonics on the grid side and the increase in the degree of nonlinearity imposed by loads and DGs. Harmonic emissions from wind turbines are a power quality issue for their installation. In addition to odd harmonics, even harmonics and interharmonics have been observed in the current produced by wind turbine converters, with levels higher than those usually found in other devices. Harmonic level limits recommended by standards may limit the penetration of RES such as wind and solar, and therefore, hinder the goal of achieving a fully renewable energy system.
[0004] Power harmonics are widely present in power grids, and harmonic interference has attracted much attention. Harmonics are usually referred to as integer multiple harmonics of the power frequency fundamental wave. However, non-integer multiple harmonics (also called interharmonics) are also widely present in power systems, such as ferromagnetic resonance caused by core saturation of power transformers and harmonic pollution caused by high-power power electronic devices. The level of such harmonic content will directly affect the stable operation of the receiving equipment, increase the difficulty of designing the filter sampling device, and bring challenges to the stable operation of the system.
[0005] In power systems, fast Fourier transform (FFT) is usually used to detect harmonics. However, due to the fence effect and spectrum leakage, the measurement accuracy is not satisfactory. When solving the spectrum leakage problem, a common method is to use a window function. While being able to meet the characteristics of the window function such as low maximum sidelobe, narrow main lobe and fast sidelobe attenuation, it will face conflicting problems. It is difficult to meet these three characteristics at the same time. When selecting a window function, it is necessary to weigh the width of the main lobe and the quality of the side lobe. On the above basis, the window function has been widely discussed in the research of many experts, and various window functions for harmonic analysis have been proposed, including Hanning window, Blackman-Harris, Blackman, 4-term 5th order Nuttall window, etc. The application of these window functions significantly improves the sidelobe characteristics and improves the performance of the window function.
[0006] The technical problems brought about by the application of existing technologies in the power industry are mainly reflected in the following aspects:
[0007] 1. Insufficient harmonic detection accuracy: In power systems, fast Fourier transform (FFT) is the main harmonic detection method. However, due to the existence of fence effect and spectrum leakage, the detection accuracy is not ideal. Spectrum leakage will cause the harmonic frequency components of the signal to spread to other frequencies, especially in the case of interharmonics and non-integer harmonics, the measurement accuracy is greatly reduced. This problem makes it difficult to effectively analyze harmonic interference in power systems and affects the operation monitoring of the overall power grid.
[0008] 2. Difficulty in selecting window functions: When solving the problem of spectrum leakage, window functions are often used to suppress leakage. However, the design of window functions has conflicting characteristics, such as the width of the main lobe and the decay speed of the side lobes. Ideally, the window function should have the characteristics of narrow main lobe and fast side lobe decay, but it is difficult to take both into account in practical applications, so it is usually necessary to compromise between performance and accuracy. Improper selection of window functions will directly affect the performance of the filter and the stability of the detection system, resulting in the system failing to achieve the expected harmonic suppression effect.
[0009] 3. Impact of harmonics on equipment stability: Harmonics and interharmonics in the power system will directly affect the stable operation of the receiving equipment. Harmonic pollution generated by ferromagnetic resonance and power electronic devices can easily cause equipment overheating, aging and even failure. This not only increases the maintenance cost of the system, but may also cause power supply quality problems. Especially when the system contains a large number of nonlinear loads, the harmonic interference to the equipment will be aggravated, affecting the life of the equipment and bringing additional maintenance and operation costs.
[0010] 4. Complexity of filter design: Due to the complex harmonic components and diverse harmonic types of the power system, higher requirements are placed on the design of the filter sampling device. The traditional FFT detection method is difficult to perform high-precision analysis of complex harmonics and interharmonics, which makes the filter design more challenging. The design needs to take into account both the filtering effect and the sampling accuracy, but in an electric power environment with a large number of harmonic components and a wide frequency distribution, it is difficult to achieve an ideal filtering effect, which limits the performance and scope of application of the filter, and further increases the difficulty of stable operation of the system. Summary of the invention
[0011] In view of the problems existing in the prior art, the present invention provides a harmonic detection method, system equipment and terminal based on the dung beetle optimization algorithm.
[0012] The present invention is implemented in this way: a harmonic detection method based on a dung beetle optimization algorithm, comprising:
[0013] S1, DFT transform;
[0014] S2, determine whether there are interharmonics;
[0015] S3, uses the dung beetle algorithm to update the harmonic amplitude, frequency and phase.
[0016] Furthermore, S1 specifically includes: Discrete Fourier Transform (DFT) Fourier analysis method is the most basic method of signal analysis. Fourier transform is the core of Fourier analysis. It transforms the signal from the time domain to the frequency domain, and then studies the spectrum structure and change law of the signal.
[0017] The definition of discrete Fourier transform comes from Fourier transform:
[0018]
[0019] Where N is the number of points of the time domain discrete signal, n is the number of the time domain discrete signal (the value range is 0 to N-1), m is the number of the frequency domain signal (the value range is 0 to N-1), and the number of points of the frequency domain signal is also N.
[0020] According to Euler's formula:
[0021] e -jω =cos(ω)-jsin(ω) (3)
[0022] The discrete Fourier transform can be written as follows:
[0023]
[0024] The number of harmonics is equal to the number of peak spectral lines, that is, the number of non-zero values of X(m).
[0025] Spectrum leakage refers to the phenomenon in which the spectrum of the signal is convolved with the spectrum of the window function due to signal truncation (i.e., non-periodic truncation) during DFT analysis, thereby deforming the spectrum of the original signal and causing leakage.
[0026] One of the main reasons for spectrum leakage is the sampling frequency f s If it is not an integer multiple of the input frequency, there will be no point in the DFT output corresponding to the input frequency, causing the energy of the input frequency to leak to all output points.
[0027] Furthermore, S2 specifically includes:
[0028] (1) If we assume that the harmonics in the waveform x(t) of formula (1) are all fundamental waves f b Integer multiples of (i.e., no interharmonics exist), and set f s Yes b If it is an integer multiple of , then the real and imaginary parts of each harmonic can be easily calculated by formula (4), thus obtaining the amplitude and phase of harmonic m.
[0029] (2) If there is no interharmonic in x(n), let the maximum harmonic component be f high , then if m in formula (4) is set to be greater than f high If the harmonic frequency is , the value of |X(m)| is equal to 0. If interharmonics exist, the calculated |X(m)|≠0. Therefore, this characteristic can be used to determine whether there are interharmonics in the signal to be detected.
[0030] Further, S3 specifically includes: In order to obtain high-precision harmonic amplitude, frequency and phase, the present invention adopts the dung beetle algorithm to detect each harmonic and interharmonic. The dung beetle algorithm grasps the five habits of dung beetles, namely, ball rolling, dancing, foraging, stealing and breeding. Different subpopulations perform different search methods, so as to efficiently explore and develop space with a fast convergence speed and obtain a relatively accurate solution. According to the natural habits of dung beetles and the influence of the external environment, the dung beetle population in nature is mainly divided into four parts, namely, ball rolling dung beetles, brooding balls, small dung beetles and thief dung beetles.
[0031] Furthermore, the update methods and rules of the four types of populations in each iteration are as follows:
[0032] (1) Ball-rolling dung beetle
[0033] In general, the rolling ball dung beetle is used to navigating the direction of the sun to ensure that it moves in a straight path. In addition, factors such as light intensity and wind will also have a comprehensive impact on the route of the rolling ball dung beetle. The general update method is:
[0034] x i (t+1)=xi (t)+α×k×x i (t-1)+b×Δx (5)
[0035] Δx=|x i (t)-X W | (6)
[0036] Among them, t represents the number of iterations, α is a natural coefficient, which takes -1 or 1 to indicate whether it deviates from the original direction, k is the deflection coefficient, b is a constant, and x i (t) represents the corresponding information of the i-th dung beetle in the t-th iteration. Δx is an important variable for simulating light intensity changes, X W Indicates the global worst position. The rolling dung beetle can initially search for a safe foraging position.
[0037] When a dung beetle encounters an obstacle while moving forward, it adjusts its direction by dancing. The corresponding position update formula is as follows:
[0038] x i (t+1)=x i (t)+tan(θ)×|x i (t)-x i (t-1)| (6)
[0039] Where θ is the deflection angle. According to the above formula, when θ is 0, and π, the position of the dung beetle remains unchanged.
[0040] (2) Brooding Ball
[0041] The brood ball mainly uses a boundary selection strategy to simulate the oviposition area of female dung beetles. The area is defined as:
[0042] Lb * =max(X * ×(1-R),Lb) (7)
[0043] Ub * =min(X * ×(1+R),Ub) (8)
[0044]
[0045] Among them, X * represents the current local optimal position, Lb * With Ub * Respectively represent the upper and lower limits of the spawning area, while Lb and Ub represent the upper and lower limits of the corresponding optimization problem, T max represents the maximum number of iterations. In addition, in order to make the optimization process more comprehensive, the position of the brooding ball is dynamically changed during each iteration:
[0046] B i (t+1)=X * +b1×(B i (t)-Lb * )+b2×(B i (t)-Ub * ) (10)
[0047] Among them, B i (t) is the position information of the ith brooding ball at the tth iteration, b1 and b2 represent two independent random vectors. The brooding ball will be produced in a known safe area.
[0048] (3) Small dung beetle
[0049] Certain constraints and update conditions are needed to guide young dung beetles to find food and simulate their foraging behavior. The optimal foraging area is defined as:
[0050] Lb b =max(X b ×(1-R),L b ) (11)
[0051] Ub b =min(X b ×(1+R),Ub) (12)
[0052] X b represents the current local optimal position, and Lb b With Ub b They represent the lower and upper limits of the optimal foraging area respectively. The position update of the dung beetle follows:
[0053] x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b ) (13)
[0054] In the above formula, x i (t) is the position information of the i-th dung beetle at the t-th iteration, C1 is a random number following the normal distribution, and C2 represents a random vector between 0 and 1. In general, dung beetles will choose to forage in the best foraging area.
[0055] (4) Thief Dung Beetle
[0056] The role of the thief dung beetle is reflected in its ability to find food more appropriately based on the positions of other dung beetles and the aforementioned optimal foraging area, i.e. the objective function. The position update mode of the thief dung beetle is as follows:
[0057] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |) (14)
[0058] In the formula, x i (t) represents the position information of the i-th thief dung beetle at the t-th iteration, g represents a random vector following the normal distribution, and S is a constant.
[0059] (5) Objective function
[0060] According to the DFT results, the amplitude and phase of the M spectra calculated are substituted into formula (15):
[0061]
[0062] Where n=1,2,…,N,Δt=1 / f s , A k ,f k , are the amplitude, frequency and phase of the kth spectrum respectively.
[0063] At time index n, the difference e between the desired signal (target signal) and the network output signal can be expressed as:
[0064]
[0065] The objective function can be expressed as:
[0066]
[0067]
[0068] Another object of the present invention is to provide a harmonic detection system based on a dung beetle optimization algorithm for implementing the harmonic detection method based on a dung beetle optimization algorithm, comprising:
[0069] DFT transformation module, used for performing DFT transformation;
[0070] An interharmonics judgment module is used to judge whether there are interharmonics;
[0071] The dung beetle algorithm module is used to update the harmonic amplitude, frequency and phase using the dung beetle algorithm.
[0072] Another object of the present invention is to provide a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the harmonic detection method based on the dung beetle optimization algorithm.
[0073] Another object of the present invention is to provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the harmonic detection method based on the dung beetle optimization algorithm.
[0074] Another object of the present invention is to provide an information data processing terminal, which includes the harmonic detection system based on the dung beetle optimization algorithm.
[0075] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0076] First, the waveform reconstructed by the algorithm of the present invention is basically consistent with the original waveform, and the algorithm has the characteristics of high precision and fast convergence.
[0077] The present invention effectively solves the accuracy and efficiency problems of the prior art in harmonic detection by introducing a harmonic detection system based on the dung beetle optimization algorithm. In traditional harmonic detection methods, fixed-frequency FFT or filtering algorithms are often relied on. Such methods have errors when processing interharmonics with non-integer multiple frequencies and require higher computing resources. Therefore, it is difficult for traditional methods to accurately and quickly detect harmonics and interharmonics in power systems with high real-time requirements.
[0078] The present invention adopts the dung beetle optimization algorithm, which simulates the resource search behavior of dung beetles to intelligently optimize and adjust the harmonic amplitude, frequency and phase, so that harmonic and interharmonic components can be identified more accurately. This optimization algorithm has strong global search capabilities and fast convergence characteristics, and can accurately update and detect harmonic information in complex signal environments, significantly improving the accuracy of harmonic detection. In addition, the dung beetle algorithm is highly adaptable and does not rely on the integer multiple characteristics of harmonic frequencies, so it has obvious advantages in processing complex power signals.
[0079] Through the combination of the DFT transformation module and the interharmonic judgment module, the present invention can effectively detect and distinguish interharmonics, avoiding the failure of traditional harmonic detection methods under non-integer frequency signals. This improvement solves the problem of the difficulty in accurately identifying the intermediate harmonic interference in the power system, ensures the reliability of the detection results, and provides better support for the stable operation of the power system.
[0080] The technical solution of the present invention integrates computer equipment and readable storage media, so that the harmonic detection method can be efficiently implemented on the computing device, which is suitable for industrial application. Users only need to load the storage medium to easily call the harmonic detection program to achieve rapid deployment and application. At the same time, the application of the information data processing terminal also makes the present invention adaptable to a variety of scenarios, providing a real-time and accurate harmonic detection and monitoring solution for the power system.
[0081] The technical solution of the present invention has achieved significant technical progress in the accuracy, real-time and applicability of harmonic detection, solved the detection defects of the prior art in complex environments, and provided an efficient and scalable solution for industrial applications in the field of harmonic detection, with good application prospects and market potential.
[0082] After the technical solution of the present invention is converted, it can be used in the equipment of the power system to accurately and quickly detect the harmonic content in the sampled signal. The equipment performs subsequent processing according to the harmonic content obtained by analysis, such as accurately calculating the harmonic power in the electric energy meter and more accurately calculating the command value of the converter in the active power filter APF, so as to achieve precise control of the harmonics and achieve the purpose of power quality management. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 is a flow chart of a harmonic detection method based on a dung beetle optimization algorithm provided in an embodiment of the present invention;
[0084] Figure 2 is a DFT spectrum diagram provided by an embodiment of the present invention;
[0085] Figure 3 is a schematic diagram comparing the original waveform and the reconstructed waveform provided by an embodiment of the present invention;
[0086] Figure 4 It is a structural diagram of a harmonic detection system based on a dung beetle optimization algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0087] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0088] Example 1: Harmonic and interharmonic detection in power system
[0089] In the power system, the presence of harmonics and interharmonics may cause problems such as equipment loss, heating, noise and reduced power quality. Therefore, accurate detection of the frequency, amplitude and phase of harmonics is crucial to the stability and safety of the system. Based on the harmonic detection system of the present invention, by performing discrete Fourier transform (DFT) on the sampled data, the conversion of the signal from the time domain to the frequency domain is realized, and the harmonic parameters are optimized in combination with the dung beetle optimization algorithm, the accuracy and efficiency of detection are significantly improved. In this embodiment, the system can detect the spectrum information of harmonics in a complex power environment, thereby effectively identifying and distinguishing the fundamental wave, harmonics and interharmonics, and ensuring the normal operation of the power system.
[0090] Example 2: Harmonic Analysis and Optimization of Power Electronic Equipment
[0091] During the operation of power electronic equipment (such as inverters, frequency converters, etc.), various harmonics and interharmonics are usually generated, which will affect the efficiency and life of the equipment. The harmonic detection system of the present invention is applied to power electronic equipment, and can detect the harmonic characteristics generated during the operation of the equipment through real-time analysis of the operating data, especially the interharmonic components of non-integer multiple frequencies. Through the dung beetle optimization algorithm, the system can automatically update the amplitude, frequency and phase parameters of the harmonics, so as to accurately grasp the harmonic situation of the equipment. During the optimization process, the system can help adjust the equipment operating parameters, reduce unnecessary harmonic components, improve the equipment operation efficiency, and extend the service life of the equipment.
[0092] These two embodiments demonstrate the application of the present invention in the field of power systems and power electronic equipment, which not only improves the accuracy of harmonic detection, but also reduces the maintenance cost and failure risk of equipment, providing reliable technical support for power quality control.
[0093] Assume that the continuous time domain signal containing M harmonics can be represented by the Fourier series, that is:
[0094]
[0095] in:
[0096] · x(t) is the time domain signal.
[0097] ·A k is the amplitude of the kth harmonic.
[0098] ·f b is the frequency of the fundamental wave.
[0099] α k is the kth harmonic frequency relative to the fundamental frequency f b multiples of.
[0100] is the phase of the kth harmonic.
[0101] M is the number of harmonics.
[0102] t is the time.
[0103] The goal of harmonic measurement in power systems is to detect the frequency, amplitude and phase of harmonics by analyzing the sampled data of network voltage in a finite time. In order to obtain high-precision harmonic parameters, the sampled data is first analyzed by discrete Fourier transform (DFT) and then processed by the dung beetle optimization algorithm.
[0104] A.DFT Transform
[0105] Discrete Fourier Transform (DFT) Fourier analysis method is the most basic method of signal analysis. Fourier transform is the core of Fourier analysis. It transforms the signal from time domain to frequency domain, and then studies the signal's spectrum structure and change law.
[0106] The definition of discrete Fourier transform comes from Fourier transform:
[0107]
[0108] Where N is the number of points of the time domain discrete signal, n is the number of the time domain discrete signal (the value range is 0 to N-1), m is the number of the frequency domain signal (the value range is 0 to N-1), and the number of points of the frequency domain signal is also N.
[0109] According to Euler's formula:
[0110] e -jω =cos(ω)-jsin(ω) (3)
[0111] The discrete Fourier transform can be written as follows:
[0112]
[0113] The number of harmonics is equal to the number of peak spectral lines, that is, the number of non-zero values of X(m).
[0114] Spectrum leakage refers to the phenomenon in which the spectrum of the signal is convolved with the spectrum of the window function due to signal truncation (i.e., non-periodic truncation) during DFT analysis, thereby deforming the spectrum of the original signal and causing leakage.
[0115] One of the main reasons for spectrum leakage is the sampling frequency f s If it is not an integer multiple of the input frequency, there will be no point in the DFT output corresponding to the input frequency, causing the energy of the input frequency to leak to all output points.
[0116] B. Determine whether there are interharmonics
[0117] (1) If we assume that the harmonics in the waveform x(t) of formula (1) are all fundamental waves f b Integer multiples of (i.e., no interharmonics exist), and set f s Yes b If it is an integer multiple of , then the real and imaginary parts of each harmonic can be easily calculated by formula (4), thus obtaining the amplitude and phase of harmonic m.
[0118] (2) If there is no interharmonic in x(n), let the maximum harmonic component be f high , then if m in formula (4) is set to be greater than f high The harmonic frequency of |X(m)| is equal to 0. If interharmonics exist, the calculated |X(m)|≠0. Therefore, this characteristic can be used to determine whether there are interharmonics in the signal to be detected.
[0119] C. Use the dung beetle algorithm to update harmonic amplitude, frequency and phase
[0120] In order to obtain high-precision harmonic amplitude, frequency and phase, the present invention adopts the dung beetle algorithm to detect each harmonic and interharmonic. The dung beetle algorithm grasps the five habits of dung beetles, namely, ball rolling, dancing, foraging, stealing and reproduction. Its different subpopulations perform different search methods, so as to efficiently explore and develop the space with a fast convergence speed and obtain a relatively accurate solution. According to the natural habits of dung beetles and the influence of the external environment, the dung beetle population in nature is mainly divided into four parts, namely, ball rolling dung beetles, brooding balls, small dung beetles and thief dung beetles. The update method and rules of these four populations in each iteration process are as follows:
[0121] (1) Ball-rolling dung beetle
[0122] In general, the rolling ball dung beetle is used to navigating the direction of the sun to ensure that it moves in a straight path. In addition, factors such as light intensity and wind will also have a comprehensive impact on the route of the rolling ball dung beetle. The general update method is:
[0123] x i (t+1)=x i (t)+α×k×x i (t-1)+b×Δx (5)
[0124] Δx=|x i (t)-X W | (6)
[0125] Among them, t represents the number of iterations, α is a natural coefficient, which takes -1 or 1 to indicate whether it deviates from the original direction, k is the deflection coefficient, b is a constant, and x i(t) represents the corresponding information of the i-th dung beetle in the t-th iteration. Δx is an important variable for simulating light intensity changes, X W Indicates the global worst position. The rolling dung beetle can initially search for a safe foraging position.
[0126] When a dung beetle encounters an obstacle while moving forward, it adjusts its direction by dancing. The corresponding position update formula is as follows:
[0127] x i (t+1)=x i (t)+tan(θ)×|x i (t)-x i (t-1)| (6)
[0128] Where θ is the deflection angle. According to the above formula, when θ is 0, and π, the position of the dung beetle remains unchanged.
[0129] (2) Brooding Ball
[0130] The brood ball mainly uses a boundary selection strategy to simulate the oviposition area of female dung beetles. The area is defined as:
[0131] Lb * =max(X * ×(1-R),Lb) (7)
[0132] Ub * =min(X * ×(1+R),Ub) (8)
[0133]
[0134] Among them, X * represents the current local optimal position, Lb * With Ub * Respectively represent the upper and lower limits of the spawning area, while Lb and Ub represent the upper and lower limits of the corresponding optimization problem, T max represents the maximum number of iterations. In addition, in order to make the optimization process more comprehensive, the position of the brooding ball is dynamically changed during each iteration:
[0135] B i (t+1)=X * +b1×(B i (t)-Lb * )+b2×(B i (t)-Ub * ) (10)
[0136] Among them, B i(t) is the position information of the ith brooding ball at the tth iteration, b1 and b2 represent two independent random vectors. The brooding ball will be produced in a known safe area.
[0137] (3) Small dung beetle
[0138] Certain constraints and update conditions are needed to guide young dung beetles to find food and simulate their foraging behavior. The optimal foraging area is defined as:
[0139] Lb b =max(X b ×(1-R),Lb) (11)
[0140] Ub b =min(X b ×(1+R),Ub) (12)
[0141] X b represents the current local optimal position, and Lb b With Ub b They represent the lower and upper limits of the optimal foraging area respectively. The position update of the dung beetle follows:
[0142] x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b ) (13)
[0143] In the above formula, x i (t) is the position information of the i-th dung beetle at the t-th iteration, C1 is a random number following the normal distribution, and C2 represents a random vector between 0 and 1. In general, dung beetles will choose to forage in the best foraging area.
[0144] (4) Thief Dung Beetle
[0145] The role of the thief dung beetle is reflected in its ability to find food more appropriately based on the positions of other dung beetles and the aforementioned optimal foraging area, i.e. the objective function. The position update mode of the thief dung beetle is as follows:
[0146] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |) (14)
[0147] In the formula, x i(t) represents the position information of the i-th thief dung beetle at the t-th iteration, g represents a random vector following the normal distribution, and S is a constant.
[0148] (5) Objective function
[0149] According to the DFT results, the amplitude and phase of the M spectra calculated are substituted into formula (15):
[0150]
[0151] Where n=1,2,…,N,Δt=1 / f s , A k ,f k , are the amplitude, frequency and phase of the kth spectrum respectively.
[0152] At time index n, the difference e between the desired signal (target signal) and the network output signal can be expressed as:
[0153]
[0154] The objective function can be expressed as:
[0155]
[0156] The algorithm flow of the present invention is as follows Figure 1 shown.
[0157] Assume the signal expression is:
[0158]
[0159] At this time, the fundamental frequency is f b =50Hz. Sampling frequency f s =20000Hz, the number of spectrum analysis points is 2N-1=800, the frequency resolution
[0160] Table 1 DFT spectrum
[0161] frequency Amplitude Phase 50.0 99.9419878647931 1.048013921 250.0 19.86208103 0.787691812 350.0 9.753782519 0.520551415 450.0 1.780286066 3.954672343 475.0 2.635253228 0.854103102 650.0 5.058870549 0.023840318
[0162] like Figure 2 As shown, 6 peak spectral lines are obtained, and the corresponding frequency, amplitude and phase harmonics are shown in Table 1. Since the frequency resolution is 25 Hz, it can be seen that when interharmonics exist, their frequencies are not integer multiples of the frequency resolution. After DTF transformation, spectrum leakage occurs, and the energy of the 9.3th harmonic leaks to the spectrum of the 9th and 9.5th harmonics.
[0163]
[0164] Let m=26*50Hz in the above formula, which is twice the maximum harmonic frequency. Substituting it into the formula, we get |X(m)|≠0, so we can judge that interharmonics exist.
[0165] The model is established, and the problem is iteratively optimized and solved by the above-mentioned single-target dung beetle algorithm. (Parameter selection: maximum number of iterations MaxIt = 500; population size PopSize = 30; rolling dung beetle deflection coefficient k = 0.1, b = 0.3; thief dung beetle S = 0.5). Then, the parameters of the dung beetle algorithm are set according to the results of DFT, and N = 800 sampled data are selected as the target signal sequence x(n) of the dung beetle algorithm. The results after iterative calculation are shown in Table 2.
[0166] Table 2 Algorithm spectrum
[0167]
[0168]
[0169] Figure 3 The comparison between the waveform reconstructed based on the calculation results and the original waveform is shown. Figure 3 It can be seen that the waveform reconstructed based on the algorithm of the present invention is basically consistent with the original waveform, and the algorithm has the characteristics of high precision and fast convergence.
[0170] Application Example 1: Harmonic Detection and Analysis in Industrial Power Grids
[0171] In an industrial power grid, in order to monitor the operating status of equipment, it is necessary to accurately detect harmonic components. The fundamental frequency of the power grid is 50Hz, and the main harmonic components are concentrated on integer multiples of 250Hz, 350Hz, 450Hz, etc., but suspected interharmonic interference is detected. The sampling data is analyzed using the above-mentioned method of combining DFT and dung beetle algorithm. The sampling frequency is set to 20kHz, and the number of sampling points N=800. First, the signal is spectrally analyzed by DFT to obtain preliminary harmonic frequency, amplitude and phase information. Then the dung beetle algorithm is used to optimize the detection, and the parameters of each harmonic are accurately adjusted based on the multiple strategies of the four types of dung beetles.
[0172] The analysis results show that there is indeed an interharmonic component with a frequency of 465.8Hz in the power grid signal. After optimization by the dung beetle algorithm, the amplitude is 3.498 and the phase is 0.084. Further detection verifies the existence and characteristic parameters of this interharmonic, effectively solves the DFT spectrum leakage problem, and improves the detection accuracy. This method helps industrial users quickly and accurately identify the source of harmonics when equipment is abnormal, prevents equipment damage, and significantly improves the safety and stability of power grid operation.
[0173] Application Example 2: Harmonic Optimization in Power Electronics
[0174] In power electronic devices, especially in high-power inverter and rectifier applications, due to nonlinear load characteristics, the equipment is prone to introduce harmonic pollution, causing unstable operation of other equipment. The frequency of a certain inverter system fluctuates between 50Hz and 700Hz during operation. The analysis sampling frequency is set to 20kHz and the number of points N=800. After the collected signal is transformed by DFT, it is found that the main harmonics appear at frequencies such as 50Hz, 250Hz, and 350Hz. It is also detected that the interharmonics have spectral leakage near the frequency of 475Hz.
[0175] The dung beetle algorithm was used for further optimization, with the maximum number of iterations set to 500 and the population size set to 30. The initial parameters of the dung beetle algorithm were set according to the DFT results. After multiple iterations, the specific parameters of the harmonic components of the system were finally obtained, among which the amplitude of the interharmonic 475Hz was 2.635 and the phase was 0.854. This result accurately identified the interharmonics that affect the stability of the inverter and provided an accurate data basis for equipment design and filter adjustment. After optimization, the filter effectively reduced interharmonic interference, improved the reliability of equipment operation, and achieved a high harmonic control effect.
[0176] like Figure 4 As shown, the harmonic detection system based on the dung beetle optimization algorithm provided by the embodiment of the present invention includes:
[0177] DFT transformation module, used for performing DFT transformation;
[0178] An interharmonics judgment module is used to judge whether there are interharmonics;
[0179] The dung beetle algorithm module is used to update the harmonic amplitude, frequency and phase using the dung beetle algorithm.
[0180] An application embodiment of the present invention provides a computer device, which includes a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the processor executes the steps of a harmonic detection method based on a dung beetle optimization algorithm.
[0181] The application embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of a harmonic detection method based on a dung beetle optimization algorithm.
[0182] An application embodiment of the present invention provides an information data processing terminal, which includes a harmonic detection system based on a dung beetle optimization algorithm.
[0183] The harmonic detection system based on the dung beetle optimization algorithm in the embodiment of the present invention first performs discrete Fourier transform (DFT) on the input signal through the DFT transformation module, converts the time domain signal into a frequency domain signal, and thus extracts preliminary information of each harmonic component. This step helps to analyze the frequency spectrum of the input signal and provide a data basis for subsequent interharmonic detection.
[0184] Next, the interharmonic judgment module analyzes the DFT-transformed signal to identify whether there are interharmonic components. Interharmonics are harmonic components whose frequencies are not equal to integer multiples of the fundamental wave. They usually interfere with the power system, so detecting and distinguishing interharmonics is crucial for harmonic analysis. This module sets judgment criteria to confirm whether the signal contains interharmonics, thereby accurately identifying frequency anomalies in the system.
[0185] After the interharmonic judgment is completed, the dung beetle algorithm module is enabled. The dung beetle optimization algorithm is an intelligent algorithm based on the behavior of dung beetles in nature. It is used in the present invention to update and optimize the amplitude, frequency and phase of harmonics. The algorithm simulates the behavior pattern of dung beetles in finding and updating resources, making harmonic detection more accurate and reducing errors in the calculation process. The dung beetle algorithm can quickly converge to the optimal solution, thereby achieving accurate estimation of harmonic information.
[0186] The harmonic detection method based on the dung beetle optimization algorithm can be integrated into computer equipment. By combining the memory and the processor, the computer program can automatically complete the above harmonic detection process when it is executed on the processor. This implementation method ensures the stability and real-time performance of the system and is suitable for large-scale data processing and real-time monitoring of complex power systems.
[0187] In addition, the present invention also provides a computer-readable storage medium that can store the computer program for a long time. The storage medium is not only suitable for local storage, but also for remote loading and updating of the program through a network, so that users can flexibly apply the harmonic detection method of the present invention. This storage method improves the scalability and operability of the system.
[0188] Finally, the information data processing terminal in the embodiment of the present invention is specially designed for harmonic detection based on the dung beetle optimization algorithm. The terminal has efficient processing capabilities and can quickly complete complex harmonic analysis. The terminal can automatically perform the entire process of harmonic detection, adapt to different power monitoring environments, and provide users with a stable and reliable harmonic detection solution.
[0189] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0190] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A harmonic detection method based on dung beetle optimization algorithm, characterized in that: include: S1.DFT transformation: Perform discrete Fourier transform (DFT) on the input continuous time domain signal to convert the time domain signal into a frequency domain signal to extract the initial frequency, amplitude and phase information of each harmonic component; S2. Interharmonic determination: Based on the frequency domain signal after DFT transformation, the detection method includes detecting whether there are non-integer frequency components in the frequency domain signal to determine the presence of interharmonics; S3. Dung beetle algorithm optimization: The frequency, amplitude and phase parameters of each harmonic and interharmonic are iteratively updated by using the dung beetle optimization algorithm, where the dung beetle optimization algorithm includes simulating the rolling, dancing, foraging and stealing behaviors of dung beetles, performing global search and local optimization to improve the accuracy of harmonic parameter detection; S4. Harmonic parameter output: Output the updated frequency, amplitude and phase of each harmonic and interharmonic as the final detection result of signal analysis.
2. The harmonic detection method based on the dung beetle optimization algorithm according to claim 1, characterized in that: S1 specifically includes: Discrete Fourier Transform Fourier analysis method is the most basic method of signal analysis. Fourier transform is the core of Fourier analysis. It transforms the signal from the time domain to the frequency domain, and then studies the spectrum structure and change law of the signal; The definition of discrete Fourier transform comes from Fourier transform: Where N is the number of points of the time domain discrete signal, n is the number of the time domain discrete signal (the value range is 0 to N-1), m is the number of the frequency domain signal (the value range is 0 to N-1), and the number of points of the frequency domain signal is also N; According to Euler's formula: e -jω =cos(ω)-jsin(ω) (3) The discrete Fourier transform can be written as follows: The number of harmonics is equal to the number of peak spectral lines, that is, the number of non-zero values of X(m); Spectrum leakage refers to the phenomenon that when performing DFT analysis, the spectrum of the signal is convolved with the spectrum of the window function due to signal truncation, which causes the spectrum of the original signal to be deformed and leak. One of the main reasons for spectrum leakage is the sampling frequency f s If it is not an integer multiple of the input frequency, there will be no point in the DFT output corresponding to the input frequency, causing the energy of the input frequency to leak to all output points.
3. The harmonic detection method based on the dung beetle optimization algorithm according to claim 1, characterized in that: S2 specifically includes: (1) If we assume that the harmonics in the waveform x(t) of formula (1) are all fundamental waves f b Integer multiples of (i.e., no interharmonics exist), and set f s Yes b If it is an integer multiple of , then the real and imaginary parts of each harmonic can be easily calculated by formula (4), thus obtaining the amplitude and phase of harmonic m; (2) If there is no interharmonic in x(n), let the maximum harmonic component be f high , then if m in formula (4) is set to be greater than f high The harmonic frequency of |X(m)| is equal to 0. If interharmonics exist, the calculated |X(m)|≠0. Therefore, this characteristic can be used to determine whether there are interharmonics in the signal to be detected.
4. The harmonic detection method based on the dung beetle optimization algorithm according to claim 1, characterized in that: S3 specifically includes: in order to obtain high-precision harmonic amplitude, frequency and phase, the present invention adopts the dung beetle algorithm to detect each harmonic and interharmonic; the dung beetle algorithm grasps the five habits of dung beetles, namely, ball rolling, dancing, foraging, stealing and reproduction, and its different sub-populations execute different search methods, so as to efficiently explore and develop the space with a fast convergence speed and obtain a relatively accurate solution; according to the natural habits of dung beetles and the influence of the external environment, the dung beetle population in nature is mainly divided into four parts, namely, ball rolling dung beetles, brooding balls, small dung beetles and thief dung beetles.
5. The harmonic detection method based on the dung beetle optimization algorithm according to claim 1, characterized in that: The update methods and rules of the four types of populations in each iteration are as follows: (1) Ball-rolling dung beetle In general, the rolling ball dung beetle is accustomed to use the direction of the sun as a navigation to ensure that it moves in a straight path; in addition, factors such as light intensity and wind will also have a combined impact on the moving route of the rolling ball dung beetle; The general update method is: x i (t+1)=x i (t)+α×k×x i (t-1)+b×Δx (5) Δx=|x i (t)-X W | (6) Among them, t represents the number of iterations, α is a natural coefficient, which takes -1 or 1 to indicate whether it deviates from the original direction, k is the deflection coefficient, b is a constant, and x i (t) represents the corresponding information of the i-th dung beetle in the t-th iteration; Δx is an important variable for simulating light intensity changes, X W Indicates the global worst position; the rolling dung beetle can initially find a safe foraging position; When a dung beetle encounters an obstacle while moving forward, it adjusts its direction by dancing. The corresponding position update formula is as follows: x i (t+1)=x i (t)+tan(θ)×|x i (t)-x i (t-1)| (6) Among them, θ is the deflection angle; according to the above formula, it can be seen that when θ is 0, and π, the position of the dung beetle remains unchanged; (2) Brooding Ball The brood ball mainly uses a boundary selection strategy to simulate the oviposition area of female dung beetles. The area is defined as: Lb * =max(X * ×(1-R),Lb) (7) Ub * =min(X * ×(1+R), Ub) (8) Among them, X * represents the current local optimal position, Lb * With Ub * Respectively represent the upper and lower limits of the spawning area, while Lb and Ub represent the upper and lower limits of the corresponding optimization problem, T max represents the maximum number of iterations; in addition, in order to make the optimization process more comprehensive, the position of the brooding ball is dynamically changed during each iteration: B i (t+1)=X * +b1×(B i (t)-Lb * )+b2×(B i (t)-Ub * ) (10) Among them, B i (t) is the position information of the i-th brooding ball at the t-th iteration, b1 and b2 represent two independent random vectors respectively; the brooding ball will be produced in a known safe area; (3) Small dung beetle Certain constraints and update conditions are needed to guide young dung beetles to find food and simulate their foraging behavior. The optimal foraging area is defined as: Lb b =max(X b ×(1-R),Lb) (11) Ub b =min(X b ×(1+R), Ub) (12) X b represents the current local optimal position, and Lb b With Ub b They represent the lower and upper limits of the optimal foraging area respectively; the position update of the dung beetle follows: x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b ) (13) In the above formula, x i (t) is the position information of the i-th dung beetle at the t-th iteration, C1 is a random number following the normal distribution, and C2 represents a random vector between 0 and 1. In general, dung beetles will choose to forage in the best foraging area. (4) Thief Dung Beetle The role of the thief dung beetle is reflected in its ability to find food more appropriately based on the positions of other dung beetles and the aforementioned optimal foraging area, i.e., the objective function; the position update mode of the thief dung beetle is as follows: x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |) (14) In the formula, x i (t) represents the position information of the i-th thief dung beetle at the t-th iteration, g represents a random vector following the normal distribution, and S is a constant; (5) Objective function According to the DFT results, the amplitude and phase of the M spectra calculated are substituted into formula (15): Where n = 1, 2, ..., N, Δt = 1 / f s , A k , f k , are the amplitude, frequency and phase of the kth spectrum respectively. At time index n, the difference e between the desired signal and the network output signal can be expressed as: The objective function can be expressed as:
6. A harmonic detection system based on a dung beetle optimization algorithm for implementing the harmonic detection method based on a dung beetle optimization algorithm as claimed in any one of claims 1 to 5, characterized in that: include: DFT transformation module, used for performing DFT transformation; An interharmonics judgment module is used to judge whether there are interharmonics; The dung beetle algorithm module is used to update the harmonic amplitude, frequency and phase using the dung beetle algorithm.
7. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the harmonic detection method based on the dung beetle optimization algorithm as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the harmonic detection method based on the dung beetle optimization algorithm as claimed in any one of claims 1 to 5.
9. An information data processing terminal, comprising the harmonic detection system based on the dung beetle optimization algorithm according to claim 6.