To improve the teaching effect of western music history, the curriculum reform of history education needs to be promoted under the background of the Internet of Things (IoT). At first, a discussion is made on the characteristics of history course, which is combined with the characteristics of teaching data easy to collect under the background of IoT. An analysis is conducted on the related theory of educational data mining. Then, the concept of personalized recommendation is proposed based on deep learning (DL) algorithm. Finally, online and offline experiments are designed to verify the performance of the algorithm from review and investigation, smoothness, and participation of difficulty. The research results show that in terms of offline recommendation accuracy, the average record length in Math data set is 24.5, which is much smaller than that in range data set. The research has obvious innovation significance compared with other studies. In the process of target review and investigation, it is found that the research method here involves a wider range of knowledge and higher reliability. In terms of the difficulty of recommending questions, the Deep Reinforcement Exercise (DRE) recommendation algorithm can adaptively adjust the difficulty of recommending questions. It also allows students to set different learning goals through participation goals. But in the experiments on Math data set, Step 10’s recommendation results are not very good, and the difficulty level varies greatly. If the goal setting is high, the problem recommended to students is too difficult, students may answer these questions wrongly, forcing the algorithm to adjust the difficulty adaptively. According to the above results, DRE recommendation algorithm can adapt to different learning needs and customize the recommendation results, thus opening up a new path for the teaching of western music history. Besides, the combination of DL algorithm and western music history teaching design can recommend learning materials, which is of great significance in the teaching of history courses.