With the rapid development of various new types of services, autonomous driving has received extensive attention. Due to the dense traffic flow, the limited battery life and computing power of the vehicles, intelligent vehicles are unable to support some computationally intensive and urgent tasks. Autonomous driving imposes strict requirements on the response time of the task. Due to the strong computing power and proximity to the terminal of mobile edge computing (MEC) and the arrival of 5G, the task can be unloaded to MEC, and data can be exchanged in milliseconds, which can reduce the task execution time. However, the resources of the MEC server are still very limited. Therefore we proposed a scheduling algorithm that takes into account the special task of the autopilot. Tasks will select the appropriate edge cloud execution and schedule the execution sequence on the edge cloud by the scheduling algorithm. At the same time, we take the mobility of high-speed vehicles into consideration. The position of the vehicle can be obtained by the prediction algorithm, and the task results are returned to the vehicle by means of other edge clouds. The experimental results show that with the increase of the task amount, the algorithm can effectively schedule more tasks to be completed within the specified time, and in different time slots; it can also predict the location of the vehicle and return the result to the vehicle.