  We propose an analytical method to achieve complete energy conversion in sum
frequency generation based on Lewis-Riesenfeld invariants theory. This
technique, derived from a two-level atom transition in quantum mechanics, is
more efficient and robust than conventional methods. In our scheme, the
quasi-adiabatic single control parameter model is established, and the value of
single control parameter is selected to make the initial eigenstate perfectly
converted to the final eigenstate we need. Corresponds to the nonlinear
frequency conversion process, the nonlinear crystal structure is designed with
the inverse engineering of optimal control theory, which is robust against the
perturbations in the coupling coefficient and phase mismatch, including pump
intensity and crystal polarization period variations, and results in almost
100% conversion efficiency at any crystal length. It is demonstrated that the
frequency conversion can be achieved in the wavelength range of 2.6 {\mu}m -3.6
{\mu}m with a spectral bandwidth of the conversion efficiency over 50%
approaching to 400 nm when the crystal length L=1 mm.
