In this paper, a cybersecurity posture assessment model based on the attention mechanism is put forward to assess the cybersecurity posture in terms of IoT fusion technology. In order to make progress in artificial intelligence-based cybersecurity posture prediction under the condition of IoT fusion, a prediction model named INGWO-LSTM is presented with the aid of an improved small-life realm gray wolf optimizer. The performance of INGWO-LSTM in cybersecurity posture prediction is compared with single prediction models. On the basis of the framework for assessing and predicting cybersecurity postures in this paper, an exploration is made into the effect of the optimization of network security management using practical cases. The results show that the proposed model can effectively recognize 13 out of 14 typical attack types currently employed. Except for Heartbleed and Web Attack-SQL Injection, the coverage rate of attack event sensing time is higher than 90% by the proposed method. Besides, the INGWO-LSTM prediction model is capable of presenting high optimization precision, consistency between the network structure and data, and greatly improved robustness. Based on the practical case study, it is shown that the attack type recognition accuracy of the INGWO-LSTM algorithm remains at a level higher than 90%, and the final prediction accuracy is 93.24%.