Heart rate detection methods, devices, equipment and media

By sorting and filtering the heart rate signal array, the number and location of valid heart rate signals are determined, which solves the problem of low accuracy caused by weak signals and interference signals in heart rate detection and achieves higher detection accuracy.

CN117796778BActive Publication Date: 2026-11-17HAIER SHENZHEN RES & DEV CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211176239.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2026-11-17
Estimated Expiration
2042-09-26

AI Technical Summary

Technical Problem

Existing heart rate detection methods have low accuracy due to weak and interference signals in the acquired heart rate signals.

Method used

Multiple heart rate signals are collected within a set time period to form a first heart rate signal array, which is then sorted in descending order. Heart rate signals within a preset peak position range are obtained to form a second heart rate signal array. The position of the target heart rate signal in the array is determined by combining the average value of the first heart rate signal array and a preset number of valid heart rate signals. The current heart rate is then obtained through a preset heart rate calculation formula.

Benefits of technology

By sorting and filtering heart rate signals, the accuracy of heart rate detection is effectively improved, and the impact of weak signals and interference on detection is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117796778B_ABST
    Figure CN117796778B_ABST
Patent Text Reader

Abstract

This application belongs to the field of heart rate detection, specifically relating to a heart rate detection method, apparatus, device, and medium. This application aims to address the problem of low accuracy in existing heart rate detection methods. The heart rate detection method, apparatus, device, and medium provided in this application, after acquiring a first heart rate signal array, sorts the heart rate signals in descending order to obtain heart rate signals within a preset peak position range, thus obtaining a second heart rate signal array. Then, combined with the average value of the first heart rate signal array, a preset number of valid heart rate signals is determined. Combined with a preset range of valid heart rate signals, the position of the target heart rate signal in the first heart rate signal array can be determined, thereby obtaining the current heart rate. This solution effectively improves the accuracy of heart rate detection by determining the position of the target heart rate signal in the first heart rate signal array based on a preset range and the number of valid heart rate signals, thereby obtaining the current heart rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of heart rate detection, specifically to heart rate detection methods, devices, equipment, and media. Background Technology

[0002] Heart rate, as an important physiological parameter, is closely related to everyone. Currently, known medical-grade or health consumer products that can detect heart rate include pulse oximeters, electrocardiogram (ECG) monitors, smartwatches, ECG clothing, and smart mattresses. Depending on the sensors used, different types of heart rate signals are acquired, such as electrocardiogram (ECG) signals, photoplethysmography (PPG) signals, and cardiac impact signals, which are then used to calculate the heart rate.

[0003] In existing technologies, after acquiring a heart rate signal, the peak values ​​are determined, the average time interval between the peak values ​​is obtained, and then the heart rate value is calculated using a heart rate calculation formula. However, due to different user habits, the acquired heart rate signal may be weak or contain interference.

[0004] In summary, the heart rate detection methods used in the prior art have low accuracy due to the presence of weak or interference signals in the acquired heart rate signals. Summary of the Invention

[0005] In order to solve the above-mentioned problems in the prior art, that is, to solve the problem that the heart rate detection method used in the prior art has low accuracy due to the presence of weak signals or interference signals in the acquired heart rate signal, the present application provides a heart rate detection method, device, equipment and medium.

[0006] In a first aspect, embodiments of this application provide a heart rate detection method, including:

[0007] Multiple heart rate signals are collected within a set time period to obtain the first heart rate signal array;

[0008] The heart rate signals in the first heart rate signal array are sorted from largest to smallest, and the heart rate signals within a preset peak position range are obtained to obtain the second heart rate signal array.

[0009] Based on the average value of the first heart rate signal array and the second heart rate signal array, a preset number of valid heart rate signals are determined;

[0010] The position of the target heart rate signal in the first heart rate signal array is determined based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity.

[0011] The current heart rate is determined based on the position of the target heart rate signal in the first heart rate signal array.

[0012] In the preferred embodiment of the above heart rate detection method, determining a preset number of valid heart rate signals based on the average value of the first heart rate signal array and the second heart rate signal array includes:

[0013] Calculate the difference between the second heart rate signal array and the average value, and then calculate the average value of the difference to obtain the peak height;

[0014] Divide the peak height by the preset number to obtain the peak gradient difference;

[0015] Based on the peak gradient difference, the peak height is divided into the preset number of sub-peak heights;

[0016] For each sub-peak height, the number of effective heart rate signals is obtained by subtracting the average value of the first heart rate signal array from the number of heart rate signals with a sub-peak height greater than 0 in the first heart rate signal array.

[0017] In the preferred embodiment of the above heart rate detection method, determining the position of the target heart rate signal in the first heart rate signal array based on a preset effective heart rate signal quantity range and the effective heart rate signal quantity includes:

[0018] The target number of heart rate signals is determined based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity.

[0019] Based on the sub-peak height corresponding to the number of target heart rate signals, the heart rate signals in the first heart rate signal array whose sub-peak height is greater than 0 (minus the average value of the first heart rate signal array) are determined as the first heart rate signals.

[0020] The position of the first heart rate signal in the first heart rate signal array is determined as the position of the target heart rate signal in the first heart rate signal array.

[0021] In the preferred embodiment of the above heart rate detection method, determining the target heart rate signal quantity based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity includes:

[0022] If there are valid heart rate signals within the preset range of valid heart rate signals, then the largest valid heart rate signal within the preset range of valid heart rate signals is determined as the target heart rate signal quantity.

[0023] In the preferred embodiment of the above heart rate detection method, the method further includes:

[0024] If there are no valid heart rate signals in the number of valid heart rate signals that belong to the preset range of valid heart rate signals, then the number of valid heart rate signals that is closest to the preset range of valid heart rate signals is determined as the target number of heart rate signals.

[0025] In the preferred embodiment of the above heart rate detection method, the method further includes:

[0026] If there are no valid heart rate signals belonging to the preset valid heart rate signal range among the number of valid heart rate signals, then the peak height is increased, the peak gradient difference is recalculated, and the number of valid heart rate signals is updated until there are valid heart rate signals belonging to the preset valid heart rate signal range among the updated number of valid heart rate signals.

[0027] In the preferred embodiment of the above heart rate detection method, after determining the heart rate signals in the first heart rate signal array as the first heart rate signal by subtracting the average value of the first heart rate signal array from the heart rate signal with a sub-peak height greater than 0, based on the sub-peak height corresponding to the number of target heart rate signals, the method further includes:

