A multi-strategy heart rate calculation method and system under a complex scene

By classifying local indicators of signals from non-contact heart rate monitoring devices and employing adaptive strategies, the accuracy problem of heart rate detection in complex scenarios was solved, achieving stable and accurate heart rate output during sleep.

CN123147888APending Publication Date: 2026-11-24ZHEJIANG QISHENG DATA SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611295097.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing non-contact heart rate monitoring devices suffer from severe noise interference in complex scenarios, leading to a decrease in the accuracy of heart rate detection. They are unable to effectively distinguish between different working conditions such as resting, slight activity, and severe turbulence, and lack adaptive recognition capabilities.

Method used

By receiving and preprocessing the raw vibration signal, local indicators of the signal are obtained. Based on the local indicators, the signal scene is classified, and different strategies are used to calculate the heart rate: in the case of a large number of disturbances, the longest stable segment is detected and combined with historical heart rate; in the case of slight disturbances, false peaks are removed; and in the case of no disturbances, Fourier transform analysis is performed.

Benefits of technology

To achieve continuous, stable, and accurate heart rate output in complex scenarios, improve detection accuracy, reduce the risk of misjudgment, and ensure the feasibility of non-contact devices in sleep monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123147888A_ABST
    Figure CN123147888A_ABST
Patent Text Reader

Abstract

This invention provides a multi-strategy heart rate calculation method and system for complex scenarios. The method includes: receiving and preprocessing a raw vibration signal to obtain local signal indices; classifying the signal scenario based on the local indices; when the signal scenario is classified as a scenario with a large number of disturbances, and when the corresponding signal does not have a longest stable segment, acquiring historical baseline heart rate and historical slice heart rate, and calculating the heart rate based on the jump detection of the two; when the signal scenario is classified as a scenario with slight disturbances, removing false peaks from the corresponding signal to determine the user's heart rate; when the signal scenario is classified as a scenario without disturbances, performing a Fourier transform on the corresponding signal and determining whether the spectrum after the Fourier transform is significant. If significant, calculating the heart rate based on the main peak of the spectrum.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical data processing technology, and in particular to a multi-strategy heart rate calculation method and system for complex scenarios. Background Technology

[0002] Currently, consumer-grade and medical-grade heart rate monitoring solutions have formed a mature product system, which can be divided into two main categories according to the signal acquisition method: wired medical monitoring devices and contact wearable devices. The former has extremely high detection accuracy and can even identify various abnormal waveforms related to the heart, such as premature beats, but its application is limited to resting medical scenarios. The latter has smaller measurement errors under normal resting conditions and is convenient to carry, but it is more restrictive to wear, requires close contact with the body, has poor comfort, and is less acceptable for sleep scenarios.

[0003] However, current contact-based devices for sleep monitoring suffer from the bottleneck of wearability constraints. Therefore, non-contact heart rate monitoring solutions based on vibration signals have become a research hotspot in the field of health monitoring in recent years. These devices offer advantages such as no need for close-fitting wearing, low hardware cost, and privacy. However, because they rely on non-contact vibration signals, they suffer from interference issues in complex scenarios: a large amount of strong noise and vibration interference exists during sleep, such as lying down, turning over, limb movement, and environmental noise from furniture and other movements. This noise is far greater than the weak BCG vibration signal generated by the heartbeat.

[0004] To address the aforementioned issues, existing traditional algorithms rely solely on fixed-frequency filtering and simple peak identification to extract the heartbeat cycle. When noise and the heartbeat spectrum highly overlap, filtering cannot effectively separate interference, easily misinterpreting body vibrations as heartbeat waveforms, leading to problems such as fluctuating heart rate, numerical distortion, or no output. Existing heart rate detection products lack adaptive recognition capabilities for these scenarios, failing to differentiate between resting, low-intensity activity, and severe vibration conditions. A uniform processing logic results in acceptable accuracy in quiet environments, but significantly reduced accuracy in complex motion scenarios, making it difficult to provide stable and accurate heart rate output across multiple scenarios. These shortcomings severely limit the application of non-contact vibration heart rate devices in sleep scenarios. Summary of the Invention

[0005] To address the problems existing in the prior art, embodiments of the present invention provide a multi-strategy heart rate calculation method and system for complex scenarios.

[0006] Firstly, embodiments of this specification provide a multi-strategy heart rate calculation method for complex scenarios, the method comprising:

[0007] The original vibration signal is received and preprocessed to obtain local signal indices, which include full-scale rate, signal quality, and longest stationary segment.

[0008] Signal scenarios are classified based on the aforementioned local signal indicators, and the classification includes stable scenarios, scenarios with a large number of disturbances, scenarios with slight disturbances, and scenarios without disturbances.

[0009] When the signal scene is classified as a scene with a large number of disturbances, it is detected whether the corresponding signal has the longest stable segment. When the longest stable segment does not exist, the historical baseline heart rate and historical slice heart rate are obtained, and the heart rate is calculated based on the jump detection of the two.

[0010] When the signal scene is classified as a slight disturbance scene, false peaks are removed from the corresponding signal, peak detection is performed on the waveform after false peak removal, and the interval is calculated to determine the user's heart rate.

[0011] When the signal scene is classified as a undisturbed scene, a Fourier transform is performed on the corresponding signal, and it is determined whether the spectrum after the Fourier transform is significant. If it is, the heart rate is calculated based on the main peak of the spectrum.

[0012] Secondly, embodiments of this specification provide a multi-strategy heart rate calculation system for complex scenarios, the system comprising:

[0013] The preprocessing module is used to receive the original vibration signal and perform preprocessing to obtain local signal indices, which include full-scale rate, signal quality, and longest stationary segment.

