In order to solve the problem of network security in colleges and universities,this paper first introduces the network security risks faced by colleges and universities under the environment of artificial intelligence,as well as some problems in network security,and puts forward the establishment of network security awareness,adopt diversified network virus response strategies,and build network security prevention system.Finally,taking a university as an example,the countermeasures of OPNETModeler hierarchical model are proposed.Through analysis,it can be seen that the model is feasible to deal with network security risks in universities,in order to provide reference for the staff to prevent network security risks in universities.