Heart rate calculation method and device and electronic equipment

By processing ECG data using the Teager Energy Operator (TEO) and combining dynamic and time threshold filtering to remove spurious peaks, the problem of inaccurate heart rate detection caused by T-wave inversion and T-wave elevation is solved, thereby improving the accuracy and stability of heart rate detection.

CN120983014APending Publication Date: 2025-11-21JIANGSU HANYA MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410632185.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-21
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

The inaccuracy of heart rate detection is due to misinterpretations of T-wave inversion and T-wave elevation in existing technologies.

Method used

The Teager Energy Operator (TEO) was used to capture and preprocess ECG data in real time. False peaks were removed by combining dynamic threshold and time threshold filtering. The peak index sequence was obtained and the heart rate value was calculated by the TEO operator.

Benefits of technology

It improves the accuracy and stability of heart rate detection, reduces computational complexity, and is suitable for various practical application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120983014A_ABST
    Figure CN120983014A_ABST
Patent Text Reader

Abstract

The invention discloses a heart rate calculation method and device and electronic equipment. The heart rate calculation method comprises the steps that electrocardiogram data of a current window are obtained; performing noise removal processing on the electrocardiogram data to obtain a first preprocessing sequence; performing R-wave enhancement processing on the first preprocessing sequence to obtain a second preprocessing sequence; performing peak detection on the second preprocessing sequence to obtain a peak index sequence; obtaining an R wave peak value sequence according to the peak value index sequence and the electrocardiogram data; removing the peak index corresponding to the pseudo peak from the peak index sequence to obtain a new peak index sequence; calculating an interval sequence; and calculating a current heart rate value according to the interval sequence. According to the method, the TEO energy operator and the real-time signal processing technology are comprehensively utilized, the accuracy and stability of heart rate detection are effectively improved, meanwhile, the operation complexity is reduced, and the method is more suitable for various practical application scenes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of medical devices and medical signal processing, and particularly relates to a heart rate calculation method and device and electronic equipment. BACKGROUND

[0002] With the enhancement of health awareness and the progress of medical technology, heart rate monitoring has become increasingly important in clinical diagnosis and daily health management. Heart rate, as a key indicator for assessing individual health status and cardiovascular function, its accurate and rapid acquisition is crucial for diagnosing cardiovascular diseases, guiding treatment and health management.

[0003] In early technology, the derivative-based algorithm proposed by Pan and Tompkins is a widely used R-peak detection algorithm. This algorithm is a self-adaptive double-threshold QRS wave detection algorithm that can be used for real-time detection of R waves. The detection is mainly based on the morphological features of R waves, including amplitude, slope, and time information. The algorithm mainly includes two parts: preprocessing-R wave enhancement and R wave comprehensive decision. This method has been widely used in electrocardiogram signal analysis field and is widely used in heart health monitoring devices and cardiac disease diagnosis systems. Due to the need for manual adjustment of the initial threshold value according to different signals, its ability to overcome the misjudgment of T wave inversion and T wave towering through decision judgment is limited, and the accuracy of this algorithm needs to be further improved. SUMMARY

[0004] The present application discloses a heart rate calculation method, device and electronic equipment to solve the problem of misjudgment of T wave inversion and T wave towering in the prior art.

[0005] The first aspect of the present application provides a heart rate calculation method, comprising:

[0006] Obtaining electrocardiogram data of a current window, the electrocardiogram data forming an electrocardiogram signal containing at least two R waves;

[0007] Performing noise removal processing on the electrocardiogram data to obtain a first pre-processing sequence;

[0008] Performing R wave enhancement processing on the first pre-processing sequence to obtain a second pre-processing sequence;

[0009] Performing wave peak detection on the second pre-processing sequence to obtain a peak index sequence;

[0010] Obtaining an R wave peak sequence according to the peak index sequence and the electrocardiogram data;

[0011] According to a pre-set threshold rule, searching for a pseudo-wave peak, removing the peak index corresponding to the pseudo-wave peak from the peak index sequence to obtain a new peak index sequence;

[0012] Based on the new peak index sequence and its relationship with the interval sequence, the interval sequence is calculated;

[0013] Calculate the current heart rate value based on the interval sequence.

[0014] Optionally, the electrocardiogram data is subjected to noise removal processing to obtain a first processing sequence, including:

[0015] The electrocardiogram data is subjected to bandpass filtering to obtain a filtered sequence;

[0016] The filtered sequence is subjected to first-order forward difference to obtain the first preprocessed sequence.

