An intelligent electric meter interference detection method, device, equipment and medium

By acquiring and comprehensively judging the interference waveforms of smart meters through dual channels, the problem of single detection dimension in existing technologies is solved, enabling accurate identification and reasonable protection against interference types, and improving the operational reliability of smart meters.

CN123136512APending Publication Date: 2026-11-20SHENZHEN STAR INSTR
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611337919.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing smart meters have limited interference detection capabilities and are inaccurate, failing to effectively distinguish between reed switch tip discharge interference and electrostatic discharge interference, leading to abnormal metering data and equipment damage.

Method used

The system employs dual-channel acquisition of interference waveforms from smart meters. Pulse width, quantity, and average level within each short-term statistical window are calculated using pulse extraction and level extraction respectively. These parameters are then combined with a long-term sliding window for comprehensive judgment. Offline training is used to determine preset thresholds and judgment rules to identify interference types and merge the results.

Benefits of technology

This improves the accuracy and reliability of interference detection, avoids feature loss and occasional noise misjudgment caused by single-dimensional detection, and ensures the operational stability of smart meters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123136512A_ABST
    Figure CN123136512A_ABST
Patent Text Reader

Abstract

The present application relates to the field of smart meters, and discloses a smart meter interference detection method, device, equipment and medium, comprising: collecting interference waveforms through a first collection channel and a second collection channel respectively; performing pulse extraction on the interference waveforms collected by the first collection channel, calculating the pulse width and the number of pulses in each short-time statistical window to obtain a first statistical result; performing level extraction on the interference waveforms collected by the second collection channel, calculating the average value of the level in each short-time statistical window to obtain a second statistical result; determining a first interference event corresponding to the first collection channel and a second interference event corresponding to the second collection channel based on the first statistical result and the second statistical result of each short-time statistical window included in a long-time sliding window; and merging the first interference event and the second interference event to determine the interference result of the smart meter. The problem of single detection dimension and inaccurate detection of the smart meter interference in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart meters, and more particularly to a method, apparatus, device, and medium for detecting interference in smart meters. Background Technology

[0002] As the core equipment for end-point metering in the power system, smart meters undertake key functions such as energy metering, data acquisition, communication transmission, and fee control management, and are widely deployed in various electricity consumption scenarios such as residential communities, industrial and commercial users, industrial parks, and public facilities. With the in-depth advancement of smart grid construction, the number of installed smart meters continues to grow, and their operational reliability is directly related to the metering accuracy and operational stability of the power system.

[0003] In actual operation, smart meters are exposed to various complex electromagnetic environments and face multiple types of electromagnetic interference threats. Among them, reed switch tip discharge interference and electrostatic discharge interference are two of the most common and serious types of interference. Reed switch tip discharge interference is usually generated by the reed switch relay inside or near the smart meter when it is switched on or off. It manifests as a continuous high-frequency narrow pulse train with a high pulse repetition frequency and a relatively slow rise edge. Electrostatic discharge interference is usually caused by factors such as human contact, equipment operation, and dry environment. It is characterized by high voltage (up to thousands to tens of thousands of volts), extremely short rise time (nanosecond level), and large single-pulse energy. All of the above interferences can cause serious consequences such as abnormal smart meter readings, MCU reset, program crashes, corrupted stored data, and communication interruptions, and may even lead to permanent damage to the meter.

[0004] Current traditional smart meter interference detection solutions in the industry generally adopt a multi-channel independent detection architecture. Multiple hardware detection I / O ports are configured for external interrupt triggering. In the interrupt service routine, simple software filtering is used to determine whether a waveform represents a valid interference event. Specifically, the detection logic of this traditional solution is as follows: if a certain number of valid waveforms are detected per second for several consecutive seconds on a certain channel, then an interference event is determined to have occurred on that channel. A simple "OR" logic is used between multiple channels; if any channel is true, then the entire system is considered to have interference.

[0005] Existing technologies for smart meter interference detection suffer from limited dimensions and inaccurate results. Summary of the Invention

[0006] This invention provides a method, apparatus, computer equipment, and storage medium for detecting interference in smart meters, in order to solve the problems of limited dimensions and inaccurate detection in existing smart meter interference detection technologies.

[0007] In a first aspect, a method for detecting interference in a smart meter is provided, comprising: acquiring interference waveforms in the smart meter through a first acquisition channel and a second acquisition channel respectively; extracting pulses from the interference waveforms acquired by the first acquisition channel, calculating the pulse width and pulse number within each short-time statistical window to obtain a first statistical result; extracting the level from the interference waveforms acquired by the second acquisition channel, calculating the average level within each short-time statistical window to obtain a second statistical result; determining a first interference event corresponding to the first acquisition channel based on the first statistical results corresponding to each of the multiple short-time statistical windows contained in a long-time sliding window; determining a second interference event corresponding to the second acquisition channel based on the second statistical results corresponding to each of the multiple short-time statistical windows contained in the long-time sliding window; and merging the first interference event and the second interference event to determine the interference result of the smart meter.

[0008] Optionally, based on the first statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window, a first interference event corresponding to the first acquisition channel is determined; based on the second statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window, a second interference event corresponding to the second acquisition channel is determined, including: a single long-term sliding window contains multiple short-term statistical windows that are sequentially continuous and have the same specifications; for the first acquisition channel, the pulse width and pulse number in the first statistical results corresponding to each short-term statistical window are compared with preset pulse width thresholds and preset number thresholds for different interference types to obtain the interference type corresponding to the short-term statistical window; for the second acquisition channel, the average level in the second statistical results corresponding to each short-term statistical window is compared with a preset level threshold to obtain a marking result indicating whether interference exists in the short-term statistical window; combining the interference types or marking results corresponding to all short-term statistical windows in the long-term sliding window, and combining with preset judgment rules, the interference event of the corresponding acquisition channel is comprehensively determined.

