IoT-based Proactive Energy Supply Control for Connected Electric Vehicles