[0017] Optionally, the first preprocessed sequence is subjected to R-wave enhancement processing to obtain a second preprocessed sequence, including:

[0018] Perform TEO calculation on the first preprocessed sequence to obtain a TEO sequence;

[0019] The TEO sequence is smoothed to obtain a second preprocessed sequence.

[0020] Optionally, according to a pre-set threshold rule, spurious peaks are found, and the peak indices corresponding to the spurious peaks are removed from the peak index sequence to obtain a new peak index sequence, including:

[0021] According to the dynamic threshold rule, find the first pseudo-peak in the R-wave peak sequence;

[0022] Remove the peak index corresponding to the first pseudo-peak from the peak index sequence to obtain the first peak index sequence;

[0023] Based on the time threshold rule, find the second pseudo-peak in the first peak index sequence;

[0024] Remove the peak index corresponding to the second pseudo-peak from the first peak index sequence to obtain a new peak index sequence.

[0025] Optionally, based on a dynamic threshold rule, the first pseudo-peak in the R-wave peak sequence is located, including:

[0026] The dynamic threshold is calculated using the following formula:

[0027] θ dynamic =20% × PP max (x(k));

[0028] Where, θ dynamic The dynamic threshold is x(k), and the ECG data is x(k); PP max(x(k)) is a maximum value of peak prominence calculated based on x(k), the peak prominence being a vertical distance of a peak from the lowest contour within its peak interval;

[0029] selecting an arbitrary element in the R-wave peak sequence as a first target element, and determining whether the first target element is less than the dynamic threshold value;

[0030] if the first target element is less than the dynamic threshold value, determining the first target element as a first pseudo-wave peak.

[0031] Optionally, according to a time threshold rule, a second pseudo-wave peak in the first peak index sequence is found, including:

[0032] calculating a first-order forward difference of the first peak index sequence to obtain a first difference sequence;

[0033] calculating a time threshold according to the following formula:

[0034]

[0035] wherein, θ t is the time threshold, f s is a sampling frequency of the electrocardio data;

[0036] selecting an arbitrary element in the first difference sequence as a second target element, and determining whether the second target element is less than the time threshold;

[0037] if the second target element is less than the time threshold, determining whether R(j) is greater than R(j+1), wherein R(j) is an R-wave peak corresponding to the second target element, and R(j+1) is an R-wave peak corresponding to a next element of the second target element;

[0038] if R(j) < R(j+1), determining the second target element as a second pseudo-wave peak.

[0039] Optionally, after the current heart rate value is calculated, further including:

[0040] calculating an absolute value of a difference between the current heart rate value and a previous window heart rate value;

[0041] determining whether the absolute value is greater than a heart rate threshold value, the heart rate threshold value being one fourth of an average heart rate value;

[0042] if the absolute value is not greater than the heart rate threshold value, taking the current heart rate value as a current window heart rate value;

[0043] if the absolute value is greater than the heart rate threshold value, calculating a weighted heart rate value of the current heart rate value and the previous window heart rate value, and taking the weighted heart rate value as the current window heart rate value.

[0044] Optionally, based on the new peak index sequence and its relationship with the interval sequence, the interval sequence is calculated, including:

[0045] The interval sequence is calculated according to the following formula:

[0046]

[0047] Wherein, RR is the interval, D(P(i)) is the first-order forward difference of P(i); P(i) is the new peak index sequence, f s is the sampling frequency of the electrocardio data.

[0048] In a second aspect of the present application, a heart rate calculation device is provided, including:

[0049] A first acquisition module is configured to acquire electrocardio data of a current window, and the electrocardio data forms an electrocardio signal containing at least two R waves;

[0050] A first preprocessing module is configured to perform noise removal processing on the electrocardio data to obtain a first preprocessing sequence;

[0051] A second preprocessing module is configured to perform R wave enhancement processing on the first preprocessing sequence to obtain a second preprocessing sequence;

[0052] A peak detection module is configured to perform wave peak detection on the second preprocessing sequence to obtain a peak index sequence;

[0053] A second acquisition module is configured to acquire an R wave peak sequence according to the peak index sequence and the electrocardio data;

[0054] A third acquisition module is configured to find a pseudo wave peak according to a pre-set threshold rule, remove the peak index corresponding to the pseudo wave peak from the peak index sequence, and obtain a new peak index sequence;

[0055] A first calculation module is configured to calculate an interval sequence based on the new peak index sequence and its relationship with the interval sequence;

[0056] A second calculation module is configured to calculate a current heart rate value according to the interval sequence.

