A Diagnostic Method and System for Communication Faults of Electric Energy Meters
By introducing the GBDT algorithm to calculate the sample weight and adjusting the node segmentation gain, the problem of inaccurate diagnosis of power meter communication faults is solved, and higher diagnostic accuracy is achieved.
Patent Information
- Application Number
- CN202510766120.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-06-10
AI Technical Summary
The existing GBDT algorithm fails to effectively consider the communication quality differences in the power meter communication fault diagnosis, resulting in inaccurate diagnosis.
By introducing the communication quality and communication environment of the sample, the sample weight is calculated, the node segmentation gain is adjusted, and the training process of the GBDT model is improved.
It improves the accuracy of the communication fault diagnosis of power meter, ensures that the model is more sensitive to samples with poor communication quality, and improves the diagnostic effect.
Smart Images

Figure CN120281672B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and specifically relates to a diagnosis method and system for communication faults of an electric energy meter. Background Art
[0002] An electric energy meter is a metering device used to measure and record electric energy consumption, and is applied to scenarios such as homes, industries, and commerce. It realizes functions such as power billing, energy consumption management, and power grid operation optimization by monitoring power consumption in real time. As a key component of the electric energy meter, the communication module undertakes the core function of data transmission. The communication module uploads information such as the metering data and device status of the electric energy meter to the power management system through wired or wireless means, to realize functions such as remote meter reading, real-time monitoring, abnormal alarm, and load control.
[0003] There are different types of communication faults in the process of using an electric energy meter. Quickly determining the fault type and solving the fault are of great significance for ensuring data integrity and maintaining the reliability of the power system. Traditional fault diagnosis uses the method of manual investigation, which not only has low efficiency but is also prone to missing potential hazards. With the development of fault detection algorithms, using fault detection algorithms to detect communication faults of electric energy meters can not only improve efficiency but also improve the accuracy of detection. The working voltage, working current, working temperature, and communication signal strength of the communication module corresponding to different communication fault types are all different. The GBDT (Gradient Boosting Decision Tree) algorithm, whose full name is the gradient boosting decision tree algorithm, as a fault detection algorithm, can not only process multi-dimensional data but also has a high accuracy for fault detection. Furthermore, it can adapt to the complex and changeable power grid environment, help operation and maintenance personnel accurately locate the root cause of the fault, and improve the maintenance efficiency.
[0004] The existing GBDT algorithm includes the following steps: constructing multiple decision trees according to the training set to complete the training of the GBDT model; inputting the data to be measured into the trained GBDT model, and adding up the results of the multiple decision trees as the final prediction result. Each fault type will output a probability, and the fault type with the largest probability is used as the fault type corresponding to the data. Among them, each decision tree is constructed through node splitting. By traversing each parameter and parameter value of the samples in a node as the splitting value, the node is split into a left child node and a right child node, and then the gain when the node is split is calculated through the loss function, and the node is split with the parameter and parameter value corresponding to the maximum gain.
[0005] However, the communication quality of electricity meters varies at different times, and poor communication quality increases the likelihood of communication failures. Existing GBDT algorithms fail to consider the differences in communication quality across samples when performing node segmentation, making them prone to underfitting samples with poor communication quality, leading to inaccurate subsequent communication fault diagnosis. Summary of the Invention
[0006] The present invention provides a method and system for diagnosing communication faults of electric energy meters, aiming to solve the technical problem of inaccurate diagnosis of communication faults in the prior art.
[0007] A method for diagnosing a communication fault of an electric energy meter according to the present invention comprises the following steps:
[0008] Obtaining a training sample set, the training sample set includes samples without faults and samples of different fault types, each sample including multiple parameters;
[0009] Use the training sample set to train the GBDT model to obtain a trained GBDT model;
[0010] Among them, the gain of node segmentation is obtained by weighting the first-order derivative and second-order derivative of the multivariate cross entropy loss function using the weight of each sample; the weight of the fault-free sample is a preset value; the weight of the fault sample is the product of the communication quality deterioration and the communication environment deterioration of the corresponding sample; the communication quality deterioration is positively correlated with the fault stage similarity of the corresponding sample, and positively correlated with the absolute value of the difference in the discrete degree of the neighborhood corresponding to the corresponding sample and each sample with the same fault type; the fault stage similarity is inversely correlated with the discrete difference between the corresponding sample and the sample with the same fault type; the discrete difference is the absolute value of the difference in the discrete degree of each parameter of the sample in its neighborhood and the adjacent domain; the adjacent domain is a sample sequence located on both sides of the neighborhood and has the same length as the neighborhood; the neighborhood is a sample sequence of preset time length centered on the corresponding sample; the communication environment deterioration is inversely correlated with the fault interval of the corresponding sample; the fault interval is the interval between the time when the fault of the corresponding sample occurs and the time when the previous fault occurs;
[0011] The sample to be tested is input into the trained GBDT model, and the corresponding output probabilities of no fault and each fault type are used. The fault condition corresponding to the maximum probability is used as the fault condition of the corresponding sample.
[0012] In the above scheme, the weight of the sample is obtained according to the communication quality deterioration and communication environment deterioration of the sample. The gain calculation during node segmentation takes the sample weight into account, making the node segmentation more reasonable, the training effect of the GBDT model better, and the diagnosis of communication faults more accurate.
[0013] Preferably, the first The sample and Similarity of fault stages of samples is as follows:
[0014] ;
[0015] In the formula, is the degree of dispersion of the j-th parameter in the neighborhood corresponding to the -th sample, is the degree of dispersion of the j-th parameter in the -th closest neighborhood corresponding to the -th sample, is the degree of dispersion of the j-th parameter in the neighborhood corresponding to the -th sample, is the degree of dispersion of the j-th parameter in the -th closest neighborhood corresponding to the -th sample, is the total number of parameters in the sample, is the exponential function with the natural constant as the base.
[0016] Preferably, the communication quality degradation of the -th sample in any fault type is as follows:
[0017] ; ]>
[0018] In the formula, is the similarity of fault stages between the -th sample and the -th sample in the same fault type, is the degree of dispersion of the j-th parameter in the neighborhood corresponding to the -th sample, is the degree of dispersion of the j-th parameter in the neighborhood corresponding to the -th sample, is the standard normalization function, is the total number of samples in the same fault type, is the total number of parameters in the sample.
[0019] In the above solution, the communication quality degradation of each sample is characterized by the absolute value of the difference between the similarity of the fault stages of the corresponding samples and the degree of dispersion of two samples with the same fault type in the corresponding neighborhoods, so that the two samples are compared at the same stage, and through the comparison of the degree of dispersion of the samples in the corresponding neighborhoods, the calculation result is more accurate.
[0020] Preferably, the communication environment degradation of the -th sample in any fault type is as follows:
[0021] ;
[0022] Where, For the The failure interval of samples, is the standard deviation of the failure intervals of all failure samples, For the natural constant The exponential function of base .
[0023] In the above solution, the fault interval of a sample is used to characterize the deterioration of the communication environment of the sample, reflecting the impact of the previous fault on the communication environment of the sample, and can truly reflect the communication environment of the sample.
[0024] Preferably, the gain of node splitting is the difference between the sum of the weighted loss of the left child node and the weighted loss of the right child node and the weighted loss of the parent node; wherein the weighted loss of any node is for:
[0025] ;
[0026] Where, is the sample set of the corresponding node Middle The weight of the samples, To be the first The value obtained by substituting the first-order derivative function of the multivariate cross entropy loss function into the sample is, To be the first The value obtained by substituting samples into the second-order derivative function of the multivariate cross entropy loss function is, is the regularization parameter, .
[0027] In the above scheme, by weighting both the first-order derivative function and the second-order derivative function of the multivariate cross entropy loss function, the difference in communication quality of each sample is taken into account, so that the calculation result is more accurate.
[0028] Preferably, the probability of the sample to be tested corresponding to various fault conditions is inversely correlated with the absolute value of the difference between the predicted value and the actual value of the corresponding sample;
[0029] Samples to be tested Corresponding to The probability of a failure for:
[0030] ;
[0031] Where, For the sample to be tested The predicted value of For the The true value of the fault condition, The natural constant The exponential function of base is is the normalized exponential function.
[0032] In the above scheme, by comparing the predicted value of the sample to be tested with the actual value of various fault conditions, the Function, to obtain the probability of various fault conditions corresponding to the corresponding samples, the calculation is simple and easy to understand.
[0033] Preferably, the fault types include signal interruption, protocol error, data verification failure, configuration error, hardware failure and verification failure.
[0034] Preferably, the parameters include the operating voltage, operating current, operating temperature and communication signal strength of the communication module.
[0035] The present invention also provides a system for diagnosing communication failures of electric energy meters, comprising a memory and a processor, wherein the processor executes a computer program stored in the memory to implement any of the above-mentioned methods for diagnosing communication failures of electric energy meters.
[0036] The beneficial effects are:
[0037] The solution of the present invention introduces a weight for each sample based on its communication quality differences. This weight is then used to calculate the gain during node segmentation, making the node segmentation more reasonable. This results in better training of the GBDT model and higher fault diagnosis accuracy. Furthermore, the sample weights are derived from the sample's communication quality and communication environment deterioration, comprehensively reflecting the impact of communication quality on the sample and making the calculation results more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Flowchart of the steps of a method for diagnosing communication failure of an electric energy meter according to an embodiment of the present invention;
[0039] Figure 2 The figure is a structural block diagram of a system for diagnosing communication failures of electric energy meters according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present invention, but should not be construed as limiting the present invention.
[0041] like Figure 1 According to a first aspect of the present invention, a method for diagnosing a communication fault of an electric energy meter is provided, comprising the following steps:
[0042] S1. Obtain a training sample set, where the training sample set includes samples without faults and samples of different fault types, and each sample includes multiple parameters.
[0043] In this step, the purpose of obtaining the training sample set is to train the GBDT model, and then use the trained GBDT model to diagnose the communication faults of the electric energy meter. In order to enable the GBDT model to accurately identify the fault conditions of no fault and various fault types, the training sample set should include no-fault samples and samples of various different fault types. Among them, the fault types include signal interruption, protocol error, data verification failure, configuration error, hardware fault, and verification failure. Therefore, the present invention altogether includes 7 fault conditions of no fault and various fault types. For each fault condition, 500 samples can be set, and of course, other numbers of samples can also be set according to needs.
[0044] When fault diagnosis is carried out, the parameters of the samples have different effects on different fault conditions, so the fault conditions can be diagnosed according to the parameters of the samples. The parameters of the samples include the working voltage, working current, working temperature, and communication signal strength of the communication module. This is because the abnormal working voltage of the communication module will cause the internal circuit of the electric energy meter to work unstably, thereby affecting the performance of the communication module. An excessive or violently fluctuating working current of the communication module will generate electromagnetic interference and affect the quality of communication signal transmission. An excessively high working temperature of the communication module will cause the performance of the electronic components in the communication module to decline, resulting in worse communication stability. And the communication signal strength is the communication signal strength between the electric energy meter and the concentrator, which directly reflects the quality of the communication link. Therefore, when obtaining samples, these parameters need to be collected.
[0045] In the present invention, the working voltage, working current, working temperature, and communication signal strength of the communication module in the electric energy meter are respectively collected by using the built-in voltage sensor, current sensor, temperature sensor, and signal detection circuit of the electric energy meter. The collection frequency can be 1 time per second, and of course, other collection frequencies can also be set according to needs.
[0046] When the present invention applies the GBDT algorithm to diagnose communication faults, it is dealing with a multi-classification task. Therefore, different labels need to be set for no fault and various fault types to achieve the distinction between no fault and various fault types. The present invention uses target encoding to set labels for no fault and various fault types. Target encoding can reflect the relationship between each parameter and each fault condition and can handle multi-classification tasks. The target encoding of each fault condition is the sum of the means of the normalized values of each parameter of all samples in the corresponding fault condition. In the present invention, the target encoding of any fault condition is the sum of the means of the normalized values of the working voltage, working current, working temperature, and communication signal strength respectively in all samples of the corresponding fault condition.
[0047] S2. Use the training sample set to train the GBDT model to obtain a trained GBDT model.
[0048] It should be noted that the GBDT (Gradient Boosting Decision Tree) algorithm, whose full name is Gradient Boosting Decision Tree algorithm, belongs to the prior art. By constructing multiple decision trees and adding up the results of multiple decision trees as the final prediction result, it can improve the accuracy of prediction. Each decision tree is constructed through node splitting. Specifically, during node splitting, each parameter of the samples in the corresponding node is traversed as the splitting value, and the node is split into a left child node and a right child node. Then, the gain during the node splitting is calculated through the multi-class cross-entropy loss function, and the node is split with the parameter and splitting value corresponding to the maximum gain.
[0049] However, due to situations such as unstable signal transmission and fluctuating network environment, the communication quality of the electricity meter varies at different times. When the communication quality is poor, the possibility of communication failure of the electricity meter is higher. In the prior art, when the GBDT algorithm performs node splitting, it does not consider the differences in the communication quality of different samples. That is, when calculating the gain, the weights of all samples are the same, which is prone to underfitting for samples with poor communication quality, resulting in a poor training effect of the GBDT model and further affecting the accuracy of communication failure diagnosis. In view of the problems existing in the prior art, the present invention proposes an improvement to the GBDT algorithm, considering the differences in the communication quality of different samples. Therefore, in step S2, constructing a decision tree includes the following steps:
[0050] S21. Calculate the weights of each sample.
[0051] Among them, the weight of the non-fault sample is a preset value. For example, the preset value is 0.5. The weight of the fault sample is the product of the communication quality deterioration degree and the communication environment deterioration degree of the corresponding sample. The communication quality deterioration degree represents the severity of the communication quality of the corresponding sample. The greater the communication quality deterioration degree, the worse the communication quality. The communication environment deterioration degree represents the severity of the communication environment at the moment corresponding to the sample. The greater the communication environment deterioration degree, the worse the communication quality. The worse the communication quality, the higher the sensitivity of the sample to faults. A slight change in the sample may represent a communication failure. Therefore, when calculating the weights of each fault sample, it is necessary to obtain the communication quality deterioration degree and the communication environment deterioration degree of each fault sample. Step S21 also includes the following steps:
[0052] S211. Obtain the communication quality deterioration degree of each fault sample.
[0053] The communication quality degradation is positively correlated with the similarity of the fault stage of the corresponding sample, and is positively correlated with the absolute value of the difference in the dispersion degree of the neighborhoods corresponding to the corresponding sample and each sample with the same fault type as it. The neighborhood is a sample sequence of a preset duration centered on the corresponding sample. For example, the preset duration is the length of 11 acquisition moments, the corresponding sample is in the center, and there are 5 acquisition moments before and after it respectively, and the corresponding neighborhood is the sample sequence corresponding to 11 acquisition moments.
[0054] Among them, the similarity of the fault stage characterizes the similarity degree between the corresponding sample and the samples with the same fault type as it. This is because from the start of the communication fault until the communication fault is resolved, it will last for a certain duration. For example, it includes the stage from normal communication to gradually emerging communication faults and the stage from communication faults to gradually recovering to normal. There are differences between the two stages. Only the comparison between two samples in the same fault type and the same stage is meaningful. And the higher the similarity of the fault stage of the sample, the greater the impact on the communication quality degradation, that is, the two are positively correlated.
[0055] And the greater the absolute value of the difference in the dispersion degree of the neighborhoods corresponding to the corresponding sample and each sample with the same fault type as it, the greater the dispersion degree of the sample in the corresponding neighborhood, which indicates that the communication quality degradation is also greater, and the two are also positively correlated.
[0056] Therefore, in order to obtain the communication quality degradation of each sample, the following steps are further included:
[0057] First, calculate the similarity of the fault stage of each sample.
[0058] The similarity of the fault stage is inversely correlated with the discrete difference degree between the corresponding sample and the samples with the same fault type as it. The discrete difference degree is the absolute value of the difference in the dispersion degree of each parameter of the sample in its neighborhood and the adjacent neighborhood. The adjacent neighborhood is a sample sequence located on both the front and back sides of the neighborhood and of the same length as the neighborhood. That is, there is one adjacent neighborhood on each of the front and back sides of the neighborhood, a total of two.
[0059] The greater the discrete difference degree between the corresponding sample and the samples with the same fault type as it, the greater the difference degree between the two, and the smaller the possibility that the two samples are in the same stage. That is, the discrete difference degree between the two samples is inversely correlated with the similarity of the fault stage.
[0060] In one embodiment, the similarity of the fault stage between the th sample and the th sample in the same fault type is:
[0061] ;
[0062] In the formula, is the jth parameter at the The degree of dispersion in the neighborhood corresponding to a sample is the degree of dispersion of the j-th parameter in the -th neighborhood corresponding to the -th similar neighborhood of the sample is the degree of dispersion of the j-th parameter in the neighborhood corresponding to the -th sample is the degree of dispersion of the j-th parameter in the -th neighborhood corresponding to the -th similar neighborhood of the sample is the total number of parameters in the sample is the exponential function with the natural constant as the base
[0063] In this step, by calculating the difference between the degrees of dispersion of the corresponding sample and the samples with the same fault type in the corresponding neighborhood and similar neighborhood respectively, the discrete difference degree between the two samples is obtained, and the similarity of the fault stages of the samples is reflected through the discrete difference degree. Due to the introduction of the neighborhood and similar neighborhood, the similarity of the fault stages of the samples is reflected by comparing the sample sequences, making the calculation result more accurate and avoiding the influence caused by accidental errors.
[0064] Then, the communication quality deterioration degree of each sample is obtained.
[0065] Then, the communication quality deterioration degree of the -th sample in any fault type is
[0066] ;
[0067] In the formula, is the similarity of the fault stages between the -th sample and the -th sample with the same fault type, [[ID= fifty]]is the degree of dispersion of the j-th parameter in the neighborhood corresponding to the -th sample, is the degree of dispersion of the j-th parameter in the neighborhood corresponding to the -th sample, is the standard normalization function, is the total number of samples with the same fault type, is the total number of parameters in the sample.
[0068] In step S211, the communication quality deterioration degree of each sample is characterized by the absolute value of the difference between the similarity of the fault stages of the corresponding sample and the degrees of dispersion of two samples with the same fault type in the corresponding neighborhood, making the two samples comparable, and the calculation result is more accurate by comparing the degrees of dispersion of the samples in the corresponding neighborhood.
[0069] The communication quality deterioration of each sample obtained in step S211 can only reflect the communication quality at the moment of the sample, but cannot reflect the communication environment situation after the communication module eliminates the fault. Therefore, it is also necessary to obtain the communication environment deterioration of each sample.
[0070] S212. Obtain the communication environment deterioration of each sample.
[0071] The communication environment deterioration is inversely correlated with the fault interval of the corresponding sample. The fault interval is the interval duration between the fault occurrence moment of the corresponding sample and the previous fault occurrence moment. This is because the shorter the interval duration between the moment of the sample and the previous fault moment, the higher the possibility that the communication environment has not fully recovered, and the higher the communication environment deterioration.
[0072] In one embodiment, the communication environment deterioration of the th sample in any fault type is:
[0073] ;
[0074] In the formula, is the fault interval of the th sample, is the standard deviation of the fault intervals of all fault samples, is the exponential function with the natural constant as the base.
[0075] In the formula of this embodiment, as the denominator serves to standardize the fault interval , making the range of the calculated values more reasonable. And taking the square of the fraction makes the curve formed by the calculated values smoother.
[0076] In step S211, the communication environment deterioration of the sample is characterized by the fault interval of the sample, which reflects the impact of the previous fault on the communication environment of the sample and can truly reflect the communication environment situation of the sample.
[0077] S213. Obtain the weight of the fault sample.
[0078] The weight of the fault sample is the product of the communication quality deterioration and the communication environment deterioration of the corresponding sample. This is because the greater the communication quality deterioration and the communication environment deterioration of the sample, the worse the communication quality, and the higher the sensitivity of the sample to faults. A slight change in the sample may also represent a communication fault. Therefore, a larger weight should be assigned to the sample.
[0079] Then the weight of the th sample in any fault type
[0080] ;
[0081] In the formula, is the communication quality deterioration of the th sample in any failure type, is the communication environment deterioration of the th sample in any failure type.
[0082] In step S213, by jointly characterizing the weight of the sample through the communication quality deterioration and the communication environment deterioration of the sample, the communication quality situation at the moment of the sample and the impact of the previous failure on the communication environment of the sample can be reflected. Therefore, the impact of the communication quality on the sample can be comprehensively reflected, making the calculation result more accurate.
[0083] In the prior art, when a node is split, the parent node is split into a left child node and a right child node by a split value. The gain of the node split is the difference between the sum of the losses of the left child node and the right child node and the loss of the parent node. When calculating the gain of the node split in the present invention, considering the differences in the communication quality of each sample, the weight of the sample is introduced to correct the gain of the node split in the prior art.
[0084] S22. Traverse each parameter and parameter value of the samples in any node as the split value for node splitting, and use the weights of each sample to weight the first-order derivative and the second-order derivative of the multi-cross entropy loss function to obtain the gain of the node split.
[0085] The gain of the node split corresponding to any node split method is the difference between the sum of the weighted losses of the left child node and the right child node and the weighted loss of the parent node. Among them, the weighted loss of any node is:
[0086] ;
[0087] In the formula, is the sample set corresponding to the node in the th sample weight, is the value obtained by substituting the th sample into the first-order derivative function of the multi-cross entropy loss function, is the value obtained by substituting the th sample into the second-order derivative function of the multi-cross entropy loss function, is the regularization parameter, [[ID=5Z]] . Preferably, The first-order derivative function is the first-order derivative of the multivariate cross entropy loss function with respect to the predicted probability of the corresponding sample, and the second-order derivative function is the second-order derivative of the multivariate cross entropy loss function with respect to the predicted probability of the corresponding sample.
[0088] In step S22, when calculating the gain of node splitting, the difference in communication quality of each sample is taken into account and the weight of the sample is introduced. Therefore, the weighted loss of the left child node, the weighted loss of the right child node and the weighted loss of the parent node can be obtained, and finally the gain of node splitting is obtained, which makes the calculation result more accurate and the node splitting more reasonable.
[0089] S23. Node splitting is performed using the parameters and splitting values of the sample with the largest gain in each node split, and the decision tree is constructed by continuous iteration. The maximum tree depth of each decision tree is set to 12 layers, and other maximum tree depths can be set as needed.
[0090] Steps S21 to S23 illustrate the construction process of only one decision tree. The construction process of other decision trees is similar, except that the training sample set of the subsequent decision tree is the residual of the training sample set of the previous decision tree. The residual is the difference between the true value and the predicted value of the sample.
[0091] The present invention can also set a validation sample set to evaluate the performance of the GBDT model during GBDT model training, so as to adjust the parameters of the GBDT model and prevent the GBDT model from overfitting. At this point, a trained GBDT model is obtained.
[0092] S3. Input the sample to be tested into the trained GBDT model, and output the corresponding probabilities of no fault and each fault type. The fault condition corresponding to the maximum probability is taken as the fault condition of the corresponding sample.
[0093] The probability that the sample to be tested corresponds to various fault conditions is inversely correlated with the absolute value of the difference between the predicted value and the actual value of the corresponding sample.
[0094] Samples to be tested Corresponding to The probability of a failure for:
[0095] ;
[0096] Where, For the sample to be tested The predicted value of For the The true value of the fault condition, For the natural constant The exponential function of base is is the normalized exponential function.
[0097] In the formula of this step, the predicted value of the sample to be tested is the sum of the predicted values of all decision trees when the sample to be tested is input into the trained GBDT model. Among them, the predicted value of each decision tree is the mean of the target encodings of all samples in the leaf node where the sample to be tested is located. The true value of the fault condition is the target encoding of this fault condition. The probability of the sample to be tested corresponding to each fault condition can be calculated, and the sum of the probabilities of all fault conditions is 1. For example, when the sample to be tested is input into the GBDT model, the probabilities of no fault, signal interruption, protocol error, data verification failure, configuration error, hardware failure, and verification failure are 0.05, 0.3, 0.2, 0.1, 0.1, 0.2, and 0.05 respectively, then the fault condition of this sample to be tested is considered to be signal interruption.
[0098] In step S3, the absolute value of the difference between the predicted value of the sample to be tested and the actual value of the fault condition is used to reflect the probability of the sample to be tested corresponding to each fault condition, and the fault condition corresponding to the maximum probability is used as the fault condition of the corresponding sample, which is simple to calculate and easy to understand.
[0099] In the diagnostic method for power meter communication faults of the present invention, by calculating the communication quality degradation and the communication environment degradation, the weights of each sample are obtained, and then the gain of node splitting is calculated using the weights of each sample. Due to considering the differences in communication quality, the calculation results are more accurate, and thus the node splitting is more reasonable, the construction of the decision tree is more reasonable, and the training effect of the GBDT model is also better, and further the diagnosis of communication faults is more accurate.
[0100] As Figure 2 shown, according to the second aspect of the present invention, there is also provided a diagnostic system for power meter communication faults. The system includes a memory and a processor, and the processor executes the computer program stored in the memory to implement the diagnostic method for power meter communication faults described in the first aspect of the present invention.
[0101] The system also includes other components well-known to those skilled in the art such as a communication bus and a communication interface, and their settings and functions are known in the art, so they will not be described herein again.
[0102] In the present invention, the foregoing memory may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of the device or accessible or connected to the device. Any application or module described in the present invention may be implemented by computer-readable / executable instructions stored or otherwise held by such a computer-readable medium.
[0103] Although this specification has shown and described several embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many changes, variations, and alternative approaches will occur to those skilled in the art without departing from the spirit and scope of the present invention. It should be understood that various alternatives to the embodiments of the present invention described herein may be employed in practicing the present invention.
Claims
1. A method for diagnosing communication failure of an electric energy meter, characterized in that: The steps include: Obtaining a training sample set, the training sample set includes samples without faults and samples of different fault types, each sample including multiple parameters; Use the training sample set to train the GBDT model to obtain a trained GBDT model; Among them, the gain of node segmentation is obtained by weighting the first-order derivative and second-order derivative of the multivariate cross entropy loss function using the weight of each sample; the weight of the fault-free sample is a preset value; the weight of the fault sample is the product of the communication quality deterioration of the corresponding sample and the communication environment deterioration; the communication quality deterioration is positively correlated with the similarity of the fault stage of the corresponding sample, and is positively correlated with the absolute value of the difference in the discrete degree of the neighborhood corresponding to the corresponding sample and each sample with the same fault type; the communication quality deterioration is positively correlated with the absolute value of the difference in the discrete degree of the neighborhood corresponding to the corresponding sample and each sample with the same fault type; the communication quality deterioration is positively correlated with the communication quality deterioration. for: ; Where, For the same fault type The sample and The similarity of the fault stages of samples, is the jth parameter in the The degree of dispersion in the neighborhood corresponding to the samples, is the jth parameter in the The degree of dispersion in the neighborhood corresponding to the samples, is the standard normalization function, is the total number of samples of the same fault type, is the total number of parameters in the sample; The similarity of the fault stage is inversely correlated with the discrete difference between the corresponding sample and the sample with the same fault type; the discrete difference is the absolute value of the difference between the discrete degrees of each parameter of the sample in its neighborhood and the adjacent domain; the adjacent domain is a sample sequence located on both sides of the neighborhood and the same length as the neighborhood; the neighborhood is a sample sequence of preset time length centered on the corresponding sample; the communication environment deterioration is inversely correlated with the fault interval of the corresponding sample; the communication environment deterioration is inversely correlated with the fault interval of the corresponding sample; for: ; Where, For the The failure interval of samples, is the standard deviation of the failure intervals of all failure samples, The natural constant is an exponential function with a base; the fault interval is the interval between the time when the fault of the corresponding sample occurs and the time when the previous fault occurs; The sample to be tested is input into the trained GBDT model, and the corresponding output probabilities of no fault and each fault type are used. The fault condition corresponding to the maximum probability is used as the fault condition of the corresponding sample.
2. The method for diagnosing communication failure of an electric energy meter according to claim 1, characterized in that: The same fault type The sample and The similarity of the fault stage of samples for: ; Where, is the jth parameter in the The degree of dispersion in the neighborhood corresponding to the samples, is the jth parameter in the The sample corresponding to The degree of dispersion in a close domain, is the jth parameter in the The degree of dispersion in the neighborhood corresponding to the samples, is the jth parameter in the The sample corresponding to The degree of dispersion in a close domain, is the total number of parameters in the sample, For the natural constant The exponential function of base .
3. The method for diagnosing communication failure of an electric energy meter according to claim 1, characterized in that: The gain of node splitting is the difference between the sum of the weighted loss of the left child node and the weighted loss of the right child node and the weighted loss of the parent node; where the weighted loss of any node is for: ; Where, is the sample set of the corresponding node Middle The weight of the samples, To be the first The value obtained by substituting the first-order derivative function of the multivariate cross entropy loss function into the sample is, To be the first The value obtained by substituting samples into the second-order derivative function of the multivariate cross entropy loss function is, is the regularization parameter, .
4. The method for diagnosing communication failure of an electric energy meter according to claim 1, characterized in that: The probability of the tested sample corresponding to various fault conditions is inversely correlated with the absolute value of the difference between the predicted value and the actual value of the corresponding sample; Samples to be tested Corresponding to The probability of a failure for: ; Where, For the sample to be tested The predicted value of For the The true value of the fault condition, For the natural constant is the exponential function of the base, is the normalized exponential function.
5. The method for diagnosing communication failure of an electric energy meter according to claim 1, characterized in that: The failure types include signal interruption, protocol error, data verification failure, configuration error, hardware failure and verification failure.
6. The method for diagnosing communication failure of an electric energy meter according to claim 1, characterized in that: The parameters include the operating voltage, operating current, operating temperature and communication signal strength of the communication module.
7. A diagnostic system for electric energy meter communication failure, comprising a memory and a processor, characterized in that: The processor executes the computer program stored in the memory to implement the method for diagnosing communication failure of an electric energy meter according to any one of claims 1 to 6.