As diffusion control caused by the thermal annealing of the in-situ As-doped HgCdTe grown by molecular beam epitaxy (MBE) was studied. The HgCdTe material with controllable As diffusion length is obtained at a lower annealing temperature, which is easy to form a PN junction profile that meets the design parameters, and provides a basis for the subsequent development of new focal plane devices. It is found that during the thermal annealing process, the size and longitudinal distribution of As concentration of the in-situ As-doped HgCdTe changed with different Hg pressures. And through theoretical calculations, As diffusion coefficients under different Hg pressures are obtained. Meanwhile, the dark current simulation of the P-on-N device structure with different As diffusion lengths was carried out through numerical simulation, which verified the importance of the As-doped junction deep advancing process.