Intelligent electric meter zero crossing point detection method and device fusing SVD and wavelet transform
By integrating wavelet transform and singular value decomposition technology, the smart meter signal is processed, which solves the problem of insufficient zero-crossing detection accuracy in traditional technology and achieves high-precision zero-crossing detection in low-voltage station environment.
Patent Information
- Application Number
- CN202410425170.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2024-09-20
AI Technical Summary
Traditional smart meters have insufficient zero-crossing detection accuracy in low-voltage distributed energy access environments, making it difficult to achieve precise control of alternating current, mainly due to the influence of unstable signal frequency and random noise.
The fusion of wavelet transform and singular value decomposition (SVD) technology is used to de-noise the energy meter signal. Wavelet transform is used to remove noise, and singular value decomposition eliminates unnecessary patterns, thereby improving the accuracy of zero-crossing detection.
By reducing and removing noise, the zero-crossing phenomenon in the signal is accurately analyzed, which improves the accuracy of zero-crossing detection and enables precise control of electric energy signals in complex environments.
Smart Images

Figure CN118671680A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment, storage medium and computer program product for detecting zero-crossing points of a smart meter integrating SVD and wavelet transform. Background Art
[0002] In the field of smart meters, with the rapid development of power systems, the requirements for zero-crossing detection algorithms for smart meters are increasing. Zero-crossing detection refers to the detection made by the system when the waveform passes through the zero position when it switches from the positive half-cycle to the negative half-cycle in the AC system. Through zero-crossing detection, precise control of AC power can be achieved, including adjustment of frequency, phase, and amplitude.
[0003] Traditional technology mainly uses phase-locked loop technology for zero-crossing point detection. However, in the context of distributed energy access in low-voltage substations, the requirement for complete signal synchronization faces severe challenges in actual power systems. Since the signal frequency is affected by complex factors such as non-strict periodicity and random noise, the detection accuracy of traditional technology for zero-crossing point detection is insufficient, which is not conducive to improving the detection accuracy of zero-crossing point detection. Summary of the invention
[0004] Based on this, it is necessary to provide a smart meter zero-crossing detection method, device, computer equipment, computer-readable storage medium and computer program product that integrates SVD and wavelet transform and can improve the detection accuracy of zero-crossing detection in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for detecting zero-crossing points of a smart meter by integrating SVD and wavelet transform, comprising:
[0006] Perform wavelet transform and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal; the signal to be detected is a signal collected from an electric energy meter;
[0007] Sampling the reconstructed signal according to a preset sampling frequency to obtain a discrete signal;
[0008] Filtering out a target moment from candidate moments in the discrete signal, monitoring the integration result corresponding to the signal to be detected starting from before the target moment, and determining a zero-crossing time series for the signal to be detected based on the integration result; the candidate moments include moments corresponding to zero-crossing points in the discrete signal;
[0009] According to the zero-crossing time series, a zero-crossing period for the signal to be detected is determined; the zero-crossing period is used to determine the zero-crossing phenomenon in the signal to be detected.
[0010] In one embodiment, the step of selecting a target moment from candidate moments in the discrete signal includes:
[0011] Determine an average period according to the time corresponding to at least two zero-crossing points in the discrete signal; the average period represents the time length between adjacent zero-crossing points in the discrete signal;
[0012] The target time is determined according to the sum of the product of the average period and the preset period parameter and the time corresponding to the zero-crossing point.
[0013] In one embodiment, determining the zero-crossing time series for the signal to be detected according to the integration result includes:
[0014] When the integration result is equal to zero, it is determined that the signal to be detected has a zero-crossing phenomenon, and the time between the moment corresponding to the integration result equal to zero and the target moment is taken as the target time;
[0015] The sum of the target time and the target duration is taken as the target zero-crossing time;
[0016] Determining a time to be analyzed according to an average value between the target time and the target zero-crossing time;
[0017] The time moments to be analyzed are sorted according to a preset order to obtain the zero-crossing time series.
[0018] In one embodiment, the zero-crossing time sequence includes at least two moments to be analyzed, and determining the zero-crossing period for the signal to be detected according to the zero-crossing time sequence includes:
[0019] The zero-crossing period is determined according to the difference between mutually adjacent moments to be analyzed in the zero-crossing time series.
[0020] In one embodiment, the step of performing wavelet transform and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal includes:
[0021] According to a preset wavelet function, the signal to be detected is subjected to wavelet transform processing to obtain a noise reduction signal;
[0022] Performing singular value decomposition processing on the noise reduction signal to obtain a decomposition result;
[0023] The reconstructed signal is generated according to the decomposition result.
[0024] In one embodiment, the wavelet transform processing is performed on the signal to be detected according to a preset wavelet function to obtain a noise reduction signal, including:
[0025] According to the preset wavelet function, multi-scale convolution processing is performed on the signal to be detected to obtain at least one layer of transformation results;
[0026] Obtaining wavelet coefficients corresponding to the transformation result;
[0027] For each layer of the transformation result, when the wavelet coefficient is greater than or equal to a preset coefficient threshold, the wavelet coefficient is fixed, and when the wavelet coefficient is less than the preset coefficient threshold, the wavelet coefficient is set to zero, so as to obtain a modified transformation result corresponding to the transformation result;
[0028] The modified transformation result is subjected to inverse wavelet transformation to generate the noise reduction signal.
[0029] In a second aspect, the present application also provides a smart meter zero-crossing detection device integrating SVD and wavelet transform, comprising:
[0030] A signal processing module, used for performing wavelet transform processing and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal; the signal to be detected is a signal collected from an electric energy meter;
[0031] A signal sampling module, used for sampling the reconstructed signal according to a preset sampling frequency to obtain a discrete signal;
[0032] A signal integration module, used to select a target moment from candidate moments in the discrete signal, monitor the integration result corresponding to the signal to be detected starting from before the target moment, and determine the zero-crossing time series for the signal to be detected according to the integration result; the candidate moment includes the moment corresponding to the zero-crossing point in the discrete signal;
[0033] The cycle determination module is used to determine the zero-crossing cycle for the signal to be detected according to the zero-crossing time series; the zero-crossing cycle is used to determine the zero-crossing phenomenon in the signal to be detected.
[0034] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the above method are implemented.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0036] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0037] The above-mentioned smart meter zero-crossing detection method, device, computer equipment, storage medium and computer program product integrating SVD and wavelet transform obtain a reconstructed signal by performing wavelet transform processing and singular value decomposition processing on the signal to be detected, thereby reducing the noise of the signal to be detected, removing unnecessary information in the signal to be detected, and improving the validity of the data in the signal to be detected; the signal to be detected is a signal collected from the electric energy meter; the reconstructed signal is sampled at a preset sampling frequency to obtain a discrete signal, thereby converting the continuous signal into a discrete signal, which is convenient for determining the subsequent target moment; the target moment is screened out from the candidate moments in the discrete signal, and the integral result corresponding to the signal to be detected is monitored starting from before the target moment, and the zero-crossing time series for the signal to be detected is determined based on the integral result; the candidate moment includes the moment corresponding to the zero-crossing point in the discrete signal, so that the integral result corresponding to the signal to be detected is monitored in real time starting from before the target moment in the discrete signal, and the detection result is accurately determined. Accurately analyze a series of time points at which zero-crossing phenomena exist in the signal to be detected; determine the zero-crossing period for the signal to be detected based on the zero-crossing time series, and accurately calculate the zero-crossing period for determining the zero-crossing phenomenon in the signal to be detected based on the zero-crossing time series; be able to use wavelet transform to reduce the noise of the original signal and eliminate most of the signal noise, use singular value decomposition to process the noise-reduced signal, in the singular value decomposition, by calculating the peak difference of the covariance matrix, set unnecessary modes to zero, obtain a reconstructed signal after reconstruction and noise reduction, and determine the target based on the discrete signal obtained by sampling the reconstructed signal, start monitoring the integration result of the signal to be detected before the target time, and calculate the zero-crossing period for the signal to be detected based on the zero-crossing time series determined by the integration result, so as to achieve accurate calculation of the zero-crossing period for determining the zero-crossing phenomenon in the original signal while eliminating the noise in the original signal, thereby improving the detection accuracy of zero-crossing detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 This is an application environment diagram of a method for detecting zero-crossing points of a smart meter integrating SVD and wavelet transform in one embodiment;
[0040] Figure 2 A schematic diagram of a flow chart of a method for detecting zero-crossing points of a smart meter by integrating SVD and wavelet transform in one embodiment;
[0041] Figure 3 A schematic diagram of a process for determining a zero-crossing period in an embodiment;
[0042] Figure 4 A schematic diagram of a process of performing singular value decomposition on a signal using an improved singular value decomposition algorithm in one embodiment;
[0043] Figure 5 A schematic diagram of a process of performing wavelet transform on a signal in one embodiment;
[0044] Figure 6 A schematic diagram of a process of performing zero-crossing detection based on a smart meter zero-crossing detection algorithm integrating SVD and wavelet transform in one embodiment;
[0045] Figure 7 It is a structural block diagram of a smart meter zero-crossing detection device integrating SVD and wavelet transform in one embodiment;
[0046] Figure 8 The figure is a diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of 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.
[0048] The smart meter zero-crossing detection method integrating SVD and wavelet transform provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the electric energy meter 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 performs wavelet transform processing and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal; the signal to be detected is a signal collected from the electric energy meter; the server 104 samples the reconstructed signal according to a preset sampling frequency to obtain a discrete signal; the server 104 selects the target moment from the candidate moments in the discrete signal, and monitors the integral result corresponding to the signal to be detected from before the target moment, and determines the zero-crossing time series for the signal to be detected according to the integral result; the candidate moment includes the moment corresponding to the zero-crossing point in the discrete signal; the server 104 determines the zero-crossing period for the signal to be detected according to the zero-crossing time series; the zero-crossing period is used to determine the zero-crossing phenomenon in the signal to be detected. Among them, the electric energy meter 102 can be but is not limited to a smart electric energy meter, and the electric energy meter 102 can measure a voltage signal and / or a current signal. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0049] In an exemplary embodiment, Figure 2 As shown, a method for detecting zero-crossing points of a smart meter by integrating SVD and wavelet transform is provided. The method is applied to a server as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0050] Step S202: performing wavelet transform and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal.
[0051] The signal to be detected may refer to data characterizing the change of electric energy (such as current and voltage) over time. In practical applications, the signal to be detected may be a current signal and / or a voltage signal collected from an electric energy meter.
[0052] The reconstructed signal may refer to a signal obtained after performing wavelet transform and singular value decomposition processing on the signal to be detected.
[0053] As an example, the server collects current signals and / or voltage signals to be measured from the electric energy meter, and converts the current signals and / or voltage signals to be measured into digital signals through an analog-to-digital converter to obtain signals to be detected. The server performs wavelet transform processing and singular value decomposition processing on the signals to be detected in sequence, thereby reducing noise and reconstructing the signals to be detected through wavelet transform and singular value decomposition to obtain reconstructed signals.
[0054] Step S204: sampling the reconstructed signal according to a preset sampling frequency to obtain a discrete signal.
[0055] The sampling frequency may refer to the number of samples extracted from a continuous signal and composed into a discrete signal in a unit time.
[0056] The discrete signal may refer to a signal obtained by sampling the reconstructed signal according to a preset sampling frequency.
[0057] As an example, the server samples the reconstructed signal according to a preset sampling frequency, thereby converting the reconstructed signal into a discrete signal.
[0058] Step S206, selecting a target moment from the candidate moments in the discrete signal, monitoring the integration result corresponding to the signal to be detected starting from before the target moment, and determining the zero-crossing time series for the signal to be detected based on the integration result.
[0059] The candidate time may refer to the time when a zero-crossing phenomenon occurs in the discrete signal.
[0060] The target time may refer to a predicted value representing the time point at which the zero-crossing phenomenon occurs in the signal to be detected. In practical applications, by analyzing the zero-crossing phenomenon in discrete signals, the time point at which the zero-crossing phenomenon occurs in the signal to be detected, i.e., the target time, can be predicted.
[0061] The integration result may refer to a result obtained by integrating the signal to be detected with the aid of an integrator (such as a Miller integrator).
[0062] Among them, the zero-crossing time series may refer to a sequence consisting of several time points characterizing the occurrence of the zero-crossing phenomenon in the signal to be detected. In practical applications, by analyzing the integration results, several time points at which the zero-crossing phenomenon occurs in the signal to be detected can be determined, thereby obtaining the zero-crossing time series.
[0063] As an example, the server filters out a target moment from candidate moments in a discrete signal, and uses the target moment as a predicted value of a zero-crossing phenomenon in the signal to be detected. The server monitors the integral result corresponding to the signal to be detected starting from before the target moment, and the server determines, in sequence, several time points at which the zero-crossing phenomenon occurs in the signal to be detected based on the integral result. The server determines a zero-crossing time series for the signal to be detected based on the several time points.
[0064] Step S208, determining the zero-crossing period of the signal to be detected according to the zero-crossing time sequence.
[0065] The zero-crossing period may refer to a period during which the signal to be detected undergoes a zero-crossing phenomenon. In practical applications, the zero-crossing period may be used to determine the zero-crossing phenomenon in the signal to be detected.
[0066] As an example, the server determines the zero-crossing period for the signal to be detected based on the zero-crossing time series. Specifically, since the time points in the zero-crossing time series are all time points where the signal to be detected undergoes a zero-crossing phenomenon, after the time points in the zero-crossing time series are arranged in descending order, the difference between any two adjacent time points can be used as the zero-crossing period of the signal to be detected. The server can also calculate the frequency of the zero-crossing phenomenon of the signal to be detected based on the zero-crossing period of the signal to be detected.
[0067] In the above-mentioned smart meter zero-crossing detection method integrating SVD and wavelet transform, a reconstructed signal is obtained by performing wavelet transform processing and singular value decomposition processing on the signal to be detected, thereby reducing the noise of the signal to be detected, removing unnecessary information in the signal to be detected, and improving the validity of the data in the signal to be detected; the signal to be detected is a signal collected from the electric energy meter; the reconstructed signal is sampled at a preset sampling frequency to obtain a discrete signal, thereby converting the continuous signal into a discrete signal, which is convenient for determining the subsequent target moment; the target moment is screened out from the candidate moments in the discrete signal, and the integral result corresponding to the signal to be detected is monitored starting from before the target moment, and the zero-crossing time series for the signal to be detected is determined based on the integral result, thereby starting from before the target moment in the discrete signal, the integral result corresponding to the signal to be detected is monitored in real time, and a series of time series of zero-crossing phenomena in the signal to be detected are accurately analyzed. time point; according to the zero-crossing time series, the zero-crossing period for the signal to be detected is determined, so as to accurately calculate the zero-crossing period for determining the zero-crossing phenomenon in the signal to be detected based on the zero-crossing time series; the original signal can be denoised by wavelet transform to eliminate most of the signal noise, and the denoised signal is processed by singular value decomposition. In the singular value decomposition, the peak difference of the covariance matrix is calculated to set the unnecessary mode to zero, so as to obtain a reconstructed signal after reconstruction and denoising, and the target is determined based on the discrete signal obtained by sampling the reconstructed signal, and the integration result of the signal to be detected is monitored before the target time, so as to calculate the zero-crossing period for the signal to be detected based on the zero-crossing time series determined by the integration result, so as to achieve accurate calculation of the zero-crossing period for determining the zero-crossing phenomenon in the original signal while eliminating the noise in the original signal, thereby improving the detection accuracy of zero-crossing detection.
[0068] In an exemplary embodiment, a target moment is screened out from candidate moments in a discrete signal, including: determining an average period based on moments corresponding to at least two zero-crossing points in the discrete signal; and determining the target moment based on the sum of the product between the average period and a preset period parameter and the moment corresponding to the zero-crossing point.
[0069] Among them, the zero-crossing point in the discrete signal may refer to the zero-crossing phenomenon that occurs after the negative peak or positive peak in the discrete signal.
[0070] Among them, the average period may refer to the time length between the occurrence time points of the zero-crossing phenomena adjacent to each other in the discrete signal.
[0071] Among them, the preset period parameter may refer to a preset constant. In practical applications, the preset period parameter can be represented as K, and the value range of K can be (0.5, 1).
[0072] As an example, as Figure 3 shown, a flowchart for determining the zero-crossing period is provided. After the server performs wavelet transform and singular value decomposition on the signal to be detected, a continuous-time signal (reconstructed signal) is obtained. The server samples the continuous-time signal according to the preset sampling frequency, converts the continuous-time signal into a discrete (time) signal. The server obtains several time points T1, T2, T3,... after the negative peak or positive peak of several cycles from the discrete signal, and obtains the zero-crossing points in the discrete signal. The zero-crossing points in the discrete signal can be used as the zero-crossing time sequence in the discrete signal. The server arranges the time points in the zero-crossing time sequence in the discrete signal in a preset order (such as from large to small or from small to large), and obtains the arrangement result T1, T2, T3 (T1 < T2 < T3). The difference between any two adjacent time points in the arrangement result can be used as the average period T. The server obtains the preset period parameter K. The server calculates the target time T according to the time point T3, the average period T, and the period parameter K in the zero-crossing time sequence of the discrete signal. bi , specifically, T1 can represent the time point when the zero-crossing phenomenon first occurs in the discrete signal (i.e., the time corresponding to the first zero-crossing point), T2 can represent the time point when the zero-crossing phenomenon second occurs in the discrete signal (i.e., the time corresponding to the second zero-crossing point), T3 can represent the time point when the zero-crossing phenomenon third occurs in the discrete signal (i.e., the time corresponding to the third zero-crossing point), then T bi can represent the predicted value or speculation value of the time point when the zero-crossing phenomenon occurs for the i-th time in the discrete signal (i.e., the predicted value of the time corresponding to the i-th zero-crossing point). The server can use the target time T bi as the starting integration time point for calculating the time corresponding to the i-th zero-crossing point.
[0073] In this embodiment, the average period is determined based on the moments corresponding to at least two zero-crossing points in the discrete signal; the target moment is determined based on the sum of the product between the average period and the preset period parameter and the moments corresponding to the zero-crossing points. This allows the zero-crossing phenomenon of the discrete signal to be analyzed, and the target moment when the zero-crossing phenomenon occurs in the signal to be detected to be inferred, providing a data basis for subsequent detection of the integral results of the signal to be detected and analysis of the zero-crossing period of the signal to be detected, thereby improving the detection accuracy of zero-crossing detection.
[0074] In some embodiments, based on the integration result, a zero-crossing time series for the signal to be detected is determined, including: when the integration result is equal to zero, it is determined that the signal to be detected has a zero-crossing phenomenon, and the duration between the moment corresponding to the integration result equal to zero and the target moment is used as the target duration; the sum of the target moment and the target duration is used as the target zero-crossing moment; the moment to be analyzed is determined based on the average value between the target moment and the target zero-crossing moment; the moments to be analyzed are sorted in a preset order to obtain a zero-crossing time series.
[0075] The target duration may refer to the length of time between the moment when the integral result is equal to zero and the target moment.
[0076] The target zero-crossing time may refer to the sum of the target time and the target duration.
[0077] The time to be analyzed may refer to the average value between the target time and the target zero-crossing time. In practical applications, the time to be analyzed may represent the time when the signal to be detected crosses the zero point phenomenon.
[0078] As an example, Figure 3 As shown, a flow chart of determining the zero-crossing period is provided. The server sends a control signal through the control circuit to initialize the Miller integrator, so that the voltage output value of the Miller integrator is 0. The server turns the switch of the Miller integrator off based on the control signal. The server starts to integrate the signal to be detected before the target time, and monitors the integration result of the signal to be detected in real time. When the integration result is equal to 0, the server determines that the signal to be detected has a zero-crossing phenomenon at this time. The server controls the integration circuit corresponding to the Miller integrator to stop integration based on the control signal, records the end time at this moment (i.e., the moment corresponding to the integration result equal to zero), and uses the time length between the end time at this moment and the target moment as the target duration. The server sums the target moment and the target duration to calculate the target zero-crossing moment T. oi , the server calculates the target time T bi and the target zero-crossing time T oi The average value between bi+ T oi) / 2, determine the time to be analyzed, the server sorts the time to be analyzed in a preset order (such as from small to large) to obtain a zero-crossing time series (or a position sequence used to characterize the positional relationship between the time to be analyzed). The server can use the zero-crossing time series to determine the time points at which multiple zero-crossing phenomena occur in the signal to be detected and calculate the (zero-crossing) period and (zero-crossing) frequency of the signal to be detected.
[0079] In this embodiment, by determining that the signal to be detected has a zero-crossing phenomenon when the integration result is equal to zero, the duration between the moment corresponding to the integration result equal to zero and the target moment is used as the target duration; the sum of the target moment and the target duration is used as the target zero-crossing moment; the moment to be analyzed is determined according to the average value between the target moment and the target zero-crossing moment; the moments to be analyzed are sorted in a preset order to obtain a zero-crossing time series, which can timely analyze the integration results, accurately record and determine the time point when the signal to be detected undergoes the zero-crossing phenomenon, improve the data basis for the subsequent determination of the zero-crossing period, and thereby improve the detection accuracy of zero-crossing detection.
[0080] In some embodiments, the zero-crossing time sequence includes at least two moments to be analyzed, and the zero-crossing period for the signal to be detected is determined based on the zero-crossing time sequence, including: determining the zero-crossing period based on the difference between adjacent moments to be analyzed in the zero-crossing time sequence.
[0081] Among them, the zero-crossing time series can be expressed as: the time to be analyzed T zi-1 , time T to be analyzed zi , time T to be analyzed zi+1 .
[0082] As an example, since the time points to be analyzed in the zero-crossing time series are arranged in a preset order (such as from small to large), the time length between any two adjacent time points to be analyzed in the zero-crossing time series can be used as the zero-crossing detection period of the signal to be detected. In practical applications, the time length between any two adjacent time points to be analyzed in the zero-crossing time series can be expressed as T pi , then T pi It can represent the zero-crossing detection period of the signal to be detected, T pi =T zi -T zi-1 , further, the frequency of the zero-crossing phenomenon of the signal to be detected (i.e., the zero-crossing frequency) F i It can be expressed as F i =1 / T pi .
[0083] In this embodiment, by determining the zero-crossing period based on the difference between adjacent moments to be analyzed in the zero-crossing time series, the zero-crossing period can be accurately calculated based on the moments to be analyzed in the zero-crossing time series, thereby improving the accuracy of the zero-crossing period and further improving the detection accuracy of zero-crossing detection.
[0084] In some embodiments, the detection signal is subjected to wavelet transform and singular value decomposition to obtain a reconstructed signal, including: performing wavelet transform on the detection signal according to a preset wavelet function to obtain a noise reduction signal; performing singular value decomposition on the noise reduction signal to obtain a decomposition result; and generating a reconstructed signal according to the decomposition result.
[0085] The preset wavelet function may refer to a mathematical function used to perform wavelet transform processing on the signal to be detected.
[0086] The noise reduction signal may refer to a signal obtained by performing wavelet transform on the signal to be detected.
[0087] The decomposition structure may refer to a result obtained by performing singular value decomposition processing on the noise reduction signal.
[0088] As an example, Figure 4 As shown, a flow chart of singular value decomposition of a signal based on an improved singular value decomposition algorithm is provided. After the server performs wavelet transform on the signal to be detected, a denoising result is obtained. The server performs inverse wavelet transform on the denoising result to realize wavelet reconstruction processing, and obtains a one-dimensional signal NewN(k) after wavelet reconstruction processing. The server fills the one-dimensional signal NewN(k) into a two-dimensional matrix A in sequence. Specifically, the server uses singular value decomposition to construct a one-dimensional noisy signal with a length of N at the wavelet transform (such as the one-dimensional signal NewN(k)), and obtains an m*n two-dimensional matrix A, wherein the one-dimensional noisy signal can be expressed as: x(n)=[x(1), x(2),……, x(n)], n=1, 2,……, N, and the two-dimensional matrix A can be expressed as:
[0089] .
[0090] Among them, m=N / 2, n=N+1-m.
[0091] The server then performs singular value decomposition (SVD) on matrix A to obtain the decomposition result. The calculation expression of singular value decomposition can be expressed as:
[0092] .
[0093] Among them, U can be an m×m orthogonal matrix, U can represent a left singular vector, V can be an n×n orthogonal matrix, V represents a right singular vector, and ∑ is an m×n non-negative diagonal matrix of the covariance matrix.
[0094] The server then determines the location of the maximum peak by analyzing the difference ratio between the singular values, where the singular values ∑ are arranged in descending order, and the server reconstructs the matrix. Specifically, the server sets the singular values after the maximum peak in the sigma matrix to zero to obtain new singular values, and then recombine the new singular values to obtain a new matrix NewA, and calculate the maximum peak σ of the matrix NewA j And record the maximum peak value σ j The server will have the maximum peak value σ j After that, all singular values are replaced by 0 to obtain ∑1, which can be expressed as:
[0095] .
[0096] The server then calculates the average value of the anti-diagonal elements of the new matrix NewA and outputs the average value as the final result. The server reconstructs the retained singular values based on the output final result, thereby selecting the appropriate number of singular values to retain. Specifically, the calculation expression for reconstructing the retained singular values can be expressed as:
[0097] .
[0098] The server then reconstructs the NewA matrix by calculating the average value xn of the anti-diagonal elements to obtain a one-dimensional signal X (ie, the reconstructed signal).
[0099] In this embodiment, the detection signal is subjected to wavelet transform processing according to a preset wavelet function to obtain a noise reduction signal; the noise reduction signal is subjected to singular value decomposition processing to obtain a decomposition result; based on the decomposition result, a reconstructed signal is generated, and it is possible to select an appropriate number of singular values to retain, and reconstruct the retained singular values, thereby improving the validity of the data in the signal, providing a data basis for the subsequent analysis of the zero-crossing period of the signal, and thereby improving the detection accuracy of the zero-crossing detection.
[0100] In some embodiments, a wavelet transform is performed on a signal to be detected according to a preset wavelet function to obtain a noise reduction signal, including: performing multi-scale convolution processing on the signal to be detected according to a preset wavelet function to obtain at least one layer of transformation results; obtaining wavelet coefficients corresponding to the transformation results; for each layer of transformation results, when the wavelet coefficient is greater than or equal to a preset coefficient threshold, fixing the wavelet coefficient, and when the wavelet coefficient is less than the preset coefficient threshold, setting the wavelet coefficient to zero, to obtain a modified transformation result corresponding to the transformation result; performing wavelet inverse transform processing on the modified transformation result to generate a noise reduction signal.
[0101] The transformation result may refer to data obtained by performing wavelet transformation on a signal using a wavelet function. In practical applications, the transformation result may include an approximate component, a detail component, a signal amplitude, and the like.
[0102] As an example, Figure 5 As shown, a schematic diagram of a process of performing wavelet transform on a signal is provided, and the server presets and selects a suitable wavelet function as a preset wavelet function, wherein the preset wavelet function can be expressed as The server performs convolution operation with the signal of the vehicle to be driven and the preset wavelet function (such as wavelet functions of different scales) to obtain the approximate components ca of each layer of decomposition j,k and detail component cd j,k And the amplitude aj of the wavelet detail signal of this layer. In practical applications, the calculation expression of wavelet transform can be expressed as:
[0103] .
[0104] The number of decomposition layers of the wavelet transform can be determined based on the mean absolute error ε, where the mean absolute error ε can be expressed as:
[0105] .
[0106] Among them, x i is the signal after noise reduction, n i is the real signal, and m is the number of signal sampling points.
[0107] The server may calculate the mean absolute error corresponding to each layer of the transformation result (ie, the decomposition result) of the wavelet transform, and use the layer number corresponding to the transformation result with the smallest mean absolute error as the decomposition layer number of the wavelet transform.
[0108] The server can use the hard threshold number to constrain or guide the noise reduction operation. In practical applications, the calculation expression of the noise reduction process can be expressed as:
[0109] .
[0110] Specifically, for each layer of transformation results, the wavelet coefficient W corresponding to the transformation result is λ When the coefficient is greater than or equal to the preset coefficient threshold λ, the server fixes the wavelet coefficient (keeps the wavelet coefficient unchanged). λ When the coefficient is less than the preset coefficient threshold λ, the server sets the wavelet coefficient to zero and obtains the modified transform result corresponding to the transform result (the periodic component of the signal to be detected with the noise component removed). The server performs inverse wavelet transform on the modified transform result to generate a noise reduction signal. Specifically, the server performs inverse wavelet transform on the components processed at each layer in the wavelet transform process to obtain the noise reduction components, completes the wavelet reconstruction and obtains the one-dimensional signal NewN (i.e., the noise reduction signal). In practical applications, the noise reduction signal NewN(k) can be expressed as:
[0111] .
[0112] In this embodiment, multi-scale convolution processing is performed on the signal to be detected according to a preset wavelet function to obtain at least one layer of transformation results; the wavelet coefficients corresponding to the transformation results are obtained; for each layer of transformation results, when the wavelet coefficient is greater than or equal to a preset coefficient threshold, the wavelet coefficient is fixed, and when the wavelet coefficient is less than the preset coefficient threshold, the wavelet coefficient is set to zero to obtain a corrected transformation result corresponding to the transformation result; the corrected transformation result is subjected to wavelet inverse transformation processing to generate a noise reduction signal, which can accurately remove the noise in the signal to be detected, improve the validity of the data in the signal, avoid the influence of noise on zero-crossing detection, and thereby improve the detection accuracy of zero-crossing detection.
[0113] In some embodiments, Figure 6As shown, a flowchart of a zero-crossing detection algorithm for a smart meter based on the fusion of SVD and wavelet transform is provided. The server collects current signals and / or voltage signals from the smart electric energy meter, and converts the current signals and / or voltage signals into digital signals (signals to be detected) through an analog-to-digital converter. The server performs multi-scale wavelet transform on the signals to be detected, decomposes the signals to be detected into wavelet components of different scales, and applies a wavelet threshold denoising method to preliminarily remove unnecessary information (such as noise components) in the signals to be detected. Then, the server performs singular value decomposition on the signal processed by the wavelet transform to eliminate noise components with less influence (i.e., detail denoising), and performs reconstruction operation to obtain a reconstructed signal. The server samples the reconstructed signal according to a preset sampling frequency to obtain a discrete signal. The server The device selects a target moment from candidate moments in the discrete signal by analyzing the discrete signal, takes the target moment as a predicted value of the zero-crossing phenomenon in the signal to be detected, and monitors the integral result corresponding to the signal to be detected starting from before the target moment. The server determines several time points at which the zero-crossing phenomenon occurs in the signal to be detected in turn according to the integral result. The server determines a zero-crossing time series for the signal to be detected according to the several time points, and then determines multiple zero-crossing time intervals based on the zero-crossing time series. The server measures and calculates the zero-crossing period and frequency of the signal to be detected according to the multiple zero-crossing time intervals. Finally, the server sends the measured results (such as the zero-crossing period and frequency, etc.) to a specific terminal, and the specific terminal displays the measured results to the user through a display for the user to further analyze and record.
[0114] In this embodiment, by integrating singular value decomposition (SVD) and wavelet transform technology, wavelet transform is used to reduce noise on the original data, most of the signal noise is eliminated, and the signal after noise reduction is processed by SVD decomposition. In the SVD decomposition, the peak difference of the covariance matrix is calculated to set the unnecessary mode to zero, and finally a reconstructed and noise-reduced signal is obtained, which can accurately provide time domain and frequency domain information at the same time. Noise reduction is performed in two steps. The first step is to select wavelet functions of different scales according to needs to analyze different frequency characteristics of the signal, and noise reduction processing can be performed at the same time; the second step is to use SVD to further remove detail noise based on the preliminary noise reduction in the first step. It not only adapts to the complex environment in the power system, but also provides an effective means to ensure the accuracy of electric energy metering and the reliability of smart meters. It does not need to convert low-frequency signals into square waves, and is particularly suitable for frequency measurement of low-frequency sinusoidal signals. It has convenient system detection, small hardware overhead and strong anti-interference ability, and can provide accurate and reliable data, thereby improving the detection accuracy of zero-crossing detection.
[0115] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0116] Based on the same inventive concept, the embodiment of the present application also provides a device for implementing the above-mentioned method for implementing the zero-crossing detection of smart meters by integrating SVD and wavelet transform. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method. Therefore, the specific limitations in the embodiments of one or more devices for implementing the zero-crossing detection of smart meters by integrating SVD and wavelet transform provided below can be referred to the limitations of the method for implementing the zero-crossing detection of smart meters by integrating SVD and wavelet transform, which will not be repeated here.
[0117] In an exemplary embodiment, Figure 7 As shown, a smart meter zero-crossing detection device integrating SVD and wavelet transform is provided, comprising: a signal processing module 702, a signal sampling module 704, a signal integration module 706 and a period determination module 708, wherein:
[0118] The signal processing module 702 is used to perform wavelet transform processing and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal; the signal to be detected is a signal collected from an electric energy meter.
[0119] The signal sampling module 704 is used to sample the reconstructed signal according to a preset sampling frequency to obtain a discrete signal.
[0120] The signal integration module 706 is used to filter out a target moment from the candidate moments in the discrete signal, monitor the integration result corresponding to the signal to be detected starting from before the target moment, and determine the zero-crossing time series for the signal to be detected based on the integration result; the candidate moments include the moments corresponding to the zero-crossing points in the discrete signal.
[0121] The period determination module 708 is used to determine the zero-crossing period for the signal to be detected according to the zero-crossing time series; the zero-crossing period is used to determine the zero-crossing phenomenon in the signal to be detected.
[0122] In an exemplary embodiment, the signal integration module 706 is further specifically used to determine an average period based on the moments corresponding to at least two zero-crossing points in the discrete signal; the average period represents the length of time between adjacent zero-crossing points in the discrete signal; and the target moment is determined based on the sum of the product between the average period and a preset period parameter and the moment corresponding to the zero-crossing point.
[0123] In an exemplary embodiment, the signal integration module 706 is also specifically used to determine, when the integration result is equal to zero, whether the signal to be detected has a zero-crossing phenomenon, and take the time between the moment corresponding to the integration result equal to zero and the target moment as the target time; take the sum of the target moment and the target time as the target zero-crossing moment; determine the moment to be analyzed based on the average value between the target moment and the target zero-crossing moment; and sort the moments to be analyzed in a preset order to obtain the zero-crossing time series.
[0124] In an exemplary embodiment, the zero-crossing time series includes at least two moments to be analyzed, and the period determination module 708 is further configured to determine the zero-crossing period according to the difference between adjacent moments to be analyzed in the zero-crossing time series.
[0125] In an exemplary embodiment, the signal processing module 702 is further used to perform wavelet transform processing on the signal to be detected according to a preset wavelet function to obtain a noise reduction signal; perform singular value decomposition processing on the noise reduction signal to obtain a decomposition result; and generate the reconstructed signal according to the decomposition result.
[0126] In an exemplary embodiment, the above-mentioned signal processing module 702 is also specifically used to perform multi-scale convolution processing on the signal to be detected according to the preset wavelet function to obtain at least one layer of transformation results; obtain the wavelet coefficients corresponding to the transformation results; for each layer of the transformation results, when the wavelet coefficient is greater than or equal to the preset coefficient threshold, fix the wavelet coefficient, and when the wavelet coefficient is less than the preset coefficient threshold, set the wavelet coefficient to zero, to obtain a modified transformation result corresponding to the transformation result; perform wavelet inverse transformation processing on the modified transformation result to generate the noise reduction signal.
[0127] Each module in the above-mentioned smart meter zero-crossing detection device integrating SVD and wavelet transform can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0128] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for detecting zero-crossing points of a smart meter that integrates SVD and wavelet transform is realized. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0129] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0132] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0134] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0135] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for detecting zero-crossing points of smart meters by integrating SVD and wavelet transform. It is characterized in that The method comprises: Perform wavelet transform and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal; the signal to be detected is a signal collected from an electric energy meter; Sampling the reconstructed signal according to a preset sampling frequency to obtain a discrete signal; Filtering out a target moment from candidate moments in the discrete signal, monitoring the integration result corresponding to the signal to be detected starting from before the target moment, and determining a zero-crossing time series for the signal to be detected based on the integration result; the candidate moments include moments corresponding to zero-crossing points in the discrete signal; According to the zero-crossing time series, a zero-crossing period for the signal to be detected is determined; the zero-crossing period is used to determine the zero-crossing phenomenon in the signal to be detected.
2. The method according to claim 1, It is characterized in that The step of selecting a target moment from candidate moments in the discrete signal includes: Determine an average period according to the time corresponding to at least two zero-crossing points in the discrete signal; the average period represents the time length between adjacent zero-crossing points in the discrete signal; The target time is determined according to the sum of the product of the average period and the preset period parameter and the time corresponding to the zero-crossing point.
3. The method according to claim 1, It is characterized in that Determining the zero-crossing time series for the signal to be detected according to the integration result includes: When the integration result is equal to zero, it is determined that the signal to be detected has a zero-crossing phenomenon, and the time between the moment corresponding to the integration result equal to zero and the target moment is taken as the target time; The sum of the target time and the target duration is taken as the target zero-crossing time; Determining a time to be analyzed according to an average value between the target time and the target zero-crossing time; The time moments to be analyzed are sorted according to a preset order to obtain the zero-crossing time series.
4. The method according to claim 1, It is characterized in that The zero-crossing time sequence includes at least two moments to be analyzed, and determining the zero-crossing period for the signal to be detected according to the zero-crossing time sequence includes: The zero-crossing period is determined according to the difference between mutually adjacent moments to be analyzed in the zero-crossing time series.
5. The method according to claim 1, It is characterized in that The step of performing wavelet transform and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal comprises: According to a preset wavelet function, the signal to be detected is subjected to wavelet transform processing to obtain a noise reduction signal; Performing singular value decomposition processing on the noise reduction signal to obtain a decomposition result; The reconstructed signal is generated according to the decomposition result.
6. The method according to claim 5, It is characterized in that The step of performing wavelet transform processing on the signal to be detected according to a preset wavelet function to obtain a noise reduction signal comprises: According to the preset wavelet function, multi-scale convolution processing is performed on the signal to be detected to obtain at least one layer of transformation results; Obtaining wavelet coefficients corresponding to the transformation result; For each layer of the transformation result, when the wavelet coefficient is greater than or equal to a preset coefficient threshold, the wavelet coefficient is fixed, and when the wavelet coefficient is less than the preset coefficient threshold, the wavelet coefficient is set to zero, so as to obtain a modified transformation result corresponding to the transformation result; The modified transformation result is subjected to inverse wavelet transformation to generate the noise reduction signal.
7. A smart meter zero-crossing detection device integrating SVD and wavelet transform, It is characterized in that The device comprises: A signal processing module, used for performing wavelet transform processing and singular value decomposition processing on the signal to be detected to obtain a reconstructed signal; the signal to be detected is a signal collected from an electric energy meter; A signal sampling module, used for sampling the reconstructed signal according to a preset sampling frequency to obtain a discrete signal; A signal integration module, used to select a target moment from candidate moments in the discrete signal, monitor the integration result corresponding to the signal to be detected starting from before the target moment, and determine the zero-crossing time series for the signal to be detected according to the integration result; the candidate moment includes the moment corresponding to the zero-crossing point in the discrete signal; The cycle determination module is used to determine the zero-crossing cycle for the signal to be detected according to the zero-crossing time series; the zero-crossing cycle is used to determine the zero-crossing phenomenon in the signal to be detected.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
