Electric energy meter wiring condition identification method and device and storage medium

By acquiring and preprocessing the electrical data of the power meter, using the TabNet network model to train the wiring error recognition model, the problem of difficult to automatically identify the wiring errors and photovoltaic access abnormalities in the existing technology is solved, and efficient and accurate abnormal identification is achieved .

CN119474686APending Publication Date: 2025-02-18GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411651954.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art is difficult to automatically identify electrical parameter abnormalities caused by electrical meter wiring errors and photovoltaic access, which leads to detectors being easily misjudged.

Method used

By obtaining the electrical data of multiple energy meters under different wiring conditions, preprocessing is performed to obtain the training data set and verification data set, the wiring error identification model is trained using the TabNet network model, and the accuracy of the model is verified by the verification data set.

Benefits of technology

It realizes accurate and automatic identification of electrical parameter abnormalities caused by wiring errors in the electricity meter and photovoltaic access, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474686A_ABST
    Figure CN119474686A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an electric energy meter wiring condition identification method and device and a storage medium. The electric energy meter wiring condition identification method comprises the following steps: acquiring multiple groups of electrical data of multiple electric energy meters under different wiring conditions; preprocessing each group of electrical data to obtain a training data set and a verification data set; training the TabNet network model according to the training data set to obtain a wiring error recognition model; verifying the wiring error identification model according to the verification data set to determine whether the wiring error identification model is qualified; and if the wiring error identification model is qualified, inputting to-be-detected electrical data of the to-be-detected electric energy meter to the wiring error identification model so as to determine the wiring condition of the to-be-detected electric energy meter. Therefore, according to the scheme, electrical parameter abnormity caused by wrong wiring of the electric energy meter and electrical parameter abnormity caused by photovoltaic access can be accurately and automatically identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of power grid technology, and in particular to a method, device and storage medium for identifying the connection status of an electric energy meter. Background Art

[0002] In the prior art, the wiring of traditional electric energy meters often has wiring errors due to various reasons, which leads to abnormal measurement data of key electrical parameters such as voltage, current, active power, reactive power, etc., resulting in deviations in metering data. In addition, with the popularization of distributed photovoltaic power generation systems, even if the electric energy meter of the distributed photovoltaic power generation system is correctly connected, the electric energy meter will also cause abnormal electrical parameters due to changes in power generation characteristics caused by photovoltaic access (such as active power fluctuations and power factor changes, etc.). However, the electric energy meter cannot automatically identify abnormal electrical parameters caused by wiring errors and photovoltaic access, which can easily lead to misjudgment by detection personnel. Summary of the invention

[0003] The embodiments of the present invention provide a method, a device and a storage medium for identifying the connection status of an electric energy meter, so as to accurately and automatically identify the electrical parameter anomalies caused by the wrong connection of the electric energy meter and the electrical parameter anomalies caused by photovoltaic access.

[0004] In a first aspect, an embodiment of the present invention provides a method for identifying a connection status of an electric energy meter, the method comprising:

[0005] Obtain multiple sets of electrical data from multiple energy meters under different wiring conditions;

[0006] Preprocessing each set of electrical data to obtain a training data set and a verification data set;

[0007] The TabNet network model is trained according to the training data set to obtain a wiring error recognition model;

[0008] Verifying the wiring error recognition model according to the verification data set to determine whether the wiring error recognition model is qualified;

[0009] If the wiring error recognition model is qualified, the electrical data to be detected of the electric energy meter to be detected is input into the wiring error recognition model to determine the wiring status of the electric energy meter to be detected.

[0010] Optionally, the step of obtaining a training data set and a verification data set includes:

[0011] Cleaning, classifying and labeling the electrical data of each group to obtain an electrical data set;

[0012] The electrical data set is divided into the training data set and the verification data set according to a preset division ratio.

[0013] Optionally, the step of obtaining a wiring error recognition model includes:

[0014] Normalizing the training data set to obtain a standardized data set;

[0015] Performing feature selection on each standard data of the standardized data set to determine a target feature of each standard data;

[0016] Input the target feature of each of the standard data into a feature converter to obtain a current step feature and a transfer feature of each of the standard data;

[0017] According to the current step feature and the transfer feature of each standard data, the TabNet network model is adjusted to obtain the wiring error recognition model.

[0018] Optionally, the step of determining whether the wiring error identification model is qualified includes:

[0019] Inputting each verification data of the verification data set into the wiring error recognition model to obtain a prediction result of each verification data;

[0020] Determining the accuracy, precision, recall and F1 score of the wiring error recognition model according to the prediction result of each of the verification data;

[0021] Whether the wiring error recognition model is qualified is determined according to the accuracy, the precision, the recall rate, and the F1 score.

[0022] Optionally, the step of determining the accuracy, precision, recall and F1 score of the wiring error identification model includes:

