Recent studies have shown that learning theories have been very successful in hydrocarbon exploration. Inversion of seismic into various attributes through the relationship of 1D well-logs and 3D seismic is an essential step in reservoir description, among which, acoustic impedance is one of the most critical attributes, and although current deep learningbased impedance inversion obtains promising results, it relies on a large number of logs (1D labels, typically more than 30 well-logs are required per inversion), which is unacceptable in many practical explorations. In this work, we define acoustic impedance inversion as a regression task for learning sparse 1D labels from 3D volume data and propose a voxel-wise semisupervised contrastive learning framework, ContrasInver, for regression tasks under sparse labels. ConstraInver consists of several key components, including a novel pre-training method for 3D seismic data inversion, a contrastive semi-supervised strategy for diffusing well-log information to the global, and a continuous-value vectorized characterization method for a contrastive learning-based regression task, and also designed the distance TopK sampling method for improving the training efficiency. We performed a complete ablation study on SEAM Phase I synthetic data to verify the effectiveness of each component and compared our approach with the current mainstream methods on this data, and our approach demonstrated very significant advantages. In this data we achieved an SSIM of 0.92 and an MSE of 0.079 with only four well-logs. ConstraInver is the first purely data-driven approach to invert two classic field data, F3 Netherlands (only four well-logs) and Delft (only three well-logs) and achieves very reasonable and reliable results.