Continuous heart rate detection method, device, electronic device and storage medium
By storing PPG signal data points in a cache queue, determining a stable reference heart rate value and performing fitting, the problem of inaccurate heart rate detection caused by Fourier transform technology is solved, and more accurate heart rate detection is achieved.
Patent Information
- Application Number
- CN202411626240.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-11-12
AI Technical Summary
In the prior art, the heart rate value detection result determined by Fourier transform technology is not accurate enough and cannot accurately detect the heart rate change.
By setting a cache queue to store the latest PPG signal data points, a stable reference heart rate value is determined, and a preset fitting curve is used to fit the candidate frequency value, avoiding the Fourier transform technology to update the heart rate value and reduce the frequency resolution.
The accuracy and frequency resolution of heart rate detection are improved without affecting the time domain resolution, and the current heart rate value can be output with the set accuracy.
Smart Images

Figure CN119453969B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of heart rate detection technology, and in particular to a method, device, electronic device and storage medium for continuous heart rate detection. Background Art
[0002] Many wearable devices currently have real-time heart rate monitoring capabilities. Current methods for continuous heart rate monitoring typically use Fourier transform technology to determine the spectral range to which the current heart rate value belongs based on the collected photoplethysmography (PPG) signal. The frequency value corresponding to the current heart rate value is then determined from this range to obtain the final heart rate value. However, the heart rate detection results obtained using this method are not accurate enough. Summary of the Invention
[0003] In view of this, the present application provides a method, device, electronic device and storage medium for continuous heart rate detection to improve the accuracy of continuous heart rate detection results.
[0004] The technical solutions provided in this application are as follows:
[0005] According to an embodiment of the first aspect of the present application, a method for continuous heart rate detection is provided, the method comprising:
[0006] Setting a cache queue, the cache queue is used to store the latest M data points in the reference photoplethysmography (PPG) signal obtained through preprocessing, where M is determined according to the sampling frequency of the reference PPG signal;
[0007] In a case where M data points have been stored in the cache queue, at every first time interval, a reference heart rate value corresponding to the M data points is determined based on the latest M data points stored in the cache queue, until the absolute value of the difference between any two adjacent reference heart rate values in K consecutive reference heart rate values is less than a preset threshold, and then an initial heart rate value is determined based on the K reference heart rate values;
[0008] Taking the initial heart rate value as the current heart rate value, after a second time interval, determining a frequency value sequence corresponding to the current heart rate value based on the current heart rate value and a preset heart rate resolution; the frequency value sequence records all possible candidate frequency values corresponding to the target heart rate value obtained after the current heart rate value is updated;
[0009] For each candidate frequency value in the frequency value sequence, fitting the latest M data points stored in the cache sequence according to a preset fitting curve and the candidate frequency value;
[0010] The candidate frequency value corresponding to the maximum fitting result is determined as the target frequency value; the target heart rate value is determined according to the target frequency value; and the current heart rate value is updated to the target heart rate value.
[0011] Optionally, after updating the current heart rate value to the target heart rate value, the method further includes:
[0012] The target heart rate value is used as the current heart rate value, and the step of determining the frequency value series corresponding to the current heart rate value according to the current heart rate value and the preset heart rate resolution after the second time interval has passed is returned until an instruction to stop heart rate detection is received.
[0013] Optionally, the reference photoplethysmography (PPG) signal is obtained by:
[0014] Filter the obtained raw acceleration sensor ACC signal and raw PPG signal through the configured filter to obtain candidate ACC signal and candidate PPG signal;
[0015] The candidate ACC signal is input into a configured adaptive filter to obtain a filter output signal, and the reference PPG signal is determined according to the candidate PPG signal and the filter output signal.
[0016] Optionally, determining the reference heart rate values corresponding to the M latest data points stored in the cache queue includes:
[0017] Perform a Fast Fourier Transform (FFT) on the latest M data points stored in the cache queue to obtain a frequency spectrum corresponding to the M data points;
[0018] A frequency value corresponding to a spectrum peak is determined according to the spectrum diagram, and the reference heart rate value is determined according to the frequency value corresponding to the spectrum peak.
[0019] Optionally, determining the initial heart rate value according to the K reference heart rate values includes:
[0020] Taking the last reference heart rate value among the K reference heart rate values as the initial heart rate value;
[0021] Alternatively, the average value of the K reference heart rate values is used as the initial heart rate value.
[0022] Optionally, determining a frequency value series corresponding to the current heart rate value according to the current heart rate value and a preset heart rate resolution includes:
[0023] generating a heart rate value series centered on the current heart rate value and at intervals of the heart rate resolution; wherein the heart rate value series records all possible target heart rate values obtained after the current heart rate value is updated; and the number of heart rate values included in the heart rate value series is determined based on the maximum range of heart rate changes within the second time interval and the heart rate resolution;
[0024] The heart rate value sequence is converted into a frequency value sequence corresponding to the heart rate value.
[0025] According to an embodiment of the second aspect of the present application, a device for continuous heart rate detection is provided, the device comprising:
[0026] a setting unit, configured to set a cache queue, wherein the cache queue is configured to store the latest M data points in the preprocessed reference photoplethysmography (PPG) signal, where M is determined according to a sampling frequency of the reference PPG signal;
[0027] a determining unit, configured to, when M data points have been stored in the cache queue, determine, at first intervals, reference heart rate values corresponding to the M data points based on the latest M data points stored in the cache queue, until the absolute value of the difference between any two adjacent reference heart rate values in K consecutive reference heart rate values is less than a preset threshold, and then determine an initial heart rate value based on the K reference heart rate values;
[0028] Taking the initial heart rate value as the current heart rate value, after a second time interval, determining a frequency value sequence corresponding to the current heart rate value based on the current heart rate value and a preset heart rate resolution; the frequency value sequence records all possible candidate frequency values corresponding to the target heart rate value obtained after the current heart rate value is updated;
[0029] a fitting unit, configured to fit, for each candidate frequency value in the frequency value sequence, the latest M data points stored in the cache sequence according to a preset fitting curve and the candidate frequency value;
[0030] The updating unit is configured to determine the candidate frequency value corresponding to the maximum fitting result as the target frequency value; determine the target heart rate value according to the target frequency value; and update the current heart rate value to the target heart rate value.
[0031] Optionally, after updating the current heart rate value to the target heart rate value, the updating unit is further configured to:
[0032] Taking the target heart rate value as the current heart rate value, returning to the step of determining a frequency value sequence corresponding to the current heart rate value according to the current heart rate value and a preset heart rate resolution after the second time interval has passed, until receiving an instruction to stop heart rate detection;
[0033] And / or, the reference photoplethysmography (PPG) signal is obtained by:
[0034] Filter the obtained raw acceleration sensor ACC signal and raw PPG signal through the configured filter to obtain candidate ACC signals and candidate PPG signals;
[0035] Inputting the candidate ACC signal into a configured adaptive filter to obtain a filter output signal, and determining the reference PPG signal based on the candidate PPG signal and the filter output signal;
[0036] And / or, the determining unit is specifically configured to:
[0037] Perform a Fast Fourier Transform (FFT) on the latest M data points stored in the cache queue to obtain a frequency spectrum corresponding to the M data points;
[0038] Determine a frequency value corresponding to a spectrum peak according to the spectrum graph, and determine the reference heart rate value according to the frequency value corresponding to the spectrum peak;
[0039] And / or, the determining unit is specifically configured to:
[0040] Taking the last reference heart rate value among the K reference heart rate values as the initial heart rate value;
[0041] Alternatively, the average of the K reference heart rate values is used as the initial heart rate value;
[0042] And / or, the determining unit is specifically configured to:
[0043] generating a heart rate value series centered on the current heart rate value and at intervals of the heart rate resolution; wherein the heart rate value series records all possible target heart rate values obtained after the current heart rate value is updated; and the number of heart rate values included in the heart rate value series is determined based on the maximum range of heart rate changes within the second time interval and the heart rate resolution;
[0044] The heart rate value sequence is converted into a frequency value sequence corresponding to the heart rate value.
[0045] According to an embodiment of the third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0046] According to an embodiment of the fourth aspect of the present application, a computer-readable storage medium is provided, on which a number of computer instructions are stored. When the computer instructions are executed, the method described in the first aspect is implemented.
[0047] It can be seen from the above technical solution that the present application sets up a cache queue for the latest M data points in the reference photoplethysmography (PPG) signal obtained after preprocessing, and determines a reference heart rate value in the cache queue based on the latest data point at regular intervals until the detected K consecutive reference heart rate values are relatively stable, and then determines the initial heart rate value based on the K reference heart rate values; further, the initial heart rate value is used as the current heart rate value, and after a second time interval, the candidate frequency value that may correspond to the updated target heart rate value is determined based on the current heart rate value and the preset heart rate resolution, and fitting is performed based on the preset fitting curve for each candidate frequency value and the data points stored in the current cache queue, and the heart rate value corresponding to the candidate frequency value corresponding to the maximum fitting result is determined as the target heart rate value, thereby avoiding the use of Fourier transform technology to update the heart rate value, and achieving a reduction in frequency resolution without affecting the time domain resolution, thereby obtaining a more accurate heart rate value. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0049] Figure 1 A schematic diagram of the PPG signal generation principle provided in an embodiment of the present application;
[0050] Figure 2 A flowchart of the continuous heart rate detection method provided in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of preprocessing based on an adaptive filter provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of the overall process of the continuous heart rate detection method provided in an embodiment of the present application;
[0053] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0054] Figure 6 This is a structural diagram of a continuous heart rate detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application are further described in detail below with reference to the accompanying drawings.
[0056] Currently, many wearable devices have the function of continuous heart rate detection. The current method for continuous heart rate detection is usually based on the collected photoplethysmography (PPG) signal, using Fourier transform technology to determine the spectrum interval to which the current heart rate value belongs, and then determine the frequency value corresponding to the current heart rate value from this interval to obtain the final heart rate value.
[0057] The following combination Figure 1 A brief description of the PPG signal acquisition method is given below.
[0058] Please refer to Figure 1 , Figure 1 Schematic diagram of the PPG signal generation principle provided in an embodiment of the present application.
[0059] like Figure 1 As shown, the PPG sensor consists of at least a pair of light emitting diodes (LEDs) and photodetectors (PDs).
[0060] The light-emitting diode is used to provide a light source to illuminate the skin, and the photodetector is used to generate different signals according to the intensity change of the detected light.
[0061] Common PGG sensors usually include the following two arrangements: projection sensor ( Figure 1 left side of the figure) and reflective sensors ( Figure 1 middle right figure).
[0062] In a projected sensor, a light-emitting diode (LED) acts as a light source to illuminate the skin. A photodetector receives the light transmitted through the skin and detects changes in light intensity. When the heart contracts, blood flow in the blood vessels increases, increasing the amount of light absorbed by the blood and the amount of light transmitted. Conversely, when the heart relaxes, the intensity of the transmitted light decreases.
[0063] For example, a reflective sensor uses a light-emitting diode (LED) as a light source to illuminate the skin. A photodetector receives the light reflected from the skin and detects changes in light intensity. When the heart contracts, blood flow in the blood vessels increases, increasing light absorption by the blood and reducing the amount of reflected light. Conversely, when the heart relaxes, the intensity of the reflected light increases.
[0064] Under this mechanism, the fluctuating PPG signal generated by the periodic contraction and relaxation of the heart can be used to monitor heart rate.
[0065] This concludes Figure 1 Description.
[0066] Currently, heart rate values derived from Fourier transforms are not accurate enough, limited by the frequency resolution of Fourier transform technology. For example, assuming a PPG signal with a sampling frequency of 25Hz and 256 sampling points, and a Fourier transform of the signal with a duration of approximately 10 seconds (256 / 25), the resulting frequency spectrum has a resolution of 25 / 256 = 0.0977Hz, corresponding to a heart rate resolution of 0.0977*60 = 5.86bpm. This results in a high heart rate resolution, making it impossible to detect smaller heart rate changes, and thus unsatisfactory accuracy.
[0067] Based on this, the present application proposes a method for continuous heart rate detection to improve the accuracy of continuous heart rate detection.
[0068] Please refer to Figure 2 , Figure 2 This is a flowchart of the continuous heart rate detection method provided in an embodiment of the present application.
[0069] As an embodiment, the method can be applied to wearable devices, such as smart bracelets, smart watches, electrocardiogram monitors, finger-clip heart rate monitors, etc., and this application does not limit this.
[0070] like Figure 2 As shown, the method may include the following steps:
[0071] Step 201: Set a cache queue.
[0072] In this embodiment, in order to detect continuous heart rate, it is first necessary to determine the initial heart rate value when the detection starts. In order to determine the initial heart rate value, this embodiment pre-sets a cache queue for storing a reference photoplethysmography (PPG) signal. The cache queue is used to store the latest M data points in the preprocessed reference photoplethysmography (PPG) signal. The value of M can be determined according to the sampling frequency of the reference PPG signal.
[0073] The reference PPG signal is obtained by preprocessing the original PPG signal and the original ACC signal. Each data point in the reference PPG signal represents the instantaneous value of the blood volume in the blood vessel at the measurement location at that moment. The heart rate value can be obtained by analyzing multiple data points, i.e., the instantaneous values of blood volume at multiple moments.
[0074] As an embodiment, the reference PPG signal may be obtained by:
[0075] Filter the obtained raw acceleration sensor ACC signal and raw PPG signal through the configured filter to obtain candidate ACC signal and candidate PPG signal;
[0076] The candidate ACC signal is input into the configured adaptive filter to obtain the filter output signal, and the reference PPG signal is determined based on the candidate PPG signal and the filter output signal.
[0077] In this embodiment, after the raw PPG signal is obtained through the PPG sensor and the raw ACC signal is obtained through the acceleration sensor, since the raw PPG signal may be affected by ambient light, the raw PPG signal and the raw ACC signal may have high-frequency noise and low-frequency baseline drift, so the raw PPG signal and the raw ACC signal can be preprocessed to eliminate the above-mentioned influences.
[0078] As an embodiment, in order to eliminate the influence of ambient light, the analog-to-digital conversion value collected when the LED light in the PPG sensor is off can be subtracted from the analog-to-digital conversion value collected when the LED light in the PPG sensor is on; in order to eliminate the influence of high-frequency noise and low-frequency baseline drift, the original PPG signal and the original ACC signal can be passed through a preset filter such as a bandpass filter, which is not limited in this application.
[0079] In this embodiment, motion artifacts may also exist in the PPG signal, and the influence of the motion artifacts can be eliminated by setting an adaptive filter.
[0080] As an example, please refer to Figure 3 , Figure 3 A schematic diagram of preprocessing based on an adaptive filter provided in an embodiment of the present application.
[0081] like Figure 3 As shown, the ACC signal (referred to as the candidate ACC signal) obtained after eliminating the influence of ambient light, high-frequency noise and low-frequency baseline drift can be used as the input signal of the adaptive filter, the PPG signal (referred to as the candidate PPG signal) obtained after eliminating the influence of ambient light, high-frequency noise and low-frequency baseline drift can be used as the expected signal, and the difference between the expected signal and the filter output signal can be used as the error signal (i.e., the reference PPG signal).
[0082] After the error signal is used as a reference PPG signal stored in the cache queue, the parameters of the adaptive filter can be further updated based on the adaptive algorithm according to the error signal.
[0083] As an embodiment, the adaptive algorithm for updating the filter parameters may be a least mean squares (LMS) algorithm or a recursive least squares (RLS) algorithm, etc., which is not limited in this application.
[0084] This concludes Figure 3 Description.
[0085] After obtaining the reference PPG signal, the reference PPG signal can be stored in a cache queue. It should be noted that the PPG signal stored in the cache queue is dynamically changed, and the cache queue always only stores the latest M data points in the PPG signal. The value of M can be set according to an empirical value. For example, it can be determined according to the sampling frequency of the reference PPG signal and set to 4 times the sampling frequency of the reference PPG signal, etc. This application does not impose any restrictions on this.
[0086] At this point, the description of step 201 ends, and step 202 is executed next.
[0087] Step 202: When M data points have been stored in the cache queue, at every first time interval, the reference heart rate value corresponding to the M data points is determined based on the latest M data points stored in the cache queue, until the absolute value of the difference between any two adjacent reference heart rate values in K consecutive reference heart rate values is less than a preset threshold, then the initial heart rate value is determined based on the K reference heart rate values, where K is greater than 1.
[0088] In this embodiment, as the PPG sensor collects the initial PPG signal and obtains the reference PPT signal after processing, M data points are gradually stored in the cache queue. When M data points have been stored in the cache queue, a corresponding reference heart rate value can be determined according to the most recently stored M data points at every first time interval.
[0089] As an embodiment, a method for determining the reference heart rate values corresponding to the M latest data points stored in the cache queue may include:
[0090] Perform a Fast Fourier Transform (FFT) on the latest M data points stored in the cache queue to obtain a frequency spectrum corresponding to the M data points;
[0091] The frequency value corresponding to the spectrum peak is determined according to the spectrum graph, and the reference heart rate value is determined according to the frequency value corresponding to the spectrum peak.
[0092] In this embodiment, the latest M data points stored in the cache queue can be subjected to a fast Fourier transform to obtain a spectrum diagram corresponding to the M data points. The spectrum diagram records the signal amplitude corresponding to each frequency. At this time, the frequency value corresponding to the spectrum line (i.e., the spectrum peak) with the largest signal amplitude in the spectrum diagram can be used as the reference frequency value of the M data points, and the heart rate value corresponding to the frequency value can be determined as the reference heart rate value corresponding to the M data points.
[0093] In this embodiment, at every first time interval, a reference heart rate value is determined based on the latest M data points stored in the current cache queue. At the same time, the currently determined reference heart rate value can also be compared with the previously determined reference heart rate value. If the absolute value of the difference between any two adjacent reference heart rate values in the consecutive K reference heart rate values is less than the preset threshold, it indicates that the heart rate value detected at this time is relatively stable, and the initial heart rate value can be determined based on the consecutive K reference heart rate values.
[0094] In this embodiment, the method for determining the initial heart rate value based on K reference heart rate values may include:
[0095] The last reference heart rate value among the K reference heart rate values is used as the initial heart rate value;
[0096] Alternatively, the average of K reference heart rate values is used as the initial heart rate value, which is not limited in this application.
[0097] In this embodiment, K is an integer greater than 1 and can be set according to actual needs. At the same time, the first time interval can also be set according to actual needs, and this application does not limit this.
[0098] At this point, the description of step 202 ends, and step 203 is executed next.
[0099] Step 203: Taking the initial heart rate value as the current heart rate value, after a second time interval, determining a frequency value series corresponding to the current heart rate value according to the current heart rate value and a preset heart rate resolution.
[0100] In this embodiment, steps 201 and 202 complete the determination of the initial heart rate value. After the initial heart rate value is determined, the initial heart rate value can be used as the current heart rate value and displayed on the wearable device as the first heart rate value detected by the wearable device after the user initiates a heart rate detection instruction. Furthermore, if the user does not issue an instruction to stop heart rate detection, the heart rate value needs to be continuously detected and updated at regular intervals.
[0101] In this embodiment, the second time interval is the interval duration for updating the heart rate value, which can be adjusted according to actual needs and is not limited in this application.
[0102] As an embodiment, the M data points stored in the cache queue may be the latest M data points in the reference PPG signal, or may be any M consecutive data points within the second time interval, which is not limited in the present application.
[0103] In this embodiment, after the second time interval, the current heart rate value needs to be updated. At this time, the frequency value series corresponding to the current heart rate value can be determined based on the current heart rate value and the preset heart rate resolution, wherein the frequency value series records all possible candidate frequency values corresponding to the target heart rate value obtained after the current heart rate value is updated.
[0104] As an embodiment, the method for determining the frequency value sequence corresponding to the current heart rate value according to the current heart rate value and the preset heart rate resolution may specifically include:
[0105] Generating a heart rate value sequence centered on the current heart rate value and at intervals of the heart rate resolution; wherein the heart rate value sequence records all possible target heart rate values obtained after the current heart rate value is updated; and the number of heart rate values included in the heart rate value sequence is determined based on the maximum range of heart rate variation within the second time interval and the heart rate resolution;
[0106] Convert the heart rate value series into the frequency value series corresponding to the heart rate values.
[0107] In this embodiment, the current heart rate value can be updated based on the pre-set heart rate resolution and the second time interval. The heart rate resolution is the smallest heart rate change that the system can distinguish. The first item of the heart rate value series is the minimum value that the heart rate value may take in the second time interval, and the last item of the heart rate value series is the maximum value that the heart rate value may take in the second time interval.
[0108] For example, the set heart rate resolution can be recorded as Δhr, and the current heart rate value can be recorded as hr. Then, the method for determining the frequency value series can be:
[0109] With hr as the center and Δhr as the interval, generate a heart rate value sequence of length 2N+1. This sequence is an arithmetic progression: hr-Δhr*N, hr-Δhr*(N-1),…,hr-Δhr, hr, hr+Δhr,…,hr+Δhr*(N-1), hr+hr*N. N is an empirical value determined based on the maximum range of heart rate changes within the second time interval and the heart rate resolution.
[0110] For example, if the second time interval is 2 seconds, the maximum range of possible changes in heart rate within 2 seconds is 5 beats per minute (bpm), and the heart rate resolution is 1 bpm. That is, assuming the current heart rate is 80 bpm, the possible values of the heart rate after changing within 2 seconds are 75 bpm, 76 bpm, 77 bpm, 78 bpm, 79 bpm, 80 bpm, 81 bpm, 82 bpm, 83 bpm, 84 bpm, and 85 bpm, for a total of 11 possible values. At this time, the value of N is 5.
[0111] After determining the heart rate value sequence, the heart rate value sequence can be converted into a corresponding frequency value sequence: f-Δf*N, f-Δf*(N-1),…, f-Δf, f, f+Δf,…, f+Δf*(N-1), f+Δf*N. The frequency values in the frequency value sequence correspond one-to-one with the heart rate values in the heart rate value sequence. Since the heart rate value is the number of heartbeats per minute and the frequency value is the number of heartbeats per second, the frequency value corresponding to the heart rate value is the heart rate value divided by 60.
[0112] As an embodiment, multiple candidate frequency values can be directly generated based on the initial heart rate value. For example, a target experience value can be directly subtracted or added to the initial heart rate value hr to obtain multiple candidate frequency values. This application does not limit this.
[0113] At this point, the description of step 203 ends, and step 204 is executed next.
[0114] Step 204 : For each candidate frequency value in the frequency value sequence, the latest M data points stored in the cache sequence are fitted according to a preset fitting curve and the candidate frequency value.
[0115] In this embodiment, for the frequency value series determined in step 203 , fitting may be performed for each candidate frequency value according to a preset fitting curve and the latest M data points stored in the cache series.
[0116] As an example, the fitting curve may be determined as:
[0117]
[0118] Where y is the reference PPG signal corresponding to the M data points stored in the cache queue, that is, the instantaneous value of the blood volume in the blood vessel at the measurement location at that moment, f is each candidate frequency value in the above frequency value series, and t is the duration of the time series generated based on the sampling rate and the cache queue length.
[0119] By fitting an amplitude Y and phase for each candidate frequency value
[0120] At this point, the description of step 204 ends, and step 205 is executed next.
[0121] Step 205: determine the candidate frequency value corresponding to the maximum fitting result as the target frequency value; determine the target heart rate value according to the target frequency value; and update the current heart rate value to the target heart rate value.
[0122] In this embodiment, since there are 2N+1 candidate frequency values in total, after fitting each candidate frequency value, 2N+1 amplitudes Y can be obtained. The candidate frequency value corresponding to the largest amplitude Y can be selected from the 2N+1 amplitudes Y as the target frequency value corresponding to the target heart rate value to be updated, that is, the candidate frequency value corresponding to the maximum fitting result is determined as the target frequency value, and the corresponding target heart rate value is further determined based on the target frequency value. The target heart rate value is used as the updated current heart rate value and displayed on the wearable device.
[0123] This concludes the description of step 205.
[0124] The above process is the overall process of one update. In fact, if the user does not issue an instruction to stop the detection, the heart rate value needs to be updated multiple times.
[0125] As an embodiment, after the current heart rate value is updated to the target heart rate value, the target heart rate value can be used as the current heart rate value, and after returning to the second time interval, the step of determining the frequency value series corresponding to the current heart rate value based on the current heart rate value and the preset heart rate resolution is performed until an instruction to stop heart rate detection is received.
[0126] In this embodiment, after completing one update, the target heart rate value can be used as the new current heart rate value, and the process returns to the step of determining the target heart rate value to determine the next target heart rate value that needs to be updated.
[0127] This concludes Figure 1 Description of the flow chart of the heart rate continuous detection method.
[0128] The present application sets up a cache queue for the latest M data points in the reference photoplethysmography (PPG) signal obtained after preprocessing. In the cache queue, a reference heart rate value is determined based on the latest data point at regular intervals until K consecutive reference heart rate values detected are relatively stable, and then an initial heart rate value is determined based on the K reference heart rate values. The initial heart rate value is further used as the current heart rate value, and after a second time interval, the candidate frequency value that may correspond to the updated target heart rate value is determined based on the current heart rate value and a preset heart rate resolution. Fitting is performed based on a preset fitting curve for each candidate frequency value and the data points stored in the current cache queue, and the heart rate value corresponding to the candidate frequency value corresponding to the maximum fitting result is determined as the target heart rate value, thereby avoiding the use of Fourier transform technology to update the heart rate value, reducing the frequency resolution without affecting the time domain resolution, and obtaining a more accurate heart rate value.
[0129] Furthermore, the solution proposed in this application can output the current heart rate value with any set accuracy without affecting the time domain resolution, that is, the current heart rate value can be updated with the set accuracy at the set update time interval.
[0130] Below through Figure 4 This article introduces the overall process of the continuous heart rate detection method.
[0131] Please refer to Figure 4 , Figure 4 A schematic diagram of the overall flow of the continuous heart rate detection method provided in an embodiment of the present application.
[0132] like Figure 4 As shown, the method may include the following steps:
[0133] Obtain PPG signals and ACC signals from wearable devices and preprocess the signals.
[0134] In this embodiment, the preprocessing mentioned here refers to the processing of eliminating the influence of ambient light, high-frequency noise, low-frequency baseline drift, etc., which will not be described in detail here.
[0135] The preprocessed PPG signal and the ACC signal are combined to obtain the adaptively filtered PPG signal.
[0136] In this embodiment, the preprocessed signal may be adaptively filtered to obtain an adaptively filtered PPG signal, i.e., a reference PPG signal, which will not be described in detail here.
[0137] Set the cache queue and update it in real time to complete the heart rate initialization.
[0138] In this embodiment, after determining the reference PPG signal, Figure 2 The method shown is used to process it and obtain the initial heart rate value.
[0139] The current heart rate value is updated with the set accuracy and time interval.
[0140] In this embodiment, after determining the initial heart rate value, the initial heart rate value can be used as the current heart rate value. Figure 2 The method shown further updates the current heart rate value to determine the target heart rate value.
[0141] This concludes Figure 4 Description of the flowchart in .
[0142] Please refer to Figure 5 , Figure 5It is a schematic structural diagram of an electronic device proposed in an embodiment of the present application. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a terminal interaction device at the logical level. Of course, in addition to software implementation methods, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0143] Please refer to Figure 6 , Figure 6 This is a structural diagram of a continuous heart rate detection device proposed in the embodiment of this application. Figure 6 As shown, the heart rate continuous detection device may include a setting unit 601, a determination unit 602, a fitting unit 603, and an updating unit 604. Specifically, the device includes:
[0144] a setting unit 601 for setting a cache queue for storing the latest M data points of the preprocessed reference photoplethysmography (PPG) signal, where M is determined according to a sampling frequency of the reference PPG signal;
[0145] a determining unit 602 configured to, when M data points are stored in the cache queue, determine, at first intervals, reference heart rate values corresponding to the M data points based on the most recent M data points stored in the cache queue, until the absolute value of the difference between any two adjacent reference heart rate values in K consecutive reference heart rate values is less than a preset threshold, and then determine an initial heart rate value based on the K reference heart rate values;
[0146] The initial heart rate value is used as the current heart rate value. After a second time interval, a frequency value sequence corresponding to the current heart rate value is determined based on the current heart rate value and a preset heart rate resolution. The frequency value sequence records all possible candidate frequency values corresponding to the target heart rate value obtained after the current heart rate value is updated.
[0147] The fitting unit 603 is configured to fit the latest M data points stored in the cache sequence to each candidate frequency value in the frequency value sequence according to a preset fitting curve and the candidate frequency value;
[0148] The updating unit 604 is configured to determine the candidate frequency value corresponding to the maximum fitting result as the target frequency value; determine the target heart rate value according to the target frequency value; and update the current heart rate value to the target heart rate value.
[0149] Optionally, after updating the current heart rate value to the target heart rate value, the updating unit 604 is further configured to:
[0150] The target heart rate value is used as the current heart rate value, and after returning to the second time interval, a step of determining a frequency value sequence corresponding to the current heart rate value according to the current heart rate value and a preset heart rate resolution is performed until an instruction to stop heart rate detection is received;
[0151] And / or, the reference photoplethysmography (PPG) signal is obtained by:
[0152] Filter the obtained raw acceleration sensor ACC signal and raw PPG signal through the configured filter to obtain candidate ACC signals and candidate PPG signals;
[0153] Input the candidate ACC signal into the configured adaptive filter to obtain the filter output signal, and determine the reference PPG signal based on the candidate PPG signal and the filter output signal;
[0154] And / or, the determining unit 602 is specifically configured to:
[0155] Perform a Fast Fourier Transform (FFT) on the latest M data points stored in the cache queue to obtain a frequency spectrum corresponding to the M data points;
[0156] Determine the frequency value corresponding to the spectrum peak according to the spectrum graph, and determine the reference heart rate value according to the frequency value corresponding to the spectrum peak;
[0157] And / or, the determining unit 602 is specifically configured to:
[0158] The last reference heart rate value among the K reference heart rate values is used as the initial heart rate value;
[0159] Alternatively, the average of K reference heart rate values is used as the initial heart rate value;
[0160] And / or, the determining unit 602 is specifically configured to:
[0161] Generating a heart rate value sequence centered on the current heart rate value and at intervals of the heart rate resolution; wherein the heart rate value sequence records all possible target heart rate values obtained after the current heart rate value is updated; and the number of heart rate values included in the heart rate value sequence is determined based on the maximum range of heart rate variation within the second time interval and the heart rate resolution;
[0162] Convert the heart rate value series into the frequency value series corresponding to the heart rate values.
[0163] So far, completed Figure 6 Description of the device for continuous detection of heart rate.
[0164] Correspondingly, in this embodiment, the embodiment of the present application further provides a computer-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed, the method disclosed in the above example of the present application can be implemented.
[0165] Exemplarily, the computer-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that may contain or store information, such as executable instructions, data, and the like. For example, the computer-readable storage medium may be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, a storage drive (such as a hard disk drive), a solid-state drive, any type of storage disk (such as a CD, DVD, etc.), or similar storage media, or a combination thereof.
[0166] The above are merely preferred embodiments of the present application and are not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A method for continuous heart rate detection, characterized in that: The method includes: Setting a cache queue, the cache queue is used to store the latest M data points in the reference photoplethysmography (PPG) signal obtained through preprocessing, where M is determined according to the sampling frequency of the reference PPG signal; In a case where M data points have been stored in the cache queue, at every first time interval, a reference heart rate value corresponding to the M data points is determined based on the latest M data points stored in the cache queue, until the absolute value of the difference between any two adjacent reference heart rate values in K consecutive reference heart rate values is less than a preset threshold, and an initial heart rate value is determined based on the K reference heart rate values, where K is greater than 1; Taking the initial heart rate value as the current heart rate value, after a second time interval, determining a frequency value sequence corresponding to the current heart rate value based on the current heart rate value and a preset heart rate resolution; the frequency value sequence records all possible candidate frequency values corresponding to the target heart rate value obtained after the current heart rate value is updated; For each candidate frequency value in the frequency value sequence, fitting the latest M data points stored in the cache queue according to a preset fitting curve and the candidate frequency value; The candidate frequency value corresponding to the maximum fitting result is determined as the target frequency value; the target heart rate value is determined according to the target frequency value; and the current heart rate value is updated to the target heart rate value.
2. The method according to claim 1, characterized in that After updating the current heart rate value to the target heart rate value, the method further includes: The target heart rate value is used as the current heart rate value, and the step of determining the frequency value series corresponding to the current heart rate value according to the current heart rate value and the preset heart rate resolution after the second time interval has passed is returned until an instruction to stop heart rate detection is received.
3. The method according to claim 1, characterized in that The reference photoplethysmography (PPG) signal is obtained by: Filter the obtained raw acceleration sensor ACC signal and raw PPG signal through the configured filter to obtain candidate ACC signals and candidate PPG signals; The candidate ACC signal is input into a configured adaptive filter to obtain a filter output signal, and the reference PPG signal is determined according to the candidate PPG signal and the filter output signal.
4. The method according to claim 1, wherein Determining the reference heart rate values corresponding to the M latest data points stored in the cache queue includes: Perform a Fast Fourier Transform (FFT) on the latest M data points stored in the cache queue to obtain a frequency spectrum corresponding to the M data points; A frequency value corresponding to a spectrum peak is determined according to the spectrum diagram, and the reference heart rate value is determined according to the frequency value corresponding to the spectrum peak.
5. The method according to claim 1, wherein The determining of the initial heart rate value according to the K reference heart rate values includes: Taking the last reference heart rate value among the K reference heart rate values as the initial heart rate value; Alternatively, the average value of the K reference heart rate values is used as the initial heart rate value.
6. The method according to claim 1, characterized in that The determining of a frequency value sequence corresponding to the current heart rate value according to the current heart rate value and a preset heart rate resolution includes: generating a heart rate value series centered on the current heart rate value and at intervals of the heart rate resolution; wherein the heart rate value series records all possible target heart rate values obtained after the current heart rate value is updated; and the number of heart rate values included in the heart rate value series is determined based on the maximum range of heart rate changes within the second time interval and the heart rate resolution; The heart rate value sequence is converted into a frequency value sequence corresponding to the heart rate value.
7. A continuous heart rate detection device, characterized in that: The device includes: a setting unit, configured to set a cache queue, wherein the cache queue is configured to store the latest M data points in the preprocessed reference photoplethysmography (PPG) signal, where M is determined according to a sampling frequency of the reference PPG signal; a determining unit, configured to, when M data points have been stored in the cache queue, determine, at first intervals, reference heart rate values corresponding to the M data points based on the most recent M data points stored in the cache queue, until the absolute value of the difference between any two adjacent reference heart rate values in K consecutive reference heart rate values is less than a preset threshold, and then determine an initial heart rate value based on the K reference heart rate values, where K is greater than 1; Taking the initial heart rate value as the current heart rate value, after a second time interval, determining a frequency value sequence corresponding to the current heart rate value based on the current heart rate value and a preset heart rate resolution; the frequency value sequence records all possible candidate frequency values corresponding to the target heart rate value obtained after the current heart rate value is updated; a fitting unit, configured to fit, for each candidate frequency value in the frequency value series, the latest M data points stored in the cache queue according to a preset fitting curve and the candidate frequency value; The updating unit is configured to determine the candidate frequency value corresponding to the maximum fitting result as the target frequency value; determine the target heart rate value according to the target frequency value; and update the current heart rate value to the target heart rate value.
8. The device according to claim 7, characterized in that After updating the current heart rate value to the target heart rate value, the updating unit is further configured to: Taking the target heart rate value as the current heart rate value, returning to the step of determining a frequency value sequence corresponding to the current heart rate value according to the current heart rate value and a preset heart rate resolution after the second time interval has passed, until receiving an instruction to stop heart rate detection; And / or, the reference photoplethysmography (PPG) signal is obtained by: Filter the obtained raw acceleration sensor ACC signal and raw PPG signal through the configured filter to obtain candidate ACC signal and candidate PPG signal; Inputting the candidate ACC signal into a configured adaptive filter to obtain a filter output signal, and determining the reference PPG signal based on the candidate PPG signal and the filter output signal; And / or, the determining unit is specifically configured to: Perform a Fast Fourier Transform (FFT) on the latest M data points stored in the cache queue to obtain a frequency spectrum corresponding to the M data points; Determine a frequency value corresponding to a spectrum peak according to the spectrum graph, and determine the reference heart rate value according to the frequency value corresponding to the spectrum peak; And / or, the determining unit is specifically configured to: Taking the last reference heart rate value among the K reference heart rate values as the initial heart rate value; Alternatively, the average of the K reference heart rate values is used as the initial heart rate value; And / or, the determining unit is specifically configured to: generating a heart rate value series centered on the current heart rate value and at intervals of the heart rate resolution; wherein the heart rate value series records all possible target heart rate values obtained after the current heart rate value is updated; and the number of heart rate values included in the heart rate value series is determined based on the maximum range of heart rate changes within the second time interval and the heart rate resolution; The heart rate value sequence is converted into a frequency value sequence corresponding to the heart rate value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium having a plurality of computer instructions stored thereon, characterized in that: When the computer instructions are executed, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Wearable device and heart rate tracking method and heart rate tracking device thereof
CN115245320A
Heart rate correction method and device, electronic equipment and storage medium
CN115349841A