## 4 Similarity Measurement Model and Clustering Model
### SBD Algorithm with Constrained Time Window Fusing Volatility  
The application of the SBD algorithm with a constrained time window (CSBD) [44] in time series clustering analysis aims to improve the clustering accuracy by improving the similarity measurement method. Compared with the traditional SBD algorithm, this algorithm introduces the constrained time window technology to capture the shape similarity of time series more flexibly at different time scales, thereby improving the accuracy and reliability of the clustering results.  
Volatility was initially introduced as a concept to measure the fluctuation of financial markets or asset prices and is usually used for the classification of financial timeseries [45]. Since vibration data has similar characteristics to financial time series, this paper proposes a method to calculate the volatility of vibration waveform sequences and combines the SBD algorithm to propose the SBD algorithm fusing volatility to improve the classification accuracy.  
Our definition of volatility is shown in Equation (2):  
\[vol=\log\left((co\times|sk|\times(aqr-iqr))+1\right) \tag{2}\]  
Here, \(co\) represents the coefficient of variation, which is used to reflect the degree of dispersion of the variable; \(sk\) represents the kurtosis, which is an indicator used to describe the sharpness or tail thickness of the data distribution; \(aqr\) represents the range of the data; and \(iqr\) represents the interquartile range of the data. The calculation of \(co\) and \(sk\) is as follows:  
\[co=\frac{avg}{vr} \tag{3}\]  
Here, \(vr\) represents the variance of the data, and \(avg\) represents the average value of the data.  
\[sk=\frac{E[(X-\mu)^{4}]}{E[(X-\mu)^{2}]^{2}} \tag{4}\]  
Here, \(E\) represents the expected value; \(\mu\) represents the mean value of the variable.  
The core idea of this algorithm is that by defining an appropriate size of the constrained time window, the algorithm can perform local similarity measurement on different parts of the time series and then comprehensively evaluate the overall shape similarity. This method allows the algorithm to capture short-term fluctuations and long-term trends in the time series and provides a more fine-grained similarity comparison method for time series with different characteristics.  
During the operation, the original time series data is first preprocessed with data fusing volatility, and then the algorithm is initialized by selecting an appropriate size of the constrained time window. This step is crucial for capturing the key shape features of the time series. Subsequently, the algorithm sets a constrained time window on each time series, calculates the shape similarity of the data within the window, and integrates these local similarity measurements into a global similarity measurement. In this way, the SBD algorithm with a constrained time window can more accurately reflect the similarity between time series.  
In the clustering stage, this algorithm uses the calculated global similarity measurement matrix and adopts the k-medoids method to assign time series to each cluster according to the shape similarity. This clustering strategy that combines the constrained time window technology and shape similarity not only improves the flexibility and adaptability of the time series clustering task but also enhances the interpretability and practicality of the clustering results. To ensure the accuracy and reliability of the clustering effect, the algorithm further adopts three indicators, namely the Silhouette Coefficient (SC), the Rand Index (RI), Adjusted Rand Index (ARI), and the Normalized Mutual Information (NMI), to comprehensively evaluate the clustering results. This comprehensive evaluation mechanism ensures the quality of the clustering results, enabling the algorithm to provide more accurate and meaningful clustering solutions when dealing with complex time series data. The CSBD-Vol algorithm is shown in Algorithm A1. The pseudocode of Algorithm A1 is provided in Appendix A.