Ultrasonic wave propagates with strong penetration, high stability, and has non-contact nature, therefore it is widely used in the petroleum industry. As an application example, an ultrasonic flowmeter can accurately measure the annular flow rate of water-based drilling fluid. According to the outlet flow rate, it can be noticed if there is an abnormal situation in the well to avoid accidents such as well kick and blowout. However, due to the attenuation of ultrasonic wave in the drilling fluid, the relevant research results are not reliable. Herein, based on the theory of acoustics, the influences of water-based drilling fluid density, solid particle size and solid particle number on the ultrasonic attenuation characteristics under different frequencies are studied by numerical simulation. First, the propagation characteristics of ultrasonic wave in water-based drilling fluid are systematically analyzed, then the accuracy of the above results is verified by laboratory tests. The results show that the ultrasonic attenuation rate is positively correlated with the solid particle size, solid particle number and ultrasonic frequency in water-based drilling fluid, while it is negatively correlated with the density of water-based drilling fluid. Furthermore, it is established that the ultrasonic energy decreases with increasing propagation distance. The results of this study can provide a theoretical basis and practical guidance for using an ultrasonic flowmeter to accurately measure the annulus return flow rate of drilling fluid and develop an intelligent drilling system, so as to improve the efficiency of field operation and drilling success rate.