To realize the efficient transmission of deep space communication, single photon detection technology is used to overcome the signal attenuation and noise problems in long-distance transmission. To further achieve high-speed single-photon communication, we proposed the pulse sampling on-off keying modulation method instead of the PPM to increase the rate, and introduced the dark counting of the single-photon detector system, and a single-photon detector simulation model is set up to solve the problem of the transmission of the non-return-to-zero code in the single-photon detector. Simulation results show that the pulse sampling technique solves the transmission problem of non-return-to-zero pseudo-random sequence code in a single-photon detector, and its bit error rate is lower than 10E-4 under the condition that the non-return-to-zero code cannot allow good communication. In addition, the relationship between the dark count rate and the bit error rate of a single photon detector is analyzed. Finally, the feasibility of applying pulse sampling to single-photon detector is proved by experiments. The research results are of great significance to the study of single-photon laser communication in deep space.