The invention discloses an antibacterial peptide prediction method and device based on protein pre-training representation learning; the method comprises the following steps: S1, employing a pre-training strategy to carry out the word segmentation and covering of a label-free protein sequence from a protein database, and obtaining a pre-training representation learning model, carrying out pre-training of two tasks of covering a language model and sentence continuity prediction, capturing expressions of a word level and a sentence level, and helping the model to learn general structural features of a protein sequence; S2, for the antibacterial peptide pre-recognition and prediction task, changing an output layer of a pre-training model, and performing fine adjustment on the model by using an antibacterial peptide data set with a label to generate an antibacterial peptide prediction model; and S3, according to the antibacterial peptide pre-identification and prediction task, adopting an antibacterial peptide prediction model for identification, and outputting a prediction result. Pre-training is applied to the field of antibacterial peptide recognition and prediction, and an efficient antibacterial peptide prediction model is established based on a known antibacterial peptide sequence with small data volume and unbalanced distribution.