[0057] In a third aspect of the present application, an electronic device is provided, including a memory and a processor, the memory is configured to store a computer program, and the processor is configured to execute the computer program to realize the heart rate calculation method provided in any one of the implementation manners of the first aspect.

[0058] The present application is based on the Teager energy operator (TEO), through real-time interception and data preprocessing of electrocardio data, applying the TEO operator for calculation to obtain a TEO sequence. Then, the TEO sequence is subjected to smoothing processing and wave peak detection to obtain a peak index sequence, and is modified in combination with a buffered electrocardio signal. In the modified peak index sequence, pseudo wave peaks are removed through dynamic threshold and time threshold filtering, and finally a heart rate value is calculated according to the peak index sequence. The method effectively improves the accuracy and stability of heart rate detection by comprehensively utilizing the TEO energy operator and real-time signal processing technology, and reduces the operation complexity, so that it is more suitable for various practical application scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0059] Figure 1 A work flow chart of a heart rate calculation method provided by an embodiment of the present application is shown in FIG. 1.

[0060] Figure 2 Results obtained in each step of the calculation method based on normal heart rhythm electrocardio signals are shown in FIG. 2.

[0061] Figure 3 Results obtained in each step of the calculation method based on T wave high electrocardio signals are shown in FIG. 3.

[0062] Figure 4 Results obtained in each step of the calculation method based on baseline drift electrocardio signals are shown in FIG. 4.

[0063] Figure 5 Results obtained in each step of the calculation method based on T wave inversion electrocardio signals are shown in FIG. 5.

[0064] Figure 6 A work flow chart of another heart rate calculation method provided by an embodiment of the present application is shown in FIG. 6.

[0065] Figure 7 A structural schematic diagram of a heart rate calculation device provided by an embodiment of the present application is shown in FIG. 7. DETAILED DESCRIPTION

[0066] The technical solutions in the embodiments of the present application will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor belong to the scope of protection of the present application.

[0067] In order to facilitate patient monitoring heart rate, the heart rate monitor is placed at the patient. In this embodiment, the heart rate monitor is a single lead continuous electrocardiogram monitoring device or one lead of the multi-lead continuous electrocardiogram monitoring device, generally using limb I, II lead. In one realizable way, the heart rate calculation method provided by the application is applied to the heart rate monitor, and the heart rate monitor directly calculates and displays the results after obtaining the electrocardiogram data; in another realizable way, the heart rate monitor is network connected with a computer device, and the computer device can obtain the electrocardiogram data and calculate, which can be a mobile phone, a personal computer, a workstation or a server, etc., that is, at least one of the personal computer, the workstation and the server is used for heart rate calculation.

[0068] In the prior art, the Teager energy operator (TEO) has attracted widespread attention from researchers. TEO is a very effective signal processing tool that can capture pulses and periodic events in signals, quickly track changes in signals, and the greater the energy value calculated by TEO, the faster the amplitude or frequency change of the corresponding part of the signal. By applying the TEO operator, periodic changes in biological signals including heart rate signals can be extracted and analyzed, overcoming the interference caused by T wave inversion, T wave elevation and baseline drift. Compared with traditional methods, the heart rate calculation method based on TEO has the advantages of simple calculation, strong real-time performance and no need for professional equipment.

[0069] Therefore, the heart rate calculation method based on TEO has become one of the current research hotspots. Through optimization and improvement of TEO, combined with intelligent algorithms and sensor technology, a new type of heart rate monitoring scheme can be developed to provide more convenient and accurate heart rate monitoring means for clinical medical treatment and personal health management.

[0070] Referring to Figure 1 The heart rate calculation method provided by the embodiment of the application includes the following steps:

[0071] Step 101, obtaining electrocardiogram data of a current window, the electrocardiogram data forming an electrocardiogram signal containing at least two R waves.

[0072] Among them, the electrocardiogram data is the electrocardiogram data collected by a single lead continuous electrocardiogram monitoring device, or the electrocardiogram data collected by one lead of a multi-lead continuous electrocardiogram monitoring device.

[0073] In the embodiment, the current window is a current time window. Since the normal heart rate value ranges from 45 to 180 times per minute, the time window is not less than 2 seconds, that is, the electrocardiogram data with a duration of not less than 2 seconds is selected to calculate the heart rate, so that the selected signal segment contains at least one heartbeat, and the heartbeat information of the previous time window in the cache can ensure the monitoring of the minimum heart rate of 30 times per minute.

