the internet of things in the cloud a middleware perspective