With the rapid development of internet technology, the amount of data generated is also increasing day by day. As a kind of distributed computing, cloud computing has been widely used in the analysis of massive data. With the development of China’s economic construction, the integration of urban and rural areas is constantly improving, and the migrant children in the city are also focused on. After moving into the city, migrant children not only face the pressure from the society but also face the pressure from life, which inevitably affects the physical and mental health of urban migrant children. The education of urban migrant children is also a focus that needs attention. How to integrate into the education environment of urbanization and adjust the learning pressure in the process of education is also worthy of our attention. Therefore, this article analyzes the current status of urban migrant children’s mental health based on cloud computing and data mining algorithm models. Based on the current research status of urban migrant children and the standards of mental health, this paper conducts a survey of middle and high school students in a certain city through questionnaires, then builds a data mining algorithm model to analyze the survey data, and explores the differences in the grades of students’ social identity and the differences in mental health between migrant children and urban children. According to the survey, most of the psychological performances of urban migrant children are very vague. At the same time, there are also some phenomena such as poor adaptability, bad mood, and inferiority complex. During the study period, there are situations such as unwilling to communicate with others, weariness, sensitivity, anxiety, and hostility. The overall incidence of the situation is relatively high in big cities, while the situation of urban children is relatively small.