[0074] The electrocardiogram signal formed by the electrocardiogram data of one heartbeat contains a QRS complex, and the QRS complex corresponds to an R wave. In one case, the electrocardiogram data of the current window contains two R waves, and the next step can be directly performed; in another case, the electrocardiogram data of the current window contains only one R wave, and the electrocardiogram data of the previous window needs to be obtained, and the electrocardiogram data of the two consecutive windows is used in the next step.

[0075] In the same time window, the collected data is related to the sampling frequency of the electrocardiogram monitoring device. When the sampling frequency of the electrocardiogram monitoring device is high, an undersampling method can be used to reduce the calculation amount, thereby reducing the requirement for the hardware device.

[0076] In step 102, the electrocardiogram data is subjected to noise removal processing to obtain a first preprocessed sequence.

[0077] In an implementable manner, step 102 includes the following steps:

[0078] In step 1021, the electrocardiogram data is subjected to band-pass filtering processing to obtain a filtered sequence.

[0079] In the embodiment, the band-pass filter is used to reduce the noise of the electrocardiogram data, and finally the main frequency information of the R wave in the electrocardiogram signal is retained, and the interference noise is filtered as much as possible. The band-pass filtering refers to a band-pass filtering of more than three orders. The band-pass filtering usually adopts a Butterworth digital filter, and the passband cutoff frequency f c is in the range of f c ∈ [5, 35] Hz.

[0080] In step 1022, the filtered sequence is subjected to first-order forward difference to obtain a first preprocessed sequence.

[0081] The difference formula is as follows: Here, Δx is 1, and the difference result can amplify the part with large energy in the electrocardiogram signal, that is, the R wave part.

[0082] In step 103, the first preprocessed sequence is subjected to R wave enhancement processing to obtain a second preprocessed sequence.

[0083] In an implementable mode, step 103 comprises the following steps:

[0084] Step 1031, performing TEO calculation on the first pre-processing sequence to obtain a TEO sequence.

[0085] The definition of Teager energy operator ψ is: ψ[D(n)]=[D(n)] 2 -D(n-1)·D(n+1), wherein D(n) is the first pre-processing sequence obtained by performing first-order forward difference on the filter sequence in step 1022, and the first pre-processing sequence is a discrete signal.

[0086] TEO calculation has a low amount of calculation, and only the values of three continuous sampling points are needed to calculate the energy of the discrete signal. If the energy value calculated through TEO is larger, the amplitude or frequency change of the given signal is faster, which is beneficial to highlight the R wave position.

[0087] Step 1032, performing smoothing processing on the TEO sequence to obtain a second pre-processing sequence.

[0088] In this step, a moving average filter is used for smoothing processing, and the moving average filter usually uses a five-point moving smoothing method, that is, the average value of itself and the four points before and after each data point is taken as the smoothing method of the filter result.

[0089] Step 104, performing wave peak detection on the second pre-processing sequence to obtain a peak index sequence.

[0090] In this step, the wave peak detection method is to judge the size of each point and each point before and after, and if the value of a certain point is greater than each point before and after, the point is considered to be a potential wave peak, and the index of the point is output.

[0091] Step 105, obtaining an R wave peak value sequence according to the peak index sequence and the electrocardio data.

[0092] In this step, according to the peak index, the corresponding peak value in the electrocardio data is searched, and the peak value is a potential R wave peak value. A series of obtained peak values are taken as the R wave peak value sequence.

[0093] Step 106, searching for a false wave peak according to a pre-set threshold rule, removing the peak value index corresponding to the false wave peak from the peak index sequence to obtain a new peak index sequence.

[0094] In this embodiment, the threshold rules mainly include a dynamic threshold rule and a time threshold rule. The dynamic threshold rule mainly considers that the R-wave peak value does not fluctuate too much or does not mutate in a small time interval, and a wave peak that greatly differs from the R-wave peak value is likely to be a T-wave interference. If the "pseudo" R-wave peak value is not filtered, the final heart rate value calculation will be obviously affected. The time threshold rule is based on the maximum heart rate of human beings. Since the maximum heart rate of human beings is mainly limited by the absolute refractory period (ARP) of the heart, the maximum conduction rate is theoretically limited to about 300 times per minute, and the time threshold rule is set in this way.

[0095] In an implementable manner, step 106 includes the following steps:

[0096] Step 1061, according to the dynamic threshold rule, searching for a first pseudo wave peak in the R-wave peak value sequence.