[0028] The position of the first heart rate signal in the first heart rate signal array is determined as the position of the first heart rate signal;

[0029] Arrange the positions of the first heart rate signal from smallest to largest to obtain the first heart rate signal position array;

[0030] The first heart rate signal position array is divided into a second heart rate signal position array, and the difference between adjacent first heart rate signal positions in each second heart rate signal position array is equal to 1.

[0031] For each second heart rate signal position array, the position of the first heart rate signal with the largest corresponding heart rate signal in the second heart rate signal position array is determined as the second heart rate signal position;

[0032] The position of the second heart rate signal is determined as the position of the target heart rate signal in the first heart rate signal array.

[0033] In the preferred embodiment of the above heart rate detection method, after determining the position of the first heart rate signal with the largest corresponding heart rate signal in each second heart rate signal position array as the second heart rate signal position, the method further includes:

[0034] Arrange the positions of the second heart rate signal from smallest to largest to obtain the third heart rate signal position array;

[0035] Determine the range of heart rate signal location intervals based on the preset heart rate range;

[0036] Based on the heart rate signal position spacing range and the third heart rate signal position array, a fourth heart rate signal position array is determined, wherein the position spacing between adjacent heart rate signal positions in the fourth heart rate signal position array belongs to the heart rate signal position spacing range.

[0037] If the number of heart rate signal positions in the fourth heart rate signal position array is greater than or equal to the preset number of heart rate signals, then the heart rate signal position in the fourth heart rate signal position array is determined as the position of the target heart rate signal in the first heart rate signal array.

[0038] In the preferred embodiment of the above heart rate detection method, the method further includes:

[0039] If the number of heart rate signal positions in the fourth heart rate signal position array is less than the preset number of heart rate signals, then the first preset number of heart rate signal positions in the third heart rate signal position array, arranged in descending order of the corresponding heart rate signals, are determined as the position of the target heart rate signal in the first heart rate signal array.

[0040] In the preferred embodiment of the above heart rate detection method, the method further includes:

[0041] Based on the position of the target heart rate signal in the first heart rate signal array, the positional distance between adjacent heart rate signal positions is determined to obtain the first positional distance;

[0042] Determine the mode of the first position spacing;

[0043] Based on the mode multiples of the mode, the first position spacing within the preset value range of the mode multiples is divided to obtain the second position spacing;

[0044] If the ratio of the number of modes of the second position spacing to the number of second position spacings is less than a preset confidence threshold, then the heart rate is updated according to the position of the target heart rate signal obtained this time in the first heart rate signal array and the position of the target heart rate signal obtained last time in the first heart rate signal array.

[0045] Secondly, embodiments of this application provide a heart rate detection device, comprising:

[0046] The acquisition module is used to collect multiple heart rate signals within a set time period to obtain a first heart rate signal array;

[0047] Processing module, used for:

[0048] The heart rate signals in the first heart rate signal array are sorted from largest to smallest, and heart rate signals within a preset sorting range are obtained to obtain the second heart rate signal array.

[0049] Based on the average value of the first heart rate signal array and the second heart rate signal array, a preset number of valid heart rate signals are determined;

[0050] The position of the target heart rate signal in the first heart rate signal array is determined based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity.

[0051] The current heart rate is determined based on the position of the target heart rate signal in the first heart rate signal array.

[0052] Thirdly, embodiments of this application provide an electronic device, including:

[0053] Processor, memory, communication interface;

[0054] The memory is used to store the executable instructions of the processor;

[0055] The processor is configured to execute the heart rate detection method according to any one of the first aspects by executing the executable instructions.

[0056] Fourthly, embodiments of this application provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the heart rate detection method described in any of the first aspects.

[0057] Fifthly, embodiments of this application provide a computer program product, including a computer program, which, when executed by a processor, is used to implement the heart rate detection method described in any of the first aspects.

[0058] Those skilled in the art will understand that the heart rate detection method, apparatus, device, and medium provided in this application, after obtaining a first heart rate signal array, sorts the heart rate signals in it in descending order to obtain heart rate signals within a preset peak position range, thus obtaining a second heart rate signal array. Then, combined with the average value of the first heart rate signal array, a preset number of valid heart rate signals are determined. Furthermore, combined with a preset effective heart rate signal range, the position of the target heart rate signal in the first heart rate signal array can be determined, thereby obtaining the current heart rate. This solution, by determining the position of the target heart rate signal in the first heart rate signal array based on a preset effective heart rate signal range and the number of valid heart rate signals, and thus obtaining the current heart rate, effectively improves the accuracy of heart rate detection. Attached Figure Description

[0059] A preferred embodiment of the heart rate detection method of this application will now be described with reference to the accompanying drawings. The drawings are as follows:

[0060] Figure 1a A flowchart illustrating an embodiment of the heart rate detection method provided in this application;

[0061] Figure 1b A schematic diagram of the sub-peak height provided for an embodiment of this application;

[0062] Figure 2 A flowchart illustrating Embodiment 2 of the heart rate detection method provided in this application;

[0063] Figure 3 A flowchart illustrating Embodiment 3 of the heart rate detection method provided in this application;

[0064] Figure 4 A flowchart illustrating Embodiment 4 of the heart rate detection method provided in this application;

[0065] Figure 5 A flowchart illustrating Embodiment 5 of the heart rate detection method provided in this application;

[0066] Figure 6 A schematic diagram of the structure of an embodiment of the heart rate detection device provided in this application;

[0067] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0068] First, those skilled in the art should understand that these embodiments are merely for explaining the technical principles of this application and are not intended to limit the scope of protection of this application. Those skilled in the art can make adjustments as needed to adapt to specific application scenarios.

[0069] Secondly, it should be noted that in the description of the embodiments of this application, the terms "inner" and "outer" and other terms indicating the direction or positional relationship are based on the direction or positional relationship shown in the drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or component must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this application.

[0070] Furthermore, it should be noted that, in the description of the embodiments of this application, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application according to the specific circumstances.

[0071] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0072] With the development of technology and the improvement of people's living standards, people are paying more and more attention to health, and heart rate is an indispensable physiological parameter. Heart rate can be detected by various smart devices, such as smart wearable devices, ECG clothing, and smart mattresses.

[0073] Current heart rate detection technologies typically involve collecting heart rate signals, identifying peak values, calculating the average time interval between peaks, and then using a heart rate calculation formula to arrive at the heart rate value. However, due to varying user habits, weak or interfering signals may appear in the heart rate signal, leading to lower accuracy in heart rate detection.

