A polarity testing method and system for metering devices suitable for high-noise environments

By applying excitation signals controlled by algorithms, preprocessing multi-dimensional signals, and using AI fusion judgment algorithms, the problems of anti-interference and judgment accuracy in polarity testing of measuring devices under high noise environments have been solved, achieving high-precision and stable polarity testing.

CN122085183APending Publication Date: 2026-05-26国网江西省电力有限公司九江供电分公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
国网江西省电力有限公司九江供电分公司
Filing Date
2025-12-22
Publication Date
2026-05-26

Smart Images

  • Figure BDA0005753016510000031
    Figure BDA0005753016510000031
  • Figure BDA0005753016510000041
    Figure BDA0005753016510000041
  • Figure BDA0005753016510000051
    Figure BDA0005753016510000051
Patent Text Reader

Abstract

This invention discloses a polarity testing method for metering devices suitable for high-noise environments, belonging to the field of metering device testing technology. The method includes: generating a square wave excitation signal with preset parameters based on algorithm control and applying it to the primary side of the metering device; acquiring the secondary side induced response signal, which is then synchronously transmitted after filtering, baseline drift correction, and amplitude scaling preprocessing; integrating the excitation and preprocessed signals, extracting phase difference, delay time, and amplitude characteristic parameters, and sequentially performing polarity, phase sequence, and on / off determination to obtain a preliminary comprehensive result; based on the preliminary result and characteristic parameters, outputting the determination result and confidence level through an improved CNN model, and obtaining the final polarity conclusion through weighted fusion; and visually outputting the final conclusion. This invention, through the collaborative design of precise excitation, anti-interference preprocessing, multi-dimensional preliminary determination, and AI-fused final determination, effectively suppresses noise interference, improves the accuracy and stability of polarity determination, and is suitable for high-noise scenarios such as industrial sites and substations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of metrology testing technology, and specifically to a method and system for testing the polarity of metrology devices suitable for high-noise environments. Background Technology

[0002] Metering devices (such as current transformers, voltage transformers, and electricity meters) are core equipment for electricity metering and safety monitoring in power systems. The correctness of their polarity directly determines metering accuracy and power supply safety. Clause 9.0.8 of GB50150-2006, "Standard for Acceptance Testing of Electrical Equipment in Electrical Installation Engineering," stipulates that the wiring group and polarity of the transformer must meet design requirements and should be consistent with the nameplate and markings. DL / 448-2000, "Technical Management Regulations for Electricity Metering Devices," stipulates that newly installed or modified electricity metering devices must generally undergo a power outage wiring inspection. In practical application scenarios such as industrial sites and substations, there are numerous high-noise signals such as power frequency interference and electromagnetic radiation. This noise severely interferes with signal transmission and identification during the polarity testing process of metering devices, leading to problems such as large judgment errors, high misjudgment rates, and poor test stability in traditional testing methods. Existing metering device polarity testing methods mainly rely on single signal characteristics (such as amplitude and simple phase comparison) for judgment, resulting in weak noise resistance. For example, traditional voltammetry testing relies on precise measurement of signal amplitude. In high-noise environments, noise signals easily superimpose with the response signal, leading to amplitude measurement deviations. Phase difference testing often employs simple zero-crossing detection, which is inaccurate in identifying the zero-crossing moment under noise interference, thus introducing phase determination errors. Furthermore, existing methods lack end-to-end error control and multi-dimensional verification during the testing process. When signal distortion or synchronization deviations occur, they cannot be effectively identified and adjusted, further reducing test reliability. Simultaneously, existing testing systems are mostly combinations of single-function modules, resulting in low efficiency in signal transfer and data interaction, making them unsuitable for real-time testing requirements in high-noise environments. Therefore, there is an urgent need for a metrology device polarity testing method and system that can effectively suppress noise interference, achieve multi-dimensional accurate determination, and ensure test stability and reliability, in order to address the shortcomings of traditional testing methods in high-noise environments. Summary of the Invention

[0003] To address the problems of weak anti-interference capability, low judgment accuracy, and poor stability in existing technologies for polarity testing of measuring devices in high-noise environments, this invention provides a method and system for polarity testing of measuring devices suitable for high-noise environments. By optimizing excitation signal control, enhancing response signal preprocessing, and constructing a multi-dimensional judgment algorithm and AI fusion model, accurate and stable testing of the polarity of measuring devices in high-noise environments can be achieved.

[0004] The technical solution of this invention is as follows:

[0005] A polarity testing method for a measuring device suitable for high-noise environments includes the following steps:

[0006] S1: Application of excitation signal based on algorithm control: The host system generates a square wave excitation signal with preset parameters and switches the output to the primary side of the metering device. The preset parameters include the square wave excitation signal frequency f. ex c. Peak voltage U ex c- max Rise time Falling edge time tp all and duty cycle D ex c);

[0007] S2: Acquisition and preprocessing of secondary side response signal of metering device: The secondary side induced response signal of metering device is acquired using Hall current sensor, and the acquired signal is preprocessed by filtering algorithm, baseline drift correction algorithm and amplitude scaling algorithm in sequence, and then synchronously transmitted to host.

[0008] S3: Signal comparison and multi-dimensional judgment algorithm execution: The host system integrates the primary side excitation signal and the secondary side preprocessed signal, extracts phase, delay time and amplitude characteristic parameters, and executes the polarity judgment algorithm, phase sequence judgment algorithm and on / off judgment algorithm in sequence to obtain the preliminary comprehensive judgment result.

[0009] S4: Preliminary comprehensive judgment result P based on the output of S3 pre The extracted feature parameters are used to output the judgment result and confidence score through an improved convolutional neural network (CNN) model. The fusion judgment is completed through weight allocation to obtain the final polarity judgment conclusion.

[0010] S5: Test Result Output: Visualize the final polarity determination conclusion.

[0011] Furthermore, in S2, the secondary-side induction response signal is acquired:

[0012] A Hall current sensor is used to collect the induced current signal on the secondary side of the metering device. The current signal is converted into a voltage signal by a signal conditioning circuit and then transmitted to the analog-to-digital converter of the host system for digital conversion.

[0013] The filtering algorithm described above:

[0014] A first-order RC low-pass filter is used to initially filter out high-frequency noise. Its transfer function is:

[0015]

[0016] Where R1 is the filter resistor, C1 is the filter capacitor, and the cutoff frequency is...

[0017] Ise cr at : Rated output current of the secondary side of the metering device, in A, with a preset range of 1 to 5A;

[0018] The discretized recursive formula is:

[0019] Response signal sampling frequency, preset Satisfying the Nyquist sampling theorem ( f max To respond to the highest harmonic frequency of the signal, the preset f max =500kHz);

[0020] y1(n)=αy1(n-1)+(1-α)x(n)

[0021] First-order low-pass filter cutoff frequency, preset Used to filter out high-frequency noise;

[0022] Where x(n) is the signal value of the nth sampling point before filtering, y1(n) is the signal value of the nth sampling point after filtering, y1(n-1) is the signal value of the (n-1)th sampling point after filtering, and α is the filtering coefficient. The sampling period;

[0023] Adaptive notch filter center frequency, preset Used to filter out power frequency interference;

[0024] The baseline drift correction algorithm described above:

