Distributed flexibility characterization and resource allocation for multi-zone commercial buildings in the smart grid