# Anomaly Monitoring of Process Based on Recurrent Timeliness Rules (AMP-RTR)
## 3 Design of AMP-RTR Model
### Implementation of AMP-RTR Model
#### 3.2.2 Anomaly Monitoring of Process  
Abnormal monitoring shall be conducted for the regularity change of periodic data timeliness. We define two types of monitoring exceptions: the number of records \(R(A)\) reaches the set threshold \(N(A)\) and the updated score is less than 0. The user dynamically adjusts the production line according to the type of abnormal warning. Figure 2: Trend of expected \(\mathit{age}\) and timeliness score of data with \(t\) (\(T=7\)). There are two main reasons for the definition of these two types of asymmetric anomalies: first, the attenuation change of the timeliness evaluation value is not linear, so the iterative update of the timeliness evaluation value is not asymmetric when the deviation before and after the set cycle is the same. Second, the evaluation value of timeliness always declines from the upper limit during the update cycle, and it is not suitable to use exceeding the upper limit as the judgment basis for anomalies. The periodic update rate \(\alpha\) in Formula (3) controls the sensitivity of model anomaly monitoring. Users can adjust the sensitivity requirements of abnormal monitoring according to different production lines. If the periodic update rate \(\alpha\) is set too high, the sensitivity of the monitoring model will be too high (there is a possibility of false alarm). Conversely, if the periodic update rate \(\alpha\) is set too small, the sensitivity of the monitoring model will be too low (unable to meet the needs of monitoring). Those whose updated timeliness score is greater than \(1\) is recorded. When the recorded value \(R(A)\) meets the set threshold \(N(A)\) (its value can be set as shown in Formula (10)), the user shall be warned in time. Accordingly, when the time of data update is later than the set cycle, the initial score value for the next cycle should be equal to the initial score value for this cycle plus the cycle update rate multiplied by the attenuated value \(Q_{decay}(t,\lambda|A)\) (when the data are updated later than the preset cycle, the value should be negative) in the cycle, the user shall be warned in time. The specific implementation flow is shown in Figure 3.  
Formula (3) is the iterative update of the timeliness score value when only one attribute (such as the timeseries of temperature) is considered. When multiple attributes (such as  
Figure 3: Flow chart of abnormal monitoring. temperature, humidity, pressure, flow, etc.) need to be considered, the calculation method of iterative update of timeliness score value is as shown in Formula (7). \[ \begin{bmatrix}f_{n+1}^{1}\\ f_{n+1}^{3}\\ f_{n+1}^{3}\\ \vdots\\ f_{n+1}^{k}\end{bmatrix} = \begin{bmatrix}f_{n}^{1}\\ f_{n}^{2}\\ f_{n}^{3}\\ \vdots\\ f_{n}^{k}\end{bmatrix} +[\alpha_{1},a_{2},\alpha_{3},\ldots,\alpha_{k}]\times \begin{bmatrix}Q(A_{1})\\ Q(A_{2})\\ Q(A_{3})\\ \vdots\\ Q(A_{k})\end{bmatrix}  \tag{7}\]  
When considering the timeseries of multiple attributes, the timeliness score value is iteratively updated by Formula (7). Determine a matrix according to the requirements of different attributes of products on monitoring sensitivity. The higher the sensitivity of an attribute to anomaly monitoring, the greater the value of \(\alpha\). \[f_{min}=\min\left\{f_{n+1}^{1},f_{n+1}^{2},f_{n+1}^{3},\ldots,f_{n+1}^{k} \right\}<0\to Stop \tag{8}\]  
After each iteration update, the smallest score value is selected according to Formula (8), and it is judged whether its value is less than 0. \[(R(A_{1})\geq N(A_{1})\lor R(A_{2})\geq N(A_{2})\vee\ldots\lor R(A_{k})\geq N (A_{k}))\to Stop \tag{9}\]  
As shown in Formulas (8) and (9), there are two cases in which the model iteration ends. First, the value of \(f_{min}\) is less than 0. Second, the number of times that the value of an attribute (\(f_{n+1}\)) is greater than 1 meets the threshold set for that attribute. \(f_{min}\) will be used as the basis for whether to alarm, but its value will not be saved or updated iteratively.