In this paper, we systematically studied the effects of non-metallic element (B, C, N, O, F) doping and biaxial stretching on the photoelectric properties of ZrS2/ZrSe2 heterostructures by using the first-principles calculation method based on density functional theory. The results show that the p-type doping is realized by B, C, and N atom doping, and the n-type doping is realized by O and F atom doping. The doping of B and C atoms produces impurity energy levels in the band gap, which affects the conductivity of the heterostructure. The band gap of N and O atom-doped heterostructures increases under tensile strain, but it is still a direct band gap. The analysis of the optical properties of the heterostructures shows that the doping of non-metallic atoms can adjust the optical absorption rate and reflectivity of the heterostructures. Under the action of tensile strain, the optical properties of the doped heterostructures have changed significantly in the low-energy region. This article provides a theoretical basis for the future application of ZrS2/ZrSe2 heterostructures. This paper uses the first-principles calculation method based on density functional theory. The PBE exchange-correlation functional based on generalized gradient approximation (GGA) is selected for the specific calculation, and the crystal structure is geometrically optimized by the ultrasoft pseudopotential method. It is verified that when the cutoff energy of the ZrS2/ZrSe2 heterostructure is 500 eV, the K-point grid is selected to be 10 × 10 × 2 with the lowest energy, so the cutoff energy is selected to be 500 eV. The K-point grid is selected to be 10 × 10 × 2. The convergence limits for structural optimization are as follows: the maximum force between atoms is 0.01 eV/Å, the convergence threshold of the maximum energy change is set to 10-9 eV/atom, and the convergence threshold of the maximum displacement is 0.001 Å. In order to avoid the influence of atomic periodic motion between different atomic layers, a vacuum layer of 20 Å is added in the vertical direction. Considering the interaction of vdW between the interfaces, the DFT-D2 method is used to verify. The optical properties were calculated by the random phase approximation method, and the K-point grid was selected as 12 × 12 × 2.