Disclosure of Invention
The invention aims to overcome the problems in the prior art and provides a temperature prediction control method for a heat shrinkage tube winding motor.
In order to achieve the technical purpose and the technical effect, the invention is realized by the following technical scheme:
a temperature prediction control method for a heat shrinkage tube winding motor comprises the following steps:
Step S1, collecting a historical data set;
S2, data processing;
Step S3, data screening;
S4, dividing a training data set and a test data set;
s5, constructing an improved CNN-LSTM network model structure;
step S6, initializing particle swarm parameters and speed position information;
Step S7, optimizing the population;
Step S8, optimizing inertia weight and learning factors;
step S9, updating the speed, the position, the inertia weight and the learning factor of the particles;
S10, inputting parameters into a CNN-LSTM neural network for training;
Step S11, defining a fitness function;
Step S12, calculating the particle fitness to update the optimal position;
step S13, calculating and judging a model, if the maximum iteration times are met, continuing to execute downwards, otherwise, repeating the step S9;
step S14, obtaining optimal parameters;
s15, inputting optimal parameters into an IPSO-CNN-LSTM prediction model;
s16, training an IPSO-CNN-LSTM model;
S17, inputting a historical test set evaluation model, and setting various model evaluation index thresholds;
S18, calculating various evaluation indexes of the IPSO-CNN-LSTM model and comparing the evaluation indexes with corresponding threshold values;
Step S19, outputting an optimal IPSO-CNN-LSTM prediction model, and simultaneously adopting a Z-Score standardized inverse normalization method to process a residual error alarm threshold delta;
and S20, counting abnormal frequency grading early warning of the temperature of the heat shrinkage tube winding motor by adopting a sliding window algorithm.
Further, the step S20 includes the following specific steps:
step S20.1, real-time data acquisition;
Step S20.2, initializing the abnormal frequency of the current temperature in the sliding window, wherein f T =0;
s20.3, inputting relevant parameters of the temperature of the heat shrinkage tube rolling motor in a period of time to be acquired in real time to an optimal IPSO-CNN-LSTM prediction model;
s20.3, inputting relevant parameters of the temperature of the heat shrinkage tube rolling motor in a period of time to be acquired in real time to an optimal IPSO-CNN-LSTM prediction model;
step S20.4, outputting a corresponding predicted temperature set of the heat-shrinkable tube winding motor: meanwhile, calculating the average absolute error between the predicted value and the actual value of the temperature of the heat shrinkage tube winding motor:
S20.5, adopting a Z Score standardized inverse normalization method to respectively treat predicted temperature sets of the heat shrinkage tube rolling motor Absolute error from averageOutputting corresponding T ΔT and average absolute error MAE update;
Step S20.6, if T i is greater than maxT, wherein T i∈TΔT, maxT is an upper temperature limit, and the corresponding temperature limit exceeds a larger threshold, setting various evaluation indexes of the optimal IPSO-CNN-LSTM prediction model by combining the temperature provided by the general comprehensive heat-shrinkable tube winding motor, and jumping to step S20.10, otherwise, continuing to downwards execute step S20.7;
Step S20.7, setting a sliding window length to l=10, and gradually sliding and traversing along the prediction time.
Step S20.8, if MAE update is smaller than residual error alarm threshold delta, adding 1 to the current temperature abnormality frequency in the sliding window to process, namely, f T=fT +1, otherwise, keeping the current temperature abnormality frequency in the sliding window to be the original value, namely, f T=fT +0;
step S20.9, if the current temperature anomaly frequency f T in the sliding window is more than or equal to 6, executing step S20.10, otherwise, jumping to step S20.11;
Step S20.10, a heat shrinkage tube winding machine monitoring early warning system automatically displays primary early warning, namely red early warning, which indicates that a heat shrinkage tube winding motor is in an abnormal state, and sends a command to a winding machine equipment maintenance worker to stop in time for carrying out abnormality treatment;
Step S20.11, if the current temperature abnormality frequency in the sliding window is more than or equal to 2 and less than or equal to T, executing step S20.12, otherwise, jumping to step S20.13;
Step S20.12, a heat shrinkage tube winding machine monitoring and early warning system automatically displays secondary early warning, namely yellow early warning, which indicates that an abnormal phenomenon occurs in a heat shrinkage tube winding motor, sends a command to winding machine equipment maintenance operators to observe the real-time running state of equipment in an equipment operation area, evaluates the running state and then determines whether to take corresponding abnormal treatment measures or not;
And step S20.13, automatically displaying green by a monitoring and early warning system of the shrink tube winding machine to indicate that the equipment temperature is normal, and jumping to step S20.2 to perform grading early warning on the abnormal frequency of the temperature of the heat shrink tube winding motor counted by a sliding window algorithm of the next round.
Further, in the step S1, in the process of collecting the historical data set, the data interval is located in the normal operation period of the heat-shrinkable tube winding machine, so that the validity of the data is ensured, the obtained data sources are winding motor rotating speed, winding motor active power, winding motor voltage, winding motor temperature, winding machine tension, environment temperature and environment humidity parameters at the same moment, and the parameter data at the same sampling moment are 1 group, the sampling interval is set for 30S, and the heat-shrinkable tube winding machine is continuously collected for 2 months, so that the sample quantity is ensured to be sufficient.
Further, in the step S2, in order to improve the data quality, remove redundant information, process missing values, and normalize data, the method specifically includes the following steps:
Step S2.1, data cleaning, setting the size of a moving window to be n by adopting a method of combining the moving window with abnormal threshold values of various parameters, firstly traversing all acquired parameters, searching repeated values existing in a data set, deleting the repeated values, secondly judging whether the number of abnormal occurrence is smaller than m by comparing the continuous n time step data with the corresponding abnormal threshold values, if so, performing interpolation by adopting a Newton polynomial interpolation method, otherwise, directly deleting other characteristic parameter data containing the abnormal data parameters in the same time step, wherein the Newton interpolation calculation formula is as follows :Nn(x)=f(x0)+f[x0,x1](x-x0)+f[x0,x1,x2](x-x0)(x-x1)+...+f[x0,x1,...,xn](x-x0)(x-x1)…(x-xn-1) (1)
In the formulas (1) - (2), (x i,f(xi)) represents normal data of samples in a window N, f [ x 0,x1,...,xn ] represents an N-order difference quotient, for the difference quotient f [ x 0,x1,...,xn ], the sequence of sequence numbers subscript does not affect the value of the difference quotient, x i represents the time coordinate of abnormal data, N n (x) represents an inserted value calculated by Newton interpolation, and in actual interpolation, only the result N n-1 (x) of interpolation after the last sampling is saved, and the sum of N n-1 (x) and a new term is directly calculated next time, so that calculation and storage space are saved;
Step S2.2, Z-Score data normalization processing, wherein the data normalization can accelerate the gradient descent optimal solution speed during model training, improve model precision, and uniformly map data in intervals [0,1], and the calculation formula is as follows:
In the formula (3), y is a data value, i.e., an initial value before data normalization, Is the average of the dataset, σ is the standard value, and y' is the data normalization corresponding value.
Further, in step S3, through pearson correlation coefficient calculation and analysis, parameters related to the heat shrinkage tube winding motor are selected, that is, 6 groups of parameters including winding motor rotation speed, winding motor active power, winding motor voltage, winding machine tension, ambient temperature and winding motor temperature are selected as follow-up model training and test sample data, and the selected sample data are integrated into the following matrix expression form:
In the formula (10), Z epsilon R 6×s represents a sample data matrix after 6 groups of historical data are integrated, wherein n is a rolling motor rotating speed set, P is a rolling motor active power set, U is a rolling motor voltage set, F is a rolling motor tension set, K is an environment temperature set, T is a rolling motor temperature set, and s is a data set s-th time step.
Further, in the step S4, the preprocessed Z matrix sample data set is randomly divided into a training set and a testing set according to conditions, wherein the training set accounts for 80% and is used for training an improved CNN-LSTM model, and the testing set accounts for 20% and is used for evaluating the improved CNN-LSTM model;
In the step S5, the network model structure comprises 2 one-dimensional convolution layers, 1 full-connection layer and 2 LSTM layers, the normalization and nonlinear operation of data are realized through a BN layer and an activation function Leaky-ReLU after the convolution layers, so that the model convergence speed is increased, the gradient disappearance problem is solved, deep features affecting the temperature factors of a winding motor are extracted, and the extracted deep features are input into the LSTM to better predict feature information.
Further, in the step S5, the parameters of the convolution layer are the weight of the convolution kernel and the offset of each channel, and the mathematical model of the convolution operation of the convolutional neural network CNN is as follows:
in the formula (11), the amino acid sequence of the compound, Represents the jth output feature map of the mth layer, M m-1 represents the input feature set, M represents the mth layer of the CNN,Representing the convolution kernel used by the m-th layer convolution operation,Representing the bias of the jth feature map, representing convolution operation, f (·) representing the activation function;
The pooling layer pools the features extracted by the convolution layer to realize dimension reduction of the features and reduce network parameters, prevents model overfitting to a certain extent, adopts maximum pooling, seeks the maximum value of a pooling area to obtain local features, the obtained feature map is more sensitive to texture features, and the maximum pooling operation is expressed as follows for the output X i of a kth filter of the convolution layer in the ith dimension:
In the formula (12), p i (j) is the j-th output of the pooling layer, and w is the width of the pooling core;
As a variant LSTM of the RNN of the recurrent neural network, a gating unit is introduced to alleviate the gradient extinction and gradient explosion problems existing during RNN training, to improve the prediction accuracy, and at time t, the memory unit C t is a core part of the LSTM neuron, and the gating structure of the network is composed of a forgetting gate, an input gate and an output gate, so as to determine the transmission of information to C t, and in one time step, the LSTM neuron obtains the values of C t and other state quantities in the unit through a series of calculations, and the specific calculation formula is as follows:
ft=σ(Wf[ht-1,xt]+bf) (13)
it=σ(Wi[ht-1,xt]+bi) (14)
ot=σ(Wo[ht-1,xt]+bo) (15)
h t=ot⊙tanh(Ct) (18), wherein in the formulas (13) - (18), f t、it、ot is the states of an input gate, a forgetting gate and an output gate at the time t respectively, and C t-1 is a memory unit of LSTM at the time t-1; And C t is a candidate memory unit and a current time memory unit of the current time LSTM respectively, h t-1 is an output value of the current time LSTM at t-1, x t is an input value of the current time LSTM, W i、Wf、Wo、WC and b i、bf、bo、bC are weights and biases of an input gate, a forgetting gate, an output gate and a candidate memory respectively, sigma (&) is a sigmoid activation function, tan h (&) is a hyperbolic tangent function, and as-is-a-bit multiplication of all elements.
Further, in the step S6, the method specifically includes the following steps:
S6.1, initializing IPSO super parameters and determining initial values of the IPSO parameters;
Step S6.2, initializing the position and the speed of particles, randomly generating a population x i=(n1,m1,m2,m3,α,p,batchsize), wherein n 1 is the number of CNN convolution kernels, m 1、m2 is the number of neurons of 2 LSTM hidden layers, m 3 is the number of neurons of a full-connection layer, alpha is an initialization learning rate, p is the inactivation rate of the neurons, batch size is a Batch Size, and the range of values of the parameters is specifically as follows:
n1∈[2,64],m1∈[1,30],m2∈[1,30],m3∈[1,20],α∈[0.001,0.005],p∈[0.01,0.90],batchsize∈[1,50].
further, in the step S7, a Circle mapping method is introduced to initialize the particle swarm, so as to obtain a more uniform and diversified initial swarm, so as to improve the convergence speed and precision of the algorithm, and the expression of the chaotic sequence generated by the Circle mapping is as follows:
Wherein X i represents the ith chaotic sequence number, X i+1 represents the (i+1) th chaotic sequence number, e=0.5, f=0.2, mod represents a modulo operator, and the population initialization operation using Circle mapping comprises speed initialization and position initialization, and the specific initial operation is as follows:
vi,j=vlower_b+(vup_b-vlower_b)*Xi,j (22)
In the formulas (22) - (23), v lower_b and v up_b are respectively the upper and lower limits of particle speed, X lower_b and X up_b are respectively the upper and lower limits of particle position, and X i,j and X' i,j are respectively chaotic sequence values generated by Circle mapping in the corresponding particle dimension.
Further, in the step S8, the method specifically includes the following steps:
step S8.1, introducing dynamic nonlinear variation inertial weight, and selecting dynamic nonlinear variation inertial weight omega, wherein the method comprises the following steps of:
Wherein ω (k) is the inertia weight of the kth iteration, ω max and ω min are respectively the maximum value 0.9 and the minimum value 0.4 of the inertia weight, t max is the maximum iteration number, and k is the iteration number;
Step S8.2, introducing asymmetric learning factors, wherein the asymmetric learning factors comprise individual learning factors c 1 and social learning factors c 2,c1 and c 2, and the individual learning factors and the social learning factors are adaptively adjusted according to different search periods, and the specific expression is as follows:
In the formulas (25) - (26), c 1(k)、c2 (k) are the individual learning factor and the social learning factor of the kth iteration respectively, c 1_e、c1_s is the initial value 2.5 and the termination value 0.5 of the individual learning factor respectively, c 2_e、c2_s is the initial value 1 and the termination value 2.25 of the social learning factor respectively, t max is the maximum iteration number, and k is the iteration number.
Further, in the step S11, the optimized initial particles are used as parameters of the CNN-LSTM model, and the mean square error MSE is used as fitness of the IPSO algorithm, which is specifically as follows:
In formula (27): For the predicted value, y i is the actual value and N is the number of samples.
Further, in the step S17, an average absolute error MAE threshold MAE th_max, an average absolute percentage error MAPE threshold MAPE th_max, a root mean square difference RMSE threshold RMSE th_max, and a determination coefficient R 2 threshold R 2 th_min are introduced to comprehensively evaluate the IPSO-CNN-LSTM model prediction effect.
Further, in the step S18, the method specifically includes the following steps:
step S18.1, calculating evaluation indexes, namely calculating and evaluating various indexes of the IPSO-CNN-LSTM model, wherein the evaluation indexes are specifically as follows:
In the steps (28) to (31), For the predicted value, y i is the actual value,The average value is N, and the number of samples is N;
Step S18.2, judging a threshold range, and sequentially comparing whether various evaluation indexes of the IPSO-CNN-LSTM model are positioned in the designated threshold range or not, wherein the specific steps are as follows:
If the requirement of the inequality group (32) is met, the prediction accuracy of the IPSO-CNN-LSTM model is higher, the MAE find is recorded as the absolute upper limit of the predicted residual error alarm threshold value when the model training is ended, the downward execution is continued, and otherwise, the operation step S14 is repeated.
Further, in the step S19, a specific calculation formula is as follows:
δ=mae final×σtest+μtest (33), where MAE final is the final mean absolute error MAE of the optimal IPSO-CNN-LSTM prediction model, δ test is the standard deviation of the test set, and μ test is the mean of the test set in equation (33).
The beneficial effects of the invention are as follows:
The intelligent grading early warning of the temperature of the heat shrinkage tube winding motor, which is acquired in real time, is realized by combining the method model with the sliding window algorithm to count the abnormal frequency of the temperature. Aiming at the defects of the traditional PSO algorithm, the method acquires a more uniform and diversified initial population by introducing Circle optimization population, is favorable for improving the convergence speed and precision of the algorithm, and can better balance the global searching and local searching capacity of the algorithm by introducing nonlinear inertial weight. The particles have stronger global convergence capability in searching by introducing asymmetric learning factors. Aiming at the temperature related parameter data of the highly nonlinear heat shrinkage tube winding motor, the parameter of the constructed CNN-LSTM model is optimized by using an IPSO algorithm, so that the model is prevented from being locally optimized, and the generalization capability of the model is improved. Aiming at the fact that certain hysteresis exists in the prior heat shrinkage tube winding motor temperature early warning, real-time collection of relevant parameters such as winding motor temperature, winding motor rotating speed, winding motor active power, winding motor voltage, winding machine tension, environmental temperature and the like is adopted, trend early warning of the heat shrinkage tube winding motor temperature is achieved through combination of sliding window algorithm statistics temperature anomaly frequency and optimal IPSO-CNN-LSTM prediction model, and the problems that the prior winding motor temperature monitoring cannot achieve advanced prediction and trend grading early warning with higher precision due to the fact that winding setting parameters are unstable, fluctuation is large and nonlinear are effectively solved.
Detailed Description
The invention will be described in detail below with reference to the drawings in combination with embodiments.
A temperature prediction control method for a heat shrinkage tube winding motor comprises the following steps:
Step S1, collecting a historical data set, wherein all data in the embodiment of the invention are acquired from a SCADA system matched with a heat-shrinkable tube winding machine, and during the normal operation of a data interval 2024, 5 months, 1 day to 2024, 6 months and 30 days, the acquired data sources are 7 types of parameters such as the rotating speed of a winding motor, the active power of the winding motor, the voltage of the winding motor, the temperature of the winding motor, the tension of the winding machine, the ambient temperature, the ambient humidity and the like at the same moment, the parameter data at the same sampling moment are 1 group, the sampling interval between each group of data is 30S, and the total data of 164160 groups are obtained;
step S2, data processing, in order to improve the data quality, remove redundant information, process missing values and normalize data, specifically comprising the following steps:
Step S2.1, data cleaning, wherein abnormal data in original data are mainly divided into 2 types of repetition and deletion, which causes deviation of a model, a method of combining a moving window with abnormal threshold values of various parameters is adopted, the size of the moving window is set to be n, firstly, all collected parameters are traversed, repeated values existing in the data set are searched for, the repeated values are deleted, secondly, whether the number of abnormal data is smaller than m by comparing the data in n continuous time steps with the corresponding abnormal threshold values, if yes, interpolation is carried out by adopting a Newton polynomial interpolation method, otherwise, other characteristic parameter data containing abnormal data parameters in the same time step are directly deleted, and a Newton interpolation calculation formula is as follows :Nn(x)=f(x0)+f[x0,x1](x-x0)+f[x0,x1,x2](x-x0)(x-x1)+...+f[x0,x1,...,xn](x-x0)(x-x1)…(x-xn-1) (1)
In formulas (1) - (2), (x i,f(xi)) represents normal data of samples in a window N, f [ x 0,x1,...,xn ] represents an N-order difference quotient, for the difference quotient f [ x 0,x1,...,xn ], the sequence of sequence numbers subscript does not affect the value of the difference quotient, x i represents the time coordinate of abnormal data, N n (x) represents an inserted value calculated by newton interpolation, and in actual interpolation, only the result of interpolation N n-1 (x) after the last sampling is needed to be saved, and the sum of N n-1 (x) and a new term is directly calculated next time, so that calculation and storage space are saved, and in the embodiment, n=10, m=2;
Step S2.2, Z-Score data normalization processing, wherein the data normalization can accelerate the gradient descent optimal solution speed during model training, improve model precision, and uniformly map data in intervals [0,1], and the calculation formula is as follows:
In the formula (3), y is a data value, i.e., an initial value before data normalization, Is the average value of the data set, sigma is the standard value, and y' is the corresponding value of data normalization;
Step S3, data screening, namely calculating a Pearson correlation coefficient (Pearson Correlation Coeffient) aiming at the rolling motor rotating speed, rolling motor active power, rolling motor voltage, rolling machine tension, environment temperature and environment humidity of data normalization, screening parameters which are strongly correlated with the rolling motor temperature to participate in subsequent model training, wherein the correlation coefficient is calculated as follows:
In formulas (4) - (9), s represents the number of data sets, n j、ni represents the jth rotating speed and the ith rotating speed in the winding motor rotating speed data set n respectively, P j、Pi represents the jth active power and the ith active power in the winding motor active power data set P respectively, U j、Ui represents the jth voltage and the ith voltage of the winding motor voltage data set U respectively, F j、Fi represents the jth tension and the ith tension of the winding machine tension data set F respectively, AH j、AHi represents the jth environmental temperature and the ith environmental temperature of the environmental temperature data set AH respectively, K j、Ki represents the jth environmental humidity and the ith environmental humidity of the environmental humidity data set K respectively, ρ nT、ρPT、ρUT、ρFT、ρAHT、ρKT represents the pearson correlation coefficient of the motor rotating speed set n and the motor temperature set T respectively, the pearson correlation coefficient of the motor active power set P and the motor temperature set T respectively, the pearson correlation coefficient of the motor voltage set U and the motor temperature set T, the pearson correlation coefficient of the tension set F and the motor temperature set T, the pearson correlation coefficient of the motor temperature set K and the pearson correlation coefficient of the motor temperature set T respectively, and the pearson correlation coefficient of the temperature coefficient of the motor temperature set T and the temperature coefficient of the temperature value of the motor temperature and the pearson temperature set T of the temperature and the pearson-T bearing value of the temperature set T respectively, and the pearson correlation coefficient of the temperature and the temperature value of the temperature set T and T value of the temperature coefficient of the temperature and T is respectively, and the pea:
table 1 analysis of pearson correlation coefficients of parameters and motor bearing temperatures, respectively
| Parameter class |
Correlation coefficient (ρ) |
Level of significance |
| Winding motor rotation speed |
0.912 |
0.000 |
| Active power of winding motor |
0.855 |
0.000 |
| Winding motor voltage |
0.824 |
0.000 |
| Tension of winding machine |
0.645 |
0.000 |
| Ambient humidity |
0.158 |
-0.256 |
| Ambient temperature |
0.769 |
0.000 |
By comparing the correlation coefficients in table 1, the pearson correlation coefficient generally represents strong correlation at [0.6,0.8], the pearson correlation coefficient represents extremely strong correlation at [0.8,1.0], and the correlation strength is lower than 0.6, so that 6 groups of parameters including the rotational speed of the winding motor, the active power of the winding motor, the voltage of the winding motor, the tension of the winding machine, the ambient temperature and the temperature and temperature of the winding motor are selected as the training and testing sample data of the subsequent model, and the selected sample data are integrated into the following matrix expression form:
in the formula (10), Z epsilon R 6×s represents a sample data matrix after 6 groups of historical data are integrated, wherein n is a rolling motor rotating speed set, P is a rolling motor active power set, U is a rolling motor voltage set, F is a rolling motor tension set, K is an environment temperature set, T is a rolling motor temperature set, and s is a data set s-th time step;
S4, dividing a training data set and a test data set, and randomly dividing the preprocessed Z matrix sample data set into a training set and a test set according to conditions, wherein the training set accounts for 80% and is used for training an improved CNN-LSTM model, and the test set accounts for 20% and is used for evaluating the improved CNN-LSTM model;
Step S5, constructing an improved CNN-LSTM network model structure, as shown in FIG. 1, aiming at the problem of insufficient feature extraction capability of a traditional winding motor temperature prediction model, the embodiment introduces a winding motor temperature prediction model based on combination of CNN and LSTM, wherein the network model structure comprises 2 one-dimensional convolution layers, 1 full-connection layers and 2 LSTM layers, the convolution layers realize normalization and nonlinear operation of data through BN layers and an activation function Leaky-ReLU after the convolution layers, so that the model convergence speed is increased, the gradient disappearance problem is solved, deep features affecting winding motor temperature factors are extracted, the extracted deep features are input into LSTM to better predict feature information, and a convolution neural network (Convolutional Neural Network, CNN) generally comprises an input layer, a convolution layer, a pooling layer, a full-connection layer and an output layer. The convolution layer is a core module of the CNN, the parameters of the core module are the weight of the convolution kernel and the offset of each channel, and a mathematical model of convolution operation of the convolution neural network CNN is as follows:
in the formula (11), the amino acid sequence of the compound, Represents the jth output feature map of the mth layer, M m-1 represents the input feature set, M represents the mth layer of the CNN,Representing the convolution kernel used by the m-th layer convolution operation,Representing the bias of the j-th feature map, representing convolution operation, f (·) representing the activation function, in this embodiment, the leak-ReLU activation function is used;
The pooling layer pools the features extracted by the convolution layer to realize dimension reduction of the features and reduce network parameters, prevents model overfitting to a certain extent, adopts maximum pooling, seeks the maximum value of a pooling area to obtain local features, the obtained feature map is more sensitive to texture features, and the maximum pooling operation is expressed as follows for the output X i of a kth filter of the convolution layer in the ith dimension:
In the formula (12), p i (j) is the j-th output of the pooling layer, and w is the width of the pooling core;
As a variant LSTM of the recurrent neural network RNN (Recurrent Neural Network, RNN), a gating unit is introduced to alleviate gradient extinction and gradient explosion problems existing during RNN training, and to improve prediction accuracy, and its internal structure is shown in fig. 2, and is an internal structure of an LSTM neuron at time t, where the current time memory unit C t is a core part of the LSTM neuron, and the gating structure of the network is composed of a forgetting gate, an input gate and an output gate, so as to determine transmission of information to C t, and in one time step, the LSTM neuron obtains values of C t and other state quantities in the unit through a series of calculations, and a specific calculation formula is as follows:
ft=σ(Wf[ht-1,xt]+bf) (13)
it=σ(Wi[ht-1,xt]+bi) (14)
ot=σ(Wo[ht-1,xt]+bo) (15)
h t=ot⊙tanh(Ct) (18), wherein in the formulas (13) - (18), f t、it、ot is the states of an input gate, a forgetting gate and an output gate at the time t respectively, and C t-1 is a memory unit of LSTM at the time t-1; W i、Wf、Wo、WC and b i、bf、bo、bC are respectively input gate, forget gate, output gate, weight and bias of candidate memory, sigma (&) is a sigmoid activation function, and tan h (&) is a hyperbolic tangent function, as indicated by the following, which are multiplied by each element according to bit;
And S6, initializing particle swarm parameters and speed position information, constructing an IPSO-CNN-LSTM model, wherein the flow of the model is shown in figure 3, and the precision, the number of convolution kernels, the number of neurons of a full connection layer and the number of hidden neurons of the LSTM have strong correlation when the temperature of the winding motor is predicted by using the CNN-LSTM. Therefore, the invention optimizes the parameters by adopting an improved Particle Swarm Optimization (PSO) algorithm (the improved PSO algorithm is abbreviated as IPSO) to improve the generalization capability of the model;
PSO is a population intelligent optimization algorithm, global optimal values are obtained through cooperation and information sharing among particles to solve the problems of multiple targets, nonlinearity and multiple variables, wherein each particle is composed of 3 indexes such as speed, position and fitness value, the size of the fitness value represents the advantages and disadvantages of the particle, the value is calculated according to a fitness function, the space dimension N is set, the number m of the particles is X 1、x2、…、xm, the corresponding speed is v 1、v2、…、vm, the position of the jth particle is X j=(xj1,xj2,…,xjN, the speed is v j=(vj1,vj2,…,vjN), the ith particle searches for the local optimal position and marks p i=(pi1,pi2,…,piN), all the particles search for the global optimal position and mark p g=(pg1,pg2,…,pgN), and the position and speed formula of the jth component of the ith particle are updated as follows:
vij(k+1)=ωvij(k))+c1*r1[pij(k)-xij(k)]+c2*r2[pgj(k)-xij(k)] (19)
xij(k+1)=xij(k)+vij(k+1) (20)
In the formulas (19) - (20), k is iteration times, ω is inertia weight, the inertia weight is used for balancing and adjusting the local searching and global searching capabilities of the PSO algorithm, r 1、c2 is a learning factor, the self learning and social learning capabilities of the reaction particles are generally set as 2, and r 1、r2 is a random number distributed in [0,1 ];
Step S7, optimizing the population;
Step S8, optimizing inertia weight and learning factor, wherein the inertia weight and the learning factor in the PSO algorithm are generally set to be constant or linearly reduced, so that the PSO algorithm can be sunk into a local optimal stage too early, and global and local searching capacity is balanced, and therefore, the particle swarm optimization algorithm is improved from the inertia weight and the learning factor;
step S9, updating the speed, the position, the inertia weight and the learning factor of the particles;
S10, inputting parameters into a CNN-LSTM neural network for training;
Step S11, defining a fitness function;
Step S12, calculating the particle fitness to update the optimal position;
step S13, calculating and judging a model, if the maximum iteration times are met, continuing to execute downwards, otherwise, repeating the step S9;
Step S14, obtaining optimal parameters including optimal parameters such as the number of IPSO (Internet protocol security) optimization convolution kernels, the number of neurons, the learning rate, the iteration times, the batch processing size and the like;
s15, inputting the optimal parameters searched by the IPSO algorithm into an IPSO-CNN-LSTM prediction model;
s16, training an IPSO-CNN-LSTM model;
S17, inputting a historical test set evaluation model, and setting various model evaluation index thresholds;
S18, calculating various evaluation indexes of the IPSO-CNN-LSTM model and comparing the evaluation indexes with corresponding threshold values;
Step S19, outputting an optimal IPSO-CNN-LSTM prediction model, and simultaneously adopting a Z-Score standardized inverse normalization method to process a residual error alarm threshold delta;
and S20, counting abnormal frequency grading early warning of the temperature of the heat shrinkage tube winding motor by adopting a sliding window algorithm.
In the step S20, as shown in fig. 4, the process includes the following specific steps:
step S20.1, real-time data acquisition;
Step S20.2, initializing the abnormal frequency of the current temperature in the sliding window, wherein f T =0;
s20.3, inputting relevant parameters of the temperature of the heat shrinkage tube rolling motor in a period of time to be acquired in real time to an optimal IPSO-CNN-LSTM prediction model;
s20.3, inputting relevant parameters of the temperature of the heat shrinkage tube rolling motor in a period of time to be acquired in real time to an optimal IPSO-CNN-LSTM prediction model;
step S20.4, outputting a corresponding predicted temperature set of the heat-shrinkable tube winding motor: meanwhile, calculating the average absolute error between the predicted value and the actual value of the temperature of the heat shrinkage tube winding motor:
S20.5, adopting a Z Score standardized inverse normalization method to respectively treat predicted temperature sets of the heat shrinkage tube rolling motor Absolute error from averageOutputting corresponding T ΔT and average absolute error MAE update;
Step S20.6, if T i is greater than maxT, wherein T i∈TΔT, maxT is an upper temperature limit, and the corresponding temperature limit exceeds a larger threshold, setting various evaluation indexes of the optimal IPSO-CNN-LSTM prediction model by combining the temperature provided by the general comprehensive heat-shrinkable tube winding motor, and jumping to step S20.10, otherwise, continuing to downwards execute step S20.7;
Step S20.7, setting a sliding window length to l=10, and gradually sliding and traversing along the prediction time.
Step S20.8, if MAE update is smaller than residual error alarm threshold delta, adding 1 to the current temperature abnormality frequency in the sliding window to process, namely, f T=fT +1, otherwise, keeping the current temperature abnormality frequency in the sliding window to be the original value, namely, f T=fT +0;
step S20.9, if the current temperature anomaly frequency f T in the sliding window is more than or equal to 6, executing step S20.10, otherwise, jumping to step S20.11;
Step S20.10, a heat shrinkage tube winding machine monitoring early warning system automatically displays primary early warning, namely red early warning, which indicates that a heat shrinkage tube winding motor is in an abnormal state, and sends a command to a winding machine equipment maintenance worker to stop in time for carrying out abnormality treatment;
Step S20.11, if the current temperature abnormality frequency in the sliding window is more than or equal to 2 and less than or equal to T, executing step S20.12, otherwise, jumping to step S20.13;
Step S20.12, a heat shrinkage tube winding machine monitoring and early warning system automatically displays secondary early warning, namely yellow early warning, which indicates that an abnormal phenomenon occurs in a heat shrinkage tube winding motor, sends a command to winding machine equipment maintenance operators to observe the real-time running state of equipment in an equipment operation area, evaluates the running state and then determines whether to take corresponding abnormal treatment measures or not;
And step S20.13, automatically displaying green by a monitoring and early warning system of the shrink tube winding machine to indicate that the equipment temperature is normal, and jumping to step S20.2 to perform grading early warning on the abnormal frequency of the temperature of the heat shrink tube winding motor counted by a sliding window algorithm of the next round.
The step S6 specifically includes the following steps:
step S6.1, initializing IPSO super parameters, and determining initial values of the IPSO parameters, wherein the initial values are shown in a table 2:
TABLE 2 IPSO parameter settings
| IPSO parameters |
Parameter value |
| Population number |
30 |
| Particle dimension |
7 |
| Maximum number of iterations |
50 |
| Initial value of individual learning factor c 1_s |
2.5 |
| Individual learning factor final value c 1_e |
0.5 |
| Initial value of social learning factor c 2_s |
1 |
| Social individual learning factor final value c 2_e |
2.25 |
| Inertial weight omega max |
0.9 |
| Inertial weight omega min |
0.4 |
Step S6.2, initializing the position and the speed of particles, randomly generating a population x i=(n1,m1,m2,m3,α,p,batchsize), wherein n 1 is the number of CNN convolution kernels, m 1、m2 is the number of neurons of 2 LSTM hidden layers, m 3 is the number of neurons of a full-connection layer, alpha is an initialization learning Rate, p is the inactivation Rate (Dropout Rate) of the neurons, and Batch size is the Batch Size (Batch Size), and the values of the parameters are as follows:
n1∈[2,64],m1∈[1,30],m2∈[1,30],m3∈[1,20],α∈[0.001,0.005],p∈[0.01,0.90],batchsize∈[1,50].
In step S7, the initial population is generally generated by using random initialization operation, but the initial population thus obtained has fundamental limitation on the convergence performance of the algorithm due to uneven distribution of individuals, and the initial population can be optimized based on the characteristics of randomness, ergodic performance, regularity and the like of the chaotic map, so that the method of introducing the Circle mapping is selected to initialize the particle population to obtain a more uniform and diversified initial population so as to improve the convergence speed and precision of the algorithm, the Circle mapping is a chaotic map which can be used for generating chaotic numbers between 0 and 1, and the expression of the chaotic sequence generated by the Circle mapping is as follows:
Wherein X i represents the ith chaotic sequence number, X i+1 represents the (i+1) th chaotic sequence number, e=0.5, f=0.2, mod represents a modulo operator, and the population initialization operation using Circle mapping comprises speed initialization and position initialization, and the specific initial operation is as follows:
vi,j=vlower_b+(vup_b-vlower_b)*Xi,j (22)
in the formulas (22) - (23), v lower_b and v up_b are respectively the upper and lower limits of particle speed, X lower_b and X up_b are respectively the upper and lower limits of particle position, and X i,j and X' i,j are respectively chaotic sequence values generated by Circle mapping in the corresponding particle dimension.
The step S8 specifically includes the following steps:
Step S8.1, introducing dynamic nonlinear variation inertial weight, wherein the size of the inertial weight represents the capability of a particle to maintain a motion state at the previous moment, ensuring the global searching capability of a PSO algorithm, but ensuring lower convergence accuracy and slower convergence speed when omega is larger, ensuring the local searching capability of the PSO algorithm, ensuring higher convergence speed but easily sinking into local optimum when omega is smaller, limiting the global searching capability and the convergence speed of the PSO when the inertial weight omega is a fixed value, and selecting the dynamic nonlinear variation inertial weight omega in order to better balance the global searching and the local searching capability of the PSO algorithm in the exploration stage and improve the convergence accuracy, wherein the method comprises the following steps of:
Wherein ω (k) is the inertia weight of the kth iteration, ω max and ω min are respectively the maximum value 0.9 and the minimum value 0.4 of the inertia weight, t max is the maximum iteration number, and k is the iteration number;
Step S8.2, introducing asymmetric learning factors, including an individual learning factor c 1 and a social learning factor c 2, wherein the larger the value of the individual learning factor c 1 is beneficial to complete searching, the larger the value of the social learning factor c 2 is beneficial to partial searching, and the adaptive adjustment of c 1 and c 2 is carried out according to different searching periods, and the specific expression is as follows:
In the formulas (25) - (26), c 1(k)、c2 (k) are the individual learning factor and the social learning factor of the kth iteration respectively, c 1_e、c1_s is the initial value 2.5 and the termination value 0.5 of the individual learning factor respectively, c 2_e、c2_s is the initial value 1 and the termination value 2.25 of the social learning factor respectively, t max is the maximum iteration number, and k is the iteration number.
In the step S11, the optimized initial particles are used as parameters of the CNN-LSTM model, and the mean square error MSE is used as fitness of the IPSO algorithm, specifically as follows:
In formula (27): For the predicted value, y i is the actual value and N is the number of samples.
In the step S12, p i and p g are calculated and determined, and the individual optima and global optima of the population are updated according to the formula (19) and the formula (20).
In the step S17, the evaluation indexes of the mean absolute error MAE threshold MAE th_max, the mean absolute percentage error MAPE threshold MAPE th_max, the root mean square difference RMSE threshold MASE th_max and the decision coefficient R 2 threshold R 2 th_min are introduced to comprehensively evaluate the prediction effect of the IPSO-CNN-LSTM model, and the specific evaluation index thresholds are shown in table 3:
Table 3 IPSO-CNN-LSTM model various evaluation index thresholds
| MAEth_max |
MAPEth_max/% |
RMSEth_max |
R2 th_min |
| 0.5 |
4.5 |
0.5 |
0.9 |
。
The step S18 specifically includes the following steps:
step S18.1, calculating evaluation indexes, namely calculating and evaluating various indexes of the IPSO-CNN-LSTM model, wherein the evaluation indexes are specifically as follows:
In the steps (28) to (31), For the predicted value, y i is the actual value,The average value is N, and the number of samples is N;
Step S18.2, judging a threshold range, and sequentially comparing whether various evaluation indexes of the IPSO-CNN-LSTM model are positioned in the designated threshold range or not, wherein the specific steps are as follows:
If the requirement of the inequality group (32) is met, the prediction accuracy of the IPSO-CNN-LSTM model is higher, the MAE find is recorded as the absolute upper limit of the predicted residual error alarm threshold value when the model training is ended, the downward execution is continued, and otherwise, the operation step S14 is repeated.
In the step S19, a specific calculation formula is as follows:
δ=mae final×σtest+μtest (33), where MAE final is the final mean absolute error MAE of the optimal IPSO-CNN-LSTM prediction model, δ test is the standard deviation of the test set, and μ test is the mean of the test set in equation (33).
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.