[0025] The moving average baseline estimation method is used, and the specific formula is as follows:

[0026]

[0027] Where B(n) is the baseline estimate for the nth sampling point. The sliding window length is estimated for the baseline, and y2(i) is the signal value of the i-th sampling point after notch filtering;

[0028] The corrected signal is:

[0029] y3(n) = y2(n) - B(n)

[0030] If |y3(n)|≤A a d r If the signal is not found, it is determined to be a baseline drift residual signal, and y3(n) = 0 is set.

[0031] The amplitude scaling algorithm described above:

[0032] To ensure the preprocessed signal matches the input range of subsequent algorithms, a linear scaling formula is used:

[0033] y4(n)=G scale ×y3(n)

[0034] Where y4(n) is the scaled signal value of the nth sampling point, G s c ale =1 / max(|y3(n)|), where max(|y3(n)|) is the maximum absolute value of the signal after baseline correction.

[0035] Furthermore, in S3,

[0036] The phase extraction mentioned above:

[0037] Hilbert transform is used to extract the signal phase for the primary excitation signal u. ex Both c(n) and the preprocessed response signal y4(n) from the secondary side are subjected to Hilbert transforms to obtain analytic signals:

[0038] Z exc (n)=u exc (n)+jH[u exc (n)]

[0039] Z sec (n) = y4(n) + jH[y4(n)]

[0040] Where H[·] denotes the Hilbert transform, and j is the imaginary unit;

[0041] The signal phase is the argument of the analytic signal, that is:

[0042]

[0043] The aforementioned delay time extraction:

[0044] The cross-correlation algorithm is used to calculate the time delay between the excitation signal and the response signal. The cross-correlation function is:

[0045]

[0046] Where τ is the delay step number and N is the total number of signal sampling points; when R ex c- se When c(τ) reaches its maximum value, the corresponding delay time

[0047] The amplitude extraction mentioned above:

[0048] The phase of the nth sampling point of the primary excitation signal;

[0049] The amplitude A of the secondary response signal is extracted using a peak detection algorithm. se c, i.e., A se c = max(|y4(n)|);

[0050] The phase of the nth sampling point of the secondary response signal;

[0051] The polarity determination algorithm

[0052] The phase difference between the excitation signal and the response signal, in rad, is calculated as follows: in The phase of the primary side excitation signal, The phase of the secondary side response signal;

[0053] Polarity determination phase difference threshold, in rad, with a preset value range of (π / 2, 3π / 2), is used to distinguish between positive and negative polarity;

[0054] Execution logic: based on phase difference With threshold The comparison results determine the polarity; when When the polarity of the measuring device is positive, the output polarity determination result P1 = 1; when When the polarity of the measuring device is reversed, the polarity determination result P1 = -1 is output.

[0055] The phase sequence determination algorithm described above

[0056] t nelaγ The delay time of the response signal relative to the excitation signal, in μs; for a three-phase metering device, the delay times corresponding to the A, B, and C phase signals are t, respectively. nelaγ-α t nelaγ-β t nelaγ -c;

[0057] t nelaγ-th Delay time threshold, in μs, with a preset value of ≤100μs, used to determine whether the delay time is within a reasonable range;

[0058] Execution logic:

[0059] Phase sequence determination is achieved based on the relationship between delay times and threshold comparison; for three-phase metering devices, when t... nelaγ-a <t nelaγ-β <t nelaγ- c, and the delay time of each phase is ≤t. nelaγ-th When the phase sequence is determined to be positive, the phase sequence determination result P2 = 1 is output; when t is satisfied... nelaγ-a >t nelaγ-β>t nelaγ- c, and the delay time of each phase is ≤t. nelaγ-th When the phase sequence is determined to be reversed, the phase sequence determination result P2 = -1 is output; if the delay time of any phase is greater than t... nelaγ-th If the phase sequence is determined to be abnormal, the phase sequence determination result P2 = 0 is output; for single-phase metering devices, there is no reverse phase sequence problem by default, and the phase sequence determination result P2 = 1 is output directly.

[0060] The aforementioned on / off determination algorithm

[0061] A se c: Amplitude of the secondary response signal, in V, extracted using a peak detection algorithm, i.e., A se c = max(|y4(n)|), where y4(n) is the preprocessed standardized signal;

[0062] A se c- th Response signal amplitude threshold, in V, with a preset value of 0.1V, used to distinguish between the on and off states of the metering device;

[0063] Execution logic:

[0064] Based on the amplitude A of the response signal se c and threshold A se c- th The comparison results are used to determine whether the circuit is open or closed; when A se c≥A se c- th When A is on, the metering device is determined to be on, and the on / off determination result P3 = 1 is output; when A se c se c- th When the metering device is disconnected, the on / off determination result P3=0 is output and all subsequent determination processes are terminated immediately, and the test conclusion of equipment failure is directly output.

[0065] The aforementioned preliminary comprehensive judgment

[0066] When the on / off determination result P3 = 1, and the phase sequence determination result P2 ≠ 0, a preliminary comprehensive determination is made by combining the polarity and phase sequence determination results. The formula is as follows:

[0067] P pre =sign(W 11 P1+W 12 P2)

[0068] Among them, W 11 Polarity determination weight (preset W) 11 =0.6), W 12 Phase sequence determination weight (preset W) 12 =0.4), satisfying W​11 +W 12 =1; sign(·) is the sign function. When the input is positive, it outputs 1 (indicating a positive / positive phase sequence). When the input is negative, it outputs -1 (indicating a negative / reverse phase sequence).

[0069] Furthermore, in S4, the improved CNN model includes an input layer, four convolutional layers, two pooling layers, one fully connected layer, and an output layer. The output layer has two neurons, corresponding to two types of results: forward / positive phase sequence and backward / inverse phase sequence. The activation function is Softmax. The improved CNN model is used for training and inference.

[0070] like If the polarity is determined to be positive, the polarity determination result P1 = 1 is output.

[0071] like If the polarity is determined to be reversed, the polarity determination result P1 = -1 will be output.

[0072] The model is trained using a sample set of metering device response signals with different polarities and phase sequences under high-noise environments. The sample set size is ≥10,000 groups. The training optimizer is Adam, the learning rate is preset to 0.001, and the loss function is the cross-entropy loss function.

[0073]

[0074] Where y is the real label (one-hot encoded), Predict probabilities for the model.

[0075] The preprocessed current response signal sequence is input into the trained improved CNN model. The model outputs the probabilities of the two types of results. The result corresponding to the maximum probability is taken as the AI ​​recognition polarity result P, where 1 represents forward / positive phase sequence and -1 represents reverse / inverted phase sequence. At the same time, the confidence level C of the result is also output.

[0076] If the actual delay relationship satisfies t nelaγ-a <t nelaγ-β <t nelaγ- If c, then the phase sequence is determined to be a positive phase sequence, and the phase sequence determination result P2 = 1 is output;

[0077] The aforementioned fusion determination:

[0078] Based on the preliminary comprehensive judgment results P pre And AI recognition results P AI The fusion determination is performed in two cases:

[0079] If the actual delay relationship is t nelaγ-a >t nelaγ-β >t nelaγ-If c, then the phase sequence is determined to be reversed, and the phase sequence determination result P2 = -1 is output.

[0080] (1) When At that time, the fusion determination formula is:

[0081]

[0082] W1: Weight of preliminary comprehensive judgment result; W2: Weight of AI recognition result.

[0083] (2) When If the AI ​​recognition result is insufficient, the fusion judgment result is taken as the preliminary comprehensive judgment result, and the prompt message indicating insufficient confidence of AI recognition is recorded.

[0084] Based on the fusion determination result P, the final polarity determination conclusion is output: when P=1, the polarity is correct and the phase sequence is normal; when P=-1, the polarity is incorrect / the phase sequence is reversed.

[0085] A polarity testing system for a metering device suitable for high-noise environments includes an excitation signal virtual generation module, a response signal acquisition and preprocessing module, a multi-dimensional judgment algorithm execution module, an AI fusion judgment module, and a test result visualization output module; each module works in sequence and is connected to the host system for control.

[0086] Virtual excitation signal generation module: used to generate a square wave excitation signal based on preset parameters and output virtual excitation control commands to external signal generation hardware. The preset parameters include the square wave excitation signal frequency f. ex c. Peak voltage U ex c- max Rise time Falling edge time tp all and duty cycle D ex c; Simultaneously, receive excitation signal monitoring data from external voltage sensors in real time, calculate voltage fluctuation rate and determine excitation signal stability, and output test stop command and error message when unstable.

[0087] The response signal acquisition and preprocessing module is used to receive the secondary-side induced response signal of the metering device acquired by the external Hall current sensor, and sequentially execute the filtering algorithm, baseline drift correction algorithm and amplitude scaling algorithm to preprocess the acquired signal to generate a standardized response signal; at the same time, based on the rising edge synchronization signal of the excitation signal output by the excitation signal virtual generation module, the preprocessed signal and the excitation signal are synchronized in time, the synchronization error is verified, and an error prompt is output when the error exceeds the limit.

[0088] The multi-dimensional judgment algorithm execution module integrates the square wave excitation signal output by the excitation signal virtual generation module and the standardized response signal output by the response signal acquisition and preprocessing module, extracting three major characteristic parameters: phase difference, delay time, and amplitude. It then sequentially executes the polarity judgment algorithm, phase sequence judgment algorithm, and on / off judgment algorithm. When the on / off judgment is normal, it fuses the polarity and phase sequence judgment results through weight allocation to obtain a preliminary comprehensive judgment result P. pre ;

[0089] AI Fusion Judgment Module: Used to load the improved convolutional neural network (CNN) model and integrate the preliminary comprehensive judgment result P output by the multi-dimensional judgment algorithm execution module. pre The extracted feature parameters are input into the model, and the AI ​​judgment result and confidence level are output. The preliminary comprehensive judgment result and the AI ​​judgment result are fused by the preset weight allocation rule to obtain the final polarity judgment conclusion.

[0090] Test Result Visualization Output Module: This module receives the final judgment from the AI ​​fusion judgment module, generates structured test data including the final conclusion, feature parameters, confidence level, and test time, and visualizes the final conclusion and excitation and response signal waveforms through a virtual interactive interface. It also supports the storage and export of structured test data.

[0091] In the virtual generation module for the excitation signal, the preset parameter value range is: f ex c∈[50Hz,1kHz]、U ex c- max ∈[5V,30V]、 tp all ≤1μs, D ex c = 0.5.

[0092] The test result visualization output module supports generating structured test data in JSON or CSV format. The visualization content includes an overlay of stimulus and response waveforms, a CNN attention heatmap, and a list of core parameters. It also supports exporting test data and backing it up to the cloud via USB, Bluetooth, or WiFi.

[0093] This invention generates a square wave excitation signal with controllable parameters through algorithmic control, which is precisely applied to the primary side of the metering device while monitoring the excitation stability to ensure the reliability of the test input. Secondly, a Hall current sensor is used to collect the secondary side's induced response signal. A combined preprocessing scheme of filtering, baseline drift correction, and amplitude scaling effectively removes noise interference and signal distortion, outputting a standardized response signal. Next, the excitation and standardized response signals are integrated, and three core feature parameters—phase difference, delay time, and amplitude—are extracted. These are then used to perform multi-dimensional preliminary verification through polarity, phase sequence, and on / off determination algorithms, yielding a preliminary comprehensive determination result. Subsequently, the preliminary comprehensive determination result and the extracted feature parameters are input into an improved CNN model. The model uses deep learning to mine deep signal features, outputting AI determination results and confidence levels. The preliminary results and AI results are then fused through weight allocation to obtain the final polarity determination conclusion. Finally, the final conclusion is visualized, output, and stored, completing the entire testing process.

[0094] The core innovations of this invention are reflected in the following four aspects:

[0095] This invention integrates parameter-controllable square wave excitation design with stability monitoring. Unlike traditional fixed excitation signals, this invention generates adjustable square wave excitation parameters such as frequency and peak voltage through a DDS module. The optimal excitation parameters can be adapted to different types of metering devices. At the same time, a voltage fluctuation rate monitoring mechanism is introduced to identify excitation instability problems in real time, ensuring test reliability from the source.

[0096] An anti-interference-oriented combined signal preprocessing scheme. For high-noise environments, a three-stage preprocessing flow is designed: bandpass filtering, baseline drift correction, and amplitude normalization. Bandpass filtering accurately preserves the fundamental frequency band of the excitation signal and suppresses power frequency and high-frequency noise; baseline drift correction eliminates sensor zero drift and DC interference; and amplitude normalization unifies the dimensions, thus solving the problem of insufficient anti-interference capability of traditional single preprocessing.

[0097] A preliminary judgment mechanism based on multi-dimensional feature fusion. Breaking through the limitations of traditional single-feature judgment, it simultaneously extracts three major feature parameters: phase difference, delay time, and amplitude, which correspond to the three core judgment targets: polarity, phase sequence, and on / off state, respectively. By weighting and fusing the multi-dimensional results, a preliminary judgment conclusion is obtained, achieving synergy between accurate judgment of core targets and verification of auxiliary targets, thereby improving the robustness of the judgment.

[0098] A weighted fusion strategy combining preliminary judgment and AI model results is proposed. This approach combines the preliminary judgment results of traditional algorithms with the deep learning results of an improved CNN model. The fusion strategy is dynamically adjusted based on the confidence level of the AI ​​model. When the confidence level is high, the AI ​​result takes precedence, with the preliminary result as a supplement; when the confidence level is low, the preliminary result is used directly. This approach leverages the feature recognition advantages of AI models under high noise conditions while preserving the stability of traditional algorithms, thus addressing the shortcomings of single AI models or traditional algorithms in complex noisy environments.

[0099] Based on the above working principle and innovative design, this invention has the following significant advantages over the prior art:

[0100] It has strong anti-interference ability. Through a combined preprocessing scheme and parameter-optimized excitation signal, it can effectively suppress various noises such as power frequency interference and high-frequency electromagnetic radiation. It can still stably extract effective signals in high-noise environments with a signal-to-noise ratio of 10dB to 40dB, with a signal distortion rate of ≤2%, thus solving the problem of signal recognition difficulties in noisy environments by traditional methods.

