Research on transfer learning in rolling bearing fault diagnosis can help overcome challenges such as different data distributions and limited fault samples. However, most existing methods still struggle to address the zero-shot cross-domain problem within the same equipment and the few-shot cross-machine problem. In response to these challenges, this paper introduces a transfer learning rolling bearing fault diagnosis model based on deep feature decomposition and class-level alignment (FDCATL). The model consists of two stages. In the first stage, the original vibration signals undergo continuous wavelet transform to obtain time-frequency diagram. Subsequently, a convolutional neural network extracts features from the diagram. The obtained deep features are decomposed into four types: uncertain features, domain-shared features, domain-specific features and category features. Multiple loss functions are then employed to remove extraneous features beyond the category features. In the second stage, category features are further extracted, and Convolutional Block Attention Module (CBAM) is introduced to further reduce the potential interference of unexcluded irrelevant information within the category features with classification results. Simultaneously applying a class-level alignment strategy effectively alleviates inter-domain class distribution discrepancies. Experimental validation was conducted on three distinct datasets, revealing a significant improvement in the classification performance of the proposed method over alternative methods. Furthermore, the model demonstrated robustness and noise resistance.