Thanks to the advancement of information technology, online learning has become a crucial tool of modern education, and the management of modern education is facing the challenges of how to effectively predict students’ learning needs and how to optimize the management of the knowledge library to support these needs. However, existing data-driven prediction approaches are flawed in handling complex learning environments and timely adapting to changes, so this study attempts to solve these questions by exploring the correlation between learning needs, the extraction of knowledge linkages, and the optimization of knowledge libraries based on rule updates. In our work, a new method was proposed for extracting learning needs and knowledge linkages to more accurately identify and predict students’ learning needs, and a rule-based knowledge library management optimization method was introduced to allow the knowledge library to more flexibly adapt to students’ learning needs and the changes in educational resources. In this way, this study offers a comprehensive and flexible solution for education management via the combination of these two aspects, which not only increases student satisfaction and improves teaching quality but also reduces resource waste and gives students a more personalized and efficient learning experience. Furthermore, the methods and findings of this study could also be used as references for data-driven decision-making in other fields.