copy code from hey_shmily@163.com ,hope can do some work for it

Signed-off-by: Dandan <godvmxi@gmail.com>