Phase difference estimation method, device and equipment for non-ideal sinusoidal voltage signal

By constructing a phase difference estimation model, including preprocessing, signal correction and three-layer nested optimization model, the problem of low measurement accuracy of non-ideal sinusoidal voltage signals is solved, and higher measurement accuracy and wider applicable scenarios are achieved.

CN119829926AActive Publication Date: 2025-04-15NAT UNIV OF DEFENSE TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411994405.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-15
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In the prior art, when measuring the phase difference of non-ideal sinusoidal voltage signals, there are problems with signal distortion sensitivity, limited resolution, and low accuracy caused by noise and nonlinear distortion.

Method used

A phase difference estimation model including preprocessing model, signal correction model and three-layer nested optimization model was constructed. By converting non-ideal sinusoidal voltage signals through the preprocessing model, the signal correction model extracts phase characteristics, and performs phase difference estimation through a three-layer nested optimization model, realizing closed-loop automatic fine-tuning to improve accuracy.

Benefits of technology

It significantly improves the accuracy of phase difference measurement, is suitable for non-ideal sinusoidal voltage signals in various distortion forms, reduces the dependence on artificially designed preprocessing models, and expands the scope of applicable scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829926A_ABST
    Figure CN119829926A_ABST
Patent Text Reader

Abstract

The invention relates to a phase difference estimation method, system and equipment for non-ideal sinusoidal voltage signals. The method comprises the following steps: constructing a phase difference estimation model; and converting the non-ideal sinusoidal voltage signal into an approximately ideal sinusoidal voltage signal through the preprocessing model, inputting the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal as a training sample set into the signal correction model to extract a phase feature, and obtaining an estimated phase feature. Training the signal correction model according to the estimated phase difference features, then correcting the extracted features, outputting an ideal sinusoidal voltage signal, and inputting the ideal sinusoidal voltage signal to the three-layer nested optimization model for phase difference estimation to obtain a phase difference estimated value. And updating training parameters of the signal correction model according to the phase difference estimation value, and performing phase difference estimation by the three-layer nested optimization model according to the updated training parameters. By adopting the method, double advantages of data driving and model optimization are exerted, and high-precision phase difference intelligent estimation of the non-ideal sinusoidal voltage is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of power electronic control technology, and in particular to a method, device and equipment for estimating the phase difference of a non-ideal sinusoidal voltage signal. Background Art

[0002] In power devices, especially in the field of power electronics and power transmission, voltage and current signals usually appear as non-ideal sine waves with various harmonic components. Accurately estimating the phase difference between these signals is crucial for applications such as power factor correction, motor control, and grid stability analysis.

[0003] In the prior art, the most commonly used method for measuring phase difference is to directly use the inverse sine function for calculation. The specific method is: first, the sinusoidal voltage signal to be measured is filtered and conditioned to obtain an approximately ideal sinusoidal waveform; then the instantaneous phase angles of the two sinusoidal voltage signals are calculated respectively, and the difference is the estimated value of the phase difference. This method is simple in principle and has low computational complexity, but there are some defects in directly using the inverse sine function to solve the phase, such as sensitivity to signal distortion and limited resolution, which results in a certain error in the obtained phase. Due to factors such as noise and nonlinear distortion, the measured signal often has various distortions, which makes it difficult to meet the premise of an approximate ideal sinusoidal waveform, thereby affecting the accuracy of the phase difference estimation. Summary of the invention

[0004] Based on this, it is necessary to provide a phase difference estimation method, device and equipment for a non-ideal sinusoidal voltage signal that can improve the phase difference measurement accuracy in order to solve the above technical problems.

[0005] A method for estimating a phase difference of a non-ideal sinusoidal voltage signal, the method comprising:

[0006] Construct a phase difference estimation model. The phase difference estimation model includes: a preprocessing model, a signal correction model, and a three-layer nested optimization model.

[0007] The non-ideal sinusoidal voltage signal is converted into an approximately ideal sinusoidal voltage signal through a preprocessing model, and the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal are input into the signal correction model as training sample sets to extract phase features and obtain estimated phase features.

[0008] The signal correction model is trained according to the estimated phase difference features and a pre-constructed loss function to obtain a trained signal correction model.

[0009] The ideal phase characteristics are obtained through the trained signal correction model. After correcting the ideal phase characteristics, the ideal sinusoidal voltage signal is obtained.

[0010] The ideal sinusoidal voltage signal is input into the three-layer nested optimization model for phase difference estimation to obtain the phase difference estimation value.

[0011] The training parameters of the signal correction model are updated according to the phase difference estimation value, the three-layer nested optimization model is trained according to the updated training parameters to obtain the trained three-layer nested optimization model, and the phase difference is estimated by the trained three-layer nested optimization model.

[0012] A phase difference estimation device for a non-ideal sinusoidal voltage signal, the device comprising:

[0013] The model building module is used to build a phase difference estimation model. The phase difference estimation model includes: a preprocessing model, a signal correction model and a three-layer nested optimization model.

[0014] The estimated phase feature extraction module is used to transform the non-ideal sinusoidal voltage signal into an approximately ideal sinusoidal voltage signal through a preprocessing model, and input the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal as a training sample set into the signal correction model to extract the phase feature and obtain the estimated phase feature.

[0015] The signal correction model training module is used to train the signal correction model according to the estimated phase difference characteristics and the pre-constructed loss function to obtain a trained signal correction model.

[0016] The ideal sinusoidal voltage signal acquisition module is used to obtain the ideal phase feature through the trained signal correction model, and obtain the ideal sinusoidal voltage signal after correcting the ideal phase feature.

