@baisong This function relies on a cache that may be stale or not present at all.  The reason that 'vsite_get_subsites' creates this cache is because the group id is stored on the child.  So in this case if you have the child you need only check the value in 'field_group_parent' for the site.