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

A method and device using a target prediction model to identify wiring anomalies in electric energy metering devices improve detection efficiency by processing collected electrical data, addressing the inefficiencies of traditional calibrator-based methods.

CN119224676APending Publication Date: 2024-12-31GUANGDONG POWER GRID CO LTD +1

Patent Information

Application Number
CN202411602993.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Existing methods for identifying abnormal wiring in electric energy metering devices, such as using large and expensive calibrators, are inefficient and cumbersome, and are easily affected by on-site environments, leading to low detection efficiency.

Method used

A method and device that utilize a target prediction model trained on historical electrical data to identify wiring anomalies in electric energy metering devices by collecting current electrical data, preprocessing it, and optimizing a primary prediction model to obtain a target prediction model without the need for large-scale calibrators.

Benefits of technology

Improves detection efficiency by predicting wiring conditions using collected electrical data through a target prediction model, eliminating the need for cumbersome calibrators and enhancing accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119224676A_ABST
    Figure CN119224676A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power grid maintenance, in particular to an electric energy metering device wiring abnormity identification method and device, equipment and a storage medium, and the method comprises the steps: obtaining the current electrical data of an electric energy metering device; and inputting the current electrical data into a target prediction model for processing and outputting the type of the wiring condition. The detection efficiency of determining the type of the wiring condition of the electric energy metering device is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of smart grids, electric energy metering devices have been widely used in industrial, commercial, and residential electricity consumption. When wiring electric energy metering devices, problems such as loose wiring, poor contact, wrong connection, and reverse connection often occur, resulting in errors or inaccuracies in electric energy metering.

[0003] At present, when checking the specific wiring condition of an electric energy metering device, it is necessary to determine the type of the wiring condition of the electric energy metering device so as to readjust the wiring according to the type of the wiring condition; a commonly used method for identifying abnormal wiring of an electric energy metering device is: using an electric energy metering device calibrator to detect various electrical data of the electric energy metering device, such as current data, voltage data, power data, etc., and making a phasor hexagonal diagram based on the electrical data, and then determining the specific type of the wiring condition based on the phasor hexagonal diagram.

[0004] However, the calibrator for electric energy metering devices is large in size, inconvenient to transport, and expensive. The calibration process is cumbersome and difficult to operate. At the same time, it is easily affected by the on-site environment. As a result, the detection efficiency of the method of using the calibrator for electric energy metering devices to determine the type of wiring condition is low. Summary of the invention

[0005] In order to improve the detection efficiency of determining the type of wiring condition of an electric energy metering device, the present application provides a method, device, equipment and storage medium for identifying wiring anomalies of an electric energy metering device.

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

[0007] Obtain current electrical data from energy metering devices;

[0008] Inputting the current electrical data into a target prediction model for processing and outputting the type of wiring condition;

[0009] The training step of the target prediction model includes:

[0010] Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring;

[0011] Preprocessing the historical electrical data to obtain processed data and data labels;

[0012] Training a primary prediction model based on the processed data to obtain a model loss, and optimizing the primary prediction model based on the model loss to obtain a candidate prediction model;

[0013] A target prediction model is obtained based on the processed data and the candidate prediction model.

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

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

[0016] A type prediction module, used for inputting the current electrical data into a target prediction model for processing and outputting the type of wiring condition;

[0017] The training step of the target prediction model includes:

[0018] Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring;

[0019] Preprocessing the historical electrical data to obtain processed data and data labels;

[0020] Training a primary prediction model based on the processed data to obtain a model loss, and optimizing the primary prediction model based on the model loss to obtain a candidate prediction model;

