An electric energy metering method and system based on parallel double metering channel detection

By employing a parallel dual-metering channel detection method, combined with time alignment and range selection, the problem of error accumulation during channel switching in dual-range energy metering equipment is solved, achieving high-precision energy metering and adapting to the wide dynamic range requirements of new energy signals.

CN122631941APending Publication Date: 2026-08-25STATE GRID SHANDONG ELECTRIC POWER CO MARKETING SERVICE CENT (MEASURING CENT)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611130914.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

Existing dual-range power metering equipment is prone to missing power characteristic bands when switching detection channels, leading to error accumulation and affecting the accuracy of power characteristic fluctuation detection.

Method used

A parallel dual-metering channel detection method is adopted. Through time alignment processing and amplitude analysis, the range is selected by combining the power data signal band. The first ADC channel and the second ADC channel are used to process the high-range and low-range signals respectively. Accurate metering values ​​are generated by time deviation calibration, amplitude gain calibration and offset calibration parameters.

Benefits of technology

It achieves wide dynamic range power metering, adapts to the dynamic range requirements of new energy signals, improves the accuracy of power metering, and reduces errors caused by inherent deviations between channels and signal clipping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122631941A_ABST
    Figure CN122631941A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of electric energy detection, and provides an electric energy metering method and system based on parallel double metering channel detection, which divides the obtained to-be-detected signal into first input signals and second input signals with equal impedance; according to the first input signals and the second input signals, and a parallel preset first channel and a second channel, first detection data and second detection data with a value range higher than the first detection data are determined; through time alignment processing and target digital value sequence extraction considering the first physical quantity amplitude, the error caused by the inherent deviation between channels, unreasonable determination of switching points and signal clipping is reduced, the problem of the influence of the error accumulation of multiple switching on the electric energy characteristic fluctuation detection accuracy is solved, the range selection is carried out based on the parallel detection channel and the electric energy data signal band, the electric energy metering with a wide dynamic range is realized, the wide dynamic range demand of new energy signals can be adapted, and the electric energy metering accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electrical energy detection technology, and particularly relates to an electrical energy metering method and system based on parallel dual-metering channel detection. Background Technology

[0002] Current electricity metering devices are mainly divided into high-range electricity metering devices, low-range electricity metering devices, and dual-range electricity metering devices. Dual-range electricity metering devices are achieved by setting up high-range ADC (analog-to-digital converter) channels and low-range ADC channels, and switching the detection channels according to the detected electricity characteristic bands through a switching mechanism.

[0003] However, the dual-range detection method based on detection channel switching requires the power metering equipment to have high detection accuracy in order to detect and identify different fluctuations. When switching ADC detection channels, the power characteristic bands are easily missing. Specifically, due to inherent deviations between channels, unreasonable determination of switching points, signal clipping or distortion, the cumulative error caused by multiple switching when detecting power data with multiple frequency variations affects the accuracy of detecting power characteristic fluctuations. Summary of the Invention

[0004] To address the aforementioned problems, this invention proposes a power metering method and system based on parallel dual-metering channel detection. By employing time alignment processing and extracting the target digital value sequence considering the amplitude of the first physical quantity, this invention reduces errors caused by inherent channel deviations, unreasonable switching point determination, and signal clipping. It also solves the problem of the cumulative error from multiple switching operations affecting the accuracy of power characteristic fluctuation detection. Based on parallel detection channels and combined with power data signal band range selection, it achieves wide dynamic range power metering, adapting to the wide dynamic range requirements of new energy signals and improving the accuracy of power metering.

[0005] To achieve the above objectives, the present invention is implemented through the following technical solution: In a first aspect, the present invention provides an energy metering method based on parallel dual-metering channel detection, comprising: The acquired signal to be detected is divided into a first input signal and a second input signal with equal impedance. Based on the first input signal and the second input signal, as well as the first channel and the second channel preset in parallel, a first detection data and a second detection data with a value range higher than the first detection data are determined; The first detection data and the second detection data are time-aligned by a preset time deviation calibration parameter, and the first detection data and the second detection data are converted into a first physical quantity and a second physical quantity. Based on the amplitude of the first physical quantity, a first range selection signal of the first physical quantity within a unit time is determined by a first preset threshold. Based on the first range selection signal, a first target digital value sequence is extracted within the first physical quantity. Based on the first target digital value sequence, a second target digital value sequence is extracted from the second physical quantity. A measurement value is generated by combining the first target digital value sequence and the second target digital value sequence.

[0006] Furthermore, a comparative analysis is performed on the first and second raw output data corresponding to the first and second channels to determine the time deviation calibration parameters, amplitude gain calibration parameters, and offset calibration parameters between the first and second channels.

[0007] Furthermore, the determination of the time deviation calibration parameter, the amplitude gain calibration parameter, and the offset calibration parameter includes: analyzing the response sequences of the first channel and the second channel to the same sinusoidal dynamic signal based on the first original output data and the second original output data, determining the phase difference fixed delay data of the first channel and the second channel based on the cross-correlation algorithm, and obtaining the time deviation calibration parameter; extracting stable output code values ​​based on multiple static DC voltages from the first original output data and the second original output data, and determining the amplitude gain calibration parameter and the offset calibration parameter by least squares linear regression fitting.

[0008] Furthermore, the switching between the first physical quantity and the second physical quantity includes: performing linear transformation on the first detection data and the second detection data respectively according to the pre-stored amplitude gain calibration parameters and offset calibration parameters to obtain a first preliminary voltage value sequence of the first detection data and a second preliminary voltage value sequence of the second detection data; Based on the pre-stored time deviation calibration parameters, the second preliminary voltage value sequence is delayed and compensated by a digital fractional delay filter, so that the second preliminary voltage value sequence is aligned with the first preliminary voltage value sequence on the time axis, thus obtaining the first physical quantity and the second physical quantity.

[0009] Furthermore, the extraction of the first target digital value sequence includes: setting a first preset threshold and a second preset threshold, setting a first range selection signal in combination with the first preset threshold and the first physical quantity, and adjusting the first range selection signal with a detection step of unit time; If the current first range selection signal is to select the high range, and the amplitude of the first physical quantity is continuously lower than the second preset threshold, then the first range selection signal is switched to select the low range; if the amplitude of the first physical quantity is greater than or equal to the second preset threshold, then the high range selection state is maintained. If the current first range selection signal is set to select a low range, and the amplitude of the first physical quantity is continuously higher than the first preset threshold, then the first range selection signal is switched to select a high range; if the amplitude of the first physical quantity is less than or equal to the first preset threshold, then the low range selection state is maintained.

[0010] Furthermore, setting the first preset threshold and the second preset threshold includes: using the mapping value of the full-scale range of the second channel to the full-scale range of the first channel as a reference value, setting the first preset threshold within a first preset value range of the reference value, and setting the second preset threshold within a second preset value range of the reference value; the first preset value range is greater than the second preset value range.

[0011] Furthermore, the step of generating a measurement value by combining the first target digital value sequence and the second target digital value sequence includes: smoothing the splicing position of the first target digital value sequence and the second target digital value sequence through weighted fusion. ; in, These are time-varying weighting coefficients; In the first Each sampling point time; The first target digital value sequence is the first One value; The first target digital value sequence is the first Values.

[0012] Furthermore, regarding the weighting coefficients Dynamic adjustment is achieved using a cosine window nonlinear gradual adjustment strategy: ; ; in, For the transition window length, The sampling frequency; It is the fundamental frequency of the power signal; The global index of the starting sampling point where the switching occurs.

[0013] Furthermore, the amplitude of the second physical quantity is analyzed in real time, and the second range selection signal of the second physical quantity is detected within a unit time according to the second preset threshold; the first range selection signal is compared with the second range selection signal, and if the first range selection signal is inconsistent with the second range selection signal, the final range selection signal is generated according to the preset selection strategy.

[0014] Furthermore, the preset selection strategy includes: when the amplitude of the signal to be detected is within the hysteresis interval between the first preset threshold and the second preset threshold, the first range selection signal is selected as the final range selection signal; when it is detected that the value of the second physical quantity has not reached saturation under the condition of the first range selection signal, the second range selection signal is selected as the final range selection signal.

[0015] Secondly, the present invention also provides an energy metering system based on parallel dual-metering channel detection, comprising: The data acquisition module is configured to divide the acquired signal to be detected into a first input signal and a second input signal with equal impedance. The initial detection module is configured to: determine first detection data and second detection data with a value range higher than the first detection data based on the first input signal and the second input signal, as well as the first channel and the second channel preset in parallel. The normalization processing module is configured to: perform time alignment processing on the first detection data and the second detection data using a preset time deviation calibration parameter, and convert the first detection data and the second detection data into a first physical quantity and a second physical quantity; The threshold analysis module is configured to: determine a first range selection signal of the first physical quantity within a unit time based on the amplitude of the first physical quantity and a first preset threshold; extract a first target digital value sequence within the first physical quantity based on the first range selection signal; and extract a second target digital value sequence from the second physical quantity based on the first target digital value sequence. The data output module is configured to generate a measurement value by combining the first target digital value sequence and the second target digital value sequence.