[0074] This embodiment provides a heart rate detection method. When obtaining a first heart rate signal array, instead of directly determining the peak value of the first heart rate signal, the heart rate signals in the first heart rate signal array are sorted in descending order, and the larger heart rate signal is selected to obtain a second heart rate signal array. Then, based on the average value of the second and first heart rate signal arrays, a preset number of valid heart rate signals are determined, which initially determines the number of heart rate signals used for heart rate calculation. Next, based on a preset range of valid heart rate signal numbers and the number of valid heart rate signals, the position of the target heart rate signal in the first heart rate signal array is determined, which determines the final position of the heart rate signal used for heart rate calculation. Finally, by combining this with a preset heart rate calculation formula, the current heart rate can be obtained, effectively improving the accuracy of heart rate detection.

[0075] The principles and features of the embodiments of this application are described below with reference to the accompanying drawings. The examples given are only used to explain the embodiments of this application and are not intended to limit the scope of the embodiments of this application.

[0076] The subject executing the sleep state detection method in this application can be a smart wearable device, a sleep belt, a smart mattress, a smart pillow, or a server, computer, terminal device, or other device capable of acquiring heart rate signals and performing heart rate detection. This application does not limit these devices. The following description uses a smart wearable device as an example.

[0077] The application scenarios of the heart rate detection method provided in this application are described below.

[0078] In this application scenario, the user wears a smart wearable device, such as a smart bracelet, but because the user wears it loosely, the heart rate signal obtained is weak.

[0079] After a smart wearable device collects multiple heart rate signals over a set time period, it can treat these signals as an array to obtain a first heart rate signal array. Then, the heart rate signals are sorted from largest to smallest, and heart rate signals within a preset peak range are obtained to obtain a second heart rate signal array. The heart rate signal at the center of the second heart rate signal array is the heart rate signal that is likely at its peak.

[0080] Then, by combining the average value of the first heart rate signal array, a preset number of effective heart rate signals is determined. The number of effective heart rate signals is the number of heart rate signals initially determined for calculating the heart rate.

[0081] Then, based on the preset effective heart rate signal quantity range, the position of the target heart rate signal in the first heart rate signal array is obtained. The position spacing between adjacent target heart rate signals is then calculated, and the mode of the position spacing is determined. The current heart rate can then be obtained according to the preset heart rate calculation formula.

[0082] It should be noted that the embodiments of this application do not limit the actual form of various devices in the application scenario. In the specific application of the solution, it can be set according to actual needs.

[0083] The technical solution of this application will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0084] Figure 1a This is a flowchart illustrating an embodiment of the heart rate detection method provided in this application. In this embodiment, after the smart wearable device acquires a first heart rate signal array, the heart rate signals are sorted in descending order. A second heart rate signal array is obtained based on a preset peak position range. The current heart rate is then calculated by combining the average value of the first heart rate signal array, a preset effective heart rate signal quantity range, and a preset heart rate calculation formula. The method in this embodiment can be implemented through software, hardware, or a combination of both. Figure 1aAs shown, this heart rate detection method specifically includes the following steps:

[0085] S101: Collect multiple heart rate signals within a set time period to obtain the first heart rate signal array.

[0086] In this step, after the user puts on the smart wearable device, the smart wearable device can collect heart rate signals and determine multiple heart rate signals within a set time period as the first heart rate signal array.

[0087] It should be noted that the set time can be 20 seconds, 30 seconds, or 2 minutes. This application embodiment does not limit the set time and can be set according to the actual situation.

[0088] It should be noted that the heart rate signal types in the first heart rate signal array include piezoelectric signals, photosolvent pulse wave signals, electrocardiogram signals, first-order differential signals of piezoelectric signals, first-order differential signals of photosolvent pulse wave signals, or first-order differential signals of electrocardiogram signals, etc. This application embodiment does not limit the heart rate signals in the first heart rate signal array, and can be determined according to the actual situation.

[0089] S102: Sort the heart rate signals in the first heart rate signal array from largest to smallest, and obtain the heart rate signals within the preset peak position range to obtain the second heart rate signal array.

[0090] In this step, after acquiring the first heart rate signal array, the smart wearable device needs to determine the positions of heart rate signals that can be used to calculate the heart rate in order to improve the accuracy of heart rate detection. This requires first sorting the heart rate signals in the first heart rate signal array from largest to smallest, and then acquiring the heart rate signals within a preset peak position range to obtain the second heart rate signal array. The second heart rate signal array is used to subsequently determine the peak height in order to obtain the number of valid heart rate signals.

[0091] For example, the first heart rate signal array contains 400 heart rate signals. After sorting them from largest to smallest, the preset peak position range is 11-200. Therefore, the 11th to 200th heart rate signals are selected as the second heart rate signal array. Starting the selection from the 11th heart rate signal is to remove larger heart rate signals and reduce errors. Selecting up to the 200th heart rate signal is to ensure that the selected heart rate signals are as close to the peak value as possible.

[0092] It should be noted that the above example is only an illustration of the process of determining the second heart rate signal array. The number of heart rate signals in the first heart rate signal array can also be 600 or 800. The preset peak position range can also be 20-300 or 30-400. This application embodiment does not limit the number of heart rate signals or the preset peak position range in the first heart rate signal array, and can be determined according to the actual situation.

[0093] S103: Determine a preset number of valid heart rate signals based on the average value of the first heart rate signal array and the second heart rate signal array.

[0094] In this step, after obtaining the second heart rate signal array, the smart wearable device can determine a preset number of valid heart rate signals based on the average value of the first heart rate signal array and the second heart rate signal array.

[0095] Specifically, first, the average value of the first heart rate signal array is calculated, which is the average value of the heart rate signal in the first heart rate signal array. Then, the difference between the second heart rate signal array and this average value is calculated, which is the difference between the heart rate signal in the second heart rate signal array and this average value. Finally, the average value of the difference is calculated to obtain the peak height.

[0096] The peak height is then divided by a preset number to obtain the peak gradient difference. Based on the peak gradient difference, the peak height is then divided into a preset number of sub-peak heights.

[0097] For example, if the peak height is 600 and the preset number is 20, then there are 20 sub-peak heights, namely: 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360, 390, 420, 480, 510, 540, 570, and 600.

[0098] It should be noted that the peak height can also be 500 or 700. The preset quantity can be 20, 30, or 50. This application embodiment does not limit the peak height or the preset quantity, and can be determined according to the actual situation.

