Method, device and equipment for identifying wiring error of electric energy metering device and storage medium

By processing the electrical data of the power metering device through a target recognition model, wiring errors such as reversed current terminals are identified, solving the problem of low efficiency in identifying wiring errors in power metering devices and achieving fast and accurate identification of wiring errors.

CN119438983BActive Publication Date: 2025-12-19GUANGDONG POWER GRID CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing electricity metering devices are prone to wiring errors during installation, leading to inaccurate electricity metering, affecting the fairness of electricity billing and potentially causing safety hazards. Furthermore, existing testing equipment is costly, cumbersome to operate, and inconvenient to carry.

Method used

A target recognition model is used to process the target electrical data of the power metering device. By collecting voltage, current and phase data, eight types of wiring errors are identified, including reversed current terminals and reversed current polarity. The XGBoost model is used for iterative training and weight determination to improve recognition efficiency.

Benefits of technology

It enables rapid and accurate identification of wiring errors in electricity metering devices, improving identification efficiency and reducing equipment costs and operational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119438983B_ABST
    Figure CN119438983B_ABST
Patent Text Reader

Abstract

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

Description

Technical Field

[0001] This application relates to the field of power grid supply technology, and in particular to a method, device, equipment and storage medium for identifying wiring errors in an electricity metering device. Background Technology

[0002] Currently, electricity metering devices are generally used to measure the electricity consumption of industrial users and high-power electrical equipment, such as three-phase three-wire electricity metering devices, so as to achieve accurate calculation of electricity consumption and reasonable settlement of electricity costs.

[0003] During the installation of electricity metering devices, wiring errors frequently occur due to complex installation environments, inexperienced operators, and aging equipment. These errors lead to inaccurate electricity metering, affecting the fairness of electricity billing and potentially causing safety hazards in the power system. Excessive positive error in the metering device will result in economic losses for users. The types of wiring errors are varied, such as reversed current terminals and reversed current polarity. Installers need to first determine the type of wiring error before correcting it. Currently, electricity meter calibration instruments are generally used, and the hexagonal diagram method is applied to perform relevant tests on the electricity metering device to determine the type of wiring error.

[0004] However, the cost of electricity meter calibration equipment is high, the instrument is bulky and inconvenient to carry and transport, the testing process is cumbersome and difficult to use, and it has high environmental requirements and requires continuous power supply. Therefore, the identification efficiency of wiring errors in electricity metering devices is low. Summary of the Invention

[0005] To improve the efficiency of identifying wiring errors in electricity metering devices, this application provides a method, apparatus, device, and storage medium for identifying wiring errors in electricity metering devices.

[0006] In a first aspect, this application provides a method for identifying wiring errors in an electricity metering device, including:

[0007] Collect target electrical data from the power metering device;

[0008] The target electrical data is input into the target identification model for processing, and the target wiring type is output.

[0009] The training steps of the target recognition model include:

[0010] Process historical wiring electrical data to obtain the target training set and the target test set;

[0011] Based on the target training set, the split nodes in the primary recognition model are iteratively trained to obtain leaf nodes, and the weights of the leaf nodes are determined.

[0012] obtaining a model loss based on the target training set and the primary identification model, and obtaining a target function value based on the model loss, the leaf node weight, and a model variable;

[0013] obtaining a target identification model based on the target function value, the target test set, and the primary identification model.

[0014] In a second aspect, the present application provides an electrical energy metering device wiring error identification device, comprising:

[0015] an electrical data acquisition module, configured to acquire target electrical data of the electrical energy metering device;

[0016] an error type identification module, configured to input the target electrical data into a target identification model for processing and output a target wiring type;

[0017] The training step of the target identification model comprises:

[0018] processing historical wiring electrical data to obtain a target training set and a target test set;

[0019] iteratively training a split node in a primary identification model based on the target training set to obtain a leaf node, and determining a leaf node weight;

[0020] obtaining a model loss based on the target training set and the primary identification model, and obtaining a target function value based on the model loss, the leaf node weight, and a model variable;

[0021] obtaining a target identification model based on the target function value, the target test set, and the primary identification model.

[0022] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements 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, which stores a computer program, and the computer program is executed by a processor to implement the steps in the above method.

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