[0016] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the energy metering method based on parallel dual-metering channel detection described in the first aspect.

[0017] Fourthly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the program to implement the steps of the energy metering method based on parallel dual-metering channel detection described in the first aspect.

[0018] Fifthly, the present invention also provides a computer program product, the computer program product comprising a computer program, which, when executed by a processor, implements the steps of the energy metering method based on parallel dual-metering channel detection described in the first aspect.

[0019] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention first divides the acquired signal to be detected into a first input signal and a second input signal with equal impedance. Based on the first and second input signals, and a first and second channel preset in parallel, a first detection data and a second detection data with a value range higher than the first detection data are determined. Then, the first and second detection data are time-aligned using a preset time deviation calibration parameter, converting the first and second detection data into a first physical quantity and a second physical quantity. Based on the amplitude of the first physical quantity, a first range selection signal for the first physical quantity within a unit time is determined using a first preset threshold. Based on the first range selection signal, the first physical quantity is extracted within the first physical quantity. A first target digital value sequence is used; a second target digital value sequence is extracted from the second physical quantity based on the first target digital value sequence; finally, a measurement value is generated by combining the first target digital value sequence and the second target digital value sequence; through time alignment processing and considering the extraction of the target digital value sequence based on the amplitude of the first physical quantity, the errors caused by inherent deviations between channels, unreasonable determination of switching points, and signal clipping are reduced, solving the problem of the impact of multiple switching error accumulation on the accuracy of power characteristic fluctuation detection. Based on parallel detection channels and combined with power data signal band range selection, a wide dynamic range power metering is realized, which can adapt to the wide dynamic range requirements of new energy signals and improve the accuracy of power metering. Attached Figure Description

[0020] The accompanying drawings, which form part of this embodiment, are used to provide a further understanding of this embodiment. The illustrative embodiments and their descriptions are used to explain this embodiment and do not constitute an improper limitation of this embodiment.

[0021] Figure 1 This is a flowchart of the method in Embodiment 1 of the present invention; Figure 2 This is a circuit schematic diagram of Embodiment 1 of the present invention; Figure 3This is a flowchart illustrating the calibration process for high-range and low-range detection data in Embodiment 1 of the present invention. Figure 4 This is a schematic diagram of the range selection strategy adjustment process in Embodiment 1 of the present invention; Figure 5 This is a schematic diagram of the system in Embodiment 2 of the present invention; Among them, 100 is the distributor; 200 is the first ADC channel; and 300 is the second ADC channel. Detailed Implementation

[0022] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0023] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0024] Example 1: As the existing energy structure moves towards low-carbon development, new energy power generation methods such as wind power, hydropower, and photovoltaic power are used to supply power to the power grid. However, due to the strong randomness and volatility of new energy power generation methods, the stability of power transmission in the power grid is insufficient, meaning that the characteristics of the power frequency band fluctuate significantly. Current power metering devices are mainly divided into high-range power metering devices, low-range power metering devices, and dual-range power metering devices. Existing dual-range power metering devices use a switching mechanism to switch between high-range and low-range ADC channels based on the detected power frequency band, with a switching mechanism that requires the power metering device to have high detection accuracy to detect and identify different fluctuations. When switching ADC detection channels, the power frequency band is easily missed. When detecting power data with multiple frequency variations, the accumulation of errors caused by multiple switching affects the accuracy of detecting power frequency fluctuations.

[0025] To solve the above problems, such as Figure 1 and Figure 2As shown, this embodiment provides a power metering method based on parallel dual-metering channel detection. The power device is constructed based on a first channel (hereinafter referred to as the first ADC channel 200) and a second channel (hereinafter referred to as the second ADC channel 300) configured in parallel. The first ADC channel 200 is a high-range detection channel, and the second ADC channel 300 is a low-range detection channel. The detection range of the first ADC channel 200 is 10V~1000V. The first ADC channel 200 is used to acquire power signals with a large amplitude range. This channel typically has a high input voltage range and low gain to avoid saturation distortion when high-amplitude signals are input, thereby ensuring signal integrity.

[0026] The detection range of the second ADC channel 300 is 1mV to 100V. This second ADC channel 300 is used to acquire electrical signals with a small amplitude range. This channel typically has a low input voltage range and high gain to improve the detection sensitivity and resolution of weak signals, thereby capturing detailed information about the signal.

[0027] The power device also includes a distributor 100, which is used to distribute the signal to be detected into multiple signals according to a preset ratio or method. In this embodiment, a one-to-two distributor 100 is used to divide the signal to be detected into two sets of input signals with equal impedance, so that the detection signal can be detected through the first ADC channel 200 and the second ADC channel 300.

[0028] The method in this embodiment constructs a power device based on a first ADC channel and a second ADC channel configured in parallel. It divides the signal using a distributor, performs time alignment and range selection, and achieves wide dynamic range power metering. This effectively adapts to the wide dynamic range requirements of new energy signals, avoids signal saturation and quantization noise problems, and improves the accuracy of power metering. The method includes: S11. Based on the divider 100, the signal to be detected is divided into a first input signal and a second input signal with equal impedance. The first input signal is sent to the first ADC channel 200 to obtain the first detection data (hereinafter referred to as high-range detection data). The second input signal is sent to the second ADC channel 300 to obtain the second detection data (hereinafter referred to as low-range detection data).

[0029] The distributor 100 can be a Wilkinson power divider, which has the characteristics of in-phase output and high isolation. After the input signal arrives at the node, two transmission lines with the same physical length and impedance are used to connect the two output ports of the distributor 100, so that the signal to be detected after passing through the distributor 100 can be divided into a first input signal and a second input signal with equal signal magnitude.

[0030] Since the physical and electrical lengths of the two transmission lines are exactly the same, the delay generated by the signals passing through them is also the same, ensuring that the two output signals are in phase. This allows the first ADC channel 200 and the second ADC channel 300 of the power device to achieve high-precision time alignment, so as to improve the detection accuracy of the signal to be detected by combining the first ADC channel 200 and the second ADC channel 300.

[0031] The distributor 100 is equipped with an isolation resistor R connected between the two output ports. Interference signals transmitted in reverse from either output port will be absorbed by the other port through this resistor, without being reflected back to the input port or crosstalked to the other output port. This ensures the independence of the operation of the first ADC channel 200 and the second ADC channel 300, that is, the first ADC channel 200 and the second ADC channel 300 can independently and synchronously detect power data.

[0032] S12. The high-range detection data and the low-range detection data are time-aligned using pre-stored time deviation calibration parameters, and the high-range detection data and the low-range detection data are converted into a first physical quantity (hereinafter referred to as the high-range physical quantity) and a second physical quantity (hereinafter referred to as the low-range physical quantity).

[0033] Optionally, a standard test signal is input to the first ADC channel 200 and the second ADC channel 300 of the power device to synchronously acquire the first raw output data of the first ADC channel 200 and the second raw output data of the second ADC channel 300. By inputting the standard test signal to the first ADC channel 200 and the second ADC channel 300 of the power device, a known and stable input reference data can be provided for the parallel first ADC channel 200 and the second ADC channel 300 of the power device, so as to evaluate and calibrate the performance differences between the channels.

[0034] By inputting standard test signals, the signal characteristics under actual working conditions can be simulated, while ensuring the accuracy and repeatability of the signal source, providing reliable input conditions for subsequent data comparison and analysis.

[0035] Based on the first and second raw output data, a data comparison analysis is performed to calculate the time deviation calibration parameters, amplitude gain calibration parameters, and offset calibration parameters between the first ADC channel 200 and the second ADC channel 300. The first ADC channel 200 and the second ADC channel 300 are then subjected to signal detection analysis using a standard test signal to correct the error between the two detection channels. Key parameters for correcting the differences between channels are quantified and generated, thereby eliminating or reducing the inherent deviation between channels when performing subsequent power data detection, thus improving the accuracy of the measurement.

[0036] Specifically, the step of performing data comparison analysis based on the first original output data and the second original output data to calculate the time deviation calibration parameter, amplitude gain calibration parameter, and offset calibration parameter between the first ADC channel 200 and the second ADC channel 300 includes: Based on the first and second original output data, analyze the response sequences of the first ADC channel 200 and the second ADC channel 300 to the same sinusoidal dynamic signal. Calculate the phase difference fixed delay data of the first ADC channel 200 and the second ADC channel 300 based on the cross-correlation algorithm to obtain the time deviation calibration parameter. Specifically, the calculation process of the time deviation calibration parameter is as follows: Based on the same sinusoidal dynamic signal input to the first ADC channel 200 and the second ADC channel 300, the data collected by the first ADC channel 200 and the second ADC channel 300 are denoted as follows: and ,right and Perform preprocessing operations such as DC removal and windowing.