[0023] Determining a prediction indicator type for each verification data according to the prediction result for each verification data and the target result for each verification data;

[0024] According to the prediction indicator type of each of the verification data, the accuracy, the precision, the recall and the F1 score are calculated.

[0025] Optionally, the prediction indicator types include true positive examples, false positive examples, false negative examples, and true negative examples;

[0026] The step of calculating the accuracy, the precision, the recall and the F1 score comprises:

[0027] Counting the number of the verification data whose prediction indicator type is the true positive example, and recording it as the total number of true positive examples;

[0028] Counting the number of the verification data whose prediction indicator type is the false positive example, and recording it as the total number of false positive examples;

[0029] Counting the number of the verification data whose prediction indicator type is the false negative example, and recording it as the total number of false negative examples;

[0030] Counting the number of the verification data whose prediction indicator type is the true negative example, and recording it as the total number of true negative examples;

[0031] Calculating the accuracy rate based on the total number of true positive examples, the total number of false positive examples, the total number of false negative examples, and the total number of true negative examples;

[0032] Calculating the precision rate according to the total number of true positive examples and the total number of false positive examples;

[0033] Calculating the recall rate according to the total number of true positive cases and the total number of false negative cases;

[0034] The F1 score is calculated according to the precision and the recall.

[0035] Optionally, determining whether the wiring error recognition model is qualified according to the accuracy, the precision, the recall rate and the F1 score includes:

[0036] If the accuracy is greater than a first preset threshold, the precision is greater than a second preset threshold, the recall is greater than a third preset threshold, and the F1 score is greater than a fourth preset threshold, the wiring error recognition model is qualified; otherwise, the wiring error recognition model is unqualified.

[0037] Optionally, the method for identifying the connection status of the electric energy meter further includes:

[0038] If the wiring error recognition model is unqualified, the wiring error recognition model parameters are adjusted, and the process returns to the step of training the TabNet network model according to the training data set to obtain the wiring error recognition model.

[0039] In a second aspect, an embodiment of the present invention further provides a device for identifying a connection status of an electric energy meter, the device comprising:

[0040] An acquisition module is used to acquire multiple sets of electrical data of multiple electric energy meters under different wiring conditions;

[0041] A data processing module, used for preprocessing each set of electrical data to obtain a training data set and a verification data set;

[0042] A model training module, used to train the TabNet network model according to the training data set to obtain a wiring error recognition model;

[0043] A judgment module, used to verify the wiring error recognition model according to the verification data set to determine whether the wiring error recognition model is qualified;

[0044] The detection module is used for inputting the electrical data to be detected of the electric energy meter to be detected into the wiring error recognition model if the wiring error recognition model is qualified, so as to determine the wiring status of the electric energy meter to be detected.

[0045] In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a method for identifying a connection status of an electric energy meter as provided in any embodiment of the present invention.

[0046] The embodiment of the present invention provides a data basis for realizing automatic identification of electrical parameter anomalies caused by wiring errors of electric energy meters and photovoltaic access by acquiring multiple sets of electrical data of multiple electric energy meters under different wiring conditions; preprocessing each set of electrical data can ensure the validity and accuracy of the data, and obtain a training data set for model training and a verification data set for model verification; thus, the TabNet network model is trained according to the training data set to obtain a wiring error recognition model that can identify the cause of electrical data anomalies. The wiring error recognition model is verified according to the verification data set to determine whether the wiring error recognition model is qualified; if the wiring error recognition model is qualified, the electrical data to be detected of the electric energy meter to be detected is input into the wiring error recognition model to determine the wiring condition of the electric energy meter to be detected. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0048] Figure 1 A schematic diagram of a flow chart of a method for identifying a connection status of an electric energy meter provided by an embodiment of the present invention;

[0049] Figure 2 A flowchart of steps for obtaining a training data set and a verification data set provided by an embodiment of the present invention;

[0050] Figure 3 A schematic flow chart of steps for obtaining a wiring error identification model provided by an embodiment of the present invention;

[0051] Figure 4 A flowchart of the steps of determining whether a wiring error recognition model is qualified provided by an embodiment of the present invention;

[0052] Figure 5 A flowchart of steps for determining the accuracy, precision, recall and F1 score of a wiring error recognition model provided by an embodiment of the present invention;

[0053] Figure 6 A schematic structural diagram of a device for identifying the connection status of an electric energy meter provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0055] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0056] Traditionally, the energy meter may have reverse voltage connection, wrong current terminal connection, reverse current polarity connection, wrong phase sequence connection, wrong connection to the wrong current transformer or voltage transformer, etc. The energy meter will detect different electrical data under different connection conditions. For example, when the A-phase current of a three-phase three-wire energy meter is reversed, the power factor angle detected by the energy meter will change compared to the actual power factor angle, resulting in measurement errors of the energy meter.

