A method for real-time detection of the mental stress state during speech through heart rate measurement is disclosed. The method comprises the steps of electrocardiosignal acquisition, R wave positioning, calculation of the heart rate, calculation of respiratory sinus arrhythmia indexes, calculation of heart rate variation indexes, and calculation of the heart rate mean value. In the non-strenuous exercise state, a short RR interval mean value and a small heart rate variation rate are shown, and (or) the situation that RR intervals are continuously lengthened or continuously shortened for many times in the adjacent intervals due to shallow and slow breathing, and it is suggested that a speaker is in a mental stress state. Particularly, the continuous variable lengthening or continuous shortening of the RR adjacency intervals occurs many times only during the speech period, which usually indicates that the speaker is in a weak mental stress state; when the first two features or all three features occur, it is suggested that the speaker is in a strong mental stress state; and when the three features do not occur, it is prompted that no mental stress occurs to the speaker. Through the detection of the small RR interval mean value, the low heart rate variability and the sinus arrhythmia indexes caused by shallow and slow breathing, and a empirical threshold method or a classical classifier is adopted, so that the method for real-time detection of the mental stress state during speech is obtained.