Since the reform and opening, China’s economy has grown rapidly, and people’s living standards have improved significantly. As one of the most effective ways to implement national fitness, square dance has gradually become the main lifestyle of urban communities, an important part of China’s sports construction, and an important indicator to reflect the fitness of the masses and the construction of a well-off society in an all-round way. On the other hand, with the rapid development of internet of things technology, many people can use intelligent bracelets based on machine learning technology to realize motion detection. This technology is also applicable in square dance, which is of great significance to exercise and protect health. This paper first reviews the research status of the internet of things communication protocol and cloud platform, then introduces and analyzes the MQTT communication protocol and Netty high-performance network framework, and studies the integration technology of the internet of things and machine learning. Then, according to the characteristics of the internet of things, a scheme to realize data preprocessing is proposed. The value to be completed is calculated based on the correlation of other attributes corresponding to the k-nearest neighbor model (KNN) and the regression model. Finally, the machine learning algorithm is used to train the results of the three models to obtain the final filling value. The whole scheme design allows the machine learning algorithm to obtain relatively high-quality data in the internal environment. This paper designs a sports monitoring data system for square dance by combining machine learning and internet of things technology, so as to promote national fitness.