Based on research on the response mechanism of rock formations and reservoirs to logging curves, 12 logging curves selected by combining the depth characteristics of formations are proposed to identify rock formations and reservoirs using four algorithms: logistic regression (LR), support vector machine (SVM), random forest (RF) and XGBoost. Out of 60 wells in the study block, 57 wells were selected for training and learning, and the remaining 3 wells were used as prediction samples for testing the algorithm. The recognition of rock formations and reservoirs is performed by each of these four machine learning algorithms, and predictive knowledge is obtained separately. It was found that the accuracy of the 4 algorithms for rock formation and reservoir layer identification reached over 90%, but the XGBoost algorithm was found to be the best in terms of the 4 scoring criteria of F1-score, precision, recall and accuracy. The accuracy of rock formation identification could reach over 95%, and the correlation analysis between the logging curve and rock formation could be performed on this basis. The results show that the RMN, RLLD and RLLS have the most obvious responses to the sandstone layer, off-surface reservoir and effective thickness layer, and the CAL has the least effect on the formation and reservoir identification, which can provide an effective reference for the selection and dimensionality reduction of the subsequent logging curves.