Understanding the influence of environmental boundary parameters on the through-flow characteristics of two-stage supercharged centrifugal compressors is the key to maximizing the power recovery potential of diesel engines at high altitudes. In this paper, the influence of the compressor through-flow characteristics on the full-load thermal cycle performance of a diesel engine under variable altitude is studied by means of tests and simulation. The results show that with the increase in altitude, the range of stable work flow decreases, and the pressure ratio of the plugging point changes greatly with altitude. The efficiency of the compressor with the same mass flow point decreases, and the highest efficiency point moves in the direction of the small flow range. With the goal of maximizing the torque of the diesel engine under full load and low speed, the key geometric parameters of the variable-altitude through-flow characteristics of the two-stage supercharged compressor were optimized as follows: at the altitudes of 0 m, 2500 m, and 5500 m, the diesel engine torque increased by 5.89%, 3.78%, and 2.18%, respectively. Based on the optimization method of the compressor through-flow design, a new direction is provided to break through the research on the independent limitation of the diesel engine thermal cycle performance optimization and compressor flow control.