[0017] The phase difference estimation value acquisition module is used to input the ideal sinusoidal voltage signal into the three-layer nested optimization model to perform phase difference estimation and obtain the phase difference estimation value.

[0018] The phase difference estimation module is used to update the training parameters of the signal correction model according to the phase difference estimation value, train the three-layer nested optimization model according to the updated training parameters to obtain the trained three-layer nested optimization model, and perform phase difference estimation through the trained three-layer nested optimization model.

[0019] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0020] Construct a phase difference estimation model. The phase difference estimation model includes: a preprocessing model, a signal correction model, and a three-layer nested optimization model.

[0021] The non-ideal sinusoidal voltage signal is converted into an approximately ideal sinusoidal voltage signal through a preprocessing model, and the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal are input into the signal correction model as training sample sets to extract phase features and obtain estimated phase features.

[0022] The signal correction model is trained according to the estimated phase difference features and a pre-constructed loss function to obtain a trained signal correction model.

[0023] The ideal phase characteristics are obtained through the trained signal correction model. After correcting the ideal phase characteristics, the ideal sinusoidal voltage signal is obtained.

[0024] The ideal sinusoidal voltage signal is input into the three-layer nested optimization model for phase difference estimation to obtain the phase difference estimation value.

[0025] The training parameters of the signal correction model are updated according to the phase difference estimation value, the three-layer nested optimization model is trained according to the updated training parameters to obtain the trained three-layer nested optimization model, and the phase difference estimation is performed through the trained three-layer nested optimization model.

[0026] The phase difference estimation method, device and equipment of the non-ideal sinusoidal voltage signal, the constructed phase difference estimation model is suitable for non-ideal sinusoidal voltage signals of various distortion forms, and has strong generalization ability. The signal correction model can automatically learn various distortion laws from a large number of samples, no longer relying on manually designed preprocessing models, and greatly expanding the scope of applicable scenarios. Through the three-layer nested optimization model, the processing parameters of each model link are collaboratively optimized and analyzed to solve the problem of low precision of the direct inverse sine method. At the same time, the closed-loop automatic fine-tuning of the signal correction model continuously optimizes the performance and greatly improves the phase difference measurement accuracy. In addition, the training parameters of the signal correction model are obtained through autonomous training, and the state variables of the three-layer nested optimization model are automatically determined through game strategies, no longer relying on manual tuning parameters, and eliminating subjective experience factors. It can not only solve the existing technology for estimating the phase difference after filtering of non-ideal sinusoidal AC voltage signals, but also effectively improve the phase difference estimation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is a flow chart of a method for estimating a phase difference of a non-ideal sinusoidal voltage signal in one embodiment;

[0028] Figure 2 is a structural block diagram of a phase difference estimation device for a non-ideal sinusoidal voltage signal in one embodiment;

[0029] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0031] In one embodiment, Figure 1 As shown, a phase difference estimation method for a non-ideal sinusoidal voltage signal is provided, comprising the following steps:

[0032] Step 102: construct a phase difference estimation model.

[0033] The phase difference estimation model includes: a preprocessing model, a signal correction model and a three-layer nested optimization model.

[0034] The signal correction model is a neural network model, which adopts a multi-layer perceptron, a convolutional neural network, a recurrent neural network or a combination thereof.

[0035] Step 104, converting the non-ideal sinusoidal voltage signal into an approximately ideal sinusoidal voltage signal through a preprocessing model, inputting the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal into a signal correction model as a training sample set to extract phase features and obtain an estimated phase feature.

[0036] Specifically, the input non-ideal sinusoidal voltage signal is first preprocessed by a preprocessing model, including removing DC components, removing high-frequency noise, and data compensation processing. A high-pass filter is used to remove the DC component of the non-ideal sinusoidal voltage signal, and the cutoff frequency of the high-pass filter is set to the minimum value of the frequency band of the non-ideal sinusoidal voltage signal.

[0037] Furthermore, a low-pass filter is used to remove high-frequency noise, and the passband frequency range of the low-pass filter is determined according to the frequency range of the non-ideal sinusoidal voltage signal. Linear interpolation or polynomial interpolation is used to interpolate the missing points in the valid data segment, and the waveform similarity comparison method is used to replace the data distortion points with normal data. The threshold for distinguishing abnormalities adopts the principle of 3 to 6 times the standard deviation.

[0038] Furthermore, the passband frequency range of the bandpass filter is determined according to the frequency range of the non-ideal sinusoidal voltage signal; the bandpass filter is designed using the window function method, frequency sampling technology, maximum flatness characteristic method or elliptic function method, the filter order is controlled below 20, and a reasonable order is determined by comparison.

[0039] Furthermore, the designed bandpass filter is used to filter the preprocessed non-ideal sinusoidal voltage signal, suppress the DC component and high-frequency noise, retain the fundamental component, and obtain an approximate signal close to the ideal sinusoidal waveform.

[0040] Furthermore, the input of the signal correction model training is the non-ideal sinusoidal voltage signal before filtering and the approximately ideal sinusoidal voltage signal after filtering, and the output of the training is the phase and amplitude characteristics (i.e., the estimated phase characteristics) of the ideal sinusoidal voltage signal corresponding to the approximately ideal sinusoidal voltage signal.

[0041] Step 106: Train the signal correction model according to the estimated phase difference feature and the pre-constructed loss function to obtain a trained signal correction model.

[0042] The pre-constructed loss function needs to comprehensively consider the errors in the two dimensions of phase and amplitude. For the phase dimension, the mean square error (MSE) loss can be used; for the amplitude dimension, the smooth L1 loss can be used to reduce the impact of outliers. The total loss is the weighted sum of the two.

