A safe and reliable collision avoidance strategy is deemed crucial for autonomous driving. Pedestrians crossing the road illegally present a high-risk collision scenario, which can easily lead to emergency collision avoidance situations for autonomous vehicles, potentially resulting in unavoidable collisions. Therefore, developing an emergency collision avoidance strategy that combines efficient computation and minimal collision cost is of paramount importance. In this paper, a collision avoidance strategy is proposed, which consists of two parts: trajectory cluster generation and optimal trajectory selection. When an autonomous vehicle encounters a pedestrian jaywalking across the road and the distance between the vehicle and the pedestrian is less than the current minimum braking distance, it is considered an emergency collision avoidance situation. The strategy then switches to pre-generated and stored trajectory clusters that satisfy the vehicle-road dynamic constraints for emergency collision avoidance. Each trajectory within the trajectory clusters is traversed to determine whether a collision occurs. Based on the collision status of each trajectory, a trajectory selection cost function, incorporating indexes such as the Obstacle Collision Cost Index (OCCI), Ego-Vehicle Stability Index (EVSI), and Two-Vehicle Collision Severity Index (TVCSI), assigns different cost values to each trajectory by adjusting the weights of these indexes. This adjustment mode enables the trajectory selection cost function to not only select the optimal trajectory that avoids collision within the trajectory clusters in avoidable collision scenarios but also choose the trajectory with the minimum collision damage in unavoidable collision scenarios. As a result, efficient selection of the optimal emergency collision avoidance trajectory that satisfies vehicle execution system constraints can be achieved. Finally, the proposed collision avoidance strategy is evaluated through various test scenarios, and the algorithm's real-time efficacy is evaluated through hardware-in-the-loop testing simulations. The findings illustrate that the emergency collision avoidance strategy efficiently achieves collision avoidance objectives and mitigates collision damage.