Disclosure of Invention
In order to solve the problems, the invention provides a portable metering automation terminal fault diagnosis device and a diagnosis method thereof, wherein the portable metering automation terminal fault diagnosis device is firstly based on data information such as real-time voltage, current, power, electric energy, calendar day, calendar month, load curve and the like which are preprocessed by a neural network classifier, and then a support vector machine is used for learning a new classification sample set as a final classifier to carry out more accurate judgment, so that the diagnosis efficiency of the metering automation terminal equipment fault is improved. The specific technical scheme is as follows:
the portable metering automation terminal fault diagnosis device comprises a detection sub-module, a power management module and a man-machine interaction module; the detection sub-module is connected with the man-machine interaction module; the power management module is respectively connected with the detection sub-module and the man-machine interaction module; the man-machine interaction module is used for inputting related instructions to carry out configuration information, and the detection sub-module is used for detecting terminal faults; the power management module provides power for the detection sub-module and the man-machine interaction module; the detection submodule comprises a main control module, a local communication module, a remote communication module, an on-off module, an alternating current sampling module and a meter reading module; the main control module is respectively connected with the local communication module, the remote communication module, the on-off module, the alternating current sampling module, the meter reading module and the man-machine interaction module;
the main control module is used for controlling the fault detection, diagnosis and communication of the terminal;
the local communication module comprises a carrier communication module and a micropower wireless communication module;
the remote communication module is used for uploading collected electric energy data;
the on-off module is provided with a plurality of paths of switch inputs and a plurality of paths of switch outputs and is used for testing whether the switching value input and output of the metering automation terminal are normal or not;
the alternating current sampling module is used for collecting three-phase voltage data and three-phase current data;
the meter reading module is used for simulating an ammeter and providing data of the ammeter read by the metering automation terminal.
A diagnosis method of a portable metering automation terminal fault diagnosis device comprises the following steps:
(1) Collecting data: the detection sub-module collects various data of the metering automation terminal equipment, and specifically comprises control data, remote signaling data, freezing data, time setting data and voltage qualification rate data;
(2) And (3) information normalization processing: the detection sub-module performs standard normalization processing on various data of the acquired metering automation terminal equipment, and converts a data sample of the various data into a numerical value in the range of [0,1] to serve as an input variable of various Adaboost weak classifiers;
(3) Training weights of various Adaboost classifiers: initializing training data weights for N data samples of various types of data, wherein each training sample is given the same weight: 1/N, through inputting fuzzy collected abnormal data and different fault types of output, through repeated iterative computation, a data sample set with updated weight is used for training a next data sample set, each Adaboost weak classifier obtained through training is combined into an Adaboost strong classifier, the weight of the Adaboost weak classifier with small classification error is increased, and the weight of the Adaboost weak classifier with large classification error rate is reduced;
(4) Training by adopting a neural network on the basis of the Adaboost strong classifier: taking various fault reasons and fault possibilities of the metering automation terminal as input quantities, and taking various collected data obtained by a weighted Adaboost strong classifier as output; during training, various fault reasons are taken as input variables, various fault history data are taken as output variables, and a neural network is utilized for feature extraction and training;
(5) And classifying various data acquired by the metering automation terminal by using a trained Ababoost strong classifier and a neural network, extracting characteristics of the received signals, and finding an optimal classification surface for the extracted characteristics by using a support vector machine, namely, classifying the most accurate fault types.
Further, in the step (2), standard normalization processing is performed on various types of data collected by the metering automation terminal device, and data samples of various types of data are converted into numerical values in the range of [0,1], and the method specifically comprises the following steps:
is provided with K evaluation data indexes and M times of acquisition data, x
ij The value r of the j-th data acquisition of the normalized ith data index is obtained by carrying out standard normalization processing on the value of the j-th data acquisition of the ith data index
ij :
Wherein->
The maximum value of the jth data acquisition in the kth data indexValues and minimums.
Further, the abnormal data in the step (3) comprise voltage data, current data, read-write data flow of a local communication module, data flow of a remote communication module and switching value input/output state data.
Further, the fault types in the step (3) include voltage-current wiring errors, abnormality of a local communication module, abnormality of a remote communication module, abnormality of a switching value input/output module, and the like.
Further, the training of the weights of the various Adaboost classifiers in the step (3) specifically includes the following steps:
1) Initializing training data weights for N data samples of various types of data, wherein each training sample is given the same weight: 1/N; d1 is a weight matrix of training samples:
2) Performing multiple iterations, wherein m represents the iteration times, and in the whole iteration process, learning a data sample set with weight distribution aiming at different fault types caused by different collected abnormal data to obtain a basic classifier Gm (x):
3) Calculating a classification error rate e of Gm (x) on the learning data sample set m I.e. by G m (x) The sum of the weights of the misclassified samples:
wherein w is mi The weight of each training sample is iterated for the mth time.
4) Calculating coefficients of Gm (x), wherein α m Represents the importance of Gm (x) in analyzing the Adaboost classifier for the final failure cause:
5) Updating the distribution of training value weights for the next round of weight updating, wherein Zm is a weight normalization factor:
D m+1 =(w m+1,1 ,w m+1,2 ...w m+1,i ...,w m+1,N );
6) After the iteration is completed, each weak classifier is combined to obtain a final strong classifier:
further, the specific steps of feature extraction in the step (4) by using the neural network are as follows:
1) Given a label-free metering automation terminal fault sample set x= { X i |1≤i≤L},x i Representing an ith sample in the fault sample set, wherein the sample length is m; mapping the input fault vector by an automatic encoder, wherein the output vector set is Y= { Y i |1≤i≤L},h i Representing the feature vector corresponding to the ith failure sample, h=f (W,b) (X)=s f (WX+b), W is the weight matrix of the input layer and the hidden layer of the neural network, b is the bias matrix between the input layer and the hidden layer, s f An activation function for the encoder portion;
2) Reconstructing the hidden layer output variable obtained by the encoder into an original input variable: the output vector set is
The length of the output vector is the same as the length of the fault vector before decoding, and the mathematical analysis formula of the decoder is as follows:
s
g activating a function for neurons of the decoder section;
3) By continuously minimizing reconstruction errors between the output vector and the input vector
The purpose of extracting features is achieved, and the reconstruction error is +.>
And continuously adjusting the weight matrix and the bias matrix of the input layer and the hidden layer of the neural network by using a gradient descent method to minimize the reconstruction error, wherein the specific implementation formula is as follows:
wherein o is the learning rate of the neural network;
4) For the reconstruction error between the output vector and the input vector calculated by the formula, the weight and the bias { W ] are continuously adjusted by an error back propagation algorithm 1 ,b 1 ,W 1 ',b 1 ' minimize the construction error, complete the training of the first stage of the nerve; then, reserving the encoder part of the current stage, wherein the characteristic layer output vector is used as the input vector of the input layer of the next stage neural network;
5) Training the second-stage neural network according to the same steps 1) to 4), repeating the training process of the steps 1) to 4), and finishing the training of the last-stage neural network, wherein when all the previous training is finished, the hidden layer output of the last layer is the final feature vector.
The beneficial effects of the invention are as follows: according to the invention, by combining the neural network and the support vector machine technology, the trained Ababoost classifier and the neural network are utilized to classify and extract the characteristics of various data of the metering automation terminal, and the support vector machine is utilized to find the optimal classification surface for the extracted data characteristics, so that the fault reason and the fault point of the terminal are accurately positioned, and the diagnosis efficiency of the metering automation terminal equipment is improved.
Detailed Description
For a better understanding of the present invention, reference is made to the following description of the invention, taken in conjunction with the accompanying drawings and specific examples:
as shown in fig. 1, a portable metering automation terminal fault diagnosis device comprises a detection sub-module, a power management module and a man-machine interaction module; the detection sub-module is connected with the man-machine interaction module; the power management module is respectively connected with the detection sub-module and the man-machine interaction module; the man-machine interaction module is used for inputting related instructions to carry out configuration information, and the detection sub-module is used for detecting terminal faults; the power management module provides power for the detection sub-module and the man-machine interaction module; the detection submodule comprises a main control module, a local communication module, a remote communication module, an on-off module, an alternating current sampling module and a meter reading module; the main control module is respectively connected with the local communication module, the remote communication module, the on-off module, the alternating current sampling module, the meter reading module and the man-machine interaction module.
The main control module is used for controlling the fault detection and diagnosis of the terminal and communication, and specifically, three-phase voltage and three-phase current data acquisition and opening and closing amount management: e.g. 4-way switching value input/output management; communication management: such as electric energy meters, concentrator communications (RS 232, RS485 and infrared); USB management, wireless communication management, etc., and local/remote communication module testing, etc.
The local communication module comprises a carrier communication module and a micropower wireless communication module.
The remote communication module is used for uploading collected electric energy data and comprises a remote GPRS/4G communication module.
The on-off module is provided with 4-way switch input and 4-way switch output and is used for testing whether the switching value input and output of the metering automation terminal are normal.
The alternating current sampling module is used for collecting three-phase voltage data and three-phase current data, wherein the three-phase current sampling can be compatible with a three-phase three-wire system and a three-phase four-wire system.
The meter reading module is used for simulating the ammeter and providing data of the ammeter read by the metering automation terminal so as to judge whether meter reading of the metering automation terminal is normal or not.
A diagnosis method of a portable metering automation terminal fault diagnosis device comprises the following steps:
1. collecting data: the detection sub-module collects various data of the metering automation terminal equipment, and specifically comprises control data, remote signaling data, freezing data, time setting data and voltage qualification rate data.
2. And (3) information normalization processing: the detection sub-module performs standard normalization processing on various data of the acquired metering automation terminal equipment, and converts a data sample of the various data into a numerical value in the range of [0,1] to serve as an input variable of various Adaboost weak classifiers; the method comprises the following steps of carrying out standard normalization processing on various data of the acquired metering automation terminal equipment, converting a data sample of the various data into a numerical value in a range of [0,1], and specifically comprising the following steps:
is provided with K evaluation data indexes and M times of acquisition data, x ij The value r of the j-th data acquisition of the normalized ith data index is obtained by carrying out standard normalization processing on the value of the j-th data acquisition of the ith data index ij :
Wherein the method comprises the steps of
The maximum value and the minimum value of the jth data acquisition values in the kth data index are respectively.
3. Training weights of various Adaboost classifiers: initializing training data weights for N data samples of various types of data, wherein each training sample is given the same weight: 1/N, through inputting fuzzy collected abnormal data and different fault types of output, through repeated iterative computation, a data sample set with updated weight is used for training a next data sample set, each Adaboost weak classifier obtained through training is combined into an Adaboost strong classifier, the weight of the Adaboost weak classifier with small classification error is increased, and the weight of the Adaboost weak classifier with large classification error rate is reduced.
The abnormal data comprise voltage data, current data, read-write data flow of a local communication module, data flow of a remote communication module and switching value input and output state data. The fault types comprise voltage and current wiring errors, abnormal local communication modules, abnormal remote communication modules and abnormal switching value output and output modules.
As shown in fig. 2, the training of the weights of the Adaboost classifiers specifically includes the following steps:
1) Initializing training data weights for N data samples of various types of data, wherein each training sample is given the same weight: 1/N; d1 is a weight matrix of training samples:
2) Performing multiple iterations, wherein m represents the iteration times, and in the whole iteration process, learning a data sample set with weight distribution aiming at different fault types caused by different collected abnormal data to obtain a basic classifier Gm (x):
3) Calculating a classification error rate e of Gm (x) on the learning data sample set m I.e. by G m (x) The sum of the weights of the misclassified samples:
wherein w is mi The weight of each training sample is iterated for the mth time.
4) Calculating coefficients of Gm (x), wherein α m Represents the importance of Gm (x) in analyzing the Adaboost classifier for the final failure cause:
5) Updating the distribution of training value weights for the next round of weight updating, wherein Zm is a weight normalization factor:
D m+1 =(w m+1,1 ,w m+1,2 ...w m+1,i ...,w m+1,N )
6) After the iteration is completed, each weak classifier is combined to obtain a final strong classifier:
4. training the neural network on the basis of the Adaboost strong classifier: taking various fault reasons and fault possibilities of the metering automation terminal as input quantities, and taking various collected data obtained by a weighted Adaboost strong classifier as output; during training, various fault reasons are taken as input variables, various fault history data are taken as output variables, and the neural network is utilized for feature extraction and training.
FIG. 3 is a schematic diagram of a neural network structure including an automatic encoder, wherein the specific steps of feature extraction using the neural network are as follows:
1) Given a label-free metering automation terminal fault sample set x= { X i |1≤i≤L},x i Representing an ith sample in the fault sample set, wherein the sample length is m; mapping the input fault vector by an automatic encoder, wherein the output vector set is Y= { Y i |1≤i≤L},h i Representing the feature vector corresponding to the ith failure sample, h=f (W,b) (X)=s f (WX+b), W is the weight matrix of the input layer and the hidden layer of the neural network, b is the bias matrix between the input layer and the hidden layer, s f Is an activation function of the encoder portion.
2) Reconstructing the hidden layer output variable obtained by the encoder into an original input variable: the output vector set is
The length of the output vector is the same as the length of the fault vector before decoding, and the mathematical analysis formula of the decoder is as follows:
s
g the function is activated for neurons of the decoder part.
3) By continuously minimizing reconstruction errors between the output vector and the input vector
The purpose of extracting features is achieved, and the reconstruction error is +.>
And continuously adjusting the weight matrix and the bias matrix of the input layer and the hidden layer of the neural network by using a gradient descent method to minimize the reconstruction error, wherein the specific implementation formula is as follows:
where o is the learning rate of the neural network.
4) For the reconstruction error between the output vector and the input vector calculated by the above formula, the weight and bias { W ] are continuously adjusted by using an error back propagation algorithm 1 ,b 1 ,W 1 ',b 1 ' minimize the construction error, complete the training of the first stage of the nerve; the encoder portion of the present stage is then preserved, with the feature layer output vector being the input vector of the next stage neural network input layer.
5) Training the second-stage neural network according to the same steps 1) to 4), repeating the training process of the steps 1) to 4), and finishing the training of the last-stage neural network, wherein when all the previous training is finished, the hidden layer output of the last layer is the final feature vector.
5. The method comprises the steps of classifying various data acquired by a metering automation terminal by using a trained Ababoost classifier and a neural network, extracting characteristics of received signals, and finding an optimal classification surface for the extracted characteristics by using a support vector machine, namely, classifying the most accurate fault types. Among the N types of faults for metering automation terminal faults, for example the common types: for training samples (x) after feature extraction by using a neural network, a remote communication module failure, a meter reading module failure, an alternating current sampling module failure, an input/output module failure, and the like i ,y i ),i=1,2,…,N,y i Is a category label, y i ∈(1,-1)。
6. By using a support vector machine classifier with two classes, an N-class classifier can be constructed by the following steps:
1) Constructing N support vector machine SVM classifier rules with two classifications: constructing a classification function f of the training sample j (x) J=1, 2..n, the j-th class of samples is separated from the training samples of the other classes (if training sample x i Belonging to the j-th class, sgn [ f ] j (x i )]=1, otherwise sgn [ f ] j (x i )]=-1)。
2) By selecting a function f j (x) J=1, 2. In N in N categories class F (x) corresponding to maximum value i )=argmax{f 1 (x i ).,..f N (x i ) And constructing an N-type classifier which can separate each type from the rest N-1 type fault samples, thereby realizing the purpose of diagnosing and classifying the faults of the metering automatic terminal.
The present invention is not limited to the specific embodiments described above, but is to be construed as being limited to the preferred embodiments of the present invention, and any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention are intended to be included in the scope of the present invention.