[0099] The smart wearable device then calculates the number of valid heart rate signals for each sub-peak height by subtracting the average value of the first heart rate signal array from the number of heart rate signals with a sub-peak height greater than 0.

[0100] For example, Figure 1b A schematic diagram of the sub-peak height provided for an embodiment of this application, as shown below. Figure 1bAs shown in the figure, the broken line is formed by the heart rate signals in the first heart rate signal array. The dashed line represents the sub-peak height. For each sub-peak height, the number of heart rate signals above that sub-peak height is the number of valid heart rate signals.

[0101] S104: Determine the position of the target heart rate signal in the first heart rate signal array based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity.

[0102] In this step, after determining the preset number of effective heart rate signals, the smart wearable device needs to determine the position of the target heart rate signal in the first heart rate signal array based on the preset effective heart rate signal range and the number of effective heart rate signals in order to determine which effective heart rate signal to use for further heart rate calculation.

[0103] The preset effective heart rate signal quantity range is the ideal range of the number of data used to calculate the heart rate. Therefore, the effective heart rate quantity that best matches the preset effective heart rate signal quantity range can be selected from the preset number of effective heart rate signals. Then, based on the effective heart rate quantity and its corresponding sub-peak height, the position of the target heart rate signal in the first heart rate signal array can be determined.

[0104] It should be noted that the preset heart rate signal quantity range can be [90, 120], [70, 150], or [100, 300]. This application embodiment does not limit the preset heart rate signal quantity range, and it can be set according to the actual situation.

[0105] S105: Determine the current heart rate based on the position of the target heart rate signal in the first heart rate signal array.

[0106] In this step, after determining the position of the target heart rate signal in the first heart rate signal array, the smart wearable device calculates the positional distance between adjacent target heart rate signals in the first heart rate signal array, thereby determining the target distance. Then, according to the preset heart rate calculation formula: heart rate = 60 / (target distance / sampling frequency), the current heart rate can be obtained.

[0107] It should be noted that the target spacing can be the mode, median, or other values ​​of the positional spacing. This application does not limit the target spacing, but it can be set according to the actual situation.

[0108] It should be noted that if the target distance is the mode of the positional distance, and there are multiple modes, if the amplitude value of the first heart rate signal array is greater than a preset amplitude threshold, then the largest mode among the multiple modes is taken as the target distance. If the amplitude value of the first heart rate signal array is less than or equal to the preset amplitude threshold, then the smallest mode among the multiple modes is taken as the target distance. The preset amplitude threshold can be 500, 650, or 700. This embodiment does not limit the preset amplitude threshold and can be set according to the actual situation.

[0109] The heart rate detection method provided in this embodiment obtains a first heart rate signal array, sorts the heart rate signals in descending order, and then determines a second heart rate signal array based on a preset peak position range. Next, it combines the average value of the first heart rate signal array to determine the number of valid heart rate signals, and then combines this with a preset effective heart rate signal number range to obtain the position of the target heart rate signal within the first heart rate signal array. Finally, the current heart rate is obtained according to the heart rate calculation formula. Compared to existing technologies that directly determine the peak value and calculate the heart rate after obtaining the heart rate signals, this method sorts the signals in descending order to obtain the second heart rate signal array, and then calculates the current heart rate based on the average value of the first heart rate signal array, the preset effective heart rate signal number range, and the preset heart rate calculation formula, effectively improving the accuracy of heart rate detection.

[0110] Figure 2 This is a flowchart illustrating a second embodiment of the heart rate detection method provided in this application. Based on the above embodiments, this application describes how the position of the target heart rate signal in the first heart rate signal array is determined according to a preset effective heart rate signal quantity range and the number of effective heart rate signals. For example... Figure 2 As shown, in this embodiment, the heart rate detection method specifically includes the following steps:

[0111] S201: Determine a preset number of valid heart rate signals based on the average value of the first heart rate signal array and the second heart rate signal array.

[0112] It should be noted that this step is similar to step S103 in Embodiment 1, and will not be repeated here.

[0113] S202: Determine whether there are any valid heart rate signals within the preset range of valid heart rate signals. If there are valid heart rate signals within the preset range of valid heart rate signals, proceed to step S203. If there are no valid heart rate signals within the preset range of valid heart rate signals, proceed to step S204.

[0114] S203: The largest number of effective heart rate signals among the number of effective heart rate signals belonging to the preset effective heart rate signal quantity range is determined as the target heart rate signal quantity.

[0115] S204: The number of effective heart rate signals that is closest to the preset range of effective heart rate signal numbers is determined as the target heart rate signal number.

[0116] In the above steps, after determining the preset number of valid heart rate signals, the smart wearable device needs to determine the target number of heart rate signals based on the preset effective heart rate signal range and the actual number of valid heart rate signals. That is, it needs to determine whether any valid heart rate signals within the preset effective heart rate signal range exist.

[0117] If there are valid heart rate signals within a preset range that fall within the total number of valid heart rate signals, then the largest valid heart rate signal within that range is determined as the target heart rate signal. Determining the largest valid heart rate signal as the target heart rate signal results in more accurate heart rate calculations.

[0118] If no valid heart rate signal falls within the preset valid heart rate signal range, the valid heart rate signal that is closest to the preset range is determined as the target heart rate signal count. The goal is to ensure that the target heart rate signal count matches the preset range as closely as possible to guarantee the proper execution of the plan.

[0119] For example, the preset quantity is 20, the preset heart rate signal quantity range is [15, 45], and the effective heart rate quantity is 183, 172, 164, 159, 154, 147, 139, 132, 128, 124, 117, 108, 104, 98, 92, 87, 81, 76. There are no effective heart rate signals within the preset effective heart rate signal quantity range. The effective heart rate signal quantity closest to the preset effective heart rate signal quantity range is 76, which is taken as the target heart rate signal quantity. The preset heart rate signal quantity range can also be [90, 120], [70, 150], [100, 300]. This application embodiment does not limit the preset quantity, effective heart rate quantity, or preset heart rate signal quantity range; these can be determined according to actual conditions.

[0120] Optionally, if there are no valid heart rate signals within the preset valid heart rate signal range in the number of valid heart rate signals, the peak height can be increased, the peak gradient difference recalculated, and the number of valid heart rate signals updated until there are valid heart rate signals within the preset valid heart rate signal range in the updated number of valid heart rate signals. The largest valid heart rate signal among the valid heart rate signals within the preset valid heart rate signal range is determined as the target heart rate signal count.