[0037] Calculate cross-correlation: Calculate and Discrete cross-correlation function , Indicates delay: ; in, For discrete correlation functions, For the first ADC channel 200 Second test data, This refers to the detection data of the second ADC channel 300 during the nth detection corresponding to the first ADC channel 200. This is the acquisition time delay for the first ADC channel 200 and the second ADC channel 300.

[0038] Due to the cross-correlation function exist The peak value is reached when the sample offset corresponds to the actual time difference between the two signals. This is determined based on the detection data. The maximum value point corresponding to , recorded as The It is the integer multiple of the sampling point delay between two channel signals.

[0039] right exist Interpolation is performed in the vicinity (e.g., parabolic interpolation) to obtain a deviation with a precision higher than that of one sampling period, thereby finding a more accurate peak location. .

[0040] The time deviation calibration parameters are as follows: ,in, It is the sampling frequency.

[0041] The time deviation calibration parameter can also be obtained by fitting the detection data of the first ADC channel 200 and the second ADC channel 300 with a sine function, and by comparing the fitted phase angles. and To calculate the time difference: ,in, It tests the signal frequency.

[0042] Stable output code values ​​based on multiple static DC voltages are extracted from the first and second original output data. The optimal linear conversion coefficient is then obtained through least-squares linear regression fitting. Amplitude gain calibration parameters and offset calibration parameters are acquired. Given a specific input static DC voltage value and its corresponding stable output code value, the line that best represents the trend of these data points is output. The slope and intercept of this line are the "optimal linear conversion coefficients." The slope reflects the gain characteristics, while the intercept reflects the offset characteristics. Specifically, the slope of the optimal line obtained through least-squares linear regression fitting is the amplitude gain calibration coefficient, and the intercept of the optimal line is the offset calibration coefficient.

[0043] Based on the analysis of the first and second original output data, the response sequences of the first ADC channel 200 and the second ADC channel 300 to the same sinusoidal dynamic signal are obtained, thereby obtaining the specific output performance of the first ADC channel 200 and the second ADC channel 300 when receiving the same dynamic signal. This reflects the real-time response of each ADC channel to the input signal and includes dynamic characteristic information such as the inherent time delay and phase shift of the channel. This allows for the correction of the detection data of the first ADC channel 200 and the second ADC channel 300 to reduce the detection error between the two sets of parallel detection channels, thereby improving the detection accuracy of the power detection data.

[0044] As a specific implementation method, the electricity metering method can be calibrated according to the following steps: First, to generate a standard test signal, a high-precision arbitrary waveform generator, such as the Keysight 33500B series, can be used, which can output a 50Hz sine wave signal with adjustable amplitude, as well as multiple stable DC voltage signals. The output of the waveform generator is connected to the input terminal of the power distributor 100 of the power device to ensure that both the first and second input signals receive the same standard test signal. During the synchronous acquisition phase, the digital signal processor (DSP) inside the power device, such as the TIC2000 series, can be configured with its timer module to generate a precise synchronous sampling clock, which simultaneously triggers the first ADC channel 200 and the second ADC channel 300 to perform data detection and conversion. In this embodiment, the sampling rate can be set to 10kHz to ensure that the two channels simultaneously complete analog-to-digital conversion in each sampling period and store the converted first and second raw output data in the internal RAM. During data comparison and analysis, the DSP can execute a cross-correlation algorithm to calculate the phase difference between the output signals of the two channels, and can calculate the difference in the peak position of the cross-correlation function of the output sine waves of the two channels, thereby determining the time deviation. Meanwhile, by performing linear regression analysis on the output data of multiple collected DC voltage signals, and by fitting the output code values ​​corresponding to multiple DC inputs using the least squares method, the slope and intercept of the linear transformation equation are obtained, thereby acquiring the amplitude gain calibration parameters and offset calibration parameters.

[0045] Specifically, Figure 3 This invention illustrates a flowchart of the calibration processing for high-range and low-range detection data in an embodiment of the invention. Step S12 includes: S121. Based on the pre-stored amplitude gain calibration parameters and offset calibration parameters, perform linear transformation on the high-range detection data and the low-range detection data respectively to obtain a first preliminary voltage value sequence of the high-range detection data and a second preliminary voltage value sequence of the low-range detection data; adjust based on the pre-stored amplitude gain calibration parameters and offset calibration parameters, correct the gain difference between the first ADC channel 200 and the second ADC channel 300 during signal amplification or conversion based on the amplitude gain calibration parameters, and correct the DC offset that may exist between the first ADC channel 200 and the second ADC channel 300 at zero input based on the offset calibration parameters.

[0046] S122. Based on pre-stored time deviation calibration parameters, a digital fractional delay filter is used to compensate for the delay of the second preliminary voltage value sequence, aligning the second preliminary voltage value sequence with the first preliminary voltage value sequence on the time axis, and outputting high-range and low-range physical quantities. The pre-stored time deviation calibration parameters are obtained by analyzing and processing the same detection signal using the first ADC channel 200 and the second ADC channel 300. High-range detection data refers to the original digital sampled value sequence obtained by analog-to-digital conversion of the first input signal by the first ADC channel 200, typically a binary or hexadecimal digital code stream output by the ADC chip, representing the voltage or current amplitude at a specific sampling moment. Low-range detection data refers to the original digital sampled value sequence obtained by analog-to-digital conversion of the second input signal by the second ADC channel 300. Similar to high-range detection data, it is a digital code stream output by the ADC chip, but due to its lower range, it has higher resolution for weak signals.

[0047] Time alignment processing is used to eliminate or compensate for time asynchrony between high-range and low-range detection data caused by factors such as sampling clock and channel delay, so that they are precisely aligned on the time axis. This allows for data extraction and splicing of the detection data from the first ADC channel 200 and the second ADC channel 300 according to the fluctuations of the detection signal, thereby achieving accurate detection of power data.

[0048] The first preliminary voltage value sequence is the voltage value sequence of high-range detection data after amplitude gain calibration and offset calibration, that is, the detection output data of the first ADC channel 200. The second preliminary voltage value sequence is the voltage value sequence of low-range detection data after amplitude gain calibration and offset calibration, that is, the detection output data of the second ADC channel 300.

[0049] S13. Analyze the amplitude of the high-range physical quantity in real time, and detect the first range selection signal of the high-range physical quantity within a unit time according to the first preset threshold, and extract the first target digital value sequence within the high-range physical quantity according to the first range selection signal.

[0050] Specifically, Figure 4 This diagram illustrates the range selection strategy adjustment process in an embodiment of the present invention. Step S13 includes: S131. Set a first preset threshold and a second preset threshold, and combine the first preset threshold and the high-range physical quantity to set a first range selection signal, adjusting the first range selection signal with a detection step size of unit time. Specifically, setting the first preset threshold and the second preset threshold includes: Using the mapping value of the full-scale range of the second ADC channel 300 to the full-scale range of the first ADC channel 200 as a reference value, a first preset threshold is set within the range of 0.7 to 0.8 of the reference value, and a second preset threshold is set within the range of 0.1 to 0.3 of the reference value.

[0051] The first and second preset thresholds are reference values ​​used to define the conditions for range switching. They define at what level the amplitude of the high-range physical quantity should trigger range switching or maintain the current range. These thresholds can be determined based on the characteristics of the ADC channel of the power device, the dynamic range of the signal to be detected, and the desired measurement accuracy. For example, they can be set empirically based on the full-scale range of the first ADC channel 200 and the effective measurement range of the second ADC channel 300, or by statistically analyzing signals under typical operating conditions to determine the critical point that can effectively distinguish between high and low range signals. The first range selection signal is a control signal indicating whether a high or low range should be used.

[0052] Using unit time as the detection step size means that the system does not continuously make range switching judgments, but periodically evaluates the amplitude of the high-range physical quantity at fixed time intervals and adjusts the first range selection signal accordingly. This periodic detection mechanism can effectively avoid frequent and unstable range switching caused by instantaneous signal fluctuations, thereby improving the stability of the system.

[0053] S132. If the current first range selection signal is to select the high range, and the amplitude of the high range physical quantity is continuously lower than the second preset threshold, then the first range selection signal is switched to select the low range. If the amplitude of the high-range physical quantity is greater than or equal to the second preset threshold, the high-range selection state is maintained.

[0054] S133. If the current first range selection signal is to select a low range, and the amplitude of the high range physical quantity is continuously higher than the first preset threshold, then the first range selection signal is switched to select a high range. If the amplitude of the high-range physical quantity is less than or equal to the first preset threshold, the low-range selection state is maintained.

[0055] Specifically, based on the mapping value of the full-amplitude range of the second ADC channel 300 onto the full-amplitude range of the first ADC channel 200, the first preset threshold is set to 0.7 times this benchmark value, and the second preset threshold is set to 0.2 times this benchmark value. In actual operation, the system will detect the step size in units of, for example, 10 milliseconds, to monitor the amplitude of high-range physical quantities in real time.

