A Novel Real Time Charging Approach for Electric Vehicles in Smart Grids