To improve the accuracy of fuel injection in high-pressure common rail systems of diesel engine, a mathematical model based on differential equations was established in view of the process of fuel entering and ejecting the common rail pipe, and the pressure variation law under working condition in the common rail tube was simulated in this study. Aiming at reducing the fuel pressure fluctuations in the system, the optimal angular velocity of the cam in high-pressure pump is solved by binary search algorithm, and the optimal control strategies for maintaining the dynamic and stability of pressure are given as well. Numerical simulation results show that with the presented strategies precise control of the pressure can be achieved in the common rail system, helping to improve the efficiency of the diesel engines.