[0025] The power metering device wiring error identification method, device, equipment and storage medium described above, by collecting target electrical data of the power metering device; the target electrical data is input into a target identification model for processing and outputting a target wiring type; wherein the training step of the target identification model includes: processing historical wiring electrical data to obtain a target training set and a target test set; based on the target training set, the leaf nodes are obtained by iteratively training the split nodes in the primary identification model, and the leaf node weights are determined; based on the target training set and the primary identification model, the model loss is obtained, and the target function value is obtained based on the model loss, the leaf node weights and the model variables; based on the target function value, the target test set and the primary identification model, the target identification model is obtained. Through the above implementation, only the target electrical data of the power metering device needs to be collected on site, then input into the target identification model for processing, and then the target wiring type can be directly determined, so as to improve the identification efficiency of the wiring error type of the power metering device.

[0026] It should be understood that the content described in this part 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 apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0028] Figure 1 A flow chart of a power metering device wiring error identification method provided in the embodiments of the present application;

[0029] Figure 2 A confusion matrix diagram provided in the embodiments of the present application;

[0030] Figure 3 A structural diagram of a power metering device wiring error identification device provided in the embodiments of the present application;

[0031] Figure 4 A structural diagram of a computer device provided in the embodiments of the present application;

[0032] Figure 5 An internal structure diagram of a computer readable storage medium provided in the embodiments of the present application. DETAILED DESCRIPTION

[0033] In order to make the purposes, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and not to limit the present disclosure.

[0034] It should be noted that the terms "first", "second" and the like in the description and claims of this text and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, device, product or equipment including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or equipment.

[0035] In this text, the term "and / or" is only a description of the association relationship between the associated objects, which means that there can be three relationships. For example, A and / or B can represent three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in this text generally represents that the front and rear associated objects are in an "or" relationship.

[0036] Embodiment one

[0037] Figure 1 A flow chart of a method for identifying wiring errors of an electric energy metering device is provided for the first embodiment of the present application, referring to Figure 1 The method can be executed by a device executing the method, which can be implemented in software and / or hardware. The method comprises the following steps:

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

[0039] In this embodiment, the electric energy metering device 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, the voltage data, current data, phase data and power data of the three-phase three-wire electric energy metering device which needs to be identified for wiring errors are collected.

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

[0042] The target identification model is a trained identification model, and is used to process the target electrical data input therein and output a target wiring type; the target wiring type is a specific wiring type of the electric energy metering device, and in this embodiment, the target wiring type includes the following eight wiring types:

[0043] First, the current terminal is reversed;

[0044] Second, the current polarity is reversed;

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

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

[0047] Fifth, the voltage phase sequence is wrong and the current terminal is 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 terminal is reversed;

[0050] Eighth, correct metering.

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

[0052] The training steps of the target identification model include:

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

[0054] The historical wiring electrical data includes historical voltage data, historical current data, historical phase data, and historical power data corresponding to the above eight wiring types; the target training set is data in the historical wiring electrical data used for training the identification model, and the target test set is data in the historical wiring electrical data used for performance testing of the identification model trained in each iteration.

[0055] Specifically, the historical wiring electrical data is divided into the target training set and the target test set by processing the historical wiring electrical data.

[0056] A120, based on the target training set, the split nodes in the primary identification model are iteratively trained to obtain leaf nodes, and the leaf node weights are determined.

[0057] The primary identification model is an untrained identification model, and in the embodiment, the identification model specifically adopts an XGBoost model, and in other embodiments, the specific form is not limited; the XGBoost model is provided with a decision tree, each decision tree specifically corresponds to a split node, and the complexity of the decision tree can be improved by iteratively training the split node, thereby improving the classification and identification 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 a preset iteration stop condition, the final split node is a leaf node, and by processing the leaf node, the weight corresponding to the leaf node, that is, the leaf node weight w j , can be determined, where j represents the jth leaf node in the XGBoost model, and in the embodiment, the leaf node weight w j may be determined according to the data amount of the data in the target training set contained in the leaf node.

[0058] Specifically, taking one of the split nodes 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, and then the new split node is continuously trained until a preset iteration stop condition is met, and the new split node obtained when the iteration stop condition is met is a leaf node; further, the leaf node is processed to obtain the leaf node weight w j corresponding to the leaf node.

[0059] A130, based on the target training set and the primary identification model, a model loss is obtained, and based on the model loss, the leaf node weight, and a model variable, a target function value is obtained.

