the method to check if variable has already been defined

Signed-off-by: ligang <ligang@ligang-System-Product-Name.(none)>