A robust adaptive optimal switching tracking control method is proposed for discrete-time nonlinear systems with unknown dynamic characteristics, aiming to address the challenge of achieving optimal tracking control in practical industrial processes where system operating points vary. First, multiple approximate linearized models are established around different operating points of the nonlinear system. An online recursive least squares identification algorithm is employed to estimate the unknown parameters of each model. Consequence both controller design model and its corresponding estimation model are yielded. Then, based on the embedding transformation, minimum principle, and quadratic programming technique, the optimal switching function and adaptive optimal tracking controller are derived. Additionally, a robust compensator is designed to enhance the performance of the control system. Finally, a numerical simulation and an application to electrode current control in the smelting process of fused magnesia are conducted. The results verify the effectiveness and practical applicability of the proposed method.