The understanding of activated sludge microbial status and roles is imperative for improving and enhancing the performance of wastewater treatment plants (WWTPs). In this study, we conducted a deep analysis of activated sludge microbial communities across five compartments (inflow, effluent, and aerobic, anoxic, anaerobic tanks) over temporal scales, employing high-throughput sequencing of 16S rRNA amplicons and metagenome data. Clearly discernible seasonal patterns, exhibiting cyclic variations, were observed in microbial diversity, assembly, co-occurrence network, and metabolic functions. Notably, summer samples exhibited higher α-diversity and were distinctly separated from winter samples. Our analysis revealed that microbial community assembly is influenced by both stochastic processes (66%) and deterministic processes (34%), with winter samples demonstrating more random assembly compared to summer. Co-occurrence patterns were predominantly mutualistic, with over 96% positive correlations, and summer networks were more organized than those in winter. These variations were significantly correlated with temperature, total phosphorus and sludge volume index. However, no significant differences were found among microbial community across five compartments in terms of β diversity. A core community of keystone taxa was identified, playing key roles in eight nitrogen and eleven phosphorus cycling pathways. Understanding the assembly mechanisms, co-occurrence patterns, and functional roles of microbial communities is essential for the design and optimization of biotechnological treatment processes in WWTPs.