[0009] Optionally, the interference types corresponding to the first acquisition channel include reed switch tip discharge interference and electrostatic discharge interference; when reed switch tip discharge interference and electrostatic discharge interference features are matched simultaneously within the same short-time statistical window, the interference type of the short-time statistical window is determined to be electrostatic discharge interference.

[0010] Optionally, the preset pulse width threshold, preset quantity threshold, and preset level threshold are determined through offline training. Specifically, this includes: collecting reed switch tip discharge interference waveforms, electrostatic discharge interference waveforms, level abnormality waveforms, and noise waveforms under different discharge voltages, discharge distances, and operating conditions, and labeling them as four categories: reed switch tip discharge, electrostatic discharge, level abnormality, and noise, to construct a sample dataset; performing denoising and fitting preprocessing on the waveforms in the sample dataset; extracting pulse width, rise time, fall time, and pulse quantity features from the reed switch tip discharge interference waveform and electrostatic discharge interference waveform; and extracting the level average and level variance features from the level abnormality waveform and noise waveform; inputting the extracted features and corresponding waveform type labels into the classification model for training; and based on the trained classification model, statistically determining the preset pulse width threshold and preset quantity threshold corresponding to reed switch tip discharge and electrostatic discharge interference, as well as the preset level threshold for determining level abnormality.

[0011] Optionally, the first interference event and the second interference event are merged to determine the interference result of the smart meter, including: when the first acquisition channel determines that there is an interference event, the interference type corresponding to the first interference event is taken as the interference result of the smart meter; when there is no interference event in the first acquisition channel and the second acquisition channel determines that there is an interference event, the abnormal output level is taken as the interference result of the smart meter; when there is no interference event in both the first acquisition channel and the second acquisition channel, the smart meter is determined to be free of interference.

[0012] Optionally, preset judgment rules include: if the pulse width and pulse number of a single short-term statistical window meet the preset pulse width threshold and preset number threshold for the corresponding electrostatic discharge interference, then the short-term statistical window is marked as having electrostatic discharge interference; if the pulse width and pulse number of a single short-term statistical window meet the preset pulse width threshold and preset number threshold for the corresponding reed tip discharge interference, then the short-term statistical window is marked as having reed tip discharge interference; the total number of short-term statistical windows marked as having electrostatic discharge interference and the total number of short-term statistical windows marked as having reed tip discharge interference within the long-term sliding window are counted respectively; if the total number of short-term statistical windows corresponding to electrostatic discharge interference exceeds half of the total number of short-term statistical windows contained in the long-term sliding window, then an electrostatic discharge interference event for the first acquisition channel is generated; if the total number of short-term statistical windows corresponding to several reed tip discharge interferences exceeds half of the total number of short-term statistical windows contained in the long-term sliding window, then a reed tip discharge interference event for the first acquisition channel is generated.

[0013] Optionally, the preset judgment rules also include: if the average level of a single short-term statistical window exceeds a preset level threshold, then mark the short-term statistical window as having interference; count the total number of short-term statistical windows marked as having interference within the long-term sliding window; if the total number of short-term statistical windows marked as having interference exceeds half of the total number of short-term statistical windows contained in the long-term sliding window, then generate an interference event for the second acquisition channel.

[0014] Secondly, a smart meter interference detection device is provided, comprising: a data acquisition module for acquiring interference waveforms in the smart meter through a first data acquisition channel and a second data acquisition channel respectively; an extraction module for extracting pulses from the interference waveforms acquired by the first data acquisition channel, calculating the pulse width and pulse number of pulses within each short-time statistical window to obtain a first statistical result; extracting the level of the interference waveforms acquired by the second data acquisition channel, calculating the average level within each short-time statistical window to obtain a second statistical result; a determination module for determining a first interference event corresponding to the first data acquisition channel based on the first statistical results corresponding to each of the multiple short-time statistical windows contained in a long-time sliding window; and determining a second interference event corresponding to the second data acquisition channel based on the second statistical results corresponding to each of the multiple short-time statistical windows contained in the long-time sliding window; and a merging module for merging the first interference event and the second interference event to determine the interference result of the smart meter.

[0015] Thirdly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described smart meter interference detection method.

[0016] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the above-described smart meter interference detection method.

[0017] This invention provides a method, apparatus, device, and medium for detecting interference in smart meters, comprising: acquiring interference waveforms in a smart meter through a first acquisition channel and a second acquisition channel; extracting pulses from the interference waveforms acquired by the first acquisition channel, calculating the pulse width and pulse count within each short-term statistical window to obtain a first statistical result; extracting the level of the interference waveforms acquired by the second acquisition channel, calculating the average level within each short-term statistical window to obtain a second statistical result; determining a first interference event corresponding to the first acquisition channel based on the first statistical results corresponding to each of the multiple short-term statistical windows contained in a long-term sliding window; determining a second interference event corresponding to the second acquisition channel based on the second statistical results corresponding to each of the multiple short-term statistical windows contained in the long-term sliding window; and merging the first and second interference events to determine the interference result of the smart meter. This invention, by extracting different features of the interference waveform, characterizes the interference waveform from different dimensions, avoiding feature loss caused by a single dimension; the long-term sliding window comprehensively judges the results of multiple short-term statistical windows, filtering out single-window misjudgments caused by occasional noise. Therefore, it solves the problems of single-dimensional interference detection and inaccurate detection in existing technologies for smart meters. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the smart meter interference detection method provided in an embodiment of the present invention; Figure 2 This is another schematic flowchart of the smart meter interference detection method provided in this embodiment of the invention; Figure 3 This is another schematic flowchart of the smart meter interference detection method provided in this embodiment of the invention; Figure 4 This is a schematic diagram of the structure of the smart meter interference detection device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0022] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0023] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," or "in response to determination." Similarly, the phrase "if determined" or "if matched to [described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once matched to [described condition or event]," or "in response to matched to [described condition or event]."

[0024] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0025] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0026] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0027] The following provides a detailed description of the smart meter interference detection method, device, equipment, and medium provided in the embodiments of the present invention.

