Wiring error identification method, device and equipment of electric energy metering device and storage medium

By collecting and processing electrical data of the electric energy metering device and using the trained target recognition model to identify wiring errors, the problem of low wiring error recognition efficiency in the prior art is solved, and the identification efficiency and fairness of electricity bill settlement are improved.

CN119438983AActive Publication Date: 2025-02-14GUANGDONG POWER GRID CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411489860.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-14
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

In the prior art, the wiring error identification efficiency of the power metering device is low, resulting in unfair electricity bill settlement and may cause safety hazards in the power system.

Method used

By collecting target electrical data of the electric energy metering device and inputting it into the trained target recognition model for processing, the target wiring type is output. The training steps of the target recognition model include processing historical wiring electrical data, iteratively training the split nodes of the primary recognition model, determining the leaf node weight, calculating the model loss and objective function value, and finally obtaining the target recognition model.

Benefits of technology

It improves the efficiency of identifying the types of wiring errors of the power metering device, simplifies on-site operation, reduces equipment costs and operation difficulties, and ensures the fairness of electricity bill settlement and the safety of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119438983A_ABST
    Figure CN119438983A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power grid power supply, in particular to an electric energy metering device wiring error identification method, device and equipment and a storage medium, and the method comprises the steps: collecting target electrical data of an electric energy metering device; and inputting the target electrical data into a target identification model for processing and outputting a target wiring type. The identification efficiency of the wiring error type of the electric energy metering device can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of power grid power supply technology, and in particular to a method, device, equipment and storage medium for identifying wiring errors in an electric energy metering device. Background Art

[0002] At present, electric energy metering devices are generally used to measure electric energy for industrial users and high-power electrical equipment, such as three-phase three-wire electric energy metering devices, so as to achieve accurate calculation of electric energy and reasonable settlement of electricity charges.

[0003] During the installation of electric energy metering devices, due to the complex installation environment, lack of operator experience and aging equipment, wiring errors often occur in electric energy metering devices. Wiring errors will lead to inaccurate electric energy metering, affect the fairness of electricity bill settlement, and may also cause safety hazards in the power system. The positive error of the electric energy metering device will cause damage to the economic interests of users. There are also many types of wiring errors, such as: reverse connection of current terminals and reverse connection of current polarity. The installer needs to first determine the type of wiring error of the electric energy metering device, and then correct the wiring error accordingly. At present, electric energy meter calibrators are generally used to perform relevant tests on electric energy metering devices according to the hexagonal diagram method to determine the type of wiring error.

[0004] However, the cost of the electricity meter calibrator is high, the instrument is bulky and not easy to carry and transport, the detection process is cumbersome and difficult to use, it has high environmental requirements and requires continuous power supply, resulting in low efficiency in identifying the types of wiring errors in the electricity metering device. Summary of the invention

[0005] In order to improve the efficiency of identifying the types of wiring errors in an electric energy metering device, the present application provides a method, device, equipment and storage medium for identifying wiring errors in an electric energy metering device.

[0006] In a first aspect, the present application provides a method for identifying wiring errors in an electric energy metering device, comprising:

[0007] Collect target electrical data of electric energy metering devices;

[0008] Inputting the target electrical data into a target recognition model for processing and outputting a target wiring type;

[0009] The target recognition model training step includes:

[0010] Processing historical wiring electrical data to obtain target training sets and target test sets;

[0011] Iteratively training the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determining the weights of the leaf nodes;

[0012] Obtaining a model loss based on the target training set and the primary recognition model, and obtaining an objective function value based on the model loss, the leaf node weights, and the model variables;

[0013] A target recognition model is obtained based on the objective function value, the target test set and the primary recognition model.

[0014] In a second aspect, the present application provides a device for identifying wiring errors in an electric energy metering device, comprising:

[0015] An electrical data acquisition module, used to acquire target electrical data of the electric energy metering device;

[0016] An error type identification module is used to input the target electrical data into a target identification model for processing and outputting a target wiring type;

[0017] The target recognition model training step includes:

[0018] Processing historical wiring electrical data to obtain target training sets and target test sets;

[0019] Iteratively training the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determining the weights of the leaf nodes;

