Machine-to-infrastructure middleware platform for data management in IoT