[0028] like Figure 1 The diagram shown is a flowchart of a smart meter interference detection method provided by an embodiment of the present invention. Specifically, it may include the following steps: S101. The interference waveform in the smart meter is acquired through the first acquisition channel and the second acquisition channel respectively.

[0029] In this step, the first and second acquisition channels synchronously begin acquiring interference waveforms at the same sampling start time.

[0030] S102. Perform pulse extraction on the interference waveform acquired by the first acquisition channel, calculate the pulse width and pulse number of pulses in each short-time statistical window, and obtain the first statistical result; perform level extraction on the interference waveform acquired by the second acquisition channel, calculate the average level in each short-time statistical window, and obtain the second statistical result.

[0031] In this step, pulse extraction is performed on the interference waveform acquired by the first acquisition channel: whenever a rising edge of a pulse is detected, a timer is started to count; whenever a falling edge of a pulse is detected, the timer count is stopped, the count value is read, and the pulse width is calculated. The pulse width and corresponding timestamp of each pulse are stored in a circular buffer. At the end of each short statistical window (1 second), the system reads all pulse data stored in the past second from the circular buffer, counts the number of pulses N, and records the pulse width of each pulse, forming the first statistical result of that window. The first statistical result includes the number of pulses N and a list of pulse width values ​​for all pulses within that window, reflecting the pulse morphology characteristics of the interference waveform.

[0032] Simultaneously, the interference waveform acquired by the second acquisition channel is subjected to level extraction: the ADC continuously samples the low-pass filtered signal at a sampling rate of 1kHz, and each sample value is stored in the sampling buffer. At the end of each short statistical window (1 second), the system reads all sample values ​​(1000 in total) from the sampling buffer within the past second, calculates their arithmetic mean as the average level V_avg of that window, and forms the second statistical result of that window. The second statistical result includes only the average level V_avg, which reflects the overall strength of the interference. The higher the average level, the greater the overall strength of the interference; when there is no interference, the average level stabilizes near the baseline value.

[0033] The short-term statistical window settlement of the two channels is triggered by the same 1-second time base event, ensuring that the first and second statistical results correspond one-to-one in time, providing a basis for the synchronous statistics of the subsequent long-term sliding window.

[0034] S103. Based on the first statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window, determine the first interference event corresponding to the first acquisition channel; based on the second statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window, determine the second interference event corresponding to the second acquisition channel.

[0035] In this step, the system maintains two independent long-term sliding windows, corresponding to the first and second acquisition channels respectively. Each long-term sliding window contains 10 short-term statistical windows that are sequentially consecutive and have the same specifications, with a total duration of 10 seconds. It is updated using a sliding method, moving forward one window position every second.

[0036] For the first acquisition channel, whenever a new short-term statistical window generates a first statistical result, the pulse width and pulse count of that window are compared with preset pulse width thresholds and preset count thresholds corresponding to reed tip discharge interference and electrostatic discharge interference, respectively, to obtain the interference type label corresponding to that short-term statistical window. This label is then added to the long-term sliding window label queue of the first channel, while the oldest label in the queue is removed, achieving a sliding update. After the update is complete, the number of windows labeled as reed tip discharge interference and the number of windows labeled as electrostatic discharge interference in the statistical queue are used to comprehensively determine whether a first interference event is generated and the type of the interference event, according to a preset judgment rule (more than half). The first interference event carries specific interference type information.

[0037] For the second acquisition channel, whenever a new short-term statistical window generates a second statistical result, the average level of that window is compared with a preset level threshold. If the average level exceeds the preset level threshold, it indicates that the overall interference intensity within that window has exceeded the limit, and the short-term statistical window is marked as having interference; otherwise, it is marked as having no interference. This mark is then added to the long-term sliding window mark queue of the second channel, while the oldest mark in the queue is removed, achieving a sliding update. After the update is complete, the number of windows marked as having interference in the statistical queue is used to comprehensively determine whether to generate a second interference event based on a preset judgment rule (more than half). The second interference event does not carry interference type information; it only indicates that the overall interference intensity continues to exceed the limit.

[0038] S104. Merge the first interference event and the second interference event to determine the interference result of the smart meter.

[0039] In this step, the system merges the first interference event of the first acquisition channel and the second interference event of the second acquisition channel, adopting a merging strategy of prioritizing the first channel and supplementing the second channel. Specifically: when the first acquisition channel determines that an interference event exists, regardless of whether the second acquisition channel determines that an interference event exists, the interference type corresponding to the first interference event (reed switch tip discharge interference or electrostatic discharge interference) is used as the interference result of the smart meter; when the first acquisition channel has no interference event but the second acquisition channel determines that an interference event exists, an abnormal output level is used as the interference result of the smart meter, indicating that interference exists but the first channel has not identified the specific type; when neither the first nor the second acquisition channel has an interference event, the smart meter is determined to be free of interference.