[0020] Obtaining a model loss based on the target training set and the primary recognition model, and obtaining an objective function value based on the model loss, the leaf node weights, and the model variables;

[0021] A target recognition model is obtained based on the objective function value, the target test set and the primary recognition model.

[0022] In a third aspect, the present application provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method when executing the computer program.

[0023] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.

[0024] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0025] The above-mentioned method, device, equipment and storage medium for identifying wiring errors in electric energy metering devices collect target electrical data of the electric energy metering device; input the target electrical data into the target recognition model for processing and outputting the target wiring type; wherein the training step of the target recognition model includes: processing historical wiring electrical data to obtain a target training set and a target test set; iteratively training the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determining the leaf node weights; obtaining model loss based on the target training set and the primary recognition model, and obtaining the objective function value based on the model loss, the leaf node weights and the model variables; obtaining the target recognition model based on the objective function value, the target test set and the primary recognition model. Through the above implementation, it is only necessary to collect the target electrical data of the electric energy metering device on site, and then input it into the target recognition model for processing, and then the target wiring type can be directly determined, which is convenient for improving the recognition efficiency of the wiring error type of the electric energy metering device.

[0026] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0028] Figure 1 A flow chart of a method for identifying wiring errors in an electric energy metering device provided in an embodiment of the present application;

[0029] Figure 2 A schematic diagram of a confusion matrix provided in an embodiment of the present application;

[0030] Figure 3 A schematic diagram of the structure of a device for identifying wiring errors in an electric energy metering device provided in an embodiment of the present application;

[0031] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application;

[0032] Figure 5 This is a diagram of the internal structure of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of this article 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 this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0035] In this article, the term "and / or" is only a description of the association relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the related objects before and after are in an "or" relationship.

[0036] Embodiment 1

[0037] Figure 1 A flowchart of a method for identifying wiring errors in an electric energy metering device provided in the first embodiment of the present application, referring to Figure 1 The method may be performed by a device for performing the method, and the device may be implemented by software and / or hardware. The method includes:

[0038] S110, collecting target electrical data of the electric energy metering device.

[0039] Among them, the electric energy metering device in this embodiment is specifically a three-phase three-wire electric energy metering device, and in other embodiments, it is not specifically limited; the target electrical data includes voltage data, current data, phase data and power data of the three-phase three-wire electric energy metering device.

[0040] Specifically, data such as voltage data, current data, phase data, and power data of a three-phase three-wire electric energy metering device that needs to identify wiring errors are collected.

[0041] S120, inputting the target electrical data into a target recognition model for processing and outputting a target wiring type.

[0042] The target recognition model is a recognition model that has been trained. The target recognition model is used to process the target electrical data input therein and output the target wiring type. The target wiring type is a specific wiring type of the electric energy metering device. In this embodiment, the target wiring type includes the following eight wiring types:

[0043] First, the current terminals are reversed;

[0044] Second, the current polarity is reversed;

[0045] Third, the current polarity is reversed and the current terminals are reversed;

[0046] Fourth, the voltage phase sequence is wrong;

[0047] Fifth, the voltage phase sequence is wrong and the current terminals are reversed;

[0048] Sixth, the voltage phase sequence is wrong and the current polarity is reversed;

[0049] Seventh, the voltage phase sequence is wrong, the current polarity is reversed, and the current terminals are reversed;

[0050] Eighth, measure correctly.

[0051] Specifically, the collected voltage data, current data, phase data, power data and other data of the three-phase three-wire electric energy metering device are input into the target recognition model for processing, and the target recognition model outputs the corresponding target wiring type, which is one of the above eight wiring types.

[0052] The target recognition model training step includes:

[0053] A110. Process historical wiring electrical data to obtain a target training set and a target test set.

[0054] Among them, the historical wiring electrical data includes historical data such as historical voltage data, historical current data, historical phase data and historical power data corresponding to the above eight types of wiring; the target training set is the data in the historical wiring electrical data used to train the recognition model, and the target test set is the data in the historical wiring electrical data used to perform performance testing on the recognition model trained in each iteration.

[0055] Specifically, the historical wiring electrical data is processed so as to be divided into a target training set and a target test set.

[0056] A120. Iteratively train the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determine the weights of the leaf nodes.