[0121] S205: Based on the sub-peak height corresponding to the number of target heart rate signals, the heart rate signals in the first heart rate signal array whose sub-peak height is greater than 0 (minus the average value of the first heart rate signal array) are determined as the first heart rate signals.

[0122] In this step, after determining the number of target heart rate signals, the smart wearable device, in order to determine the position of the target heart rate signal in the first heart rate signal array, first calculates the number of heart rate signals in the first heart rate signal array by subtracting the average value of the first heart rate signal array from the sub-peak height corresponding to the number of target heart rate signals, and then combining this with... Figure 1b The heart rate signal above the sub-peak height is identified as the first heart rate signal.

[0123] S206: Determine the position of the first heart rate signal in the first heart rate signal array as the position of the target heart rate signal in the first heart rate signal array.

[0124] In this step, after determining the first heart rate signal, the smart wearable device determines the position of the first heart rate signal in the first heart rate signal array as the position of the target heart rate signal in the first heart rate signal array.

[0125] The heart rate detection method provided in this embodiment determines the target heart rate signal quantity based on a preset effective heart rate signal quantity range, then determines the first heart rate signal based on the sub-peak height corresponding to the target heart rate signal quantity, and finally determines the position of the first heart rate signal in the first heart rate signal array as the position of the target heart rate signal in the first heart rate signal array. The heart rate can be determined by using this position in subsequent steps, which can effectively improve the accuracy of heart rate detection.

[0126] Figure 3 This is a flowchart illustrating a third embodiment of the heart rate detection method provided in this application. Based on the above embodiments, this application describes how, after determining the first heart rate signal, in order to improve the accuracy of heart rate detection, non-peak signals are removed from the first heart rate signal to obtain a second heart rate signal, and then the position of the target heart rate signal in the first heart rate signal array is determined. For example... Figure 3 As shown, in this embodiment, the heart rate detection method specifically includes the following steps:

[0127] S301: Determine the position of the first heart rate signal in the first heart rate signal array as the first heart rate signal position.

[0128] S302: Arrange the positions of the first heart rate signal from smallest to largest to obtain the first heart rate signal position array.

[0129] In the above steps, after the smart wearable device determines the first heart rate signal, in order to remove the non-peak signal positions, the position of the first heart rate signal in the first heart rate signal array must first be determined as the first heart rate signal position. Then, the first heart rate signal positions are arranged from smallest to largest to obtain the first heart rate signal position array, so that the first heart rate signal position array can be divided in the subsequent process.

[0130] S303: Divide the first heart rate signal position array into a second heart rate signal position array.

[0131] In this step, after obtaining the first heart rate signal location array, the smart wearable device divides it into a second heart rate signal location array. In each second heart rate signal location array, the difference between adjacent first heart rate signal locations is equal to 1. Consecutive heart rate signal locations are grouped together, so that each second heart rate signal location array includes a peak signal.

[0132] For example, the first heart rate signal location array is {3, 4, 10, 16, 25, 26, 32, 33, 34, 35, 38, 39, 40, 49, 50, 54, 62, 63, 73, 74}. After partitioning, 10 second heart rate signal location arrays are obtained, namely: {3, 4}, {10}, {16}, {25, 26}, {32, 33, 34, 35}, {38, 39, 40}, {49, 50}, {54}, {62, 63}, {73, 74}.

[0133] It should be noted that the above example is only an illustration of the process of dividing the first heart rate signal position array into the second heart rate signal position array. The embodiments of this application do not limit the first heart rate signal position array and the second heart rate signal position array, but can be limited according to the actual situation.

[0134] S304: For each second heart rate signal position array, determine the first heart rate signal position with the largest corresponding heart rate signal in the second heart rate signal position array as the second heart rate signal position.

[0135] S305: Determine the position of the second heart rate signal as the position of the target heart rate signal in the first heart rate signal array.

[0136] In the above steps, after obtaining the second heart rate signal position array, in order to obtain the position of the peak signal, for each second heart rate signal position array, the position of the first heart rate signal with the largest corresponding heart rate signal in the second heart rate signal position array is determined as the second heart rate signal position, and then the second heart rate signal position is determined as the position of the target heart rate signal in the first heart rate signal array, thus obtaining the position of the peak signal.

[0137] For each second heart rate signal position array, since the heart rate signal positions are continuous, there is a peak signal position. The position of the first heart rate signal with the largest corresponding heart rate signal is the position of the peak signal.

[0138] The heart rate detection method provided in this embodiment reduces errors by removing non-peak signal positions from the first heart rate signal position and uses the second heart rate signal position to determine the heart rate, thereby improving the accuracy of heart rate detection.

[0139] Figure 4 This is a flowchart illustrating Embodiment 4 of the heart rate detection method provided in this application. Based on the above embodiments, this application describes how, after determining the position of the second heart rate signal, to improve the accuracy of heart rate detection, heart rate signal positions that do not conform to the spacing are removed from the second heart rate signal positions, thereby obtaining the position of the target heart rate signal in the first heart rate signal array. For example... Figure 4 As shown, in this embodiment, the heart rate detection method specifically includes the following steps:

[0140] S401: Arrange the positions of the second heart rate signal from smallest to largest to obtain the array of positions of the third heart rate signal.

[0141] In this step, after the smart wearable device obtains the second heart rate signal position, in order to remove heart rate signal positions that do not conform to the position spacing, it first arranges the second heart rate signal positions from smallest to largest to obtain the third heart rate signal position array.

[0142] S402: Determine the range of heart rate signal position intervals based on the preset heart rate range.

[0143] In this step, after acquiring the location of the second heart rate signal, the smart wearable device can determine the distance range between the heart rate signal locations based on a preset heart rate range.

[0144] For example, the preset heart rate range is 40-200, and the sampling frequency is 20Hz. According to 60*sampling frequency / maximum heart rate range ≤ heart rate signal position spacing ≤ 60*sampling frequency / minimum heart rate range, the heart rate signal position spacing range can be obtained as [6, 30].

[0145] It should be noted that the above example is only an illustration of the process of determining the range of heart rate signal location intervals. The preset heart rate range can also be 50-180 or 45-150; the sampling frequency can also be 25Hz or 30Hz. This application embodiment does not limit the preset heart rate range or sampling frequency, and can be set according to the actual situation.

[0146] It should be noted that the execution order of steps S401 and S402 can be as follows: step S401 is executed first, followed by step S402; step S402 is executed first, followed by step S401; or steps S401 and S402 are executed simultaneously. This embodiment does not limit the execution order of steps S401 and S402, and can be set according to actual circumstances.