[0040] The reason for prioritizing the first acquisition channel in the merging strategy is that the first acquisition channel can identify specific interference types, and its detection results have higher decision-making value, providing a basis for smart meters to adopt differentiated protection strategies. The second acquisition channel can only determine whether the overall intensity of the interference exceeds the standard, but cannot distinguish specific types, serving as a supplement and fallback to the first channel. When the first channel has detected pulse-type interference and identified its type, even if the second channel simultaneously detects that the overall intensity exceeds the standard, the specific type of pulse-type interference is output first, so that the smart meter can take targeted protection measures. Only when the first channel fails to detect pulse-type interference (possibly due to atypical pulse morphology) while the second channel detects that the overall intensity exceeds the standard, is the result of the second channel used as the final output, achieving fallback detection of interference with excessive overall intensity. This merging strategy ensures both priority identification of interference types and avoids missed detections due to atypical pulse morphology.

[0041] This invention provides a method for detecting interference in smart meters, comprising: acquiring interference waveforms in a smart meter through a first acquisition channel and a second acquisition channel; extracting pulses from the interference waveforms acquired through the first acquisition channel, calculating the pulse width and number of pulses within each short-term statistical window to obtain a first statistical result; extracting the level of the interference waveforms acquired through the second acquisition channel, calculating the average level within each short-term statistical window to obtain a second statistical result; determining a first interference event corresponding to the first acquisition channel based on the first statistical results corresponding to each of the multiple short-term statistical windows contained in a long-term sliding window; determining a second interference event corresponding to the second acquisition channel based on the second statistical results corresponding to each of the multiple short-term statistical windows contained in the long-term sliding window; and merging the first and second interference events to determine the interference result of the smart meter. This invention, by extracting different features of the interference waveform, characterizes the interference waveform from different dimensions, avoiding feature loss caused by a single dimension; the long-term sliding window comprehensively judges the results of multiple short-term statistical windows, filtering out misjudgments caused by occasional noise in a single window. Therefore, it solves the problems of single-dimensional and inaccurate detection of interference in smart meters in the prior art.

[0042] like Figure 2 The diagram shown is a flowchart illustrating the event determination step in the smart meter interference detection method provided by an embodiment of the present invention. The process specifically includes: S201. A single long-term sliding window contains multiple short-term statistical windows that are sequentially continuous and have the same specifications.

[0043] In this embodiment, the length of a single short-term statistical window is 1 second, and a single long-term sliding window contains 10 consecutive 1-second short-term statistical windows, with a total duration of 10 seconds. The long-term sliding window slides second by second in 1-second increments, updating the statistical results of the short-term statistical windows within the long-term sliding window with each slide, always retaining the statistical data from the most recent 10 seconds. The duration of the long-term sliding window is an integer multiple of the length of the short-term statistical window, which is 10 times in this embodiment. The design basis for using a 10-second long-term window is that reed switch tip discharge interference and electrostatic discharge interference are usually persistent, with a duration generally between several seconds and tens of seconds. A 10-second window can effectively capture persistent interference while avoiding excessive detection delay caused by an excessively long window.

[0044] S202. For the first acquisition channel, the pulse width and pulse number in the first statistical result corresponding to each short-term statistical window are compared with the preset pulse width threshold and preset number threshold for different interference types to obtain the interference type corresponding to the short-term statistical window.

[0045] In the specific implementation, after the timing of each short-term statistical window ends, a threshold comparison is immediately performed. The pulse width of all pulses within the short-term statistical window is compared with the preset pulse width threshold corresponding to reed switch tip discharge interference and the preset pulse width threshold corresponding to electrostatic discharge interference, respectively. At the same time, the number of pulses within the short-term statistical window is compared with the preset number threshold corresponding to each of the two types of interference. If both the pulse width and the pulse number meet the threshold conditions for one type of interference, the short-term statistical window is marked as the corresponding interference type; if neither threshold condition is met, the short-term statistical window is marked as having no interference. If the same window meets the threshold conditions for both types of interference, it is marked as electrostatic discharge interference according to the priority rule. The marking results of all short-term statistical windows are stored in a marking queue in chronological order for use in long-term sliding window statistics.

[0046] S203. For the second acquisition channel, compare the average level in the second statistical result corresponding to each short-term statistical window with the preset level threshold to obtain a marking result indicating whether there is interference in the short-term statistical window.

[0047] In the specific implementation, after the timing of each short-term statistical window ends, the average level V_avg of that window is compared with a preset level threshold V_th. If V_avg exceeds V_th, it indicates that the overall intensity of interference within that window has exceeded the limit, and the short-term statistical window is marked as having interference; otherwise, the short-term statistical window is marked as having no interference. The marking result of the second acquisition channel does not distinguish between interference types, but only provides a binary label (interference present or no interference). The preset level threshold here is determined based on the baseline level under interference-free conditions plus a certain margin. When the average level exceeds this threshold, it indicates that there is interference intensity sufficient to affect the normal operation of the meter.

[0048] S204. Combining the interference types or marking results corresponding to all short-term statistical windows within the long-term sliding window, and in conjunction with preset judgment rules, the interference events of the corresponding acquisition channel are comprehensively judged.