[0097] This step calculates the dynamic threshold according to the following formula: dynamic = 20% x PP max (x(k)); wherein θ dynamic is the dynamic threshold, x(k) is the electrocardio data, PP max (x(k)) is the maximum value of the peak prominence calculated based on x(k); any element in the R-wave peak value sequence is selected as a first target element, and it is judged whether the first target element is less than the dynamic threshold; if the first target element is less than the dynamic threshold, the first target element is determined as the first pseudo wave peak.

[0098] The calculation method of the peak prominence is as follows: a horizontal line is extended from the current wave peak to the left and right sides until the line reaches the window boundary or intersects with the signal again, and the intersection point is located on the rising edge of a higher wave peak; if the intersection point is with a wave peak of the same height, the intersection point is ignored; the signal between the left and right intersection points and the wave peak is defined as a target peak interval; the minimum signal value in the defined interval on each side is found; the larger one of the two minimum signal values is marked as the lowest contour line of the wave peak; then, the peak prominence is calculated as the vertical distance between the peak value of the wave peak itself and the lowest contour line thereof.

[0099] Step 1062, removing the peak index corresponding to the first pseudo wave peak from the peak index sequence to obtain a first peak index sequence.

[0100] Step 1063, according to the time threshold rule, searching for a second pseudo wave peak in the first peak index sequence.

[0101] In this step, first, a first-order forward difference of the first peak index sequence is calculated to obtain a first difference sequence; and the time threshold is calculated according to the following formula: wherein θt is a time threshold, f s is a sampling frequency of the electrocardio data; then taking any element in the first difference sequence as a second target element, judging whether the second target element is less than the time threshold; if the second target element is less than the time threshold, judging whether R(j) is greater than R(j+1), wherein R(j) is an R-wave peak value corresponding to the second target element, and R(j+1) is an R-wave peak value corresponding to a next element of the second target element; if R(j) < R(j+1), determining that the second target element is a second pseudo-wave peak.

[0102] wherein a maximum heart rate value is set as 300 times per minute, i.e. an interval between two heartbeats is 200 ms, and thus a time threshold is set as 200 ms.

[0103] Step 1064, removing the peak value index corresponding to the second pseudo-wave peak from the first peak value index sequence to obtain a new peak value index sequence.

[0104] Step 107, calculating an interval sequence based on the new peak value index sequence and a relationship between the new peak value index sequence and the interval sequence.

[0105] In an implementable manner, the interval sequence is calculated according to the following formula: wherein PR is the interval sequence, D(P(i)) is a first-order forward difference of P(i), P(i) is the new peak value index sequence, f s is a sampling frequency of the electrocardio data.

[0106] Step 108, calculating a current heart rate value according to the interval sequence.

[0107] wherein the current heart rate value is a number of times of R-wave appearing per minute of the electrocardio signal. Two calculation manners are provided in the embodiment, which are described in detail below.

[0108] In the first calculation manner, first, an instantaneous heart rate value is calculated according to each interval in the interval sequence, which is calculated by using the following formula: HR=60 / RR, wherein HR is the instantaneous heart rate value, and RR is the interval sequence; then, an average value of the instantaneous heart rate value is taken as the current heart rate value.

[0109] In the second calculation manner, the current heart rate value is calculated by using the following formula: wherein is the current heart rate value, is an average value of each interval in the interval sequence.

[0110] As can be seen from the above technical solution, this embodiment is based on the Teager Energy Operator (TEO). It performs real-time interception and preprocessing of ECG data, and then applies the TEO operator to calculate the TEO sequence. Next, the TEO sequence is smoothed and peaks are detected to obtain a peak index sequence, which is then corrected using a buffered ECG signal. In the corrected peak index sequence, spurious peaks are removed through dynamic and time threshold filtering, and finally, the heart rate value is calculated based on the peak index sequence. This method, by comprehensively utilizing the TEO energy operator and real-time signal processing technology, effectively improves the accuracy and stability of heart rate detection while reducing computational complexity, making it more suitable for various practical application scenarios.

[0111] Four typical ECG signals were selected from the MIT-BIH arrhythmia database: normal rhythm ECG signal, T-wave tall ECG signal, baseline drift ECG signal, and T-wave inversion ECG signal, to verify the feasibility of the calculation method.

[0112] Figure 2 This is an example provided for an embodiment of this application, where the horizontal axis represents the sampling point and the vertical axis represents the signal amplitude. Figure 2 (a) shows the raw electrocardiogram data; Figure 2 (b) is the filtered sequence after bandpass filtering; Figure 2 (c) is for Figure 2 (b) The filtered sequence is subjected to first-order forward difference to obtain the first preprocessed sequence; Figure 2 (d) is for Figure 2 (c) The first preprocessed sequence is subjected to TEO calculation to obtain the TEO sequence; Figure 2 (e) is for Figure 2 (d) The TEO sequence is smoothed to obtain a second preprocessed sequence. In this step, the smoothing process is specifically a moving mean filter. Figure 2 (f) shows the R-peak search results after removing pseudo-peaks through dynamic threshold and time threshold filtering.

