Measurement while drilling is an important part of the intelligent development of coal mines and the development trend of roof formation detection. The main purpose of this paper is to study the best identification method of rock interface and category based on drilling parameters. Firstly, the borehole drilling device was independently developed; Secondly, 4 concrete blocks were poured to simulate the different rock formations; Thirdly, displacement, rotational speed, torque, and sound pressure level data were collected during drilling the concrete blocks, and the original data was processed by the local linear kernel estimation method; Finally, K-means clustering and change points detection method, was used to identify the rock formation interface respectively, and BP neural network and support vector machine method was used to identify the rock category respectively. Experimental results show that the local linear kernel estimation method based on exponentially weighted loss function can better reflect the response characteristics of drilling parameters. The change point detection method based on the penetration rate is better for the rock interface prediction (the sum of the two interface errors is 10.25 mm). Besides, with the penetration rate and sound pressure level as input parameters, BP neural network and support vector machine can achieve the operational classification of rock formations. This research is of great significance for understanding the prediction of the interface and category of rock formation in coal mines, which can not only promote safe mining but also reflect efficient coal production.