This work reports on the preparation of N, S-CQDs from melon seed shell, a common household waste that can inhibit the corrosion of copper in a 0.5 M H2SO4 solution. Additionally, by varying the preparation time and preparation temperature, the effects of N, S-CQDs on the capacity of copper to resist corrosion in 0.5 M H2SO4 solution were compared. It was also used to prove its inhibitory effect on copper in 0.5 M H2SO4 solution by a series of test methods. The corrosion inhibition rate of N, S-CQDs was 99.66 % and 99.87 % when the N, S-CQDs prepared at 160 ℃ for 6 h and 200 ℃ for 10 h were added. The results indicate that the corrosion inhibition rate of N, S-CQDs increases with increasing preparation time and temperature. XPS (X-ray photoelectron spectroscopy) and ATR-FTIR (Fourier transform infrared) were used to describe the composition and functional groups adsorbed on the surface of copper. N, S-CQDs' corrosion inhibition property was demonstrated by using an AFM (Atomic force microscope) and SEM (Scanning electron microscopy) to examine the corrosion surface morphology. Using the Langmuir adsorption model, it was found that the corrosion of copper was inhibited by both physical and chemical adsorption. A number of experimental findings demonstrate that preparation temperature and time impact the degree of carbonization, size, and functional group content of the N, S-CQDs, which in turn influences the corrosion inhibition of the N, S-CQDs. By means of heteroatom adsorption and surface structure, N, S-CQDs generate new chemical coordination bonds on the copper surface, thereby forming a protective layer, reducing the interaction between copper and 0.5 M H2SO4 solution, and generating a corrosion inhibition effect.