[0113] Figure 3 to Figure 5 The process describes the R-wave detection of raw ECG signals with T-wave peaks, baseline drift, and T-wave inversion. It can be seen that after the first and second preprocessing, the R-wave peaks are highlighted, which improves the inaccuracy caused by T-wave peaks, baseline drift, and T-wave inversion that are common in traditional heart rate calculation methods. In addition, the calculation process of this embodiment is simple, which reduces the amount of computation to a certain extent, providing a more convenient and accurate heart rate monitoring method for clinical medicine and personal health management.

[0114] To further improve the accuracy and stability, the application corrects the heart rate value obtained in step 108, and finally outputs a more accurate heart rate value. The application also provides another heart rate calculation method, in which steps 101-108 operate the same as the workflow diagram shown in Figure 1 The method further includes the following steps, as shown in the workflow diagram shown in Figure 6

[0115] Step 109, calculate the absolute value of the difference between the current heart rate value and the previous window heart rate value.

[0116] Step 1010, determine whether the absolute value is greater than a heart rate threshold, the heart rate threshold being one fourth of the average heart rate value.

[0117] In this step, the "average heart rate value" refers to the average of all previously calculated heart rate values of the ECG signal window.

[0118] Step 1011, if the absolute value is not greater than the heart rate threshold, the current heart rate value is taken as the current window heart rate value.

[0119] Step 1012, if the absolute value is greater than the heart rate threshold, a weighted heart rate value is calculated from the current heart rate value and the previous window heart rate value, and the weighted heart rate value is taken as the current window heart rate value.

[0120] In one implementation, the weighted heart rate value calculation method is a weighted average of the current heart rate value, the previous window heart rate value and the average heart rate value, with weights of 3, 1 and 2 respectively.

[0121] This method introduces a difference determination mechanism between the current heart rate and the previous heart rate calculation result, and performs weighted processing when the difference exceeds a predetermined threshold. The current heart rate value is output when the output standard is met or the predetermined number of times is reached, thereby further improving the accuracy of heart rate value calculation.

[0122] Referring to the structural diagram shown in Figure 7 The application also provides a heart rate calculation device, comprising:

[0123] The first acquisition module 100 is configured to acquire ECG data of a current window, and the ECG data forms an ECG signal containing at least two R waves;

[0124] The first preprocessing module 200 is configured to perform noise removal processing on the ECG data to obtain a first preprocessing sequence;

[0125] The second preprocessing module 300 is configured to perform R wave enhancement processing on the first preprocessing sequence to obtain a second preprocessing sequence;

[0126] ​The peak detection module 400 is configured to perform peak detection on the second preprocessed sequence to obtain a peak index sequence.

[0127] The second acquisition module 500 is configured to obtain an R-wave peak sequence according to the peak index sequence and the electrocardio data.

[0128] The third acquisition module 600 is configured to find a pseudo-wave peak according to a preset threshold rule, remove the peak index corresponding to the pseudo-wave peak from the peak index sequence, and obtain a new peak index sequence.

[0129] The first calculation module 700 is configured to calculate an interval sequence based on the new peak index sequence and a relationship between the new peak index sequence and the interval sequence.

[0130] The second calculation module 800 is configured to calculate a current heart rate value according to the interval sequence.

[0131] The first preprocessing module 200 includes:

[0132] The filtering unit is configured to perform band-pass filtering on the electrocardio data to obtain a filtered sequence.

[0133] The first difference unit is configured to perform first-order forward difference on the filtered sequence to obtain a first preprocessed sequence.

[0134] The second preprocessing module 300 includes:

[0135] The first calculation unit is configured to perform TEO calculation on the first preprocessed sequence to obtain a TEO sequence.

[0136] The smoothing processing unit is configured to perform smoothing processing on the TEO sequence to obtain a second preprocessed sequence.

[0137] The second preprocessing module 300 includes:

[0138] The first threshold finding unit is configured to find a first pseudo-wave peak in the R-wave peak sequence according to a dynamic threshold rule.

[0139] The first removal unit is configured to remove the peak index corresponding to the first pseudo-wave peak from the peak index sequence to obtain a first peak index sequence.