[0101] High accuracy. The collaborative design of multi-dimensional preliminary judgment and AI-integrated final judgment avoids the judgment bias of single feature or single algorithm. Experimental verification shows that the accuracy of polarity determination of single-phase and multi-phase metering devices is ≥98% in high-noise environment, and the accuracy of repeated test is ≥99%, which is far higher than the judgment accuracy of traditional methods.

[0102] Wide adaptability. The excitation parameters are adjustable, and the phase sequence determination supports single-phase / multi-phase switching. It can be adapted to polarity testing of various metering devices such as current transformers, voltage transformers, and energy meters. There is no need to redesign test schemes for different devices, which reduces test costs and improves the versatility of the equipment. Detailed Implementation

[0103] A polarity testing method for a measuring device suitable for high-noise environments includes the following steps:

[0104] S1: Application of excitation signal based on algorithm control: The host system generates a square wave excitation signal with preset parameters and switches the output to the primary side of the metering device. The preset parameters include the square wave excitation signal frequency f. ex c. Peak voltage U ex c- max Rise time Falling edge time tp all and duty cycle D ex c);

[0105] S2: Acquisition and preprocessing of secondary side response signal of metering device: The secondary side induced response signal of metering device is acquired using Hall current sensor, and the acquired signal is preprocessed by filtering algorithm, baseline drift correction algorithm and amplitude scaling algorithm in sequence, and then synchronously transmitted to host.

[0106] S3: Signal comparison and multi-dimensional judgment algorithm execution: The host system integrates the primary side excitation signal and the secondary side preprocessed signal, extracts phase, delay time and amplitude characteristic parameters, and executes the polarity judgment algorithm, phase sequence judgment algorithm and on / off judgment algorithm in sequence to obtain the preliminary comprehensive judgment result.

[0107] S4: Preliminary comprehensive judgment result P based on the output of S3 pre The extracted feature parameters are used to output the judgment result and confidence score through an improved convolutional neural network (CNN) model. The fusion judgment is completed through weight allocation to obtain the final polarity judgment conclusion.

[0108] S5: Test Result Output: Visualize the final polarity determination conclusion.

[0109] In step S1, the core of this step is to accurately construct a square wave excitation signal with preset parameters using a digital signal generation algorithm, while simultaneously employing a signal stability monitoring algorithm to provide real-time feedback on the signal status, ensuring that the excitation signal meets the test requirements. The specific implementation process is as follows:

[0110] Parameter definition

[0111] f ex c: Square wave excitation signal frequency, in Hz, with a preset range of 10 to 100 Hz, which can be adaptively adjusted according to the model of the metering device;

[0112] 1.2 Square Wave Excitation Signal Generation Algorithm and Function Formula

[0113] U ex c- max Peak voltage of the square wave excitation signal, in volts (V), with a preset range of 5–220V, determined by the rated voltage of the primary side of the metering device. Decision, satisfaction

[0114] A square wave signal generation algorithm based on direct digital frequency synthesis (DDS) is adopted, and the signal synthesis is realized through the digital signal processor (DSP) built into the host system. The core function formula is as follows:

[0115] The rise time of the square wave excitation signal is in μs, with a preset value of ≤10μs to ensure the steepness of the signal edge and to excite the metering device to respond effectively.

[0116] (1) Expression for the instantaneous value of a square wave signal:

[0117] tp all The falling edge time of the square wave excitation signal, in μs, is preset to ≤10μs and is symmetrical to the rising edge time to ensure signal symmetry.

[0118]

[0119] D ex c: Duty cycle of square wave excitation signal, dimensionless, preset value is 50%, that is, the duration of high level is equal to the duration of low level;

[0120] Where k is a non-negative integer (k = 0, 1, 2, ...), T ex c is the period of the square wave excitation signal, in seconds, which satisfies T ex c = 1 / f ex c.

[0121] The square wave excitation signal ripple voltage, in mV, has a preset threshold of ≤50mV and is used to characterize signal stability.

[0122] (2) Frequency control word calculation using the DDS algorithm:

[0123] t staβle : Signal stabilization duration, in seconds, preset value ≥2s, to ensure that the excitation signal is stable before proceeding to the next testing stage.

[0124]

[0125] Where FW is the frequency control word (dimensionless), N is the number of bits in the DSP's built-in phase accumulator (default N = 32), and f nlk This is the DSP system clock frequency, in Hz, with a preset f. nlk =100MHz.

[0126] Signal stability monitoring algorithm

[0127] The stability of a square wave excitation signal is monitored in real time using the sliding window variance method. Specific steps are as follows:

[0128] (1) Using sampling frequency (preset) The excitation signal is continuously sampled to obtain the sampling sequence u. ex c- samp (n), where n is the sampling point index (n = 1, 2, ..., M), and M is the number of sampling points within a single sliding window, satisfying... The preset duration for the sliding window.

[0129] (2) Calculate the variance σ of the sampled sequence within each sliding window, using the following formula:

[0130]

[0131] in, This represents the average value of the sampled sequence within a single sliding window.

[0132] (3) Set the variance threshold σ th ,satisfy If the variance of all 5 consecutive sliding windows is ≤σ th If the signal is stable, the duration of stability is considered to be [missing information]. Then, the main system outputs the excitation signal to the primary side of the metering device through a relay switching circuit; if the variance exceeds σ... th Then, the output parameters of the DDS module are adjusted using a PID control algorithm until the signal stabilizes.

[0133] PID control algorithm (for signal stability correction)

[0134] The core formula is the PID output control quantity:

[0135]

[0136] in, The PID output control quantity for the k-th control cycle is used to adjust the amplitude control word of the DDS module; K p The proportionality coefficient (preset K) p =0.5), K i The integral coefficient (preset K) i =0.1), Kd is the differential coefficient (preset Kd = 0.05); e(k) is the deviation in the kth control cycle, e(k) = σ 2 (k)-σ th ; The PID control period is in milliseconds (ms). (Preset) e(k-1) is the deviation in the (k-1)th control cycle.

[0137] In step S2, the secondary-side induced response signal is acquired using a Hall current sensor. For high-noise environments, multi-level filtering, baseline drift correction, and amplitude scaling preprocessing algorithms are introduced to improve the signal-to-noise ratio, providing high-quality signal data for subsequent judgment. The specific implementation process is as follows:

[0138] Response signal acquisition

[0139] A high-precision Hall current sensor (accuracy class ≤0.1%) is used to acquire the induced current signal on the secondary side of the metering device. The current signal is then converted into a voltage signal by a signal conditioning circuit (conversion factor). The data is then transmitted to the host system's analog-to-digital converter (ADC) for digital conversion. The ADC resolution is preset to 16 bits, and the input voltage range is -5V to 5V.

[0140] Filtering algorithm:

[0141] First-order RC low-pass filter: used for initial filtering of high-frequency noise, its transfer function is:

[0142]

[0143] Where R1 is the filter resistor (default R1 = 1kΩ), C1 is the filter capacitor (default C1 = 1.59nF), and the cutoff frequency is...

[0144] The rated output current of the secondary side of the metering device, in A, has a preset range of 1 to 5A.

[0145] The discretized recursive formula is:

[0146] The response signal sampling frequency, in Hz, is preset. Satisfying the Nyquist sampling theorem ( f max To respond to the highest harmonic frequency of the signal, the preset f max =500kHz);

[0147] y1(n)=αy1(n-1)+(1-α)x(n)

