The ongoing energy structure reform in our country has led to the emergence of distributed renewable energy as a primary source of energy development and utilization, primarily due to its utilization of local resources. However, challenges such as undefined objectives and ineffective planning have impeded its progress. This study specifically investigates distributed renewable energy power planning by enhancing a particle swarm algorithm with a strategy for updating local optimal solutions. The refined algorithm tackles issues related to renewable energy variability and economic efficiency, thereby optimizing the planning of distributed renewable energy power systems. The outcomes illustrate improvements in system operation, economic viability, and environmental sustainability. This research contributes to the progression of particle swarm algorithms for the planning of distributed renewable energy power systems.