This paper reviews the current situation of intrusion detection and the commonly used random forest (RF) method, and confirms that support vector machine (SVM) and artificial neural network (ANN) are good methods, which are important components of building state network information security. Very complex and critical system technology. Appropriate security strategy must be based on the real needs of the government, guided by design principles, and establish a comprehensive and dynamic security system with technical management measures to truly protect government information security and maximize government efficiency. In this environment, we get the following conclusions: (1) In the performance test of different RF algorithms, the accuracy of the traditional RF algorithm is 83.4%, the security is 79.3%, and the correlation is 84.9%. In the data, we conclude that the high-dimensional clustering RF algorithm is the best in the performance test of different RF algorithms. (2) The security awareness and cognition of users also account for 6%, which shows that the security awareness of many users in government departments is not perfect, and the main reason for network intrusion in government departments is the intrusion of intruders and malicious code.