[0060] wherein y i and y i represent the i th training data in the target training set; the primary identification model can output corresponding prediction data y i by processing the training data y The model loss can be calculated based on the training data y i and the corresponding prediction data y The target function value is used to represent the accuracy of the identification model in predicting the target connection type in the iteration training; the model variable in the embodiment includes the number of decision trees T, the gain threshold γ, and the L2 regularization parameter λ, and the target function value Obj can be calculated based on the model loss, the leaf node weight w j , and the model variable.

[0061] Specifically, the training data y iInput into the primary identification model for processing, output corresponding prediction data Based on the training data y i With the prediction data Calculate the model loss of the primary identification model; further, according to the model loss, the leaf node weight w j And the model variable to calculate the objective function value Obj.

[0062] A140, based on the target function value, the target test set and the primary identification model to obtain the target identification model.

[0063] Wherein, the primary identification model can be iteratively trained through the objective function value and the target test set, so as to gradually improve the classification and identification performance of the identification model, until the objective function value reaches the minimum value, so that the trained identification model, that is, the target identification model, can be obtained.

[0064] Specifically, the primary identification model is iteratively trained through the objective function value and the target test set until the objective function value reaches the minimum value, so as to obtain the target identification model.

[0065] It should be noted that the target electrical data of the electric energy metering device is collected; the target electrical data is input into the target identification model for processing to output the target wiring type; wherein the training step of the target identification model comprises: processing the historical wiring electrical data to obtain the target training set and the target test set; based on the target training set, the split nodes in the primary identification model are iteratively trained to obtain the leaf nodes, and the leaf node weight is determined; based on the target training set and the primary identification model, the model loss is obtained, based on the model loss, the leaf node weight and the model variable, the objective function value is obtained; based on the target function value, the target test set and the primary identification model, the target identification model is obtained. Through the above implementation, only the target electrical data of the electric energy metering device needs to be collected on site, then input into the target identification model for processing, and then the target wiring type can be directly determined, so as to improve the identification efficiency of the wiring error type of the electric energy metering device.

[0066] Embodiment two

[0067] The electric energy metering device wiring error identification method provided in embodiment two of the present application optimizes the "processing historical wiring electrical data to obtain target training set and target test set" in embodiment one; it should be noted that the parts not described in this embodiment can be referred to the description of other embodiments. The method comprises:

[0068] S210, collecting target electrical data of the electric energy metering device.

[0069] S220, inputting the target electrical data into a target identification model for processing to output a target wiring type.

[0070] The training step of the target identification model comprises:

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

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

[0073] A212, standardizing the cleaned data to obtain standard data.

[0074] In order to facilitate the subsequent primary identification model to process each data in the cleaned data at the same scale, the cleaned data needs to be standardized, and in this embodiment, the standardization can specifically use minimum-maximum standardization or Z-score standardization, wherein 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 conforming to a normal distribution; the standard data is 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, processing the standard data based on a preset diversity ratio to obtain a primary training set and a primary test set.

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

[0078] Specifically, according to the preset diversity ratio 7:3, it is determined that the data amount of the primary training set accounts for 7 / 10 of the standard data, and it is also determined that the data amount of the primary test set accounts for 3 / 10 of the standard data, and further, 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, performing format conversion on the primary training set and the primary test set to obtain a target training set and a target test set.

[0080] The original data format of the primary training set and the primary test set is not suitable for processing in the primary identification model. If the primary training set and the primary test set are directly processed by the primary identification model, the processing speed will be slow. In order to improve the processing speed of the primary identification model on the primary training set and the primary test set, the data format of the primary training set and the primary test set needs to be converted into a data format suitable for processing by the primary identification model. The data format suitable for processing by the primary identification model is DMatrix format in this embodiment.

[0081] Specifically, the primary training set and the primary test set are converted into DMatrix format data, thereby obtaining a target training set corresponding to the primary training set and a target test set corresponding to the primary test set.

[0082] A220, based on the target training set, the split nodes in the primary identification model are iteratively trained to obtain leaf nodes, and the leaf node weights are determined.

[0083] A230, based on the target training set and the primary identification model, a model loss is obtained, based on the model loss, the leaf node weights and the model variables, a target function value is obtained.

[0084] A240, based on the target function value, the target test set and the primary identification model, a target identification model is obtained.

[0085] Embodiment three