[0057] Among them, the primary recognition model is an untrained recognition model. The recognition model specifically adopts the XGBoost model in this embodiment, and is not specifically limited in other embodiments; a decision tree is provided in the XGBoost model, and each decision tree corresponds to a split node. By iteratively training the split node, the complexity of the decision tree can be improved, thereby improving the classification and recognition performance of the XGBoost model; taking one of the decision trees as an example, when the iterative training of the split node in the decision tree meets the preset iteration stop condition, the final split node is a leaf node, and the weight corresponding to the leaf node can be determined by correspondingly processing the leaf node, that is, the leaf node weight w j , where j represents the jth leaf node in the XGBoost model. In this embodiment, the leaf node weight w can be determined according to the amount of data in the target training set contained in the leaf node. j ; In addition, the iteration stopping condition may be that the number of iterative training reaches a preset iteration number threshold.

[0058] Specifically, taking a split node in the XGBoost model as an example, the split node is trained based on the target training set, a new split node is obtained each time the training is performed, and then the new split node is trained again until the preset iteration stop condition is met. The new split node obtained when the iteration stop condition is met is also a leaf node; further, the leaf node is processed to obtain the leaf node weight w corresponding to the leaf node. j .

[0059] A130. Obtain a model loss based on the target training set and the primary recognition model, and obtain an objective function value based on the model loss, the leaf node weights, and the model variables.

[0060] Among them, the training data in the target training set is recorded as y i ,y i The training data is characterized as the i-th training data in the target training set; the primary recognition model is trained on the training data y i Processing can output the corresponding prediction data The model loss can be based on the training data y i The corresponding prediction data Calculated; the objective function value is used to characterize the accuracy of the recognition model in iterative training in predicting the target wiring type; the model variables in this embodiment include: the number of decision trees T, the gain threshold γ and the L2 regularization parameter λ, and the objective function value Obj can be based on the model loss, the leaf node weight w j And the model variables are calculated.

[0061] Specifically, the training data y in the target training set iInput into the primary recognition model for processing and output the corresponding prediction data Based on the training data y i With forecast data Calculate the model loss of the primary recognition model; further, based on the model loss, leaf node weight w j And the model variables calculate the objective function value Obj.

[0062] A140. Obtain a target recognition model based on the objective function value, the target test set and the primary recognition model.

[0063] Among them, the primary recognition model can be iteratively trained through the objective function value and the target test set, so as to gradually improve the classification and recognition performance of the recognition model until the objective function value reaches the minimum value, so as to obtain a completed trained recognition model, that is, the target recognition model.

[0064] Specifically, the primary recognition model is iteratively trained through the objective function value and the target test set until the objective function value reaches a minimum value, thereby obtaining the target recognition model.

[0065] It should be noted that this embodiment collects the target electrical data of the electric energy metering device; inputs the target electrical data into the target recognition model for processing and outputs the target wiring type; wherein the training step of the target recognition model includes: processing the historical wiring electrical data to obtain the target training set and the target test set; iteratively training the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determining the leaf node weights; obtaining the model loss based on the target training set and the primary recognition model, and obtaining the objective function value based on the model loss, the leaf node weights and the model variables; obtaining the target recognition model based on the objective function value, the target test set and the primary recognition model. Through the above implementation, it is only necessary to collect the target electrical data of the electric energy metering device on site, and then input it into the target recognition model for processing, and then the target wiring type can be directly determined, which is convenient for improving the recognition efficiency of the wiring error type of the electric energy metering device.

[0066] Embodiment 2

[0067] A method for identifying wiring errors in an electric energy metering device provided in a second embodiment of the present application optimizes the "processing historical wiring electrical data to obtain a target training set and a target test set" in the first embodiment; it should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments, and the method includes:

[0068] S210: Collect target electrical data of the electric energy metering device.

[0069] S220, inputting the target electrical data into a target recognition model for processing and outputting a target wiring type.

[0070] The target recognition model training step includes:

[0071] A211. Preprocess the historical wiring electrical data to obtain cleaned data.

[0072] Among them, the preprocessing in this embodiment specifically includes missing value filling processing, abnormal value detection and correction processing, and duplicate value deletion processing, which is not specifically limited in other embodiments; the cleaned data is the data obtained after preprocessing the historical wiring electrical data.

