In this paper, we use random forest feature extraction to classify and rank the importance of the behavioral features in the student behavior dataset and obtain the behavioral features with top importance. In the knowledge tracking model, the multidimensional feature strategy is integrated, and the attention weight is introduced in the prediction stage, respectively, so as to predict the results of students’ spatiotemporal behavioral prediction behavioral prediction. The results show that the dormitory area activity has the highest percentage of 30.27%, followed by the teaching area and dining hall area activities. Rest > Study > Eat reflects the regularity of students’ behavior. Behaviors vary at different times of the day. From 0:00 to 7:00, most behaviors are related to rest, while from 8:00 to 11:00, behaviors related to class and eating are predominant. Attending classes abnormally only happened in the second week (3%) and the third week (5%). In the prediction of consumption behavior, the sixth type of students, the average monthly consumption is shallow (541.34) and less frequent (249), and teachers should pay more attention to the life of these students and intervene in the education of mental and physical health.