[0043] Specifically, a signal correction model is used to predict the phase and amplitude characteristics of an ideal sinusoidal voltage signal based on a non-ideal signal before filtering and an approximately ideal sinusoidal voltage signal after filtering. A gated recurrent unit or a long short-term memory network structure is used for the signal correction model to capture long-term dependencies in the input sequence.

[0044] Furthermore, a small batch gradient descent method can be used in the training process, and the optimizer can be selected from Adam or RMSProp, etc. The batch size and learning rate need to be adjusted according to the amount of data and model complexity. Generally, the batch size is set to 32 to 512, and the initial value of the learning rate is 0.001 to 0.01. The decay strategy can be used later. To prevent overfitting, regularization strategies such as L2 regularization, dropout, and data augmentation can be introduced during the training process.

[0045] Furthermore, the sample training set needs to cover enough distortion conditions, including phase distortion, amplitude fluctuation, etc., and its label is the corresponding ideal sinusoidal voltage signal phase and amplitude data. During the training process, the changes in training loss and validation loss need to be monitored. When the validation loss no longer decreases for multiple consecutive epochs, the training can be terminated to avoid overfitting. Generally, 100 to 500 epochs are sufficient.

[0046] Step 108, obtaining an ideal phase feature through the trained signal correction model, and obtaining an ideal sinusoidal voltage signal after correcting the ideal phase feature.

[0047] Specifically, after the above training, a signal correction model is obtained that can predict the phase and amplitude of the corresponding ideal sinusoidal voltage signal from the input non-ideal sinusoidal voltage signal. Since there may be a small phase distortion and amplitude offset during the prediction, it is necessary to correct and optimize the phase and amplitude of the ideal sinusoidal voltage signal and the parameters of the signal correction model.

[0048] Furthermore, an adaptive adjustment model is constructed, and the difference between the signal adjusted according to these parameters and the ideal sinusoidal voltage signal is minimized by optimizing the phase offset and amplitude correction parameters. The optimization objective is defined as minimizing the mean square error between the adaptive adjustment model and the known ideal sinusoidal voltage signal, including the amplitude correction parameter, baseline correction amount, initial phase and time-varying phase correction amount. The optimization algorithm is used to solve the problem with the amplitude correction parameter, baseline correction amount, initial phase and time-varying phase correction amount as optimization variables. The optimal parameters obtained by the solution are substituted into the adaptive adjustment model to obtain the corrected ideal sinusoidal voltage signal.

[0049]

[0050] Among them, A is the amplitude correction parameter, B is the baseline correction amount, is the initial phase, is the time-varying phase correction.

[0051] Define the optimization goal as minimizing The mean square error with the known ideal sinusoidal voltage signal y(t):

[0052]

[0053] A, B, and To optimize the variables, an optimization algorithm (such as L-BFGS) is used to solve. Add smoothing constraints to prevent the phase correction from fluctuating too drastically. Smoothing can use a norm penalty term:

[0054]

[0055] Among them, λ is the smoothing coefficient, and the larger the value, the better the smoothness.

[0056] Further, the optimal A, B, Substitute into the adaptive adjustment model to obtain the corrected ideal sinusoidal voltage signal

[0057] Step 110: Input the ideal sinusoidal voltage signal into the three-layer nested optimization model to perform phase difference estimation to obtain a phase difference estimation value.

[0058] Specifically, the repaired ideal sinusoidal voltage signal The main purpose of normalization is to eliminate the influence of the amplitude dimension so that the subsequent phase difference estimation is only related to the phase. The normalization method uses maximum and minimum value normalization:

[0059]

[0060] Among them, yn (t) represents the normalized sinusoidal voltage signal, and Respectively Through this normalization, the signal y_n(t)y n The value range of (t) is mapped to the interval [0, 1].

[0061] Furthermore, using the normalized ideal sinusoidal voltage signal y_n(t)y n (t) is orthogonal, and the phase difference estimation function \phi(\theta,\omega,X)φ(θ,ω,X) is constructed. The ideal sinusoidal voltage signal y(t)=A\cos(\omegat+\phi)y(t)=Acos(ωt+φ) and sin(ωt+φ) are orthogonal, that is:

[0062]

[0063] Among them, TT is the period, \omegaω is the angular frequency, and \phiφ is the initial phase. Using this orthogonal property, we can construct an estimation function of the phase difference.

[0064] Furthermore, suppose the actual measured signal is: y_l(t)=A_1\cos(\omega t+\phi_l)y 1 (t) = A 1 cos(ωt+φ 1 ), the reference signal is: y_2(t)=A_2\cos(\omega t+\phi_2)y 2 (t) = A 2 cos(ωt+φ 2 ), the phase difference between them is \theta = \phi_1-\phi_2θ = φ 1 -φ 2 According to the above orthogonal properties, we have:

[0065]

[0066] Divide the above formula by And y_l(t)y 1 (t)Use the normalized y_n(t)y n (t) is replaced by:

[0067]

[0068] That is, the required phase difference estimation function \phi(\theta, \omega, X)φ(θ, ω, X), where \thetaθ is the phase difference to be estimated, \omegaω is the angular frequency known or to be optimized, and XX is the neural network parameter vector. n (t) is the normalized ideal sinusoidal voltage signal.

[0069] Furthermore, a three-layer nested optimization model is established, including an outer multi-objective optimization, a middle max-min game model and an inner single-objective optimization. The purpose is to optimize the phase difference \thetaθ, angular frequency \omegaω and signal correction model parameters XX so that the deviation between the phase difference estimate \thetaθ and the known expected phase difference value is minimized, and the loss function of the signal correction model is also minimized.

[0070] The outer multi-objective optimization model is as follows:

[0071]

