Quantum control with Lyapunov function and bang-bang solution in the optomechanics system