[0086] The method provided by the embodiment three of the application is a method for identifying wiring errors of an electric energy metering device. The method optimizes the "iterative training of split nodes in the primary identification model based on the target training set" in the embodiment one. It should be noted that the parts not described in this embodiment can be referred to the descriptions of other embodiments. The method comprises the following steps:

[0087] S310, target electrical data of the electric energy metering device is collected.

[0088] S320, the target electrical data is input into the target identification model for processing to output a target wiring type.

[0089] The training steps of the target identification model comprise the following steps:

[0090] A310, historical wiring electrical data is processed to obtain a target training set and a target test set.

[0091] A321, based on the target training set and the model variables, a split node gain is calculated.

[0092] The split node gain corresponding to the split node gain is obtained by inputting the data in the target training set and the model variable into a preset split node gain calculation formula.

[0093] A322, determining whether to split the split node based on the split node gain and a 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 indicates 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 the gain threshold, so as to determine whether to split the split node.

[0096] A323, if yes, splitting the split node to obtain a child node and child node data.

[0097] The child node is a new split node obtained after the split node is split; each split node has corresponding node data, which is derived from the target training set. After the split node is split into two child nodes, the node data corresponding to the split node is also allocated to the two child nodes. The node data allocated to each child node is 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 split into two child nodes, and the node data corresponding to the split node is allocated to one of the child nodes to obtain the child node data.

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

[0100] The iterative training means that the child node is taken as a new split node, the child node data is taken as new target training data, and the new split node is used to process the new target training data to obtain a new split node gain. Then, the above steps A322-A323 are re-executed to realize the iterative training of the new split node. The iteration stop condition is that the number of iterations reaches a preset iteration number threshold.

[0101] A325, determining a leaf node weight.

[0102] A330, obtaining a model loss based on the target training set and the primary identification model, and obtaining a target function value based on the model loss, the leaf node weight, and a model variable.

[0103] A340, obtaining a target identification model based on the target function value, the target test set, and the primary identification model.

[0104] Embodiment Four

[0105] The method provided in Embodiment Four of the present application is a wiring error identification method for electric energy metering devices, which optimizes the "calculating split node gain based on the target training set and model variable" in Embodiment Three; it should be noted that the parts not described in this embodiment can be referred to the descriptions of other embodiments. This method comprises the following steps:

[0106] S410, collecting target electrical data of the electric energy metering device.

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

[0108] The training step of the target identification model comprises the following steps:

[0109] A410, processing historical wiring electrical data to obtain a target training set and a target test set.

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

[0111] The preset data threshold is used for comparison with the target training data in the target training set. The left node data set is a collection of target training data in the target training set that is less than the preset data threshold, and the right node data set is a collection of target training data in the target training set that is not less than the preset data threshold.

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

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

[0114] The first-order derivative sum is the sum of the first-order derivatives of the data in the left node data set, and the second-order derivative sum is the sum of the second-order derivatives of the 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, and h i represents the second-order derivative of the i-th data in the left node data set. The third-order derivative sum is the sum of the first-order derivatives of each data in the right node data set, and the fourth-order derivative sum the sum of the second-order derivatives of each data in the right node data set; wherein, I R denotes the right node data set, g i denotes the first-order derivative of the i-th data in the right node data set, h i denotes 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 first-order derivative sum; 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 second-order derivative sum; 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 third-order derivative sum; 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 fourth-order derivative sum.

[0116] A421C, the first-order derivative sum, the second-order derivative sum, the third-order derivative sum, the fourth-order derivative, and the model variable are calculated to obtain the split node gain; wherein, the model variable includes an L2 regularization parameter and a gain threshold.

[0117] wherein, the first-order derivative sum and the third-order derivative sum are denoted as the fifth-order derivative sum i∈I g i , the second-order derivative and the fourth-order derivative sum sum are denoted as the sixth-order derivative sum i∈I h i ; the model variable includes an L2 regularization parameter λ and a gain threshold γ; the calculation formula of the split node gain Gain is as follows:

[0118]

[0119] Specifically, the sum of the first-order derivative sum and the third-order derivative is calculated to obtain the fifth-order derivative sum i∈I g i , and the sum of the second-order derivative and the fourth-order derivative sum is calculated to obtain the sixth-order derivative sum i∈I h iFurther, the first derivative sum, the second derivative sum, the third derivative sum, the fourth derivative, the fifth derivative, the sixth derivative, and the L2 regularization parameter λ and the gain threshold γ are substituted into the calculation formula of the split node gain Gain to obtain the split node gain Gain.

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