[0014] The classification module is used to classify signal scenes based on the local indicators of the signal. The classification includes stable scenes, scenes with a large number of disturbances, scenes with slight disturbances, and scenes without disturbances.

[0015] The large disturbance scenario module is used to detect whether the corresponding signal has a longest stable segment when the signal scenario is classified as a large disturbance scenario. When the longest stable segment does not exist, the historical baseline heart rate and historical slice heart rate are obtained, and the heart rate is calculated based on the jump detection of the two.

[0016] The minor disturbance scenario module is used to remove false peaks from the corresponding signal when the signal scenario is classified as a minor disturbance scenario, perform peak detection on the waveform after false peak removal, calculate the interval, and then determine the user's heart rate.

[0017] The undisturbed scene module is used to perform Fourier transform on the corresponding signal when the signal scene is classified as an undisturbed scene, and to determine whether the spectrum after the Fourier transform is significant. If it is significant, the heart rate is calculated based on the main peak of the spectrum.

[0018] Thirdly, embodiments of this specification provide an electronic device, including a processor and a memory;

[0019] The processor is connected to the memory;

[0020] The memory is used to store executable program code;

[0021] The processor runs a program corresponding to the executable program code stored in the memory to perform the methods described in one or more embodiments.

[0022] Fourthly, embodiments of this specification provide a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the multi-strategy heart rate calculation method in the aforementioned complex scenario.

[0023] In view of the above, the beneficial effects of the technical solutions provided by some embodiments of this specification include at least the following:

[0024] In one or more embodiments of this specification, a raw vibration signal is received and preprocessed to obtain local signal indices, including full-scale rate, signal quality, and longest stationary segment. Based on these local indices, signal scenarios are classified into four categories: stable scenarios, scenarios with significant disturbances, scenarios with minor disturbances, and undisturbed scenarios. When the signal scenario is classified as a scenario with significant disturbances, the system checks whether the corresponding signal has a longest stationary segment. If no longest stationary segment exists, historical baseline heart rate and historical slice heart rate are obtained, and heart rate is calculated based on the jump detection of these two values. When the signal scenario is classified as a scenario with minor disturbances, false peaks are removed from the corresponding signal. Peak values ​​are detected in the waveform after false peak removal, and the interval is calculated to determine the user's heart rate. When the signal scenario is classified as a scenario without disturbances, a Fourier transform is performed on the corresponding signal, and the significance of the spectrum after the Fourier transform is determined. If significant, heart rate is calculated based on the main peak of the spectrum. This embodiment utilizes local indices to automatically distinguish between four types of scenarios: stable, slightly disturbed, significantly disturbed, and undisturbed, and employs corresponding strategies for each. Under conditions of significant disturbances such as vigorous body movement and turning over, local stable segments are extracted and repaired to avoid heart rate fluctuations and numerical distortion. In undisturbed scenarios with significant respiratory interference, frequency domain analysis is switched to extract the dominant heart rate, overcoming the challenge of BCG time-domain waveforms being submerged by breathing. Thus, without sacrificing non-contact comfort and low hardware cost, continuous, stable, and accurate heart rate output is achieved across multiple conditions throughout the sleep process. This significantly improves detection accuracy in complex scenarios, reduces the risk of no output and misjudgment, and provides a feasible solution for the engineering implementation of non-contact vibration heart rate devices in real-world sleep monitoring. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a flowchart of a multi-strategy heart rate calculation method in a complex scenario provided by one embodiment of this specification.

[0027] Figure 2 This is a flowchart of scene classification provided in one embodiment of this specification.

[0028] Figure 3 This is a flowchart of heart rate calculation in a stable scenario provided by one embodiment of this specification.

[0029] Figure 4 This is a flowchart of heart rate calculation under a large number of disturbance scenarios provided in one embodiment of this specification.

[0030] Figure 5 This is a flowchart of heart rate calculation under a slight disturbance scenario provided in one embodiment of this specification.

[0031] Figure 6 This is a flowchart of heart rate calculation in a undisturbed scenario provided by one embodiment of this specification.

[0032] Figure 7 This is a schematic diagram of the structure of a multi-strategy heart rate calculation system in a complex scenario, provided by one embodiment of this specification.

[0033] Figure 8 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this specification. Detailed Implementation

[0034] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed merely to enable those skilled in the art to better understand and implement the subject matter described herein, and are not intended to limit the scope, applicability, or examples set forth in the claims. The function and arrangement of the elements discussed may be changed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the various examples. For example, the described methods may be performed in a different order than described, and steps may be added, omitted, or combined. Furthermore, features described in some examples may be combined in other examples.

[0035] As used herein, the term "comprising" and its variations are open terms meaning "including but not limited to". The term "based on" means "at least partially based on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. Unless explicitly indicated by the context, the definition of a term shall remain consistent throughout the specification.

[0036] Please see Figure 1 , Figure 1 The diagram shows an overall flowchart of a multi-strategy heart rate calculation method for complex scenarios provided in an embodiment of this specification.

[0037] like Figure 1 As shown, the multi-strategy heart rate calculation method in this complex scenario includes at least the following steps:

[0038] Step S102: Receive the original vibration signal and perform preprocessing to obtain local signal indices, which include full-scale rate, signal quality, and longest stationary segment.

[0039] Specifically, the original vibration signal is received and sliced ​​into easily processed segments. These segments are then preprocessed to output key local indices of the original vibration signal slices, including full-scale rate, signal quality, and longest stationary segment. The calculation steps for these key local indices include:

