<p>By considering both the single drug dose and the total drug input during the treatment period, we propose a new optimal control problem by maximizing the immune cell levels and minimizing the tumor cell count, as well as the negative effects of the total drug quantity over time. To solve this problem, the control parameterization technique is employed to approximate the control function by a piecewise constant function, which gives rise to a sequence of mathematical programming problems. Then, we derive gradients of the cost function and/or the constraints in the resulting problems. On the basis of this gradient information, we develop a numerical approach to seek the optimal control strategy for a discrete drug administration. Finally, numerical simulations are conducted to assess the impact of the total drug input on the tumor treatment and to evaluate the rationality of the treatment strategy within the anti-cancer cycle. These results provide a theoretical framework that can guide clinical trials in immunotherapy.</p>