Disclosure of Invention
The invention provides a method and a system for monitoring a power system to solve the problems, wherein observation data of each node of the power system in a certain observation time period are collected; preprocessing observation data to obtain a characteristic vector; inputting the feature vectors into a trained operation state classification model to obtain the probability that each node of the power system belongs to different operation states at the current moment, and selecting the operation state corresponding to the highest probability as the operation state of each node at the current moment; the learning rate of the operation state classification model is updated based on the total error in the training process, so that the convergence speed is accelerated, and the prediction precision of the model is improved; and the model adopts a hyperbolic sine activation function, so that the problems of gradient explosion and gradient disappearance caused by the traditional activation function are solved, and the convergence speed of the model is ensured.
According to some embodiments, the invention adopts the following technical scheme:
a power system monitoring method, comprising:
acquiring observation data of a certain node of the power system in a certain observation time period;
preprocessing observation data to obtain a characteristic vector;
inputting the characteristic vector into a trained operation state classification model to obtain the probability that the current moment of the node of the power system belongs to different operation states, and selecting the operation state corresponding to the highest probability as the current moment of the node; and in the training process of the operation state classification model, if the total error of the output probability of the output layer and the expected probability does not meet the convergence condition, updating the learning rate based on the total error, and transferring to back propagation until the total error meets the convergence condition.
Further, the training process of the operation state classification model specifically includes:
constructing a training set;
initializing a network;
an input feature vector is taken from the training set and added to the network, a target probability vector corresponding to the input feature vector is obtained, and hidden layer output is calculated;
calculating a probability vector output by an output layer according to the hidden layer output;
calculating a network prediction error and an error item of a hidden layer;
updating the adjustment quantity of each weight and threshold according to the network prediction error and the error item of the hidden layer;
calculating a total error according to the probability vector output by the output layer and the target probability vector, and updating the learning rate;
judging whether a convergence condition is met, if not, returning to calculate hidden layer output; if so, saving the operation state classification model.
Further, the pretreatment comprises the following specific steps:
interpolating missing values by mean interpolation;
carrying out standardization treatment by using a z-score standardization method;
and converting the standardized observation data into a feature vector.
Further, the operation state classification model adopts a hyperbolic sine activation function.
Furthermore, when the training is finished, the weight and the threshold are stored in the file by the operation state classification model, and when the training is performed next time, the weight and the threshold are directly derived from the file for training without initialization.
A power system monitoring system comprising:
a data acquisition module configured to: acquiring observation data of a certain node of the power system in a certain observation time period;
a data pre-processing module configured to: preprocessing observation data to obtain a characteristic vector;
an operating state prediction module configured to: inputting the characteristic vector into a trained operation state classification model to obtain the probability that the current moment of the node of the power system belongs to different operation states, and selecting the operation state corresponding to the highest probability as the current moment of the node; and in the training process of the operation state classification model, if the total error of the output probability of the output layer and the expected probability does not meet the convergence condition, updating the learning rate based on the total error, and transferring to back propagation until the total error meets the convergence condition.
An electronic device comprising a memory and a processor, and computer instructions stored on the memory and executed on the processor, the computer instructions, when executed by the processor, performing the steps of the method of the first aspect.
A computer readable storage medium storing computer instructions which, when executed by a processor, perform the steps of the method of the first aspect.
The invention has the beneficial effects that:
1. according to the monitoring method of the power system, the operation state of each node of the power system at the current moment is obtained by adopting the operation state classification model based on the observation data in a period of observation time, so that the organic integration of historical operation data and the current moment data is realized, the operation state of the system is comprehensively described, and the accuracy of the operation state prediction of the power system is improved.
2. The embodiment of the invention provides an operation state classification model for predicting the operation state of a power system, which updates the learning rate in each iteration process based on the total error, and when the total error is larger, the learning rate is larger, and the convergence speed is accelerated; when the total error is small, the learning rate is small, and the local optimization capability is enhanced; the convergence speed is accelerated, and meanwhile, the prediction precision of the model is improved.
3. The operation state classification model for predicting the operation state of the power system provided by the embodiment of the invention adopts a hyperbolic sine activation function, solves the problems of gradient explosion and gradient disappearance caused by gradient reverse transfer of a sigmod function or a logistic function in a deep neural network, and ensures the training convergence speed.
Detailed Description
The invention is further described with reference to the following figures and examples.
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
Example 1
As shown in fig. 1, in the monitoring method for the power system provided by this embodiment, observation data of each node of the power system in an observation time period is collected; preprocessing observation data to obtain a characteristic vector; inputting the feature vectors into a trained operation state classification model to obtain the probability that each node of the power system belongs to different operation states at the current moment, and selecting the operation state corresponding to the highest probability as the operation state of the power system at the current moment; the learning rate of the operation state classification model is updated based on the total error in the training process, so that the convergence speed is accelerated, and the prediction precision of the model is improved; and the model adopts a hyperbolic sine activation function, so that the problems of gradient explosion and gradient disappearance caused by the traditional activation function are solved, and the convergence speed of the model is ensured.
A power system monitoring method, as shown in fig. 1, includes the following steps:
step 1: the method comprises the steps of obtaining observation data of any node of the power system at different observation moments in an observation time period before the current moment and the current moment, wherein the observation data comprise voltage, current, active power, reactive power, frequency and the like.
Specifically, the acquisition of the observation data at different observation times is performed by an acquisition device, and the acquisition device includes an analog quantity data acquisition unit, a temperature sensor, and the like.
The input end of the analog quantity data acquisition unit is connected with a PT/CT port of the power system for acquisition, and a voltage transformer inputs voltage and a current transformer inputs current; the ambient temperature of each node of the power system is measured by a temperature sensor.
The specific steps of acquiring observation data of a certain node of the power system at different observation times in an observation time period before the current time are as follows:
(1) the acquisition device acquires observation data of a certain node of the power system at the current moment, and the output end of the acquisition device is connected with the information processing device and outputs digital acquisition information at the current moment after AD conversion;
(2) the information processing device receives clock information from a system clock and digital acquisition information at the current moment, combines the clock information and the digital acquisition information at the current moment to generate a sampling information message at the current moment with a timestamp, and sends the sampling information message to the communication device;
(3) the system clock is connected with the communication device and receives and updates clock information, the storage device is connected with the information processing device and receives a current time sampling information message with a time stamp, meanwhile, the storage device outputs a historical information message to the information processing device, and at the moment, the information processing device obtains observation data of different observation times in the current time and an observation time period before the current time.
After receiving the sampling information message and the historical information message at the current moment, the information processing device firstly preprocesses data, and then predicts and obtains the current-moment operation state of the node of the power system based on a trained operation state classification model.
Step 2: and preprocessing the observation data to obtain a feature vector.
Firstly, interpolating a missing value by adopting mean interpolation;
secondly, standardizing the interpolated data by a z-score standardization method;
and finally, converting the standardized observation data into a characteristic vector X ═ X1,x2,...,xT) Wherein, the vector xtThe data acquired at time T after normalization, T1, …, T, is assumed to be a vector xtIs P, then the dimension of the feature vector X is TP.
And step 3: inputting the collected characteristic vectors into a trained operation state classification model to obtain the probability that the node belongs to different operation states at the current moment of the power system, and selecting the operation state corresponding to the highest probability as the operation state of the node at the current moment, wherein the operation state comprises a normal state, a general abnormal state and a serious abnormal state.
Wherein the operating state classification model utilizes a BP neural network structure.
The BP neural network is a multilayer feedforward neural network, mainly comprises an input layer, a hidden layer and an output layer, and is mainly characterized in that signals are transmitted in a forward direction, and errors are propagated in a reverse direction.
In the training process of the operation state classification model, if the total error of the output probability of the output layer and the expected probability does not meet the convergence condition, the learning rate is updated based on the total error, and the operation state classification model is transmitted to the back propagation until the total error of the output probability of the model and the expected probability meets the convergence condition. Specifically, the training process of the operation state classification model is as follows:
(1) and constructing a training set.
Assume that m training samples are constructed { (X (1), Y (1)), (X (2), Y (2)),1,y2,...,yK) The expected output of the feature vector x (i) corresponding to the ith sample at different observation times, i.e. the probability that the ith sample belongs to different operation states at time T, where K is 3 in this embodiment; the feature vector of the ith sample from 1 to T observation times is denoted as x (i) ═ x1(i),x2(i),...,xT(i) The characteristic index at the time t) can be a vector x with a dimension of PtWhen T is 1, …, and T, the dimension of the feature vector x (i) is TP, and TP is N, so the feature vector of the ith sample from 1 to T observation time can be represented as x (i) (x) and (i) ═ N1,x2,...,xN)。
(2) And (5) initializing the network.
Initializing connection weights V between input layer, hidden layer, and output layer neuronsnlAnd WlkHidden layer threshold alOutput layer threshold bkAnd initializes the learning rate β.
(3) An input feature vector X (i) is taken from the training set and added to the network, and a target output vector Y (i) corresponding to the input feature vector is obtained.
(4) The hidden layer output is computed.
According to the input characteristic vector X, the connection weight V between the input layer and the hidden layernlAnd an implicit layer threshold alAnd calculating hidden layer output:
wherein, N is the number of nodes of the network input layer, L is 1, …, L is the number of nodes of the hidden layer, f (x) is the activation function, the activation function of the invention adopts the hyperbolic sine activation function, specifically, it is the hyperbolic sine activation function
The activation function is replaced by a hyperbolic sine activation function from the original sigmod function or logetics function, so that the problems of gradient explosion and gradient disappearance caused by gradient reverse transfer of the sigmod function or the logetics function in the deep neural network are solved, and the training convergence speed is ensured.
(5) And calculating output layer output.
Outputting H and connecting weight W according to hidden layerlkAnd a threshold value bkAnd calculating the probability vector O ═ O (O) output by the output layer of the BP neural network1,o2,…,ok)
Wherein K is 1, …, and K is the number of nodes in the output layer.
(6) Computing network prediction error
Will output the element o in the vectorkWith elements in the target vectorElement ykAnd comparing, and calculating the network prediction error:
δk=(yk-ok)ok(1-ok)
(7) calculating the error term of the hidden layer:
(8) updating the adjustment quantity of each weight and threshold according to the network prediction error and the error item of the hidden layer:
Wlk=Wlk+βhlδk
bk=bk+βδk
(9) calculating a total error according to the probability vector output by the output layer and the target probability vector;
after obtaining the probability vectors output by all output layers every time K goes through 1 to K, a total error is calculated according to the probability vectors output by the output layers and the target probability vector (i.e., the target output vector Y), the total error E can be expressed as,
(10) updating learning rate
β=γE
Wherein gamma is an adjusting parameter. The traditional method adopting a fixed learning rate value has the following disadvantages: a small learning rate may take a significant amount of time to converge, or may fail to converge due to the disappearance of the gradient; a large learning rate puts the model at risk of exceeding a minimum value, so it will not converge, the so-called explosive gradient. Therefore, the learning rate is updated in each iteration process based on the total error, and when the total error is larger, the learning rate is larger, and the convergence speed is accelerated; when the total error is small, the learning rate is small, and the local optimization capability is enhanced, so that the convergence speed is accelerated and the prediction accuracy of the model is improved by the method for updating the learning rate based on the total error.
(11) Judging whether the total error meets a convergence condition: e is less than or equal to epsilon, epsilon is a convergence threshold value, if not, the step (3) is returned, and iteration is continued; if yes, go to the next step.
(12) And after training, storing the weight values and the threshold values in a file, confirming that each weight value and each threshold value have reached stability, forming an operation state classification model, and storing the operation state classification model.
And when training is performed next time, the weight and the threshold are directly exported from the file for training without initialization.
According to the monitoring method of the power system, the operation state of each node of the power system at the current moment is obtained by adopting the operation state classification model based on the observation data of each node in a period of observation time, so that the organic integration of historical operation data and current moment data is realized, the operation state of the system is comprehensively described, and the accuracy of the operation state prediction of the power system is improved.
Example 2
The present embodiment provides a power system monitoring system, including:
a data acquisition module configured to: acquiring observation data of a certain node of the power system in a certain observation time period;
a data pre-processing module configured to: preprocessing observation data to obtain a characteristic vector;
an operating state prediction module configured to: inputting the characteristic vector into a trained operation state classification model to obtain the probability that the current moment of the node of the power system belongs to different operation states, and selecting the operation state corresponding to the highest probability as the current moment of the node; and in the training process of the operation state classification model, if the total error of the output probability of the output layer and the expected probability does not meet the convergence condition, updating the learning rate based on the total error, and transferring to back propagation until the total error meets the convergence condition.
Example 3
The present embodiment also provides an electronic device, which includes a memory, a processor, and computer instructions stored in the memory and executed on the processor, wherein the computer instructions, when executed by the processor, perform the steps of the method of embodiment 1.
Example 4
The present embodiment also provides a computer-readable storage medium for storing computer instructions, which when executed by a processor, perform the steps of the method of embodiment 1.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.