[0056] Initially, the system is assumed to be in a high-range selection state. If the amplitude of the high-range physical quantity begins to decrease and remains below the second preset threshold for five consecutive detection steps (i.e., 50 milliseconds), the system determines that the signal has entered the low-amplitude region, and the first range selection signal will switch from "select high range" to "select low range". If the amplitude of the high-range physical quantity is greater than or equal to the second preset threshold at any time, the system will maintain the high-range selection state, even if there was a previous downward trend, to ensure accurate measurement of the high-amplitude signal. Now, assuming the system is in a low-range selection state, if the amplitude of the high-range physical quantity begins to increase and remains above the first preset threshold for five consecutive detection steps, the first range selection signal will still switch to low range selection according to the scheme's settings. This prevents erroneous switching when the signal amplitude briefly increases but has not yet reached the condition for a stable switch to high range, or in certain specific application scenarios where the signal amplitude is high but its impact on the detection state of the second ADC channel 300 is significant, prioritizing the use of low-range detection data ensures the continuity and stability of the detection data. If the amplitude of the high-range physical quantity is less than or equal to the first preset threshold at any time, the system will maintain the low-range selection state to ensure accurate measurement of low-amplitude signals. In this way, the system can achieve stable and timely range switching based on the dynamic changes in signal amplitude, combined with preset thresholds and continuity judgments, thereby ensuring optimal measurement accuracy under different signal strengths.

[0057] A first preset threshold is set within the range of 0.7 to 0.8 of the reference value. This first preset threshold can be used as a trigger condition for switching from a high-range to a low-range measurement. The first preset threshold is an upper limit threshold; when the amplitude of the high-range physical quantity drops below this threshold, the system tends to switch to the more sensitive low-range channel. Setting this threshold between 70% and 80% of the reference value aims to provide a reasonable switching point, ensuring timely switching when the signal amplitude is sufficiently small and the accuracy of the high-range channel may decrease, while avoiding premature switching that could lead to saturation of the low-range channel when the signal amplitude is still high. For example, the specific threshold can be selected as 0.75 times the reference value as the first preset threshold based on the system's requirements for switching smoothness and response speed, through experimental testing or simulation analysis.

[0058] A second preset threshold is set within the range of 0.1 to 0.3 of the reference value. This second preset threshold can be used as a trigger condition for switching from a low range to a high range. The second preset threshold is a lower limit; when the amplitude of the high-range physical quantity rises above this threshold, the system tends to switch to the higher-range channel with a larger range. Setting this threshold between 10% and 30% of the reference value aims to provide a safe switching point, ensuring timely switching back to the high range when the signal amplitude increases and the low-range channel may face saturation risk, preventing signal clipping or distortion. Simultaneously, it forms a certain hysteresis range with the first preset threshold, avoiding frequent switching when the signal fluctuates near the threshold. For example, the specific threshold can be selected as 0.2 times the reference value, based on the system's saturation margin for the low-range channel and the minimum measurable signal requirement for the high-range channel.

[0059] Based on the dynamic changes in the comprehensive detection data of the first preset threshold and the second preset threshold, the detection data of the first ADC channel 200 and the second ADC channel 300 are combined to output highly accurate power detection data.

[0060] S14. Extract a second target digital value sequence from the low-range physical quantity based on the first target digital value sequence, and generate a measurement value by combining the first target digital value sequence and the second target digital value sequence. Specifically, step S14 includes: The concatenation position of the first target digital value sequence and the second target digital value sequence is smoothed by weighted fusion. The calculation formula for the smoothing process is as follows: ; in, These are time-varying weighting coefficients that are applied during the switch from a high range to a low range. Gradually changing from 1 to 0; during the switch from a low range to a high range. Gradually changing from 0 to 1, In the first The final output physical quantity value at each sampling point time. The first target digital value sequence is the first One value, The first target digital value sequence is the first Values.

[0061] Weighted fusion is a signal processing technique that assigns different weights to multiple input signals and then combines the weighted signals to generate a smooth output signal. In this embodiment, by adjusting the data transition at the splicing position between the detection data of the first ADC channel 200 and the detection data of the second ADC channel 300 through weighted fusion processing, the accuracy of the splicing point between the detection data of the first ADC channel 200 and the second ADC channel 300 can be improved.

[0062] This smoothing process ensures that the output physical quantity values ​​can transition continuously and naturally near the range switching point, improving the accuracy of power data detection.

[0063] In the At each sampling point, the sequence of the first target digital values ​​from the high-range detection channel will be... and the second target digital value sequence from the low-range detection channel Weighted combinations are performed to generate the final output physical quantity values. The weighting coefficients This reflects the contribution ratio of the first target numerical value sequence and the second target numerical value sequence. And the weighting coefficient The weighting coefficients are time-varying, i.e., the weighting coefficients. The value of will be dynamically adjusted as time or sampling points change. When selecting a segment of the first target digital value sequence and a segment of the second target digital value sequence to combine, the time-varying weight coefficient allows the data of the two segments to transition naturally, reducing the abruptness of splicing between the first and second target digital value sequences. This gradual process can continue for a certain number of sampling points, forming a transition interval, thereby effectively avoiding abrupt changes in the detection data.

[0064] In some embodiments, the weighting coefficients A cosine window nonlinear gradual adjustment strategy is adopted for dynamic adjustment: when the system determines that a range switch is needed based on the first range selection signal, a fixed transition window length is set. (Unit: number of sampling points). The value is determined by the sampling frequency. and fundamental frequency of power signals Confirm, optional For example, when , hour, There are 100 sampling points. Let the global index of the starting sampling point where the switching occurs be 0. Define relative offset ,in, The formula for calculating the weight coefficient within the transition window is: ; in, This is the global time-series index of the sampling point, with a value that is a non-negative integer, representing the nth sampling point since system startup or a certain reference time. One sampling point; This is the global index of the starting sampling point where the range switching behavior occurs, i.e., the first sampling point of the transition window; The relative offset is defined as follows: This represents the offset of the current sampling point from the switching start point, with a value range of [value range missing]. ; The length of the transition window, expressed in the number of sampling points, represents the total number of sampling points traversed from the start of the handover to the completion of the handover. For time-varying weighting coefficients, it means that in the first... At each sampling point, the weight of high-range data in the output fusion result ranges from [value range missing]. ; The sampling frequency of the system is expressed in Hz, representing the number of samples collected by the analog-to-digital converter per second. This is the fundamental frequency of the electrical signal, measured in Hz. For power frequency systems, it is typically 50Hz or 60Hz. For the system in the first The final output of the physical quantity of electrical energy (such as the instantaneous voltage value) at each sampling point time. For the first target digital value sequence (high-range channel) in the th The physical quantity values ​​at each sampling point; For the second target digital value sequence (low range channel) in the 1st The physical quantity values ​​of each sampling point.

[0065] Depending on the direction being switched, The gradual change process is as follows: When switching from a high range to a low range: from Gradient to Substitute into the fusion formula It can be seen that high-range data is used at the beginning and low-range data is used at the end.

[0066] When switching from a low range to a high range: Should from Gradient to At this time, it can be ordered At the beginning (Using high-range data throughout), at the end (Using only low-range data).

[0067] The cosine window function changes gradually at both ends of the window and changes more rapidly in the middle. Compared with linear gradual change, it can further suppress high-frequency harmonic components introduced by weight abrupt changes and reduce interference with harmonic energy metering.

[0068] The output value This represents the electrical energy metering result obtained at a specific sampling time n after weighted fusion and smoothing processing. It is a continuous and accurate physical quantity provided by the system, reflecting the true amplitude of the signal to be detected. This final output value reflects the complementary advantages of high-range and low-range data. It utilizes the wide dynamic range of the high-range data at high amplitudes and the high resolution of the low-range data at low amplitudes, and the smoothing process ensures seamless connection throughout the entire measurement range.

[0069] Specifically, the electricity metering method further includes: The amplitude of the low-range physical quantity is analyzed in real time, and the second range selection signal of the low-range physical quantity is detected within a unit time according to the second preset threshold. The first range selection signal is compared with the second range selection signal. If the first range selection signal and the second range selection signal are inconsistent, a final range selection signal is generated according to a preset selection strategy. By analyzing the amplitude of the low-range physical quantity, a second preset threshold is set to assist the first preset threshold in range selection, thereby realizing feedback correction of the range selection adjustment of the detection data and effectively improving the accuracy of range selection.

[0070] Real-time analysis of the amplitude of the low-range physical quantity aims to continuously monitor the intensity of the physical quantity signal acquired by the low-range detection channel, enabling the acquisition of instantaneous dynamic information of the low-range signal and providing an independent basis for subsequent range selection. Specifically, a digital signal processor can continuously sample the low-range physical quantity and calculate its instantaneous amplitude or effective value. Detecting the second range selection signal of the low-range physical quantity within a unit time according to a second preset threshold aims to independently generate a range selection signal by comparing the amplitude of the low-range physical quantity with a preset judgment standard. This helps to evaluate the applicability of the low-range channel under current signal conditions. Specifically, the preset selection strategy includes: When the amplitude of the signal to be detected is within the hysteresis interval between the first preset threshold and the second preset threshold, the first range selection signal is selected as the final range selection signal. When it is detected that the low-range physical quantity value has not reached saturation under the first range selection signal condition, the second range selection signal is selected as the final range selection signal.