[0148] The cutoff frequency of a first-order low-pass filter, in Hz, is preset. Used to filter out high-frequency noise;

[0149] Where x(n) is the signal value of the nth sampling point before filtering, y1(n) is the signal value of the nth sampling point after filtering, y1(n-1) is the signal value of the (n-1)th sampling point after filtering, and α is the filtering coefficient. The sampling period.

[0150] The center frequency of the adaptive notch filter, in Hz, is preset. Used to filter out power frequency interference;

[0151] Baseline drift correction algorithm:

[0152] The moving average baseline estimation method is used, and the specific formula is as follows:

[0153]

[0154] Where B(n) is the baseline estimate for the nth sampling point. Estimate the sliding window length for the baseline (preset) y2(i) is the signal value of the i-th sampling point after notch filtering.

[0155] The corrected signal is:

[0156] y3(n) = y2(n) - B(n)

[0157] If |y3(n)|≤A a d r If the signal is not found, it is determined to be a baseline drift residual signal, and y3(n) is set to 0.

[0158] Amplitude scaling algorithm

[0159] To ensure the preprocessed signal matches the input range of subsequent algorithms (preset to -1 to 1), a linear scaling formula is used:

[0160] y4(n)=G scale ×y3(n)

[0161] Where y4(n) is the scaled signal value of the nth sampling point, G s c ale =1 / max(|y3(n)|), where max(|y3(n)|) is the maximum absolute value of the signal after baseline correction.

[0162] Preprocessing effect verification

[0163] The signal-to-noise ratio (SNR) of the preprocessed signal is calculated using the following formula:

[0164]

[0165] in, For signal power, P noise This represents noise power. If SNR ≥ SNR re If q, then the preprocessed signal y4(n) will be synchronously transmitted to the host system; if SNR <SNR re If q is returned, the filtering algorithm for this step will be re-executed, and the cutoff frequency of the low-pass filter will be adjusted. The damping coefficient ζ of the notch filter is adjusted until the signal-to-noise ratio requirement is met.

[0166] In S3, phase extraction:

[0167] Hilbert transform is used to extract the signal phase for the primary excitation signal u. ex Both c(n) and the preprocessed response signal y4(n) from the secondary side are subjected to Hilbert transforms to obtain analytic signals:

[0168] Z exc (n)=u exc (n)+jH[u exc (n)]

[0169] Z sec (n) = y4(n) + jH[y4(n)]

[0170] Where H[·] denotes the Hilbert transform, and j is the imaginary unit.

[0171] The signal phase is the argument of the analytic signal, that is:

[0172]

[0173] Delay time extraction:

[0174] The cross-correlation algorithm is used to calculate the time delay between the excitation signal and the response signal. The cross-correlation function is:

[0175]

[0176] Where τ is the delay step number and N is the total number of signal sampling points. When R ex c- se When c(τ) reaches its maximum value, the corresponding delay time

[0177] Amplitude extraction:

[0178] The phase of the nth sampling point of the primary excitation signal, in rad;

[0179] The amplitude A of the secondary response signal is extracted using a peak detection algorithm. se c, i.e., A se c = max(|y4(n)|).

[0180] The phase of the nth sampling point of the secondary response signal, in rad;

[0181] The polarity determination algorithm described above:

[0182] The phase difference between the excitation signal and the response signal, in rad, is calculated as follows: in The phase of the primary side excitation signal, The phase of the secondary side response signal;

[0183] Polarity determination phase difference threshold, in rad, with a preset value range of (π / 2, 3π / 2), is used to distinguish between positive and negative polarity;

[0184] Execution logic: based on phase difference With threshold The comparison results determine the polarity; when When the polarity of the measuring device is positive, the output polarity determination result P1 = 1; when When the polarity of the measuring device is reversed, the polarity determination result P1 = -1 is output.

[0185] The phase sequence determination algorithm described above:

[0186] t nelaγ The delay time of the response signal relative to the excitation signal, in μs; for a three-phase metering device, the delay times corresponding to the A, B, and C phase signals are t, respectively. nelaγ-a t nelaγ-β t nelaγ -c;

[0187] t nelaγ-th Delay time threshold, in μs, with a preset value of ≤100μs, used to determine whether the delay time is within a reasonable range;

[0188] Execution logic:

[0189] Phase sequence determination is achieved based on the relationship between delay times and threshold comparison; for three-phase metering devices, when t... nelaγ-a <t nelaγ-β <t nelaγ- c, and the delay time of each phase is ≤t. nelaγ-th When the phase sequence is determined to be positive, the phase sequence determination result P2 = 1 is output; when t is satisfied... nelaγ-a >t nelaγ-β >t nelaγ- c, and the delay time of each phase is ≤t. nelaγ-th When the phase sequence is determined to be reversed, the phase sequence determination result P2 = -1 is output; if the delay time of any phase is greater than t... nelaγ-th If the phase sequence is determined to be abnormal, the phase sequence determination result P2 = 0 is output; for single-phase metering devices, there is no reverse phase sequence problem by default, and the phase sequence determination result P2 = 1 is output directly.

[0190] The aforementioned on / off determination algorithm:

[0191] A se c: Amplitude of the secondary response signal, in V, extracted using a peak detection algorithm.

[0192] A se c = max(|y4(n)|), where y4(n) is the preprocessed standardized signal;

[0193] A se c- thResponse signal amplitude threshold, in V, with a preset value of 0.1V, used to distinguish between the on and off states of the metering device;

[0194] Execution logic:

[0195] Based on the amplitude A of the response signal se c and threshold A se c- th The comparison results are used to determine whether the circuit is open or closed; when A se c≥A se c- th When A is on, the metering device is determined to be on, and the on / off determination result P3 = 1 is output; when A se c se c- th When the metering device is disconnected, the on / off determination result P3=0 is output and all subsequent determination processes are terminated immediately, and the test conclusion of equipment failure (disconnection) is directly output.

[0196] Preliminary overall assessment:

[0197] When the on / off determination result P3 = 1, and the phase sequence determination result P2 ≠ 0, a preliminary comprehensive determination is made by combining the polarity and phase sequence determination results. The formula is as follows:

[0198] P pre =sign(W 11 P1+W 12 P2)

[0199] Among them, W 11 Polarity determination weight (preset W) 11 =0.6), W 12 Phase sequence determination weight (preset W) 12 =0.4), satisfying W 11 +W 12 =1; sign(·) is the sign function, which outputs 1 when the input is positive (preliminary determination of positive / positive phase sequence) and -1 when the input is negative (preliminary determination of negative / reverse phase sequence).

[0200] Improved CNN model: Includes an input layer, 4 convolutional layers, 2 pooling layers, 1 fully connected layer, and an output layer. Specific structure:

[0201] Input layer: The input is the preprocessed secondary side response signal sequence y_4(n), with a dimension of 1×L×1 (L is the length of the signal sequence, preset L=10000);

[0202] Convolutional layer 1: 32 kernels, kernel size 1×3, stride 1, activation function is ReLU;

[0203] Pooling layer 1: max pooling, pooling kernel size 1×2, step size 2;​

[0204] Convolutional layer 2: 64 kernels, kernel size 1×3, stride 1, activation function is ReLU;

[0205] Pooling layer 2: max pooling, pooling kernel size 1×2, step size 2;

