In order to solve the cold-starting problem and improve the intake and exhaust pipe temperatures of diesel engines under cold-starting and low- and medium-speed conditions, this paper proposes a twice-open control method for a hydraulic variable valve system. First, a hydraulic variable valve system that can realize a fully variable valve lift and phase angle is applied to replace the original intake system in order to meet the air intake requirements of different conditions. Then, a twice-open control method in which the intake valve opens two times at the exhaust stroke and intake stroke is proposed to improve the intake pipe temperature and solve the cold-starting problem. This paper contains a numerical work analysis. A GT-POWER model is constructed to validate the intake valve twice-open control method. The cylinder pressure, cylinder temperature, intake pipe pressure, and intake pipe temperature are obtained and compared between the original intake valve system and the hydraulic variable valve system with the proposed intake valve twice-open control method. The results show that the twice-open control method can increase the intake pipe temperature to 260 K or even higher, which can improve the cold-starting performance and the exhaust temperature at low and medium speeds. At the same time, the performance under low- and medium-speed conditions is improved.