[0072] Among them, f_1f 1 is the phase difference between the estimated value \thetaθ and the expected value \theta_0θ 0 The absolute deviation, f_2f 2 is the loss function value of the trained signal correction model under the current parameter XX\text{loss}(X)loss(X), and the goal is to minimize these two objective functions simultaneously. The constraints include the value range of \thetaθ and \omegaω, and the modulus constraint of the phase difference estimation function \phi(\theta,\omega,X)φ(θ,ω,X).

[0073] The middle layer is the max-min game model, including the upper max-min model and the lower min model

[0074] Upper max-min model:

[0075]

[0076]

[0077] The goal is to minimize the worst-case phase difference estimate absolute error f_1f 1 , where \thetaθ is the decision variable, \omegaω and XX are the opponent variables, and the constraints are the same as above.

[0078] Lower min model:

[0079]

[0080] Here \theta^*θ *is the solution of the upper max-min model, the goal is to give \theta^*θ * When f_1+\lambda f_2f 1 +λf 2 The smallest \omegaω and XX, that is, to find the current \theta^*θ * The best matching \omegaω and XX, \lambdaλ is the weight, and the constraints include the value range of \omegaω, the modulus constraint of the phase difference estimation function, the ordinary constraint of the derivative of \phiφ with respect to \omegaω (to ensure the periodicity of \omegaω), and the value constraint of the neural network loss function.

[0081] The inner layer is a single-objective optimization model:

[0082]

[0083] \text{st}\quad\text{loss}(X)\leq\gammas.t.loss(X)≤γ

[0084] This layer optimizes the signal correction model parameters XX to minimize the loss function. The goal is the same as step S30, and the constraint is the upper limit of the loss function \gammaγ. The optimization process of this three-layer nested structure is as follows: the outer layer optimizes the given initial \theta, \omega, Xθ, ω, X, and the middle layer solves the optimal \omega^*, X^*ω corresponding to this initial value. * , X * The solution is substituted into the outer optimization and repeated until convergence to obtain the global optimal \theta^*, \omega^*, X^*θ * ,ω * , X * The inner layer is for auxiliary optimization, further optimizing XX and outputting the results to the middle layer for use.

[0085] Step 112, update the training parameters of the signal correction model according to the phase difference estimation value, train the three-layer nested optimization model according to the updated training parameters to obtain the trained three-layer nested optimization model, and perform phase difference estimation through the trained three-layer nested optimization model.

[0086] Specifically, we obtain the optimal solution \theta^*, \omega^*, X^*θ * ,ω * , X * , \theta^*θ * Output as the phase difference estimate. And according to \theta^*θ *The deviation from the known expected phase difference is used to update the neural network training data, loss function, and regularization parameters, and the three-layer nested optimization model is re-executed to form an optimization closed loop.

[0087] Furthermore, the global optimal values ​​\theta, \omega, Xθ, ω, X obtained in the previous iteration step are substituted into the three-layer nested optimization model, and multiple rounds of iterative solutions are performed in the following way:

[0088] 1) Fix \theta, \omegaθ, ω, and use inner optimization to solve the optimal X^*X * :

[0089]

[0090] \text{st}\quad\text{loss}(X)\leq\gammas.t.loss(X)≤γ

[0091] 2) X^*X * Substitute into the lower min model:

[0092]

[0093] Get \omega^*ω * . Among them, ∈ is the lower layer min model constraint The threshold in is used to limit the range of the derivative of \phiφ to \omegaω, and γ is the upper limit of the neural network loss function.

[0094] 3). Set \theta, \omega^*, X^*θ, ω * , X * Substitute into the upper max-min model:

[0095] Solve to get the new \theta^*θ * , with \omega^*ω * 、X^*X * Create a new optimal solution.

[0096] 4) Repeat steps 1), 2) and 3) until convergence to obtain the global optimal \theta^*, \omega^*, X^*θ * ,ω * , X * . When the global optimal solution \theta^*θ is obtained * Then, it is output as the phase difference estimation value.

[0097] Further, according to \theta^*θ *The phase difference with the known expected phase \theta_0θ 0 Deviation \Delta = |\theta^*-\theta_0|Δ = |θ * -θ 0 |, the signal correction model is updated in the following way to form an optimization closed loop:

[0098] 1) Update the training data set:

[0099] Based on the original training set, a new batch of training samples with phase difference distortion close to \DeltaΔ are redesigned according to the value of \DeltaΔ and added to the training set. At the same time, some old training samples with large differences from \DeltaΔ can be eliminated to improve the pertinence of the data set.

[0100] 2) Update the loss function:

[0101] Based on the value of \DeltaΔ, the weight of the phase error term in the loss function is adaptively adjusted. For example, when \DeltaΔ is large, the weight of the phase error term can be appropriately increased so that the signal correction model can focus more on optimizing the phase error in the next round of training.

[0102] 3) Update regularization strategy:

[0103] For large \DeltaΔ values, the regularization strength can be appropriately increased (such as increasing the L2 regularization coefficient) to reduce model complexity and reduce the risk of overfitting. At the same time, regularization methods such as dropout can be used to improve the generalization ability of the model.

[0104] After the above update, a new round of training is performed on the signal correction model to obtain new model parameters X'X'. With X'X' as the new initial value, the three-layer nested optimization solution of step S80 is performed again to obtain new \theta^*, \omega^*, X^*θ * ,ω * , X * The solution is obtained and the \DeltaΔ value is updated. This iteration is repeated until \DeltaΔ meets the specified convergence threshold or the maximum number of iterations is reached. This closed-loop update strategy can continuously optimize the signal correction model so that its output results gradually approach the ideal state, thereby improving the final phase difference estimation accuracy. By alternating between model self-adjustment and optimization, the estimation error is continuously reduced, and finally a high-precision phase difference estimation value is obtained.