[0206] Convolutional layer 3: 128 kernels, kernel size 1×3, stride 1, activation function is ReLU;

[0207] Convolutional layer 4: 256 kernels, kernel size 1×3, stride 1, activation function is ReLU;

[0208] Fully connected layer: 128 neurons, ReLU activation function, and Dropout algorithm (Dropout rate = 0.5) to prevent overfitting;

[0209] like If the polarity is determined to be positive, the polarity determination result P1 = 1 is output.

[0210] Output layer: 2 neurons, corresponding to two types of results: forward / positive phase sequence and reverse / inverted phase sequence. The activation function is Softmax.

[0211] Model training and inference

[0212] The model is trained using a sample set of metering device response signals with different polarities and phase sequences under high-noise environments. The sample set size is ≥10,000 groups. The training optimizer is Adam, the learning rate is preset to 0.001, and the loss function is the cross-entropy loss function.

[0213]

[0214] Where y is the real label (one-hot encoded), Predict probabilities for the model.

[0215] The preprocessed current response signal sequence is input into the trained improved CNN model. The model outputs the probabilities of the two types of results. The result corresponding to the maximum probability is taken as the AI ​​recognition polarity result P (1 represents forward / positive phase sequence, -1 represents reverse / inverted phase sequence). At the same time, the confidence level C (i.e. the maximum probability value) of the result is output.

[0216] If the actual delay relationship satisfies t nelaγ-a <t nelaγ-β <t nelaγ- c, then the phase sequence is determined to be positive, and the phase sequence determination result P2 = 1 is output; if If the polarity is determined to be reversed, the polarity determination result P1 = -1 will be output.

[0217] Fusion determination algorithm

[0218] Based on the preliminary comprehensive judgment results P pre And AI recognition results P aI The fusion determination is performed in two cases:

[0219] If the actual delay relationship is t nelaγ-a >t nelaγ-β >t nelaγ- If c, then the phase sequence is determined to be reversed, and the phase sequence determination result P2 = -1 is output.

[0220] (1) When At that time, the fusion determination formula is:

[0221]

[0222] W1: Weight of preliminary comprehensive judgment result; W2: Weight of AI recognition result.

[0223] (2) When If the AI ​​recognition result is insufficient, the fusion judgment result is taken as the preliminary comprehensive judgment result, and the prompt message indicating insufficient confidence of AI recognition is recorded.

[0224] Based on the fusion determination result P, the final polarity determination conclusion is output: when P=1, the polarity is correct and the phase sequence is normal; when P=-1, the polarity is incorrect / the phase sequence is reversed.

[0225] S4: Test result output, recording, and device reset

[0226] If A se c≥A se c- th If the metering device is on, the on / off determination result P3 = 1 is output.

[0227] The specific implementation process is as follows:

[0228] Parameter definition

[0229] If A se c se c- th If the metering device is disconnected, the on / off determination result P3=0 is output, the subsequent determination is terminated directly, and the device fault (disconnection) result is output.

[0230] T: Duration of a single test, in seconds. Record the start time T and end time T of the test. T = TT.

[0231] ID: Unique identifier code for the metering device, string type, used to distinguish different test objects;

[0232] ​D: Test data set, including excitation signal parameters, preprocessed response signal data, characteristic parameters, judgment results and confidence levels;

[0233] F: Test report format type, defaults to supporting PDF and Excel formats;

[0234] S: Device reset status indicator. S=0 indicates not reset, and S=1 indicates reset completed.

[0235] The core of this step is to output the test results after fusion judgment in multiple forms, record them in a standardized manner, and complete the equipment reset to ensure a closed loop in the test process.

[0236] A polarity testing system for a metering device suitable for high-noise environments includes an excitation signal virtual generation module, a response signal acquisition and preprocessing module, a multi-dimensional judgment algorithm execution module, an AI fusion judgment module, and a test result visualization output module; each module works in sequence and is connected to the host system for control.

[0237] Virtual excitation signal generation module: used to generate a square wave excitation signal based on preset parameters and output virtual excitation control commands to external signal generation hardware. The preset parameters include the square wave excitation signal frequency f. ex c. Peak voltage U ex c- max Rise time Falling edge time tp all and duty cycle D ex c; Simultaneously, receive excitation signal monitoring data from external voltage sensors in real time, calculate voltage fluctuation rate and determine excitation signal stability, and output test stop command and error message when unstable.

[0238] The response signal acquisition and preprocessing module is used to receive the secondary-side induced response signal of the metering device acquired by the external Hall current sensor, and sequentially execute the filtering algorithm, baseline drift correction algorithm and amplitude scaling algorithm to preprocess the acquired signal to generate a standardized response signal; at the same time, based on the rising edge synchronization signal of the excitation signal output by the excitation signal virtual generation module, the preprocessed signal and the excitation signal are synchronized in time, the synchronization error is verified, and an error prompt is output when the error exceeds the limit.

[0239] The multi-dimensional judgment algorithm execution module integrates the square wave excitation signal output by the excitation signal virtual generation module and the standardized response signal output by the response signal acquisition and preprocessing module, extracting three major characteristic parameters: phase difference, delay time, and amplitude. It then sequentially executes the polarity judgment algorithm, phase sequence judgment algorithm, and on / off judgment algorithm. When the on / off judgment is normal, it fuses the polarity and phase sequence judgment results through weight allocation to obtain a preliminary comprehensive judgment result P. pre ;

[0240] AI Fusion Judgment Module: Used to load the improved convolutional neural network (CNN) model and integrate the preliminary comprehensive judgment result P output by the multi-dimensional judgment algorithm execution module. pre The extracted feature parameters are input into the model, and the AI ​​judgment result and confidence level are output. The preliminary comprehensive judgment result and the AI ​​judgment result are fused by the preset weight allocation rule to obtain the final polarity judgment conclusion.

[0241] Test Result Visualization Output Module: This module receives the final judgment from the AI ​​fusion judgment module, generates structured test data including the final conclusion, feature parameters, confidence level, and test time, and visualizes the final conclusion and excitation and response signal waveforms through a virtual interactive interface. It also supports the storage and export of structured test data.

[0242] In the virtual generation module for the excitation signal, the preset parameter value range is: f ex c∈[50Hz,1kHz]、U ex c- max ∈[5V,30V]、 tp all ≤1μs, D ex c = 0.5.

[0243] The test result visualization output module supports generating structured test data in JSON or CSV format. The visualization content includes an overlay of stimulus and response waveforms, a CNN attention heatmap, and a list of core parameters. It also supports exporting test data and backing it up to the cloud via USB, Bluetooth, or WiFi.

[0244] Application scenarios:

[0245] A polarity test was conducted on a single-phase current transformer of model LZZBJ9-220 in a 220kV substation (power frequency interference 50Hz, electromagnetic radiation noise superposition, signal-to-noise ratio 18dB).

[0246] Operating steps:

[0247] 1. Host preset excitation parameters: f ex c = 200Hz, U ex c- max =12V, A square wave excitation is generated by the DDS module, and after impedance matching, it is applied to the primary side of the transformer. The voltage fluctuation rate is monitored to be 1.5% (≤3%), and the excitation is stable.

