Information flow topology is crucial in the control of connected autonomous vehicles. It has a substantial influence on the platoon's performance, especially in scenarios with imperfect communication. To address this issue, this study provides a real-time switching topology technique for improving the platoon's performance under various types of imperfect communication situations and constant packet dropout rates. First, a discrete sliding mode controller with a double power reaching law is designed for a nonlinear heterogeneous vehicle dynamic model with packet loss. Then, Lyapunov analysis is applied to ensure the platoon's stability and string stability. Finally, a two-step switching topology framework is introduced. The first step is to design an offline Pareto optimal topology search with some predicted imperfect communication scenarios, where the platoon's tracking ability, fuel consumption, and driving comfort are optimised using a multi-objective evolutionar