[0073] A212. Standardize the cleaning data to obtain standard data.

[0074] Among them, in order to facilitate the subsequent primary recognition model to process each data in the cleaned data at the same scale, the cleaned data needs to be standardized. In this embodiment, the standardization can specifically adopt minimum-maximum standardization or Z-score standardization, among which, the minimum-maximum standardization is to linearly map the cleaned data to [0,1], and the Z-score standardization is to convert the cleaned data into data that conforms to the normal distribution; the standard data is the data obtained after the cleaned data is standardized.

[0075] Specifically, the cleaned data is processed based on a preset standardization processing method to obtain standard data.

[0076] A213. Process the standard data based on a preset diversity ratio to obtain a primary training set and a primary test set.

[0077] Among them, the diversity ratio is 7:3 in this embodiment, and is not specifically limited in other embodiments; among them, the data volume of the primary training set accounts for 7 / 10 of the standard data, and the data volume of the primary test set accounts for 3 / 10 of the standard data.

[0078] Specifically, according to the preset subset ratio of 7:3, it is determined that the data volume of the primary training set accounts for 7 / 10 of the standard data, and it is also determined that the data volume of the primary test set accounts for 3 / 10 of the standard data. Furthermore, 7 / 10 of the data in the standard data is determined as the primary training set, and the remaining 3 / 10 of the data in the standard data is determined as the primary test set.

[0079] A214. Convert the format of the primary training set and the primary test set to obtain a target training set and a target test set.

[0080] Among them, the original data format of the primary training set and the primary test set is not suitable for processing in the primary recognition model. If the primary training set and the primary test set are directly processed by the primary recognition model, the processing speed will be slow. In order to facilitate improving the processing speed of the primary recognition model for the primary training set and the primary test set, it is necessary to first convert the data format of the primary training set and the primary test set into a data format suitable for processing by the primary recognition model. The data format suitable for processing by the primary recognition model is the DMatrix format in this embodiment.

[0081] Specifically, the formats of the primary training set and the primary test set are converted into data in DMatrix format, so as to obtain a target training set corresponding to the primary training set and a target test set corresponding to the primary test set.

[0082] A220. Iteratively train the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determine the leaf node weights.

[0083] A230. Obtain a model loss based on the target training set and the primary recognition model, and obtain an objective function value based on the model loss, the leaf node weights, and the model variables.

[0084] A240. Obtain a target recognition model based on the objective function value, the target test set and the primary recognition model.

[0085] Embodiment 3

[0086] A method for identifying wiring errors in an electric energy metering device provided in a third embodiment of the present application optimizes the "iterative training of split nodes in a primary recognition model based on the target training set to obtain leaf nodes" in the first embodiment; it should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments, and the method includes:

[0087] S310: Collect target electrical data of the electric energy metering device.

[0088] S320, inputting the target electrical data into a target recognition model for processing and outputting a target wiring type.

[0089] The target recognition model training step includes:

[0090] A310. Process historical wiring electrical data to obtain target training sets and target test sets.

[0091] A321. Calculate split node gains based on the target training set and model variables.

[0092] The corresponding split node gain can be obtained by inputting the data and model variables in the target training set into a preset split node gain calculation formula for processing.

[0093] A322. Determine whether to split the split node based on the split node gain and the gain threshold.

[0094] The gain threshold is used to compare with the split node gain. If the split node gain is not less than the gain threshold, it means that the split node corresponding to the split node gain needs to be split, wherein the split means that the split node is split into two new split nodes.

[0095] Specifically, it is determined whether the split node gain is not less than a gain threshold, thereby determining whether to split the split node.

[0096] A323: If yes, split the split node to obtain child nodes and child node data.

[0097] Among them, the child node is the new split node obtained after the split node is split; each split node has corresponding node data, and the node data comes from the target training set. After the split node is split into two child nodes, the node data corresponding to the split node will also be distributed to the two child nodes, and the node data allocated to each child node is also the child node data.

[0098] Specifically, if it is determined that the split node gain is not less than the gain threshold, the split node is controlled to split into two child nodes, and the node data corresponding to the split node is distributed to one of the child nodes to obtain the child node data.