[0021] A target prediction model is obtained based on the processed data and the candidate prediction 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 abnormal wiring of electric energy metering devices, by acquiring the current electrical data of the electric energy metering device; inputting the current electrical data into the target prediction model for processing and outputting the type of wiring condition; wherein the training step of the target prediction model includes: determining the total wiring type based on the circuit connection method, and acquiring the historical electrical data corresponding to the total wiring type; preprocessing the historical electrical data to obtain processed data and data labels; training the primary prediction model based on the processed data to obtain the model loss, optimizing the primary prediction model based on the model loss to obtain the candidate prediction model; and obtaining the target prediction model based on the processed data and the candidate prediction model. Through the above implementation, there is no need to use a large-scale electric energy metering device calibrator to determine the type of wiring condition of the electric energy metering device, but only needs to collect the current electrical data of the electric energy metering device, and process the current electrical data through the target prediction model to predict the type of wiring condition of the electric energy metering device, which facilitates improving the detection efficiency of determining the type of wiring condition 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 abnormal wiring of 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 abnormal wiring of 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 abnormal wiring of 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, obtaining current electrical data of the electric energy metering device.

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

[0040] Specifically, electrical data such as current data, voltage data, phase data, and power data of the three-phase four-wire electric energy metering device that has completed the wiring operation are collected to obtain the electrical data.

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

[0042] The target prediction model is a prediction model that has been trained. The target prediction model is used to process the current electrical data and output the corresponding wiring condition type. The wiring condition types in this embodiment include the following seven categories:

[0043] First, correct measurement and positive voltage phase sequence;

[0044] Second, the current polarity is reversed and the voltage is positive phase sequence;

[0045] Third, the current phase sequence is wrong and the voltage phase sequence is positive;

[0046] Fourth, the current polarity is reversed, the current phase sequence is wrong, and the voltage phase sequence is reversed;

[0047] Fifth, the current polarity is reversed and the voltage phase sequence is reversed;

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

[0049] Seventh, the current polarity is reverse and the current phase sequence is wrong.

[0050] The training step of the target prediction model includes:

[0051] A110. Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring.

[0052] Among them, the circuit connection methods include 6 voltage terminal phase sequence connection methods, 6 current terminal phase sequence connection methods and 8 current terminal positive and reverse connection conditions; among them, the 6 voltage terminal phase sequence connection methods specifically include: Ua-Ub-Uc, Ub-Uc-Ua, Uc-Ua-Ub, Ua-Ub-Uc, Ub-Uc-Ua, Uc-Ua-Ub; the 6 current terminal phase sequence connection methods specifically include: Ia-Ib-Ic, Ib-Ic-Ia, Ic-Ia-Ib, Ia-Ib-Ic, Ib-Ic-Ia, Ic-Ia-Ib. The total number of connection types is 6*6*8=288, which are obtained by combining 6 voltage terminal phase sequence connection methods, 6 current terminal phase sequence connection methods and 8 current terminal positive and reverse connection conditions. The historical electrical data includes historical electrical data corresponding to 288 types of wiring; the historical electrical data includes historical current data, historical voltage data, historical phase data, historical power data, etc.

[0053] Specifically, the number of types of phase sequence connection methods at the voltage end in the circuit connection is determined to obtain a first number of types, the number of types of phase sequence connection methods at the current end in the circuit connection is determined to obtain a second number of types, and the number of types of positive and reverse connection conditions at the current end in the circuit connection is determined to obtain a third number of types; the product of the first number of types, the second number of types, and the third number of types is calculated to obtain a total wiring type; further, historical electrical data corresponding to each wiring type in the total wiring type is obtained.

[0054] A120. Preprocess the historical electrical data to obtain processed data and data labels.

[0055] Among them, by preprocessing the historical electrical data, it is convenient to make the processed data and data labels obtained after preprocessing meet the data requirements for subsequent training of the primary prediction model. The processed data is the data obtained after preprocessing the historical electrical data, and the data label is the label corresponding to the processed data. The data label is used to characterize the type of wiring situation corresponding to the processed data.

[0056] A130. Training a primary prediction model based on the processed data to obtain a model loss, and optimizing the primary prediction model based on the model loss to obtain a candidate prediction model.

[0057] Among them, the primary prediction model is an untrained prediction model. In this embodiment, the primary prediction model specifically adopts a multilayer perceptron (MLP) model. The MLP model includes a three-layer network structure including an input layer, a hidden layer and an output layer; the selected prediction model is a prediction model obtained by optimizing the primary prediction model through model loss; among them, optimization in this embodiment specifically refers to adjusting the network parameter weights and biases in the primary prediction model.

