Machine learning-based rectifier online monitoring method
Technical Field
The invention relates to a machine learning-based online rectifier monitoring method.
Background
The Rectifier (Rectifier) is a rectifying device which can convert Alternating Current (AC) into Direct Current (DC), and the equipment mainly has two functions, namely, converting the Alternating Current (AC) into the Direct Current (DC), and supplying the filtered Alternating Current (AC) to a load; and secondly, supplying power to the energy storage system. As a part of the power supply system, the running state of the rectifier is directly related to the stability of the power supply system, and the safety of the power supply system during running can be further improved by monitoring, judging and early warning the running state of the rectifier equipment.
So far, the monitoring mode of the rectifier running state at home and abroad mainly collects the current, the environment temperature, the environment humidity and the equipment temperature data when the equipment runs and displays the data through numerical values. However, the conventional monitoring method cannot describe the mutual influence relationship between the variables, and on the other hand, an index threshold (e.g., an equipment temperature threshold) must be manually set when the rectifier state is evaluated, and when the index is within the threshold, the overall state and the variation trend of the rectifier cannot be accurately and effectively evaluated.
Disclosure of Invention
The invention aims to solve the technical problem of providing a machine learning-based rectifier online monitoring method, which takes a rectifier real temperature value as a state judgment index, constructs a temperature model between the rectifier current, power, environment temperature and humidity and the rectifier real temperature, uses the temperature model to calculate a predicted value of the rectifier temperature in real time when monitoring the rectifier state, compares an equipment predicted temperature value with the real temperature value, and discriminates the abnormal operation trend of the rectifier in real time by judging the result, so as to monitor the operation state of the rectifier.
The technical scheme adopted by the invention is as follows:
a machine learning-based rectifier online monitoring method is characterized by comprising the following steps:
s1, data acquisition:
collecting data of current, equipment temperature, environment temperature and environment humidity when the rectifier runs by using a current sensor, a temperature sensor and a humidity sensor;
s2, data processing: the current data is subjected to dynamic smoothing treatment, and the method comprises a moving smoothing method, an asymmetric local weighted regression scatter point smoothing method and a moving window simulation or polynomial smoothing method;
s2-1, performing dynamic smoothing processing on the current data by adopting a moving smoothing method, namely a formula (1); because the current change has large fluctuation, the result fluctuation is large when the current is directly used for prediction; therefore, the current data needs to be smoothed before modeling and temperature prediction, so that the predicted temperature is ensured not to have large fluctuation;
in the invention, a moving smoothing method is adopted to carry out moving smoothing treatment on current data:
wherein,for the current value smoothed at the present moment, ItAs the actual current value at the current time, (1,2, …, N) is how many time points, such as I, are smoothed backwards at the current timet-1Is the current value at time t-1, It-2Is the current value at time t-2, It-NThe current value at the time t-N;
s2-2, constructing a new derivative variable by using the current data:
constructing derivative variables of the current data, wherein the derivative variable types comprise a current square value, a current cubic value, a smooth current square value, a smooth current cubic value, a current square accumulated value in a period of time (formula (2)), a current cubic accumulated value in a period of time (formula (3)), a current maximum (formula (4)), a minimum value (formula (5)) and a standard deviation (formula (6));
It_max=max(It-1,It-2,…,It-N)………………………(4);
It_min=min(It-1,It-2,…,It-N)………………………(5);
It_std=std(It-1,It-2,…,It-N)………………………(6);
in the formula, the first and second sets of data are represented,is the square of the current at time t,the square of the current at time t-1,the square of the current at time t-2,the square value of the current at the time t-N;is the current cubic value at time t,is the current cubic value at time t-1,is the current cubic value at time t-2,the current cubic value at the time t-N;is [ t-N, t-1 ]]The integrated value of the square of the current over the time period,is a group of [ t-N,t-1]cumulative value of current cubed over time period, It_maxIs [ t-N, t-1 ]]Maximum value of current in time period, It_minIs [ t-N, t-1 ]]Minimum value of current in time period, It_stdIs [ t-N, t-1 ]]Standard deviation of current values over a time period; i ist-1Is the current value at time t, It-2Is the current value at time t-2, It-NThe current value at the time t-N;
s2-3, data normalization:
scaling the data to make the data fall into a cell, eliminating unit limitation of the data, and facilitating comparison and weighting of indexes of different units or orders of magnitude;
in the present invention, data normalization is performed for each variable using the z-score method (normalization method) (equation 9):
σX=std(x1,x2,…,xN)………………………(8);
in addition to the z-score method, it may be: min-max normalization, log function conversion, and atan function conversion methods;
s3, machine learning: modeling by using a ridge regression method, a Lasso regression method, a random forest, a decision tree, a gradient boosting decision tree, a neural network or an RNN algorithm according to historical operation data of a rectifier;
the method adopts rectifier historical operation data and a ridge regression method to carry out modeling, and establishes a corresponding relation among current, environment temperature, environment humidity and equipment temperature when the rectifier operates, namely a rectifier temperature model;
for the linear regression problem, the objective function of the least squares method is (equation 10):
in the formula:
xij——xi=(xi1,…,xip)Tthe independent variable value of the ith observation sample is the independent variable value of the ith observation sample, and the sample has p characteristic variables;
yi-dependent value of the ith sample (i.e. the required actual temperature value of the device);
α -intercept term;
βj-coefficients of the jth characteristic variable;
β -vectors of characteristic variable coefficients;
let θ equal (α), the objective function becomes to minimize | | X θ -y | | ceiling ventilation2(ii) a Derivation of the parameters of the objective function yields the solution formula for the objective function (formula 11):
θ=(XTX)-1XTy………………………(11);
in the formula, theta is a parameter vector to be solved, X is a sample characteristic matrix, and y is a dependent variable value vector; when X is not column full rank, or multiple collinearity exists between columns, XTDeterminant of X is close to 0 (i.e. X)TX is close to singular), then (X) is calculatedTX)-1The time error is very large, so that the traditional least square method is lack of stability and reliability;
therefore, by abandoning the unbiased property of the least square method, the regression coefficient obtained at the cost of losing part of information and reducing precision is more consistent with the actual and reliable regression method:
adding a regularization term to the objective functionSo that the objective function becomes minimized | | | X theta-y | | non-calculation2+||λI||2;
After derivation is performed on the regularized target function, a target function solving formula (formula 12) can be obtained, and the method is called a ridge regression method;
θ=(XTX+λI)-1XTy………………………(12);
in the formula, λ is a ridge parameter, I is an identity matrix, and λ I is an increasing regular term;
s4, model prediction:
aiming at new data generated by the operation of the rectifier, the data is transmitted to a rectifier temperature model after being processed, the temperature of the rectifier under the current, the ambient temperature and the ambient humidity is predicted, and whether the temperature of the rectifier changes according to a historical normal rule or not is discriminated in real time by comparing the real temperature and the real temperature of the rectifier;
s5, calculating the state and early warning level of the rectifier
Because the current fluctuation is large, the prediction result of the model at partial data points is poor, and in order to avoid program misinformation, the mode of interval judgment and dynamic monitoring is used for distinguishing on the basis of model prediction;
the steps of the interval determination and dynamic monitoring process are specifically as follows (see fig. 3 for details):
4) judging whether the absolute value of the residual error between the predicted temperature and the real temperature of the current equipment is greater than a set threshold value, and when the absolute value of the residual error is greater than the threshold value, automatically starting a monitoring program to monitor the state of the equipment;
5) counting the absolute values of the residual errors of the subsequent N data points, and when the absolute values of the residual errors of the N data points are larger than a threshold value, automatically adding 1 to the state information Tp of the equipment;
6) repeating the step (2), and when the absolute value of the residual error of n data points appearing in all the continuous p intervals is larger than or equal to the threshold (namely Tp is p), automatically adding 1 to the early warning information Tw; and (4) if the absolute value of the residual error in a certain interval does not meet the condition, resetting the Tp and Tw values, returning to the step (1), and restarting to monitor the model prediction result.
Has the advantages that: the technical scheme fundamentally solves the problem that the current simple monitoring mode that the state of the rectifier cannot be effectively evaluated when the early warning state value is manually set and the index value is in the threshold range is solved. The temperature model among the current, the environment temperature and humidity and the rectifier temperature during the normal operation of the rectifier is established by adopting historical operation data, so that the abnormal change trend of the equipment in the subsequent operation process can be discriminated. Meanwhile, by using a dynamic monitoring program and an interval discrimination method, the technical scheme has stronger anti-interference performance and avoids program misinformation.
Drawings
FIG. 1 is a flow chart of the invention;
FIG. 2 is a diagram of real-time monitoring and prediction of rectifier temperature;
FIG. 3 is a flow chart of rectifier state/warning level calculation;
fig. 4 is a diagram of the rectifier status/warning level display.
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to specific examples and accompanying drawings.
The embodiment of the machine learning-based rectifier online monitoring method comprises the following steps of:
s1, data acquisition:
collecting data of current, equipment temperature, environment temperature and environment humidity when the rectifier runs by using a current sensor, a temperature sensor and a humidity sensor;
s2, data processing:
s2-1, performing dynamic smoothing treatment on the current (formula 1); because the current change has large fluctuation, the result fluctuation is large when the current is directly used for prediction; therefore, the current data needs to be smoothed before modeling and temperature prediction, so that the predicted temperature is ensured not to have large fluctuation;
in the invention, a moving smoothing method is adopted to carry out moving smoothing treatment on current data:
wherein,for the current value smoothed at the present moment, ItAs the actual current value at the current time, (1,2, …, N) is how many time points, such as I, are smoothed backwards at the current timet-1Is the current value at time t-1, It-2Is the current value at time t-2, It-NThe current value at the time t-N;
in addition, an asymmetric local weighted regression scatter smoothing method (LOWESS), a moving window fitting polynomial smoothing method can also be adopted;
s2-2, constructing a new derivative variable by using the current data:
constructing derivative variables of the current data, wherein the derivative variable types comprise a current square value, a current cubic value, a smooth current square value, a smooth current cubic value, a current square in a period of time (formula (2)), a cubic cumulative value (formula (3)), a current maximum value (formula (4)), a minimum value (formula (5)) and a standard deviation (formula (6));
It_max=max(It-1,It-2,…,It-N)………………………(4);
It_min=min(It-1,It-2,…,It-N)………………………(5);
It_std=std(It-1,It-2,…,It-N)………………………(6);
in the formula, the first and second sets of data are represented,is the square of the current at time t,the square of the current at time t-1,the square of the current at time t-2,the square value of the current at the time t-N;is the current cubic value at time t,is the current cubic value at time t-1,is the current cubic value at time t-2,is the time t-NThe current cubic value of (a);is [ t-N, t-1 ]]The integrated value of the square of the current over the time period,is [ t-N, t-1 ]]Cumulative value of current cubed over time period, It_maxIs [ t-N, t-1 ]]Maximum value of current in time period, It_minIs [ t-N, t-1 ]]Minimum value of current in time period, It_stdIs [ t-N, t-1 ]]Standard deviation of current values over a time period; i ist-1Is the current value at time t, It-2Is the current value at time t-2, It-NThe current value at the time t-N;
s2-3, data normalization:
scaling the data to make the data fall into a small specific interval, eliminating unit limitation of the data, and facilitating comparison and weighting of indexes of different units or magnitude levels;
in the present invention, data normalization is performed for each variable using the z-score method (normalization method) (equation 9):
σX=std(x1,x2,…,xN)………………………(8);
s3, machine learning:
modeling by using historical rectifier operation data and a ridge regression method, and constructing a corresponding relation among current, environment temperature, environment humidity and equipment temperature when the rectifier operates, namely a rectifier temperature model;
for the linear regression problem, the objective function of the least squares method is (equation 10):
in the formula:
xij——xi=(xi1,…,xip)Tthe independent variable value of the ith observation sample is the independent variable value of the ith observation sample, and the sample has p characteristic variables;
yi-dependent value of the ith sample (i.e. the required actual temperature value of the device);
α -intercept term;
βj-coefficients of the jth characteristic variable;
β -vectors of characteristic variable coefficients;
let θ equal (α), the objective function becomes to minimize | | X θ -y | | ceiling ventilation2(ii) a Derivation of the parameters of the objective function yields the solution formula for the objective function (formula 11):
θ=(XTX)-1XTy………………………(11);
in the formula, theta is a parameter vector to be solved, X is a sample characteristic matrix, and y is a dependent variable value vector. When X is not column full rank, or multiple collinearity exists between columns, XTDeterminant of X is close to 0 (i.e. X)TX is close to singular), then (X) is calculatedTX)-1The time error is very large, so that the traditional least square method is lack of stability and reliability;
therefore, by abandoning the unbiased property of the least square method, the regression coefficient obtained at the cost of losing part of information and reducing precision is more consistent with the actual and reliable regression method:
adding a regularization term to the target function to minimize | | X θ -y | | calculation of the non-calculation of the2+||λI||2;
After derivation is performed on the regularized target function, a target function solving formula (formula 12) can be obtained, and the method is called a ridge regression method;
θ=(XTX+λI)-1XTy………………………(12);
in the formula, λ is the ridge parameter, I is the identity matrix, and λ I is the increasing regularization term.
S4, model prediction
Aiming at new data generated by the operation of the rectifier, the data is transmitted to a rectifier temperature model after being processed, the temperature of the rectifier under the current, the ambient temperature and the ambient humidity is predicted, and whether the temperature of the rectifier changes according to a historical normal rule or not is discriminated in real time by comparing the real temperature and the real temperature of the rectifier;
s5, calculating the state and early warning level of the rectifier
Because the current fluctuation is large, the prediction result of the model at partial data points is poor, and in order to avoid program misinformation, the mode of interval judgment and dynamic monitoring is used for distinguishing on the basis of model prediction;
the steps of the interval determination and dynamic monitoring process are specifically as follows (see fig. 3 for details):
7) judging whether the absolute value of the residual error between the predicted temperature and the real temperature of the current equipment is greater than a set threshold value, and when the absolute value of the residual error is greater than the threshold value, automatically starting a monitoring program to monitor the state of the equipment;
8) counting the absolute values of the residual errors of the subsequent N data points, and when the absolute values of the residual errors of the N data points are larger than a threshold value, automatically adding 1 to the state information Tp of the equipment;
9) repeating the step (2), and when the absolute value of the residual error of n data points appearing in all the continuous p intervals is larger than or equal to the threshold (namely Tp is p), automatically adding 1 to the early warning information Tw; and (4) if the absolute value of the residual error in a certain interval does not meet the condition, resetting the Tp and Tw values, returning to the step (1), and restarting to monitor the model prediction result.
The specific flow is shown in fig. 1 and is divided into three steps.
1) Step 1 models rectifier historical data. The method comprises the steps of modeling by using historical data of the rectifier, constructing a temperature model of the rectifier in a normal operation state, processing original data of the rectifier and constructing a characteristic project by using a data processing technology, and constructing the temperature model of the rectifier by using a ridge regression method in a machine learning technology link.
2) Step 2 is rectifier condition monitoring and prediction (see fig. 2 for details). And collecting the state data of the rectifier, and on one hand, carrying out state monitoring. On the other hand, the temperature value of the rectifier in the normal state is predicted by combining the rectifier temperature model constructed in the step 1 and adopting the technical links of data processing and model prediction. Processing the new data by using a data processing technology, constructing the same characteristic variables, transmitting the processed data to a rectifier temperature model, and calculating a predicted value of the rectifier temperature by using the temperature model.
3) Step 3 is rectifier status/warning level calculation (see figure 3 for details). The step uses the technology of a rectifier state and early warning grade calculation link. Comparing the predicted value with the actual value of the rectifier temperature in real time, judging the operation state of the rectifier by adopting interval judgment and dynamic monitoring, and giving out early warning information and state information of the rectifier in real time (see figure 4 in detail). The early warning information is divided into three intervals. The early warning level of the first interval is 0 (green), which indicates that the equipment normally operates. The second interval warning level is 1-11 (yellow), indicating that the equipment status needs "attention". The second interval warning level is 12 (red), indicating that the device status is "abnormal".