The characteristics of educational information, such as quantization, decentralization, redundancy and unstructuredness, bring complex and multi-level problems to the construction of high-quality educational resources in colleges and universities. The study constructs a model for the optimal allocation of educational resources in colleges and universities using a collaborative filtering algorithm. Taking big data as the background, the existing educational resources allocation ratio of colleges and universities is analyzed, and the current demand for resources in colleges and universities is predicted through the cosine similarity algorithm and the Pearson similarity algorithm, and the recommended resource items are derived and recommended. The study takes the university district of city Z as an example and uses the model in this paper to optimize the allocation of teaching and auxiliary room area, sports hall area, number of books, number of computers, and value of teaching instruments and equipment. After using the optimal allocation model to optimize the educational resources of colleges and universities, the pass rate of students’ exams increased to more than 70%, and the students were more satisfied with the subjective evaluation of the model. This paper’s model plays a significant role in the optimal allocation of educational resources, and colleges and universities can effectively utilize and reference it.