[0058] Specifically, the primary prediction model is trained by processing the data to obtain the model loss of the primary prediction model. Further, the network parameter weights and biases of the primary prediction model are optimized according to the model loss to obtain the candidate prediction model.

[0059] A140. Obtain a target prediction model based on the processed data and the candidate prediction model.

[0060] Among them, the candidate prediction model can basically accurately predict the type of wiring conditions of the electric energy metering device, but its own model performance may not meet the target requirements. Therefore, it is necessary to detect the model performance of the candidate prediction model through processed data, and optimize the candidate prediction model again when the model performance does not meet the target requirements; the target prediction model is also the optimized candidate prediction model.

[0061] Specifically, the processed data is used to detect whether the model performance of the candidate prediction model meets the target requirements; if so, the candidate prediction model is directly used as the target prediction model; otherwise, the candidate prediction model is continuously optimized through the processed data until the model performance of the candidate prediction model meets the target requirements, thereby obtaining the target prediction model.

[0062] It should be noted that this embodiment obtains the current electrical data of the electric energy metering device; inputs the current electrical data into the target prediction model for processing and outputting the type of wiring condition; wherein the training step of the target prediction model includes: determining the total wiring type based on the circuit connection method, and obtaining the historical electrical data corresponding to the total wiring type; preprocessing the historical electrical data to obtain processed data and data labels; training the primary prediction model based on the processed data to obtain the model loss, optimizing the primary prediction model based on the model loss to obtain the candidate prediction model; and obtaining the target prediction model based on the processed data and the candidate prediction model. Through the above implementation, there is no need to use a large-scale electric energy metering device calibrator to determine the type of wiring condition of the electric energy metering device, but only needs to collect the current electrical data of the electric energy metering device, and process the current electrical data through the target prediction model to predict the type of wiring condition of the electric energy metering device, which facilitates improving the detection efficiency of determining the type of wiring condition of the electric energy metering device.

[0063] Embodiment 2

[0064] A method for identifying abnormal wiring of an electric energy metering device provided in a second embodiment of the present application optimizes the "preprocessing the historical electrical data to obtain processed data and data labels" 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:

[0065] S210, obtaining current electrical data of the electric energy metering device.

[0066] S220: Input the current electrical data into a target prediction model for processing and outputting a type of wiring condition.

[0067] The training step of the target prediction model includes:

[0068] A210. Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring.

[0069] A221. Normalize the historical electrical data to obtain processed data.

[0070] Among them, normalization in this embodiment specifically adopts minimum-maximum normalization (Min-MaxNormalization), which performs minimum-maximum normalization on the historical electrical data, that is, each historical electrical data is linearly transformed to between [-1,1]; the processed data is the data obtained after normalizing the historical electrical data.

[0071] A222. Feature encode the historical electrical data to obtain data labels.

[0072] Among them, feature encoding is the process of converting the features in the historical electrical data into a numerical form that can be understood by the prediction model; feature encoding specifically adopts one-hot encoding in this embodiment; in this embodiment, the historical electrical data of 288 types of wiring conditions are specifically classified into the above-mentioned 7 types of wiring conditions; and the classified historical electrical data are one-hot encoded, and the data label is the result obtained after one-hot encoding the historical electrical data; for example, a certain historical electrical data is classified as the last type of "reverse current polarity and wrong current phase sequence" among the above-mentioned 7 types of wiring conditions, then the data label corresponding to the data is "0000001", only the last position is 1, and the rest of the positions are 0.

[0073] Specifically, the historical electrical data of 288 types of wiring conditions are specifically classified into 7 types of wiring conditions, and then each type of historical electrical data of the 7 types of wiring conditions is uniquely hot encoded to obtain a data label corresponding to each historical electrical data.

[0074] A230. Training a primary prediction model based on the processed data to obtain a model loss, and optimizing the primary prediction model based on the model loss to obtain a candidate prediction model.

[0075] A240. Obtain a target prediction model based on the processed data and the candidate prediction model.

[0076] Embodiment 3