[0248] 2. The Hall current sensor acquires the secondary side response signal, which is then preprocessed by second-order Butterworth bandpass filtering (160-240Hz), 10ms window length baseline correction, and amplitude normalization, with a synchronization error of 0.4μs.

[0249] 3. Extract feature parameters: t nelaγ =22μs, A se c = 0.32V, P1 = 1, P2 = 1, P3 = 1 in sequence, and the preliminary comprehensive result is P pre =1;

[0250] 4. The improved 1D-CNN model takes a dual-channel input signal and outputs p. + =0.96, C_AI=0.96≥0.8, fusion yields P_final=1 (positive polarity);

[0251] 5. The display screen shows the waveform overlay and judgment results in real time, generates a structured report containing the device number and test time, and backs it up to the cloud.

[0252] Application results: The test took 8 seconds under strong interference, with a judgment accuracy of 100%, solving the problem of misjudgment in traditional methods and ensuring the accuracy of substation metering.

[0253] Economic benefits:

[0254] For the addition and capacity expansion of metering devices, polarity verification has been improved from a 3-4 person operation to a single person operation with automatic judgment. On average, each addition and capacity expansion operation saves about 1.5 hours of time. At the same time, each work group only needs 2 people, saving an average of one person per group.

[0255] Social benefits:

[0256] Compared with traditional current transformer polarity testing, it is convenient to use, occupies little space, can be operated by a single person, has extremely low safety risks, and saves manpower and resources.

[0257] Compared to the power outage wiring process of a multimeter's secondary circuit, the wiring tester eliminates the need to remove and reinstall the secondary circuit. This significantly improves the efficiency of meter installation and power connection, while also enhancing the safe and correct operation of metering devices and relay protection devices.

Claims

1. A polarity testing method for a measuring device suitable for high-noise environments, characterized in that, Includes the following steps: S1: Application of excitation signal based on algorithm control: The host system generates a square wave excitation signal with preset parameters and switches the output to the primary side of the metering device. The preset parameters include the square wave excitation signal frequency f. ex c. Peak voltage U ex c- max Rise time Falling edge time tp all and duty cycle D ex c); S2: Acquisition and preprocessing of secondary side response signal of metering device: The secondary side induced response signal of metering device is acquired by Hall current sensor, and the acquired signal is preprocessed by filtering algorithm, baseline drift correction algorithm and amplitude scaling algorithm in sequence, and then transmitted synchronously to host. S3: Signal comparison and multi-dimensional judgment algorithm execution: The host system integrates the primary side excitation signal and the secondary side preprocessed signal, extracts phase, delay time and amplitude characteristic parameters, and executes the polarity judgment algorithm, phase sequence judgment algorithm and on / off judgment algorithm in sequence to obtain the preliminary comprehensive judgment result. S4: Preliminary comprehensive judgment result P based on the output of S3 pre The extracted feature parameters are used to output the judgment result and confidence score through an improved convolutional neural network (CNN) model. The fusion judgment is completed through weight allocation to obtain the final polarity judgment conclusion. S5: Test Result Output: Visualize the final polarity determination conclusion.

2. The polarity testing method for a measuring device suitable for high-noise environments according to claim 1, characterized in that, In S2, the secondary-side induction response signal is acquired: A Hall current sensor is used to collect the induced current signal on the secondary side of the metering device. The current signal is converted into a voltage signal by a signal conditioning circuit and then transmitted to the analog-to-digital converter of the host system for digital conversion. The filtering algorithm described above: A first-order RC low-pass filter is used to initially filter out high-frequency noise. Its transfer function is: Where R1 is the filter resistor, C1 is the filter capacitor, and the cutoff frequency is... Rated output current of the secondary side of the metering device; The discretized recursive formula is: Response signal sampling frequency, preset Satisfies the Nyquist sampling theorem; y1(n)=αy1(n-1)+(1-α)x(n) Cutoff frequency of a first-order low-pass filter; Where x(n) is the signal value of the nth sampling point before filtering, y1(n) is the signal value of the nth sampling point after filtering, y1(n-1) is the signal value of the (n-1)th sampling point after filtering, and α is the filtering coefficient. The sampling period; Adaptive notch filter center frequency; The baseline drift correction algorithm described above: The moving average baseline estimation method is used, and the specific formula is as follows: Where B(n) is the baseline estimate for the nth sampling point. The sliding window length is estimated for the baseline, and y2(i) is the signal value of the i-th sampling point after notch filtering; The corrected signal is: y3(n) = y2(n) - B(n) If |y3(n)|≤A a d r If so, it is determined to be a baseline drift residual signal; The amplitude scaling algorithm described above: To ensure the preprocessed signal matches the input range of subsequent algorithms, a linear scaling formula is used: y4(n)=G scale ×y3(n) Where y4(n) is the scaled signal value of the nth sampling point, G s c ale =1 / max(|y3(n)|), where max(|y3(n)|) is the maximum absolute value of the signal after baseline correction.

3. The polarity testing method for a measuring device suitable for high-noise environments according to claim 1, characterized in that, In S3, the phase extraction is as follows: Hilbert transform is used to extract the signal phase for the primary excitation signal u. ex Both c(n) and the preprocessed response signal y4(n) from the secondary side are subjected to Hilbert transforms to obtain analytic signals: Z exc (n)=u exc (n)+jH[u exc (n)] Z sec (n)=y4(n)+jH[y4(n)] Where H[·] denotes the Hilbert transform, and j is the imaginary unit; The signal phase is the argument of the analytic signal, that is:

4. The polarity testing method for a measuring device suitable for high-noise environments according to claim 1, characterized in that, In S3, the delay time extraction is as follows: The cross-correlation algorithm is used to calculate the time delay between the excitation signal and the response signal. The cross-correlation function is: Where τ is the delay step number and N is the total number of signal sampling points; when R ex c- se When c(τ) reaches its maximum value, the corresponding delay time 5. The polarity testing method for a measuring device suitable for high-noise environments according to claim 1, characterized in that, In S3, the amplitude extraction is as follows: The phase of the nth sampling point of the primary excitation signal; The amplitude A of the secondary response signal is extracted using a peak detection algorithm. se c, i.e., A se c = max(|y4(n)|); The phase of the nth sampling point of the secondary side response signal.