[0040] Full-scale rate. Acquire the raw signal after slicing. ,length And preset the full-scale threshold. (Settings from the sensor, typically 90% or 95% of the range). Then iterate through each sampling point within the slice. Determine whether the absolute value of the amplitude at that point is greater than Then use the indicator function. Statistical analysis is performed: 1 is recorded if the condition is met, and 0 is recorded otherwise. The proportion of sampling points meeting the condition out of the total number of sampling points is calculated to obtain the full-scale rate. Its formula includes:

[0041] ,

[0042] in, Represents the full-scale rate. Original signal after slicing Length, For the slice of the first Point signal sample value, This is an indicator function. It detects sensor saturation or strong impact interference by checking the full-scale rate. When the signal amplitude frequently approaches or exceeds the full-scale threshold, it indicates that the sensor may be saturated, or that there has been a severe physical / environmental impact.

[0043] Signal quality. Acquiring slice signals. ,length Sampling rate and the lower limit of the effective heart rate band 0.5Hz, upper limit The noise determination starting frequency is 3.5Hz. The frequency is 4Hz. The power spectrum of the sliced ​​signal is calculated. (This can be obtained by taking the square of the amplitude after FFT), and then in the effective frequency band respectively. Integrating (or summing) the power spectrum within the frequency band yields the energy in the heartbeat frequency band, as well as the energy in the noise frequency band. Integrating (or summing) the power spectrum yields the high-frequency noise energy. The ratio of the two is calculated using the following formula:

[0044] ,

[0045] in This represents the signal-to-noise ratio in the frequency domain, i.e., a signal quality indicator. The power spectrum of the sliced ​​signal. The maximum value of the frequency. It is a very small positive number, used to avoid the denominator being zero. A higher value indicates a higher proportion of cardiac components, less body motion noise, and better signal quality. This quantifies the relative intensity of the effective cardiac components in the signal.

[0046] Longest stationary segment. Obtain the raw signal after slicing. Sampling rate And preset a baseline threshold. (Signal fluctuation variance at rest, obtained from historical experience) and the duration of multiple windows (e.g., 0.5 s, 1 s, 2 s, 4 s, etc.), corresponding to different window lengths. .

[0047] By traversing through multiple window lengths, that is, for each preset... Get the corresponding window length Then slide the window to scan, in steps. Slide on the signal to extract the window. (from index) Starting with a length of Calculate the window mean and variance:

[0048] ,

[0049] ,

[0050] in, For window The mean, if If a segment is found to be stationary, that window is marked as a candidate stationary segment. The lengths of all candidate stationary segments are counted, and the longest segment is taken as the longest stationary segment of the slice, and its length is recorded. This quantifies the length of the usable stable interval in the signal. In sleep scenarios, stationary segments of the body movement interval are often suitable for extracting heart rate. By using a sliding window search, the longest low-fluctuation interval within the slice can be found.

[0051] Step S104: Classify the signal scene based on the local signal indicators. The classification includes stable scene, scene with a large number of disturbances, scene with a slight disturbance, and scene with no disturbance.

[0052] Specifically, based on local signal indices (full-scale rate, signal quality, and longest stationary segment length) as features, the signal slices of the corresponding original vibration signal are classified into scenes. The scene classification logic may include:

[0053] 1. Determine whether the length of the longest stationary segment is equal to the slice length. The criterion is:

[0054] Lstable = Lslice

[0055] Where Lstable is the length of the longest stationary segment, and Lslice is the length of the current slice. When the equation holds true, the current slice is considered a stationary segment, and the current scene is considered a stationary scene. This indicates that throughout the entire slice, signal fluctuations consistently remain within the resting baseline threshold. Below this point, there is no obvious volumetric motion or strong disturbance. Conversely, if the current slice does not exhibit these characteristics, it is considered a non-stationary segment and requires further subdivision.

[0056] 2. Subdivision of non-stationary segments and full-scale rate determination. The full-scale rate reflects the proportion of a signal whose amplitude approaches or exceeds the sensor's range, and is a direct indication of strong impulses / saturation interference. Its determination criteria are:

[0057] Determine if the full-scale rate is greater than the threshold. For example, the threshold If the full-scale rate is set to 0.3 (based on empirical statistics and can be adjusted adaptively), then if the full-scale rate is greater than 0.3, it means that more than 30% of the sampling points in this slice have amplitudes exceeding the preset range threshold. This indicates severe and unrecoverable damage, and the slice data can be classified as a scenario with a large number of disturbances. Otherwise, further subdivision is performed.

[0058] The full-scale rate metric is specifically designed to address the unique hardware issue of saturation distortion caused by significant body movement in mattress vibration sensors. Mattress-built-in vibration sensors have an inherent weakness: when a person rolls over dramatically or shakes violently, the vibration amplitude easily exceeds the sensor's sampling range, causing the signal waveform to be clipped at the top / bottom, resulting in saturation distortion. Saturation-distorted data represents permanent information loss; filtering cannot recover the waveform, and it is fundamentally different from ordinary Gaussian noise or baseline drift. Therefore, a custom metric, full-scale rate, is defined: the proportion of data points within a slice that reach the upper / lower limit of sampling saturation out of the total length. A threshold is set to quickly determine the degree of slice damage. An excessively high full-scale rate indicates that a large number of waveforms are permanently damaged, and the data cannot be repaired, directly categorizing it as a scenario with significant disturbance.

[0059] 3. Signal quality assessment. Signal quality It represents the ratio of cardiac frequency band energy to high-frequency noise energy, reflecting the relative intensity of the effective cardiac component.

