The diagnosis of electrocardiogram (ECG) is extremely onerous and inefficient, so it is necessary to use a computer-aided diagnosis of ECG signals. However, it is still a challenging problem to design high-accuracy ECG algorithms suitable for the medical field. In this paper, a classification method is proposed to classify ECG signals. Firstly, wavelet transform is used to denoise the original data, and data enhancement technology is used to overcome the problem of an unbalanced dataset. Secondly, an integrated convolutional neural network (CNN) and gated recurrent unit (GRU) classifier is proposed. The proposed network consists of a convolution layer, followed by 6 local feature extraction modules (LFEM), a GRU, and a Dense layer and a Softmax layer. Finally, the processed data were input into the CNN-GRU network into five categories: nonectopic beats, supraventricular ectopic beats, ventricular ectopic beats, fusion beats, and unknown beats. The MIT-BIH arrhythmia database was used to evaluate the approach, and the average sensitivity, accuracy, and F1-score of the network for 5 types of ECG were 99.33%, 99.61%, and 99.42%. The evaluation criteria of the proposed method are superior to other state-of-the-art methods, and this model can be applied to wearable devices to achieve high-precision monitoring of ECG.