Surface-enhanced Raman scattering (SERS) has been widely used in the detection of targets and strongly depends on the interaction and the distance between the targets and nanoparticles.