[0060] Determine if the signal quality is greater than the threshold. For example, setting a threshold Setting it to 0.8 (based on empirical statistics, adjustable adaptively), if the signal quality is greater than 0.8, it indicates that the segment has high reliability and can be classified into a slightly disturbed scenario within a non-stationary segment; otherwise, it is classified into a undisturbed scenario. In the slightly disturbed scenario, high signal quality indicates that although non-stationary factors exist, the heart rate frequency band energy is still significantly higher than high-frequency noise, indicating high reliability, and a more robust algorithm can be used to extract the heart rate. In the undisturbed scenario, low signal quality indicates relatively insufficient heart rate frequency band energy, but there are no large full-scale impacts. The user described it as: there is no significant body movement / turning interference, but the respiratory waveform obtained after filtering is poor, and the heart rate nodes cannot be visually identified.

[0061] like Figure 2 As shown in the scene classification flowchart, this signal classification process divides the original vibration signal (slice) into four scene categories based on its local signal indices: stable scene, slightly disturbed scene, undisturbed scene, and heavily disturbed scene. This allows subsequent heart rate calculations to select different strategies based on the scene characteristics.

[0062] In addition, for a stable scenario, the characteristics include: minimal signal fluctuations throughout the entire slice (or the longest stable segment), with variance below the resting baseline threshold; no significant body movement, turning over, or environmental shock interference; and a smooth heart rate curve with short-term fluctuations typically not exceeding 10 BPM. Therefore, heart rate in this scenario can be assessed using methods such as filtering, peak finding, and RR interval calculation. Figure 3 As shown, the heart rate calculation strategy in a stable scenario can include:

[0063] The signal slice data is bandpass filtered from 0.5 to 3 Hz. This separates the heartbeat frequency band from the original vibration signal, improves the signal-to-noise ratio, and provides a clean periodic waveform for subsequent peak finding.

[0064] Then, peak and trough detection (peak finding) is performed. That is, peak detection is performed on the filtered signal to find all local maxima (peaks) and local minima (troughs), thereby accurately locating the position of each cardiac cycle in the vibration signal and providing a time reference for calculating the RR interval.

[0065] Next, the RR interval is calculated by taking the time index difference between adjacent peaks (or troughs, or the average of peak / trough intervals to improve stability). This yields the beat-by-beat time interval, reflecting instantaneous heart rate changes.

[0066] Finally, the beat rate is calculated from the RR interval, and the oscillation period is converted into a commonly used clinical heart rate value.

[0067] For steady-state scenarios, the signal quality is high, interference is low, and the heartbeat waveform is clear. Therefore, a high-precision heart rate can be obtained by using filtering, peak finding, and RR interval calculation. The computational load is small, making it suitable for real-time or near-real-time processing.

[0068] Step S106: When the signal scene is classified as a large number of disturbances, detect whether the corresponding signal has a longest stable segment. When the longest stable segment does not exist, obtain the historical baseline heart rate and the historical slice heart rate, and calculate the heart rate based on the jump detection of the two.

[0069] Specifically, when the signal scene is classified as a scene with a large number of disturbances, its core characteristic is that the large number of disturbances directly leads to the loss of blocks of signals, making direct filtering impossible. This manifests as a large number of sampling points having amplitudes exceeding the full-scale threshold. However, within the slice, there may still be locally stable segments that have not been severely disrupted, namely the longest stable segment in step S102.

[0070] Therefore, for the current scenario, there are two situations: if the longest usable stationary segment still exists in the slice, the heart rate can be extracted using the stationary segment method; if the signal in the slice is too severely damaged, and no usable stationary segment exists or is too short, then other repair strategies as described below are used to repair the signal and output a reasonable heart rate estimate. For example... Figure 4 As shown, heart rate calculation strategies under scenarios with a large number of disturbances may include:

[0071] On the one hand, when the longest stationary segment from step S102 exists within a signal slice under a highly turbulent scenario, the heart rate calculation strategy for stationary scenarios, as described in step S104, is executed on that stationary segment. This strategy includes bandpass filtering, peak finding, calculating the RR interval, and calculating the heart rate. For this part, although the entire slice is subject to significant disturbances, the signal quality within the local stationary segment may still be close to ideal, with a clear heartbeat waveform and minimal interference. It can be directly processed using the heart rate calculation strategy for stationary scenarios.

[0072] On the other hand, if the current slice lacks a sufficiently long longest stationary segment, or if the longest stationary segment is too short to extract a valid heart rate (less than 2-3 complete heartbeat cycles, making reliable heart rate calculation impossible), then a historical baseline heart rate is obtained. This baseline heart rate can be: the user's average heart rate during historical sleep, the moving average heart rate over a recent period (e.g., the previous 5 minutes), or a pre-defined prior value based on the user's age, resting heart rate, etc., representing the user's typical heart rate level in a resting state. Historical slice heart rates are also obtained (i.e., the most recently successfully calculated heart rate value (from the previous slice or the previous few valid slices)). For example, between the historical baseline heart rate and the historical slice heart rate, it is determined whether there is a significant difference between the two, i.e., whether a jump has occurred (the jump threshold can be preset, for example, based on factors such as the user's age, a difference exceeding 15-20 bpm is considered a jump).

[0073] If no jump occurs in the comparison results, the baseline heart rate is output. Since the previous heart rate segment matches the baseline, it indicates the user is generally in a stable state, and the current interfering segment does not represent the true heart rate change; the baseline heart rate can fill this gap. Conversely, if a jump occurs, the historical heart rate segment is output. A large difference between the previous segment's heart rate and the baseline indicates the user may be experiencing real heart rate fluctuations (such as waking up, changes in posture, etc.). In this case, the baseline heart rate is no longer reliable, while the previous segment's heart rate is closer to the current state. Therefore, even when the data is completely corrupted, continuous heart rate estimation is provided through historical information, ensuring the integrity of the monitoring data.

