## 1 Introduction  
With the increasing diversification and complexity of network security attacks [1], traditional security protection measures, including anti-virus software, vulnerability scanning, intrusion detection systems (IDS), and firewalls, whether active or passive defense, are facing development bottlenecks. Anti-virus software and vulnerability scanning tools typically concentrate on safeguarding individual computers. They do not offer a thorough evaluation of the overall security status of the network environment and lack the capacity to analyze and oversee the security of the entire network system at a macro level. While an intrusion detection system (IDS) [2, 3] can monitor the entire network, it can only take corrective actions after identifying potential threats. This reactive approach leaves the network in a passive state, unable to proactively avert future network security risks. Network-security situational awareness systems, through dynamic and comprehensive monitoring of the real-time security status and risk level of the network, have overcome the limitation of a single security device that can only monitor local security information [4, 5]. As a result, they have gradually become a focal point in the field of network security research. Network-security situation prediction technology is an essential component of network-security situation awareness. It can analyze historical network data to predict future network threats and issue warnings [6]. Network-security situation prediction plays an important role in network defense, network-security early warning, and network resource allocation. In recent years, with the rapid progress of artificial intelligence technology, all sectors have become acutely aware of its enormous potential and advantages. Artificial intelligence technology is now considered a crucial engine for the industry's development. In the field of network-security situation prediction, this trend is also evident, with artificial intelligence technology gradually emerging as a key driver of innovation and development in this domain. At present, many studies on situation prediction focus on time-series analysis, typically utilizing recurrent neural networks (RNNs) [7], long short-term memory networks (LSTMs) [8], gated recurrent units (GRUs) [9; 10; 11], or their variants to predict network situations. However, these methods do not fully utilize effective dataset feature-processing techniques when dealing with large-scale network data, resulting in limitations in feature extraction. In order to address this deficiency, this paper introduces the convolutional neural network (CNN) structure to enhance the feature extraction capability of the dataset. In this way, we aim to optimize the feature processing process to enhance the efficiency and accuracy of network-security situation prediction. Therefore, aiming to address the shortcomings of datasets in feature processing, this paper proposes a CNN-GRU neural network model integrating an attention mechanism for predicting network security situations. At present, some studies have combined the advantages of CNNs and GRUs. They utilize CNNs to extract spatial features and GRUs to process time-series data. These studies have made significant achievements in fields such as power grid and water level prediction [12; 13; 14]. However, there is a scarcity of research on network-security situation prediction. The research in this paper utilizes real data released by the National Internet Emergency Response Center (CERT) as the experimental dataset. It employs a combination of a CNN, a GRU, and an attention mechanism to enable the model to automatically focus on the most relevant data, thereby enhancing the accuracy of network-security situation prediction. The main contributions of this paper are as follows. * Utilizing a gated recurrent unit (GRU) to capture overall trends and patterns in time-series data enhances prediction accuracy. * Convolutional neural networks (CNNs) are suitable for processing data with spatial correlation.