Abstract In this paper, after using PSO algorithm to encode the information on innovation and entrepreneurship education resources in universities, N particle is randomly generated to form the initial population, and it is also necessary to continuously update the particles to carry out the adjustment of the initial population size. The mathematical model of hard constraints of all courses of innovation and entrepreneurship teaching is obtained through the fitness function, on the basis of which, according to the objective function of innovation and entrepreneurship education resources in universities, each kind of resource is effectively allocated to the most adapted aspects, so as to realize the optimal allocation of innovation and entrepreneurship education resources in universities. Based on the current situation of innovation and entrepreneurship education at the Polytechnic Institute of Zhejiang University, the research hypothesis and research design are proposed, and the utilization efficiency and allocation efficiency of innovation and entrepreneurship education resources are confirmed and analyzed. The results show that before the experiment, there was a large difference in resource allocation efficiency between groups; the minimum value was 0.123, and the maximum value was 0.187. After optimization, the allocation efficiency is 0.188, with an average growth rate of 19.55%. That is, the PSO algorithm can achieve the optimization of innovation and entrepreneurship education resource allocation at the Polytechnic Institute of Zhejiang University. The four dimensions of innovation and entrepreneurship education: theoretical education, practical education, teacher quality, educational support and initiative personality of the three dimensions, motivation, change and resilience are in the presence of each other in the middle of the work, and the correlation coefficient is concentrated in the role of 0.5 on average. This study further stimulates the students passion for innovation and entrepreneurship, which is of great significance to the cultivation of students innovation and entrepreneurship abilities.