In the era of information, cybersecurity of communication networks of power grids has received increasing attention. In this paper, the important attributes are extracted from the alarm data of the multiple sources of the communication network of power grids. Based on these attributes, after time series construction, using multi-step deep learning and data dimensionality reduction techniques, spatiotemporal feature maps of the data are created. The security posture attributes of the communication network components of power grids are discretized using the 3σ criterion, and the Bayesian network is constructed to infer and generate the probability of security postures of network components. The results show that when attacks occur, the correlation of alerts varies between [0.56, 0.89], which shows considerable accuracy. The maximum security posture score of nodes exceeds 200 in all attack phases, showing a decreasing trend.