[0140] The second threshold finding unit is configured to find a second pseudo-wave peak in the first peak index sequence according to a time threshold rule.

[0141] The second removal unit is configured to remove the peak index corresponding to the second pseudo-wave peak from the first peak index sequence to obtain a new peak index sequence.

[0142] The first threshold finding unit includes:

[0143] The first calculation subunit is configured to calculate the dynamic threshold value according to the following formula:

[0144] θ dynamic = 20% * PP max (x(k));

[0145] wherein θ dynamic is the dynamic threshold value, x(k) is the electrocardio data, PP max (x(k)) is the maximum value of the peak prominence calculated based on x(k), and the peak prominence is the vertical distance between the peak value and the lowest contour within the peak value interval of the peak value;

[0146] The first judgment subunit is configured to select any element in the R-wave peak value sequence as a first target element, and determine whether the first target element is less than the dynamic threshold value.

[0147] The first determination subunit is configured to determine that the first target element is a first pseudo-wave peak in a case where the first judgment subunit determines that the first target element is less than the dynamic threshold value.

[0148] The second threshold value searching unit comprises:

[0149] The second calculation subunit is configured to calculate the first-order forward difference of the first peak index sequence to obtain a first difference sequence.

[0150] The third calculation subunit is configured to calculate the time threshold value according to the following formula:

[0151]

[0152] wherein θ t is the time threshold value, and f s is the sampling frequency of the electrocardio data.

[0153] The second judgment subunit is configured to select any element in the first difference sequence as a second target element, and determine whether the second target element is less than the time threshold value.

[0154] The third judgment subunit is configured to determine whether R(j) is greater than R(j+1) in a case where the second judgment subunit determines that the second target element is less than the time threshold value, wherein R(j) is the R-wave peak value corresponding to the second target element, and R(j+1) is the R-wave peak value corresponding to the next element of the second target element.

[0155] The second determination subunit is configured to determine that the second target element is a second pseudo-wave peak in a case where the third judgment subunit determines that R(j) < R(j+1).

[0156] The heart rate calculation device provided by the embodiment of the present application further comprises:

[0157] The third calculation module is configured to calculate an absolute value of a difference between the current heart rate value and the previous window heart rate value after the second calculation module calculates the current heart rate value;

[0158] The judgment module is configured to judge whether the absolute value is greater than a heart rate threshold value, wherein the heart rate threshold value is one fourth of the average heart rate value;

[0159] The first heart rate value determination module is configured to, in the case that the absolute value is not greater than the heart rate threshold value, take the current heart rate value as the current window heart rate value;

[0160] The second heart rate value determination module is configured to, in the case that the absolute value is greater than the heart rate threshold value, calculate a weighted heart rate value of the current heart rate value and the previous window heart rate value, and take the weighted heart rate value as the current window heart rate value.

[0161] The first calculation module 700 comprises:

[0162] The second calculation unit is configured to calculate the interval sequence according to the following formula:

[0163]

[0164] Wherein, RR is the interval, D(P(i)) is the first-order forward difference of P(i); P(i) is the new peak value index sequence, f s is the sampling frequency of the electrocardiogram data.

[0165] The embodiment of the present application further provides an electronic device comprising a memory and a processor, wherein the memory is configured to store a computer program, and the processor is configured to execute the computer program to realize the heart rate calculation method. Figure 1 The heart rate calculation method provided by any one of the implementation manners.

[0166] The above are merely embodiments of the present application and are not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.

Claims

1. A method for calculating heart rate, characterized in that, include: Acquire the ECG data of the current window, wherein the ECG signal formed by the ECG data contains at least two R waves; The electrocardiogram data is subjected to noise removal processing to obtain a first preprocessed sequence; The first preprocessed sequence is subjected to R-wave enhancement processing to obtain the second preprocessed sequence; Peak detection is performed on the second preprocessed sequence to obtain the peak index sequence; Based on the peak index sequence and the electrocardiogram data, the R-wave peak sequence is obtained; False peaks are found according to a pre-set threshold rule, and the peak index corresponding to the false peak is removed from the peak index sequence to obtain a new peak index sequence. Based on the new peak index sequence and its relationship with the interval sequence, the interval sequence is calculated; Calculate the current heart rate value based on the interval sequence.

2. The heart rate calculation method according to claim 1, characterized in that, The electrocardiogram data is subjected to noise removal processing to obtain a first processing sequence, including: The electrocardiogram data is subjected to bandpass filtering to obtain a filtered sequence; The filtered sequence is subjected to first-order forward difference to obtain the first preprocessed sequence.