[0074] In this step, the method for finding the longest stable segment is designed specifically for the unique operating conditions of BCG signals from sleep mattresses. The interference characteristics of the BCG signal extracted from the mattress vibration signal are very unique. Human sleep disturbances occur in blocks: quiet lying flat - slight turning and disturbance - quiet again. The disturbances are not uniform noise, but rather appear in fragments and intermittently, and the duration of the disturbances is unpredictable. In this embodiment, heart rate is calculated using slices as input. Considering the characteristics of human disturbances, the following phenomenon may occur within the same slice window: quiet - turning over - quiet again. By using the method for finding the stable segment in this embodiment, body movement fragments in the window can be eliminated, and the longest stable segment within the window can be found. The found longest stable segment can be used for scene classification and also for more accurate heart rate calculation. Both the method of combining it with other subsequent indicators and the method of finding the longest stable segment itself are different from existing solutions in the field.

[0075] Step S108: When the signal scene is classified as a slight disturbance scene, false peaks are removed from the corresponding signal, peak detection is performed on the waveform after false peak removal, and the interval is calculated to determine the user's heart rate.

[0076] Specifically, when the signal scene is classified as a slightly disturbed scene, its core characteristics are: the noise amplitude is low, there is only a small amount of local distortion, the overall heartbeat waveform is intact and identifiable, the signal quality is relatively high, and the energy of the heartbeat frequency band is much higher than that of high-frequency noise.

[0077] For the heart rate calculation strategy in this scenario, such as Figure 5 As shown, the same bandpass filter (0.5–3 Hz) as for a stable scene can be used to remove low-frequency baseline drift, breathing motion interference, and high-frequency environmental / mechanical noise. Then, a peak threshold is set. To distinguish between true cardiac wave peaks and spurious peaks caused by disturbances. It can be a fixed value (preset based on historical data or sensor characteristics) or an adaptive threshold (e.g., a statistic based on the amplitude of the filtered signal, such as the mean plus a certain number of standard deviations, or a percentage of the signal envelope). Peak threshold Peak detection is performed on the filtered signal to identify all local maxima. For each candidate peak, its amplitude (or relative height to surrounding points) is checked to see if it meets a threshold condition: if the peak amplitude is less than a certain value... If the peak amplitude is greater than or equal to a certain value, it is considered a false peak caused by disturbance and is removed; if the peak amplitude is greater than or equal to a certain value, it is considered a false peak caused by disturbance and is removed. If so, the true heart rate peak will be retained.

[0078] After removing spurious peaks, a clean waveform is obtained. A complete peak detection is then performed on this waveform to find the time index of the peak (and optionally the trough). The RR interval is then calculated based on the indices of adjacent peaks (or troughs) (using the same calculation method as in the stationary scenario). This converts the filtered and spurious-peak-removed cardiac cycle into a standard heart rate value, outputting a heart rate estimate for this scenario. In this scenario, due to local distortions, spurious peaks may occur, so filtering is necessary to remove them. Compared to the stationary scenario, this method includes defensive filtering and requires significantly less complex processing than scenarios with numerous disturbances. This embodies the concept of "adaptively allocating computational complexity according to the scenario" in this embodiment.

[0079] Step S110: When the signal scene is classified as a disturbance-free scene, perform a Fourier transform on the corresponding signal and determine whether the spectrum after the Fourier transform is significant. If it is, calculate the heart rate based on the main peak of the spectrum.

[0080] Specifically, when the signal scene is classified as a undisturbed scene, its core characteristics are: the human body is stationary, that is, there is no obvious body movement, turning over or large limb movement, and the full-scale rate is low; respiratory motion interference is relatively significant, and the amplitude may far exceed the weak BCG oscillations caused by the heartbeat; and in the time domain waveform, the heartbeat peak is not obvious or is masked by the respiratory wave, making it difficult to find a reliable heartbeat cycle through conventional peak detection methods; the signal quality indicators are also relatively poor.

[0081] Based on the above characteristics, the undisturbed scenario suffers from the problem of "no body motion interference, but waveform features being masked by low-frequency components." This problem does not exist in ECG (Electrocardiography) and PPG (Photoplethysmography) signals, but it does exist in BCG (Ballistocardiography) signals. Therefore, given that time-domain peak detection is not applicable, we switch to frequency-domain analysis. For the heart rate calculation strategy in this scenario, such as... Figure 6 As shown, it includes:

[0082] Perform a Fourier transform on the signal (slice) to obtain the spectral amplitude. Then, search for the main peak of the spectrum within a search band of 0.5–3 Hz, and record the frequency and corresponding amplitude of the main peak (i.e., the frequency point with the largest amplitude), as well as the frequency and amplitude of the second-highest peak. Then, set a preset threshold. It also determines whether the difference between the amplitude of the main peak and the amplitude of the secondary peak is less than a preset significance threshold. If the difference is greater than If the main peak is significant, the corresponding frequency is reliable, and heart rate can be calculated accordingly. Conversely, if the value is less than [a certain value], then [the main peak is significant, the corresponding frequency is reliable, and heart rate can be calculated based on this]. If the main peak is not prominent enough and there is no obvious dominant heart rate in the spectrum, the frequency domain method is unreliable, and a fallback repair scheme is adopted.

[0083] When the main peak is significant, heart rate is calculated based on the main peak frequency, and the output heart rate value is used as the heart rate estimate for the current slice. This utilizes the linear relationship between heart rate and beat frequency to directly obtain the heart rate from the main peak in the frequency domain, bypassing the difficulties of time-domain peak detection.

