With increasing awareness of ecological issues and diminishing reliance on fossil fuels, electric vehicles (EVs) have garnered widespread attention as a sustainable transportation solution. Electric vehicles are favored for their environmental friendliness, yet their limited energy storage capacity restricts driving range, making efficient energy utilization crucial. To ensure timely energy replenishment for electric vehicles, this paper presents an optimization method based on the ant colony algorithm for fast charging station location and capacity determination. This study takes into account factors such as real-time pricing, usage duration, critical peak pricing, and peak time rebates, aiming to devise an optimal charging pricing strategy. Based on this strategy, the ant colony optimization algorithm is applied to conduct an in-depth analysis of electric vehicle traffic and charging demand. By comprehensively considering construction costs, equipment procurement expenses, maintenance fees, and user driving costs, an optimization model for fast charging station location and capacity determination is constructed. The ant colony algorithm is then utilized to solve this model, yielding the optimal location and capacity configuration. Experimental results demonstrate that the proposed optimization method based on the ant colony algorithm exhibits superior comprehensive performance, making it suitable for practical application scenarios.