[0071] For example, a comparator circuit or software logic module can be used to compare the amplitude of the low-range physical quantity monitored in real time with the second preset threshold. When the amplitude exceeds or falls below the threshold, a corresponding second range selection signal is generated. Alternatively, a state machine or control algorithm can be designed to continuously monitor the amplitude of the low-range physical quantity within a specific unit time window and determine the state of the second range selection signal based on whether it remains stably above or below the second preset threshold.

[0072] The purpose of comparing the first range selection signal with the second range selection signal is to cross-validate the range selection signal generated by the high range channel and the range selection signal generated by the low range channel. Its function is to promptly detect any inconsistencies or conflicts that may exist between the two independent channels in range selection judgment.

[0073] In this embodiment, logic gates or conditional statements in software can be used to check whether the two range selection signals are in the same state. If the first range selection signal and the second range selection signal are inconsistent, the purpose of generating the final range selection signal according to a preset selection strategy is to make a final range selection decision based on a set of pre-defined rules when the two range selection signals conflict. This ensures that the system can make a stable and optimal range switching when the signal changes dynamically or when there is uncertainty.

[0074] This invention further improves the energy metering method by introducing real-time analysis of low-range physical quantities. In the basic energy metering method, the signal to be detected is divided into a first input signal and a second input signal with equal impedance by the distributor 100, and sent to the first ADC channel 200 and the second ADC channel 300 respectively to obtain high-range detection data and low-range detection data. The high-range detection channel and the low-range detection channel are used for synchronous detection to obtain two sets of detection data for the same energy data with different detection ranges. After time alignment and linear transformation, the high-range physical quantity and the low-range physical quantity are obtained.

[0075] By combining the first ADC channel 200 and the second ADC channel 300, which are set in parallel, in an equal impedance shunt manner, and introducing pre-stored time deviation calibration parameters for time alignment processing, full-range dynamic coverage of high-amplitude fluctuating signals and extremely weak signals is achieved.

[0076] Specifically, the initial detection module uses distributor 100 to ensure that the signal to be detected is divided by equal impedance, avoiding signal reflection or attenuation caused by impedance mismatch, and providing a synchronous raw data foundation for the dual channels; the normalization processing module performs precise time alignment of the dual-channel data based on pre-stored time deviation calibration parameters, eliminating timing errors introduced by hardware differences, and ensuring that the high-range physical quantity and the low-range physical quantity are strictly synchronized on the time axis; the threshold analysis module analyzes the amplitude of the high-range physical quantity in real time and dynamically generates the first range selection signal according to the preset threshold, intelligently identifying the range of signal amplitude changes, and guiding the extraction of the first target digital value sequence; the data output module accurately extracts the second target digital value sequence from the low-range physical quantity according to the range state indicated by the first target digital value sequence, realizing seamless fusion of dual-channel data.

[0077] This technical solution effectively solves the problem that single-range analog-to-digital converters cannot simultaneously and accurately acquire high-amplitude fluctuating signals and extremely weak signals through the coordinated operation of the aforementioned modules. Since the distributor 100 equally impedance-splits the signal to be detected to the first ADC channel 200 and the second ADC channel 300, the high-range detection channel can completely capture high-amplitude signals without saturation distortion, while the low-range detection channel can finely analyze weak signals to improve resolution. The application of time deviation calibration parameters ensures the time consistency of the dual-channel data, providing a reliable basis for subsequent range switching. The dynamic range selection mechanism of the threshold analysis module enables the system to adapt to signal changes, prioritizing high-range data in high-amplitude regions to ensure signal integrity, and switching to low-range data in weak signal regions to optimize accuracy. Finally, the data output module generates measurement values ​​through sequence extraction and fusion, avoiding the abrupt errors that occur during range switching in traditional single-channel solutions.

[0078] In summary, this embodiment uses a distributor to send the signal to be detected to two parallel detection channels to acquire high-range and low-range detection data. Through time alignment processing, the high-range and low-range detection data are converted into high-range and low-range physical quantities. The amplitude of the high-range physical quantity is analyzed in real time, and a first range selection signal is set based on a first preset threshold. A first target digital value sequence and a second target digital value sequence are extracted based on the first range selection signal. A metering value is generated by combining the first target digital value sequence and the second target digital value sequence. By constructing an energy device based on parallel detection channels and selecting the range based on the energy data signal band, a wide dynamic range energy metering is achieved, which can adapt to the wide dynamic range requirements of new energy signals and improve the accuracy of energy metering.

[0079] Example 2: This embodiment provides an energy metering system based on parallel dual-metering channel detection, including: The data acquisition module 10 is configured to divide the acquired signal to be detected into a first input signal and a second input signal with equal impedance. The initial detection module 20 is configured to: determine first detection data and second detection data with a value range higher than the first detection data based on the first input signal and the second input signal, as well as the first channel and the second channel preset in parallel. Normalization processing module 30 is configured to: perform time alignment processing on the first detection data and the second detection data using preset time deviation calibration parameters, and convert the first detection data and the second detection data into a first physical quantity and a second physical quantity; The threshold analysis module 40 is configured to: determine a first range selection signal of the first physical quantity within a unit time based on the amplitude of the first physical quantity and a first preset threshold; extract a first target digital value sequence within the first physical quantity based on the first range selection signal; and extract a second target digital value sequence from the second physical quantity based on the first target digital value sequence. The data output module 50 is configured to generate a measurement value by combining the first target digital value sequence and the second target digital value sequence.

[0080] By combining the first and second ADC channels, which are set in parallel, with equal impedance shunting and introducing pre-stored time deviation calibration parameters for time alignment, full-range dynamic coverage of high-amplitude fluctuating signals and extremely weak signals is achieved. Specifically, the initial detection module 20 uses a distributor to ensure that the signal to be detected is divided by equal impedance, avoiding signal reflection or attenuation caused by impedance mismatch, and providing a synchronous raw data basis for the dual channels; the normalization processing module 30 performs precise time alignment of the dual-channel data based on the pre-stored time deviation calibration parameters, eliminating timing errors introduced by hardware differences, and ensuring that the high-range physical quantity and the low-range physical quantity are strictly synchronized on the time axis; the threshold analysis module 40 analyzes the amplitude of the high-range physical quantity in real time and dynamically generates a first range selection signal according to a preset threshold, intelligently identifying the signal amplitude change range and guiding the extraction of the first target digital value sequence; the data output module 50 accurately extracts the second target digital value sequence from the low-range physical quantity according to the range state indicated by the first target digital value sequence, realizing seamless fusion of dual-channel data.

[0081] This embodiment effectively solves the problem that a single-range analog-to-digital converter cannot simultaneously and accurately acquire high-amplitude fluctuating signals and extremely weak signals through the coordinated operation of the aforementioned modules. Because the distributor equally impedes the signal to be detected and branches it to the first and second ADC channels, the high-range detection channel can completely capture high-amplitude signals without saturation distortion, while the low-range detection channel can finely analyze weak signals to improve resolution. The application of time deviation calibration parameters ensures the time consistency of the dual-channel data, providing a reliable basis for subsequent range switching. The dynamic range selection mechanism of the threshold analysis module enables the system to adapt to signal changes, prioritizing high-range data in high-amplitude regions to ensure signal integrity, and switching to low-range data in weak signal regions to optimize accuracy. Finally, the data output module generates measurement values ​​through sequence extraction and fusion, avoiding abrupt errors that occur during range switching in traditional dual-channel detection schemes.

[0082] This embodiment constructs a power device based on a first ADC channel and a second ADC channel set in parallel. By dividing the signal through a distributor, performing time alignment and range selection, it achieves power metering with a wide dynamic range. It can effectively adapt to the wide dynamic range requirements of new energy signals, avoid signal saturation and quantization noise problems, and improve the accuracy of power metering.

[0083] The operating method of the system is the same as that of the energy metering method based on parallel dual-metering channel detection in Embodiment 1, and the method includes: S11. Based on the divider 100, the signal to be detected is divided into a first input signal and a second input signal with equal impedance. The first input signal is sent to the first ADC channel 200 to obtain the first detection data (hereinafter referred to as high-range detection data). The second input signal is sent to the second ADC channel 300 to obtain the second detection data (hereinafter referred to as low-range detection data).

[0084] The distributor 100 can be a Wilkinson power divider, which has the characteristics of in-phase output and high isolation. After the input signal arrives at the node, two transmission lines with the same physical length and impedance are used to connect the two output ports of the distributor 100, so that the signal to be detected after passing through the distributor 100 can be divided into a first input signal and a second input signal with equal signal magnitude.