[0057] In addition, after the photovoltaic power generation system where the energy meter is located is connected, the output of photovoltaic power generation fluctuates significantly as the intensity of solar radiation changes, causing the active power of the power generation system to decrease or fluctuate abnormally. For example, after the photovoltaic power generation system is connected, if the active power required by the load remains unchanged, the active power transmitted from the grid to the load will decrease, and the reactive power will remain relatively unchanged, which will reduce the power factor detected by the energy meter. When a large amount of photovoltaic power is transmitted to the grid, the energy meter will detect a negative current. As a result, the abnormal electrical data detected by the energy meter can easily mislead the inspectors, causing them to misjudge the wiring condition of the energy meter.

[0058] In view of the above situation, the hexagonal diagram method is generally used to determine the connection condition of the electric energy meter. Specifically, the electrical data detected by the electric energy meter is obtained on site, and a hexagonal diagram is drawn according to the phase angle relationship between the voltage and current in the electrical data to determine the connection condition of the electric energy meter. Among them, the hexagonal diagram method can only accurately determine the abnormal connection of the electric energy meter under normal circumstances. When the photovoltaic power is connected to the power generation system where the electric energy meter is located, the hexagonal diagram method cannot determine the specific cause of the abnormal electrical data. In addition, the drawing of the hexagonal diagram method is relatively cumbersome, which makes the judgment of the connection condition of the electric energy meter time-consuming and the efficiency of the detection of the connection condition of the electric energy meter is low.

[0059] In view of the above problems, an embodiment of the present invention proposes a method for identifying the connection status of an electric energy meter, which can accurately and quickly automatically identify electrical parameter anomalies caused by incorrect connection of the electric energy meter and electrical parameter anomalies caused by photovoltaic access. Figure 1 The present invention provides a flow chart of a method for identifying the connection status of an electric energy meter. This embodiment is applicable to situations where the connection status of an electric energy meter in a photovoltaic system needs to be identified. The method can be implemented by an electric energy meter connection status identification device. The method specifically includes the following steps:

[0060] S110, obtaining multiple groups of electrical data of multiple electric energy meters under different wiring conditions.

[0061] Specifically, electrical data refers to the detection data of the electric energy meter, and each set of electrical data includes data such as voltage, current, phase angle, active power and reactive power. Wiring conditions refer to the wiring conditions of the electric energy meter, and wiring conditions include correct wiring conditions, reverse current polarity conditions, reverse terminal conditions, wrong phase sequence conditions, reverse current polarity and reverse terminal conditions, reverse current polarity and wrong phase sequence conditions, reverse terminal and wrong phase sequence conditions, reverse current polarity, reverse terminal and wrong phase sequence conditions, and photovoltaic access conditions.

[0062] Among them, by obtaining multiple groups of electrical data from multiple electricity meters under different working conditions, data processing can be performed on the multiple groups of electrical data under different working conditions, and according to the characteristic differences of each group of electrical data, a data basis can be provided for automatic identification of electrical parameter anomalies caused by electricity meter wiring errors and photovoltaic access.

[0063] S120 , preprocessing each set of electrical data to obtain a training data set and a verification data set.

[0064] Specifically, data preprocessing is a key step, and each set of electrical data needs to be cleaned to delete the unreasonable outliers included in each set of electrical data, so as to ensure the validity and accuracy of the data. After cleaning each set of electrical data, each cleaned electrical data is classified according to the working conditions of the electric energy meter generating the electrical data, and each electrical data is marked with a corresponding category label according to the classified category. Among them, the categories of electrical data include correct wiring, reverse current polarity, reverse terminal, wrong phase sequence, reverse current polarity and reverse terminal, reverse current polarity and wrong phase sequence, reverse terminal and wrong phase sequence, reverse current polarity, reverse terminal and wrong phase sequence, photovoltaic access. Exemplarily, the electrical data generated by the electric energy meter under the correct wiring condition, the classification category of the electrical data is correct wiring, and the corresponding type label marked can be a pre-set text, letter, number, symbol or image representing the category of correct wiring.

[0065] In addition, after each electrical data is labeled, the cleaned data needs to be randomly divided into a training data set and a verification data set, for example, 80% of the data is randomly selected as the training data set, and the remaining 20% ​​of the data is divided into the verification data set. The electrical data included in the training data set is used to train the basic model, so that the model obtained through training has the function of automatically identifying the electrical parameter anomalies caused by incorrect wiring of the electric energy meter and the electrical parameter anomalies caused by photovoltaic access. The verification data set is used to verify the obtained model to confirm the accuracy of the obtained model.

[0066] S130 . Training the TabNet network model according to the training data set to obtain a wiring error recognition model.

