Error curve morphology-based clustering method and system for secondary classification of electric energy meter quality
By using a clustering method based on error curve morphology, the problems of poor identification effectiveness and insufficient accuracy in the secondary grading method of electricity meter quality are solved, realizing the fine grading of electricity meters and improving the accuracy and stability of power grid metering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI ZENITH ELECTRICITY & ELECTRONICS
- Filing Date
- 2026-04-15
- Publication Date
- 2026-07-21
AI Technical Summary
Existing methods for secondary grading of electricity meter quality suffer from poor identification effectiveness and insufficient accuracy. They cannot effectively identify morphological distortions in the error curves of electricity meters and internal quality consistency, leading to defective meters entering the power grid and increasing the risk of metering inaccuracies.
A clustering method based on error curve morphology is adopted. By acquiring the relative error data of the full load point of the electricity meter, an error matrix is constructed, sensitivity weights are calculated, and three-dimensional morphological feature vectors are extracted. The DBSCAN clustering algorithm is used to perform cluster analysis in the three-dimensional feature space to identify features with significant skewness. Combined with an adaptive judgment threshold, a secondary quality classification is performed.
It effectively identifies electricity meters with abnormal error curve shapes, prevents faulty meters from entering the power grid, improves the accuracy of defect identification, realizes refined grading of electricity meter quality, provides quantitative data support, and enhances the metering level of the power grid.
Smart Images