[0121] A423, if yes, splitting the split node to obtain a child node and child node data.

[0122] A424, taking the child node as a new split node, and iteratively training the new split node based on the child node data until a preset iteration stopping condition is met to obtain a leaf node.

[0123] A425, determining a leaf node weight.

[0124] A430, obtaining a model loss based on the target training set and the primary identification model, and obtaining a target function value based on the model loss, the leaf node weight, and a model variable.

[0125] A440, obtaining a target identification model based on the target function value, the target test set, and the primary identification model.

[0126] Embodiment five

[0127] The method provided by Embodiment Five of the present application optimizes the "obtaining a target function value based on the model loss, the leaf node weight, and a model variable" in Embodiment One; it should be noted that the parts not described in detail in this embodiment can be referred to the descriptions of other embodiments. The method comprises:

[0128] S510, collecting target electrical data of the electric energy metering device.

[0129] S520, inputting the target electrical data into the target identification model for processing to output a target wiring type.

[0130] The training step of the target identification model comprises:

[0131] A510, processing historical wiring electrical data to obtain a target training set and a target test set.

[0132] A520, iteratively training a split node in a primary identification model based on the target training set to obtain a leaf node, and determining a leaf node weight.

[0133] A531、based on the target training set and the primary identification model, a model loss is obtained.

[0134] A532、based on the leaf node weight and the model variable, a model regularization term is calculated.

[0135] For example, taking the kth decision tree in the primary identification model as an example, the decision tree has its corresponding single-tree regularization term Ω(f k ), and the calculation formula of the single-tree regularization term Ω(f k ) is as follows:

[0136]

[0137] Wherein, λ 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, w j represents the leaf node weight of the jth leaf node in the primary identification model.

[0138] Specifically, the L2 regularization parameter λ, the gain threshold γ, the number of decision trees T in the model variable, and the leaf node weight w j of each leaf node in the primary identification model are substituted into the calculation formula of the above single-tree regularization term Ω(f k ) to calculate the single-tree regularization term Ω(f k ).

[0139] A533、based on the model loss and the model regularization term, a target function value is obtained.

[0140] Wherein, the model loss L in this embodiment is the sum of the squares of the differences between each target training data y i in the target training set and the corresponding predicted data , n is the data amount of the target training data y i in the target training set; the model regularization term Ω is the sum of each single-tree regularization term Ω(f k ), and the target function value Obj is the sum of the model loss L and the model regularization term Ω, Obj=L+Ω.

[0141] Specifically, the model loss L is calculated first by calculating the sum of the squares of the differences between each target training data y i in the target training set and the corresponding predicted data , and then the sum of each single-tree regularization term Ω(f k ) is calculated to obtain the model regularization term Ω; then the sum of the model loss L and the model regularization term Ω is calculated to obtain the target function value Obj.

[0142] A140、based on the target function value, the target test set, and the primary identification model, a target identification model is obtained.

[0143] Embodiment six

[0144] The embodiment six of the present application provides a wiring error identification method of an electric energy metering device. The method optimizes the "obtaining a target identification model based on the target function value, the target test set and the primary identification model" in the embodiment one. It needs to be noted that the parts not described in detail in the present embodiment can be referred to the descriptions of other embodiments. The method comprises the following steps:

[0145] S610, collecting target electrical data of the electric energy metering device.

[0146] S620, inputting the target electrical data into the target identification model for processing and outputting a target wiring type.

[0147] The training step of the target identification model comprises the following steps:

[0148] A610, processing historical wiring electrical data to obtain a target training set and a target test set.

[0149] A620, iteratively training a split node in a primary identification model based on the target training set to obtain a leaf node and determine a leaf node weight.

[0150] A630, obtaining a model loss based on the target training set and the primary identification model, and obtaining a target function value based on the model loss, the leaf node weight and a model variable.

[0151] A641, in response to the target function value not being a minimum function value, obtaining a confusion matrix based on the target test set and a current identification model corresponding to the target function value.