[0067] Among them, compared with traditional neural networks, the TabNet network model can adaptively select important features and accurately capture implicit associations in electrical data, so that it can clearly point out which features (such as active power, reactive power, voltage, current, etc.) have the greatest impact on electrical data anomalies caused by meter wiring errors or photovoltaic access, thereby helping testers to better understand the logic behind the data during analysis. In addition, the efficiency and flexibility of the TabNet network model enable it to provide faster convergence speed and better generalization ability when processing high-dimensional complex electrical data, ensuring that in the face of different meter wiring errors and photovoltaic access, it can still stably and accurately identify and predict the specific causes of electrical data anomalies.

[0068] Specifically, the training data set is input into the TabNet network model, and each electrical data is associated with the corresponding category label; then, through the layer-by-layer feature selection mechanism of the TabNet network model, the TabNet network model can adaptively analyze the influence of each input electrical data and dynamically select the most relevant features for training and optimization. The attention mechanism in the TabNet network model enables it to deeply analyze the relationship between features, thereby more accurately identifying electrical data anomalies caused by wiring errors and photovoltaic access.

[0069] The TabNet network model is trained based on the training data set. The TabNet network model can effectively learn the complex patterns hidden in the electrical data and finally generate a wiring error recognition model that can intelligently identify the causes of electrical data anomalies.

[0070] S140: Verify the wiring error recognition model according to the verification data set to determine whether the wiring error recognition model is qualified.

[0071] Specifically, the wiring error recognition model needs to be verified through a validation data set, and the performance of the wiring error recognition model is evaluated based on the verification results using indicators such as accuracy, precision, recall, and F1 score to further determine whether the wiring error recognition model is qualified.

[0072] If all indicators of the wiring error recognition model are high, the wiring error recognition model can be determined to be qualified; if all indicators of the wiring error recognition model are low, the wiring error recognition model can be determined to be unqualified. The standard for judging each indicator can be set according to the actual situation, and this scheme does not limit this.

[0073] S150: If the wiring error recognition model is qualified, the electrical data to be detected of the electric energy meter to be detected is input into the wiring error recognition model to determine the wiring status of the electric energy meter to be detected.

[0074] Among them, if the wiring error recognition model is qualified, the technicians can analyze the abnormal data generated by the electric energy meter through the wiring error recognition model, that is, input the electrical data to be tested of the electric energy meter to be tested into the wiring error recognition model to determine the cause of the abnormal electrical parameters detected by the electric energy meter, and then determine the wiring status of the electric energy meter to be tested (whether the wiring of the electric energy meter is correct).

[0075] The embodiment of the present invention provides a data basis for realizing automatic identification of electrical parameter anomalies caused by wiring errors of electric energy meters and photovoltaic access by acquiring multiple sets of electrical data of multiple electric energy meters under different wiring conditions; preprocessing each set of electrical data can ensure the validity and accuracy of the data, and obtain a training data set for model training and a verification data set for model verification; thus, the TabNet network model is trained according to the training data set to obtain a wiring error recognition model that can identify the cause of electrical data anomalies. The wiring error recognition model is verified according to the verification data set to determine whether the wiring error recognition model is qualified; if the wiring error recognition model is qualified, the electrical data to be detected of the electric energy meter to be detected is input into the wiring error recognition model to determine the wiring condition of the electric energy meter to be detected.

[0076] Based on the above embodiment, optionally, Figure 2 A flowchart of steps for obtaining a training data set and a verification data set is provided in an embodiment of the present invention. Figure 2 As shown, the steps to obtain the training data set and the validation data set are explained:

[0077] S210 , cleaning, classifying and labeling each group of electrical data to obtain an electrical data set.

[0078] Specifically, each set of electrical data is cleaned to delete unreasonable outliers included in each set of electrical data, thereby ensuring the validity and accuracy of the data. After each set of electrical data is cleaned, each cleaned electrical data is classified according to the working conditions of the electric energy meter generating the electrical data, and each electrical data is labeled with a corresponding category according to the classified category, thereby obtaining an electrical data set.

[0079] The categories of electrical data include correct wiring, reverse current polarity, reverse terminal connection, wrong phase sequence, reverse current polarity and reverse terminal connection, reverse current polarity and wrong phase sequence, reverse terminal connection and wrong phase sequence, reverse current polarity, reverse terminal connection and wrong phase sequence, and photovoltaic connection. For example, if the electrical data generated by the electric energy meter under the correct wiring condition is classified as correct wiring, the corresponding type label can be a pre-set text, letter, number, symbol or image representing the category of correct wiring.

[0080] S220 , dividing the electrical data set into a training data set and a verification data set according to a preset division ratio.

