Water resources are precious resources around the world, but pollution is becoming increasingly severe. While the degree of damage to water caused by organic pollutants is reflected by chemical oxygen demand, which is also an important indicator for hydrological monitoring. Therefore, accurate measurement of chemical oxygen demand is necessary. The rapid development of water quality detection by ultraviolet visible spectrum analysis as an efficient, convenient, and pollution-free new water quality detection method has been achieved. When we were processing ultraviolet visible spectral absorbance data, various environmental factors can affect the chemical oxygen demand light absorption value, thus affecting the accuracy of detection. So there are some goals, such as more comprehensively extracting the feature wavelength and reducing the interference to achieve better detection results. It is expected that the model can be applied to a portable water quality detection device. It is necessary to consider detection time, reduce model training parameters, and improve detection speed. Therefore, this article proposes Competitive Adaptive Weighted Sampling-Convolutional Neural Network-Long Short-Term Memory and Competitive Adaptive Weighted Sampling-Convolutional Long Short-Term Memory models for detecting chemical oxygen demand in water. To verify the effectiveness of the proposed model, the model was trained on the experimental dataset and the detection results of all models involved in the article were compared. It can be confirmed that the application of these two proposed algorithms results in less detection time and higher accuracy in concentration detection.