Platoon formation has attracted extensive attention recently due to its potential to significantly reduce fuel consumption and emissions. For the problem of optimizing vehicle platoon formation, existing methods can only ensure the optimal operation of a single vehicle, but not the overall optimal fuel consumption and emissions of a platoon. In this study, a new optimization control method is proposed for the formation process of diesel commercial vehicles, that solves the transient fuel consumption and NOx emissions integrated optimization problem for the whole platoon. First, mathematical models of instantaneous vehicle fuel consumption and NOx emissions are established by polynomial fitting, and an optimization objective function considering overall fuel consumption, NOx emissions and vehicle acceleration of the whole platoon is given. Second, the relative distance, velocity and acceleration are considered as constraints, and their upper and lower bounds are determined by comprehensively considering the feasibility of the optimization variables. Third, a grid equivalent method for platoon formation time is proposed that transforms the platoon formation optimization problem with free terminal time into an optimization problem with fixed terminal time, and the optimal solution is obtained by the interior-point method. Finally, a co-simulation with GT-power and MATLAB shows that the proposed method can obtain the comprehensive optimization of fuel consumption and NOx emissions while maintaining safety and ensure the enforceability of the desired vehicle speed and acceleration.