When traditional infrared spectroscopy technology measures and analyzes the quantitative research of fluid, due to the complex band composition of infrared spectrum, weak absorption intensity and spectral signal, it is easy to be disturbed during measurement and increase the error, making the quantitative analysis of fluid inaccurate and difficult to achieve requirements for accurate analysis of fluids. In order to solve this problem, this paper uses the self-developed experimental apparatus, and takes water-based drilling fluid and diesel oil as the research objects, and proposes a new method for quantitative research of two-component proportional fluids based on HDC-PSAM. A large number of experiments are carried out on water-based drilling fluids, diesel and water mixtures, and a large number of spectral experimental data are preprocessed using moving window smoothing and normalization methods. Extracting effective features with Hybrid dilated convolution (HDC) and Pyramid self-attention modules (PSAM) , combined with Partial Least Squares Algorithm (PLS) to model fluid mixtures to achieve quantification of fluid mixtures calculate. The experimental results show that this method can reduce the influence of disturbance during measurement, has higher accuracy and stability, and effectively improves the measurement accuracy of infrared spectroscopy for quantitative analysis of fluids. At the same time, this method provides a strong technical support for the analysis of other fluids and the measurement of fluid mixture by using infrared spectroscopy technology.