# Intelligent Stuck Pipe Type Recognition Using Digital Twins and Knowledge Graph Model
## Materials and Methods
### Recognition of Sticking Rules Based on SAX Morphology Aggregation Method
#### 2.2.2 Curve Recognition Based on SAX Morphological Aggregation Approximation  
In the literature on sticking types, there are variation trends for describing various parameters at the moment of sticking (such as gradual rising, gradual lowering, sudden rising, and sudden lowering), but the specific quantification fails. The SAX method is used to identify curve rules from the aspect of morphology and mean value to improve the identification accuracy, with monitoring by the moving window in this article. The quantity of logging parameters monitored and parameters calculated each time reaches 100. Move to the next window to continue monitoring after the analysis is completed. After Z-Score standardization of 100 data, the average of the Z values of 100 points will be obtained to obtain the mean characteristics of every five segments in the 20 points. The normal distribution probability density function is calculated. The calculation formula is as follows:  
\[\mathrm{f(x)}=\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(x-y)^{2}}{2\sigma^{2}}} \tag{19}\]  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  
The integration is conducted. The calculation formula is as follows:  
\[I=\int_{-\infty}^{+\infty}\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(x-y)^{2}}{2\sigma ^{2}}}dx \tag{20}\]  
The mean of u is 0 and the variance is in the formula. The probability integral results are divided into six equal parts to obtain six equally divided probability intervals: [\(-3\), \(-0.962\)], [\(-0.962\), \(-0.427\)], [\(-0.427\), 0], [\(0\), \(0.427\)], [\(0.427\), \(0.962\)], and [\(0.962\), \(3\)]. \(\sigma\). The corresponding aggregation symbols cover a, b, c, c, d, and e.  
As for the slope aggregation method, the Z values of 20 points are subject to curve fitting pursuant to the least square method to obtain the slope of every 5 segments in 100 points (namely curve morphological characteristics) after Z-Score standardization of 100 data. The slope calculation formula is as follows:  
\[\overline{q_{i}}=k\times\sum_{j=j_{0}}^{k\times i}j\times q_{j}-((\sum_{j=j_{0 }}^{k\times i}j)(\sum_{j=j_{0}}^{k\times i}q_{j})/k)\times\sum_{j=j_{0}}^{k \times i}j\times j-(\sum_{j=j_{0}}^{k\times i}j)^{2} \tag{21}\]  
In the formula, k is the number of original data points observed. There five 5 sections and i refers to the time sequence number (i = 1, 2, 3, 4, 5). Because the quantity of observed data is 100 (20 in a group), there are five time sequences. J is the serial number of the observation point, with j0 = k (I \(-\) 1) + 1 which refers to the aggregated slope value of the ith time sequence. Qj refers to original data value of observation, including calculation and monitoring parameters and logging while drilling parameters, \(\overline{q_{i}}\). To symbolize the slope, it is necessary to convert the slope domain to the mean domain, namely multiplying the slope by the time sequence span and multiplying the interval of S94 by 2 to obtain the interval value: [\(-6\), \(-1.924\)], [\(-1.924\), \(-0.854\)], [\(-0.854\), 0], [\(0\), \(0.854\)], [\(0.854\), \(1.924\)], and [\(1.924\), \(6\)]. The corresponding aggregation symbols cover a, b, c, c, d, and e.  
The polymerization approximation symbolization is used to represent the results and five given time series (slow increase, continuous increase, slow decrease, continuous decrease, and continuous stability) for the calculation of similarity measure. According to the calculation result, the change trend of logging while drilling data and calculation and monitoring parameters in the moving window is judged.