[0152] The minimum function value is the minimum value of the target function corresponding to the target function value. The target test set also comprises target test data corresponding to the eight wiring types, and the eight wiring types are respectively denoted as class 0, class 1, class 2, class 3, class 4, class 5, class 6 and class 7. The primary identification model is iteratively trained. Each iteration of the primary identification model has a corresponding target function value. Taking one iteration as an example, the identification model corresponding to the iteration, i.e. the current identification model, is obtained. The current identification model processes the target test data in the target test set corresponding to the actual eight wiring types to obtain a predicted classification corresponding to each wiring type, and the predicted classification is also the eight wiring types. A confusion matrix is established with the predicted classification as the horizontal data and the actual eight wiring types corresponding to the predicted classification as the vertical data, as shown in the following table. Figure 2

[0153] ​A642, calculate a performance evaluation index based on the confusion matrix.

[0154] The performance evaluation index includes an accuracy A, a precision P, a recall R, and an F1 value. The accuracy A is calculated according to the following formula: In the formula, TP represents the number of true positives in the confusion matrix, a true positive representing data that is predicted to be positive and is actually positive. TN represents the number of true negatives in the confusion matrix, a true negative representing data that is predicted to be negative and is actually negative. FP represents the number of false positives in the confusion matrix, a false positive representing data that is predicted to be positive and is actually negative. FN represents the number of false negatives in the confusion matrix, a false negative representing data that is predicted to be negative and is actually positive. The precision P is calculated according to the following formula: The recall R is calculated according to the following formula: The F1 value is calculated according to the following formula:

[0155] A643, iteratively optimize the primary recognition model based on the performance evaluation index until the target function value is the minimum function value, to obtain a target recognition model.

[0156] The performance of the current recognition model can be determined by evaluating each performance evaluation index, so as to determine whether the performance of the current recognition model meets the standard. If the performance does not meet the standard, the current recognition model can be iterated again. In this way, the target function value is calculated until it is the minimum function value. Then, the current recognition model corresponding to the target function value at this time is taken as the target recognition model.

[0157] It should be understood that, although each step in the flowchart involved in each embodiment described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times. The execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0158] Embodiment Seven

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

[0160] In the embodiments, as shown in Figure 3 An electric energy metering device wiring error identification device is provided, comprising:

[0161] An electrical data acquisition module is configured to acquire target electrical data of the electric energy metering device.

[0162] An error type identification module is configured to input the target electrical data into a target identification model for processing and output a target wiring type.

[0163] The training step of the target identification model comprises:

[0164] Processing historical wiring electrical data to obtain a target training set and a target test set.

[0165] Iteratively training split nodes in a primary identification model based on the target training set to obtain leaf nodes and determine leaf node weights.

[0166] Obtaining a model loss based on the target training set and the primary identification model, obtaining a target function value based on the model loss, the leaf node weights, and model variables.

[0167] Obtaining a target identification model based on the target function value, the target test set, and the primary identification model.

[0168] Each module in the above electric energy metering device wiring error identification device can be realized by software, hardware, and combinations thereof, in whole or in part. Each module described above can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0169] It should be noted that the embodiment acquires target electrical data of the electric energy metering device, inputs the target electrical data into a target identification model for processing and outputting a target wiring type, wherein the training step of the target identification model comprises: processing historical wiring electrical data to obtain a target training set and a target test set; iteratively training a split node in a primary identification model based on the target training set to obtain a leaf node and determine a leaf node weight; obtaining a model loss based on the target training set and the primary identification model, obtaining a target function value based on the model loss, the leaf node weight and a model variable; and obtaining a target identification model based on the target function value, the target test set and the primary identification model. Through the above implementation, only the target electrical data of the electric energy metering device needs to be collected on site, then input into the target identification model for processing, and then the target wiring type can be directly determined, so as to improve the identification efficiency of the wiring error type of the electric energy metering device.

[0170] Embodiment eight

[0171] In the embodiment, a computer device is provided, which can be a server, and an internal structure diagram thereof can be as shown in Figure 4 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 operating system and the computer program in the non-volatile storage medium to run. 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. The computer program is executed by the processor to implement an electric energy metering device wiring error identification method.

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

[0173] Embodiment nine

[0174] In the embodiment, a computer readable storage medium is provided, as shown in Figure 5 The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in the above method embodiments.

[0175] Embodiment ten

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

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

[0178] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, 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 above-mentioned embodiments. Any reference to 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 memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric 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 but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present disclosure can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present disclosure can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0179] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, as long as the combinations of technical features do not have contradictions, they shall be considered within the scope of the present disclosure.