[0084] When the main peak is not significant, the same fallback repair solution used in scenarios with minor disturbances can be applied. This involves obtaining a historical baseline heart rate, which can be: the user's average heart rate during historical sleep, the moving average heart rate over a recent period (e.g., the previous 5 minutes), or a pre-defined value based on the user's age, resting heart rate, etc., representing the user's typical heart rate level in a calm state. It also involves obtaining historical slice heart rates (i.e., the most recently successfully calculated heart rate value (from the previous slice or several previous valid slices)). For example, comparing the historical baseline heart rate and historical slice heart rates, it's determined whether there is a significant difference between the two, i.e., whether a jump has occurred (the jump threshold can be pre-set, for example, based on factors such as the user's age, a difference exceeding 15-20 bpm is considered a jump).

[0085] If no jump occurs in the comparison results, the baseline heart rate is output. This is because the heart rate in the previous segment is consistent with the baseline heart rate, indicating that the user is still in a stable state overall. The current interfering segment does not represent the true heart rate change and can be filled in by the baseline heart rate. Conversely, if a jump occurs, the historical segment heart rate is output. If the heart rate in the previous segment differs greatly from the baseline heart rate, it indicates that the user may be experiencing real heart rate fluctuations (such as waking up, changing posture, etc.). In this case, the baseline heart rate is no longer reliable, while the heart rate in the previous segment is closer to the current state.

[0086] In this embodiment, a multi-strategy heart rate calculation method for complex scenarios includes: receiving and preprocessing the raw vibration signal to obtain local signal indices, which include full-scale rate, signal quality, and longest stationary segment; classifying the signal scenario based on the local signal indices, including stable scenarios, scenarios with significant disturbances, scenarios with slight disturbances, and scenarios without disturbances; when the signal scenario is classified as a scenario with significant disturbances, detecting whether the corresponding signal has a longest stationary segment; if no longest stationary segment exists, acquiring the historical baseline heart rate and historical slice heart rate, and calculating the heart rate based on the jump detection of the two; when the signal scenario is classified as a scenario with slight disturbances, removing false peaks from the corresponding signal, performing peak detection on the waveform after removing false peaks, calculating the interval, and then determining the user's heart rate; when the signal scenario is classified as a scenario without disturbances, performing a Fourier transform on the corresponding signal, and determining whether the spectrum after the Fourier transform is significant; if so, calculating the heart rate based on the main peak of the spectrum. This embodiment utilizes local indices to automatically distinguish between four types of scenarios: stable, slightly disturbed, scenarios with significant disturbances, and scenarios without disturbances, and adopts corresponding strategies for each. Under conditions of significant disturbances such as vigorous body movement and turning over, local stable segments are extracted and repaired to avoid heart rate fluctuations and numerical distortion. In undisturbed scenarios with significant respiratory interference, frequency domain analysis is switched to extract the dominant heart rate, overcoming the challenge of BCG time-domain waveforms being submerged by breathing. Thus, without sacrificing non-contact comfort and low hardware cost, continuous, stable, and accurate heart rate output is achieved across multiple conditions throughout the sleep process. This significantly improves detection accuracy in complex scenarios, reduces the risk of no output and misjudgment, and provides a feasible solution for the engineering implementation of non-contact vibration heart rate devices in real-world sleep monitoring.

[0087] Please refer to the following. Figure 7 , Figure 7 This diagram illustrates the structure of a multi-strategy heart rate calculation system for complex scenarios, as provided in an embodiment of this specification. It should be noted that... Figure 7 The multi-strategy heart rate calculation system shown in the complex scenario is used to execute this specification. Figure 1 The methods shown in the embodiments are illustrated for ease of explanation, showing only the parts related to the embodiments of this specification. For specific technical details not disclosed, please refer to this specification. Figure 1 The example shown.

[0088] like Figure 7 As shown, the multi-strategy heart rate calculation system in this complex scenario can include at least:

[0089] The preprocessing module S702 is used to receive the original vibration signal and perform preprocessing to obtain local signal indices, which include full-scale rate, signal quality, and longest stationary segment.

[0090] The classification module S704 is used to classify signal scenes based on the local indicators of the signal. The classification includes stable scenes, scenes with a large number of disturbances, scenes with slight disturbances, and scenes without disturbances.

[0091] The large disturbance scenario module S706 is used to detect whether the corresponding signal has a longest stable segment when the signal scenario is classified as a large disturbance scenario. When the longest stable segment does not exist, the historical baseline heart rate and historical slice heart rate are obtained, and the heart rate is calculated based on the jump detection of the two.

[0092] The Slight Disturbance Scenario Module S708 is used to remove false peaks from the corresponding signal when the signal scenario is classified as a slight disturbance scenario, perform peak detection on the waveform after false peak removal, calculate the interval, and then determine the user's heart rate.

[0093] The S710 undisturbed scene module is used to perform Fourier transform on the corresponding signal when the signal scene is classified as undisturbed, and to determine whether the spectrum after Fourier transform is significant. If it is significant, the heart rate is calculated based on the main peak of the spectrum.

[0094] In another embodiment, a multi-strategy heart rate calculation system for complex scenarios further includes:

[0095] The first judgment module is used to determine whether the length of the longest stable segment is equal to the length of the corresponding signal slice. If it is equal, the signal slice is determined to be a stable scene.

[0096] The second judgment module is used to, conversely, if not equal, further determine whether the full-scale rate is greater than the preset full-scale rate threshold; if greater, determine that the signal slice corresponds to a scenario with a large number of disturbances.

[0097] The third judgment module is used to, conversely, if the signal quality is less than a preset signal quality threshold, determine whether the signal slice corresponds to a slightly disturbed scenario; if it is greater than a preset signal quality threshold, determine whether the signal slice corresponds to a slightly disturbed scenario; if it is less than a preset signal quality threshold, determine whether the signal slice corresponds to a slightly disturbed scenario.

[0098] Those skilled in the art will clearly understand that the technical solutions of the embodiments in this specification can be implemented by means of software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware capable of independently performing or cooperating with other components to perform a specific function. The hardware may be, for example, a Field-Programmable Gate Array (FPGA), an Integrated Circuit (IC), etc.

[0099] Each processing unit and / or module in the embodiments of this specification can be implemented by an analog circuit that implements the functions described in the embodiments of this specification, or by software that executes the functions described in the embodiments of this specification.

[0100] See Figure 8 It shows a schematic diagram of the structure of an electronic device according to an embodiment of this specification, which can be used to implement... Figure 1 The method in the illustrated embodiment. (As shown) Figure 8 As shown, the electronic device 800 may include: at least one central processing unit 801, at least one network interface 804, user interface 803, memory 805, and at least one communication bus 802.

[0101] The communication bus 802 is used to enable communication between these components.

[0102] The user interface 803 may include a display screen and a camera. Optionally, the user interface 803 may also include a standard wired interface and a wireless interface.

[0103] The network interface 804 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0104] The processor 801 may include one or more processing cores. The processor 801 connects to various parts within the electronic device 800 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 805, and by calling data stored in the memory 805. Optionally, the processor 801 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 801 may integrate one or a combination of several of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 801 and may be implemented as a separate chip.

