A computer-implemented method for calculating a physiological parameter, comprising: - selecting a section of a time domain signal (S10, S20, S30) corresponding to at least one signal of red light and infrared light obtained by sampling, and performing a time-to-frequency domain transformation on the section of the time domain signal to obtain at least one frequency domain signal; - selecting all rational frequency spectrum peaks (S12, S22, S32) from the frequency domain signal, calculating energy and position information of the selected rational frequency spectrum peaks, and forming a frequency spectrum peak energy ratio sequence and a frequency spectrum peak position sequence; - constructing a stability coefficient (S14, S24, S34) according to the frequency spectrum peak energy ratio sequence and the frequency spectrum peak position sequence, and - if the stability coefficient is less than or equal to a set threshold, the stability coefficient is determined to be relatively low, and the method further comprises: (i) constructing a compensation coefficient by using the frequency spectrum peak energy ratio sequence and the frequency spectrum peak position sequence; and (ii) compensating for at least one of the time domain signal and the frequency domain signal by using the compensation coefficient (S16, S26, S36), and (iii) calculating the physiological parameter based on at least one of the compensated time domain signal and frequency domain signal; - if the stability coefficient is higher than the set threshold, the method further comprises: calculating the physiological parameter based on at least one of the time domain signal and frequency domain signal without compensation. - selecting a section of a time domain signal (S10, S20, S30) corresponding to at least one signal of red light and infrared light obtained by sampling, and performing a time-to-frequency domain transformation on the section of the time domain signal to obtain at least one frequency domain signal; - selecting all rational frequency spectrum peaks (S12, S22, S32) from the frequency domain signal, calculating energy and position information of the selected rational frequency spectrum peaks, and forming a frequency spectrum peak energy ratio sequence and a frequency spectrum peak position sequence; - constructing a stability coefficient (S14, S24, S34) according to the frequency spectrum peak energy ratio sequence and the frequency spectrum peak position sequence, and - if the stability coefficient is less than or equal to a set threshold, the stability coefficient is determined to be relatively low, and the method further comprises: (i) constructing a compensation coefficient by using the frequency spectrum peak energy ratio sequence and the frequency spectrum peak position sequence; and (ii) compensating for at least one of the time domain signal and the frequency domain signal by using the compensation coefficient (S16, S26, S36), and (iii) calculating the physiological parameter based on at least one of the compensated time domain signal and frequency domain signal; (i) constructing a compensation coefficient by using the frequency spectrum peak energy ratio sequence and the frequency spectrum peak position sequence; and (ii) compensating for at least one of the time domain signal and the frequency domain signal by using the compensation coefficient (S16, S26, S36), and (iii) calculating the physiological parameter based on at least one of the compensated time domain signal and frequency domain signal; - if the stability coefficient is higher than the set threshold, the method further comprises: calculating the physiological parameter based on at least one of the time domain signal and frequency domain signal without compensation. <EOS>