6. The polarity testing method for a measuring device suitable for high-noise environments according to claim 1, characterized in that, In S3, the polarity determination algorithm is as follows: The phase difference between the excitation signal and the response signal, in rad, is calculated as follows: in The phase of the primary side excitation signal, The phase of the secondary side response signal; Polarity determination phase difference threshold, in rad, with a preset value range of (π / 2, 3π / 2), is used to distinguish between positive and negative polarity; Execution logic: Based on phase difference With threshold The comparison results determine the polarity; when When the polarity of the measuring device is positive, the output polarity determination result P1 = 1; when When the polarity of the measuring device is reversed, the polarity determination result P1 = -1 is output. The phase sequence determination algorithm described above: t nelaγ The delay time of the response signal relative to the excitation signal, in μs; for a three-phase metering device, the delay times corresponding to the A, B, and C phase signals are t, respectively. nelaγ-a t nelaγ-β t nelaγ -c; t nelaγ-th Delay time threshold; Execution logic: Phase sequence determination is achieved based on the relationship between delay times and threshold comparison; for three-phase metering devices, when t... nelaγ-a <t nelaγ-β <t nelaγ- c, and the delay time of each phase is ≤t. nelaγ-th When the phase sequence is determined to be positive, the phase sequence determination result P2 = 1 is output; when t is satisfied... nelaγ-a >t nelaγ-β >t nelaγ -c and the delay time of each phase is ≤t nelaγ-th When the phase sequence is determined to be reversed, the phase sequence determination result P2 = -1 is output. If the delay time of any phase is greater than t nelaγ-th If the phase sequence is determined to be abnormal, the phase sequence determination result P2 = 0 is output; for single-phase metering devices, there is no reverse phase sequence problem by default, and the phase sequence determination result P2 = 1 is output directly. The aforementioned on / off determination algorithm: A se c: Amplitude of the secondary response signal, i.e., A se c = max(|y4(n)|), where y4(n) is the preprocessed standardized signal; A se c- th : Response signal amplitude threshold; Execution logic: Based on the amplitude A of the response signal se c and threshold A se c- th The comparison results are used to determine whether the circuit is open or closed; when A se c≥A se c- th When A is on, the metering device is determined to be on, and the on / off determination result P3 = 1 is output; when A se c se c- th When the metering device is disconnected, the on / off determination result P3=0 is output and all subsequent determination processes are terminated immediately, and the test conclusion of equipment failure is directly output.​ The aforementioned preliminary comprehensive judgment When the on / off determination result P3 = 1, and the phase sequence determination result P2 ≠ 0, a preliminary comprehensive determination is made by combining the polarity and phase sequence determination results. The formula is as follows: P pre =sign(W 11 P1+W 12 P2) Among them, W 11 Polarity determination weight (preset W) 11 =0.6), W 12 Phase sequence determination weight (preset W) 12 =0.4), satisfying W 11 +W 12 =1; sign(·) is the sign function. When the input is positive, it outputs 1, which initially determines that the input is positive / positive phase sequence. When the input is negative, it outputs -1, which initially determines that the input is negative / reverse phase sequence.

7. The polarity testing method for a measuring device suitable for high-noise environments according to claim 1, characterized in that, In S4, the improved CNN model includes an input layer, four convolutional layers, two pooling layers, one fully connected layer, and an output layer. The output layer has two neurons, corresponding to two output types: forward / positive phase and backward / inverse phase. The activation function is Softmax. The training and inference of the improved CNN model are as follows: like If the polarity is determined to be positive, the polarity determination result P1 = 1 is output. like The polarity is then determined to be reversed, and the polarity determination result P1 = -1 is output. The model is trained using a sample set of metering device response signals of different polarities and phase sequences under high-noise conditions. The training optimizer is Adam, and the loss function is the cross-entropy loss function. Where y represents the real label. Predict probabilities for the model; The preprocessed current response signal sequence is input into the trained improved CNN model. The model outputs the probabilities of the two types of results. The result corresponding to the maximum probability is taken as the AI ​​recognition polarity result P, where 1 represents forward / positive phase sequence and -1 represents reverse / inverted phase sequence. At the same time, the confidence level C of the result is also output. If the actual delay relationship satisfies t nelaγ-a <t nelaγ-β <t nelaγ If -c is selected, the phase sequence is determined to be positive, and the phase sequence determination result P2 = 1 is output. The aforementioned fusion determination: Based on the preliminary comprehensive judgment results P Pre And AI recognition results P AI The fusion determination is performed in two cases: If the actual delay relationship is t nelaγ-a >t nelaγ-β >t nelaγ If -c is selected, the phase sequence is determined to be reversed, and the phase sequence determination result P2 = -1 is output. (1) When At that time, the fusion determination formula is: P final =sign(W1P pre +W2P AI ) W1: Weight of preliminary comprehensive judgment result; W2: Weight of AI recognition result. (2) When If the AI ​​recognition result is insufficient, the fusion judgment result is taken as the preliminary comprehensive judgment result, and the prompt message indicating insufficient confidence of AI recognition is recorded. Based on the fusion determination result P, the final polarity determination conclusion is output: when P=1, the polarity is correct and the phase sequence is normal; when P=-1, the polarity is incorrect / the phase sequence is reversed.

8. A polarity testing system for a measuring device suitable for high-noise environments, characterized in that, It includes a virtual generation module for excitation signals, a preprocessing module for acquisition of response signals, a multi-dimensional judgment algorithm execution module, an AI fusion judgment module, and a test result visualization output module; Each module works in sequence and is connected to the host system control. Virtual excitation signal generation module: used to generate a square wave excitation signal based on preset parameters and output virtual excitation control commands to external signal generation hardware. The preset parameters include the square wave excitation signal frequency f. ex c. Peak voltage U ex c- max Rise time Falling edge time tp all and duty cycle D ex c; Simultaneously, receive excitation signal monitoring data from external voltage sensors in real time, calculate voltage fluctuation rate and determine excitation signal stability, and output test stop command and error message when unstable. Response signal acquisition and preprocessing module: It is used to receive the secondary side induction response signal of the metering device acquired by the external Hall current sensor, and sequentially execute the filtering algorithm, baseline drift correction algorithm and amplitude scaling algorithm to preprocess the acquired signal to generate a standardized response signal; at the same time, based on the rising edge synchronization signal of the excitation signal output by the excitation signal virtual generation module, it completes the time synchronization alignment between the preprocessed signal and the excitation signal, verifies the synchronization error, and outputs an error prompt when the error exceeds the limit; Multi-dimensional judgment algorithm execution module: used to integrate the square wave excitation signal output by the excitation signal virtual generation module and the standardized response signal output by the response signal acquisition and preprocessing module, and extract the three major characteristic parameters of phase difference, delay time and amplitude; The polarity determination algorithm, phase sequence determination algorithm, and on / off determination algorithm are executed sequentially. If the on / off determination is normal, the polarity and phase sequence determination results are fused by weight allocation to obtain a preliminary comprehensive determination result P. pre ; AI Fusion Judgment Module: Used to load the improved convolutional neural network (CNN) model and integrate the preliminary comprehensive judgment result P output by the multi-dimensional judgment algorithm execution module. pre The extracted feature parameters are input into the model, and the AI ​​judgment result and confidence level are output. The preliminary comprehensive judgment result and the AI ​​judgment result are fused by the preset weight allocation rule to obtain the final polarity judgment conclusion. Test Result Visualization Output Module: This module receives the final judgment from the AI ​​fusion judgment module, generates structured test data including the final conclusion, feature parameters, confidence level, and test time, and visualizes the final conclusion and excitation and response signal waveforms through a virtual interactive interface. It also supports the storage and export of structured test data.

9. The polarity testing system for a measuring device suitable for high-noise environments according to claim 8, characterized in that, In the virtual generation module for the excitation signal, the preset parameter value range is: f ex c∈[50Hz,1kHz]、U ex c- max ∈[5V,30V]、 tp all ≤1μs, D ex c = 0.

5.

10. The polarity testing system for a measuring device suitable for high-noise environments according to claim 8, characterized in that, The test result visualization output module supports generating structured test data in JSON or CSV format. The visualization content includes an overlay of stimulus and response waveforms, a CNN attention heatmap, and a list of core parameters. It also supports exporting test data and backing it up to the cloud via USB, Bluetooth, or WiFi.