[0081] Among them, if the preset division ratio of the training data set and the validation data set is: 8:2, then 80% of the data is randomly selected to be divided into the training data set, and the remaining 20% ​​of the data is divided into the validation data set.

[0082] Based on the above embodiment, optionally, Figure 3 A flowchart of steps for obtaining a wiring error identification model provided by an embodiment of the present invention. Figure 3 As shown in the figure, the steps of obtaining the wiring error recognition model are explained:

[0083] S310: Normalize the training data set to obtain a standardized data set.

[0084] Specifically, each electrical data f∈R in the training data set B*D Input TabNet network model. R is the training data set, B is the batch size, and D is the feature dimension.

[0085] Normalize the training data set: f1 = BN(f);

[0086] Among them, BN is batch normalization, which ensures the standardized processing of data in each layer. f1 is a standard data of the standardized data set.

[0087] S320 , performing feature selection on each standard data of the standardized data set to determine the target feature of each standard data.

[0088] Specifically, the TabNet network model uses an attention mechanism to dynamically select the most important features at each step through a sparse mask for each standard data set. For the i-th step, the mask M[i] is generated by the sparse maximization function:

[0089] M[i]=sparsemax(P[i-1]·h(a[i-1]));

[0090] Among them, P[i-1] is the feature weight accumulated in the previous step, which controls the reuse of some features; h(a[i-1]) is the output transformation function of the fully connected layer.

[0091] in addition,

[0092] Where γ is the relaxation parameter that determines how often features are used in different steps. j refers to the number of steps, M[j] is the mask of the jth step, and P[i] is the accumulated feature weight in the current step.

[0093] The target feature f2 of each standard data is: f2 = M[i]f.

[0094] S330, input the target feature of each standard data into the feature converter to obtain the current step feature and transfer feature of each standard data.

[0095] Among them, the feature converter contains multiple layers of fully connected layers (FC), batch normalization (BN) and gated linear unit (GLU) activation functions. Each standard data is input into the feature converter for further processing by the target feature selected by the mask. After the target feature passes through the feature converter, the output feature of the current step - the current step feature and the feature passed to the next step - the transfer feature will be generated.

[0096] Specifically, [d[i], a[i]]=f i (f2);

[0097] Among them, f i It is a feature converter, which consists of a shared layer and a layer that depends on each step. It can select the most effective feature for processing according to the step. d[i] is the output feature of the current step - the current step feature, and a[i] is the feature passed to the next step - the transfer feature.

[0098] S340, adjusting the TabNet network model according to the current step characteristics and transfer characteristics of each standard data to obtain a wiring error recognition model.

[0099] Specifically, the TabNet network model accumulates the output of each step through multiple decision steps to form the final model output. The current step features generated at each step are accumulated through the ReLU activation function, and the final classification or regression output prediction results are generated through linear mapping. The parameters of the TabNet network model are adjusted according to the prediction results and the target results, so that the prediction results output by the TabNet network model are continuously close to the target results until they are consistent with the target results, and the wiring error recognition model can be obtained.

[0100] Among them, the current step features generated in each step are accumulated through the ReLU activation function to obtain the accumulated result d out for: Where N is the total number of steps.

[0101] The current step features generated in each step are accumulated through the ReLU activation function to obtain the accumulated results. The final classification or regression output prediction result y' is generated through linear mapping: y' = Wd out ; Where W is the weight matrix of the output layer.

[0102] Based on the above embodiment, optionally, Figure 4A flowchart of the steps of determining whether a wiring error recognition model is qualified is provided in an embodiment of the present invention. Figure 4 As shown in the figure, the steps to determine whether the wiring error recognition model is qualified are explained:

[0103] 410. Input each verification data of the verification data set into the wiring error recognition model to obtain a prediction result of each verification data.

[0104] S420 , determining the accuracy, precision, recall and F1 score of the wiring error recognition model according to the prediction results of each verification data.

[0105] Among them, accuracy refers to the proportion of samples predicted correctly by the model to the total number of samples. Precision refers to the proportion of samples predicted by the model to be positive that are actually positive, reflecting the prediction accuracy of the model. Recall refers to the proportion of all samples that are actually positive that are correctly identified as positive by the model, reflecting the coverage ability of the model. The F1 score is the harmonic mean of precision and recall, which is used to balance the relationship between the two and is particularly suitable for imbalanced datasets.

[0106] Specifically, according to the prediction result of each verification data and the target result of each verification data, the prediction indicator type of each verification data can be determined. Among them, the prediction indicator type includes true positive examples, false positive examples, false negative examples and true negative examples. According to the prediction indicator type of each verification data, the number of verification data of each prediction indicator type can be known, and then the accuracy, precision, recall and F1 score are calculated according to the number of verification data of each prediction indicator type.

[0107] S430: Determine whether the wiring error recognition model is qualified according to the accuracy, precision, recall and F1 score.

