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 evolutionary algorithm based on decomposition with two opposing adaptive mechanisms. In the second step, the optimal topology is switched and selected in real-time from among the previously acquired Pareto optimal topology candidates, to reduce the control cost. To validate the proposed approach, numerical simulations are conducted. According to the results, compared to a standard robust sliding mode controller, the suggested technique enhances platoon tracking ability by 97.73 percent, fuel efficiency by 9.96 percent, and driving comfort by 20.18 percent, respectively.