Chemistry as a probe of the structures and evolution of massive star-forming regions