[0108] Specifically, if the accuracy is greater than the first preset threshold, the precision is greater than the second preset threshold, the recall is greater than the third preset threshold, and the F1 score is greater than the fourth preset threshold, the wiring error recognition model is qualified; otherwise, the wiring error recognition model is unqualified.

[0109] Among them, the first preset threshold, the second preset threshold, the third preset threshold and the fourth preset threshold are all limit values ​​pre-set according to actual conditions.

[0110] Based on the above embodiment, optionally, Figure 5 A flowchart of the steps of determining the accuracy, precision, recall and F1 score of a wiring error recognition model provided by an embodiment of the present invention. Figure 5 As shown, the steps to determine the accuracy, precision, recall, and F1 score of the wiring error recognition model are explained:

[0111] S510: Determine the prediction indicator type of each verification data according to the prediction result of each verification data and the target result of each verification data.

[0112] Among them, the prediction indicator types include true positive examples, false positive examples, false negative examples and true negative examples; the prediction indicator type of each verification data can be determined according to the prediction result of each verification data and the positive and negative characteristics of the target result. Specifically, true positive examples refer to samples whose prediction results are positive and whose target results are positive; true negative examples refer to samples whose prediction results are negative and whose target results are negative; false positive examples refer to samples whose prediction results are positive and whose target results are negative; false negative examples refer to samples whose prediction results are negative and whose target results are positive.

[0113] S520 , calculating the accuracy, precision, recall and F1 score according to the prediction indicator type of each verification data.

[0114] Specifically, the number of verification data whose statistical prediction indicator type is a true positive is recorded as the total number of true positives; the number of verification data whose statistical prediction indicator type is a false positive is recorded as the total number of false positives; the number of verification data whose statistical prediction indicator type is a false negative is recorded as the total number of false negatives; the number of verification data whose statistical prediction indicator type is a true negative is recorded as the total number of true negatives;

[0115] If TP represents the total number of true positives, TN represents the total number of true negatives, FP represents the total number of false positives, and FN represents the total number of false negatives.

[0116] Based on the total number of true positives, false positives, false negatives, and true negatives, calculate the accuracy.

[0117] Specifically, the accuracy is:

[0118] Calculate the precision based on the total number of true positives and the total number of false positives.

[0119] Specifically, the precision is:

[0120] Based on the total number of true positives and the total number of false negatives, the recall is calculated.

[0121] Specifically, the recall rate Recall is:

[0122] Based on the precision and recall, the F1 score is calculated.

[0123] Specifically,

[0124] Based on the above embodiment, optionally, the method for identifying the wiring condition of the electric energy meter further includes: if the wiring error identification model is unqualified, adjusting the wiring error identification model parameters, returning to execute the step of training the TabNet network model according to the training data set to obtain the wiring error identification model.

[0125] Figure 6 A schematic diagram of a device for identifying the connection status of an electric energy meter provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the electric energy meter wiring status identification device includes:

[0126] An acquisition module 610 is used to acquire multiple sets of electrical data of multiple electric energy meters under different wiring conditions;

[0127] The data processing module 620 is used to pre-process each set of electrical data to obtain a training data set and a verification data set;

[0128] A model training module 630 is used to train the TabNet network model according to the training data set to obtain a wiring error recognition model;

[0129] A judgment module 640 is used to verify the wiring error recognition model according to the verification data set to determine whether the wiring error recognition model is qualified;

[0130] The detection module 650 is used to input the electrical data to be detected of the electric energy meter to be detected into the wiring error recognition model if the wiring error recognition model is qualified, so as to determine the wiring status of the electric energy meter to be detected.

[0131] The embodiment of the present invention obtains multiple sets of electrical data of multiple electric energy meters under different wiring conditions through the acquisition module 610, which provides a data basis for realizing the automatic identification of electrical parameter anomalies caused by electric energy meter wiring errors and photovoltaic access; the data processing module 620 pre-processes each set of electrical data to ensure the validity and accuracy of the data, and obtains a training data set for model training and a verification data set for model verification; thus, the model training module 630 trains the TabNet network model according to the training data set to obtain a wiring error recognition model that can identify the cause of electrical data anomalies. The judgment module 640 verifies the wiring error recognition model according to the verification data set to determine whether the wiring error recognition model is qualified; if the wiring error recognition model is qualified, the detection module 650 inputs the electrical data to be detected of the electric energy meter to be detected into the wiring error recognition model to determine the wiring condition of the electric energy meter to be detected.

[0132] Based on the above embodiment, optionally, the data processing module includes:

[0133] A preprocessing unit is used to clean, classify and label each group of electrical data to obtain an electrical data set;

[0134] The data partitioning unit is used to partition the electrical data set into a training data set and a verification data set according to a preset partitioning ratio.

