Sleep apnea hypopnea syndrome (SAHS) is a common sleep disorder with a high prevalence. The apnea hypopnea index (AHI) is an important indicator used to diagnose the severity of SAHS disorders. The calculation of the AHI is based on the accurate identification of various types of sleep respiratory events. In this paper, we proposed an automatic detection algorithm for respiratory events during sleep. In addition to the accurate recognition of normal breathing, hypopnea and apnea events using heart rate variability (HRV), entropy and other manual features, we also presented a fusion of ribcage and abdomen movement data combined with the long short-term memory (LSTM) framework to achieve the distinction between obstructive and central apnea events. While only using electrocardiogram (ECG) features, the accuracy, precision, sensitivity, and F1 score of the XGBoost model are 0.877, 0.877, 0.876, and 0.876, respectively, demonstrating that it performs better than other models. Moreover, the accuracy, sensitivity, and F1 score of the LSTM model for detecting obstructive and central apnea events were 0.866, 0.867, and 0.866, respectively. The research results of this paper can be used for the automatic recognition of sleep respiratory events as well as AHI calculation of polysomnography (PSG), which provide a theoretical basis and algorithm references for out-of-hospital sleep monitoring.