Battery online equalization principle