[0085] Since the physical and electrical lengths of the two transmission lines are exactly the same, the delay generated by the signals passing through them is also the same, ensuring that the two output signals are in phase. This allows the first ADC channel 200 and the second ADC channel 300 of the power device to achieve high-precision time alignment, so as to improve the detection accuracy of the signal to be detected by combining the first ADC channel 200 and the second ADC channel 300.

[0086] The distributor 100 is equipped with an isolation resistor R connected between the two output ports. Interference signals transmitted in reverse from either output port will be absorbed by the other port through this resistor, without being reflected back to the input port or crosstalked to the other output port. This ensures the independence of the operation of the first ADC channel 200 and the second ADC channel 300, that is, the first ADC channel 200 and the second ADC channel 300 can independently and synchronously detect power data.

[0087] S12. The high-range detection data and the low-range detection data are time-aligned using pre-stored time deviation calibration parameters, and the high-range detection data and the low-range detection data are converted into a first physical quantity (hereinafter referred to as the high-range physical quantity) and a second physical quantity (hereinafter referred to as the low-range physical quantity).

[0088] Optionally, a standard test signal is input to the first ADC channel 200 and the second ADC channel 300 of the power device to synchronously acquire the first raw output data of the first ADC channel 200 and the second raw output data of the second ADC channel 300. By inputting the standard test signal to the first ADC channel 200 and the second ADC channel 300 of the power device, a known and stable input reference data can be provided for the parallel first ADC channel 200 and the second ADC channel 300 of the power device, so as to evaluate and calibrate the performance differences between the channels.

[0089] By inputting standard test signals, the signal characteristics under actual working conditions can be simulated, while ensuring the accuracy and repeatability of the signal source, providing reliable input conditions for subsequent data comparison and analysis.

[0090] Based on the first and second raw output data, a data comparison analysis is performed to calculate the time deviation calibration parameters, amplitude gain calibration parameters, and offset calibration parameters between the first ADC channel 200 and the second ADC channel 300. The first ADC channel 200 and the second ADC channel 300 are then subjected to signal detection analysis using a standard test signal to correct the error between the two detection channels. Key parameters for correcting the differences between channels are quantified and generated, thereby eliminating or reducing the inherent deviation between channels when performing subsequent power data detection, thus improving the accuracy of the measurement.

[0091] Specifically, the step of performing data comparison analysis based on the first original output data and the second original output data to calculate the time deviation calibration parameter, amplitude gain calibration parameter, and offset calibration parameter between the first ADC channel 200 and the second ADC channel 300 includes: Based on the first and second original output data, analyze the response sequences of the first ADC channel 200 and the second ADC channel 300 to the same sinusoidal dynamic signal. Calculate the phase difference fixed delay data of the first ADC channel 200 and the second ADC channel 300 based on the cross-correlation algorithm to obtain the time deviation calibration parameter. Specifically, the calculation process of the time deviation calibration parameter is as follows: Based on the same sinusoidal dynamic signal input to the first ADC channel 200 and the second ADC channel 300, the data collected by the first ADC channel 200 and the second ADC channel 300 are denoted as follows: and ,right and Perform preprocessing operations such as DC removal and windowing.

[0092] Calculate cross-correlation: Calculate and Discrete cross-correlation function , Indicates delay: ; in, For discrete correlation functions, For the first ADC channel 200 Second test data, This refers to the detection data of the second ADC channel 300 during the nth detection corresponding to the first ADC channel 200. This is the acquisition time delay for the first ADC channel 200 and the second ADC channel 300.

[0093] Due to the cross-correlation function exist The peak value is reached when the sample offset corresponds to the actual time difference between the two signals. This is determined based on the detection data. The maximum value point corresponding to , recorded as The It is the integer multiple of the sampling point delay between two channel signals.

[0094] right exist Interpolation is performed in the vicinity (e.g., parabolic interpolation) to obtain a deviation with a precision higher than that of one sampling period, thereby finding a more accurate peak location. .

[0095] The time deviation calibration parameters are as follows: ,in, It is the sampling frequency.

[0096] The time deviation calibration parameter can also be obtained by fitting the detection data of the first ADC channel 200 and the second ADC channel 300 with a sine function, and by comparing the fitted phase angles. and To calculate the time difference: ,in, It tests the signal frequency.

[0097] Stable output code values ​​based on multiple static DC voltages are extracted from the first and second original output data. The optimal linear conversion coefficient is then obtained through least-squares linear regression fitting. Amplitude gain calibration parameters and offset calibration parameters are acquired. Given a specific input static DC voltage value and its corresponding stable output code value, the line that best represents the trend of these data points is output. The slope and intercept of this line are the "optimal linear conversion coefficients." The slope reflects the gain characteristics, while the intercept reflects the offset characteristics. Specifically, the slope of the optimal line obtained through least-squares linear regression fitting is the amplitude gain calibration coefficient, and the intercept of the optimal line is the offset calibration coefficient.

[0098] Based on the analysis of the first and second original output data, the response sequences of the first ADC channel 200 and the second ADC channel 300 to the same sinusoidal dynamic signal are obtained, thereby obtaining the specific output performance of the first ADC channel 200 and the second ADC channel 300 when receiving the same dynamic signal. This reflects the real-time response of each ADC channel to the input signal and includes dynamic characteristic information such as the inherent time delay and phase shift of the channel. This allows for the correction of the detection data of the first ADC channel 200 and the second ADC channel 300 to reduce the detection error between the two sets of parallel detection channels, thereby improving the detection accuracy of the power detection data.

[0099] As a specific implementation method, the electricity metering method can be calibrated according to the following steps: First, to generate a standard test signal, a high-precision arbitrary waveform generator, such as the Keysight 33500B series, can be used, which can output a 50Hz sine wave signal with adjustable amplitude, as well as multiple stable DC voltage signals. The output of the waveform generator is connected to the input terminal of the power distributor 100 of the power device to ensure that both the first and second input signals receive the same standard test signal. During the synchronous acquisition phase, the digital signal processor (DSP) inside the power device, such as the TIC2000 series, can be configured with its timer module to generate a precise synchronous sampling clock, which simultaneously triggers the first ADC channel 200 and the second ADC channel 300 to perform data detection and conversion. In this embodiment, the sampling rate can be set to 10kHz to ensure that the two channels simultaneously complete analog-to-digital conversion in each sampling period and store the converted first and second raw output data in the internal RAM. During data comparison and analysis, the DSP can execute a cross-correlation algorithm to calculate the phase difference between the output signals of the two channels, and can calculate the difference in the peak position of the cross-correlation function of the output sine waves of the two channels, thereby determining the time deviation. Meanwhile, by performing linear regression analysis on the output data of multiple collected DC voltage signals, and by fitting the output code values ​​corresponding to multiple DC inputs using the least squares method, the slope and intercept of the linear transformation equation are obtained, thereby acquiring the amplitude gain calibration parameters and offset calibration parameters.

[0100] Specifically, Figure 3 This invention illustrates a flowchart of the calibration processing for high-range and low-range detection data in an embodiment of the invention. Step S12 includes: S121. Based on the pre-stored amplitude gain calibration parameters and offset calibration parameters, perform linear transformation on the high-range detection data and the low-range detection data respectively to obtain a first preliminary voltage value sequence of the high-range detection data and a second preliminary voltage value sequence of the low-range detection data; adjust based on the pre-stored amplitude gain calibration parameters and offset calibration parameters, correct the gain difference between the first ADC channel 200 and the second ADC channel 300 during signal amplification or conversion based on the amplitude gain calibration parameters, and correct the DC offset that may exist between the first ADC channel 200 and the second ADC channel 300 at zero input based on the offset calibration parameters.

[0101] S122. Based on pre-stored time deviation calibration parameters, a digital fractional delay filter is used to compensate for the delay of the second preliminary voltage value sequence, aligning the second preliminary voltage value sequence with the first preliminary voltage value sequence on the time axis, and outputting high-range and low-range physical quantities. The pre-stored time deviation calibration parameters are obtained by analyzing and processing the same detection signal using the first ADC channel 200 and the second ADC channel 300. High-range detection data refers to the original digital sampled value sequence obtained by analog-to-digital conversion of the first input signal by the first ADC channel 200, typically a binary or hexadecimal digital code stream output by the ADC chip, representing the voltage or current amplitude at a specific sampling moment. Low-range detection data refers to the original digital sampled value sequence obtained by analog-to-digital conversion of the second input signal by the second ADC channel 300. Similar to high-range detection data, it is a digital code stream output by the ADC chip, but due to its lower range, it has higher resolution for weak signals.

[0102] Time alignment processing is used to eliminate or compensate for time asynchrony between high-range and low-range detection data caused by factors such as sampling clock and channel delay, so that they are precisely aligned on the time axis. This allows for data extraction and splicing of the detection data from the first ADC channel 200 and the second ADC channel 300 according to the fluctuations of the detection signal, thereby achieving accurate detection of power data.