[0049] After the long-term sliding window completes one slide, the marking results of all short-term statistical windows within the statistical window are used to determine the current interference event for that acquisition channel according to preset judgment rules. The first and second acquisition channels execute this step independently, each generating its corresponding interference event.

[0050] like Figure 3 The diagram shown illustrates the offline training process for determining thresholds in the smart meter interference detection method provided by this invention. The preset pulse width threshold, preset quantity threshold, and preset level threshold are determined through offline training, specifically including: S301. Collect reed switch tip discharge interference waveforms, electrostatic discharge interference waveforms, level abnormal waveforms, and noise waveforms under different discharge voltages, different discharge distances, and different operating conditions, and label them as four categories: reed switch tip discharge, electrostatic discharge, level abnormality, and noise, to construct a sample dataset.

[0051] The waveform acquisition process utilizes a digital oscilloscope with a sampling rate of at least 200 MS / s to collect interference waveforms under different operating conditions. For reed switch tip discharge interference, it is generated by frequently switching the reed relays inside the smart meter, covering different load current conditions (no load, light load, rated load, overload). For electrostatic discharge interference, an electrostatic discharge generator is used to conduct contact discharge and air discharge tests according to the IEC 61000-4-2 standard, with discharge voltages covering the ±2kV to ±8kV range and discharge distances covering typical scenarios of near-distance (direct contact), medium-distance (1 cm to 5 cm), and long-distance (over 5 cm). For waveforms with abnormal levels, waveform samples with overall interference intensity exceeding the standard are collected, including reed switch tip discharge interference of different intensity levels and waveforms with average levels exceeding the standard after low-pass filtering in electrostatic discharge interference, as well as interference waveforms with atypical pulse morphology but overall intensity exceeding the standard. Simultaneously, various noise waveforms present in the environment are collected, including background noise during normal operation, switching power supply noise, and communication module noise.

[0052] After data collection, all waveform samples were manually labeled, with each sample assigned a corresponding type of label: reed switch tip discharge, electrostatic discharge, abnormal level, and noise, thus constructing a sample dataset with four types of labels. It should be noted that the "abnormal level" label refers to samples where the average level of the interference waveform exceeds a preset baseline, reflecting an overall interference intensity exceeding the limit.

[0053] S302. Perform noise reduction and fitting preprocessing on the waveforms in the sample dataset. Extract pulse width, rise time, fall time and pulse number features from the reed switch tip discharge interference waveform and electrostatic discharge interference waveform. Extract the average level and level variance features from the abnormal level waveform and noise waveform.

[0054] After annotation, the sample waveforms are preprocessed. First, high-frequency noise in the waveforms is removed by low-pass filtering. The filter cutoff frequency is set according to the highest frequency component of the interference type. For pulse interference, it is set to 10MHz, and for level interference, it is set to 1kHz. Then, the piecewise linear fitting method is used to locate the key feature points of the waveform, including the start point of the rising edge, the end point of the rising edge (peak point), the start point of the falling edge, and the end point of the falling edge. Based on the location of the feature points, the feature parameters of each waveform are calculated.

[0055] For reed switch tip discharge interference waveforms and electrostatic discharge interference waveforms (pulse type), the following four-dimensional features are extracted: pulse width is the time from the end of the falling edge to the start of the rising edge; rising edge time is the time from the end of the rising edge to the start of the rising edge; falling edge time is the time from the end of the falling edge to the start of the falling edge; and the number of pulses is the number of pulses per unit time. For waveform segments containing multiple pulses, the above parameters are calculated for each pulse, and the average value or statistical distribution is taken as the feature of the sample.

[0056] For waveforms with abnormal levels and noise waveforms, the following two-dimensional features are extracted: the average level is the arithmetic mean of all sampling points after low-pass filtering of the entire waveform segment, reflecting the overall strength of the interference; the level variance is the variance of all sampling points within the entire waveform segment relative to the average value, reflecting the degree of level fluctuation. The average level can be used to determine whether the overall strength of the interference exceeds the limit, while the level variance can be used to distinguish between persistent strength exceeding the limit and random noise fluctuations.

[0057] S303. Input the extracted features and corresponding waveform type labels into the classification model for training.

[0058] The extracted multidimensional features and corresponding type labels are input into the classification model for training. The classification model can be a Support Vector Machine (SVM), Random Forest, Gradient Boosting Tree (GBDT), Fully Connected Neural Network (FCNN), or similar models.

[0059] S304. Based on the completed classification model, the preset pulse width threshold and preset quantity threshold corresponding to the determination of reed switch tip discharge and electrostatic discharge interference are statistically obtained, as well as the preset level threshold for determining abnormal level.

[0060] Based on the trained classification model, the judgment thresholds for each type of interference are statistically obtained. Specifically, for reed switch tip discharge interference and electrostatic discharge interference, the pulse width and pulse number distributions of all samples correctly classified as these types in the test set are statistically analyzed, and the pre-set confidence interval boundaries of each category's feature distribution are taken as the preset pulse width threshold and preset pulse number threshold. For level anomalies, the average level distribution of all samples correctly classified as level anomalies in the test set is statistically analyzed, and the classification boundary between this average level and the noise category is taken as the preset level threshold.

[0061] In one specific embodiment, the thresholds obtained through training are as follows: the preset pulse width threshold for reed switch tip discharge interference is a pulse width of less than 640 microseconds, and the corresponding preset quantity threshold is a pulse count greater than or equal to 20 and less than or equal to 30 within 1 second; the preset pulse width threshold for electrostatic discharge interference is a pulse width greater than or equal to 640 microseconds and less than or equal to 960 microseconds, and the corresponding preset quantity threshold is a pulse count of 1 within 1 second; the preset level threshold for abnormal level is an average level exceeding 120% of the interference-free baseline level (i.e., more than 20% higher than the average level under normal interference-free conditions). The thresholds obtained through training are stored in the Flash parameter area of ​​the smart meter's main control chip for use during detection.

