抽取共通方法

Signed-off-by: qiuqiupeng <pengleeg@gmail.com>