Figure CN122432710A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for secondary grading of electricity meter quality in the field of electricity metering technology, particularly to a method for secondary grading of electricity meter quality based on error curve morphology clustering, and also to a system for secondary grading of electricity meter quality based on error curve morphology clustering. Background Technology
[0002] As a key metering instrument for trade settlement, the accuracy and stability of electricity meters directly affect the economic interests of both electricity suppliers and consumers, as well as the fairness of power grid operation. Currently, domestic and international quality control of electricity meters mainly relies on relevant national standards (such as the GB / T 17215 series) or international standards (such as the IEC 62053 series), through specified load points (e.g., ...). An error test is conducted to determine whether the error at each test point falls within the maximum permissible error (MPE) range. If the error at all test points is within the limit, the energy meter is deemed a "qualified product" and is permitted to leave the factory or be connected to the grid.
[0003] However, with the deepening of smart grid construction and the continuous improvement of metering accuracy requirements, the aforementioned "qualified / unqualified" binary judgment mechanism has gradually revealed its limitations. First, this mechanism has a blind spot where "qualification masks hidden dangers": although the absolute error values of some electricity meters at various load points do not exceed the MPE limit, their error curves exhibit significant local nonlinear distortions (such as sharp jumps or spikes in light load areas). These latent defects often foreshadow early hardware problems that traditional threshold judgment methods cannot detect, leading to "qualified with defects" products entering the grid and increasing the risk of metering inaccuracies after long-term operation. Second, existing methods lack quantitative assessment tools for the internal quality consistency of qualified products, making it impossible to distinguish between high-quality products with flat and smooth error curves and marginal products with drastic fluctuations but barely qualified, resulting in quality confusion. In addition, some existing technologies attempt to analyze error data using statistical methods (such as mean and standard deviation), but fail to effectively extract the temporal morphological characteristics of error as the load changes (such as skewness, kurtosis, and smoothness), and do not consider the different sensitivities of different load points due to the differences in MPE limits, resulting in distorted analysis results and difficulty in accurately separating abnormal samples with specific morphological defects. Summary of the Invention
[0004] To address the technical problems of poor identification effectiveness and insufficient accuracy in existing secondary grading methods for electricity meter quality, this invention provides a secondary grading method and system for electricity meter quality based on error curve morphology clustering.
[0005] This invention is achieved using the following technical solution: a secondary grading method for the quality of electricity meters based on error curve morphology clustering, which includes the following steps: S1: Obtain the relative error data of the full load point of the batch of energy meters to be tested, and construct the error matrix; S2: Calculate the sensitivity weight of each load point based on the error matrix and the maximum permissible error limit sequence corresponding to the accuracy class of the electricity meter; S3: Using the aforementioned sensitivity weights, perform feature transformation on the error curve of each energy meter to extract a three-dimensional morphological feature vector containing the weighted error morphological concentration index, weighted skewness coefficient, and weighted kurtosis coefficient. S4: Input the three-dimensional morphological feature vectors of all electricity meters into a density-based unsupervised clustering algorithm to perform cluster analysis in the three-dimensional feature space and automatically divide different feature clusters; S5: Based on the center coordinates of each feature cluster in the clustering results, identify features with significant skewness, and combine them with the adaptive judgment threshold calculated based on the main cluster distribution features to perform a secondary quality classification of the qualified batch of electricity meters.
[0006] This invention sensitively captures morphological distortions in error curves through weighted kurtosis and weighted skewness. Even if the error of a meter does not exceed the MPE limit at all load points, it can be identified as a "risky item" as long as its curve shows abnormal "peaks" or "valleys" (usually caused by hardware nonlinearity). It no longer relies solely on whether the absolute value of the error exceeds the limit, effectively preventing defective meters from entering the grid, reducing the risk of metering disputes after long-term operation, and solving the technical problem of poor identification effectiveness in existing secondary grading methods for electricity meter quality. Furthermore, by introducing a reciprocal weighting mechanism based on the MPE limit, this invention automatically assigns higher weights to high-precision areas such as light-load areas. Minor morphological anomalies appearing in light-load areas are amplified by the algorithm, while larger fluctuations allowed in heavy-load areas are appropriately suppressed. This aligns with the actual physical characteristics of electricity metering, significantly improving the accuracy of defect identification and solving the technical problem of insufficient identification accuracy in existing secondary grading methods for electricity meter quality.
[0007] As a further improvement to the above scheme, the formula for calculating the sensitivity weight is as follows: In the formula, For the first The weight of each load point For the first The absolute value of the maximum permissible error at each load point. This represents the total number of load points.
[0008] Furthermore, the formula for calculating the weighted error morphological concentration index is as follows: In the formula, The weighted error morphological concentration index. For the first The relative error of each load point; , It is a weighted average; The formula for calculating the weighted skewness coefficient is as follows: In the formula, The weighted skewness coefficient; , The weighted standard deviation; The formula for calculating the weighted kurtosis coefficient is as follows: In the formula, The weighted kurtosis coefficient is denoted as .
[0009] Furthermore, the method for calculating the adaptive judgment threshold includes the following steps: The cluster with the largest number of samples and the smallest absolute value of each component of the cluster center feature vector is identified as the main feature cluster, representing the superior product group. Calculate the absolute value of the weighted skewness coefficient of the center coordinates of the principal feature cluster. and weighted kurtosis coefficient value ; Set adaptive decision threshold: Drift decision threshold and nonlinearity determination threshold ;in, and This is a preset multiplier factor.
[0010] As a further improvement to the above scheme, in step S5, each feature cluster and outlier point is mapped to a preset quality level, and the determination rules include: The electricity meter corresponding to the main feature cluster is classified as "superior grade"; For the remaining feature clusters, determine the nonlinear risk: if the center of a feature cluster satisfies... ≥ If so, the corresponding electricity meter will be classified as "second-class product"; After excluding second-class products, if the center of a certain characteristic cluster satisfies ≥ and < If so, the corresponding electricity meter will be classified as "first-class product"; The outliers identified by the unsupervised clustering algorithm and those that simultaneously satisfy... ≥ and ≥ The electricity meters corresponding to the abnormal clusters were all identified as "risky items".
[0011] As a further improvement to the above scheme, in step S1, the magnitude of the acquired raw error data is automatically detected. If the data unit is not a percentage unit, it is automatically normalized and corrected, and converted into relative error data in percentage units.
[0012] As a further improvement to the above scheme, the unsupervised clustering algorithm divides densely connected points in the feature space into the same cluster and marks points in low-density regions as noise points. When performing cluster analysis, the unsupervised clustering algorithm traverses multiple neighborhood radius parameter values and selects the parameter combination that can generate a preset number of effective clusters and the proportion of noise points is lower than a preset proportion as the optimal clustering parameters.
[0013] As a further improvement to the above scheme, the secondary grading method for the quality of qualified electricity meters also includes the following steps: S6: Calculate the batch quality consistency index (BQCI) based on the results of the secondary quality grading; BQCI is the percentage of electricity meters that are judged as "superior grade" out of the total number of electricity meters in the batch. A quality warning signal is issued when the BQCI is lower than the first preset threshold, or when the proportion of electricity meters judged as "risky products" is higher than the second preset threshold.
[0014] As a further improvement to the above scheme, the unsupervised clustering algorithm is the DBSCAN clustering algorithm, and the neighborhood radius parameter is selected from 0.1 to 0.2, the minimum number of samples parameter MinPts is set to 5, and a small number of defect sample clusters with a proportion of less than 1% are separated out.
[0015] This invention also provides a secondary grading system for electricity meter quality based on error curve morphology clustering, which applies any of the above-described secondary grading methods for electricity meter quality based on error curve morphology clustering. The grading system includes: The data acquisition module is used to acquire the relative error data of the full load point of the batch of energy meters to be tested and to construct the error matrix. The weight calculation module is used to calculate the sensitivity weight of each load point based on the error matrix and the maximum permissible error limit sequence corresponding to the accuracy level of the electricity meter. The feature extraction module uses the sensitivity weights to perform feature transformation on the error curve of each electricity meter and extracts a three-dimensional morphological feature vector containing the weighted error morphological concentration index, weighted skewness coefficient and weighted kurtosis coefficient. The clustering analysis module is used to input the three-dimensional morphological feature vectors of all electricity meters into a density-based unsupervised clustering algorithm to perform clustering analysis in the three-dimensional feature space and automatically divide different feature clusters. The grading and determination module is used to identify features with significant skewness based on the center coordinates of each feature cluster in the clustering results, and to perform secondary grading of the quality of the batch of qualified energy meters by combining the adaptive determination threshold calculated based on the distribution characteristics of the main cluster.
[0016] Compared with existing two-level grading methods for electricity meter quality, the two-level grading method and system for electricity meter quality based on error curve morphology clustering of the present invention has the following advantages: 1. This secondary quality grading method for electricity meters based on error curve morphology clustering can sensitively capture the morphological distortion of error curves through weighted kurtosis and weighted skewness. Even if the error of a meter does not exceed the MPE limit at all load points, as long as its curve shows abnormal "peaks" or "valleys" (usually caused by hardware nonlinearity), it can be identified as a "risky product". It no longer relies solely on whether the absolute value of the error exceeds the standard, effectively preventing defective meters from entering the power grid, reducing the risk of metering disputes after long-term operation, breaking through the limitations of traditional single-point threshold judgment, solving the technical problem of poor identification effectiveness in existing secondary quality grading methods for electricity meters, and breaking through the detection blind spot of "qualified but hidden defects". It can sensitively capture the drift trend and nonlinear distortion characteristics of error curves, and effectively identify hidden defective electricity meters that are "numerically qualified but morphologically abnormal".
[0017] 2. This secondary quality grading method for electricity meters based on error curve morphology clustering automatically assigns higher weights to high-precision areas such as light-load areas by introducing a reciprocal weighting mechanism based on MPE limits. Minor morphological anomalies appearing in light-load areas are amplified by the algorithm, while larger fluctuations allowed in heavy-load areas are appropriately suppressed. This conforms to the actual physical characteristics of electricity metering, significantly improves the accuracy of defect identification, solves the technical problem of insufficient identification accuracy in existing secondary quality grading methods for electricity meters, and achieves adaptive focus on key load points.
[0018] 3. This secondary quality grading method for electricity meters based on error curve morphology clustering utilizes the DBSCAN clustering algorithm to further subdivide qualified meters into four levels: "Excellent," "First-class," "Second-class," and "Risk." Traditional verification methods can only provide a binary conclusion of "qualified" or "unqualified." This invention provides quantitative data support for power companies' procurement selection, supplier quality evaluation, and meter rotation strategies, helping to achieve "high-quality metering for optimal use," improving the overall metering level of the power grid, and providing a refined quality grading view.
[0019] 4. This method for secondary quality grading of electricity meters based on error curve morphology clustering employs the density-based DBSCAN algorithm, eliminating the need to pre-specify the number of categories (K value) as required by K-Means. This invention can automatically discover the number of clusters based on the data's own distribution density and effectively identify clusters of arbitrary shapes and outliers. It is highly suitable for handling complex scenarios in actual production where quality distribution is uneven and abnormal samples are unknown. It does not require pre-setting the number of categories, exhibits strong adaptability, and enables refined and adaptive grading of qualified products.
[0020] 5. The beneficial effects of this energy meter quality secondary classification system based on error curve morphology clustering are the same as those of the above-mentioned energy meter quality secondary classification method based on error curve morphology clustering, and will not be repeated here. Attached Figure Description
[0021] Figure 1 This is a flowchart of the secondary quality classification method for electricity meters based on error curve morphology clustering, which is described in Embodiment 1 of the present invention.
[0022] Figure 2 This is a flowchart of the overall process of the secondary quality classification method for electricity meters based on error curve morphology clustering in Embodiment 1 of the present invention.
[0023] Figure 3 This is a three-dimensional feature space distribution diagram of the electricity meter in Embodiment 2 of the present invention.
[0024] Figure 4 This is a comparison diagram of typical error curves of energy meters of different quality levels in Embodiment 2 of the present invention.
[0025] Figure 5 This is a pie chart showing the percentage distribution of quality grades of electricity meters in a batch in Embodiment 2 of the present invention.
[0026] Figure 6 This is a frequency distribution diagram of the weighted error morphological concentration index of the batch of electricity meters in Embodiment 2 of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0028] Example 1 Please see Figure 1 and Figure 2This embodiment provides a secondary quality grading method for electricity meters based on error curve morphology clustering. This grading method utilizes the full-load point error data measured during the meter's calibration, moving beyond the binary judgment of "whether a single point error exceeds the standard" to analyze the overall "morphology" of the error curve, thereby achieving refined grading of the internal quality of qualified products. Specifically, this grading method includes the following steps (S1-S6), where S6 may be omitted in some embodiments.
[0029] S1. Data Acquisition and Preprocessing: Acquire the relative error data of the batch of energy meters under test at all load points and construct an error matrix. All load points include all standard test points from light load to overload. Clean the raw error data, remove invalid data, and construct... The error matrix, where For the number of electricity meters, This represents the number of load points. In this embodiment, the magnitude of the acquired raw error data is automatically detected. If the data unit is not a percentage unit (such as ppm), it is automatically normalized and corrected, and converted into relative error data in percentage units.
[0030] S2. Adaptive Sensitivity Weight Construction: Based on the error matrix and the maximum permissible error (MPE) limit sequence corresponding to the accuracy class of the electricity meter. The sensitivity weight of each load point is calculated. In this embodiment, the formula for calculating the sensitivity weight is: In the formula, For the first The weight of each load point For the first The absolute value of the maximum permissible error at each load point. This represents the total number of load points. This formula assigns higher weights to load points with smaller MPE limits (i.e., higher accuracy requirements), thereby amplifying morphological differences in key regions during subsequent feature extraction.
[0031] S3. Three-dimensional morphological feature extraction: Utilizing sensitivity weights, the error curve of each energy meter is extracted. Feature transformation is performed to extract a three-dimensional morphological feature vector containing a weighted error morphological concentration index, a weighted skewness coefficient, and a weighted kurtosis coefficient. This embodiment extracts a three-dimensional feature vector that characterizes the "shape" of a curve from a one-dimensional, discrete set of error points using a weighted statistical method. This three-dimensional feature vector forms the mathematical basis of the algorithm. In this embodiment, the formula for calculating the weighted error morphological concentration index is: In the formula, The weighted error morphological concentration index characterizes the average deviation of the error curve from the weighted mean, reflecting the overall fluctuation range of the curve. For the first The relative error of each load point. , This is the weighted average.
[0032] The formula for calculating the weighted skewness coefficient is: In the formula, The weighted skewness coefficient characterizes the symmetry and drift direction of the error curve distribution. , This is the weighted standard deviation.
[0033] The formula for calculating the weighted kurtosis coefficient is: In the formula, The weighted kurtosis coefficient characterizes the steepness of the error curve distribution and whether there are sharp peaks or abrupt changes.
[0034] Ultimately, each electricity meter is mapped to a point in a three-dimensional feature space. .
[0035] S4. Unsupervised Density Clustering Feature Standardization: The three-dimensional morphological feature vectors of all electricity meters are input into a density-based unsupervised clustering algorithm to perform clustering analysis in the three-dimensional feature space, automatically dividing it into different feature clusters. The unsupervised clustering algorithm can group density-connected points in the feature space into the same cluster and mark points in low-density regions as noise points. During clustering analysis, the unsupervised clustering algorithm iterates through multiple neighborhood radius parameter values, selecting the parameter combination that produces a preset number (e.g., 2 to 5) of effective clusters with a noise point ratio below a preset ratio (e.g., 10%) as the optimal clustering parameters.
[0036] In this embodiment, the three-dimensional feature vectors of all electricity meters are input into a normalizer for normalization. The unsupervised clustering algorithm is DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm, and the neighborhood radius parameter... The selection range is 0.1 to 0.2, the minimum sample size parameter MinPts is set to 5, and a small number of defect sample clusters with a proportion of less than 1% are separated out. This embodiment uses unsupervised clustering (DBSCAN algorithm) to automatically discover different "subgroups" (clusters) and outliers within the qualified product group in the three-dimensional feature space, without relying on known defect labels, and can handle complex quality distributions.
[0037] S5. Quality Semantic Mapping and Grading: Based on the center coordinates of each feature cluster in the clustering results, features with significant skewness are identified. Combined with an adaptive judgment threshold calculated based on the main cluster distribution characteristics, a secondary quality grading is performed on the batch of qualified energy meters. The calculation method for the adaptive judgment threshold may include the following steps: (1) Identify the cluster with the largest number of samples in the clustering results and the smallest absolute value of each component of the cluster center feature vector as the main feature cluster, representing the superior product group; (2) Calculate the absolute value of the weighted skewness coefficient of the center coordinates of the principal feature cluster. and weighted kurtosis coefficient value ; (3) Set adaptive judgment threshold: drift judgment threshold and nonlinearity determination threshold .in, , It is a statistical boundary value that is adaptively generated based on the center coordinate characteristics of the feature cluster (i.e., the superior product cluster) with the largest sample size in the batch. Based on the main cluster center The drift determination threshold is determined by the distribution characteristics. Based on the main cluster center Nonlinear judgment threshold determined by distribution characteristics. and The preset multiplier factor is preferably between 1 and 5. This mechanism ensures that the grading standard can dynamically shift with the overall quality level of the production batch, rather than being a rigid, fixed threshold.
[0038] In this embodiment, each feature cluster and outlier point is mapped to a preset quality level, and the determination rules include: Rule 1: The electricity meter corresponding to the main feature cluster is classified as "superior grade" (stable type); Rule 2: For the remaining feature clusters, determine the nonlinear risk: if the center of a feature cluster satisfies ≥ If so, the corresponding electricity meter will be classified as "second-class product"; Rule 3: After excluding second-class products, if the center of a certain characteristic cluster satisfies ≥ and < If so, the corresponding electricity meter will be classified as "first-class product" (drift type); Rule 4: Integrate outliers identified by the unsupervised clustering algorithm (Label=-1) and those that simultaneously satisfy... ≥ and ≥ The electricity meters corresponding to the anomalous clusters were all identified as "risky goods" (outliers).
[0039] In this way, the clustering results are mapped to "quality grades" (superior, first-class, second-class, and risky) with clear engineering semantics. The mapping is completed based on dynamically generated adaptive thresholds, rather than using fixed thresholds, ensuring that the grading standards can "shift" with the overall quality level of the batch. Based on the above judgment results, a grading result file is output, which includes the ID of each electricity meter, its quality grade, three-dimensional feature values, and a report on the shape of typical error curves. For electricity meters judged as "risky," a warning list is generated, recommending re-inspection or rejection.
[0040] S6: Calculate the batch quality consistency index (BQCI) based on the results of the secondary quality grading; BQCI is the percentage of electricity meters that are judged as "superior grade" out of the total number of electricity meters in the batch. A quality warning signal is issued when the BQCI is lower than the first preset threshold, or when the proportion of electricity meters judged as "risky products" is higher than the second preset threshold.
[0041] This grading method breaks through the limitations of traditional "single-point threshold judgment," solving the problem of the inability to effectively identify products with hidden defects such as "numerical compliance but abnormal morphology." Simultaneously, it achieves refined, multi-level quality stratification within the qualified product group, upgrading the traditional binary "qualified / unqualified" judgment model to a quantitative grading system that reflects the inherent quality differences of products. This grading method constructs mathematical indicators that can accurately characterize the key morphological features (concentration, skewness, nonlinearity) of the error curve and designs an adaptive grading algorithm that can dynamically adjust the threshold according to the quality level of each production batch, accurately distinguishing different categories of electricity meters such as stable, drifting, nonlinear, and high-risk types.
[0042] In summary, compared with existing two-level grading methods for electricity meter quality, the two-level grading method for electricity meter quality based on error curve morphology clustering in this embodiment has the following advantages: 1. This secondary quality grading method for electricity meters based on error curve morphology clustering can sensitively capture the morphological distortion of error curves through weighted kurtosis and weighted skewness. Even if the error of a meter does not exceed the MPE limit at all load points, as long as its curve shows abnormal "peaks" or "valleys" (usually caused by hardware nonlinearity), it can be identified as a "risky product". It no longer relies solely on whether the absolute value of the error exceeds the standard, effectively preventing defective meters from entering the power grid, reducing the risk of metering disputes after long-term operation, breaking through the limitations of traditional single-point threshold judgment, solving the technical problem of poor identification effectiveness in existing secondary quality grading methods for electricity meters, and breaking through the detection blind spot of "qualified but hidden defects". It can sensitively capture the drift trend and nonlinear distortion characteristics of error curves, and effectively identify hidden defective electricity meters that are "numerically qualified but morphologically abnormal".
[0043] 2. This secondary quality grading method for electricity meters based on error curve morphology clustering automatically assigns higher weights to high-precision areas such as light-load areas by introducing a reciprocal weighting mechanism based on MPE limits. Minor morphological anomalies appearing in light-load areas are amplified by the algorithm, while larger fluctuations allowed in heavy-load areas are appropriately suppressed. This conforms to the actual physical characteristics of electricity metering, significantly improves the accuracy of defect identification, solves the technical problem of insufficient identification accuracy in existing secondary quality grading methods for electricity meters, and achieves adaptive focus on key load points.
[0044] 3. This secondary quality grading method for electricity meters based on error curve morphology clustering utilizes the DBSCAN clustering algorithm to further subdivide qualified meters into four levels: "Excellent," "First-class," "Second-class," and "Risk." Traditional verification methods can only provide a binary conclusion of "qualified" or "unqualified." This invention provides quantitative data support for power companies' procurement selection, supplier quality evaluation, and meter rotation strategies, helping to achieve "high-quality metering for optimal use," improving the overall metering level of the power grid, and providing a refined quality grading view.
[0045] 4. This method for secondary quality grading of electricity meters based on error curve morphology clustering employs the density-based DBSCAN algorithm, eliminating the need to pre-specify the number of categories (K value) as required by K-Means. This invention can automatically discover the number of clusters based on the data's own distribution density and effectively identify clusters of arbitrary shapes and outliers. It is highly suitable for handling complex scenarios in actual production where quality distribution is uneven and abnormal samples are unknown. It does not require pre-setting the number of categories, exhibits strong adaptability, and enables refined and adaptive grading of qualified products.
[0046] Example 2 This embodiment provides a secondary quality classification method for electricity meters based on error curve morphology clustering. This method further refines the secondary quality classification method for electricity meters in Embodiment 1, and performs secondary quality classification on a batch of single-phase electricity meters.
[0047] 1. Experimental subjects and data sources A batch of single-phase smart energy meters that had just completed factory testing by a certain meter manufacturer was selected as the experimental subjects. The total sample size was... The sample size is 1000 units. All samples have passed the routine error verification specified by national standards, meaning that the absolute value of the relative error at each load point across the entire range is less than the maximum permissible error, and they are judged as "qualified" in the routine verification. Relative error data for each meter were collected at 10 standard load points to construct the original error matrix. .
[0048] 2. Implementation Steps S1: Obtain the relative error data of 10,000 meters in this batch at 10 standard load points and construct an error matrix.
[0049] S2: Calculate the normalized weight vector based on the MPE limit sequence of the electricity meter. In this embodiment, considering that light load points have a greater impact on measurement accuracy, low load points are given slightly higher weights to ensure the sensitivity of feature extraction.
[0050] S3: Using a weighted statistical formula, calculate the three key morphological characteristic values for each meter: Weighted error morphological concentration index: Function: To reflect the overall fluctuation range (smoothness) of the error curve. The smaller the value, the straighter the curve.
[0051] Weighted skewness: Function: To reflect the symmetry of the error curve. The larger the value, the more pronounced the unidirectional drift (left or right skew) of the curve.
[0052] Weighted kurtosis: Function: To reflect the sharpness of the error curve. The larger the value, the more likely the curve has an abnormal peak or valley (nonlinear abrupt change) at a specific load point.
[0053] According to statistics, this batch of samples The median is 0.000173 (see appendix). Figure 6 This indicates that the error curves of the vast majority of electricity meters are very smooth.
[0054] S4: Input the standardized feature vector into the DBSCAN algorithm. This embodiment determines the optimal hyperparameter combination—neighborhood radius—through parameter sensitivity testing on a large amount of actual production batch data. =0.15, minimum number of samples MinPts=5.
[0055] The selection criteria for this parameter combination and its resulting technical effects are as follows: Criticality verification of neighborhood radius: Under the specific dataset of this embodiment, The optimal separation effect is observed when the value is 0.15, and the preferred range is 0.1 to 0.2.
[0056] Experimental Comparison: This embodiment conducted multiple sets of control experiments. When When set to conventional empirical values (such as 0.2 or 0.3), the large neighborhood range causes density fusion between the high-density "superior" clusters and the sparse "drifting" and "nonlinear" clusters in the feature space. Experimental results show that under a large radius, the originally independent micro-defect clusters are absorbed, and the algorithm can only output "qualified" and "unqualified". This results in the "drifting" samples (55 pieces) accounting for only 0.55% and the "nonlinear" samples (26 pieces) accounting for 0.26% being misclassified as ordinary qualified products, causing missed detections.
[0057] Optimal effect: When When the precision is locked at 0.15, the algorithm successfully cut out two independent low-density clusters at the edge of the dense distribution area of superior products (9697 items).
[0058] Drifting clusters: 55 samples were successfully identified. The mean is -1.17, exhibiting a significant negative skewness. If no... With a fine cut of 0.15, the group will be submerged.
[0059] Nonlinear clusters: 26 samples were successfully identified. The mean value is as high as 1.17, showing a clear peak characteristic.
[0060] Conclusion: In this batch dataset, =0.15 is the optimal parameter for achieving the goal of accurately extracting the trace defect group of less than 1% from 96.97% of qualified products in this invention.
[0061] The noise filtering effect of minimum sample size (MinPts=5): Setting MinPts=5 means that a failure mode is considered to have engineering significance only if at least 5 meters exhibit consistent morphological characteristics.
[0062] In this batch of 10,000 samples, this setting successfully identified 222 (2.22%) scattered cases that could not be categorized into any specific failure mode as "risky items (outliers)". These samples... The mean value is as high as 0.000942 (4.5 times that of the superior grade), and the skewness and kurtosis show no uniform pattern, indicating a high-risk random failure. If MinPts is set too small (e.g., 2), a large number of random fluctuations will be incorrectly clustered into false "fault types"; if set too large, some real small fault clusters (such as the 26 nonlinear samples in this example) may be misjudged as noise and lose the opportunity for targeted analysis. MinPts=5 ensures that the 26 small sample clusters are identified while effectively isolating 222 real outliers, achieving the best balance.
[0063] S5: Clustering Result Mapping and Quality Level Determination Based on the above With a clustering result of 0.15 and MinPts=5, the algorithm successfully identified the superior cluster (main cluster) with the largest number of samples, totaling 9697 individuals, and its center coordinates are: =0.000206, =0.13, =-0.67.
[0064] Based on the main cluster distribution characteristics, calculate the adaptive decision threshold: Drift detection threshold =0.5 (main cluster center) (4 times) Nonlinearity determination threshold =1.0 (main cluster center) 1.5 times (of the original text).
[0065] This threshold setting ensures accurate identification of the small defect group (accounting for less than 1%), while avoiding misjudging normal fluctuations as abnormal.
[0066] Based on the aforementioned thresholds, this embodiment divides the samples into four quality levels and statistically analyzes their characteristics as follows: Superior grade (stable type): 9,697 units (accounting for 96.97%).
[0067] feature: The mean is extremely low (0.000206). (0.13) and (-0.67) is close to the ideal distribution.
[0068] Judgment: Low risk of failure, stable long-term operation.
[0069] First-class product (drifting type): 55 pieces in total (accounting for 0.55%).
[0070] feature: Lower (0.000160), but Significantly negative bias (-1.17).
[0071] Judgment: There may be a systematic error drift trend, and calibration and correction are required; otherwise, long-term operation is prone to exceeding tolerances.
[0072] Second-class product (non-linear type): 26 pieces in total (accounting for 0.26%).
[0073] feature: The lowest (0.000091), but Significantly elevated (1.17) Positive bias (1.29).
[0074] Judgment: There may be sampling nonlinear distortion, which is very easy to fail at specific load points (such as light load or overload), and traditional full-range average error detection is difficult to detect.
[0075] Risky items (outliers): 222 in total (accounting for 2.22%).
[0076] feature: Abnormally high (0.000942), with disordered morphology.
[0077] Judgment: The product has a severely abnormal shape and is classified as a high-risk defective product. It is recommended to reject it directly or re-inspect it.
[0078] Note: The data shows that first-class and second-class products... It is even lower than that of superior grade products. This is not abnormal, but rather reflects the essential differences in morphological characteristics: The measurement focuses on the overall fluctuation range. First-class (drifting type) products only exhibit overall translation and remain flat, while second-class (non-linear type) products are very flat overall except for a few sharp peaks. Therefore, the two... On the contrary, it may be lower than that of superior products, which have slight random fluctuations. This illustrates that the three indicators need to be used in combination to fully depict the shape of the error curve—relying solely on… It is impossible to distinguish between drift and nonlinearity; a combination is necessary. and .
[0079] 3. Experimental Results and Analysis As shown in the attached diagram (including) Figures 3 to 6 This embodiment successfully subdivided 10,000 "qualified products" into four quality grades, achieving a significant grading effect: (1) Distribution Overview ( Figure 5 (Distribution of Quality Grades) As Figure 4 shown, the grading results are as follows: Grade A (stable type): accounting for 96.97% (the large black sector). This indicates that the overall consistency of this batch is excellent, and the vast majority of the electric meters are not only qualified but also in perfect form.
[0080] Grade B (drifting type) & Grade C (non-linear type): together accounting for approximately 0.81% (the tiny sector in the upper left corner of the figure, containing triangular and diamond markings). Although these electric meters pass the routine inspection, they have slight defects in form.
[0081] Risk products (outlier type): accounting for 2.22% (the extremely small separated sector in the figure). These are the "fugitives" that cannot be detected by traditional inspection.
[0082] Analysis: The traditional binary judgment of "qualified / unqualified" masks these 3% of form differences. Through secondary grading, the present invention successfully distinguishes "perfect products" from "defective qualified products".
[0083] (2) Comparison of form features ( Figure 3 : Comparison of the form of error curves for each grade - core evidence) To verify the effectiveness of grading, the average error curves of four types of electric meters are plotted: Grade A (stable type): As Figure 4 shown by the black solid line (with circular markings) in
[0084] Grade B (drifting type): As Figure 4 shown by the gray dashed line (with triangular markings) in
[0085] Grade C (non-linear type): As Figure 4 shown by the gray dotted line (with diamond markings) in , the curve is normal at most load points, but shows a slight "V"-shaped drop at the 2nd and 4th load points, reflecting
[0086] Risk products (outlier type): As Figure 4 shown by the thick black dotted line (with square markings) in
[0087] Technical interpretation: This feature of "qualified in value but pathological in form" may be caused by non-linearity in the ADC sampling of the metering chip or instability of the reference source. The present invention passes high The value and DBSCAN outlier detection successfully removed it from the qualified products and marked it as a risk product.
[0088] (3) Feature spatial distribution ( Figure 3 (Three-dimensional distribution of feature space) exist In three-dimensional space: Near the origin: a dense cluster of black dots (superior grade), representing low volatility, symmetry, and no sharp peaks.
[0089] Y-axis extension: sparse triangular point clusters (drifting type), representing high skewness.
[0090] Z-axis extension: sparse diamond-shaped point group (non-linear type), representing peak density.
[0091] Remote isolated point: black square (risky item), completely separated from the main distribution area.
[0092] This intuitively demonstrates that the feature space constructed by the three formulas has good separability.
[0093] (4) Smoothness frequency statistics ( Figure 6 : (Frequency distribution) like Figure 6 As shown in the histogram. The distribution exhibits an extremely right-skewed pattern, with the vast majority of samples concentrated around 0.00. The median of 0.000173, marked by the black dashed line in the graph, is extremely low, further confirming the exceptionally high smoothness of this batch of meters. Individuals that deviate significantly from this median are more likely to be classified as drifting, non-linear, or risky.
[0094] 4. Summary of Technical Effects Through the parameter settings in this embodiment, not only was a quantitative indicator of BQCI (Batch Quality Consistency Index) of 96.97% calculated, but more importantly, a risk warning mechanism was triggered: a risky product ratio of 2.22% was detected, exceeding the preset 2% warning line. Based on this, the system automatically issued an alarm stating "risky product ratio exceeds 2%", indicating potential systemic fluctuations in the production process. If traditional methods were used, the vast majority of these 2.22% risky products would be missed, leading to an inflated BQCI and potential quality risks.
[0095] Example 3 This embodiment provides a secondary grading system for electricity meter quality based on error curve morphology clustering. The system applies the secondary grading method for electricity meter quality based on error curve morphology clustering in Embodiment 1 or 2, and specifically includes a data acquisition module, a weight calculation module, a feature extraction module, a cluster analysis module, and a grading determination module.
[0096] The data acquisition module is used to acquire the relative error data of the batch of electricity meters under test at all load points and construct an error matrix, mainly executing step S1. This module is communicatively connected to the electricity meter calibration device or production testing database, receiving or reading the relative error data measured by each electricity meter at multiple preset load points. Specifically, this module performs validity cleaning on the raw error data, removing invalid data caused by test anomalies, and organizes all valid data into an M×N error matrix, where M is the number of electricity meters and N is the number of load points. Preferably, this module is also equipped with an automatic data unit detection and normalization subunit, which automatically converts the error data unit to a percentage unit when it is detected that the unit is not a percentage (such as ppm) to ensure the consistency of subsequent calculations.
[0097] The weight calculation module calculates the sensitivity weight of each load point based on the error matrix and the maximum permissible error limit sequence corresponding to the accuracy class of the electricity meter. This module pre-stores MPE limit tables for each load point corresponding to different accuracy classes (e.g., 0.2S, 0.5S, and Class 1). During calculation, the module reads the corresponding level limit sequence and calculates the weight point by point, giving higher weights to load points with smaller MPE limits. The weight vector output by this module is used by the feature extraction module. This module mainly corresponds to step S2 in the execution method.
[0098] The feature extraction module is connected to the weight calculation module and the data acquisition module. Using sensitivity weights, it performs feature transformation on the error curve of each electricity meter, extracting a three-dimensional morphological feature vector containing a weighted error morphological concentration index, a weighted skewness coefficient, and a weighted kurtosis coefficient. This module mainly executes step S3. Specifically, this module calculates the weighted error morphological concentration index, weighted skewness coefficient, and weighted kurtosis coefficient sequentially for the error sequence of each electricity meter. The calculation formula is shown in step S3 of Example 1. Through this module, each electricity meter is mapped to a feature point in the three-dimensional feature space.
[0099] The clustering analysis module is used to input the three-dimensional morphological feature vectors of all electricity meters into a density-based unsupervised clustering algorithm to perform clustering analysis in the three-dimensional feature space and automatically divide it into different feature clusters. This module incorporates the DBSCAN algorithm engine, which first standardizes (normalizes) the input feature vectors before clustering to eliminate the influence of differences in the dimensions of each feature. During clustering, the module searches for density-connected core points in the feature space based on preset or adaptively optimized neighborhood radius parameters and minimum sample number parameters. Regions with density reaching a threshold are divided into the same feature cluster, and points in sparsely dense regions are marked as outliers (Label=-1). Preferably, this module also has an automatic parameter optimization function, which iterates through multiple... The module evaluates the effective cluster count and noise ratio of the clustering results and automatically selects the optimal parameter combination. This module mainly corresponds to step S4 in the execution method.
[0100] The grading and determination module is used to identify significantly skewed features based on the center coordinates of each feature cluster in the clustering results. Combined with an adaptive determination threshold calculated based on the distribution characteristics of the main cluster, it performs a secondary quality grading of qualified batches of electricity meters. This module first identifies the feature cluster with the largest number of samples in the clustering results as the main feature cluster (representing the superior product group). It then calculates the absolute value of the weighted skewness coefficient and the weighted kurtosis coefficient of the center coordinates of this main feature cluster, thereby generating adaptive determination thresholds: a drift threshold and a nonlinearity threshold. Subsequently, the module determines the grade of each feature cluster and outlier according to preset semantic mapping rules. The module finally outputs a list of grading results containing the ID of each electricity meter, its quality grade, and three-dimensional feature values. This module mainly corresponds to step S5 in the execution method.
[0101] In some other embodiments, the system further includes a quality early warning module connected to the grading judgment module. This module is used to calculate the batch quality consistency index (BQCI) based on the grading results, where BQCI = (number of superior products / total number of batches) × 100%. This module has a first preset threshold and a second preset threshold. When the BQCI is lower than the first preset threshold or the proportion of risky products is higher than the second preset threshold, a quality early warning signal is automatically generated and issued, indicating that there may be systemic fluctuations in the production process.
[0102] The system provided in this embodiment achieves automated extraction, intelligent clustering, and refined grading of the error curve shape of qualified electricity meters through the organic collaboration between various modules. It breaks through the limitations of traditional verification technology and has the advantages of high recognition accuracy, strong adaptability, and interpretable grading results.
[0103] Example 4 This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the secondary grading method for energy meter quality based on error curve morphology clustering as described in Embodiment 1 or 2.
[0104] When applying the methods of Embodiment 1 or 2, they can be implemented in software form, such as by designing them as stand-alone programs and installing them on a computer terminal, which can be a computer, smartphone, control system, or other IoT devices. Alternatively, the methods of Embodiment 1 or 2 can be designed as embedded programs and installed on a computer terminal, such as on a microcontroller.
[0105] Example 5 This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the steps of the secondary grading method for energy meter quality based on error curve morphology clustering in Embodiment 1 or 2.
[0106] When applying the method of Embodiment 1 or 2, it can be applied in the form of software, such as by designing it as a program that can run independently on a computer-readable storage medium. The computer-readable storage medium can be a USB flash drive, designed as a USB security token, and the program is designed to start the entire method through an external trigger.
[0107] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A secondary quality classification method for electricity meters based on error curve morphology clustering, characterized in that, It includes the following steps: S1: Obtain the relative error data of the full load point of the batch of energy meters to be tested, and construct the error matrix; S2: Calculate the sensitivity weight of each load point based on the error matrix and the maximum permissible error limit sequence corresponding to the accuracy class of the electricity meter; S3: Using the aforementioned sensitivity weights, perform feature transformation on the error curve of each energy meter to extract a three-dimensional morphological feature vector containing the weighted error morphological concentration index, weighted skewness coefficient, and weighted kurtosis coefficient. S4: Input the three-dimensional morphological feature vectors of all electricity meters into a density-based unsupervised clustering algorithm to perform cluster analysis in the three-dimensional feature space and automatically divide different feature clusters; S5: Based on the center coordinates of each feature cluster in the clustering results, identify features with significant skewness, and combine them with the adaptive judgment threshold calculated based on the main cluster distribution features to perform a secondary quality classification of the qualified batch of electricity meters.
2. The method for secondary quality grading of electricity meters based on error curve morphology clustering as described in claim 1, characterized in that, The formula for calculating the sensitivity weight is: ; In the formula, For the first The weight of each load point For the first The absolute value of the maximum permissible error at each load point. This represents the total number of load points.
3. The method for secondary quality grading of electricity meters based on error curve morphology clustering as described in claim 2, characterized in that, The formula for calculating the weighted error morphological concentration index is as follows: ; In the formula, The weighted error morphological concentration index. For the first The relative error of each load point; , It is a weighted average; The formula for calculating the weighted skewness coefficient is as follows: ; In the formula, The weighted skewness coefficient; , The weighted standard deviation; The formula for calculating the weighted kurtosis coefficient is as follows: ; In the formula, The weighted kurtosis coefficient is denoted as .
4. The method for secondary quality grading of electricity meters based on error curve morphology clustering as described in claim 3, characterized in that, The method for calculating the adaptive decision threshold includes the following steps: The cluster with the largest number of samples and the smallest absolute value of each component of the cluster center feature vector is identified as the main feature cluster, representing the superior product group. Calculate the absolute value of the weighted skewness coefficient of the center coordinates of the principal feature cluster. and weighted kurtosis coefficient value ; Set adaptive decision threshold: Drift decision threshold and nonlinearity determination threshold ;in, and This is a preset multiplier factor.
5. The method for secondary quality grading of electricity meters based on error curve morphology clustering as described in claim 1, characterized in that, In step S5, each feature cluster and outlier point is mapped to a preset quality level, and the determination rules include: The electricity meter corresponding to the main feature cluster is classified as "superior grade"; For the remaining feature clusters, determine the nonlinear risk: if the center of a feature cluster satisfies... ≥ If so, the corresponding electricity meter will be classified as "second-class product"; After excluding second-class products, if the center of a certain characteristic cluster satisfies ≥ and < If so, the corresponding electricity meter will be classified as "first-class product"; The outliers identified by the unsupervised clustering algorithm and those that simultaneously satisfy... ≥ and ≥ The electricity meters corresponding to the abnormal clusters were all identified as "risky items".
6. The method for secondary quality grading of electricity meters based on error curve morphology clustering as described in claim 1, characterized in that, In step S1, the magnitude of the acquired raw error data is automatically detected. If the data unit is not a percentage unit, it is automatically normalized and corrected, and converted into relative error data in percentage units.
7. The method for secondary quality grading of electricity meters based on error curve morphology clustering as described in claim 1, characterized in that, The unsupervised clustering algorithm divides densely connected points in the feature space into the same cluster and marks points in low-density regions as noise points. When performing cluster analysis, the unsupervised clustering algorithm traverses multiple neighborhood radius parameter values and selects the parameter combination that can generate a preset number of effective clusters and has a noise point ratio lower than a preset ratio as the optimal clustering parameters.
8. The method for secondary quality grading of electricity meters based on error curve morphology clustering as described in claim 1, characterized in that, The secondary grading method for the quality of qualified electricity meters also includes the following steps: S6: Calculate the batch quality consistency index (BQCI) based on the results of the secondary quality grading; BQCI is the percentage of electricity meters that are judged as "superior grade" out of the total number of electricity meters in the batch. A quality warning signal is issued when the BQCI is lower than the first preset threshold, or when the proportion of electricity meters judged as "risky products" is higher than the second preset threshold.
9. The method for secondary quality grading of electricity meters based on error curve morphology clustering as described in claim 1, characterized in that, The unsupervised clustering algorithm is the DBSCAN clustering algorithm, and the neighborhood radius parameter is selected from 0.1 to 0.
2. The minimum number of samples parameter MinPts is set to 5, and a small number of defect sample clusters with a proportion of less than 1% are separated out.
10. A secondary quality grading system for electricity meters based on error curve morphology clustering, characterized in that, Its application is the secondary grading method for energy meter quality based on error curve morphology clustering as described in any one of claims 1-9, wherein the grading system includes: The data acquisition module is used to acquire the relative error data of the full load point of the batch of energy meters to be tested and to construct the error matrix. The weight calculation module is used to calculate the sensitivity weight of each load point based on the error matrix and the maximum permissible error limit sequence corresponding to the accuracy level of the electricity meter. The feature extraction module uses the sensitivity weights to perform feature transformation on the error curve of each electricity meter and extracts a three-dimensional morphological feature vector containing the weighted error morphological concentration index, weighted skewness coefficient and weighted kurtosis coefficient. The clustering analysis module is used to input the three-dimensional morphological feature vectors of all electricity meters into a density-based unsupervised clustering algorithm to perform clustering analysis in the three-dimensional feature space and automatically divide different feature clusters. The grading and determination module is used to identify features with significant skewness based on the center coordinates of each feature cluster in the clustering results, and to perform secondary grading of the quality of the batch of qualified energy meters by combining the adaptive determination threshold calculated based on the distribution characteristics of the main cluster.