An electric energy metering box electric metering data stability analysis method and electric energy metering box
Patent Information
- Application Number
- CN202611339918.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-09-29
AI Technical Summary
[0004]为了解决现有技术中计量数据稳定性误判率较高的问题,本发明提供一种电能计量箱电计量数据稳定性分析方法及电能计量箱
通过依次执行基于累积和的正向扫描以精准识别负载阶跃断点、利用断点隔离的动态窗口汉佩尔滤波在抑制高频电磁尖峰的同时保留阶跃形态、对分段数据独立执行局部加权回归分解以阻断噪声向趋势项泄漏并获取纯净残差、以及提取残差的相对方差偏移率与峰度系数进行综合概率评分,形成了一个先定位边界、再保边去噪、后分段分解、最后多维量化的处理流程,从而在有效滤除工业现场强电磁干扰和密集脉冲群的同时,完整保留了非线性负载启停的真实物理阶跃特征,解决了噪声平滑与边缘保留之间的固有冲突,降低了计量数据稳定性误判率,为电能计量箱在复杂用电环境下的设备劣化准确辨识和主动运维预警提供了可靠的技术支撑。
Smart Images

Figure CN122838877A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data stability analysis technology, and in particular to a method for analyzing the stability of electricity metering data in an electricity metering box and an electricity metering box. Background Technology
[0002] With the deepening construction of smart grids, electricity metering boxes are being deployed in outdoor environments such as residential areas and industrial parks. The stability of the electricity metering data they collect, such as voltage, current, and active power, directly affects the fairness of electricity billing and the accuracy of grid load forecasting. In actual electricity usage scenarios, a large number of nonlinear loads are connected to the user side, such as new energy vehicle charging piles and high-power variable frequency motors. When these nonlinear loads start and stop, the active power data will show drastic step-like load transients in the time series.
[0003] Currently, existing stability analysis methods in the industry typically employ static threshold comparisons or simple moving average models. These basic methods have significant limitations: legitimate load transients caused by the start-up and shutdown of nonlinear loads manifest as sharp rises or falls in data, making it difficult for traditional algorithms to distinguish them from actual metering degradation caused by aging components within the metering chamber or temperature drift of the sampling chip. More seriously, industrial environments are often accompanied by strong external electromagnetic interference, generating high-frequency, dense clusters of abnormal spike noise pulses in the data. When existing time-series decomposition models attempt to process this data, local regression algorithms are easily contaminated by dense, continuous outliers, leading to significant noise leakage into the trend evaluation term. Furthermore, if conventional smoothing filters are forcibly introduced, their inherent sliding window mechanism can cross the legitimate step edges of nonlinear loads, incorrectly obscuring the physically real step characteristics and ultimately causing a surge in residual anomalies. This technical contradiction between noise smoothing and edge preservation easily leads to misjudging normal physical power transients as metering equipment malfunctions. Summary of the Invention
[0004] To address the problem of high misjudgment rate of metering data stability in existing technologies, this invention provides a method for analyzing the stability of metering data in an energy metering box and an energy metering box itself.
[0005] In a first aspect, the present invention provides a method for analyzing the stability of electricity metering data in an electricity metering box, employing the following technical solution: S1: Collect the power sequence, perform a forward scan on the power sequence, calculate the cumulative drift of the absolute mean at the current moment to identify the load step breakpoint, and store the timestamp corresponding to the load step breakpoint in the dynamic breakpoint set. S2: Based on the dynamic breakpoint set, initialize the sliding analysis window and perform dynamic truncation, calculate the local absolute median difference after truncation, and output the global denoised power sequence by replacing the original sampling points that meet the preset conditions with the local median. S3: Segment the global denoised power sequence at the breakpoints of the dynamic breakpoint set, and independently perform local weighted regression decomposition on the segmented data segments to obtain the clean residual term sequence; S4: Extract the relative variance shift rate and non-Gaussian distribution kurtosis coefficient of the pure residual term sequence, calculate the comprehensive stability score probability value, and determine the current power metering box data instability when the comprehensive stability score probability value exceeds the final warning threshold.
[0006] By accurately identifying load step breakpoints through forward scanning of accumulated drift, and dynamically truncating the sliding window accordingly, high-frequency electromagnetic spikes can be filtered out while the true load step edge is fully preserved. Subsequently, local weighted regression decomposition is performed independently on the segmented data to effectively avoid noise leakage and edge blurring. Finally, a comprehensive probability assessment is performed by combining variance offset rate and kurtosis coefficient, which reduces the misjudgment rate of metering equipment caused by normal power transients.
[0007] Preferably, the power sequence acquisition includes: acquiring the voltage and current signals of the acquisition circuit; extracting features from the voltage and current signals respectively to obtain the root mean square (RMS) values of the voltage and current; multiplying the RMS values of the voltage and current to obtain the instantaneous power value; and downsampling the instantaneous power value to a specific frequency to obtain the power sequence.
[0008] Instantaneous power is obtained by collecting voltage and current signals and calculating the root mean square value. After downsampling, the power sequence is accurately represented by the load change, and the amount of data is greatly compressed, thereby effectively reducing the computing load and storage overhead of the edge computing gateway.
[0009] Preferably, the method for calculating the cumulative absolute mean drift at the current moment is as follows: obtain the cumulative absolute mean drift at the previous moment, the power sequence sample value at the current moment, the reference mean parameter, and the tolerance offset coefficient; obtain the absolute value of the difference between the power sequence sample value at the current moment and the reference mean parameter, subtract the tolerance offset coefficient from the absolute value to obtain the intermediate difference; add the intermediate difference to the cumulative absolute mean drift at the previous moment, and take the maximum value between the sum and 0 as the cumulative absolute mean drift at the current moment.
[0010] The method uses a combination of the accumulated drift from the previous moment and the current sampling deviation for recursive calculation, and introduces a tolerance offset coefficient to suppress random electrical noise. This allows small but continuous mean drift to be effectively accumulated and amplified, thus enabling the structural load change location to be highlighted stably and accurately even in a strong noise background.
[0011] Preferably, identifying load step breakpoints includes: multiplying the decision interval constant by the environmental noise floor standard deviation to obtain the absolute mean cumulative drift warning threshold; when the absolute mean cumulative drift exceeds the absolute mean cumulative drift warning threshold at the current moment, the corresponding timestamp is marked as a load step breakpoint.
[0012] By multiplying the decision interval constant by the standard deviation of the environmental noise floor, an adaptive warning threshold is obtained, which enables the judgment boundary to be dynamically adjusted according to the on-site noise level. This avoids the defects of fixed thresholds being prone to false alarms in low-noise environments and prone to false alarms in high-noise environments, and ensures the robustness and consistency of load step breakpoint identification under different industrial on-site conditions.
[0013] Preferably, the method for calculating the truncated local absolute median is as follows: obtain the local element parameters in the effective sampling point array after being isolated and truncated by the dynamic breakpoint set, and the local median of all local element parameters; calculate the median of the absolute difference between each local element parameter and the local median, and multiply the median of the absolute difference by the normal distribution scaling constant to obtain the local absolute median.
[0014] Within the effective sampling point array after dynamic breakpoint isolation, the median of the absolute difference between each element and the local median is calculated and multiplied by the normal distribution scaling constant. The resulting local absolute median difference serves as a robust dispersion index, effectively resisting interference from extreme spike pulses and truly reflecting the normal fluctuation range of local data, thus providing a stable and reliable statistical benchmark for subsequent spike detection.
[0015] Preferably, the global denoised power sequence is output by replacing the original sampling points that meet preset conditions with the local median, including: multiplying the warning multiplier threshold for determining the peak with the local absolute median difference to obtain the absolute difference threshold; when the absolute difference between the original sampling point and the median of its neighborhood is greater than the absolute difference threshold, the original sampling point is replaced with the corresponding local median to output the global denoised power sequence.
[0016] An adaptive decision boundary is obtained by multiplying the warning multiplier threshold with the local absolute median difference. When the original sampling point deviates from the neighborhood median by more than this boundary, it is replaced. This can not only sensitively capture and suppress high-intensity electromagnetic spike pulses, but also avoid misjudging normal load fluctuations as noise. Thus, the physical change characteristics of the original power sequence are completely preserved while effectively denoising.
[0017] Preferably, obtaining the pure residual term sequence includes: separating the steady-state seasonal term sequence from the global denoised power sequence and extracting the macro trend term sequence; subtracting the macro trend term sequence and the steady-state seasonal term sequence from the global denoised power sequence to obtain the pure residual term sequence.
[0018] Steady-state seasonal terms and macro-trend terms are sequentially separated from the denoised power sequence. Regular components are removed by subtraction, so that the final residual term sequence almost eliminates the influence of periodic electricity consumption behavior and overall load drift. This allows it to truly reflect the random noise components caused by the aging of components or the degradation of the equipment itself, such as sampling temperature drift.
[0019] Preferably, the relative variance offset rate of the pure residual term sequence is extracted by: obtaining the residual variance within the current backtracking window and the initial calibration reference variance extracted during the equipment factory bench calibration stage; and dividing the residual variance by the initial calibration reference variance to obtain the relative variance offset rate.
[0020] Using the initial baseline variance extracted during the equipment's factory bench calibration stage as a reference, the relative deviation rate of the residual variance within the current backtracking window is calculated. This dimensionless index eliminates the differences in the initial noise floor between different devices, making the stability assessment comparable across devices and operating conditions, and enabling it to sensitively capture the gradual deterioration trend of metrological performance over time.
[0021] Preferably, the expression for the probability value of the comprehensive stability score is: in, This represents the probability value of the overall stability score of the output power metering box; Represents the natural constant; This represents the basic bias coefficient constant obtained through offline high-precision bench joint calibration test training. Indicates the variance offset weighted characteristic coefficient; This represents the relative variance offset rate calculated for the residual term sequence within the backtracking historical time window; Represents the kurtosis weighted characteristic coefficient; It represents the kurtosis coefficient of the non-Gaussian distribution of the residual term sequence.
[0022] By using a probability mapping formula in the form of logistic regression, the variance offset rate and hyperkurtosis parameter are nonlinearly integrated into a comprehensive stability score probability value. This takes into account both the two degradation modes of noise energy growth and distribution distortion, and also ensures that the output probability under healthy conditions is suppressed to a low level by using prior coefficients from offline calibration training. Thus, it provides a unified, quantitative and high-confidence decision basis for instability judgment.
[0023] Secondly, the present invention provides an electricity metering box, which adopts the following technical solution: An electricity metering box includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-described method for analyzing the stability of electricity metering data of an electricity metering box is implemented.
[0024] The present invention has the following technical effects: By sequentially performing a forward scan based on cumulative sums to accurately identify load step breakpoints, utilizing dynamic window Hamper filtering with breakpoint isolation to suppress high-frequency electromagnetic spikes while preserving the step shape, independently performing local weighted regression decomposition on segmented data to block noise leakage into the trend term and obtain clean residuals, and extracting the relative variance offset rate and kurtosis coefficient of the residuals for comprehensive probability scoring, a processing flow is formed that first locates the boundary, then preserves the edge and denoises, then segments the data for decomposition, and finally performs multi-dimensional quantization. This effectively filters out strong electromagnetic interference and dense pulse groups in industrial sites while fully preserving the true physical step characteristics of nonlinear load start-stop. It resolves the inherent conflict between noise smoothing and edge preservation, reduces the misjudgment rate of metering data stability, and provides reliable technical support for accurate identification of equipment degradation and proactive maintenance early warning of power metering boxes in complex power environments. Attached Figure Description
[0025] Figure 1 This is a flowchart of a method for analyzing the stability of electricity metering data in an electricity metering box according to the present invention. Detailed Implementation
[0026] 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.
[0027] This invention discloses a method for analyzing the stability of electricity metering data in an electricity metering box, referring to... Figure 1 This includes the following steps: Step S1: Perform forward accumulation and scanning of the power sequence to identify load step breakpoints.
[0028] The physical execution environment is deployed in an edge computing gateway inside the power metering box. Since the system needs to continuously capture the transient start-stop characteristics of nonlinear loads, this embodiment uses the hardware timer interrupt mechanism at the bottom layer of the edge computing gateway to control the voltage transformer and current sampling chip to synchronously collect the voltage and current signals of the circuit at a sampling rate of 128 points per power frequency cycle. Then, feature extraction based on the root mean square (RMS) of single-cycle AC current is performed on the voltage and current signals to obtain the RMS values of voltage and current. The two are multiplied to obtain the instantaneous power value of that cycle. The original high-frequency data is downsampled to a 1Hz power sequence, thereby significantly reducing the edge computing load of subsequent algorithms.
[0029] To accumulate a sufficient dataset before executing batch processing, the system uses the current time... As the endpoint, construct a length along the historical timeline. The first-in-first-out (FIFO) queue buffer transforms the real-time downsampled power sequence into continuous historical raw electricity metering time series data. The sliding window length parameter... The value range is [500, 2000]. For example, The value is 1000 sample points.
[0030] Because real power grids contain a large amount of ambient white noise, directly identifying step changes based on single-point differential detection would result in an extremely high false alarm rate. Therefore, this embodiment uses the CUSUM algorithm to scan historical power sequence data forward along the time axis. By accumulating small, continuous mean drifts, it effectively highlights the location of structural load abrupt changes. The absolute mean cumulative drift at the current moment is calculated using the following expression: in, Indicates the current time The absolute mean cumulative drift; Indicates the previous moment The absolute mean cumulative drift; Indicates the current time The power sequence sample values; This parameter represents the baseline mean of historical power series data under the current operating conditions. Its value is the average value within a sliding window of length L. The tolerance offset coefficient is used to suppress random electrical noise. It is obtained by collecting steady-state operating data under typical field conditions (including background white noise and conventional electromagnetic interference), extracting the standard deviation of the deviation distribution from the historical benchmark mean, and calibrating the tolerance offset coefficient K to 1.5 to 3.0 times the standard deviation of the deviation distribution. For example, when the standard deviation of the background white noise is 0.4, K=1.2.
[0031] when When the value increases, it reflects the increasing positive deviation of the current load power from the historical baseline, causing the result value to tend to accumulate and rise rapidly; when When the value decreases, it reflects that the current electrical load characteristics are approaching or falling below the historical baseline, causing the result value to tend to stop accumulating or return to zero. When the value increases, it reflects that the system's tolerance threshold for random electrical white noise has increased, causing the resulting value to tend to be less likely to trigger cumulative growth; when When the value decreases, it reflects that the system's tolerance threshold for random electrical white noise has become lower, causing the resulting value to tend to accumulate uncontrolled errors.
[0032] Cumulative drift of absolute mean A state index reflecting the continuous accumulation of energy for upward step transitions in a time series, when When the value is large, it is determined to be a structural step state in which a nonlinear load starts in the circuit; when When the noise level is low, the circuit is considered to be operating smoothly or experiencing normal environmental noise fluctuations.
[0033] To establish an anomaly prevention mechanism, an absolute mean cumulative drift warning threshold based on the dynamic equation of local steady-state background noise is set as follows: ,in This is a decision interval constant, with an example value of 4.0; For the standard deviation of environmental noise floor, when the calculated When the threshold is exceeded, the corresponding timestamp is marked as a structural load mutation point and stored in the dynamic breakpoint set. Simultaneously, measures are taken to address the issue of the queue cache not being full during system startup. Calculate the extreme case where the denominator is zero, and set a system-level safety net mechanism: if the cache queue data volume is insufficient... If this happens, the CUSUM scan will be forcibly suspended and a state latch signal will be output until the dataset accumulation reaches the target.
[0034] The environmental noise floor standard deviation is obtained by the system's real-time adaptive estimation. Specifically, taking the current time as the endpoint, from the previous scan cycle in the historical power sequence cache, the guard bands of all sampling points Δ before and after each breakpoint in the dynamic breakpoint set are excluded. The median absolute deviation (MAD) of the remaining steady-state sampling points is calculated and multiplied by a scaling constant of 1.4826 as the median absolute deviation. A robust estimate. Also, after the most recent breakpoint occurs. Updates are frozen within a specified timeframe to prevent residual step data from contaminating the noise floor. When the number of steady-state samples is insufficient, the previous valid estimate is automatically reused. The value of Δ ranges from 10 to 30. The value range is 60–300 seconds, with a preferred value of 120 seconds. It should be noted that this applies to the system's initial startup and when the historical power sequence cache has accumulated to L. L After a sample point, the median absolute deviation (MAD) is directly calculated based on the full cached data as... The initial estimate is then updated on a rolling basis using the aforementioned breakpoint isolation method.
[0035] Step S2: Truncate the sliding window based on the dynamic breakpoint set and perform median replacement for noise reduction.
[0036] In industrial environments, strong electromagnetic interference such as contactor arcing can superimpose high-frequency abnormal spike pulses into the sequence. To filter out these dense pulse clusters while preserving the true nonlinear load start-stop step pattern locked in step S1, this step initializes the sliding analysis window of the Hampel filter in the memory stream processing module of the edge computing gateway and performs sliding processing on the power sequence data along the time series. Since a conventional sliding window can cause irreversible edge smoothing side effects when crossing a step signal, this embodiment introduces the dynamic breakpoint set from step S1 to forcibly truncate the boundary of the sliding window. By strictly locking the computational domain to the same side of the structural load abrupt change point, it achieves the physical effect of filtering out high-frequency electromagnetic interference while preserving the true shape of the load step edge.
[0037] According to classical signal processing rules, the detection of local outliers depends on the statistical distribution characteristics of the neighborhood data. To adapt to the dynamic boundary index data structure of this step while preserving physical step accuracy, continuous fixed-width median scanning is transformed into dynamic array reassembly based on boundary-aware indexing. Subsequently, by calculating robust statistics of the absolute deviation within the reassembly array, eigenvalues characterizing the local peak deviation are derived. The local absolute median difference under dynamic truncation is calculated using the following expression: in, Indicates the first Local absolute median corresponding to each timestamp; This represents the normal distribution scaling constant used to calibrate the local absolute median to a standard deviation scale. Its value is approximately equal to 1.4826. It is the inverse function of the standard normal distribution function; This indicates that after being isolated and truncated by the set of breakpoints, the first... The array of valid sampling points contained within the timestamp neighborhood is the first one. Local element parameters; This represents the array of valid sampling points. The local median of all element parameters; This indicates the operator for taking the median.
[0038] Local absolute median This reflects the true dispersion and fluctuation environment of local electrical metering signals after excluding extreme outliers. When the value is large, it reflects the existence of severe irregular pulse cluster contamination within the local time sequence; when... When the value is small, it reflects that the local time series data is of good quality and there is no significant electromagnetic spike interference.
[0039] The warning multiplier threshold for identifying spikes is set to 3.0. When a spike is detected, the multiplier threshold is set to 3.0. The absolute difference is greater than When that happens, replace it with the local median. This outputs a global denoised power sequence. To address abnormal boundary conditions where network congestion or sensor extreme value saturation leads to a severe shortage of sampling points within the truncated effective window, a minimum window threshold of 3 is set. If the number of effective array elements after truncation is less than 3, a safety net mechanism is triggered, directly outputting the original value of that point without median replacement. This effectively prevents statistical division by zero errors or computational crashes caused by extreme sample scarcity. This step outputs the global denoised power sequence to the shared memory data area for use in step S3.
[0040] Step S3: Segment the global denoised power sequence and perform local weighted regression decomposition independently.
[0041] The global denoised power sequence output from step S2 is input into the built-in STL decomposition mathematical model. In this embodiment, the seasonal term window length of the STL decomposition mathematical model is the number of sample points within a complete power consumption cycle, i.e., the number of sample points within a 24-hour cycle. The trend term window length is twice the seasonal term window length. The robustness iteration count adopts the standard configuration of the STL algorithm, i.e., 5 iterations for the inner layer and 2 iterations for the outer layer. Since step S2 has completely removed the dense spike pulse group, this embodiment directly uses the local weighted regression method to iteratively smooth the global denoised sequence, separating the steady-state seasonal term sequence that characterizes the physical cycle law of power consumption and the macroscopic trend term sequence that represents the overall power consumption drift. By subtracting the patterns, a clean residual term sequence is finally output.
[0042] To cut off the leakage path of step energy to the residual term and avoid the Gibbs phenomenon (boundary effect) caused by cross-boundary fitting, this step forcibly introduces the dynamic breakpoint set index vector output from step S1, and adopts a piecewise independent temporal decomposition architecture. Specifically, the system physically segments the global denoised power sequence at the breakpoints to form multiple independent data segments; then, it independently performs local weighted regression on each data segment. The regression fitting is strictly restricted within its own physical sequence boundary, and cross-segment interpolation is prohibited to ensure that the fitting of the macro trend term does not cross the real physical step edge and generate false peaks.
[0043] The residual term can be obtained using the following additive decomposition formula: in, This represents the sequence value of the pure residual term at the current time t after separation; This represents the global denoised power sequence value input at the current time t; This represents the sequence value of the macroeconomic trend term at the current time t, extracted through local weighted regression. This represents the current steady-state seasonal term sequence value that has been separated.
[0044] By using highly pure prior input data and implementing piecewise independent fitting boundary isolation, the problem of trend term fitting distortion caused by continuous outliers contaminating the original locally weighted regression is solved, resulting in the separation of... It can accurately reflect the purely random degradation noise caused by the aging of underlying components or chip temperature drift. To address the extreme case where the algorithm may fail to converge under atypical operating conditions (such as when the data is completely non-periodic), a maximum iteration threshold of 10 is set. If the loop exceeds this threshold and the convergence error is still not reached, the internal loop of the local weighted regression is forcibly terminated, and the current suboptimal residual term data is locked and output as a backup strategy to prevent infinite loops.
[0045] Step S4: Extract the variance shift rate and kurtosis coefficient of the residual term sequence and calculate the overall stability score probability value.
[0046] After obtaining the residual term sequence output in step S3, the classification prediction module within the gateway needs to quantify its latent degradation characteristics. Since traditional variance threshold comparisons cannot assess the variation in noise distribution patterns, this step extracts the relative variance offset rate of the residual term sequence within the most recent one-hour historical time window, normalized with reference to the initial calibration benchmark variance, and extracts the non-Gaussian distribution kurtosis coefficient, which reflects the degree of waveform distortion, thereby comprehensively capturing the waveform distortion phenomenon caused by chip temperature drift.
[0047] The method for obtaining the initial calibration reference variance is as follows: During the factory bench calibration stage, a standard sine wave test signal is input into the metrology box (three test points with amplitudes of 100%, 50%, and 10% of the rated value). The variance of the residual term sequence output in step S3 is recorded, and the minimum value of the variances of the three test points is taken as the initial calibration reference variance. To characterize the optimal noise floor at the time of equipment leaving the factory, relative variance deviation. The expression is: ,in, This represents the residual variance within the current backtracking window.
[0048] Subsequently, the following probability mapping formula is used to output the probability value of the comprehensive stability score of the power metering box: in, This represents the probability value of the overall stability score of the output power metering box; Represents the natural constant; This represents the basic bias coefficient constant obtained through offline high-precision bench joint calibration test training. Indicates the variance offset weighted characteristic coefficient; This represents the relative variance shift rate calculated within the backtracking historical time window, specifically: the variance of the residual term sequence within the backtracking historical time window compared to the variance of the initial calibration baseline. The ratio; Represents the kurtosis weighted characteristic coefficient; The kurtosis coefficient represents the non-Gaussian distribution of the residual term sequence. This represents the hyperkurtosis parameter after centering, used to correct the theoretical kurtosis reference bias of Gaussian white noise.
[0049] and The value of is obtained jointly through the following method: using the residual sample set output by the metering chambers whose health status (fault / normal) has been calibrated in historical bench tests, the maximum likelihood estimation method with prior constraints is used to iteratively fit the logistic regression model. The prior constraint is [-6.0, -3.0]. This prior domain is determined by prefitting the residual samples of the health measurement box under standard test conditions. The purpose is to suppress the output probability of the healthy samples in the low convergence region at the initial stage of model training, so as to reduce the bias estimation bias caused by sample class imbalance. and The prior constraints are [0.1, 0.9]. After fitting, the maximum likelihood estimate is taken as the final weight coefficient.
[0050] when When this overall index input module increases, it reflects an enhanced condition where the signal inside the metering box undergoes severe discretization or exhibits extreme thick-tailed distortion, resulting in a higher probability value for the overall stability score; when When the value decreases, it reflects that the residual signal closely follows the white noise distribution and the overall discrete fluctuation amplitude is reduced, causing the result value to tend to converge to the low probability range.
[0051] In summary, the overall stability score probability value Essentially, this reflects the overall confidence level assessment index that reflects the actual performance degradation of the underlying physical components of the metering box. When the value is large, it is determined that the device has experienced irreversible sampling instability; when When the value is relatively small, it is determined that the device's sampling accuracy is in a healthy and normal state.
[0052] In this step, to prevent variance shift rate The calculation may encounter a zero-variance collapse caused by a completely constant residual within the time window (e.g., due to sensor disconnection and output dead zone). When the variance is detected to be less than the minimum threshold of 0.0001, it is directly set... .
[0053] Finally, a final warning threshold for equipment instability is set, based on the calculated probability value of the comprehensive stability score. When the threshold is exceeded, the gateway triggers an edge alarm interruption, determines that the current power metering box data is unstable, and dispatches a device maintenance prediction work order to the host computer.
[0054] Among them, the final warning threshold The method for obtaining the stability score is as follows: During the logistic regression model training phase, the probability mapping formula described in step S4 is used to score the residual sample set of the calibration chambers in the historical bench tests, where the health status (faulty / normal) has been determined, to obtain the stability score probability value corresponding to each sample. Subsequently, the receiver operating characteristic (ROC) curve analysis method is used to calculate the Youden index corresponding to each probability threshold in sequence. ,in The true positive rate, The true negative rate is used. The probability value that maximizes the Youden index is selected as the final warning threshold. For example, the final warning threshold is obtained through receiver operating characteristic curve analysis and Youden index maximization. The value is 0.75.
[0055] This invention also discloses an energy metering box, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, an energy metering data stability analysis method according to the present invention is implemented.
[0056] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for analyzing the stability of electricity metering data in an electricity metering box, characterized in that, The steps include: S1: Acquire the power sequence, perform a forward scan on the power sequence, calculate the cumulative absolute mean drift at the current moment to identify the load step breakpoint, and store the timestamp corresponding to the load step breakpoint in the dynamic breakpoint set. S2: Based on the dynamic breakpoint set, initialize the sliding analysis window and perform dynamic truncation, calculate the local absolute median difference after truncation, and output the global denoised power sequence by replacing the original sampling points that meet the preset conditions with the local median. S3: Segment the global denoised power sequence at the breakpoints of the dynamic breakpoint set, and independently perform local weighted regression decomposition on the segmented data segments to obtain the clean residual term sequence; S4: Extract the relative variance shift rate and non-Gaussian distribution kurtosis coefficient of the pure residual term sequence, calculate the comprehensive stability score probability value, and determine the current power metering box data instability when the comprehensive stability score probability value exceeds the final warning threshold.
2. The method for analyzing the stability of electricity metering data in an electricity metering box according to claim 1, characterized in that, The power sequence is acquired by: acquiring the voltage and current signals of the acquisition circuit; extracting features from the voltage and current signals respectively to obtain the root mean square (RMS) values of the voltage and current; multiplying the RMS values of the voltage and current to obtain the instantaneous power value; and downsampling the instantaneous power value to a specific frequency to obtain the power sequence.
3. The method for analyzing the stability of electricity metering data in an electricity metering box according to claim 1, characterized in that, The method for calculating the cumulative absolute mean drift at the current moment is as follows: obtain the cumulative absolute mean drift at the previous moment, the power sequence sample value at the current moment, the reference mean parameter, and the tolerance offset coefficient; obtain the absolute value of the difference between the power sequence sample value at the current moment and the reference mean parameter, subtract the tolerance offset coefficient from this absolute value to obtain the intermediate difference; add the intermediate difference to the cumulative absolute mean drift at the previous moment, and take the maximum value between the sum and 0 as the cumulative absolute mean drift at the current moment.
4. The method for analyzing the stability of electricity metering data in an electricity metering box according to claim 1, characterized in that, Identifying load step breakpoints includes: multiplying the decision interval constant by the environmental noise floor standard deviation to obtain the absolute mean cumulative drift warning threshold; when the absolute mean cumulative drift exceeds the absolute mean cumulative drift warning threshold at the current moment, the corresponding timestamp is marked as the load step breakpoint.
5. The method for analyzing the stability of electricity metering data in an electricity metering box according to claim 1, characterized in that, The method for calculating the truncated local absolute median is as follows: obtain the local element parameters in the effective sampling point array after being isolated and truncated by the dynamic breakpoint set, and the local median of all local element parameters; calculate the median of the absolute difference between each local element parameter and the local median, and multiply the median of the absolute difference by the normal distribution scaling constant to obtain the local absolute median.
6. The method for analyzing the stability of electricity metering data in an electricity metering box according to claim 1, characterized in that, The global denoised power sequence is output by replacing the original sampling points that meet preset conditions with the local median. This includes: multiplying the warning multiplier threshold for determining the peak with the local absolute median difference to obtain the absolute difference threshold; when the absolute difference between the original sampling point and the median of its neighborhood is greater than the absolute difference threshold, the original sampling point is replaced with the corresponding local median to output the global denoised power sequence.
7. The method for analyzing the stability of electricity metering data in an electricity metering box according to claim 1, characterized in that, Obtaining the pure residual term sequence includes: separating the steady-state seasonal term sequence from the global denoised power sequence and extracting the macro trend term sequence; subtracting the macro trend term sequence and the steady-state seasonal term sequence from the global denoised power sequence to obtain the pure residual term sequence.
8. The method for analyzing the stability of electricity metering data in an electricity metering box according to claim 1, characterized in that, Extracting the relative variance offset of the pure residual term sequence includes: obtaining the residual variance within the current backtracking window, and the initial calibration reference variance extracted during the equipment factory bench calibration stage; dividing the residual variance by the initial calibration reference variance to obtain the relative variance offset.
9. The method for analyzing the stability of electricity metering data in an electricity metering box according to claim 1, characterized in that, The expression for the probability value of the overall stability score is: in, This represents the probability value of the overall stability score of the output power metering box; Represents the natural constant; This represents the basic bias coefficient constant obtained through offline high-precision bench joint calibration test training. Indicates the variance offset weighted characteristic coefficient; This represents the relative variance offset rate calculated for the residual term sequence within the backtracking historical time window; Represents the kurtosis weighted characteristic coefficient; It represents the kurtosis coefficient of the non-Gaussian distribution of the residual term sequence.
10. An electricity metering box, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement a method for analyzing the stability of electricity metering data in an electricity metering box according to any one of claims 1-9.