Direct-current electric energy metering method based on improved wavelet threshold algorithm
By improving the wavelet threshold algorithm and the complex Simpson integral algorithm, the problem of inaccurate power calculation caused by noise in the DC distribution network is solved, and more accurate DC power measurement is achieved, ensuring fair trading.
Patent Information
- Application Number
- CN202411357690.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing DC distribution network contains noise, which leads to inaccurate DC power calculations. The existing dot product and power metering methods are suitable for AC distribution networks, which will have large metering errors for DC distribution networks.
Using the DC power measurement method based on the improved wavelet threshold algorithm, the voltage/current waveform data is extracted, the appropriate wavelet basis and decomposition layer are selected for signal decomposition, threshold processing and reconstruction are performed, the denoised signal is output, and complex is used. The Simpson integration algorithm performs electrical energy calculation.
The improved method can better extract signals in the context of strong noise, reduce electricity measurement errors, and maintain fair transactions between enterprises and residents.
Smart Images

Figure CN119125668A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of direct current electric energy measurement, and in particular relates to a direct current electric energy measurement method based on an improved wavelet threshold algorithm. Background Art
[0002] With the development and widespread application of DC distribution networks, a large number of new electronic devices have also been connected to the power system. While life has become more convenient, it has also brought many problems, such as disturbance signals and noise generated by electrical appliances, which have brought inconvenience to the calculation of electric energy. Since most household, commercial and industrial electricity was basically AC before, my country's research on AC electric energy calculation has been relatively mature, but for DC electric energy, the application of DC electric energy has become more and more extensive. However, the existing DC distribution network contains noise (ripple), but lacks an effective DC electric energy calculation method, resulting in inaccurate DC electric energy calculation, which is not convenient for accurate calculation and settlement. Therefore, the research on DC electric energy calculation methods can not only bring convenience for accurate DC electric energy calculation in the future, but also have important significance for the further development of DC distribution networks.
[0003] Therefore, it is necessary to design a DC power calculation method for DC distribution networks to improve the accuracy of measurement and maintain fairness in transactions between enterprises and residents. Summary of the invention
[0004] The technical problem to be solved by the present invention is that the existing DC distribution network contains noise (ripple), and the existing dot product and electric energy metering methods are suitable for AC distribution networks, but there will be a large metering error problem for DC distribution networks.
[0005] The present invention provides a DC electric energy metering method based on an improved wavelet threshold algorithm, comprising the following steps:
[0006] S1. Extract voltage / current waveform data x(t) in the scenario of DC distribution network; obtain voltage / current signal waveform data x(n) of the power grid based on fixed sampling technology; based on the acquired waveform data x(n), select appropriate wavelet basis and decomposition layer number to decompose the input power signal at each layer to obtain the wavelet coefficients of each layer;
[0007] S2. Perform threshold processing on the wavelet coefficients of each layer obtained in step S1 to obtain estimated wavelet coefficients, reconstruct the estimated wavelet coefficients, and output the denoised voltage / current signal signal(n);
[0008] S3. For the reconstructed voltage / current signal signal(n) obtained in step S2, an electric energy calculation method based on Simpson integration is obtained.
[0009] As a possible design, step S1 is specifically as follows:
[0010] S1.1: Based on fixed sampling technology, using digital-to-analog converter to s The voltage / current signal in the power grid is sampled at a sampling frequency to obtain the voltage / current signal waveform data x(n) of the power grid;
[0011] S1.2: Based on the acquired waveform data x(t), continuous wavelet transformation is performed, and the wavelet coefficients are as follows:
[0012]
[0013] Where: WT f (α,τ) represents the wavelet coefficients; ν α,τ (t) represents the wavelet basis function; α represents the scale parameter; τ is the delay parameter;
[0014] The discrete waveform data after sampling the continuous signal is x(n), and the discrete wavelet transform can be expressed as:
[0015]
[0016] Where: WT f (j,k) is the wavelet coefficient; j is the discretization scale parameter; k is the ordinal number of the coefficient.
[0017] As a possible design, step S2 is specifically as follows:
[0018] S2.1: Obtaining the selected threshold
[0019]
[0020] Where: ξ is the selected threshold; the threshold of the jth layer of wavelet decomposition is ξ j ρ 1,2 Indicates the degree of influence of the original signal coefficient and the decomposed signal coefficient. When the original signal coefficient is strongly correlated with the decomposed signal coefficient, take |ρ 1,2 |∈(0.7,1], when the original signal coefficient is weakly correlated with the decomposed signal coefficient, take |ρ 1,2 |∈(0,0.5]; in other cases, take ρ 1,2 ∈(0.5,0.;
[0021] S2.2: Based on the selected threshold value obtained in step S2.1, a wavelet threshold function is established, as shown in the following formula:
[0022]
[0023] In the formula, represents the kth estimated wavelet coefficient of the jth layer, ω j,krepresents the kth real wavelet coefficient of the jth layer of decomposition, ξ represents the selected threshold, sgn(ω j,k ) is a step function;
[0024] Perform an inverse transform on the wavelet threshold function obtained in step S2.3, restore the signal from the frequency domain to the time domain, and obtain the denoised signal signal(n).
[0025] As a possible design, the correlation coefficient ρ 1,2 The details of obtaining are as follows:
[0026] Set the original set of data to s 1 =[a 11 a 12 ...a 1n ] T , the data after each layer of decomposition is s 2,j =[a 21 a 22 ...a 2n ] T , then the correlation coefficient ρ 1,2 as follows:
[0027]
[0028] Among them: Cov(s 1 ,s 2,j ) is s 1 and 2,j The covariance of and They are s 1 and 2,j The variance of , and there exists |ρ 1,2 |≤1.
[0029] As a possible design, step S3 is specifically as follows:
[0030] S3.1: Set a sampling period T according to the voltage / current signal signal(n) obtained in step S2, sample M+1 points in the sampling period, and divide the time in the period into M time intervals [t p ,t p+1 ], where p = 0, 1, 2, ..., M-1;
[0031] S3.2: Calculate the product of every two equally divided intervals in step S3.1;
[0032] S3.3: Accumulate and sum the values obtained in each interval to obtain the corresponding voltage, current, and power;
[0033] S3.4: Calculate the electrical energy based on the corresponding voltage, current, and power.
[0034] As a possible design, step S3.2 is as follows:
[0035] [t p ,t p+1 ] and [t p+1 ,t p+2 ] together form a new interval [t 2k ,t 2k+2 ],in,
[0036] Since the coefficients of the second-order integral of the Newton-Cotes quadrature formula are And here is the product of every two intervals, then the coefficient is The following Simpson integral formulas for voltage, current and power can be obtained;
[0037]
[0038]
[0039]
[0040] As a possible design, step S3.3 is as follows:
[0041]
[0042]
[0043]
[0044] As a possible design, step S3.4 is as follows:
[0045] The calculation formula of electric energy E is as follows:
[0046]
[0047] As a possible design, in step S3.1, the higher the wavelet decomposition layer, the lower the correlation with the original signal, the smaller the r value, and a smaller threshold is selected.
[0048] As a possible design, in step S1.2, the wavelet basis is the db5 wavelet basis, and the number of decomposition levels is 4.
[0049] Beneficial effects of the present invention:
[0050] 1. Based on the traditional wavelet threshold denoising, the present invention proposes an adaptive wavelet threshold function to denoise the power signal. The improved threshold avoids the problem of incorrect signal judgment caused by too large or too small threshold during threshold processing. The signal denoising is more thorough and the required signal can be better extracted under strong noise background.
[0051] 2. The present invention improves the traditional dot product and electric energy metering methods and proposes a complex Simpson integration algorithm, which makes the electric energy metering error smaller and maintains fair transactions between enterprises and residents. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The above and other purposes, features and advantages of the present invention will be more clear as shown in the drawings. The same reference numerals in all the drawings indicate the same parts, and the drawings are not deliberately scaled according to the actual size. The focus is on illustrating the main purpose of the present invention.
[0053] Figure 1 The figure is a flow chart of a DC electric energy metering method based on an improved wavelet threshold algorithm in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0056] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0057] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0058] Since most household, commercial and industrial electricity was basically AC, my country's research on AC power calculation has developed relatively maturely. However, as for DC power, the application of DC power has become more and more extensive. However, the existing DC distribution network contains noise (ripple) but lacks effective DC power calculation methods, resulting in inaccurate DC power calculation, which is not convenient for accurate calculation and billing.
[0059] It should be noted that the units of all parameters involved in the present invention are based on international standards.
[0060] With respect to direct current power, the application of direct current power is becoming more and more widespread. However, the existing direct current distribution network contains noise (ripple), but lacks an effective direct current power calculation method, resulting in inaccurate direct current power calculation, and inconvenience in accurate calculation and billing. The embodiment of the present invention discloses a direct current power metering method based on an improved wavelet threshold algorithm, which avoids the problem of incorrect signal judgment due to excessively large or too small thresholds during threshold processing, and is more thorough in signal denoising, and can better extract the desired signal under a strong noise background.
[0061] like Figure 1 As shown in , a DC power measurement method based on an improved wavelet threshold algorithm includes the following steps:
[0062] Step 1: Extract voltage / current waveform data x(t) in the DC distribution network scenario, that is, based on fixed sampling technology, use a digital-to-analog converter to obtain the voltage / current waveform data x(t). s The voltage / current signal in the power grid is sampled at a sampling frequency to obtain the voltage / current signal waveform data x(n) of the power grid; based on the acquired waveform data x(n), an appropriate wavelet basis and decomposition layer number are selected to decompose the input power signal at each layer to obtain the wavelet coefficients of each layer.
[0063] The step 1 comprises the following steps:
[0064] Step 1.1: Based on the fixed sampling technique, use the digital-to-analog converter to obtain the s The voltage / current signal in the power grid is sampled at a sampling frequency to obtain the voltage / current signal waveform data x(n) of the power grid;
[0065] Step 1.2: Based on the acquired waveform data x(t), continuous wavelet transformation is performed to obtain:
[0066]
[0067] Where: WT f (α,τ) represents the wavelet coefficients; ν α,τ (t) represents the wavelet basis function; α represents the scale parameter; τ is the delay parameter.
[0068] The discrete waveform data after sampling the continuous signal is x(n), and the discrete wavelet transform can be expressed as:
[0069]
[0070] Where: WT f (j,k) is the wavelet coefficient; j is the discretization scale parameter; k is the ordinal number of the coefficient.
[0071] According to the above formulas (0.23) and (0.1), select appropriate wavelet basis to decompose the input power signal at each layer and obtain the wavelet coefficients WT of each layer. f Here, the db5 wavelet basis is generally selected for the characteristics of the multi-frequency components of the power signal, and the number of decomposition levels is generally set to 4.
[0072] Step 2: Perform threshold processing on the coefficients of each layer obtained in step 1 to obtain the estimated wavelet coefficients. When performing wavelet decomposition threshold processing, it is considered that the noise coefficient will decrease with the increase of the number of decomposition layers. Therefore, it is unreasonable to use the same threshold for all traditional layers, which is easy to make wrong judgments on noise signals and lacks adaptability. Therefore, a corresponding improved threshold processing method is proposed so that the threshold of each layer can be adaptively selected according to the signal characteristics. Finally, the denoised wavelet coefficients are reconstructed and the denoised voltage / current signal signal(n) is output.
[0073] Step 2.1: Selecting an appropriate threshold and threshold function is crucial to achieving a good noise reduction effect. Fixed threshold noise reduction is more thorough, but it is easy to remove useful signals and lacks adaptability to all working conditions. To this end, the present invention proposes a new threshold that changes with the number of decomposition levels, so that the selected threshold is more in line with the characteristics of signal changes, as shown in the following formula (0.2).
[0074]
[0075] Where: ξ is the selected threshold; the threshold of the jth layer of wavelet decomposition is ξ j ρ 1,2 Indicates the degree of influence between the original signal coefficient and the decomposed signal coefficient. jIt can also be expressed as shown in formula (0.26).
[0076]
[0077] Where: σ represents the noise variance, N represents the signal length. j is a monotonically decreasing function. The larger the number of decomposition layers, the j The smaller it is, the more adaptively the threshold can be selected.
[0078] Step 2.2: For the correlation coefficient ρ in the above formula (0.2), 1,2 For further analysis and discussion, set the original set of data as s 1 =[a 11 a 12 ...a 1n ] T , the data after each layer of decomposition is s 2,j =[a 21 a 22 ...a 2n ] T , then the correlation coefficient between the two is ρ 1,2 It can be further expanded into:
[0079]
[0080] Among them: Cov(s 1 ,s 2,j ) is s 1 and 2,j The covariance of and They are s 1 and 2,j The variance of , and there exists |ρ 1,2 |≤1.
[0081] The selection principle is mainly as follows: the higher the wavelet decomposition layer, the lower the correlation with the original signal, the smaller the r value, and the smaller the threshold should be selected. In general, when the two are strongly correlated, |ρ 1,2 |∈(0.7,1]; when the correlation is weak, take ρ 1,2 |∈(0,0.5]; in other cases, take |ρ 1 ,2|∈(0.5,0.7].
[0082] Step 2.3: Based on the new threshold value proposed in step 2.1, a new wavelet threshold function is established, as shown in the following formula.
[0083]
[0084] In the above formula, represents the kth estimated wavelet coefficient of the jth layer, ωj,k represents the kth real wavelet coefficient of the jth layer of decomposition, ξ represents the selected threshold, sgn(ω j,k ) is a step function.
[0085] Step 2.4: Perform an inverse transform on the wavelet change coefficient after threshold processing, restore the signal from the frequency domain to the time domain, and obtain the denoised signal signal(n).
[0086] Step 3: Based on the reconstructed voltage / current signal signal(n) obtained in step 2, high-precision DC power measurement is achieved. Considering that the traditional dot product and measurement method is only applicable to AC power calculation, and the positive and negative power offset of the sine wave cannot be achieved for DC power calculation, a complex power calculation method based on Simpson integral is proposed.
[0087] Step 3.1: First, set a sampling period T according to the voltage / current signal signal(n) obtained in step 2. Sample M+1 points in the sampling period, and divide the time in the period into M time intervals [t p ,t p+1 ], where p = 0, 1, 2, .. M., -.
[0088] Step 3.2: Take the product of every two equally divided intervals, such as [t p ,t p+1 ] and [t p+1 ,t p+2 ] together form a new interval [t 2k ,t 2k+2 ],in, Since the coefficients of the second-order integral of the Newton-Cotes quadrature formula are And here is the product of every two intervals, then the coefficient is The following Simpson integral formulas for voltage, current and power can be obtained.
[0089]
[0090]
[0091]
[0092] Step 3.3: Add up the values obtained in each interval to obtain the corresponding complex Simpson integral formulas for voltage, current, and power as shown below:
[0093]
[0094]
[0095]
[0096] Step 3.4: Calculate the electric energy E according to formula (0.11), which is the integral of P(t) over time T.
[0097]
[0098] The DC electric energy metering method based on the improved wavelet threshold algorithm disclosed in the present invention has the following effects:
[0099] 1. Based on the traditional wavelet threshold denoising, the present invention proposes an adaptive wavelet threshold function to denoise the power signal. The improved threshold avoids the problem of incorrect signal judgment caused by too large or too small threshold during threshold processing. The signal denoising is more thorough and the required signal can be better extracted under strong noise background.
[0100] 2. The present invention improves the traditional dot product and electric energy metering methods and proposes a complex Simpson integration algorithm, which makes the electric energy metering error smaller and maintains fair transactions between enterprises and residents.
[0101] 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 DC electric energy measurement method based on an improved wavelet threshold algorithm, characterized in that: The steps include: S1. Extract voltage / current waveform data x(t) in the scenario of DC distribution network; obtain voltage / current signal waveform data x(n) of the power grid based on fixed sampling technology; based on the acquired waveform data x(n), select appropriate wavelet basis and decomposition layer number to decompose the input power signal at each layer to obtain the wavelet coefficients of each layer; S2. Perform threshold processing on the wavelet coefficients of each layer obtained in step S1 to obtain estimated wavelet coefficients, reconstruct the estimated wavelet coefficients, and output the denoised voltage / current signal signal(n); S3. For the reconstructed voltage / current signal signal(n) obtained in step S2, an electric energy calculation method based on Simpson integration is obtained.
2. The DC electric energy measurement method based on the improved wavelet threshold algorithm according to claim 1 is characterized in that: Step S1 is specifically as follows: S1.1: Based on fixed sampling technology, using digital-to-analog converter to s The voltage / current signal in the power grid is sampled at a sampling frequency to obtain the voltage / current signal waveform data x(n) of the power grid; S1.2: Based on the acquired waveform data x(t), continuous wavelet transformation is performed, and the wavelet coefficients are as follows: Where: WT f (α,τ) represents the wavelet coefficients; ν α,τ (t) represents the wavelet basis function; α represents the scale parameter; τ is the delay parameter; The discrete waveform data after sampling the continuous signal is x(n), and the discrete wavelet transform can be expressed as: Where: WT f (j,k) is the wavelet coefficient; j is the discretization scale parameter; k is the ordinal number of the coefficient.
3. The DC electric energy measurement method based on the improved wavelet threshold algorithm according to claim 1 is characterized in that: Step S2 is specifically as follows: S2.1: Obtaining the selected threshold Where: ξ is the selected threshold; the threshold of the jth layer of wavelet decomposition is ξ j ρ 1,2 Indicates the degree of influence of the original signal coefficient and the decomposed signal coefficient. When the original signal coefficient is strongly correlated with the decomposed signal coefficient, take |ρ 1,2 |∈(0.7,1], when the original signal coefficient is weakly correlated with the decomposed signal coefficient, take |ρ 1,2 |∈(0,0.5]; in other cases, take ρ 1,2 ∈(0.5,0.; S2.2: Based on the selected threshold value obtained in step S2.1, a wavelet threshold function is established, as shown in the following formula: In the formula, represents the kth estimated wavelet coefficient of the jth layer, ω j,k represents the kth real wavelet coefficient of the jth layer of decomposition, ξ represents the selected threshold, sgn(ω j,k ) is a step function; Perform an inverse transform on the wavelet threshold function obtained in step S2.3, restore the signal from the frequency domain to the time domain, and obtain the denoised signal signal(n).
4. The DC electric energy measurement method based on the improved wavelet threshold algorithm according to claim 3 is characterized in that: The correlation coefficient ρ 1,2 The details of obtaining are as follows: Set the original set of data to s1 = [a 11 a 12 ...a 1n ] T , the data after each layer of decomposition is s 2,j =[a 21 a 22 ...a 2n ] T , then the correlation coefficient ρ 1,2 as follows: Where: Cov(s1,s 2,j ) for s1 and s 2,j The covariance of and s1 and s 2,j The variance of , and there exists |ρ 1,2 |≤1.
5. The DC electric energy measurement method based on the improved wavelet threshold algorithm according to claim 1 is characterized in that: Step S3 is as follows: S3.1: Set a sampling period T according to the voltage / current signal signal(n) obtained in step S2, sample M+1 points in the sampling period, and divide the time in the period into M time intervals [t p ,t p+1 ], where p = 0, 1, 2, ..., M-1; S3.2: Calculate the product of every two equally divided intervals in step S3.1; S3.3: Accumulate and sum the values obtained in each interval to obtain the corresponding voltage, current, and power; S3.4: Calculate the electrical energy based on the corresponding voltage, current, and power.
6. The DC electric energy measurement method based on the improved wavelet threshold algorithm according to claim 5 is characterized in that: Step S3.2 is as follows: [t p ,t p+1 ] and [t p+1 ,t p+2 ] together form a new interval [t 2k ,t 2k+2 ],in, Since the coefficients of the second-order integral of the Newton-Cotes quadrature formula are And here is the product of every two intervals, then the coefficient is The following Simpson integral formulas for voltage, current and power can be obtained; 7. The DC electric energy measurement method based on improved wavelet threshold algorithm according to claim 5 is characterized in that: Step S3.3 is as follows:
8. The DC electric energy measurement method based on improved wavelet threshold algorithm according to claim 5 is characterized in that: Step S3.4 is as follows: The calculation formula of electric energy E is as follows:
9. The DC electric energy measurement method based on improved wavelet threshold algorithm according to claim 3 is characterized in that: In step S3.1, the higher the wavelet decomposition layer, the lower the correlation with the original signal, the smaller the r value, and the smaller the threshold is selected.
10. The DC electric energy measurement method based on improved wavelet threshold algorithm according to claim 2 is characterized in that: In step S1.2, the wavelet basis is the db5 wavelet basis, and the number of decomposition levels is 4.
Citation Information
Patent Citations
DC electric energy metering device and method based on signal separation and precise integration
CN111537789A
DC electric energy signal denoising method based on improved wavelet threshold and correlation detection
CN113378661A
Direct-current electric energy metering method and device, equipment and storage medium
CN113884758A
Signal processing method of fuel cell impedance test system
CN118393356A
Direct-current digital standard power source device
CN214895457U