[0099] A324. Use the child node as a new split node, and perform iterative training on the new split node based on the child node data until a preset iteration stop condition is met to obtain a leaf node.

[0100] Among them, iterative training is to use the child node as a new split node, and the child node data as new target training data, and process the new target training data through the new split node to obtain a new split node gain, and then re-execute the above A322-A323 steps to achieve iterative training of the new split node; the iterative stopping condition is that the number of iterations reaches the preset iteration number threshold.

[0101] A325. Determine the leaf node weight.

[0102] A330. Obtain a model loss based on the target training set and the primary recognition model, and obtain an objective function value based on the model loss, the leaf node weights and the model variables.

[0103] A340. Obtain a target recognition model based on the objective function value, the target test set and the primary recognition model.

[0104] Embodiment 4

[0105] A method for identifying wiring errors in an electric energy metering device provided in a fourth embodiment of the present application optimizes the "calculating split node gains based on the target training set and the model variables" in the third embodiment; it should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments, and the method includes:

[0106] S410: Collect target electrical data of the electric energy metering device.

[0107] S420, inputting the target electrical data into a target recognition model for processing and outputting a target wiring type.

[0108] The target recognition model training step includes:

[0109] A410. Process historical wiring electrical data to obtain target training sets and target test sets.

[0110] A421A. Process the target training set based on a preset data threshold to obtain a left node data set and a right node data set.

[0111] Among them, the preset data threshold is used to compare with the target training data in the target training set, the left node data set is the set of target training data in the target training set that is less than the preset data threshold, and the right node data set is the set of target training data in the target training set that is not less than the preset data threshold.

[0112] Specifically, target training data in the target training set that is less than a preset data threshold is determined to obtain a left node data set; and target training data in the target training set that is not less than the preset data threshold is determined to obtain a right node data set.

[0113] A421B. Calculate the sum of the first-order derivative and the sum of the second-order derivative based on the left node data set, and calculate the sum of the third-order derivative and the sum of the fourth-order derivative based on the right node data set.

[0114] Among them, the first-order derivative and is the sum of the first-order derivatives of each data in the left node data set, and the second-order derivative The sum is the sum of the second-order derivatives of each data in the left node data set, where I L Represents the left node data set, g i Represents the first-order derivative of the i-th data in the left node data set, h i Represents the second-order derivative of the i-th data in the left node data set. The third-order derivative is the sum of the first-order derivatives of each data in the right node data set, and the sum of the fourth-order derivatives is the sum of the second-order derivatives of each data in the right node data set; where I R Represents the right node data set, g i represents the first-order derivative of the i-th data in the right node data set, h i Represents the second-order derivative of the i-th data in the right node data set.

[0115] Specifically, the one-to-one corresponding first-order derivatives of each data in the left node data set are calculated, and then the sum of each first-order derivative is calculated to obtain the sum of the first-order derivatives; the one-to-one corresponding second-order derivatives of each data in the left node data set are calculated, and then the sum of each second-order derivative is calculated to obtain the sum of the second-order derivatives; the one-to-one corresponding first-order derivatives of each data in the right node data set are calculated, and then the sum of each first-order derivative is calculated to obtain the sum of the third-order derivatives; the one-to-one corresponding second-order derivatives of each data in the right node data set are calculated, and then the sum of each second-order derivative is calculated to obtain the sum of the fourth-order derivatives.

[0116] A421C. Calculate the split node gain based on the first-order derivative and the second-order derivative and the third-order derivative and the fourth-order derivative and the model variables; wherein the model variables include an L2 regularization parameter and a gain threshold.

[0117] Among them, the first-order derivative and With the third derivative The sum of the fifth-order derivatives is recorded as i∈I g i , and also the second-order derivative With the fourth derivative and The sum of the values ​​is recorded as the sixth-order derivative and ∑ i∈I h i ; Model variables include L2 regularization parameter λ and gain threshold γ; The calculation formula of split node gain Gain is as follows:

[0118]

