The network security situation can realize accurate perception of network attacks in advance to intercept and prevention, aiming at matching the traditional detection method of network security situation prediction accuracy is not good. A network security situation awareness model is proposed based on genetic algorithm, the security state distribution model first structure virus built under complex network environment the extraction of feature information of network security situation, then genetic algorithm is used to extract the virus information flow correlation detection, security situation prediction and accurate perception. Finally, the simulation results show that the proposed method has a high probability of accurate detection of network virus invasion, high accuracy of the security situation prediction, and ensure the network security.