The Internet of Things in the Cloud: A Middleware Perspective