Exposure to bioaerosols in high-density urban environments will pose a severe threat to human life and health and present significant challenges to the sustainability and resilience of cities. In this study, the aerodynamic dispersion patterns of bioaerosols at two release locations (open and dense areas) under both thermal conditions in Zhongguancun, Beijing, are investigated. By coupling a dose-response model and an improved cellular automaton, the infection risk within exposed populations was assessed, and emergency evacuation strategies for distinct populations in high-risk areas were devised. This study reveals that bioaerosol distribution is notably influenced by factors such as thermal conditions, release locations and pedestrian height. Bioaerosol concentration above the release source decreases with increasing pedestrian height at two release locations. Under the same exposure time, the infection probability of different groups in this area declines with pedestrian height increases, with adult males having the highest and elderly females having the lowest probability. Thermal conditions and building layout near the release source were second only to exposure time in influencing infection probability and evacuation path. Proximity to the release source indicates a high infection probability but a short evacuation distance to safe areas, while downstream areas exhibit lower infection probability but require longer evacuation distances. The layout of buildings near the release source has the most significant effect on evacuation time. Evacuation for high-risk populations should be prioritized upstream or either side of the mainstream. This study aims to mitigate potential biological threats, address challenges in enhancing urban biosecurity management, and enable sustainable urban development.