[0105] In the above-mentioned phase difference estimation method for non-ideal sinusoidal voltage signals, the constructed phase difference estimation model is applicable to non-ideal sinusoidal voltage signals of various distortion forms and has strong generalization ability. The signal correction model can automatically learn various distortion laws from a large number of samples, no longer relying on manually designed preprocessing models, and greatly expanding the scope of applicable scenarios. Through the three-layer nested optimization model, the processing parameters of each model link are collaboratively optimized and analyzed to solve the problem of low precision of the direct inverse sine method. At the same time, the closed-loop automatic fine-tuning of the signal correction model continuously optimizes the performance and greatly improves the phase difference measurement accuracy. In addition, the training parameters of the signal correction model are obtained through autonomous training, and the state variables of the three-layer nested optimization model are automatically determined through game strategies, no longer relying on manual tuning parameters, and eliminating subjective experience factors. It can not only solve the existing technology for estimating the phase difference after filtering of non-ideal sinusoidal AC voltage signals, but also effectively improve the phase difference estimation accuracy. The problem that the measured signal often has various distortions due to sensitivity to signal distortion, limited resolution, noise, nonlinear distortion and other factors, resulting in a certain error in the obtained phase, can also be solved.

[0106] In one of the embodiments, a non-ideal sinusoidal voltage signal is obtained through a preprocessing model, and after the non-ideal sinusoidal voltage signal is subjected to signal cleaning, it is filtered through a bandpass filter to obtain an approximately ideal sinusoidal voltage signal.

[0107] It is worth mentioning that the bandpass filter can be designed using the following method:

[0108] 1) Window function method: determine the ideal passband frequency response according to the required passband frequency range, and then truncate it into a finite impulse response by adding a window function. The window function can be a rectangular window, a Hamming window, a Blackman window, etc. The window function selection affects the passband ripple and the stopband attenuation. The window length is inversely proportional to the main ceramic ripple and the slope of the transition band, and it is usually necessary to balance the main ceramic ripple and the stopband attenuation.

[0109] 2) Frequency sampling technology: design the ideal frequency response according to the required bandpass frequency range, and then obtain the filter impulse response coefficient through inverse transformation. Frequency sampling technology includes direct sampling method, linear normalization method and Chebyshev weighting method. Chebyshev weighting method can obtain better amplitude-frequency characteristics, but at the same order, the phase linearity is poor.

[0110] 3) Maximum flatness characteristic method: The design method is to solve the filter transfer function that can achieve the maximum flat frequency response amplitude characteristic for a given passband frequency range and passband ripple requirements. The maximum flatness characteristic can ensure that the amplitude-frequency response within the passband is basically flat.

[0111] 4) Elliptic function method, based on the digital realization of analog filters. It can design filters with very steep pass / stop characteristics and narrow transition bands, but there will be large ripples and phase nonlinearity.

[0112] The order of the bandpass filter is proportional to the frequency selection performance. The higher the order, the steeper the transition band and the better the stopband attenuation. However, too high an order will also bring problems such as large amount of calculation and noise transmission. It is generally recommended to control the filter order below 20. Usually, the order can be selected according to the actual needs after simulation comparison. After passing through the above bandpass filter, the high-frequency noise and DC component of the non-ideal sinusoidal voltage signal are effectively suppressed, and the fundamental component is filtered and retained to obtain an approximate ideal sinusoidal waveform.

[0113] In one embodiment, the three-layer nested optimization model includes: an outer multi-objective optimization model, a middle max-min game model, and an inner single-objective optimization model. After normalizing the ideal sinusoidal voltage signal, the orthogonal feature is obtained:

[0114]

[0115] Among them, y(t) is the ideal sinusoidal voltage signal, T is the time period, \omegaω is the angular frequency of the ideal sinusoidal voltage signal, and \phiφ is the initial phase of the ideal sinusoidal voltage signal. The phase difference estimation function is constructed based on the orthogonal characteristics:

[0116]

[0117] Among them, yn(t)y n (t) is the normalized sinusoidal voltage signal, is an ideal sinusoidal voltage signal, and They are ideal sinusoidal voltage signals The minimum and maximum values ​​of \phi(\theta, \omega, X)φ(θ, ω, X) are the phase difference estimation functions, φ 2 is the phase of the ideal sinusoidal voltage signal, θ min is the minimum value range of the phase difference parameter \thetaθ, θ max is the maximum value range of the phase difference parameter \thetaθ, ω min is the minimum value range of the angular frequency parameter \omegaω, ω max is the maximum value range of the angular frequency parameter \omegaω;

[0118] Minimize the ideal phase characteristics based on the phase difference estimation function and the outer multi-objective optimization model:

[0119]

[0120] Among them, f 1 is the phase difference between the estimated value \thetaθ and the expected value θ 0 The absolute deviation, f 2 is the loss function value of the signal correction model under the current parameter X\text{loss}(X)loss(X), ω is the angular frequency of the ideal sinusoidal voltage signal, \thetaθ is the phase difference estimate, and \phi(\theta, \omaga, X)φ(θ, ω, X) is the phase difference estimation function. The minimized ideal phase feature is used to obtain the minimum phase difference estimate, the minimum angular frequency matched by the minimum phase difference estimate, and the correction parameters of the signal correction model through the middle-level max-min game model. The correction parameters are used to obtain the optimal correction parameters through the inner-level single-objective optimization model, and the training parameters of the signal correction model are updated according to the optimal correction parameters. The three-layer nested optimization model is trained according to the updated training parameters to obtain a trained three-layer nested optimization model.

