Heart Rate Variability (HRV) refers to the capability of the heart rhythm to vary at different times, typically reflecting the regulation of the heart by the autonomic nervous system. In recent years, with advancements in Electrocardiogram (ECG) signal processing technology, HRV features reflect various aspects of cardiac activity, such as variability in heart rate, cardiac health status, and responses. We extracted key features of HRV and used them to develop and evaluate an automatic recognition model for cardiac diseases. Consequently, we proposed the HRV Heart Disease Recognition (HHDR) method, employing the Spectral Magnitude Quantification (SMQ) technique for feature extraction. Firstly, the HRV signals are extracted through electrocardiogram signal processing. Then, by analyzing parts of the HRV signal within various frequency ranges, the SMQ method extracts rich features of partial information. Finally, the Random Forest (RF) classification computational method is employed to classify the extracted information, achieving efficient and accurate cardiac disease recognition. Experimental results indicate that this method surpasses current technologies in recognizing cardiac diseases, with an average accuracy rate of 95.1% for normal/diseased classification, and an average accuracy of 84.8% in classifying five different disease categories. Thus, the proposed HHDR method effectively utilizes the local information of HRV signals for efficient and accurate cardiac disease recognition, providing strong support for cardiac disease research in the medical field.