The effect of grating structure on the photoelectric conversion efficiency of solar cells is studied with the finite-difference time-domain method. The influence of grating shape, height and the thickness of coated metal film is analysed. It is found that the variation of grating shape and height makes great changes of energy storage, especially of the photoelectric conversion efficiency and energy storage of the triangle grating. The comparison between un-optimized and optimized surface grating structure on solar cells shows that the optimized grating surface significantly increases the energy storage capability and greatly improves the efficiency.