fix bugs and optimize the interface
Signed-off-by: zhengjiabin <zhengjiabin.tj@gmail.com>