add common code

Signed-off-by: James-Tu <57621080@qq.com>