For children with autism, music therapy has aroused great concern with its novelty and better influence. Music therapy, as one of the effective treatment methods, has an important influence on the social interaction, behavior, and emotion of autistic children. This study attempts to explore a form of applying highly specialized impromptu music therapy to the personal treatment of autistic children in schools for the disabled, as well as the design method of specific music activities. Based on music data mining, the machine learning method is introduced to model music emotion features, and various algorithms are compared to find a model with higher recognition rate, and, at the same time, the antinoise ability and generalization ability of the model are further improved. Finally, a music emotion cognitive model with better performance is established. The results show that the model can effectively promote the overall development of autistic children’s cognitive movement, social communication, language communication, and cognition.