add persist tree code

Signed-off-by: changedi <jysoftware@gmail.com>