The gradual and unpredictable variation in chemo-sensory signal responses when exposed to the same analyte under identical conditions, commonly referred to as sensor drift, has long been recognized as one of the most serious challenges faced by chemical sensors. The traditional drift compensation method is both labor-intensive and expensive, as it requires frequent collection and labeling of gas samples for recalibration. Introducing a small number of meaningful drift calibration samples can be an attractive strategy to reduce the computational load and improve the performance of the updated classifier. However, under the influence of drift, new challenges arise due to the difference in the distribution of source and target domain data. This paper proposes a novel algorithm framework called semi-supervised contrastive learning drift compensation (SSCLDC). The framework automatically extracts high-level abstract features based on a multilayer perceptron to better represent the structure of the source data. In addition, to address the issue of data distribution differences caused by drift between the source and target domains. We add a small number of reference sample pairs into the training for semi-supervised learning. Combining a contrastive loss function that can represent the matching degree of paired samples effectively overcomes the problem of sensor drift. The Kennard-Stone sequential algorithm is used to select the representative reference sample from the set of candidate reference samples. Experiments conducted on a widely used long-term chemical gas sensor drift dataset demonstrate that the proposed method outperforms several classic drift compensation techniques, highlighting its effectiveness and practical applicability.