A hierarchical inference model for Internet-of-Things