[0062] In one embodiment, the preset judgment rule of the first acquisition channel specifically includes: if the pulse width and pulse number of a single short-time statistical window meet the preset pulse width threshold and preset number threshold of the corresponding electrostatic discharge interference, then the short-time statistical window is marked as having electrostatic discharge interference; if the pulse width and pulse number of a single short-time statistical window meet the preset pulse width threshold and preset number threshold of the corresponding reed tip discharge interference, then the short-time statistical window is marked as having reed tip discharge interference; the total number of short-time statistical windows marked as having electrostatic discharge interference and the total number of short-time statistical windows marked as having reed tip discharge interference within the long-time sliding window are counted respectively; if the total number of short-time statistical windows corresponding to electrostatic discharge interference exceeds half of the total number of short-time statistical windows contained in the long-time sliding window, then an electrostatic discharge interference event of the first acquisition channel is generated; if the total number of short-time statistical windows corresponding to several reed tip discharge interferences exceeds half of the total number of short-time statistical windows contained in the long-time sliding window, then a reed tip discharge interference event of the first acquisition channel is generated.

[0063] In practice, at the end of each 1-second short-term statistical window, it is checked whether there is at least one pulse within the window whose pulse width is within the preset pulse width threshold range for electrostatic discharge interference (e.g., 640 microseconds to 960 microseconds), and whether the number of pulses within the window meets the preset number threshold for electrostatic discharge interference (e.g., equal to 1). If both conditions are met, then electrostatic discharge interference is marked as present in the short-term statistical window.

[0064] Check whether the pulse width of all valid pulses within the window is less than the preset pulse width threshold (e.g., 640 microseconds) for reed tip discharge interference, and whether the number of pulses within the window falls within the preset number threshold range for reed tip discharge interference (e.g., 20 to 30). If both conditions are met, mark the short-time statistical window as containing reed tip discharge interference. If the same window simultaneously meets the threshold conditions for two types of interference, prioritize it as electrostatic discharge interference according to the priority rule.

[0065] Each time the long-term sliding window slides, the number of windows marked as electrostatic discharge interference (M_esd) and the number of windows marked as reed switch tip discharge interference (M_reed) in the current 10 short-term statistical windows are counted.

[0066] If M_esd is greater than 5 (i.e., more than half of the total window size of 10), the first acquisition channel generates an electrostatic discharge (ESD) interference event. The event type is ESD interference, and the event status is "Event Start". If the event is already in an ESD interference event, the event status is maintained; if M_esd drops to 5 or below, the event generation ends.

[0067] If M_reed is greater than 5, the first acquisition channel generates a reed switch tip discharge interference event, the event type is reed switch tip discharge interference, and the event status is event start. If M_reed drops to 5 or below, the event generation ends.

[0068] Using a majority voting mechanism (more than half) to generate interference events can effectively filter out single-window misjudgments caused by occasional noise pulses, improving the reliability of event determination. When the number of windows for both types of interference does not exceed 5, the first acquisition channel is determined to have no interference events.

[0069] In one embodiment, the preset judgment rule of the second acquisition channel specifically includes: if the average level of a single short-term statistical window exceeds a preset level threshold, then the short-term statistical window is marked as having interference; the total number of short-term statistical windows marked as having interference within the long-term sliding window is counted; if the total number of short-term statistical windows marked as having interference exceeds half of the total number of short-term statistical windows contained in the long-term sliding window, then an interference event of the second acquisition channel is generated.

[0070] In the specific implementation, at the end of each 1-second short-term statistical window, the average level V_avg of that window is compared with a preset level threshold V_th. If V_avg exceeds V_th, it indicates that the overall interference intensity within that window has exceeded the limit, and the short-term statistical window is marked as having interference; otherwise, it is marked as having no interference. The marking of the second acquisition channel does not distinguish between specific interference types and is only a binary marking. The preset level threshold here is determined based on the baseline level under interference-free conditions plus a certain margin. When the average level exceeds this threshold, it indicates that there is interference intensity sufficient to affect the normal operation of the meter.

[0071] Each time the long-term sliding window slides, the number of windows marked as having interference in the current 10 short-term statistical windows is counted, M_level.

[0072] If M_level is greater than 5 (i.e., more than half of the total window size of 10), the second acquisition channel generates an interference event, and the event status is "Event Start". If M_level drops to 5 or below, the event generation ends. The interference event of the second acquisition channel does not carry interference type information; it only indicates that the overall interference intensity has been continuously exceeded.

[0073] The complete process of this solution will be described in detail below through a specific application example, so that those skilled in the art can better understand the present invention.

[0074] This solution is deployed in a smart meter using the Fudan Microelectronics FM33M04xER series main control chip. PA0 is configured as the first acquisition channel (pulse detection channel), and PA1 as the second acquisition channel (intensity detection channel). The chip's Flash memory stores threshold parameters obtained from offline training: reed switch tip discharge interference pulse width threshold is less than 640 microseconds, and the number threshold is 20 to 30 pulses per second; electrostatic discharge interference pulse width threshold is 640 to 960 microseconds, and the number threshold is 1 pulse per second; the level anomaly threshold is when the average level exceeds 120% of the interference-free baseline. Timer3 is configured with a 72MHz clock source divided by 71 to a 1MHz counting frequency for pulse width measurement of the first acquisition channel; Timer4 is configured with a 1kHz timer interrupt to trigger ADC sampling of the second acquisition channel.