[0077] A method for identifying abnormal wiring of an electric energy metering device provided in a third embodiment of the present application optimizes the "training a primary prediction model based on the processed data to obtain a model loss" 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:

[0078] S310, obtaining current electrical data of the electric energy metering device.

[0079] S320, inputting the current electrical data into a target prediction model for processing and outputting a type of wiring condition.

[0080] The training step of the target prediction model includes:

[0081] A310. Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring.

[0082] A320. Preprocess the historical electrical data to obtain processed data and data labels.

[0083] A331. Divide the processed data into a training set.

[0084] In this embodiment, a partition ratio is preset, and the partition ratio is used to characterize the proportion of the training set and the test set in the processed data; data partitioning also means dividing the processed data into the training set and the test set.

[0085] Specifically, the processed data is divided into a training set and a test set according to a preset division ratio.

[0086] A332. The primary prediction model performs a linear transformation on the training set to obtain a first transformation result.

[0087] The primary prediction model includes multiple neural network layers, and the output of the previous neural network layer is used as the input of the next neural network layer. Taking the lth neural network layer as an example, the neural network layer includes multiple neurons, each neuron has a corresponding neuron weight w, and the neuron weights of multiple neurons can together constitute a weight matrix w (l) ; Each neuron also corresponds to a bias b, and the bias b of multiple neurons can form a bias vector b (l) ; and the output of the previous layer of the l-th neural network layer is recorded as a (l-1) , if l = 1, then a (l-1) The training data in the training set input to the first neural network layer; if l>1, then a (l-1) It is obtained based on the training data in the training set; through the weight matrix w (l) With the bias vector b (l) , can be used for a (l-1) Perform linear transformation, the first transformation result z (l) That is the result obtained after linear transformation; the calculation formula of linear transformation is as follows: (l) =w (l) a (l-1) +b (l) .

[0088] Specifically, taking the lth layer of the neural network as an example, obtain the output a of the previous layer of the neural network (l-1) , calculate the weight matrix w (l) with a (l-1) The product of and the bias vector b (l) The sum of the values ​​of (l) .

[0089] A333. The primary prediction model performs a nonlinear transformation on the transformation result to obtain a second transformation result.

[0090] Among them, the nonlinear transformation is the first transformation result z (l) In this embodiment, the ReLu function built into the primary prediction model is used as the activation function f (l) For the first transformation result z(l) Perform nonlinear transformation; the second transformation result is also the activation function f (l) For the first transformation result z (l) The result obtained after nonlinear transformation; the calculation formula of nonlinear transformation is as follows: a (l) =f (l) (z (l) ).

[0091] A334. Obtain a model loss based on the second transformation result and the data label.

[0092] The calculation formula of model loss is as follows: Among them, a (L) is the output of the last neural network layer, Y is the data label; n is the amount of data in the training set; K is 7, corresponding to 7 types of wiring conditions; y ik is the data label of the kth wiring condition of the i-th sample in the training set, that is, the data label Y; is the predicted probability that the i-th sample in the training set belongs to the k-th wiring situation, which is also the output a of the last neural network layer. (L) .

[0093] Specifically, taking a historical electrical data as an example, the second transformation result of the historical electrical data in the last neural network layer is calculated, which is recorded as a (L) ,or Then the y corresponding to each historical electrical data ik and Substitution Calculate in order to get the model loss L ( a (L) ,Y ) .

[0094] A335. Optimize the primary prediction model based on the model loss to obtain a candidate prediction model.

[0095] A340. Obtain a target prediction model based on the processed data and the candidate prediction model.

[0096] Embodiment 4

[0097] A method for identifying abnormal wiring of an electric energy metering device provided in a fourth embodiment of the present application optimizes the "optimizing the primary prediction model based on the model loss to obtain a candidate prediction 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:

[0098] S410, obtaining current electrical data of the electric energy metering device.

[0099] S420: Input the current electrical data into a target prediction model for processing and outputting a type of wiring condition.

[0100] The training step of the target prediction model includes:

[0101] A410. Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring.

[0102] A420. Preprocess the historical electrical data to obtain processed data and data labels.

