## 2 Detection Method of Microseisms in Coal Mines
### Extraction of Temporal and Spatial Characteristics of Coal Mine Microseisms Based on Markov Chain
#### 2.1.2 Continuous Attribute Discretization Processing of Coal Mine Data  
Since the Markov chain can only model random variables with discrete states, it is necessary to discretize the real-time coal mine data in the spatiotemporal sliding window [13] before building the sensor data Markov chain to map the data to different state spaces. This paper proposes a continuous attribute discretization algorithm based on entropy to discretize the coal mine data. The specific method is as follows.  
With the \(n\) coal mine dataset with continuous attributes \(M\) for any continuous attribute of the coal mine data, the maximum number of intervals is the number of samples \(k\), that is an interval has at least one sample value. To discretize the continuous attribute of the coal mine data, divide the value range of the continuous attribute of the coal mine data into several intervals and convert the continuous sample value into less than several \(k\) discrete values. Therefore, the key to discretization algorithm is to reasonably determine the number and location of coal mine data to divide the points.  
For discrete random variables \(A\), the entropy is defined as follows:  
\[H(A)=-\sum_{a\in A}p(a)\log_{2}p(a) \tag{1}\]  
In the above formula, \(p(a)\) is the probability function of the discrete value of coal mine \(a\).  
Assume interval \(k\)'s minimum value can reach 1, that is all values are combined into an interval. The following formula can be obtained:  
\[C_{k}=k_{\max}F(k)-H(A)(k-1)F(k_{\max}) \tag{2}\]  
Figure 1: Spatiotemporal sliding window of coal mine data.  
Among them, \(C_{k}\) is the number of intervals' balance threshold, \(k_{\max}\) is the maximum number of intervals, and \(F(A)\) is a concave function. The number of intervals \(k\) can be consolidated to effectively reduce the entropy \(F(k)\), but ultimately, it needs to reach a minimum entropy value and the optimal number of interval \(k\)'s balance; \(F(k_{\max})\) is the entropy value at the maximum interval number. When \(C_{k}>C_{k-1}\), stop interval consolidation. At this point, \(k\) is the optimal interval number. On this basis, this paper applies the entropy-based discretization method to the Hadoop platform. Through the self-merging of continuous attribute values, the merging point with the smallest entropy difference before and after merging is found as the best merging point; then, use Equation (2) as the stop condition of the algorithm. The specific algorithm can be simply described as follows:  
Input: Coal mine dataset with multiple continuous attributes \(M\).  
Exporting: Coal datasets \(M\)'s consolidated state set on each attribute of the.  
Step:  
Discretization processing for coal mine dataset \(M\) with multiple continuous attributes:  
1. Calculate initial state entropy \(F(k_{\max})\);
2. Make \(M\)'s attribute \(A\) perform and ascending arrangement, and then, select two adjacent intervals from the ordered sequence to merge;
3. Calculate the entropy value after merging every two adjacent intervals one by one \(F(k-1)\); connect it with \(F(k_{\max})\) to make a difference; select the merge interval with the smallest entropy difference as the best merge interval;
4. Calculate Formula (2) to compare the size of \(C_{k}\) and \(C_{k-1}\); if \(C_{k}<C_{k-1}\), the merged continuous attributes will be \(A^{\prime}\), and repeat Steps (2) and (3); otherwise, the algorithm stops, and all discrete point sets are output. Complete the discretization of the real-time coal mine data in the spatiotemporal sliding window.