Influence Mechanism of Mg2+ Doping on Electrochemical Properties of LiFePO4 Cathode Materials