[0075] During normal operation of the meter, the PA0 pin of the first acquisition channel continuously monitors the pulse signal on the pin through a high-pass filter circuit, and the double-edge interrupt is enabled; the PA1 pin of the second acquisition channel continuously acquires the signal level after low-pass filtering by the ADC at a sampling rate of 1kHz through a low-pass filter circuit.

[0076] When the reed relay inside the smart meter generates continuous tip discharge interference due to frequent load switching, the first acquisition channel first acquires a continuous narrow pulse waveform: after the rising edge triggers an interrupt, a timestamp is recorded and Timer3 counting is started; after the falling edge triggers an interrupt, counting stops. The count value is read and the pulse width is calculated to be 320 microseconds, which falls within the reed tip discharge pulse width range (less than 640 microseconds). This is marked as a valid pulse and stored in the circular buffer. When the current 1-second short-term statistical window ends, the number of valid pulses in the window is 25, which meets the threshold for the number of reed tip discharge interference (20 to 30), and all pulse widths are less than 640 microseconds. Therefore, the 1-second window is marked as having reed tip discharge interference.

[0077] For the next 8 seconds, 20 to 30 pulses with a pulse width of less than 640 microseconds were counted every second, and each window was marked as reed tip discharge interference. At the 10th second, the number of short-time statistical windows corresponding to the reed tip discharge interference was 8, which is more than half of the total number of windows (10). The first acquisition channel determined that a reed tip discharge interference event was generated, the event type was reed tip discharge interference, and the event status was event start.

[0078] Meanwhile, the ADC of the second acquisition channel continuously acquires the signal level after low-pass filtering. Because the reed switch tip discharge interference manifests as a dense, narrow pulse train, with a large proportion of the pulse's high-level duration, the average level (DC component) significantly increases after low-pass filtering, reaching 145% of the interference-free baseline, exceeding the preset level threshold (120% of the baseline). Each short-term statistical window is marked as containing interference. After a 10-second long-term sliding window, the second acquisition channel also generates an interference event.

[0079] During the merging phase, a reed switch tip discharge interference event was detected in the first acquisition channel. Following the merging strategy prioritizing the first channel, the reed switch tip discharge interference was directly output as the smart meter's interference result, and the interference type was reported as reed switch tip discharge interference to the upper-level application. Interference events in the second acquisition channel were recorded as auxiliary information in the event log. Upon receiving the interference result, the smart meter implemented corresponding anti-interference protection measures, such as increasing the frequency of metering data verification, suspending non-critical operations, and reporting the event to the concentrator.

[0080] When the reed relay stops switching, the pulse interference disappears, and the short-term statistical windows of the first acquisition channel are no longer marked as reed tip discharge interference. After a 10-second sliding window, the number of windows corresponding to reed tip discharge interference drops to 5 or below, and the first acquisition channel generates an event end signal. At the same time, the average level of the second acquisition channel falls back to near the baseline and no longer exceeds the threshold, and the second interference event also ends. During the merging phase, if no interference events are detected in either channel, it is determined that the smart meter is interference-free, the interference status mark is cleared, and normal operation resumes.

[0081] In one embodiment, the present invention also provides a smart meter interference detection device. For example... Figure 4 As shown, the smart meter interference detection device includes a data acquisition module 41, an extraction module 42, a judgment module 43, and a merging module 44. Detailed descriptions of each functional module are as follows: Acquisition module 41 is used to acquire interference waveforms in the smart meter through the first acquisition channel and the second acquisition channel respectively; Extraction module 42 is used to extract pulses from the interference waveforms acquired by the first acquisition channel, calculate the pulse width and pulse number of pulses in each short-time statistical window, and obtain the first statistical result; and to extract the level of the interference waveforms acquired by the second acquisition channel, calculate the average level in each short-time statistical window, and obtain the second statistical result. The determination module 43 is used to determine the first interference event corresponding to the first acquisition channel based on the first statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window; and to determine the second interference event corresponding to the second acquisition channel based on the second statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window. The merging module 44 is used to merge the first interference event and the second interference event to determine the interference result of the smart meter.

[0082] This invention also provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the aforementioned smart meter interference detection method; to avoid repetition, this will not be described again here. Alternatively, the electronic device can implement the functions of each module in this embodiment of the smart meter interference detection device; this will also not be described again here.

[0083] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 5 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used for network communication. When the computer program is executed by the processor, it implements the functions or steps of a smart meter interference detection method.

[0084] This invention also provides a readable storage medium storing a program. When the program is executed by a processor, it implements the aforementioned smart meter interference detection method. To avoid repetition, this will not be described again here. Alternatively, when the program is executed by a processor, it implements the functions of each module in this embodiment of the smart meter interference detection device, which will also not be described again here.

[0085] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

[0086] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0087] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

Claims

1. A method for detecting interference in a smart meter, characterized in that, include: The interference waveforms in the smart meter are collected through the first and second acquisition channels, respectively. The interference waveform acquired by the first acquisition channel is pulse extracted, and the pulse width and pulse number of the pulses in each short-time statistical window are calculated to obtain the first statistical result. The interference waveforms acquired by the second acquisition channel are level extracted, and the average level within each short-time statistical window is calculated to obtain the second statistical result. Based on the first statistical results corresponding to each of the multiple short-term statistical windows contained in the long-term sliding window, the first interference event corresponding to the first acquisition channel is determined. Based on the second statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window, the second interference event corresponding to the second acquisition channel is determined. The first interference event and the second interference event are combined to determine the interference result of the smart meter.