[0103] The first preliminary voltage value sequence is the voltage value sequence of high-range detection data after amplitude gain calibration and offset calibration, that is, the detection output data of the first ADC channel 200. The second preliminary voltage value sequence is the voltage value sequence of low-range detection data after amplitude gain calibration and offset calibration, that is, the detection output data of the second ADC channel 300.

[0104] S13. Analyze the amplitude of the high-range physical quantity in real time, and detect the first range selection signal of the high-range physical quantity within a unit time according to the first preset threshold, and extract the first target digital value sequence within the high-range physical quantity according to the first range selection signal.

[0105] Specifically, Figure 4 This diagram illustrates the range selection strategy adjustment process in an embodiment of the present invention. Step S13 includes: S131. Set a first preset threshold and a second preset threshold, and combine the first preset threshold and the high-range physical quantity to set a first range selection signal, adjusting the first range selection signal with a detection step size of unit time. Specifically, setting the first preset threshold and the second preset threshold includes: Using the mapping value of the full-scale range of the second ADC channel 300 to the full-scale range of the first ADC channel 200 as a reference value, a first preset threshold is set within the range of 0.7 to 0.8 of the reference value, and a second preset threshold is set within the range of 0.1 to 0.3 of the reference value.

[0106] The first and second preset thresholds are reference values ​​used to define the conditions for range switching. They define at what level the amplitude of the high-range physical quantity should trigger range switching or maintain the current range. These thresholds can be determined based on the characteristics of the ADC channel of the power device, the dynamic range of the signal to be detected, and the desired measurement accuracy. For example, they can be set empirically based on the full-scale range of the first ADC channel 200 and the effective measurement range of the second ADC channel 300, or by statistically analyzing signals under typical operating conditions to determine the critical point that can effectively distinguish between high and low range signals. The first range selection signal is a control signal indicating whether a high or low range should be used.

[0107] Using unit time as the detection step size means that the system does not continuously make range switching judgments, but periodically evaluates the amplitude of the high-range physical quantity at fixed time intervals and adjusts the first range selection signal accordingly. This periodic detection mechanism can effectively avoid frequent and unstable range switching caused by instantaneous signal fluctuations, thereby improving the stability of the system.

[0108] S132. If the current first range selection signal is to select the high range, and the amplitude of the high range physical quantity is continuously lower than the second preset threshold, then the first range selection signal is switched to select the low range. If the amplitude of the high-range physical quantity is greater than or equal to the second preset threshold, the high-range selection state is maintained.

[0109] S133. If the current first range selection signal is to select a low range, and the amplitude of the high range physical quantity is continuously higher than the first preset threshold, then the first range selection signal is switched to select a high range. If the amplitude of the high-range physical quantity is less than or equal to the first preset threshold, the low-range selection state is maintained.

[0110] Specifically, based on the mapping value of the full-amplitude range of the second ADC channel 300 onto the full-amplitude range of the first ADC channel 200, the first preset threshold is set to 0.7 times this benchmark value, and the second preset threshold is set to 0.2 times this benchmark value. In actual operation, the system will detect the step size in units of, for example, 10 milliseconds, to monitor the amplitude of high-range physical quantities in real time.

[0111] Initially, the system is assumed to be in a high-range selection state. If the amplitude of the high-range physical quantity begins to decrease and remains below the second preset threshold for five consecutive detection steps (i.e., 50 milliseconds), the system determines that the signal has entered the low-amplitude region, and the first range selection signal will switch from "select high range" to "select low range". If the amplitude of the high-range physical quantity is greater than or equal to the second preset threshold at any time, the system will maintain the high-range selection state, even if there was a previous downward trend, to ensure accurate measurement of the high-amplitude signal. Now, assuming the system is in a low-range selection state, if the amplitude of the high-range physical quantity begins to increase and remains above the first preset threshold for five consecutive detection steps, the first range selection signal will still switch to low range selection according to the scheme's settings. This prevents erroneous switching when the signal amplitude briefly increases but has not yet reached the condition for a stable switch to high range, or in certain specific application scenarios where the signal amplitude is high but its impact on the detection state of the second ADC channel 300 is significant, prioritizing the use of low-range detection data ensures the continuity and stability of the detection data. If the amplitude of the high-range physical quantity is less than or equal to the first preset threshold at any time, the system will maintain the low-range selection state to ensure accurate measurement of low-amplitude signals. In this way, the system can achieve stable and timely range switching based on the dynamic changes in signal amplitude, combined with preset thresholds and continuity judgments, thereby ensuring optimal measurement accuracy under different signal strengths.

[0112] A first preset threshold is set within the range of 0.7 to 0.8 of the reference value. This first preset threshold can be used as a trigger condition for switching from a high-range to a low-range measurement. The first preset threshold is an upper limit threshold; when the amplitude of the high-range physical quantity drops below this threshold, the system tends to switch to the more sensitive low-range channel. Setting this threshold between 70% and 80% of the reference value aims to provide a reasonable switching point, ensuring timely switching when the signal amplitude is sufficiently small and the accuracy of the high-range channel may decrease, while avoiding premature switching that could lead to saturation of the low-range channel when the signal amplitude is still high. For example, the specific threshold can be selected as 0.75 times the reference value as the first preset threshold based on the system's requirements for switching smoothness and response speed, through experimental testing or simulation analysis.

[0113] A second preset threshold is set within the range of 0.1 to 0.3 of the reference value. This second preset threshold can be used as a trigger condition for switching from a low range to a high range. The second preset threshold is a lower limit; when the amplitude of the high-range physical quantity rises above this threshold, the system tends to switch to the higher-range channel with a larger range. Setting this threshold between 10% and 30% of the reference value aims to provide a safe switching point, ensuring timely switching back to the high range when the signal amplitude increases and the low-range channel may face saturation risk, preventing signal clipping or distortion. Simultaneously, it forms a certain hysteresis range with the first preset threshold, avoiding frequent switching when the signal fluctuates near the threshold. For example, the specific threshold can be selected as 0.2 times the reference value, based on the system's saturation margin for the low-range channel and the minimum measurable signal requirement for the high-range channel.

[0114] Based on the dynamic changes in the comprehensive detection data of the first preset threshold and the second preset threshold, the detection data of the first ADC channel 200 and the second ADC channel 300 are combined to output highly accurate power detection data.

[0115] S14. Extract a second target digital value sequence from the low-range physical quantity based on the first target digital value sequence, and generate a measurement value by combining the first target digital value sequence and the second target digital value sequence. Specifically, step S14 includes: The concatenation position of the first target digital value sequence and the second target digital value sequence is smoothed by weighted fusion. The calculation formula for the smoothing process is as follows: ; in, These are time-varying weighting coefficients that are applied during the switch from a high range to a low range. Gradually changing from 1 to 0; during the switch from a low range to a high range. Gradually changing from 0 to 1, In the first The final output physical quantity value at each sampling point time. The first target digital value sequence is the first One value, The first target digital value sequence is the first Values.

[0116] Weighted fusion is a signal processing technique that assigns different weights to multiple input signals and then combines the weighted signals to generate a smooth output signal. In this embodiment, by adjusting the data transition at the splicing position between the detection data of the first ADC channel 200 and the detection data of the second ADC channel 300 through weighted fusion processing, the accuracy of the splicing point between the detection data of the first ADC channel 200 and the second ADC channel 300 can be improved.

[0117] This smoothing process ensures that the output physical quantity values ​​can transition continuously and naturally near the range switching point, improving the accuracy of power data detection.

[0118] In the At each sampling point, the sequence of the first target digital values ​​from the high-range detection channel will be... and the second target digital value sequence from the low-range detection channel Weighted combinations are performed to generate the final output physical quantity values. The weighting coefficients This reflects the contribution ratio of the first target numerical value sequence and the second target numerical value sequence. And the weighting coefficient The weighting coefficients are time-varying, i.e., the weighting coefficients. The value of will be dynamically adjusted as time or sampling points change. When selecting a segment of the first target digital value sequence and a segment of the second target digital value sequence to combine, the time-varying weight coefficient allows the data of the two segments to transition naturally, reducing the abruptness of splicing between the first and second target digital value sequences. This gradual process can continue for a certain number of sampling points, forming a transition interval, thereby effectively avoiding abrupt changes in the detection data.