[0121] It is worth noting that the reason for using maximum and minimum value normalization is that it can keep the periodicity and phase characteristics of the signal unchanged, while removing the amplitude information. Compared with other methods such as zero mean normalization, this normalization method is more suitable for periodic signal processing. Based on the orthogonal integration method, it is possible to avoid directly using trigonometric functions such as arc sine to estimate the phase difference, thereby reducing the estimation error. Through this three-layer nested optimization model, the phase difference estimation value \thetaθ, angular frequency \omegaω and neural network parameter XX can be optimized at the same time, so that the absolute deviation of the phase difference estimation and the loss function of the signal correction model are both optimal, thereby obtaining the most accurate phase difference estimation. Among them, game optimization helps to deal with the coupling relationship between \theta, \omega, Xθ, ω, and X, and the inner layer auxiliary optimization improves the optimization degree of XX. In the iterative optimization process, intelligent optimization algorithms such as particle swarm and ant swarm can be used, supplemented by some mathematical optimization methods (such as interior point method, alternating direction multiplier method, etc.) to improve the optimization efficiency and robustness.

[0122] In one embodiment, the estimated phase feature includes: a phase value to be optimized and an amplitude value to be optimized. The ideal phase feature includes: an ideal phase value and an ideal amplitude value.

[0123] In one of the embodiments, a trained signal correction model obtains an ideal phase feature, and adaptive filtering compensation is used to correct the ideal phase feature to obtain an ideal sinusoidal voltage signal corresponding to the corrected ideal phase feature.

[0124] It is worth noting that the signal correction model can adopt a multilayer perceptron (MLP), a convolutional neural network (CNN), a recurrent neural network (RNN) or a combination thereof. The present embodiment adopts an RNN or CNN+RNN hybrid structure. The input includes two parts: a non-ideal sinusoidal voltage signal before filtering and an approximately ideal sinusoidal voltage signal after filtering. Because the non-ideal signal before filtering contains all distortion information such as phase and amplitude distortion, and the approximately ideal signal after filtering is used as a training label to guide the signal correction model to learn the repair operation. The output is the phase and amplitude feature data of the ideal sinusoidal voltage signal corresponding to the approximately ideal sinusoidal voltage signal. The phase feature can be expressed as a time series, and the amplitude feature can be set as an amplitude constant.

[0125] In one embodiment, adaptive filtering compensation is used to correct the ideal phase characteristic, and an ideal sinusoidal voltage signal corresponding to the corrected ideal phase characteristic is obtained:

[0126]

[0127] in, is an ideal sinusoidal voltage signal, A is the ideal amplitude correction parameter, B is the baseline correction value, is the phase value to be optimized, is the time-varying phase correction.

[0128] It is worth noting that this correction method can effectively correct the amplitude distortion and phase distortion errors caused by the neural network prediction, obtain a near-ideal sinusoidal waveform, and lay the foundation for the subsequent accurate estimation of the phase difference. In addition, the existing filtering methods (such as Kalman filtering, adaptive filtering, etc.) can also be used to smooth the predicted signal, and then adaptively optimize and compensate to improve efficiency. It can be seen that by optimizing the amplitude and phase correction parameters, the neural network prediction results are finely adjusted, and the ideal sinusoidal waveform data is obtained, which provides a reliable basic signal source for the subsequent minimization of the phase difference estimation error.

[0129] In one embodiment, a non-ideal sinusoidal voltage signal is obtained through a preprocessing model, and a high-pass filter is used to remove the DC component of the non-ideal sinusoidal voltage signal to obtain a non-ideal sinusoidal voltage signal to be denoised. A low-pass filter is used to remove high-frequency noise from the non-ideal sinusoidal voltage signal to be denoised, and linear interpolation is used to interpolate the missing points of the valid data segment of the non-ideal sinusoidal voltage signal to be denoised, so as to obtain a non-ideal sinusoidal voltage signal to be cleaned. Waveform similarity is used to replace the data distortion points of the non-ideal sinusoidal voltage signal to be cleaned with normal data to obtain a cleaned non-ideal sinusoidal voltage signal. A bandpass filter is used to suppress the DC component and high-frequency noise of the cleaned non-ideal sinusoidal voltage signal, and the fundamental component of the cleaned non-ideal sinusoidal voltage signal is retained to obtain an approximately ideal sinusoidal voltage signal.

[0130] It is worth noting that a high-pass filter can be used to remove the DC component. The cutoff frequency of the filter is usually the minimum value of the frequency band of the non-ideal sinusoidal voltage signal. For example, when the sinusoidal frequency range is 50Hz to 100Hz, the cutoff frequency of the high-pass filter can be set to 45Hz. A digital filter can be used for the high-pass filter, and the filter design method can be a window function method, a frequency sampling method, a maximum flat characteristic method, etc. A low-pass filter can be used to remove high-frequency noise. The passband frequency range of the low-pass filter is determined according to the frequency range of the non-ideal sinusoidal voltage signal, and the amplitude in the passband is as flat as possible. When the sinusoidal frequency range is 50Hz to 100Hz, the cutoff frequency of the low-pass filter can be set to 105Hz. A digital filter can also be used, and the design method is the same as that of the high-pass filter. Data compensation mainly processes abnormal points such as missing points and distorted points in the valid data segment. For the missing points in the valid data segment, linear interpolation, polynomial interpolation or wavelet transform can be used for interpolation. For data distortion points, they can be replaced with normal data by waveform similarity comparison and other methods. The threshold setting is affected by factors such as the signal-to-noise ratio and the effective data length. Usually, the threshold can be set based on 3 to 6 times the standard deviation.

