In offshore drilling, accidents such as gas invasion, overflow, and kicks are unavoidable, and they can escalate into blowouts and other catastrophic events, resulting in casualties and significant economic losses. Therefore, ensuring drilling safety requires precise monitoring of gas invasion and overflow. Currently, most overflow monitoring methods used at drilling sites are based on threshold criteria. However, the monitoring parameters obtained during actual drilling operations often contain noise signals, which makes it challenging for threshold-based methods to achieve a balance between improving accuracy and minimizing false positives. This paper proposes a novel method called Pattern-Recognition-based Kick Detection (PRKD) for diagnosing overflow in offshore drilling. The PRKD method utilizes the overflow evolution process by integrating multiphase flow calculations, data filtering theory, pattern recognition theory, the Bayesian framework, and other theoretical models. By analyzing the shape and wave characteristics of the curves, PRKD effectively detects and monitors gas intrusion and overflow based on single parameters. Through case analysis, it is demonstrated that the proposed method achieves high precision in monitoring drilling overflow while maintaining a low false positive rate. By combining advanced computational techniques with pattern recognition algorithms, PRKD improves the accuracy and reliability of kick detection, enabling proactive responses to potential risks, protecting the environment and human lives, and optimizing drilling operations. The case analysis shows that by integrating the probabilistic information of pre-drilling kicks and various characteristic parameters, when the noise amplitude is less than 8 L/s, the PRKD model exhibits superior detection performance. Moreover, when the noise amplitude is 16 L/s, the PRKD model detects the continuous overflow approximately 200 s after the actual overflow occurs and predicts a 96.4% probability of overflow occurrence at the specified location, meeting the on-site requirements. The gas invasion monitoring method proposed in this paper provides accurate diagnostic results and a low false positive rate, offering valuable guidance for gas invasion monitoring in drilling operations.