In order to further improve the spectrum resource detection probability and increase the spectrum utilization rate in underwater wireless communication systems, this paper designs a novel multi-layer cooperative spectrum sensing algorithm based on compressed sensing, which uses compressed sensing technology to estimate the spectrum to reduce the sampling rate and the overhead of sonar signals. This new algorithm seeks the optimal hyper-parameter through Bayesian model. The multi-layer Bayesian model is introduced into the Dirichlet process to realize the automatic grouping of compressed perceptual data with the information from the non-parametric grouping mechanism, and the optimal super-parameters are selected through the fusion center to determine the spectrum. Simulation results show that the proposed algorithm fully considers the temporal correlation of compressed perceptual data and effectively improves spectral sensing performance of underwater communication system.