[0119] Specifically, calculate the first-order derivative and With the third derivative The sum of the fifth-order derivatives and ∑ i∈I g i , calculate the second-order derivative With the fourth derivative and The sum of the sixth-order derivatives and ∑ i∈I h iFurther, the first-order derivative and the second-order derivative and the third-order derivative and the fourth-order derivative and the fifth-order derivative and the sixth-order derivative as well as the L2 regularization parameter λ and the gain threshold γ are substituted into the calculation formula of the split node gain Gain for calculation, thereby obtaining the split node gain Gain.

[0120] A422. Determine whether to split the split node based on the split node gain and the gain threshold.

[0121] A423. If yes, split the split node to obtain child nodes and child node data.

[0122] A424. Use the child node as a new split node, and perform iterative training on the new split node based on the child node data until a preset iteration stop condition is met to obtain a leaf node.

[0123] A425. Determine the leaf node weight.

[0124] A430. Obtain a model loss based on the target training set and the primary recognition model, and obtain an objective function value based on the model loss, the leaf node weights and the model variables.

[0125] A440. Obtain a target recognition model based on the objective function value, the target test set and the primary recognition model.

[0126] Embodiment 5

[0127] A method for identifying wiring errors in an electric energy metering device provided in a fifth embodiment of the present application optimizes the "obtaining an objective function value based on the model loss, the leaf node weights, and the model variables" in the first embodiment; it should be noted that for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments, and the method includes:

[0128] S510: Collect target electrical data of the electric energy metering device.

[0129] S520: Input the target electrical data into a target recognition model for processing and outputting a target wiring type.

[0130] The target recognition model training step includes:

[0131] A510. Process historical wiring electrical data to obtain target training sets and target test sets.

[0132] A520. Iteratively train the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determine the leaf node weights.

[0133] A531. Obtain a model loss based on the target training set and the primary recognition model.

[0134] A532. Calculate the model regularization term based on the leaf node weights and model variables.

[0135] Among them, taking the kth decision tree in the primary recognition model as an example, the decision tree has its corresponding single tree regularization term Ω(f k ), single tree regularization term Ω(f k ) is calculated as follows:

[0136]

[0137] Among them, λ is the L2 regularization parameter in the model variable, γ is the gain threshold in the model variable, T is the number of decision trees in the model variable, and w j Represents the leaf node weight of the jth leaf node in the primary recognition model.