[0103] A431. Training a primary prediction model based on the processed data to obtain a model loss.

[0104] A432. Update the original weight matrix of the primary prediction model based on the model loss to obtain an updated weight matrix.

[0105] Among them, the model loss is used to optimize the neuron weights in the neural network layer in the primary prediction model. The original weight matrix is ​​the weight of each neuron in the neural network layer. The original weight matrix can be optimized through the model loss, and the updated weight matrix is ​​the new matrix obtained after optimizing the original weight matrix.

[0106] A433. Update the original bias of the primary prediction model based on the model loss to obtain an updated bias.

[0107] The model loss is also used to optimize the neuron bias in the neural network layer in the primary prediction model. The original bias b (l) That is, the bias of each neuron in the neural network layer; update bias b (lG) That is, the original bias b (l) After updating and optimizing, the set of biases of each neuron is obtained; the calculation formula for updating the bias is as follows: Among them, b (l) is the original bias, η is the preset learning rate, is the model loss L ( a (L) ,Y ) For the original bias b (l) gradient.

[0108] Specifically, calculate the model loss L ( a (L) ,Y ) For the original bias b (l) Gradient Then calculate the original bias b (l) With learning rate and The difference of the product of , thus obtaining the updated bias b (lG).

[0109] A434. Iteratively optimize the primary prediction model based on the updated weight matrix and the updated bias until a preset iteration stop condition is met to obtain a candidate prediction model.

[0110] Among them, the iterative optimization is to first replace the corresponding original weight matrix and original bias in the primary prediction model according to the updated weight matrix and the updated bias, so that the primary prediction model is transformed into a second-generation prediction model; the second-generation prediction model is also the new primary prediction model, and then continue to train the new primary prediction model through steps A410-A433 to obtain a new updated weight matrix and updated bias; then use the new updated weight matrix and updated bias to replace the corresponding original weight matrix and original bias in the second-generation primary prediction model, so as to obtain a third-generation prediction model; and so on, to achieve iterative optimization of the primary prediction model; the iterative stopping condition is that the number of iterative optimizations reaches a preset iteration number threshold; the selected prediction model is the prediction model obtained when the preset iterative stopping condition is met.

[0111] A440. Obtain a target prediction model based on the processed data and the candidate prediction model.

[0112] Embodiment 5

[0113] A method for identifying abnormal wiring of an electric energy metering device provided in a fifth embodiment of the present application optimizes the "updating the original weight matrix of the primary prediction model based on the model loss to obtain an updated weight matrix" in the fourth 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:

[0114] S510: Acquire current electrical data of the electric energy metering device.

[0115] S520: Input the current electrical data into a target prediction model for processing and outputting a type of wiring condition.

[0116] The training step of the target prediction model includes:

[0117] A510. Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring.

[0118] A520. Preprocess the historical electrical data to obtain processed data and data labels.

[0119] A531. Training a primary prediction model based on the processed data to obtain a model loss.

[0120] A532A. Target gradient of the original weight matrix of the primary prediction model based on the model loss.

[0121] Among them, the model loss is the original weight matrix w of the lth neural network layer in the primary prediction model (l) The gradient of The calculation formula is: Among them, δ (l) is the model loss L(a) in the above fourth embodiment (L) ,Y) for the original bias b (l) Gradient a (l-1)T It is the transpose of the second transformation result of the previous neural network layer of the lth neural network layer.

[0122] Specifically, calculate the model loss L ( a (L) ,Y ) For the original bias b (l) Gradient That is, δ (l) ; Further, calculate the transpose a of the second transformation result of the previous neural network layer of the lth neural network layer (l-1)T With δ (l) The product of , thus obtaining the target gradient

[0123] A532B. Obtain an updated weight matrix based on the original weight matrix, the learning rate, and the target gradient.

[0124] Wherein, the original weight matrix can be updated and optimized based on the original weight matrix, the learning rate and the target gradient, and the updated weight matrix is ​​the result obtained by updating and optimizing the original weight matrix; the updated weight matrix w (lG) The calculation formula is: Among them, w (l) is the original weight matrix, η is the preset learning rate, is the gradient of the model loss with respect to the original weight matrix.