[0105] The memory 805 may include random access memory (RAM) or read-only memory. Optionally, the memory 805 may include a non-transitory computer-readable storage medium. The memory 805 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 805 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 805 may also be at least one storage system located remotely from the aforementioned processor 801. Figure 8 As shown, the memory 805, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.

[0106] exist Figure 8 In the illustrated electronic device 800, the user interface 803 is mainly used to provide an input interface for the user and to acquire user input data; while the processor 801 can be used to call the image-based interactive application stored in the memory 805 and specifically perform the following operations:

[0107] The original vibration signal is received and preprocessed to obtain local signal indices, which include full-scale rate, signal quality, and longest stationary segment.

[0108] Signal scenarios are classified based on the aforementioned local signal indicators, and the classification includes stable scenarios, scenarios with a large number of disturbances, scenarios with slight disturbances, and scenarios without disturbances.

[0109] When the signal scene is classified as a scene with a large number of disturbances, it is detected whether the corresponding signal has the longest stable segment. When the longest stable segment does not exist, the historical baseline heart rate and historical slice heart rate are obtained, and the heart rate is calculated based on the jump detection of the two.

[0110] When the signal scene is classified as a slight disturbance scene, false peaks are removed from the corresponding signal, peak detection is performed on the waveform after false peak removal, and the interval is calculated to determine the user's heart rate.

[0111] When the signal scene is classified as a undisturbed scene, a Fourier transform is performed on the corresponding signal, and it is determined whether the spectrum after the Fourier transform is significant. If it is, the heart rate is calculated based on the main peak of the spectrum.

[0112] As an optional embodiment of this specification, the signal scene classification based on the signal local indicators includes:

[0113] Determine whether the length of the longest stable segment is equal to the length of the corresponding signal slice. If they are equal, then determine that the scene corresponding to the signal slice is a stable scene.

[0114] Conversely, if they are not equal, it is further determined whether the full-scale rate is greater than the preset full-scale rate threshold. If it is greater, it is determined that the signal slice corresponds to a scenario with a large amount of disturbance.

[0115] Conversely, if it is less than the threshold, then it is further determined whether the signal quality is greater than the preset signal quality threshold. If it is greater than the threshold, then the scene corresponding to the signal slice is determined to be a slightly disturbed scene. If it is less than the threshold, then the scene corresponding to the signal slice is determined to be a non-disturbed scene.

[0116] As an optional embodiment of this specification, the method further includes:

[0117] When the signal scene is classified as a stationary scene, bandpass filtering is applied to the signal slice.

[0118] The peaks / troughs of the bandpass filtered signal slice are detected, the RR interval is calculated based on adjacent peaks / troughs, and the vibration period is converted into a heart rate value based on the RR interval.

[0119] As an optional embodiment of this specification, after detecting whether the corresponding signal has a longest stationary segment, the method further includes:

[0120] When the longest steady segment exists, the heart rate calculation strategy for that longest steady segment includes:

[0121] Bandpass filtering is applied to the signal slice;

[0122] The peaks / troughs of the bandpass filtered signal slice are detected, the RR interval is calculated based on adjacent peaks / troughs, and the vibration period is converted into a heart rate value based on the RR interval.

[0123] As an optional embodiment of this specification, the step of obtaining historical baseline heart rate and historical slice heart rate, and calculating heart rate based on jump detection of both, includes:

[0124] Compare the historical baseline heart rate and the historical slice heart rate to determine whether the difference between the two is less than the jump threshold;

[0125] If it is less than, the historical baseline heart rate is output; otherwise, the historical slice heart rate is output.

[0126] As an optional embodiment of this specification, the step of determining whether the spectrum after Fourier transform is significant includes:

[0127] Search the spectrum for the main peak and the secondary peak, and determine whether the difference between the amplitude of the main peak and the amplitude of the secondary peak is greater than the significance threshold;

[0128] If the value is greater than 1, the spectrum is considered to be significant; otherwise, the spectrum is considered to be non-significant.

[0129] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method. The computer-readable storage medium may include, but is not limited to, any type of disk, including floppy disks, optical disks, DVDs, CD-ROMs, microdrives, as well as magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.

[0130] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this specification is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this specification. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this specification.

[0131] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0132] In the embodiments provided in this specification, it should be understood that the disclosed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between systems or units may be electrical or other forms.

[0133] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0134] Furthermore, the functional units in the various embodiments of this specification can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0135] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this specification, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0136] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0137] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

