To address the unknown spatial relationship between source and target domain labels, which leads to poor fault diagnosis accuracy, a contrastive universal domain adaptation model and rolling bearing fault diagnosis approach are proposed. The approach introduces bootstrap your own latent network to mine the data-specific structure of the target domain and proposes rejecting unknown class samples using an entropy separation strategy. Simultaneously, a source class weighting mechanism is designed to improve the transferable semantics augmentation method by assigning various class-level weights to source categories, which improves the alignment of the feature distributions in the shared label space to further construct fault diagnosis models. Experimental validation on two rolling bearing datasets confirmed the superior fault diagnosis accuracy of the proposed method under diverse working conditions.