The systematic training of metacognitive strategies in teaching Chinese as a foreign language, cultivating learners’ autonomous learning ability, and improving the effectiveness of teaching Chinese as a foreign language is of great significance for realizing the overall goal of teaching Chinese as a foreign language. Therefore, this paper designs a model based on CDIO to guide the teaching of data structures and algorithms, which emphasizes students’ hands-on ability, advocates learning in use, students’ autonomous learning, and teamwork. Taking massive online open courses(MOOC ) and small private online courses ( SPOC) learning data as a sample, hidden Markov algorithm and data mining technology are used to establish a student learning behavior evaluation model to evaluate students’ learning behavior in real-time. Meanwhile, teachers adjust the teaching content according to the evaluation results and enhance students’ learning performance and improve teaching quality.