[0147] S403: Determine the fourth heart rate signal position array based on the heart rate signal position interval range and the third heart rate signal position array.

[0148] In this step, after obtaining the third heart rate signal position array and the heart rate signal position spacing range, the smart wearable device can determine the fourth heart rate signal position array based on the heart rate signal position spacing range and the third heart rate signal position array. The position spacing between adjacent heart rate signal positions in the fourth heart rate signal position array belongs to the heart rate signal position spacing range. That is, some heart rate signal positions in the third heart rate signal position array are removed so that the position spacing between adjacent heart rate signal positions belongs to the heart rate signal position spacing range, thus obtaining the fourth heart rate signal position array.

[0149] S404: Determine whether the number of heart rate signal positions in the fourth heart rate signal position array is greater than or equal to the preset number of heart rate signals; if the number of heart rate signal positions in the fourth heart rate signal position array is greater than or equal to the preset number of heart rate signals, then execute step S405; if the number of heart rate signal positions in the fourth heart rate signal position array is less than the preset number of heart rate signals, then execute step S406.

[0150] S405: Determine the position of the heart rate signal in the fourth heart rate signal position array as the position of the target heart rate signal in the first heart rate signal array.

[0151] S406: In the third heart rate signal position array, the positions of the first preset number of heart rate signals in descending order of the corresponding heart rate signals are determined as the position of the target heart rate signal in the first heart rate signal array.

[0152] In the above steps, after obtaining the fourth heart rate signal location array, the smart wearable device needs to determine whether the number of heart rate signal locations in the fourth heart rate signal location array is greater than or equal to the preset number of heart rate signals in order to improve the accuracy of heart rate detection.

[0153] If the number of heart rate signal positions in the fourth heart rate signal position array is greater than or equal to the preset number of heart rate signals, it means that the number of heart rate signal positions in the fourth heart rate signal position array is used to calculate the heart rate, which can ensure the accuracy of the heart rate calculation. Therefore, the heart rate signal positions in the fourth heart rate signal position array are determined as the positions of the target heart rate signal in the first heart rate signal array.

[0154] If the number of heart rate signal positions in the fourth heart rate signal position array is less than the preset number of heart rate signals, it means that the accuracy of heart rate calculation is low when only the fourth heart rate signal position array is used. It is necessary to increase the number of heart rate signal positions. In the third heart rate signal position array, the first preset number of heart rate signal positions are determined according to the order of the corresponding heart rate signals from largest to smallest as the position of the target heart rate signal in the first heart rate signal array.

[0155] It should be noted that the preset number of heart rate signals can be 20, 30, or 40. This application embodiment does not limit the preset number of heart rate signals and can be set according to the actual situation.

[0156] The heart rate detection method provided in this embodiment can improve the accuracy of heart rate detection by removing heart rate signal positions that do not conform to the position spacing from the second heart rate signal positions.

[0157] Figure 5 This is a flowchart illustrating Embodiment 5 of the heart rate detection method provided in this application. Based on the above embodiments, this embodiment describes the process of calculating the reliability of the current heart rate after obtaining it, and updating the heart rate when the reliability is less than a reliability threshold. Figure 5 As shown, in this embodiment, the heart rate detection method specifically includes the following steps:

[0158] S501: Based on the position of the target heart rate signal in the first heart rate signal array, determine the positional distance between adjacent heart rate signal positions to obtain the first positional distance.

[0159] In this step, after the smart wearable device obtains the current heart rate, in order to determine the reliability of the current heart rate, it needs to first determine the positional distance between adjacent heart rate signal positions based on the position of the target heart rate signal in the first heart rate signal array, and obtain the first positional distance.

[0160] S502: Determine the mode of the first position spacing.

[0161] S503: Based on the mode multiples, the first position spacing within the preset value range of the mode multiples is split to obtain the second position spacing.

[0162] In the above steps, after obtaining the first position spacing, the smart wearable device determines the mode of the first position spacing, and then, based on the mode multiples of the mode, splits the first position spacing within the preset value range of the mode multiples to obtain the second position spacing.

[0163] For example, the first position spacing is 23, 24, 24, 23, 24, 48, 23, 23, 46, 74, 10, 11; the mode is 23, and the preset value range is -2 and 2, so the first position spacing within the range of twice the value of 23 is 48, 46; 48 is split into 24, 24; and 46 is split into 23, 23. The second position spacing is 23, 24, 24, 23, 24, 24, 24, 23, 23, 23, 23, 74, 10, 11.

[0164] It should be noted that the above example is only an illustration of the process of obtaining the second position spacing. The preset value range can also be -5 and 5, -3 and 3. This application embodiment does not limit the preset value range and can be set according to the actual situation.

[0165] S504: If the ratio of the number of modes of the second position spacing to the number of second position spacings is less than the preset confidence threshold, then update the heart rate according to the position of the target heart rate signal obtained this time in the first heart rate signal array and the position of the target heart rate signal obtained last time in the first heart rate signal array.

[0166] In this step, after acquiring the second position spacing, if the ratio of the mode of the second position spacing to the total number of second position spacings is less than a preset confidence threshold, the heart rate is updated based on the position of the currently acquired target heart rate signal in the first heart rate signal array and the position of the previously acquired target heart rate signal in the first heart rate signal array. The position spacing of the currently acquired target heart rate signal in the first heart rate signal array and the position spacing of the previously acquired target heart rate signal in the first heart rate signal array are calculated, and their mode is used as the target position spacing. Combined with the heart rate calculation formula, the new heart rate can be obtained.

[0167] It should be noted that the preset confidence threshold can be 70%, 80%, or even 90%. This application does not limit the preset confidence threshold; it can be set according to the actual situation.

[0168] The heart rate detection method provided in this embodiment improves the accuracy of heart rate detection by calculating the reliability of the heart rate after obtaining the current heart rate, and recalculating the heart rate when the reliability is low.

[0169] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0170] Figure 6 This is a schematic diagram of the structure of an embodiment of the heart rate detection device provided in this application. Figure 6 As shown, the heart rate detection device 60 includes:

[0171] The acquisition module 61 is used to acquire multiple heart rate signals within a set time period to obtain a first heart rate signal array;

[0172] Processing module 62 is used for:

[0173] The heart rate signals in the first heart rate signal array are sorted from largest to smallest, and heart rate signals within a preset sorting range are obtained to obtain the second heart rate signal array.

[0174] Based on the average value of the first heart rate signal array and the second heart rate signal array, a preset number of valid heart rate signals are determined;

