This paper focuses on examining the coordination and optimization of photovoltaic energy storage systems within distribution networks. It introduces a configuration approach utilizing the Discrete Particle Swarm Optimization (DPSO) algorithm and validates its efficacy through simulation experiments. Initially, the research establishes a coordinated optimization framework for photovoltaic energy storage, accounting for uncertainties like light intensity fluctuations and load variations. The primary objective is to minimize the system’s overall operational costs. To address this optimization challenge, the study employs the DPSO algorithm. By seeking out the best configuration of photovoltaic generation and energy storage units, it achieves a multi-faceted optimization encompassing economic efficiency, reliability, and sustainability. Simulation outcomes reveal that the proposed DPSO algorithm exhibits notable strengths in solution quality, convergence rate, robustness, and adaptability. When benchmarked against other algorithms, the DPSO method demonstrates a shorter runtime, improved by approximately 32%. Moreover, it attains a high solution quality, exceeding 92%. These findings underscore the algorithm’s proficiency in swiftly identifying superior solutions. Overall, this research offers valuable insights for optimizing the design and operation of photovoltaic energy storage systems within distribution networks.