PLC trust grading method oriented to control process and data
Through the combination of fuzzy neural networks and lightweight neural networks, the accuracy of PLC trust level prediction is solved, and the operation reliability and maintenance efficiency of PLC equipment are improved.
Patent Information
- Application Number
- CN202510689235.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-08-05
AI Technical Summary
The prior art is difficult to accurately predict the level of trust in PLCs in the face of complex industrial environments, resulting in unplanned downtime and rising maintenance costs.
The fuzzy neural network is adopted as a data-driven model, combined with the lightweight neural network mechanism, and a lightweight fuzzy neural network (LFNN) is designed. Through online training and data cleaning, the prediction speed and accuracy of the PLC trust level are improved.
It realizes rapid and accurate prediction of PLC trust level, reduces the risk of unplanned downtime, and improves the service life and maintenance efficiency of equipment.
Smart Images

Figure CN120428644A_ABST
Abstract
Description
Technical Field
[0001] This paper designs a PLC trust level classification method for control processes and data, enabling intelligent assessment of PLC trust levels during industrial production. Because the PLC trust level is a key indicator for determining whether the PLC is operating properly and directly reflects its operating status and safety, assessing the PLC trust level is crucial for understanding the operational status of PLC devices. Factors such as PLC behavior, network traffic, and data integrity serve as key criteria for assessing device trust levels, providing valuable guidance for predictive maintenance. Background Art
[0002] With the rapid development of industrialization, automation, and artificial intelligence, the level of automation in industrial production processes has gradually increased. With the extensive use of mechanical equipment, higher requirements are placed on the stability and reliability of equipment. Abnormal behavior of PLCs can cause equipment downtime in production processes and even pose serious safety hazards, severely impacting the economic benefits of enterprises, the country, and society. Therefore, understanding and evaluating the trust level of PLCs is crucial to promptly detect PLC equipment failures and implement predictive maintenance to reduce the economic losses caused by unplanned downtime. In this context, data-driven models have become an effective intelligent prediction method due to their advantages, such as simple modeling and the lack of explicit analysis of correlations between features. However, faced with the complex operating environment of equipment, fixed-structure data-driven models struggle to adapt to the influence of large amounts of data with diverse features and scales, which can easily lead to biased prediction results, increased unplanned downtime losses, higher maintenance costs, and potentially reduced equipment lifespan. Therefore, research on the classification of PLC trust levels is of great significance and can provide key support for predictive maintenance of equipment.
[0003] The present invention designs a PLC trust level classification method for control processes and data. It mainly analyzes factors such as the behavior, network traffic, and data integrity during the PLC operation process, and designs a lightweight neural network mechanism. This mechanism can effectively streamline the network model, improve the model's prediction speed, and enhance the timeliness of PLC trust level prediction. Summary of the Invention
[0004] The present invention obtains a PLC trust level classification method for control processes and data. This method uses a fuzzy neural network (FNN) as the main architecture for data-driven model prediction, and trains the FNN online to achieve accurate prediction of the PLC trust level during equipment operation. In addition, by summarizing and analyzing the impact of various types of data during equipment operation, a data cleaning method for different feature data is designed. This method applies knowledge and experience to summarize the impact of different data on the PLC trust level. Finally, a lightweight neural network mechanism is designed. Through this mechanism, the network model can be effectively streamlined, the model's computing speed can be improved, and the model can respond quickly when faced with the impact of events, thereby improving the timeliness of PLC trust level evaluation.
[0005] The present invention adopts the following technical solutions and implementation steps:
[0006] A PLC trust level classification method for control processes and data includes the following steps:
[0007] (1) Configuring the PLC system to collect key data: The present invention mainly performs intelligent prediction on the control process and data of the PLC, determines the PLC equipment operating speed, equipment load, equipment temperature, system login success time, task running time, task stopping time, ambient temperature and ambient humidity, a total of 8 variables as related variables to be classified, and uses the trust level of the equipment as the output variable;
[0008] (2) Design a working condition classification method for the input data set to divide the equipment trust level, and perform continuous division on the imbalanced samples in the data set, specifically:
[0009] ① Get the device operating speed detected by PLC as vector x 10 =[x 11 ,…,x 1n ], the device load is vector x 20 =[x 21 ,…,x 2n ], the device temperature is vector x 30 =[x 31 ,…,x 3n ], the system login success time is vector x 40 =[x 41 ,…,x 4n ], the running task time is vector x 50 =[x 51 ,…,x 5n ], the stop task time is vector x 60 =[x 61 ,…,x 6n ], the ambient temperature is vector x 70=[x 71 ,…,x 7n ], the ambient humidity is vector x 80 =[x 81 ,…,x 8n ], training sample device trust level label Construct the training sample matrix as X=[x 10 ,…,x j0 ,…,x n0 ], x j0 =[x 1j ,…,x ij ,…,x mj ] T , i = 1,…, m, j = 1,…, n, where m and n are the number of relevant variables and the number of samples, respectively, and T represents the transpose of the matrix;
[0010] ②Quantize the training sample X, each sample vector is x j0 , each sample data is x ij , normalize all types of input data and distribute them on (0,1), which represents the credibility score of each type of data; for device speed, device load, and device temperature, the sample quantization formula is
[0011]
[0012] Among them, x ij is the original training sample data, x ij-new 1 is the sample data of the normalized equipment speed, equipment load, and equipment temperature, x e Represents the average value of the original training samples, and its calculation formula is
[0013]
[0014] For the system login success time, task running time and task stopping time, the sample quantification formula is:
[0015]
[0016] Among them, x ij-new 2 is the normalized system login success time, task running time, and task stopping time sample data, μ is the mean value of the training sample, σ is the standard deviation of the training sample, and its calculation formula is:
[0017] μ=x e (4)
[0018]
[0019] For the ambient temperature and humidity when the device is working, the quantitative formula of the sample is:
[0020]
[0021] Among them, x ij-new 3 is the normalized sample data of ambient temperature and humidity when the device is working. a and b represent the maximum and minimum values of ambient temperature or humidity when the system is working normally. α and β are the parameters of the Cauchy distribution, both of which are positive numbers.
[0022] ③ Get the quantized training sample X new =[x 1-new ,…,x j-new ,…,x n-new ], x j =[x 1j-new 1 ,x 2j-new 1 ,x 3j-new 1 ,x 1j-new 2 ,x 2j-new 2 ,x 3j-new 2 ,x 1j-new 3 ,x 2j-new 3 ] T , j = 1,…, n, where n is the number of samples of the relevant variables, and T represents the transpose of the matrix.
[0023] (3) Design a lightweight fuzzy neural network (LFNN). The neural network topology is divided into four layers: input layer, radial basis function (RBF) layer, rule layer, and output layer. Determine the connection mode of the neural network mRR-1, that is, the number of neurons in the input layer is m, the number of neurons in the RBF layer is R, the number of neurons in the rule layer is R, and the number of neurons in the output layer is 1. The network center value, width, and weight are C(t) = [c1(t), c2(t), ..., c i (t),…,c m (t)] T ,
[0024] B(t)=[b1(t),b2(t),…,b i (t),…,b m (t)] T andω(t)=[ω1(t),ω2(t),…,ω j(t),…,ω R (t)] T , where i = 1, 2, ..., m, j = 1,
[0025] 2,…,R,c i (t)=[c i1 (t),c i2 (t),…,c ij (t),…,c iR (t)],b i (t)=[b i1 (t),b i2 (t),…,b ij (t),…,b iR (t)],c ij (t) and b ij (t) represents the center value and width between the i-th output of the input layer and the j-th input of the RBF layer at time t, and the weight ω j (t) represents the weight between the jth neuron in the rule layer and the output layer neuron at time t. During the initialization process of C(t), B(t) and ω(t), the internal elements are all 1; according to steps (1) and (2), the reconstructed sample matrix X is obtained as the network input sample matrix X(t) at time t, X(t) = X new , the corresponding network training output is the trust score γ(t) of the device, and the trust level classification is defined as k f , f=1,2,3,4,5, specifically including:
[0026] Category k1: 0≤γ(t)<25, the device trust level is "very low trust level";
[0027] Category k2: When 25≤γ(t)<50, the device trust level is "low trust level";
[0028] Category k3: 50≤γ(t)<75, the device trust level is "medium trust level";
[0029] Category k4: 75≤γ(t)<90, the device trust level is "high trust level";
[0030] Category k5: When 90≤γ(t)<100, the device trust level is "very high trust level";
[0031] The network topology and calculation method are
[0032] ① Input layer: The input-output relationship of each node i in this layer can be expressed as
[0033] a i (t) = x ij (t) (7)
[0034] Among them, a i (t) represents the output of the i-th neuron in the input layer at time t;
[0035] ② Lightweight RBF layer: Each node j in this layer represents a membership function. Gaussian function is selected as the membership function. The input-output relationship of the jth node can be expressed as
[0036]
[0037] Among them, u ij (t) represents the output of the jth neuron in the RBF layer at time t;
[0038] ③Rule layer: In the rule layer, the input-output relationship of the jth node can be expressed as
[0039]
[0040] in, represents the output of the jth neuron in the regular layer at time t;
[0041] ④ Output layer: The input and output relationship of this layer is
[0042]
[0043] Where γ(t) represents the trust score calculated by the neural network at time t, and y(t) represents the output trust level of the output neuron at time t;
[0044] ⑤Define the loss function as
[0045]
[0046] in, is the actual trust score of the device, C is the number of categories, and D i (t) is the accuracy of the confidence level classification output by the output layer at time t, α and ε are the parameters of the Cauchy distribution, α is a positive number, and ε is a positive even number;
[0047] (4) training the neural network, specifically designing a gradient descent algorithm to update the parameters of the LFNN;
[0048] ① The model input is X(t)=X new , conduct training and design the calculation step L1=1, the maximum number of iterations is 500, the number of RBF layer neurons and the number of regular layer neurons R=25;
[0049] ② t=L1, calculate the output error E(t) of the model according to formulas (6), (7), (8), (9), (10), (11), and (12), and use the gradient descent method to adjust the parameters of the model at time t+1. The update rules for the connection weights of the output layer and the mean and standard deviation of the RBF layer are as follows:
[0050]
[0051] Among them, ω j (t+1), c ij (t+1) and b ij (t+1) are the weights between the regular layer neurons and the output neurons at time t+1, the center value and width of the RBF layer, η, ρ, ζ are the parameter learning rates of the connection layer, the center layer and the width, respectively. is the symbol of partial derivative, They are the correction amounts of the weights between the regular layer neurons and the output neurons, and the correction amounts of the mean and standard deviation of the RBF layer, respectively. The calculation formula is:
[0052]
[0053] Among them, e(t) is the derivative of the loss function E(t) with respect to the output accuracy D(t), and the calculation formula is
[0054]
[0055] ③ The number of learning steps L1 increases by L. If the number of steps is less than the maximum number of iterations, go to step ② to continue training. If the number of steps reaches the total number of samples, stop the calculation;
[0056] (5) Lightweight neural network mechanism, which uses a hidden layer pruning method to delete neurons with low output ratio in the fuzzy neural network to achieve lightweight algorithm;
[0057] ① Complete the initial training of the neural network until convergence according to the neural network training process in step (4);
[0058] ②Quantify the activation contribution of the jth neuron in the RBF layer to the final output:
[0059]
[0060] Among them, ω j (t) represents the connection weight between the jth neuron in the rule layer and the output layer at time t, N is the number of training samples, u ij (t) represents the output of the jth neuron in the RBF layer at time t. The cosine similarity method is used to quantify the similarity between the activation patterns of the jth RBF neuron and the remaining RBF neurons:
[0061]
[0062] Where max(·) represents the maximum value, and the values of nodes j and k are calculated separately, k = 1, 2, …, R. The weighted fusion formula (22) and formula (23) are used to obtain the comprehensive importance score of node j:
[0063] I j =ζS AC,j (t)+(1-ζ)S CU,j (t) (24)
[0064] Among them, ζ∈(0,1) is the importance score fusion weight;
[0065] ③Set dynamic pruning threshold τ
[0066] τ=quantile({I1,I2,...,I R},ρ%) (25)
[0067] Where qunantile(·) is the quantile function used to calculate the threshold τ for the top ρ% of importance scores, ρ is the preset retention ratio, and ρ = 90 means retaining 90% of the nodes;
[0068] ④Reconstruct the RBF layer and rule layer in the network. When the importance score of the kth node is I k When it is lower than the threshold τ, the kth RBF neuron is removed and the number of remaining nodes is reduced from R to R′
[0069] R′=R·ρ% (26)
[0070] ⑤After network reconstruction, the model input is selected as X(t)=X new , and set the calculation step L1 = 1, the maximum number of iterations to 50, the number of neurons in the RBF layer R = R′, and perform retraining as shown in step (4) to fine-tune the reconstructed network;
[0071] ⑥ Repeat steps ②-⑤ until the accuracy of the validation set drops by more than 1% after pruning, then revert to the retained result of the previous pruning and end the pruning process.
[0072] (6) Based on the lightweight fuzzy neural network, the PLC trust level classification is selected, and the input sample matrix z(t) = [z1(t),z2(t),…,z m (t)] T , according to formulas (7), (8), (9) and (10), the output of the model at time t is calculated as y(t).
[0073] The creativity of the present invention is mainly reflected in:
[0074] This invention addresses the uneven scales of input data caused by the diverse distribution characteristics of input data during the PLC trust level classification process. Fixed-structure data-driven models, such as fuzzy neural networks, struggle to capture and adapt to such unevenly scaled input data. The classification results also lack knowledge guidance about operational changes, leading to reduced prediction performance. By designing a lightweight neural network mechanism, the prediction speed of the fuzzy neural network is effectively improved, enhancing the reliability and timeliness of the PLC trust level classification results. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 This is an example of a diagnostic report for PLC trust level assessment according to the present invention;
[0076] Figure 2 This is a comparison between the predicted results of the PLC trust level evaluation and the actual results of the present invention. DETAILED DESCRIPTION
[0077] The present invention designs a PLC trust level classification method for control processes and data. Three types of data, namely, PLC equipment detection data, behavior data, and environmental parameters, are selected as input variables of a prediction model for predicting PLC trust levels, and the PLC trust level is used as the output variable of the prediction model.
[0078] The experimental data comes from the sampling records of PLC operating variables of a sewage treatment plant, including the operation event records of the equipment. The sampling interval is one hour. After screening, 2000 sets of data remain.
[0079] The present invention adopts the following technical solutions and implementation steps:
[0080] A PLC trust level classification method for control processes and data includes the following steps:
[0081] (1) Determine the input variables required for model prediction and the output variables to be predicted: intelligently predict the PLC trust level in the sewage treatment process and collect key data of the PLC system: determine the sewage treatment equipment pump speed, agitator load, motor temperature, aerator operating time, sludge return pump operating time, chemical agent addition time, dissolved oxygen concentration, pH value, a total of 8 variables as related variables to be divided, and use the equipment trust level as the output variable;
[0082] (2) Design a working condition classification method for the input data set to divide the equipment trust level, and perform continuous division on the imbalanced samples in the data set, specifically:
[0083] ① Get the pump speed detected by PLC as vector x 10 =[x 11 ,…,x 1n ], the agitator load is vector x20 =[x 21 ,…,x 2n ], the motor temperature is vector x 30 =[x 31 ,…,x 3n ], the aerator running time is vector x 40 =[x 41 ,…,x 4n ], sludge return pump operating time x 50 =[x 51 ,…,x 5n ], the amount of chemical agent added is vector x 60 =[x 61 ,…,x 6n ], the dissolved oxygen concentration is vector x 70 =[x 71 ,…,x 7n ], pH value is vector x 80 =[x 81 ,…,x 8n ], training sample device trust level label Construct the training sample matrix as X=[x 10 ,…,x j0 ,…,x n0 ], x j0 =[x 1j ,…,x ij ,…,x mj ] T , i = 1,…, m, j = 1,…, n, where m and n are the number of relevant variables and the number of samples, respectively, and T represents the transpose of the matrix;
[0084] ②Quantize the training sample X, each sample vector is x j0 , each sample data is x ij , normalize all types of input data and distribute them on (0,1), which represents the credibility score of each type of data; for pump speed, agitator load, and motor temperature, the sample quantization formula is
[0085]
[0086] Among them, x ij is the original training sample data, x ij-new 1 is the sample data of the normalized equipment pump speed, agitator load, and motor temperature, x e Represents the average value of the original training samples, and its calculation formula is
[0087]
[0088] For the aerator operation time, sludge return pump operation time, and chemical agent addition time, the sample quantification formula is:
[0089]
[0090] Among them, x ij-new 2 is the normalized aerator operation time, sludge return pump operation time, and chemical agent dosage sample data, μ is the mean value of the training sample, and σ is the standard deviation of the training sample. The calculation formula is:
[0091] μ=x e (4)
[0092]
[0093] For dissolved oxygen concentration and pH value, the quantitative formula of the sample is
[0094]
[0095] Among them, x ij-new 3 is the normalized sample data of ambient temperature and humidity when the equipment is working, a and b represent the maximum and minimum values of dissolved oxygen concentration and pH value when the system is working normally, α and β are the parameters of Cauchy distribution, both of which are positive numbers;
[0096] ③ Get the quantized training sample X new =[x 1-new ,…,x j-new ,…,x n-new ], x j =[x 1j-new 1 ,x 2j-new 1 ,x 3j-new 1 ,x 1j-new 2 ,x 2j-new 2 ,x 3j-new 2 ,x 1j-new 3 ,x 2j-new 3 ] T , j = 1,…, n, where n is the number of samples of the relevant variables, and T represents the transpose of the matrix.
[0097] (3) Design a lightweight fuzzy neural network (LFNN). The neural network topology is divided into four layers: input layer, radial basis function (RBF) layer, rule layer, and output layer. Determine the connection mode of the neural network mRR-1, that is, the number of neurons in the input layer is m, the number of neurons in the RBF layer is R, the number of neurons in the rule layer is R, and the number of neurons in the output layer is 1. The network center value, width, and weight are C(t) = [c1(t), c2(t), ..., c i (t),…,c m (t)] T ,B(t)=[b1(t),b2(t),…,b i (t),…,b m (t)] T andω(t)=[ω1(t),ω2(t),…,ω j (t),…,ω R (t)] T , where i = 1, 2, ..., m, j = 1, 2, ..., R, c i (t)=[c i1 (t),c i2 (t),…,c ij (t),…,c iR (t)],b i (t)=[b i1 (t),b i2 (t),…,b ij (t),…,b iR (t)],c ij (t) and b ij (t) represents the center value and width between the i-th output of the input layer and the j-th input of the RBF layer at time t, and the weight ω j (t) represents the weight between the jth neuron in the rule layer and the output layer neuron at time t. During the initialization process of C(t), B(t) and ω(t), the internal elements are all 1; according to steps (1) and (2), the reconstructed sample matrix X is obtained as the network input sample matrix X(t) at time t, X(t) = X new , the corresponding network training output is the trust score γ(t) of the device, and the trust level classification is defined as k f , f=1,2,3,4,5, specifically including:
[0098] Category k1: 0≤γ(t)<25, the device trust level is "very low trust level";
[0099] Category k2: When 25≤γ(t)<50, the device trust level is "low trust level";
[0100] Category k3: 50≤γ(t)<75, the device trust level is "medium trust level";
[0101] Category k4: 75≤γ(t)<90, the device trust level is "high trust level";
[0102] Category k5: When 90≤γ(t)<100, the device trust level is "very high trust level";
[0103] The network topology and calculation method are
[0104] ① Input layer: The input-output relationship of each node i in this layer can be expressed as
[0105] a i (t) = x ij (t) (7)
[0106] Among them, a i (t) represents the output of the i-th neuron in the input layer at time t;
[0107] ② Lightweight RBF layer: Each node j in this layer represents a membership function. Gaussian function is selected as the membership function. The input-output relationship of the jth node can be expressed as
[0108]
[0109] Among them, u ij (t) represents the output of the jth neuron in the RBF layer at time t;
[0110] ③Rule layer: In the rule layer, the input-output relationship of the jth node can be expressed as
[0111]
[0112] in, represents the output of the jth neuron in the regular layer at time t;
[0113] ④ Output layer: The input and output relationship of this layer is
[0114]
[0115] Where γ(t) represents the trust score calculated by the neural network at time t, and y(t) represents the output trust level of the output neuron at time t;
[0116] ⑤Define the loss function as
[0117]
[0118] in, is the actual trust score of the device, C is the number of categories, and D i (t) is the accuracy of the confidence level classification output by the output layer at time t, α and ε are the parameters of the Cauchy distribution, α is a positive number, and ε is a positive even number;
[0119] (6) Training the neural network, specifically designing a gradient descent algorithm to update the parameters of the LFNN;
[0120] ① The model input is X(t)=X new , conduct training and design the calculation step L1=1, the maximum number of iterations is 500, the number of RBF layer neurons and the number of regular layer neurons R=25;
[0121] ② t=L1, calculate the output error E(t) of the model according to formulas (6), (7), (8), (9), (10), (11), and (12), and use the gradient descent method to adjust the parameters of the model at time t+1. The update rules for the connection weights of the output layer and the mean and standard deviation of the RBF layer are as follows:
[0122]
[0123] Among them, ω j (t+1), c ij (t+1) and b ij (t+1) are the weights between the regular layer neurons and the output neurons at time t+1, the center value and width of the RBF layer, η, ρ, ζ are the parameter learning rates of the connection layer, the center layer and the width, respectively. is the symbol of partial derivative, They are the correction amounts of the weights between the regular layer neurons and the output neurons, and the correction amounts of the mean and standard deviation of the RBF layer, respectively. The calculation formula is:
[0124]
[0125]
[0126] Among them, e(t) is the derivative of the loss function E(t) with respect to the output accuracy D(t), and the calculation formula is
[0127]
[0128] ③ The number of learning steps L1 increases by L. If the number of steps is less than the maximum number of iterations, go to step ② to continue training. If the number of steps reaches the total number of samples, stop the calculation;
[0129] (7) Lightweight neural network mechanism, using a hidden layer pruning method to delete neurons with low output ratio in the fuzzy neural network to achieve lightweight algorithm;
[0130] ① Complete the initial training of the neural network until convergence according to the neural network training process in step (4);
[0131] ②Quantify the activation contribution of the jth neuron in the RBF layer to the final output:
[0132]
[0133] Among them, ω j (t) represents the connection weight between the jth neuron in the rule layer and the output layer at time t, N is the number of training samples, u ij (t) represents the output of the jth neuron in the RBF layer at time t. The cosine similarity method is used to quantify the similarity between the activation patterns of the jth RBF neuron and the remaining RBF neurons:
[0134]
[0135] Where max(·) represents the maximum value, and the values of nodes j and k are calculated separately, k = 1, 2, …, R. The weighted fusion formula (22) and formula (23) are used to obtain the comprehensive importance score of node j:
[0136] I j =ζS AC,j (t)+(1-ζ)S CU,j (t)(24)
[0137] Among them, ζ∈(0,1) is the importance score fusion weight;
[0138] ③Set dynamic pruning threshold τ
[0139] τ=quantile({I1,I2,...,I R},ρ%)(25)
[0140] Where qunantile(·) is the quantile function used to calculate the threshold τ for the top ρ% of importance scores, ρ is the preset retention ratio, and ρ = 90 means retaining 90% of the nodes;
[0141] ④Reconstruct the RBF layer and rule layer in the network. When the importance score of the kth node is I k When it is lower than the threshold τ, the kth RBF neuron is removed and the number of remaining nodes is reduced from R to R′
[0142] R′=R·ρ% (26)
[0143] ⑤After network reconstruction, the model input is selected as X(t)=X new , and set the calculation step L1 = 1, the maximum number of iterations to 50, the number of neurons in the RBF layer R = R′, and perform retraining as shown in step (4) to fine-tune the reconstructed network;
[0144] ⑥ Repeat steps ②-⑤ until the accuracy of the validation set drops by more than 1% after pruning, then revert to the retained result of the previous pruning and end the pruning process.
[0145] (6) Based on the lightweight fuzzy neural network, the PLC trust level classification is selected, and the input sample matrix z(t) = [z1(t),z2(t),…,z m (t)] T , according to formulas (7), (8), (9) and (10), the output of the model at time t is calculated as y(t).
[0146] (7) Based on the model output y(t), the following maintenance recommendations are given for the machine:
[0147] ① When the model output y(t) is "very low confidence level", the risk of equipment failure is extremely high and immediate shutdown and maintenance are required;
[0148] ② When the model output y(t) is "low confidence level", the equipment performance has significantly decreased and maintenance is recommended;
[0149] ③ When the model output y(t) is "medium confidence level", there is a problem with the device operation and regular monitoring is required;
[0150] ④ When the model output y(t) is "high confidence level", the equipment is operating efficiently and it is recommended to maintain the current state;
[0151] ⑤ When the model output y(t) is “very high confidence level”, the device is in the optimal working state.
Claims
1. A PLC trust level classification method for control processes and data, characterized in that: The following steps are involved: (1) Configure the PLC system to collect key data: perform intelligent prediction on the PLC-oriented control process and data, determine the PLC equipment operating speed, equipment load, equipment temperature, system login success time, task running time, task stopping time, ambient temperature and ambient humidity, a total of 8 variables as the relevant variables to be classified, and use the equipment trust level as the output variable; (2) Design a working condition classification method for the input data set to divide the equipment trust level, and perform continuous division on the imbalanced samples in the data set, specifically: ① Get the device operating speed detected by PLC as vector x 10 =[x 11 ,…,x 1n ], the device load is vector x 20 =[x 21 ,…,x 2n ], the device temperature is vector x 30 =[x 31 ,…,x 3n ], the system login success time is vector x 40 =[x 41 ,…,x 4n ], the running task time is vector x 50 =[x 51 ,…,x 5n ], the stop task time is vector x 60 =[x 61 ,…,x 6n ], the ambient temperature is vector x 70 =[x 71 ,…,x 7n ], the ambient humidity is vector x 80 =[x 81 ,…,x 8n ], training sample device trust level label Construct the training sample matrix as X=[x 10 ,…,x j0 ,…,x n0 ], x j0 =[x 1j ,…,x ij ,…,x mj ] T , i = 1,…, m, j = 1,…, n, where m and n are the number of relevant variables and the number of samples, respectively, and T represents the transpose of the matrix; ②Quantize the training sample X, each sample vector is x j0 , each sample data is x ij , normalize all types of input data and distribute them on (0,1), which represents the credibility score of each type of data; For device operating speed, device load, and device temperature, the sample quantization formula is: Among them, x ij is the original training sample data, x ij-new 1 is the sample data of the normalized equipment speed, equipment load, and equipment temperature, x e Represents the average value of the original training samples, and its calculation formula is For the system login success time, task running time and task stopping time, the sample quantification formula is: Among them, x ij-new 2 is the normalized system login success time, task running time, and task stopping time sample data, μ is the mean value of the training sample, σ is the standard deviation of the training sample, and its calculation formula is: μ=x e (4) For the ambient temperature and humidity when the device is working, the quantitative formula of the sample is: Among them, x ij-new 3 is the normalized sample data of ambient temperature and humidity when the device is working. a and b represent the maximum and minimum values of ambient temperature or humidity when the system is working normally. α and β are the parameters of the Cauchy distribution, both of which are positive numbers. ③ Get the quantized training sample X new =[x 1-new ,…,x j-new ,…,x n-new ], x j =[x 1j-new 1 ,x 2j-new 1 ,x 3j-new 1 ,x 1j-new 2 ,x 2j-new 2 ,x 3j-new 2 ,x 1j-new 3 ,x 2j-new 3 ] T , j = 1,…, n, where n is the number of samples of the relevant variable and T represents the transpose of the matrix; (3) Design a lightweight fuzzy neural network (LFNN). The neural network topology is divided into four layers: input layer, radial basis function (RBF) layer, rule layer, and output layer. Determine the connection mode of the neural network mRR-1, that is, the number of neurons in the input layer is m, the number of neurons in the RBF layer is R, the number of neurons in the rule layer is R, and the number of neurons in the output layer is 1. The network center value, width, and weight are C(t) = [c1(t), c2(t), ..., c i (t),…,c m (t)] T ,B(t)=[b1(t),b2(t),…,b i (t),…,b m (t)] T andω(t)=[ω1(t),ω2(t),…,ω j (t),…,ω R (t)] T , where i = 1, 2, ..., m, j = 1, 2, ..., R, c i (t)=[c i1 (t),c i2 (t),…,c ij (t),…,c iR (t)],b i (t)=[b i1 (t),b i2 (t),…,b ij (t),…,b iR (t)],c ij (t) and b ij (t) represents the center value and width between the i-th output of the input layer and the j-th input of the RBF layer at time t, and the weight ω j (t) represents the weight between the jth neuron in the rule layer and the output layer neuron at time t. During the initialization process of C(t), B(t) and ω(t), the internal elements are all 1; according to steps (1) and (2), the reconstructed sample matrix X is obtained as the network input sample matrix X(t) at time t, X(t) = X new , the corresponding network training output is the trust score γ(t) of the device, and the trust level classification is defined as k f , f=1,2,3,4,5, specifically including: Category k1: 0≤γ(t)<25, the device trust level is "very low trust level"; Category k2: When 25≤γ(t)<50, the device trust level is "low trust level"; Category k3: 50≤γ(t)<75, the device trust level is "medium trust level"; Category k4: 75≤γ(t)<90, the device trust level is "high trust level"; Category k5: When 90≤γ(t)<100, the device trust level is "very high trust level"; The network topology and calculation method are ① Input layer: The input-output relationship of each node i in this layer can be expressed as a i (t)=x ij (t) (7) Among them, a i (t) represents the output of the i-th neuron in the input layer at time t; ② Lightweight RBF layer: Each node j in this layer represents a membership function. Gaussian function is selected as the membership function. The input-output relationship of the jth node can be expressed as Among them, u ij (t) represents the output of the jth neuron in the RBF layer at time t; ③Rule layer: In the rule layer, the input-output relationship of the jth node can be expressed as in, represents the output of the jth neuron in the regular layer at time t; ④ Output layer: The input and output relationship of this layer is Where γ(t) represents the trust score calculated by the neural network at time t, and y(t) represents the output trust level of the output neuron at time t; ⑤Define the loss function as in, is the actual trust score of the device, C is the number of categories, and D i (t) is the accuracy of the confidence level classification output by the output layer at time t, α and ε are the parameters of the Cauchy distribution, α is a positive number, and ε is a positive even number; (4) training the neural network, specifically designing a gradient descent algorithm to update the parameters of the LFNN; ① The model input is X(t)=X new , conduct training and design the calculation step L1=1, the maximum number of iterations is 500, the number of RBF layer neurons and the number of regular layer neurons R=25; ② t=L1, calculate the output error E(t) of the model according to formulas (6), (7), (8), (9), (10), (11), and (12), and use the gradient descent method to adjust the parameters of the model at time t+1. The update rules for the connection weights of the output layer and the mean and standard deviation of the RBF layer are as follows: Among them, ω j (t+1), c ij (t+1) and b ij (t+1) are the weights between the regular layer neurons and the output neurons at time t+1, the center value and width of the RBF layer, η, ρ, ζ are the parameter learning rates of the connection layer, the center layer and the width, respectively. is the symbol of partial derivative, They are the correction amounts of the weights between the regular layer neurons and the output neurons, and the correction amounts of the mean and standard deviation of the RBF layer, respectively. The calculation formula is: Among them, e(t) is the derivative of the loss function E(t) with respect to the output accuracy D(t), and the calculation formula is ③ The number of learning steps L1 increases by L. If the number of steps is less than the maximum number of iterations, go to step ② to continue training. If the number of steps reaches the total number of samples, stop the calculation; (5) Lightweight neural network mechanism, which uses a hidden layer pruning method to delete neurons with low output ratio in the fuzzy neural network to achieve lightweight algorithm; ① Complete the initial training of the neural network until convergence according to the neural network training process in step (4); ②Quantify the activation contribution of the jth neuron in the RBF layer to the final output: Among them, ω j (t) represents the connection weight between the jth neuron in the rule layer and the output layer at time t, N is the number of training samples, u ij (t) represents the output of the jth neuron in the RBF layer at time t. The cosine similarity method is used to quantify the similarity between the activation patterns of the jth RBF neuron and the remaining RBF neurons: Where max(·) represents the maximum value, and the values of nodes j and k are calculated separately, k = 1, 2, …, R; the weighted fusion formula (22) and formula (23) are used to obtain the comprehensive importance score of node j: I j =ζS AC,j (t)+(1-ζ)S CU,j (t) (24) Among them, ζ∈(0,1) is the importance score fusion weight; ③Set dynamic pruning threshold τ τ=quantile({I1,I2,...,I R },ρ%) (25) Where qunantile(·) is the quantile function used to calculate the threshold τ for the top ρ% of importance scores, ρ is the preset retention ratio, and ρ = 90 means retaining 90% of the nodes; ④Reconstruct the RBF layer and rule layer in the network. When the importance score of the kth node is I k When it is lower than the threshold τ, the kth RBF neuron is removed and the number of remaining nodes is reduced from R to R′ R′=R·ρ% (26) ⑤After network reconstruction, the model input is selected as X(t)=X new , and set the calculation step L1 = 1, the maximum number of iterations to 50, the number of neurons in the RBF layer R = R′, and perform retraining as shown in step (4) to fine-tune the reconstructed network; ⑥ Repeat steps ②-⑤ until the accuracy of the validation set drops by more than 1% after pruning, then revert to the retained result of the previous pruning and end the pruning process; (6) Based on the lightweight fuzzy neural network, the PLC trust level classification is selected, and the input sample matrix z(t) = [z1(t),z2(t),…,z m (t)] T , according to formulas (7), (8), (9) and (10), the output of the model at time t is calculated as y(t).
Citation Information
Cited By
PLC closed-loop trusted operation method and system based on state awareness and dynamic strategy
CN121411307A