add new rule functions ad db functions by Fang danli 20140304