The loss of the population diversity leads to the premature convergence in existing particle swarm optimization(PSO) algorithm. In order to solve this problem, a novel version of PSO algorithm called bacterial PSO(BacPSO), was proposed in this paper. In the new algorithm, the individuals were replaced by bacterial, and a new evolutionary mechanism was designed by the basic law of evolution of bacterial colony. Such evolutionary mechanism also generated a new natural termination criterion. Propagation and death operators were used to keep the population diversity of BacPSO. The simulation results show that BacPSO algorithm not only significantly improves convergence speed ,but also can converge to the global optimum.