[0131] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0132] In one embodiment, Figure 2 As shown, a phase difference estimation device for a non-ideal sinusoidal voltage signal is provided, comprising: a model building module 202, an estimated phase feature extraction module 204, a signal correction model training module 206, an ideal sinusoidal voltage signal acquisition module 208, a phase difference estimation value acquisition module 210 and a phase difference estimation module 212, wherein:

[0133] The model building module 202 is used to build a phase difference estimation model. The phase difference estimation model includes: a preprocessing model, a signal correction model and a three-layer nested optimization model.

[0134] The estimated phase feature extraction module 204 is used to convert the non-ideal sinusoidal voltage signal into an approximately ideal sinusoidal voltage signal through a preprocessing model, and input the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal as a training sample set into the signal correction model to extract the phase feature to obtain the estimated phase feature.

[0135] The signal correction model training module 206 is used to train the signal correction model according to the estimated phase difference feature and the pre-constructed loss function to obtain a trained signal correction model.

[0136] The ideal sinusoidal voltage signal acquisition module 208 is used to acquire the ideal phase feature through the trained signal correction model, and obtain the ideal sinusoidal voltage signal after correcting the ideal phase feature.

[0137] The phase difference estimation value acquisition module 210 is used to input the ideal sinusoidal voltage signal into the three-layer nested optimization model to perform phase difference estimation and obtain a phase difference estimation value.

[0138] The phase difference estimation module 212 is used to update the training parameters of the signal correction model according to the phase difference estimation value, train the three-layer nested optimization model according to the updated training parameters to obtain the trained three-layer nested optimization model, and perform phase difference estimation through the trained three-layer nested optimization model.

[0139] For the specific definition of the phase difference estimation device for non-ideal sinusoidal voltage signals, please refer to the definition of the phase difference estimation method for non-ideal sinusoidal voltage signals in the above text, which will not be repeated here. Each module in the above-mentioned phase difference estimation device for non-ideal sinusoidal voltage signals can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0140] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a device bus. Among them, 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 device and a computer program. The internal memory provides an environment for the operation of the operating device and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a phase difference estimation method of a non-ideal sinusoidal voltage signal is implemented. The display screen of the computer device 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 covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0141] Those skilled in the art will understand that Figure 2-3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention 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.

[0142] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0143] Construct a phase difference estimation model. The phase difference estimation model includes: a preprocessing model, a signal correction model, and a three-layer nested optimization model.

[0144] The non-ideal sinusoidal voltage signal is converted into an approximately ideal sinusoidal voltage signal through a preprocessing model, and the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal are input into the signal correction model as training sample sets to extract phase features and obtain estimated phase features.

[0145] The signal correction model is trained according to the estimated phase difference features and a pre-constructed loss function to obtain a trained signal correction model.

[0146] The ideal phase characteristics are obtained through the trained signal correction model. After correcting the ideal phase characteristics, the ideal sinusoidal voltage signal is obtained.

[0147] The ideal sinusoidal voltage signal is input into the three-layer nested optimization model for phase difference estimation to obtain the phase difference estimation value.

[0148] The training parameters of the signal correction model are updated according to the phase difference estimation value, the three-layer nested optimization model is trained according to the updated training parameters to obtain the trained three-layer nested optimization model, and the phase difference is estimated by the trained three-layer nested optimization model.

[0149] 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 memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0150] The technical features of the above embodiments may be combined arbitrarily. 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.

[0151] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for estimating the phase difference of a non-ideal sinusoidal voltage signal, characterized in that: The method comprises: Constructing a phase difference estimation model; the phase difference estimation model includes: a preprocessing model, a signal correction model and a three-layer nested optimization model; The non-ideal sinusoidal voltage signal is converted into an approximately ideal sinusoidal voltage signal through the preprocessing model, and the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal are input into the signal correction model as a training sample set to extract phase features, so as to obtain an estimated phase feature; The signal correction model is trained according to the estimated phase difference feature and a pre-constructed loss function to obtain a trained signal correction model; An ideal phase feature is obtained by using a trained signal correction model, and an ideal sinusoidal voltage signal is obtained after correcting the ideal phase feature; Inputting the ideal sinusoidal voltage signal into the three-layer nested optimization model to perform phase difference estimation to obtain a phase difference estimation value; The training parameters of the signal correction model are updated according to the phase difference estimation value, the three-layer nested optimization model is trained according to the updated training parameters to obtain the trained three-layer nested optimization model, and the phase difference estimation is performed through the trained three-layer nested optimization model.

2. The method according to claim 1, characterized in that The non-ideal sinusoidal voltage signal is converted into an approximately ideal sinusoidal voltage signal by the preprocessing model, including: A non-ideal sinusoidal voltage signal is obtained through the preprocessing model, and after the non-ideal sinusoidal voltage signal is subjected to signal cleaning, it is filtered through a bandpass filter to obtain an approximately ideal sinusoidal voltage signal.

