Lithology identification of rock is one of the main bases for stratigraphic division in geology and plays a very important role in oil and gas exploration. In recent years, with the increasing amount of data obtained by MWD and other methods, it is possible to use artificial intelligence method to dynamically identify lithology based on these data. This paper establishes a formation lithology prediction model based on CNN-LSTM-Attention, predicts formation lithology through drilling parameters and logging data, and verifies the drilling data of a block in Huizhou, South China Sea. Three artificial intelligence methods, convolutional neural network - Long short-term memory neural network -Attention mechanism (CNN-LSTM-Attention), convolutional neural network - long short-term memory neural network (CNN-LSTM) and long short-term memory neural network (LSTM), are compared and analyzed. The results show that the lithology prediction model proposed in this paper has good accuracy and low error, and has certain reliability and practicability.