Aiming at the problem that sweeping robot cannot judge dynamic obstacles in advance,which cause collision during cleaning process,a path planning method of sweeping robot in dynamic obstacle environment is proposed. Through processing of laser and map data,the detection and solution of dynamic obstacles are realized. Map grid cost value is updated by using improved two-dimensional(2D)Gaussian distribution function to combine with dynamic obstacle information. Inflation mode is improved combined with dynamic obstacle analysis,and introduce novel evaluation sub-function coefficient calculation method and dynamic threshold setting method to optimize dynamic window approach(DWA). Dynamic obstacle avoidance is realized by using the global and local path planning algorithm on the map with updated grid cost value. Experimental result shows that this method can effectively achieve early avoidance of dynamic obstacles for sweeping robot,and has characteristics of feasibility and effectiveness.