3. The method according to claim 1, characterized in that The three-layer nested optimization model includes: an outer multi-objective optimization model, a middle max-min game model, and an inner single-objective optimization model; Inputting the ideal sinusoidal voltage signal into the three-layer nested optimization model to perform phase difference estimation to obtain a phase difference estimation value, updating the training parameters of the signal correction model according to the phase difference estimation value, training the three-layer nested optimization model according to the updated training parameters to obtain the trained three-layer nested optimization model, including: After normalizing the ideal sinusoidal voltage signal, the orthogonal feature is obtained: Where y(t) is the ideal sinusoidal voltage signal, T is the time period, \omegaω is the angular frequency of the ideal sinusoidal voltage signal, and \phiφ is the initial phase of the ideal sinusoidal voltage signal; Construct a phase difference estimation function based on the orthogonal features: Among them, y_n(t)y n (t) is the normalized sinusoidal voltage signal, is an ideal sinusoidal voltage signal, and They are ideal sinusoidal voltage signals The minimum and maximum values ​​of \phi(\theta, \omega, X)φ(θ, ω, X) are phase difference estimation functions, and φ2 is the phase of the approximate ideal sinusoidal voltage signal; Minimize the ideal phase characteristic according to the phase difference estimation function and the outer multi-objective optimization model: f2(θ,ω,X)=loss(X) stθ∈[θ min ,the max ],ω∈[ω min ,the max ]||(θ, X)||≤1 Where f1 is the absolute deviation between the phase difference estimate \thetaθ and the expected value θ0, f2 is the loss function value of the signal correction model under the current parameter X\text{loss}(X)loss(X), ω is the angular frequency of the ideal sinusoidal voltage signal, \thetaθ is the phase difference estimate, \phi(\theta,\omege,X)φ(θ,ω,X) is the phase difference estimation function, θ min is the minimum value range of the phase difference parameter \thetaθ, θ max is the maximum value range of the phase difference parameter \thetaθ, ω min is the minimum value range of the angular frequency parameter \omegaω, ω max is the maximum value range of the angular frequency parameter \omegaω; The minimized ideal phase feature obtains a minimum phase difference estimate, a minimum angular frequency matched by the minimum phase difference estimate, and correction parameters of a signal correction model through a middle-level max-min game model; The correction parameters obtain the optimal correction parameters through the inner single-objective optimization model, the training parameters of the signal correction model are updated according to the optimal correction parameters, and the three-layer nested optimization model is trained according to the updated training parameters to obtain the trained three-layer nested optimization model.

4. The method according to any one of claims 1 to 3, characterized in that: The estimated phase characteristics include: a phase value to be optimized and an amplitude value to be optimized; The ideal phase characteristics include: an ideal phase value and an ideal amplitude value.

5. The method according to claim 4, characterized in that The ideal phase feature is obtained by using the trained signal correction model, and after correcting the ideal phase feature, an ideal sinusoidal voltage signal is obtained, including: The ideal phase feature is obtained through the trained signal correction model, and the ideal phase feature is corrected by adaptive filtering compensation to obtain an ideal sinusoidal voltage signal corresponding to the corrected ideal phase feature.

6. The method according to claim 5, characterized in that Adopting adaptive filtering compensation to correct the ideal phase characteristic to obtain an ideal sinusoidal voltage signal corresponding to the corrected ideal phase characteristic, including: Adaptive filtering compensation is used to correct the ideal phase characteristic, and an ideal sinusoidal voltage signal corresponding to the corrected ideal phase characteristic is obtained: in, is an ideal sinusoidal voltage signal, A is the ideal amplitude correction parameter, B is the baseline correction value, is the phase value to be optimized, is the time-varying phase correction.

7. The method according to claim 6, characterized in that The non-ideal sinusoidal voltage signal is obtained by the preprocessing model, and the non-ideal sinusoidal voltage signal is subjected to signal net processing and then filtered by a bandpass filter to obtain an approximately ideal sinusoidal voltage signal, including: Acquire a non-ideal sinusoidal voltage signal through the preprocessing model, and use a high-pass filter to remove the DC component of the non-ideal sinusoidal voltage signal to obtain a non-ideal sinusoidal voltage signal to be denoised; Using a low-pass filter to remove high-frequency noise from the non-ideal sinusoidal voltage signal to be denoised, and using linear interpolation to interpolate missing points of the valid data segment of the non-ideal sinusoidal voltage signal to be denoised, to obtain the non-ideal sinusoidal voltage signal to be cleaned; Using waveform similarity to replace the data distortion points of the non-ideal sinusoidal voltage signal to be cleaned with normal data to obtain the non-ideal sinusoidal voltage signal to be cleaned; The bandpass filter is used to suppress the DC component and high-frequency noise of the net processed non-ideal sinusoidal voltage signal respectively, and the fundamental component of the net processed non-ideal sinusoidal voltage signal is retained to obtain an approximately ideal sinusoidal voltage signal.

8. A phase difference estimation device for a non-ideal sinusoidal voltage signal, characterized in that: The device comprises: A model building module, used to build a phase difference estimation model; the phase difference estimation model includes: a preprocessing model, a signal correction model and a three-layer nested optimization model; An estimated phase feature extraction module is used to convert the non-ideal sinusoidal voltage signal into an approximately ideal sinusoidal voltage signal through the preprocessing model, and input the non-ideal sinusoidal voltage signal and the approximately ideal sinusoidal voltage signal as a training sample set into the signal correction model to extract phase features, so as to obtain an estimated phase feature; A signal correction model training module, used to train the signal correction model according to the estimated phase difference feature and a pre-constructed loss function to obtain a trained signal correction model; An ideal sinusoidal voltage signal acquisition module is used to acquire an ideal phase feature through a trained signal correction model, and obtain an ideal sinusoidal voltage signal after correcting the ideal phase feature; A phase difference estimation value acquisition module, used for inputting the ideal sinusoidal voltage signal into the three-layer nested optimization model to perform phase difference estimation to obtain a phase difference estimation value; A phase difference estimation module is used to update the training parameters of the signal correction model according to the phase difference estimation value, train the three-layer nested optimization model according to the updated training parameters to obtain the trained three-layer nested optimization model, and perform phase difference estimation through the trained three-layer nested optimization model.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Under-Nyquist sampling and parameter measuring method for non-ideal multi-exponential attenuation sinusoidal signals

    CN112595889A

  • LFM signal parameter estimation method under influence of sine nonlinear interference

    CN116827738A

  • Incremental learning-based power supply quality evaluation method and system

    CN119204428A