Particle swarm optimization algorithm is easy to reach premature convergence in the solution process, and fall into the local optimal solution. Aiming at the problem, this paper proposes a particle swarm optimization algorithm with chaotic mapping (CM-PSO). The algorithms uses chaotic mapping function to optimize the initial state of population, improve the probability of obtain optimal solution. Then, CM-PSO algorithm introduces nonlinear decreasing strategy on the inertia weight to avoid local optimal solution. In the experimental stage, four different functions are used to validate the performance of the algorithm. The experimental results show that, compared with the standard particle swarm algorithm, CM-PSO algorithm has strong global searching ability, can effectively avoid the premature convergence problem, and enhance the ability of the algorithm to escape from local optima. Although the algorithm consumes time is slightly increased, it is worth for getting the global optimal solution with such cost.