[0175] The position of the target heart rate signal in the first heart rate signal array is determined based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity.

[0176] The current heart rate is determined based on the position of the target heart rate signal in the first heart rate signal array.

[0177] Furthermore, the processing module 62 is specifically used for:

[0178] Calculate the difference between the second heart rate signal array and the average value, and then calculate the average value of the difference to obtain the peak height;

[0179] Divide the peak height by the preset number to obtain the peak gradient difference;

[0180] Based on the peak gradient difference, the peak height is divided into the preset number of sub-peak heights;

[0181] For each sub-peak height, the number of effective heart rate signals is obtained by subtracting the average value of the first heart rate signal array from the number of heart rate signals with a sub-peak height greater than 0 in the first heart rate signal array.

[0182] Furthermore, the processing module 62 is specifically used for:

[0183] The target number of heart rate signals is determined based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity.

[0184] Based on the sub-peak height corresponding to the number of target heart rate signals, the heart rate signals in the first heart rate signal array whose sub-peak height is greater than 0 (minus the average value of the first heart rate signal array) are determined as the first heart rate signals.

[0185] The position of the first heart rate signal in the first heart rate signal array is determined as the position of the target heart rate signal in the first heart rate signal array.

[0186] Furthermore, the processing module 62 is specifically used for:

[0187] If there are valid heart rate signals within the preset range of valid heart rate signals, then the largest valid heart rate signal within the preset range of valid heart rate signals is determined as the target heart rate signal quantity.

[0188] Furthermore, the processing module 62 is specifically used for:

[0189] If there are no valid heart rate signals in the number of valid heart rate signals that belong to the preset range of valid heart rate signals, then the number of valid heart rate signals that is closest to the preset range of valid heart rate signals is determined as the target number of heart rate signals.

[0190] Furthermore, the processing module 62 is specifically used for:

[0191] If there are no valid heart rate signals belonging to the preset valid heart rate signal range among the number of valid heart rate signals, then the peak height is increased, the peak gradient difference is recalculated, and the number of valid heart rate signals is updated until there are valid heart rate signals belonging to the preset valid heart rate signal range among the updated number of valid heart rate signals.

[0192] Furthermore, the processing module 62 is specifically used for:

[0193] The position of the first heart rate signal in the first heart rate signal array is determined as the position of the first heart rate signal;

[0194] Arrange the positions of the first heart rate signal from smallest to largest to obtain the first heart rate signal position array;

[0195] The first heart rate signal position array is divided into a second heart rate signal position array, and the difference between adjacent first heart rate signal positions in each second heart rate signal position array is equal to 1.

[0196] For each second heart rate signal position array, the position of the first heart rate signal with the largest corresponding heart rate signal in the second heart rate signal position array is determined as the second heart rate signal position;

[0197] The position of the second heart rate signal is determined as the position of the target heart rate signal in the first heart rate signal array.

[0198] Furthermore, the processing module 62 is specifically used for:

[0199] Arrange the positions of the second heart rate signal from smallest to largest to obtain the third heart rate signal position array;

[0200] Determine the range of heart rate signal location intervals based on the preset heart rate range;

[0201] Based on the heart rate signal position spacing range and the third heart rate signal position array, a fourth heart rate signal position array is determined, wherein the position spacing between adjacent heart rate signal positions in the fourth heart rate signal position array belongs to the heart rate signal position spacing range.

[0202] If the number of heart rate signal positions in the fourth heart rate signal position array is greater than or equal to the preset number of heart rate signals, then the heart rate signal position in the fourth heart rate signal position array is determined as the position of the target heart rate signal in the first heart rate signal array.

[0203] Furthermore, the processing module 62 is specifically used for:

[0204] If the number of heart rate signal positions in the fourth heart rate signal position array is less than the preset number of heart rate signals, then the first preset number of heart rate signal positions in the third heart rate signal position array, arranged in descending order of the corresponding heart rate signals, are determined as the position of the target heart rate signal in the first heart rate signal array.

[0205] Furthermore, the processing module 62 is specifically used for:

[0206] Based on the position of the target heart rate signal in the first heart rate signal array, the positional distance between adjacent heart rate signal positions is determined to obtain the first positional distance;

[0207] Determine the mode of the first position spacing;

[0208] Based on the mode multiples of the mode, the first position spacing within the preset value range of the mode multiples is divided to obtain the second position spacing;

[0209] If the ratio of the number of modes of the second position spacing to the number of second position spacings is less than a preset confidence threshold, then the heart rate is updated according to the position of the target heart rate signal obtained this time in the first heart rate signal array and the position of the target heart rate signal obtained last time in the first heart rate signal array.

[0210] The heart rate detection device provided in this embodiment is used to execute the technical solution in any of the foregoing method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0211] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 70 includes:

[0212] Processor 71, memory 72, communication interface 73;

[0213] The memory 72 is used to store the executable instructions of the processor 71;

[0214] The processor 71 is configured to execute the technical solutions in any of the foregoing method embodiments by executing the executable instructions.

[0215] Optionally, the memory 72 can be either standalone or integrated with the processor 71.

[0216] Optionally, when the memory 72 is a device independent of the processor 71, the electronic device 70 may further include:

[0217] Bus 74, memory 72 and communication interface 73 are connected to processor 71 through bus 74 and complete communication with each other. Communication interface 73 is used to communicate with other devices.

[0218] Optionally, the communication interface 73 can be implemented using a transceiver. The communication interface is used to enable communication between the database access device and other devices (e.g., clients, read-write databases, and read-only databases). The memory may include random access memory (RAM) and may also include non-volatile memory, such as at least one disk drive.

[0219] Bus 74 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus.

[0220] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0221] The electronic device is used to execute the technical solutions in any of the foregoing method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0222] This application also provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the technical solutions provided in any of the foregoing method embodiments.

[0223] This application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the technical solutions provided in any of the foregoing method embodiments.