2. The smart meter interference detection method according to claim 1, characterized in that, The first interference event corresponding to the first acquisition channel is determined based on the first statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window. Based on the second statistical results corresponding to each of the multiple short-term statistical windows contained in the long-term sliding window, the second interference event corresponding to the second acquisition channel is determined, including: A single long-term sliding window contains multiple short-term statistical windows that are sequentially consecutive and have the same specifications. For the first acquisition channel, the pulse width and pulse number in the first statistical result corresponding to each short-term statistical window are compared with the preset pulse width threshold and preset number threshold for different interference types to obtain the interference type corresponding to the short-term statistical window. For the second acquisition channel, the average level in the second statistical result corresponding to each short-term statistical window is compared with a preset level threshold to obtain a marking result indicating whether there is interference in the short-term statistical window; By combining the interference types or labeling results corresponding to all short-term statistical windows within the long-term sliding window, and in conjunction with preset judgment rules, the interference events of the corresponding acquisition channel are comprehensively judged.

3. The smart meter interference detection method according to claim 2, characterized in that, The interference types corresponding to the first acquisition channel include reed switch tip discharge interference and electrostatic discharge interference; When both reed switch tip discharge interference and electrostatic discharge interference characteristics are matched within the same short-term statistical window, the interference type of that short-term statistical window is determined to be electrostatic discharge interference.

4. The smart meter interference detection method according to claim 2, characterized in that, The preset pulse width threshold, preset quantity threshold, and preset level threshold are determined through offline training, specifically including: The waveforms of reed switch tip discharge interference, electrostatic discharge interference, abnormal level, and noise were collected under different discharge voltages, discharge distances, and operating conditions, and labeled as reed switch tip discharge, electrostatic discharge, abnormal level, and noise, respectively, to construct a sample dataset. The waveforms in the sample dataset are preprocessed for noise reduction and fitting. The pulse width, rise time, fall time and pulse number features are extracted from the reed switch tip discharge interference waveform and electrostatic discharge interference waveform. The level average value and level variance features are extracted from the level abnormal waveform and noise waveform. The extracted features and corresponding waveform type labels are input into the classification model for training; Based on the trained classification model, the preset pulse width threshold and preset number threshold for determining reed switch tip discharge and electrostatic discharge interference, as well as the preset level threshold for determining abnormal level, are statistically obtained.

5. The smart meter interference detection method according to claim 1, characterized in that, The step of merging the first interference event and the second interference event to determine the interference result of the smart meter includes: When the first acquisition channel determines that an interference event exists, the interference type corresponding to the first interference event is taken as the interference result of the smart meter. When there is no interference event in the first acquisition channel and the second acquisition channel determines that there is an interference event, the abnormal output level is taken as the interference result of the smart meter. When there are no interference events in both the first and second acquisition channels, the smart meter is determined to be interference-free.

6. The smart meter interference detection method according to claim 2, characterized in that, The preset determination rules include: If the pulse width and pulse number of a single short-time statistical window meet the preset pulse width threshold and preset number threshold of the corresponding electrostatic discharge interference, then the short-time statistical window is marked as having electrostatic discharge interference. If the pulse width and pulse number of a single short-time statistical window meet the preset pulse width threshold and preset number threshold of the corresponding reed tip discharge interference, then the short-time statistical window is marked as having reed tip discharge interference. The total number of short-term statistical windows marked with electrostatic discharge interference within the long-term sliding window and the total number of short-term statistical windows marked with reed switch tip discharge interference are counted separately. If the total number of short-term statistical windows corresponding to electrostatic discharge interference exceeds half of the total number of short-term statistical windows contained in the long-term sliding window, then an electrostatic discharge interference event for the first acquisition channel is generated. If the total number of short-time statistical windows corresponding to a number of reed tip discharge interferences exceeds half the total number of short-time statistical windows contained in the long-time sliding window, then a reed tip discharge interference event for the first acquisition channel is generated.

7. The smart meter interference detection method according to claim 2, characterized in that, The preset determination rules also include: If the average level of a single short-term statistical window exceeds a preset level threshold, then the short-term statistical window is marked as having interference. The total number of short-term statistical windows marked with interference within a long-term sliding window is counted. If the total number of short-term statistical windows marked as having interference exceeds half the total number of short-term statistical windows contained in the long-term sliding window, then an interference event for the second acquisition channel is generated.

8. A smart meter interference detection device, characterized in that, include: The acquisition module is used to acquire interference waveforms in the smart meter through the first acquisition channel and the second acquisition channel, respectively. The extraction module is used to extract pulses from the interference waveforms acquired by the first acquisition channel, calculate the pulse width and pulse number of pulses in each short-time statistical window, and obtain the first statistical result. The interference waveforms acquired by the second acquisition channel are level extracted, and the average level within each short-time statistical window is calculated to obtain the second statistical result. The determination module is used to determine the first interference event corresponding to the first acquisition channel based on the first statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window. Based on the second statistical results corresponding to the multiple short-term statistical windows contained in the long-term sliding window, the second interference event corresponding to the second acquisition channel is determined. The merging module is used to merge the first interference event and the second interference event to determine the interference result of the smart meter.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the smart meter interference detection method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the smart meter interference detection method as described in any one of claims 1 to 7.