This article deals with the optimal control issue of nonlinear batch process. First, in order to derive high efficiency and accuracy process model, a novel hierarchical searching mechanism local dynamic nonlinear model is constructed which is composed of just‐in‐time learning and extreme learning machine (JITL‐ELM). Then, based on the local dynamic JITL‐ELM model, an optimal quadratic‐criterion‐based iterative learning control (Q‐ILC) algorithm is presented, where the control input trajectory can be obtained by solving a quadratic programming problem. Moreover, on the basis of inverse model system, the initial batch control input trajectory of the Q‐ILC algorithm can be obtained by the use of JITL method. As a result, not only the issue of model‐plant mismatch and real‐time disturbance can be solved, but also obtain faster system convergence rate and smaller tracking error. Besides, the convergence properties of control input and tracking error are analyzed. Finally, a typical batch process is presented to demonstrate the feasibility and superiority.