[0135] Based on the above embodiment, optionally, the model training module includes:

[0136] A normalization unit, used to normalize the training data set to obtain a standardized data set;

[0137] a target feature determination unit, used for performing feature selection on each standard data of the standardized data set to determine the target feature of each standard data;

[0138] A feature conversion unit, used for inputting the target feature of each standard data into a feature converter to obtain the current step feature and the transfer feature of each standard data;

[0139] The wiring error recognition model generation unit is used to adjust the TabNet network model according to the current step characteristics and transfer characteristics of each standard data to obtain the wiring error recognition model.

[0140] Based on the above embodiment, optionally, the judging module includes:

[0141] A prediction unit, used for inputting each verification data of the verification data set into the wiring error recognition model to obtain a prediction result of each verification data;

[0142] An evaluation index determination unit, used to determine the accuracy, precision, recall and F1 score of the wiring error recognition model according to the prediction results of each verification data;

[0143] The judgment unit is used to determine whether the wiring error recognition model is qualified according to the accuracy, precision, recall and F1 score.

[0144] Based on the above embodiment, optionally, the evaluation index determination unit includes:

[0145] A prediction indicator type determination subunit, used to determine the prediction indicator type of each verification data according to the prediction result of each verification data and the target result of each verification data;

[0146] The calculation subunit is used to calculate the accuracy, precision, recall and F1 score according to the prediction indicator type of each verification data.

[0147] Based on the above embodiment, optionally, the prediction indicator types include true positive examples, false positive examples, false negative examples and true negative examples;

[0148] The computing subunit is specifically used for:

[0149] Count the number of validation data with true positive results as the prediction indicator type, and record it as the total number of true positive results;

[0150] Count the number of validation data with false positive examples as the prediction indicator type, and record it as the total number of false positive examples;

[0151] Count the number of validation data with false negative examples as the prediction indicator type, and record it as the total number of false negative examples;

[0152] Count the number of validation data with true negative examples as the prediction indicator type, and record it as the total number of true negative examples;

[0153] Calculate the accuracy based on the total number of true positives, false positives, false negatives, and true negatives;

[0154] Calculate the precision based on the total number of true positives and the total number of false positives;

[0155] Calculate the recall rate based on the total number of true positives and the total number of false negatives;

[0156] Based on the precision and recall, the F1 score is calculated.

[0157] Based on the above embodiment, optionally, the judging unit is specifically configured to:

[0158] If the accuracy is greater than the first preset threshold, the precision is greater than the second preset threshold, the recall is greater than the third preset threshold, and the F1 score is greater than the fourth preset threshold, the wiring error recognition model is qualified; otherwise, the wiring error recognition model is unqualified.

[0159] Based on the above embodiment, optionally, the electric energy meter connection status identification device further includes:

[0160] The modification module is used to adjust the wiring error recognition model parameters if the wiring error recognition model is unqualified, and return to execute the step of training the TabNet network model according to the training data set to obtain the wiring error recognition model.

[0161] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for identifying the connection status of an electric energy meter provided in any embodiment of the present invention is implemented.

[0162] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. The computer-readable storage medium includes (a non-exhaustive list): an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.

[0163] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, the data signal carrying a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0164] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.

[0165] Computer program code for performing the disclosed operations may be written in one or more programming languages ​​or a combination of multiple programming languages, including object-oriented programming languages ​​such as Java, Smalltalk, C++, Ruby, Go, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).

[0166] It will be appreciated by those skilled in the art that the term user terminal covers any suitable type of wireless user equipment, such as a mobile phone, a portable data processing device, a portable web browser or a vehicle-mounted mobile station.

[0167] In general, various embodiments of the present invention can be implemented in hardware or dedicated circuits, software, logic or any combination thereof. For example, some aspects can be implemented in hardware, while other aspects can be implemented in firmware or software that can be executed by a controller, microprocessor or other computing device, although the present invention is not limited thereto.

[0168] Embodiments of the present invention may be implemented by executing computer program instructions by a data processor of a mobile device, for example in a processor entity, or by hardware, or by a combination of software and hardware. The computer program instructions may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages.

[0169] The block diagram of any logic flow in the accompanying drawings of the present invention may represent program steps, or may represent interconnected logic circuits, modules and functions, or may represent a combination of program steps and logic circuits, modules and functions. The computer program may be stored in a memory. The memory may be of any type suitable for the local technical environment and may be implemented using any suitable data storage technology, such as but not limited to read-only memory (ROM), random access memory (RAM), optical memory devices and systems (digital versatile discs DVD or CD discs), etc. Computer-readable media may include non-transitory storage media. The data processor may be of any type suitable for the local technical environment, such as but not limited to a general-purpose computer, a special-purpose computer, a microprocessor, a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable logic device (Field-Programmable Gate Array, FGPA) and a processor based on a multi-core processor architecture.

