add new function for get degree.

Signed-off-by: qijiang.guo <qijiang.guo@gmail.com>