[0138] Specifically, the L2 regularization parameter λ, the gain threshold γ, the number of decision trees T, and the leaf node weight w of each leaf node in the primary recognition model are transformed into j Substitute into the above single tree regularization term Ω(f k , and then the single tree regularization term Ω(f k ).

[0139] A533. Obtain an objective function value based on the model loss and the model regularization term.

[0140] The model loss L in this embodiment is the target training data y in the target training set. i The corresponding prediction data The sum of the squares of the differences, n is the target training data y in the target training set i The amount of data; the model regularization term Ω is the regularization term Ω(f k The objective function value Obj is the sum of the model loss L and the model regularization term Ω, Obj = L + Ω.

[0141] Specifically, first, the target training data y of each target training set i The corresponding prediction data Calculate the model loss L, and then calculate the regularization term Ω(f k ) to obtain the model regularization term Ω; then calculate the sum of the model loss L and the model regularization term Ω to obtain the objective function value Obj.

[0142] A140. Obtain a target recognition model based on the objective function value, the target test set and the primary recognition model.

[0143] Embodiment 6

[0144] A method for identifying wiring errors in an electric energy metering device provided in a sixth embodiment of the present application optimizes the "obtaining a target recognition model based on the objective function value, the target test set, and the primary recognition model" in the first embodiment; it should be noted that, for the parts not described in detail in this embodiment, reference may be made to the descriptions of other embodiments, and the method includes:

[0145] S610: Collect target electrical data of the electric energy metering device.

[0146] S620: Input the target electrical data into a target recognition model for processing and outputting a target wiring type.

[0147] The target recognition model training step includes:

[0148] A610. Process historical wiring electrical data to obtain target training sets and target test sets.

[0149] A620. Iteratively train the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determine the leaf node weights.

[0150] A630. Obtain a model loss based on the target training set and the primary recognition model, and obtain an objective function value based on the model loss, the leaf node weights and the model variables.

[0151] A641. In response to the objective function value not being the minimum function value, a confusion matrix is ​​obtained based on the target test set and a current recognition model corresponding to the objective function value.

[0152] Among them, the minimum function value is the minimum value of the objective function corresponding to the objective function value; the target test set also includes the target test data corresponding to the above eight types of wiring, and the above eight types of wiring are respectively recorded as category 0, category 1, category 2, category 3, category 4, category 5, category 6, and category 7; primary recognition model; each iterative training of the primary recognition model has a corresponding objective function value; taking one of the iterative training as an example, obtain the recognition model corresponding to the iterative training, that is, the current recognition model; the current recognition model processes the target test data corresponding to the actual eight types of wiring in the target test set, and obtains the predicted classification corresponding to the target test data corresponding to each type of wiring, and the predicted classification is also the above eight types of wiring; use the predicted classification as the horizontal data, and the actual eight types of wiring corresponding to the predicted classification as the vertical data to establish a confusion matrix, such as Figure 2 shown.

[0153] A642. Calculate a performance evaluation index based on the confusion matrix.

[0154] Among them, the performance evaluation indicators include: accuracy A, precision P, recall rate R and F1 value; among them, the calculation formula of accuracy A is: Among them, TP represents the number of true positive examples in the confusion matrix, and the true positive examples represent the data predicted as positive but actually positive; TN represents the number of true negative examples in the confusion matrix, and the true negative examples represent the data predicted as negative but actually negative; FP represents the number of false positive examples in the confusion matrix, and the true negative examples represent the data predicted as positive but actually negative; FN represents the number of false negative examples in the confusion matrix, and the false negative examples represent the data predicted as negative but actually positive; the calculation formula of precision P is: The calculation formula of recall rate R is: The calculation formula of F1 value is:

[0155] A643. Iteratively optimize the primary recognition model based on the performance evaluation index until the objective function value is the minimum function value, thereby obtaining a target recognition model.

[0156] Among them, the current performance of the current recognition model can be determined by evaluating various performance evaluation indicators; thereby judging whether the performance of the current recognition model meets the standard; if it does not meet the standard, the current recognition model can be iterated for the next time, and so on, until the objective function value is calculated to be the minimum function value, and then the current recognition model corresponding to the objective function value at this time is used as the target recognition model.

[0157] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0158] Embodiment 7

[0159] Based on the same inventive concept, this embodiment also provides an electric energy metering device wiring error identification device for implementing the electric energy metering device wiring error identification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the electric energy metering device wiring error identification device provided below can refer to the limitations of the electric energy metering device wiring error identification method above, and will not be repeated here.

[0160] In this embodiment, Figure 3 As shown, a device for identifying wiring errors of an electric energy metering device is provided, comprising:

[0161] An electrical data acquisition module, used to acquire target electrical data of the electric energy metering device;

[0162] An error type identification module is used to input the target electrical data into a target identification model for processing and outputting a target wiring type;

[0163] The target recognition model training step includes:

[0164] Processing historical wiring electrical data to obtain target training sets and target test sets;

[0165] Iteratively training the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determining the weights of the leaf nodes;

[0166] Obtaining a model loss based on the target training set and the primary recognition model, and obtaining an objective function value based on the model loss, the leaf node weights, and the model variables;

[0167] A target recognition model is obtained based on the objective function value, the target test set and the primary recognition model.

[0168] Each module in the above-mentioned electric energy metering device wiring error identification device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.

[0169] It should be noted that this embodiment collects the target electrical data of the electric energy metering device; inputs the target electrical data into the target recognition model for processing and outputs the target wiring type; wherein the training step of the target recognition model includes: processing the historical wiring electrical data to obtain the target training set and the target test set; iteratively training the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determining the leaf node weights; obtaining the model loss based on the target training set and the primary recognition model, and obtaining the objective function value based on the model loss, the leaf node weights and the model variables; obtaining the target recognition model based on the objective function value, the target test set and the primary recognition model. Through the above implementation, it is only necessary to collect the target electrical data of the electric energy metering device on site, and then input it into the target recognition model for processing, and then the target wiring type can be directly determined, which is convenient for improving the recognition efficiency of the wiring error type of the electric energy metering device.

[0170] Embodiment 8

[0171] In this embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for identifying wiring errors in an electric energy metering device is implemented.

[0172] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0173] Embodiment 9

