Aiming at the problem of supply and demand that a large number of charging piles are idle, and the charging of some users is not satisfied, an Immune Algorithm (IA) based charging pile location optimization model is proposed. Give full consideration to affect the charging pile location of multivariate data, such as the data, the number of parking queued up for the charging data, etc., has established the mathematical model of charging pile location selection problem. Secondly, from the perspective of the user, based on the user to the shortest charging pile distance, time, at least for the target's location optimization model, in the regional scale adaptive search for charging pile location. Finally, through the simulation experiment, the rationality and effectiveness of the immune algorithm for optimizing the location of charging piles are verified, which provides a reference for the scientific location of charging piles.