[0119] In some embodiments, the weighting coefficients A cosine window nonlinear gradual adjustment strategy is adopted for dynamic adjustment: when the system determines that a range switch is needed based on the first range selection signal, a fixed transition window length is set. (Unit: number of sampling points). The value is determined by the sampling frequency. and fundamental frequency of power signals Confirm, optional For example, when , hour, There are 100 sampling points. Let the global index of the starting sampling point where the switching occurs be 0. Define relative offset ,in, The formula for calculating the weight coefficient within the transition window is: ; in, This is the global time-series index of the sampling point, with a value that is a non-negative integer, representing the nth sampling point since system startup or a certain reference time. One sampling point; This is the global index of the starting sampling point where the range switching behavior occurs, i.e., the first sampling point of the transition window; The relative offset is defined as follows: This represents the offset of the current sampling point from the switching start point, with a value range of [value range missing]. ; The length of the transition window, expressed in the number of sampling points, represents the total number of sampling points traversed from the start of the handover to the completion of the handover. For time-varying weighting coefficients, it means that in the first... At each sampling point, the weight of high-range data in the output fusion result ranges from [value range missing]. ; The sampling frequency of the system is expressed in Hz, representing the number of samples collected by the analog-to-digital converter per second. This is the fundamental frequency of the electrical signal, measured in Hz. For power frequency systems, it is typically 50Hz or 60Hz. For the system in the first The final output of the physical quantity of electrical energy (such as the instantaneous voltage value) at each sampling point time. For the first target digital value sequence (high-range channel) in the th The physical quantity values ​​at each sampling point; For the second target digital value sequence (low range channel) in the 1st The physical quantity values ​​of each sampling point.

[0120] Depending on the direction being switched, The gradual change process is as follows: When switching from a high range to a low range: from Gradient to Substitute into the fusion formula It can be seen that high-range data is used at the beginning and low-range data is used at the end.

[0121] When switching from a low range to a high range: Should from Gradient to At this time, it can be ordered At the beginning (Using high-range data throughout), at the end (Using only low-range data).

[0122] The cosine window function changes gradually at both ends of the window and changes more rapidly in the middle. Compared with linear gradual change, it can further suppress high-frequency harmonic components introduced by weight abrupt changes and reduce interference with harmonic energy metering.

[0123] The output value This represents the electrical energy metering result obtained at a specific sampling time n after weighted fusion and smoothing processing. It is a continuous and accurate physical quantity provided by the system, reflecting the true amplitude of the signal to be detected. This final output value reflects the complementary advantages of high-range and low-range data. It utilizes the wide dynamic range of the high-range data at high amplitudes and the high resolution of the low-range data at low amplitudes, and the smoothing process ensures seamless connection throughout the entire measurement range.

[0124] Example 3: This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the energy metering method based on parallel dual-metering channel detection described in Embodiment 1.

[0125] Example 4: This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the program, it implements the steps of the energy metering method based on parallel dual-metering channel detection described in Embodiment 1.

[0126] Example 5: This embodiment provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the energy metering method based on parallel dual-metering channel detection described in Embodiment 1.

[0127] The above description is merely a preferred embodiment of this practice and is not intended to limit the scope of this practice. Various modifications and variations can be made to this practice by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this practice should be included within the protection scope of this practice.

Claims

1. A power metering method based on parallel dual-metering channel detection, characterized in that, include: The acquired signal to be detected is divided into a first input signal and a second input signal with equal impedance. Based on the first input signal and the second input signal, as well as the first channel and the second channel preset in parallel, a first detection data and a second detection data with a value range higher than the first detection data are determined; The first detection data and the second detection data are time-aligned by a preset time deviation calibration parameter, and the first detection data and the second detection data are converted into a first physical quantity and a second physical quantity. Based on the amplitude of the first physical quantity, a first range selection signal of the first physical quantity within a unit time is determined by a first preset threshold, and a first target digital value sequence is extracted within the first physical quantity based on the first range selection signal. Extract the second target digital value sequence from the second physical quantity based on the first target digital value sequence; A measurement value is generated by combining the first target digital value sequence and the second target digital value sequence.

2. The energy metering method based on parallel dual-metering channel detection as described in claim 1, characterized in that, A comparative analysis is performed on the first and second raw output data corresponding to the first and second channels to determine the time deviation calibration parameters, amplitude gain calibration parameters, and offset calibration parameters between the first and second channels.

3. The energy metering method based on parallel dual-metering channel detection as described in claim 2, characterized in that, The determination of the time deviation calibration parameter, the amplitude gain calibration parameter, and the offset calibration parameter includes: analyzing the response sequences of the first channel and the second channel to the same sinusoidal dynamic signal based on the first original output data and the second original output data, determining the phase difference fixed delay data of the first channel and the second channel based on the cross-correlation algorithm, and obtaining the time deviation calibration parameter; extracting stable output code values ​​based on multiple static DC voltages from the first original output data and the second original output data, and determining the amplitude gain calibration parameter and the offset calibration parameter by least squares linear regression fitting.

4. The energy metering method based on parallel dual-metering channel detection as described in claim 1, characterized in that, The switching between the first physical quantity and the second physical quantity includes: performing linear transformation on the first detection data and the second detection data respectively according to the pre-stored amplitude gain calibration parameters and offset calibration parameters to obtain a first preliminary voltage value sequence of the first detection data and a second preliminary voltage value sequence of the second detection data; Based on the pre-stored time deviation calibration parameters, the second preliminary voltage value sequence is delayed and compensated by a digital fractional delay filter, so that the second preliminary voltage value sequence is aligned with the first preliminary voltage value sequence on the time axis, thus obtaining the first physical quantity and the second physical quantity.

5. The energy metering method based on parallel dual-metering channel detection as described in claim 1, characterized in that, The extraction of the first target digital value sequence includes: setting a first preset threshold and a second preset threshold, setting a first range selection signal in combination with the first preset threshold and the first physical quantity, and adjusting the first range selection signal with a unit time as the detection step; If the current first range selection signal is to select the high range, and the amplitude of the first physical quantity is continuously lower than the second preset threshold, then the first range selection signal is switched to select the low range; if the amplitude of the first physical quantity is greater than or equal to the second preset threshold, then the high range selection state is maintained. If the current first range selection signal is set to select a low range, and the amplitude of the first physical quantity is continuously higher than the first preset threshold, then the first range selection signal is switched to select a high range; if the amplitude of the first physical quantity is less than or equal to the first preset threshold, then the low range selection state is maintained.

6. The energy metering method based on parallel dual-metering channel detection as described in claim 5, characterized in that, The setting of the first preset threshold and the second preset threshold includes: using the mapping value of the full-scale range of the second channel to the full-scale range of the first channel as a reference value, setting the first preset threshold within a first preset value range of the reference value, and setting the second preset threshold within a second preset value range of the reference value; the first preset value range is greater than the second preset value range.

7. The energy metering method based on parallel dual-metering channel detection as described in claim 1, characterized in that, The step of generating a measurement value by combining the first target digital value sequence and the second target digital value sequence includes: smoothing the splicing position of the first target digital value sequence and the second target digital value sequence through weighted fusion. ; in, These are time-varying weighting coefficients; In the first Each sampling point time; The first target digital value sequence is the first One value; The first target digital value sequence is the first Values.

8. The energy metering method based on parallel dual-metering channel detection as described in claim 7, characterized in that, For the weighting coefficients Dynamic adjustment is achieved using a cosine window nonlinear gradual adjustment strategy: ; ; in, For the transition window length, The sampling frequency; It is the fundamental frequency of the power signal; The global index of the starting sampling point where the switching occurs.

9. The energy metering method based on parallel dual-metering channel detection as described in claim 7, characterized in that, The amplitude of the second physical quantity is analyzed in real time, and the second range selection signal of the second physical quantity is detected within a unit time according to the second preset threshold. The first range selection signal is compared with the second range selection signal. If the first range selection signal and the second range selection signal are inconsistent, the final range selection signal is generated according to the preset selection strategy.

10. The energy metering method based on parallel dual-metering channel detection as described in claim 9, characterized in that, The preset selection strategy includes: when the amplitude of the signal to be detected is within the hysteresis interval between the first preset threshold and the second preset threshold, the first range selection signal is selected as the final range selection signal; when it is detected that the value of the second physical quantity has not reached saturation under the condition of the first range selection signal, the second range selection signal is selected as the final range selection signal.

11. An energy metering system based on parallel dual-metering channel detection, characterized in that, include: The data acquisition module is configured to divide the acquired signal to be detected into a first input signal and a second input signal with equal impedance. The initial detection module is configured to: determine first detection data and second detection data with a value range higher than the first detection data based on the first input signal and the second input signal, as well as the first channel and the second channel preset in parallel. The normalization processing module is configured to: perform time alignment processing on the first detection data and the second detection data using a preset time deviation calibration parameter, and convert the first detection data and the second detection data into a first physical quantity and a second physical quantity; The threshold analysis module is configured to: determine a first range selection signal of the first physical quantity within a unit time based on the amplitude of the first physical quantity and a first preset threshold; extract a first target digital value sequence within the first physical quantity based on the first range selection signal; and extract a second target digital value sequence from the second physical quantity based on the first target digital value sequence. The data output module is configured to generate a measurement value by combining the first target digital value sequence and the second target digital value sequence.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the energy metering method based on parallel dual-metering channel detection as described in any one of claims 1-10.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the program, it implements the steps of the power metering method based on parallel dual-metering channel detection as described in any one of claims 1-10.

14. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the energy metering method based on parallel dual-metering channel detection as described in any one of claims 1-10.