[0224] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A heart rate detection method, characterized in that, include: Multiple heart rate signals are collected within a set time period to obtain the first heart rate signal array; The heart rate signals in the first heart rate signal array are sorted from largest to smallest, and the heart rate signals within a preset peak position range are obtained to obtain the second heart rate signal array. Based on the average value of the first heart rate signal array and the second heart rate signal array, a preset number of valid heart rate signals are determined; The target number of heart rate signals is determined based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity. Based on the sub-peak height corresponding to the number of target heart rate signals, the heart rate signals in the first heart rate signal array whose sub-peak height is greater than 0 (minus the average value of the first heart rate signal array) are determined as the first heart rate signals. The position of the first heart rate signal in the first heart rate signal array is determined as the position of the target heart rate signal in the first heart rate signal array; The current heart rate is determined based on the position of the target heart rate signal in the first heart rate signal array; The step of determining a preset number of valid heart rate signals based on the average value of the first heart rate signal array and the second heart rate signal array includes: Calculate the difference between the second heart rate signal array and the average value, and then calculate the average value of the difference to obtain the peak height; Divide the peak height by the preset number to obtain the peak gradient difference; Based on the peak gradient difference, the peak height is divided into the preset number of sub-peak heights; For each sub-peak height, the number of effective heart rate signals is obtained by subtracting the average value of the first heart rate signal array from the number of heart rate signals with a sub-peak height greater than 0 in the first heart rate signal array.

2. The method according to claim 1, characterized in that, The step of determining the target heart rate signal count based on the preset effective heart rate signal count range and the effective heart rate signal count includes: If there are valid heart rate signals within the preset range of valid heart rate signals, then the largest valid heart rate signal within the preset range of valid heart rate signals is determined as the target heart rate signal quantity.

3. The method according to claim 2, characterized in that, The method further includes: If there are no valid heart rate signals in the number of valid heart rate signals that belong to the preset range of valid heart rate signals, then the number of valid heart rate signals that is closest to the preset range of valid heart rate signals is determined as the target number of heart rate signals.

4. The method according to claim 2, characterized in that, The method further includes: If there are no valid heart rate signals belonging to the preset valid heart rate signal range among the number of valid heart rate signals, then the peak height is increased, the peak gradient difference is recalculated, and the number of valid heart rate signals is updated until there are valid heart rate signals belonging to the preset valid heart rate signal range among the updated number of valid heart rate signals.

5. The method according to claim 1, characterized in that, After determining the heart rate signals in the first heart rate signal array as the heart rate signals whose sub-peak height is greater than 0 (the average value of the first heart rate signal array minus the sub-peak height) based on the sub-peak height corresponding to the number of target heart rate signals, the method further includes: The position of the first heart rate signal in the first heart rate signal array is determined as the position of the first heart rate signal; Arrange the positions of the first heart rate signal from smallest to largest to obtain the first heart rate signal position array; The first heart rate signal position array is divided into a second heart rate signal position array, and the difference between adjacent first heart rate signal positions in each second heart rate signal position array is equal to 1. For each second heart rate signal position array, the position of the first heart rate signal with the largest corresponding heart rate signal in the second heart rate signal position array is determined as the second heart rate signal position; The position of the second heart rate signal is determined as the position of the target heart rate signal in the first heart rate signal array.

6. The method according to claim 5, characterized in that, After determining the position of the first heart rate signal with the largest corresponding heart rate signal in each second heart rate signal position array as the second heart rate signal position, the method further includes: Arrange the positions of the second heart rate signal from smallest to largest to obtain the third heart rate signal position array; Determine the range of heart rate signal location intervals based on the preset heart rate range; Based on the heart rate signal position spacing range and the third heart rate signal position array, a fourth heart rate signal position array is determined, wherein the position spacing between adjacent heart rate signal positions in the fourth heart rate signal position array belongs to the heart rate signal position spacing range. If the number of heart rate signal positions in the fourth heart rate signal position array is greater than or equal to the preset number of heart rate signals, then the heart rate signal position in the fourth heart rate signal position array is determined as the position of the target heart rate signal in the first heart rate signal array.

7. The method according to claim 6, characterized in that, The method further includes: If the number of heart rate signal positions in the fourth heart rate signal position array is less than the preset number of heart rate signals, then the first preset number of heart rate signal positions in the third heart rate signal position array, arranged in descending order of the corresponding heart rate signals, are determined as the position of the target heart rate signal in the first heart rate signal array.

8. The method according to claim 7, characterized in that, The method further includes: Based on the position of the target heart rate signal in the first heart rate signal array, the positional distance between adjacent heart rate signal positions is determined to obtain the first positional distance; Determine the mode of the first position spacing; Based on the mode multiples of the mode, the first position spacing within the preset value range of the mode multiples is divided to obtain the second position spacing; If the ratio of the number of modes of the second position spacing to the number of second position spacings is less than a preset confidence threshold, then the heart rate is updated according to the position of the target heart rate signal obtained this time in the first heart rate signal array and the position of the target heart rate signal obtained last time in the first heart rate signal array.

9. A heart rate detection device, characterized in that, include: The acquisition module is used to collect multiple heart rate signals within a set time period to obtain a first heart rate signal array; Processing module, used for: The heart rate signals in the first heart rate signal array are sorted from largest to smallest, and heart rate signals within a preset sorting range are obtained to obtain the second heart rate signal array. Based on the average value of the first heart rate signal array and the second heart rate signal array, a preset number of valid heart rate signals are determined; The target number of heart rate signals is determined based on the preset effective heart rate signal quantity range and the effective heart rate signal quantity. Based on the sub-peak height corresponding to the number of target heart rate signals, the heart rate signals in the first heart rate signal array whose sub-peak height is greater than 0 (minus the average value of the first heart rate signal array) are determined as the first heart rate signals. The position of the first heart rate signal in the first heart rate signal array is determined as the position of the target heart rate signal in the first heart rate signal array; The current heart rate is determined based on the position of the target heart rate signal in the first heart rate signal array; When the processing module determines a preset number of valid heart rate signals based on the average value of the first heart rate signal array and the second heart rate signal array, it specifically performs the following: Calculate the difference between the second heart rate signal array and the average value, and then calculate the average value of the difference to obtain the peak height; Divide the peak height by the preset number to obtain the peak gradient difference; Based on the peak gradient difference, the peak height is divided into the preset number of sub-peak heights; For each sub-peak height, the number of effective heart rate signals is obtained by subtracting the average value of the first heart rate signal array from the number of heart rate signals with a sub-peak height greater than 0 in the first heart rate signal array.

10. An electronic device, characterized in that, include: Processor, memory, communication interface; The memory is used to store the executable instructions of the processor; The processor is configured to execute the heart rate detection method according to any one of claims 1 to 8 by executing the executable instructions.

11. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the heart rate detection method according to any one of claims 1 to 8.

12. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, is used to implement the heart rate detection method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Heart rate detection method, device, electronic equipment and storage medium

    CN107647860A

  • Electrocardiogram monitoring method and monitoring system

    CN108113667A