Claims

1. A multi-strategy heart rate calculation method for complex scenarios, characterized in that, The method includes: The original vibration signal is received and preprocessed to obtain local signal indices, which include full-scale rate, signal quality, and longest stationary segment. Signal scenarios are classified based on the aforementioned local signal indicators, and the classification includes stable scenarios, scenarios with a large number of disturbances, scenarios with slight disturbances, and scenarios without disturbances. When the signal scene is classified as a scene with a large number of disturbances, it is detected whether the corresponding signal has the longest stable segment. When the longest stable segment does not exist, the historical baseline heart rate and historical slice heart rate are obtained, and the heart rate is calculated based on the jump detection of the two. When the signal scene is classified as a slight disturbance scene, false peaks are removed from the corresponding signal, peak detection is performed on the waveform after false peak removal, and the interval is calculated to determine the user's heart rate. When the signal scene is classified as a undisturbed scene, a Fourier transform is performed on the corresponding signal, and it is determined whether the spectrum after the Fourier transform is significant. If it is, the heart rate is calculated based on the main peak of the spectrum.

2. The multi-strategy heart rate calculation method in complex scenarios according to claim 1, characterized in that, The signal scene classification based on the local signal indicators includes: Determine whether the length of the longest stable segment is equal to the length of the corresponding signal slice. If they are equal, then determine that the scene corresponding to the signal slice is a stable scene. Conversely, if they are not equal, it is further determined whether the full-scale rate is greater than the preset full-scale rate threshold. If it is greater, it is determined that the signal slice corresponds to a scenario with a large amount of disturbance. Conversely, if it is less than the threshold, then it is further determined whether the signal quality is greater than the preset signal quality threshold. If it is greater than the threshold, then the scene corresponding to the signal slice is determined to be a slightly disturbed scene. If it is less than the threshold, then the scene corresponding to the signal slice is determined to be a non-disturbed scene.

3. The multi-strategy heart rate calculation method in complex scenarios according to claim 1, characterized in that, The method further includes: When the signal scene is classified as a stationary scene, bandpass filtering is applied to the signal slice. The peaks / troughs of the bandpass filtered signal slice are detected, the RR interval is calculated based on adjacent peaks / troughs, and the vibration period is converted into a heart rate value based on the RR interval.

4. The multi-strategy heart rate calculation method in complex scenarios according to claim 1, characterized in that, After detecting whether the corresponding signal has a longest stationary segment, the method further includes: When the longest steady segment exists, the heart rate calculation strategy for that longest steady segment includes: Bandpass filtering is applied to the signal slice; The peaks / troughs of the bandpass filtered signal slice are detected, the RR interval is calculated based on adjacent peaks / troughs, and the vibration period is converted into a heart rate value based on the RR interval.

5. The multi-strategy heart rate calculation method in complex scenarios according to claim 1, characterized in that, The process of obtaining historical baseline heart rate and historical slice heart rate, and calculating heart rate based on jump detection of both, includes: Compare the historical baseline heart rate and the historical slice heart rate to determine whether the difference between the two is less than the jump threshold; If it is less than, the historical baseline heart rate is output; otherwise, the historical slice heart rate is output.

6. The multi-strategy heart rate calculation method in complex scenarios according to claim 1, characterized in that, The determination of whether the spectrum after Fourier transform is significant includes: Search the spectrum for the main peak and the secondary peak, and determine whether the difference between the amplitude of the main peak and the amplitude of the secondary peak is greater than the significance threshold; If the value is greater than 1, the spectrum is considered to be significant; otherwise, the spectrum is considered to be non-significant.

7. A multi-strategy heart rate calculation system for complex scenarios, characterized in that, The system includes: The preprocessing module is used to receive the original vibration signal and perform preprocessing to obtain local signal indices, which include full-scale rate, signal quality, and longest stationary segment. The classification module is used to classify signal scenes based on the local indicators of the signal. The classification includes stable scenes, scenes with a large number of disturbances, scenes with slight disturbances, and scenes without disturbances. The large disturbance scenario module is used to detect whether the corresponding signal has a longest stable segment when the signal scenario is classified as a large disturbance scenario. When the longest stable segment does not exist, the historical baseline heart rate and historical slice heart rate are obtained, and the heart rate is calculated based on the jump detection of the two. The minor disturbance scenario module is used to remove false peaks from the corresponding signal when the signal scenario is classified as a minor disturbance scenario, perform peak detection on the waveform after false peak removal, calculate the interval, and then determine the user's heart rate. The undisturbed scene module is used to perform Fourier transform on the corresponding signal when the signal scene is classified as an undisturbed scene, and to determine whether the spectrum after the Fourier transform is significant. If it is significant, the heart rate is calculated based on the main peak of the spectrum.

8. The multi-strategy heart rate calculation system for complex scenarios according to claim 1, characterized in that, The system also includes: The first judgment module is used to determine whether the length of the longest stable segment is equal to the length of the corresponding signal slice. If it is equal, the signal slice is determined to be a stable scene. The second judgment module is used to, conversely, if not equal, further determine whether the full-scale rate is greater than the preset full-scale rate threshold; if greater, determine that the signal slice corresponds to a scenario with a large number of disturbances. The third judgment module is used to, conversely, if the signal quality is less than a preset signal quality threshold, determine whether the signal slice corresponds to a slightly disturbed scenario; if it is greater than a preset signal quality threshold, determine whether the signal slice corresponds to a slightly disturbed scenario; if it is less than a preset signal quality threshold, determine whether the signal slice corresponds to a slightly disturbed scenario.

9. An electronic device, comprising a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code stored in the memory to perform the method as described in any one of claims 1-6.

10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-6.