[0125] Specifically, calculate the original weight matrix w (l) With the learning rate η and The difference of the product of is obtained to update the weight matrix w (lG) .

[0126] A533. Update the original bias of the primary prediction model based on the model loss to obtain an updated bias.

[0127] A534. Iteratively optimize the primary prediction model based on the updated weight matrix and the updated bias until a preset iteration stop condition is met to obtain a candidate prediction model.

[0128] A540. Obtain a target prediction model based on the processed data and the candidate prediction model.

[0129] Embodiment 6

[0130] A method for identifying abnormal wiring of an electric energy metering device provided in Embodiment 6 of the present application optimizes the "obtaining a target prediction model based on the processed data and the selected prediction model" in Embodiment 1; 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:

[0131] S610: Acquire current electrical data of the electric energy metering device.

[0132] S620: Input the current electrical data into a target prediction model for processing and outputting a type of wiring condition.

[0133] The training step of the target prediction model includes:

[0134] A610. Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring.

[0135] A620. Preprocess the historical electrical data to obtain processed data and data labels.

[0136] A630. Training a primary prediction model based on the processed data to obtain a model loss, and optimizing the primary prediction model based on the model loss to obtain a candidate prediction model.

[0137] A641. Divide the processed data into a test set.

[0138] Among them, a test set can be divided from the processed data according to a preset division ratio, and the test set is used to test the performance of the candidate prediction model.

[0139] A642. Process the test set based on the candidate prediction model to obtain prediction data.

[0140] Among them, each test data in the test set corresponds to the real data label, that is, Figure 2 The real class on the vertical axis; the candidate prediction model can output prediction data by processing the test data in the test set, that is, Figure 2 The predicted class on the horizontal axis.

[0141] Specifically, the test set is input into the candidate prediction model for processing, and the prediction data is output.

[0142] A643. Obtain a confusion matrix based on the test set and the prediction data.

[0143] The confusion matrix can be established based on the test set and the prediction data.

[0144] Specifically, a confusion matrix is ​​established based on the test data in the test set and the prediction data corresponding to the test data.

[0145] A644. Obtain a target prediction model based on the confusion matrix and the candidate prediction model.

[0146] Among them, the corresponding model performance indicators can be calculated according to the confusion matrix. The model performance indicators in this embodiment include but are not limited to accuracy, recall rate, precision and F1 value; by evaluating the model performance indicators, it can be determined whether the model performance of the candidate prediction model meets the standards; if it meets the standards, the candidate prediction model can be used as the target prediction model; otherwise, the model parameters (neuron weights, neuron biases) of the candidate prediction model need to be further adjusted until the model performance of the candidate prediction model meets the standards, thereby obtaining the target prediction model.

[0147] 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.

[0148] Embodiment 7

[0149] Based on the same inventive concept, this embodiment also provides an electric energy metering device wiring abnormality identification device for implementing the electric energy metering device wiring abnormality 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 abnormality identification device provided below can refer to the limitations of the electric energy metering device wiring abnormality identification method above, and will not be repeated here.

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

[0151] A data acquisition module, used to acquire current electrical data of the electric energy metering device;

[0152] A type prediction module, used for inputting the current electrical data into a target prediction model for processing and outputting the type of wiring condition;

[0153] The training step of the target prediction model includes:

[0154] Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring;

[0155] Preprocessing the historical electrical data to obtain processed data and data labels;

[0156] Training a primary prediction model based on the processed data to obtain a model loss, and optimizing the primary prediction model based on the model loss to obtain a candidate prediction model;

[0157] A target prediction model is obtained based on the processed data and the candidate prediction model.