[0170] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0171] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for identifying the connection status of an electric energy meter, characterized in that: include: Obtain multiple sets of electrical data from multiple energy meters under different wiring conditions; Preprocessing each set of electrical data to obtain a training data set and a verification data set; The TabNet network model is trained according to the training data set to obtain a wiring error recognition model; Verifying the wiring error recognition model according to the verification data set to determine whether the wiring error recognition model is qualified; If the wiring error recognition model is qualified, the electrical data to be detected of the electric energy meter to be detected is input into the wiring error recognition model to determine the wiring status of the electric energy meter to be detected.

2. The method for identifying the connection status of an electric energy meter according to claim 1, characterized in that: The step of obtaining a training data set and a verification data set includes: Cleaning, classifying and labeling the electrical data of each group to obtain an electrical data set; The electrical data set is divided into the training data set and the verification data set according to a preset division ratio.

3. The method for identifying the connection status of an electric energy meter according to claim 1, characterized in that: The step of obtaining the wiring error recognition model includes: Normalizing the training data set to obtain a standardized data set; Performing feature selection on each standard data of the standardized data set to determine a target feature of each standard data; Input the target feature of each of the standard data into a feature converter to obtain a current step feature and a transfer feature of each of the standard data; According to the current step feature and the transfer feature of each standard data, the TabNet network model is adjusted to obtain the wiring error recognition model.

4. The method for identifying the connection status of an electric energy meter according to claim 1, characterized in that: The step of determining whether the wiring error identification model is qualified comprises: Inputting each verification data of the verification data set into the wiring error recognition model to obtain a prediction result of each verification data; Determining the accuracy, precision, recall and F1 score of the wiring error recognition model according to the prediction result of each of the verification data; Whether the wiring error recognition model is qualified is determined according to the accuracy, the precision, the recall rate, and the F1 score.

5. The method for identifying the connection status of an electric energy meter according to claim 4, characterized in that: The step of determining the accuracy, precision, recall and F1 score of the wiring error identification model includes: Determining a prediction indicator type for each verification data according to the prediction result for each verification data and the target result for each verification data; According to the prediction indicator type of each of the verification data, the accuracy, the precision, the recall and the F1 score are calculated.

6. The method for identifying the connection status of an electric energy meter according to claim 5, characterized in that: The prediction indicator types include true positives, false positives, false negatives, and true negatives; The step of calculating the accuracy, the precision, the recall and the F1 score comprises: Counting the number of the verification data whose prediction indicator type is the true positive example, and recording it as the total number of true positive examples; Counting the number of the verification data whose prediction indicator type is the false positive example, and recording it as the total number of false positive examples; Counting the number of the verification data whose prediction indicator type is the false negative example, and recording it as the total number of false negative examples; Counting the number of the verification data whose prediction indicator type is the true negative example, and recording it as the total number of true negative examples; Calculating the accuracy rate based on the total number of true positive examples, the total number of false positive examples, the total number of false negative examples, and the total number of true negative examples; Calculating the precision rate according to the total number of true positive examples and the total number of false positive examples; Calculating the recall rate according to the total number of true positive cases and the total number of false negative cases; The F1 score is calculated according to the precision and the recall.

7. The method for identifying the connection status of an electric energy meter according to claim 4, characterized in that: The determining whether the wiring error recognition model is qualified according to the accuracy, the precision, the recall rate and the F1 score includes: If the accuracy is greater than a first preset threshold, the precision is greater than a second preset threshold, the recall is greater than a third preset threshold, and the F1 score is greater than a fourth preset threshold, the wiring error recognition model is qualified; otherwise, the wiring error recognition model is unqualified.

8. The method for identifying the connection status of an electric energy meter according to claim 1, characterized in that: Also includes: If the wiring error recognition model is unqualified, the wiring error recognition model parameters are adjusted, and the process returns to the step of training the TabNet network model according to the training data set to obtain the wiring error recognition model.

9. A device for identifying the connection status of an electric energy meter, characterized in that: include: An acquisition module is used to acquire multiple sets of electrical data of multiple electric energy meters under different wiring conditions; A data processing module, used for preprocessing each set of electrical data to obtain a training data set and a verification data set; A model training module, used to train the TabNet network model according to the training data set to obtain a wiring error recognition model; A judgment module, used to verify the wiring error recognition model according to the verification data set to determine whether the wiring error recognition model is qualified; The detection module is used for inputting the electrical data to be detected of the electric energy meter to be detected into the wiring error recognition model if the wiring error recognition model is qualified, so as to determine the wiring status of the electric energy meter to be detected.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for identifying the connection status of an electric energy meter as described in any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Current transformer connection detection method, device and system and storage medium

    CN120065072A