The radar's high-resolution range profile (HRRP) data structure is complex, and extracting stable and reliable features from it is crucial for HRRP target recognition. In this paper, we propose to use the convolution module to extract local spatial features of HRRP and use the positional encoding to embed the position information to generate new temporal features, and then capture the long-term dependency within the distance unit of HRRP through the multi-head new selfattention mechanism of the Transformer encoder, to construct a reliable feature extraction method for the HRRP target. Finally, a new deep learning model CNN-TEAN (CNN TransEncoder-Attention Network), based on one-dimensional residual convolution, Transformer encoder, and attention mechanism, is formed using the attention mechanism, fully connected layer, and softmax for classification. Using six simulated ship target data types for experimental validation, the CNN-TEAN model proposed in this paper can achieve a higher recognition rate than RNN, LSTM, and SVM models.