[0158] Each module in the above-mentioned device for identifying abnormal wiring of an electric energy metering device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0159] It should be noted that this embodiment obtains the current electrical data of the electric energy metering device; inputs the current electrical data into the target prediction model for processing and outputting the type of wiring condition; wherein the training step of the target prediction model includes: determining the total wiring type based on the circuit connection method, and obtaining the historical electrical data corresponding to the total wiring type; preprocessing the historical electrical data to obtain processed data and data labels; training the primary prediction model based on the processed data to obtain the model loss, optimizing the primary prediction model based on the model loss to obtain the candidate prediction model; and obtaining the target prediction model based on the processed data and the candidate prediction model. Through the above implementation, there is no need to use a large-scale electric energy metering device calibrator to determine the type of wiring condition of the electric energy metering device, but only needs to collect the current electrical data of the electric energy metering device, and process the current electrical data through the target prediction model to predict the type of wiring condition of the electric energy metering device, which facilitates improving the detection efficiency of determining the type of wiring condition of the electric energy metering device.

[0160] Embodiment 8

[0161] 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 4As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, 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 abnormal wiring of an electric energy metering device is implemented.

[0162] 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.

[0163] Embodiment 9

[0164] 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.

[0165] Embodiment 10

[0166] 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.

[0167] 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.

[0168] 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.

[0169] 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.

[0170] 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 abnormal wiring of an electric energy metering device, characterized in that: include: Obtain current electrical data from energy metering devices; Inputting the current electrical data into a target prediction model for processing and outputting the type of wiring condition; The training step of the target prediction model includes: Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring; Preprocessing the historical electrical data to obtain processed data and data labels; Training a primary prediction model based on the processed data to obtain a model loss, and optimizing the primary prediction model based on the model loss to obtain a candidate prediction model; A target prediction model is obtained based on the processed data and the candidate prediction model.

2. The method according to claim 1, characterized in that The preprocessing of the historical electrical data to obtain processed data and data labels includes: Normalizing the historical electrical data to obtain processed data; The historical electrical data is feature encoded to obtain data labels.

3. The method according to claim 1, characterized in that The step of training a primary prediction model based on the processed data to obtain a model loss includes: Performing data division on the processed data to obtain a training set; The primary prediction model performs a linear transformation on the training set to obtain a first transformation result; The primary prediction model performs a nonlinear transformation on the transformation result to obtain a second transformation result; A model loss is obtained based on the second transformation result and the data label.

4. The method according to claim 1, characterized in that: The optimizing the primary prediction model based on the model loss to obtain a prediction model to be selected includes: Based on the model loss, the original weight matrix of the primary prediction model is updated to obtain an updated weight matrix; Updating the original bias of the primary prediction model based on the model loss to obtain an updated bias; The primary prediction model is iteratively optimized based on the update weight matrix and the update bias until a preset iteration stop condition is met to obtain a candidate prediction model.

5. The method according to claim 4, characterized in that The updating of the original weight matrix of the primary prediction model based on the model loss to obtain an updated weight matrix includes: A target gradient of an original weight matrix of the primary prediction model based on the model loss; An updated weight matrix is ​​obtained based on the original weight matrix, the learning rate, and the target gradient.

6. The method according to claim 1, characterized in that The obtaining of a target prediction model based on the processed data and the selected prediction model comprises: Performing data division on the processed data to obtain a test set; Processing the test set based on the candidate prediction model to obtain prediction data; Obtaining a confusion matrix based on the test set and the prediction data; A target prediction model is obtained based on the confusion matrix and the candidate prediction model.

7. A device for identifying abnormal wiring of an electric energy metering device, characterized in that: The device comprises: A data acquisition module, used to acquire current electrical data of the electric energy metering device; A type prediction module, used for inputting the current electrical data into a target prediction model for processing and outputting the type of wiring condition; The training step of the target prediction model includes: Determine the type of main wiring based on the circuit connection method, and obtain historical electrical data corresponding to the type of main wiring; Preprocessing the historical electrical data to obtain processed data and data labels; Training a primary prediction model based on the processed data to obtain a model loss, and optimizing the primary prediction model based on the model loss to obtain a candidate prediction model; A target prediction model is obtained based on the processed data and the candidate prediction 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

  • Electric energy meter wiring state type identification system based on fuzzy algorithm

    CN115510619A

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

    CN117491912A

  • Battery state prediction method and device, equipment and storage medium

    CN118091464A

Cited By

  • Wiring error visual analysis method and system based on data processing

    CN120972045A