With the development of Internet of Things and big data technology, mental health education in colleges and universities has ushered in new opportunities and challenges. This study proposes a way to identify students' mental health problems at an early stage by constructing a decision support system based on data mining technology (such as a decision tree algorithm), and to integrate ideological and political education into this system, so as to promote the formation of mental health and correct values in students. Empirical research shows that this system can significantly improve the early warning capacity of psychological problems and provide a scientific basis for timely intervention. This advancement will not only help to improve the mental health of college students, but will also promote innovation in mental health education and support the all-around development of students.