[0180] The above embodiments only express several implementation manners of the present disclosure, and the description is relatively specific and detailed, but it shall not be understood as a limitation on the patent scope of the present disclosure. It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these shall be within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the appended claims.

Claims

1. An electric energy metering device wiring error recognition method, characterized by, The method comprises: collecting target electrical data of an electric energy metering device; inputting the target electrical data into a target identification model for processing to output a target connection type; wherein the training step of the target identification model comprises: processing historical connection electrical data to obtain a target training set and a target test set; iteratively training a split node in a primary identification model based on the target training set to obtain a leaf node and determine a leaf node weight; obtaining a model loss based on the target training set and the primary identification model, obtaining a target function value based on the model loss, the leaf node weight, and a model variable; obtaining a target identification model based on the target function value, the target test set, and the primary identification model; wherein the iteratively training a split node in a primary identification model based on the target training set to obtain a leaf node comprises: calculating a split node gain based on the target training set and a model variable; determining whether to split the split node based on the split node gain and a gain threshold; if yes, splitting the split node to obtain a child node and child node data; taking the child node as a new split node, iteratively training the new split node based on the child node data until a preset iteration stop condition is met to obtain a leaf node; wherein the calculating a split node gain based on the target training set and a model variable comprises: processing the target training set based on a preset data threshold to obtain a left node data set and a right node data set; calculating a first-order derivative sum and a second-order derivative sum based on the left node data set, and calculating a third-order derivative sum and a fourth-order derivative sum based on the right node data set; calculating a split node gain based on the first-order derivative sum, the second-order derivative sum, the third-order derivative sum, the fourth-order derivative, and the model variable; wherein the model variable comprises an L2 regularization parameter and a gain threshold.

2. The method of claim 1, wherein, The processing historical connection electrical data to obtain a target training set and a target test set comprises: preprocessing the historical connection electrical data to obtain cleaned data; standardizing the cleaned 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; format-converting the primary training set and the primary test set to obtain a target training set and a target test set.

3. The method of claim 1, wherein, The obtaining a target function value based on the model loss, the leaf node weight, and a model variable comprises: calculating a model regularization term based on the leaf node weight and a model variable; obtaining a target function value based on the model loss and the model regularization term.

4. The method of claim 1, wherein, The obtaining a target identification model based on the target function value, the target test set, and the primary identification model comprises: in response to the target function value not being a minimum function value, obtaining a confusion matrix based on the target test set and a current identification model corresponding to the target function value; calculating a performance evaluation index based on the confusion matrix; iteratively optimizing the primary identification model based on the performance evaluation index until the target function value is a minimum function value to obtain a target identification model.

5. An electric energy metering device wiring error recognition device characterized by comprising: The device comprises: An electrical data acquisition module is configured to acquire target electrical data of an electric energy metering device. An error type identification module is configured to input the target electrical data into a target identification model for processing and output a target wiring type. The training step of the target identification model comprises: processing historical wiring electrical data to obtain a target training set and a target test set; iteratively training a split node in a primary identification model based on the target training set to obtain a leaf node and determine a leaf node weight; obtaining a model loss based on the target training set and the primary identification model, obtaining a target function value based on the model loss, the leaf node weight, and a model variable; obtaining a target identification model based on the target function value, the target test set, and the primary identification model; The iteratively training a split node in a primary identification model based on the target training set to obtain a leaf node comprises: calculating a split node gain based on the target training set and a model variable; determining whether to split the split node based on the split node gain and a gain threshold; if yes, splitting the split node to obtain a child node and child node data; treating the child node as a new split node, iteratively training the new split node based on the child node data until a preset iteration stop condition is met, and obtaining a leaf node. The calculating a split node gain based on the target training set and a model variable comprises: processing the target training set based on a preset data threshold to obtain a left node data set and a right node data set; calculating a first-order derivative sum and a second-order derivative sum based on the left node data set, and calculating a third-order derivative sum and a fourth-order derivative sum based on the right node data set; calculating a split node gain based on the first-order derivative sum, the second-order derivative sum, the third-order derivative sum, the fourth-order derivative sum, and the model variable; wherein the model variable comprises an L2 regularization parameter and a gain threshold. 6.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-5 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 4.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 4.

8. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • 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