An integrated automatic driving system consists of perception, planning and control. As one of the key components of an autonomous driving system, the longitudinal planning module guides the vehicle to accelerate or decelerate automatically on the roads. A complete longitudinal planning module is supposed to consider the flexibility to various scenarios and multi-objective optimization including safety, comfort and efficiency. However, most of the current longitudinal planning methods can not meet all the requirements above. In order to satisfy the demands mentioned above, a new Potential Field (PF) based longitudinal planning method is presented in this paper. Firstly, a PF model is constructed to depict the potential risk of surrounding traffic entities, including obstacles and roads. The shape of each potential field is closely related to the property of the corresponding traffic entity. Secondly, a high-level controller and a low-level controller for the longitudinal motion are respectively designed to realize functions of the longitudinal planning and control. Based on the PF model, the longitudinal high-level controller can calculate the desired acceleration by optimizing a cost function that takes the potential risk, comfort and driving efficiency into consideration. And the longitudinal low-level controller essentially implements an adaptive PID algorithm to make the controlled vehicle follow the acceleration command well. Finally, the designed longitudinal planning and control module is integrated with a lateral planning and control module studied previously, which is also based on the same PF model. The feasibility of the proposed method in different traffic scenarios including approaching, cut-in and overtaking with multiple traffic participants is verified by co-simulation tests of CarSim/Simulink and hardware-in-the-loop tests.