3. The heart rate calculation method according to claim 1, characterized in that, The first preprocessed sequence is subjected to R-wave enhancement processing to obtain a second preprocessed sequence, including: Perform TEO calculation on the first preprocessed sequence to obtain a TEO sequence; The TEO sequence is smoothed to obtain a second preprocessed sequence.

4. The heart rate calculation method according to claim 1, characterized in that, Pseudo-peaks are identified according to a pre-set threshold rule. The peak index corresponding to the pseudo-peak is removed from the peak index sequence to obtain a new peak index sequence, including: According to the dynamic threshold rule, find the first pseudo-peak in the R-wave peak sequence; Remove the peak index corresponding to the first pseudo-peak from the peak index sequence to obtain the first peak index sequence; Based on the time threshold rule, find the second pseudo-peak in the first peak index sequence; Remove the peak index corresponding to the second pseudo-peak from the first peak index sequence to obtain a new peak index sequence.

5. The heart rate calculation method according to claim 4, characterized in that, According to the dynamic threshold rule, the first pseudo-peak in the R-wave peak sequence is located, including: The dynamic threshold is calculated using the following formula: i dynamic =20%×PP max (x(k)); Where, θ dynamic The dynamic threshold is x(k), and the ECG data is x(k); PP max (x(k)) is the maximum value of the peak prominence calculated based on x(k), where the peak prominence is the vertical distance between the peak and the lowest contour line within the peak interval; Select any element from the R-wave peak sequence as the first target element, and determine whether the first target element is less than the dynamic threshold. If the first target element is smaller than the dynamic threshold, then the first target element is determined to be the first pseudo-peak.

6. The heart rate calculation method according to claim 4, characterized in that, Based on the time threshold rule, the second pseudo-peak in the first peak index sequence is searched, including: Calculate the first-order difference of the first peak index sequence to obtain the first difference sequence; Calculate the time threshold using the following formula: Where, θ t f is the time threshold. s The sampling frequency of the electrocardiogram data; Take any element in the first difference sequence as the second target element, and determine whether the second target element is less than the time threshold; If the second target element is less than the time threshold, determine whether R(j) is greater than R(j+1), where R(j) is the R-wave peak value corresponding to the second target element, and R(j+1) is the R-wave peak value corresponding to the next element after the second target element. If R(j) < R(j+1), then the second target element is determined to be the second pseudo-peak.

7. The heart rate calculation method according to claim 1, characterized in that, After calculating the current heart rate, the following is also included: Calculate the absolute value of the difference between the current heart rate value and the heart rate value in the previous window; Determine whether the absolute value is greater than a heart rate threshold, where the heart rate threshold is one-quarter of the average heart rate value; If the absolute value is not greater than the heart rate threshold, then the current heart rate value is used as the current window heart rate value; If the absolute value is greater than the heart rate threshold, then calculate the weighted heart rate value of the current heart rate value and the heart rate value of the previous window, and use the weighted heart rate value as the heart rate value of the current window.

8. The heart rate calculation method according to claim 1, characterized in that, Based on the new peak index sequence and its relationship with the interval sequence, the interval sequence is calculated, including: Calculate the interval series using the following formula: Where RR is the interval, D(P(i)) is the first-order forward difference of P(i); P(i) is the new peak index sequence, f s The sampling frequency of the electrocardiogram data is denoted as .

9. A heart rate calculation device, characterized in that, include: The first acquisition module is used to acquire the electrocardiogram (ECG) data of the current window, wherein the ECG signal formed by the ECG data contains at least two R waves. The first preprocessing module is used to perform noise removal processing on the electrocardiogram data to obtain a first preprocessed sequence; The second preprocessing module is used to perform R-wave enhancement processing on the first preprocessed sequence to obtain the second preprocessed sequence; The peak detection module is used to perform peak detection on the second preprocessed sequence to obtain a peak index sequence; The second acquisition module is used to obtain the R-wave peak sequence based on the peak index sequence and the electrocardiogram data; The third acquisition module is used to find pseudo-peaks according to a pre-set threshold rule, remove the peak index corresponding to the pseudo-peak from the peak index sequence, and obtain a new peak index sequence. The first calculation module is used to calculate the interval sequence based on the new peak index sequence and its relationship with the interval sequence; The second calculation module is used to calculate the current heart rate value based on the interval sequence.

10. An electronic device, characterized in that, The system includes a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to implement the heart rate calculation method according to any one of claims 1 to 8.