Advanced Metering Infrastructure In Smart Grids