[TangSong]重构代码和添加注释