[0174] In this embodiment, a computer readable storage medium is provided. Figure 5 As shown, a computer program is stored thereon, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0175] Embodiment 10

[0176] In this embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0177] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0178] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.

[0179] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0180] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.

Claims

1. A method for identifying wiring errors in an electric energy metering device, characterized in that: include: Collect target electrical data of electric energy metering devices; Inputting the target electrical data into a target recognition model for processing and outputting a target wiring type; The target recognition model training step includes: Processing historical wiring electrical data to obtain target training sets and target test sets; Iteratively training the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determining the weights of the leaf nodes; Obtaining a model loss based on the target training set and the primary recognition model, and obtaining an objective function value based on the model loss, the leaf node weights, and the model variables; A target recognition model is obtained based on the objective function value, the target test set and the primary recognition model.

2. The method according to claim 1, characterized in that The processing of the historical wiring electrical data to obtain a target training set and a target test set includes: Preprocessing the historical wiring electrical data to obtain cleaned data; Standardizing the cleaning data to obtain standard data; Processing the standard data based on a preset diversity ratio to obtain a primary training set and a primary test set; The primary training set and the primary test set are format converted to obtain a target training set and a target test set.

3. The method according to claim 1, characterized in that The iterative training of the split nodes in the primary recognition model based on the target training set to obtain leaf nodes includes: Calculating split node gains based on the target training set and model variables; Determining whether to split the split node based on the split node gain and the gain threshold; If yes, split the split node to obtain child nodes and child node data; The child node is used as a new split node, and the new split node is iteratively trained based on the child node data until a preset iteration stop condition is met to obtain a leaf node.

4. The method according to claim 3, characterized in that: The calculating the split node gain based on the target training set and the model variables includes: Processing the target training set based on a preset data threshold to obtain a left node data set and a right node data set; Calculate the sum of the first-order derivative and the sum of the second-order derivative based on the left node data set, and calculate the sum of the third-order derivative and the sum of the fourth-order derivative based on the right node data set; The split node gain is calculated based on the first order derivative sum, the second order derivative sum, the third order derivative sum, the fourth order derivative and the model variables; wherein the model variables include an L2 regularization parameter and a gain threshold.

5. The method according to claim 1, characterized in that The obtaining of the objective function value based on the model loss, the leaf node weight and the model variable comprises: Calculating a model regularization term based on the leaf node weights and model variables; An objective function value is obtained based on the model loss and the model regularization term.

6. The method according to claim 1, characterized in that The obtaining of the target recognition model based on the objective function value, the target test set and the primary recognition model comprises: In response to the objective function value not being a minimum function value, obtaining a confusion matrix based on the target test set and a current recognition model corresponding to the objective function value; Calculate a performance evaluation index based on the confusion matrix; The primary recognition model is iteratively optimized based on the performance evaluation index until the objective function value is the minimum function value, thereby obtaining a target recognition model.

7. A device for identifying wiring errors in an electric energy metering device, characterized in that: The device comprises: An electrical data acquisition module, used to acquire target electrical data of the electric energy metering device; An error type identification module is used to input the target electrical data into a target identification model for processing and outputting a target wiring type; The target recognition model training step includes: Processing historical wiring electrical data to obtain target training sets and target test sets; Iteratively training the split nodes in the primary recognition model based on the target training set to obtain leaf nodes, and determining the weights of the leaf nodes; Obtaining a model loss based on the target training set and the primary recognition model, and obtaining an objective function value based on the model loss, the leaf node weights, and the model variables; A target recognition model is obtained based on the objective function value, the target test set and the primary recognition model.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and device for detecting wrong wiring of electric energy metering device

    CN108445438A

  • Load identification method based on electric power fingerprint and computer readable storage medium

    CN110544177A

  • Signal quality prediction method and device, electronic equipment and nonvolatile storage medium

    CN115334561A

  • Fusion algorithm-based three-phase three-wire electric energy meter wrong wiring diagnosis method

    CN117491912A

  • Multi-coal-type coal calorific value determination method and system based on NIRS-XRF combination

    CN118709081A