In the current higher education environment, the traditional “one-size-fits-all” mode of ideological and political education is difficult to meet the diversified development needs of students. Students in higher education have significant individual differences and diversified ideological concepts, and traditional education lacks pertinence and effectiveness. This study builds a personalized teaching strategy system for ideological and political education in colleges and universities based on big data, and realizes accurate student profiling and classified policy through student information modeling, similarity comparison and K-means clustering analysis. The study collects 5,712 data on the performance of 408 students in the class of 2020 in a college of a provincial university over the past four years, and establishes an index system covering seven dimensions: academics, work, ideology and politics, economy, development, employment, and psychology. The 64 students were divided into five clusters by K-means cluster analysis, and independent samples t-test was used to verify the teaching effect. The results show that: the p-value of students in the experimental class in the six dimensions of healthy life, ecological civilization, patriotism, scientific spirit, social responsibility, civic literacy is 0.000, and the level of ideological and political awareness is significantly higher than that before the practice; the difference between the average score of the experimental class and the control class in terms of interest in learning Civics and Politics course is 8.92 points, and the difference is statistically significant; the profile coefficient converges most closely to 1 when the K-value is 5, and the clustering effect is the best. The study shows that the personalized teaching strategy based on accurate portrait can effectively enhance students’ ideological and political awareness and learning interest, and provides a new practice path for the Civic and Political Education in colleges and universities.