All-solid-state lasers have become one of the most promising research fields in the field of lasers because of their small size, high efficiency and convenient operation. All-solid-state lasers use semiconductor lasers as pump sources, however, Compared with gas lasers, solid-state lasers and fiber lasers, high-power semiconductor lasers have poor beam quality, thus limiting the progress of all-solid-state lasers. Therefore, improving the power and beam quality of semiconductor lasers has become a bottleneck in the development of all-solid-state lasers. The unit beam of the semiconductor laser is rectangular, so the beam needs to be shaped and focused to form a spot before being coupled to the laser medium. Due to its poor quality the spot center has a high optical energy density. When using LD end-pumped mode, the spot can easily destroy the film of the working medium end. In this paper, a uniform function describing the distribution of refractive index and the related parameters were used. And use this function to simulate and calculate the transmission characteristics of optical fiber. Based on the influence of fiber refractive index and core structure on the distribution of optical power in cross section, the homogenization of the LD beam spot is achieved by designing the core structure of optical fiber. This paper established optical fiber transmission model of light waves by using Matlab software and confirmed the influence of the refractive index distribution on the optical power distribution by using Comsol Multiphysics software.