A heart rate detection method and related device

By performing sparse decomposition and outlier detection on heartbeat sampling data, combined with mean clustering algorithm, the problems of weak signal and noise interference in heart rate detection are solved, and more accurate heart rate detection is achieved.

CN116776087BActive Publication Date: 2026-07-21CHINA MOBILE COMM GRP TERMINAL +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE COMM GRP TERMINAL
Filing Date
2022-03-02
Publication Date
2026-07-21

Smart Images

  • Figure CN116776087B_ABST
    Figure CN116776087B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of information processing, and particularly relates to a heart rate detection method and related equipment. The method comprises the following steps: obtaining a plurality of groups of heartbeat sampling data; decomposing the plurality of groups of heartbeat sampling data by using a preset sparse dictionary to obtain sparse representation of the plurality of groups of heartbeat sampling data; determining a part greater than a preset threshold in the sparse representation as a heartbeat time sequence; performing outlier factor detection on the heartbeat time sequence to obtain a plurality of outlier factors in the heartbeat time sequence; excluding the plurality of outlier factors to obtain a cleaned heartbeat time sequence; clustering the cleaned heartbeat time sequence; and determining a heart rate detection result according to a clustering result.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to the field of information processing technology, and in particular to a heart rate detection method and related equipment. [Background Technology]

[0002] Virtual Reality (VR) interaction technology is a crucial supporting technology in VR. To ensure user safety when using VR functions, it's necessary to measure vital signs data such as heart rate. Current technologies often acquire this data by adding light sensors to VR interaction devices. However, directly acquired heart rate data signals are weak and contain excessive noise and other interference. Existing technologies often extract valid heart rate detection results by removing noise and then clustering the data. However, this method, due to the weak heart rate signal and high sensitivity requirements, is prone to inaccurate clustering results. [Summary of the Invention]

[0003] To address the aforementioned issues, embodiments of the present invention provide a heart rate detection method and related equipment, which can increase the accuracy and robustness of heart rate detection results.

[0004] In a first aspect, embodiments of the present invention provide a heart rate detection method, comprising:

[0005] Acquire multiple sets of heart rate sampling data;

[0006] The multiple sets of heartbeat sampling data are decomposed using a preset sparse dictionary to obtain a sparse representation of the multiple sets of heartbeat sampling data;

[0007] The portion of the sparse representation that exceeds a preset threshold is determined as the heartbeat time sequence;

[0008] Outlier detection is performed on the heartbeat time sequence to obtain multiple outliers in the heartbeat time sequence;

[0009] After excluding multiple outliers, a cleaned heartbeat time sequence is obtained;

[0010] Cluster the cleaned heartbeat time sequence;

[0011] Based on the clustering results, the heart rate detection results are determined.

[0012] In this embodiment of the invention, outliers are removed to prevent clustering from getting stuck in local optima and affecting clustering performance. This improves the robustness and accuracy of the heart rate detection method.

[0013] In one possible implementation, a preset sparse dictionary is used to decompose the multiple sets of heartbeat sampling data to obtain a sparse representation of the multiple sets of heartbeat sampling data, including:

[0014] Calculate the inner product of the multiple sets of heartbeat sampling data and the inner product of each atom in the preset sparse dictionary, respectively;

[0015] The atom with the largest inner product in the sparse dictionary is determined as the atom that best matches the heartbeat sampling data.

[0016] The most matching atom is subtracted from the multiple sets of heartbeat sampling data to split the multiple sets of heartbeat sampling data into an atom part and a residual part;

[0017] The residual portion is further split until the size of the residual portion is lower than a preset residual threshold or the number of splits is greater than a preset number threshold.

[0018] The sparse representation of the multiple sets of heartbeat sampling data is determined based on the splitting results.

[0019] In one possible implementation, outlier detection is performed on the heartbeat time sequence to obtain multiple outliers in the heartbeat time sequence, including:

[0020] The corresponding heartbeat time distance matrix is ​​obtained based on the heartbeat time sequence;

[0021] Linear fitting is performed on each row of the heartbeat time distance matrix to obtain the fitting coefficients for each row;

[0022] Multiple outlier rows were identified based on the fitting coefficients;

[0023] The outlier row is identified as the outlier factor.

[0024] In one possible implementation, clustering the cleaned heartbeat time sequence includes:

[0025] The cleaned heartbeat time sequence was clustered using the mean clustering algorithm.

[0026] In one possible implementation, the cleaned heartbeat time sequence is clustered using the mean clustering algorithm, including:

[0027] Using multiple random points in the cleaned heartbeat time sequence as centers, a corresponding circular sliding window is created, and the radius of the circular sliding window is determined based on the standard deviation of the cleaned heartbeat time sequence.

[0028] Calculate the mean value in each of the circular sliding windows;

[0029] Using the aforementioned mean values ​​as new centers, move each circular sliding window in the direction of data density within the circular window until the data density within the circular sliding window no longer increases.

[0030] In one possible implementation, the heart rate detection result is determined based on the clustering results, including:

[0031] Calculate the centroid of the data within each of the circular sliding windows;

[0032] The heart rate detection result is determined based on the centroid.

[0033] In one possible implementation, before decomposing the multiple sets of heartbeat sampling data using a preset sparse dictionary to obtain a sparse representation of the multiple sets of heartbeat sampling data, the method further includes:

[0034] The multiple sets of heartbeat sampling data are preprocessed to obtain multiple sets of heartbeat sampling data after noise removal;

[0035] A pre-defined sparse dictionary is used to decompose multiple sets of heartbeat sampling data after noise removal, resulting in sparse representations of the multiple sets of heartbeat sampling data.

[0036] In a second aspect, embodiments of the present invention provide a heart rate detection device, comprising:

[0037] The acquisition module is used to acquire multiple sets of heartbeat sampling data;

[0038] The processing module is used to decompose the multiple sets of heartbeat sampling data using a preset sparse dictionary to obtain a sparse representation of the multiple sets of heartbeat sampling data;

[0039] The processing module is further configured to determine the portion of the sparse representation that is greater than a preset threshold as a heartbeat time sequence;

[0040] The processing module is further configured to perform outlier detection on the heartbeat time sequence to obtain multiple outliers in the heartbeat time sequence;

[0041] The processing module is also used to exclude multiple outliers to obtain a cleaned heartbeat time sequence.

[0042] The processing module is also used to cluster the cleaned heartbeat time sequence;

[0043] The processing module is also used to determine the heart rate detection result based on the clustering result.

[0044] Thirdly, embodiments of the present invention provide an electronic device, comprising:

[0045] At least one processor; and

[0046] At least one memory communicatively connected to the processor, wherein:

[0047] The memory stores program instructions that can be executed by the processor, and the processor can execute the methods described in the first to fourth aspects by calling the program instructions.

[0048] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions that cause the computer to perform the methods described in the first and second aspects.

[0049] It should be understood that the method described in the fourth aspect of the present invention is consistent with the technical solutions in the first and second aspects of the present invention, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be described again. [Attached Image Description]

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

[0051] Figure 1 A flowchart of a heart rate detection method provided in an embodiment of the present invention;

[0052] Figure 2 A flowchart of another heart rate detection method provided in an embodiment of the present invention;

[0053] Figure 3 This is a schematic diagram of the structure of a heart rate detection device provided in an embodiment of the present invention;

[0054] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

Detailed Implementation Methods

[0055] To better understand the technical solutions in this specification, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0056] It should be understood that the described embodiments are merely some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without inventive effort are within the scope of protection of this invention.

[0057] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0058] In this embodiment of the invention, outlier detection is performed on the heartbeat data before clustering, and outliers are removed, thereby improving the robustness of the detection process and thus improving the accuracy of the heart rate detection results.

[0059] Figure 1 This is a flowchart illustrating a heart rate detection method provided in an embodiment of the present invention. Figure 1 As shown, the method includes:

[0060] Step 101: Acquire multiple sets of heartbeat sampling data. Since VR interactive devices, such as VR controllers, are equipped with Inertial Measurement Units (IMUs), IMU data can be acquired as heartbeat sampling data. Specifically, an IMU data acquisition window can be used to obtain multiple sets of heartbeat sampling data. Since typical heart rates range from 40 to 220 beats per minute, and the IMU sampling rate is twice the lowest heart rate, the minimum IMU sampling rate at the highest heart rate is 440 beats per minute, corresponding to a sampling rate of at least 7.333 Hz. Therefore, the sampling rate can be set to 50 Hz to 500 Hz. Preferably, the sampling rate can be set to 500 Hz. To achieve stable detection performance, the IMU data acquisition window needs to be longer than 12 seconds. However, for users, a test duration longer than 18 seconds can cause user boredom, thus reducing the user experience. Therefore, the IMU data acquisition window size can be set to 15 seconds. Each window contains 200×15 IMU data frames, which is 3000 sets of data.

[0061] Step 102: Decompose multiple sets of heartbeat sampling data using a pre-defined sparse dictionary to obtain sparse representations of the heartbeat sampling data. The pre-defined sparse dictionary can be an overcomplete Gabor dictionary. The Gabor function is a Gaussian window function modulated by a sine wave. According to the Heisenberg uncertainty principle, the Gabor function has optimal time-frequency concentration. Specifically, the function is: Among them, u, s, ω and These represent the atom's position, scale frequency, and phase characteristics, respectively. The Gabor overcomplete dictionary is constructed by discretizing these four parameters. Where s = (1 / 2) j , where j is an integer, j≥0, j<8. u=(1 / 2) kω = (1 / 2) where k is an integer, k ≥ -8, k < 8. m , where m is an integer, m≥-8, m<8. Where n is an integer, n ≥ -12, n < 12. The resulting Gabor overcomplete dictionary has 8 × 16 × 16 × 24 = 49152 atoms. The dimension of the Gabor overcomplete dictionary is 3000 × 39152. This improves the detection capability of low signal-to-noise ratio signals, increases the dictionary's sensitivity, and reduces noise in the dictionary. After completing the Gabor overcomplete dictionary, the matching pursuit method can be used to solve multiple sets of heartbeat sampling data to obtain the corresponding sparse representation.

[0062] In some embodiments, the specific steps for obtaining a sparse representation of the heartbeat sampling data using the matching pursuit method are as follows: Figure 2 As shown.

[0063] Step S1021: Calculate the inner product of multiple sets of heartbeat sampling data and the inner product of each atom in the preset sparse dictionary.

[0064] Step S1022: The atom with the largest inner product in the sparse dictionary is determined as the atom that best matches the heartbeat sampling data.

[0065] Step S1023: Subtract the best-matching atom from the multiple sets of heartbeat sampling data to split the multiple sets of heartbeat sampling data into an atom part and a residual part.

[0066] Step S1024: Continue splitting the residual portion until the size of the residual portion is lower than a preset residual threshold or the number of splits is greater than a preset number of splits threshold. For example, splitting until the size of the residual portion is lower than 0.001, or the number of splits is greater than 100.

[0067] Step S1025: Determine the sparse representation of multiple sets of heartbeat sampling data based on the splitting results. Specifically, the linear combination of atoms (atomic part and residual part) of the heartbeat sampling data obtained in the counting step constitutes the sparse representation of the heartbeat sampling data.

[0068] In some embodiments, low-frequency noise in the heartbeat sampling data can be removed before decomposition. Specifically, multiple sets of heartbeat sampling data are preprocessed to obtain multiple sets of noise-removed heartbeat sampling data. Preprocessing can be performed using differential filtering and bucket filtering. Since displacement in IMU data (heartbeat sampling data) is generally a low-frequency characteristic, while the heart rate signal is a high-frequency characteristic, differential filtering can remove the influence of low-frequency interference and also reduce the influence of gravitational acceleration. This can be expressed by the formula δIMU = IMU i -IMU i-1 Differential processing is then performed. Among them, the IMU...i -IMU i-1 These are the i-th and (i-1)-th sampled data sets from the IMU data. The differentially analyzed data is then bandpass filtered to extract heartbeat sampled data within the frequency range of 0.5Hz to 5Hz. A pre-defined sparse dictionary is then used to decompose the noise-removed heartbeat sampled data sets, resulting in sparse representations of the heartbeat sampled data sets.

[0069] Step 103: The portion of the sparse representation greater than a preset threshold is identified as the heartbeat time sequence. This can be achieved by first determining the L2 norm corresponding to the sparse representation, and then using the sequence numbers of points greater than the preset L2 norm (preset threshold) to form the heartbeat time sequence. If there are no points in the sparse representation greater than the preset L2 norm, then it is determined that there is no heartbeat signal in the heartbeat sampling data.

[0070] Step 104: Outlier detection is performed on the heartbeat time sequence to obtain multiple outliers. First, a heartbeat time distance matrix is ​​obtained based on the heartbeat time sequence. Specifically, if the heartbeat time sequence is t1 to tn, the first row of the heartbeat time distance matrix is ​​the heartbeat time sequence minus t1, the second row is the heartbeat time sequence minus t2, and so on, resulting in an n-row heartbeat time distance matrix. The elements on the main diagonal of the heartbeat time distance matrix are 0. Then, linear fitting is performed on each row of the heartbeat time distance matrix to obtain the fitting coefficients for each row. The fitting coefficients consist of a linear term coefficient 'a' and a constant term 'b'. Multiple outlier rows are then identified based on the fitting coefficients. Since the coefficient 'b' of a normal heartbeat time sequence should be infinitely close to 0, the larger the absolute value of coefficient 'b', the more likely it is to be an outlier. The absolute values ​​of the coefficients 'b' in each row can be arranged in descending order. The first 20% are then identified as outlier rows. Outliers were identified as outlier factors.

[0071] Step 105: Eliminate multiple outliers to obtain the cleaned heartbeat time sequence.

[0072] Step 106: Cluster the cleaned heartbeat time series. Since mean clustering is sensitive to outliers, it achieves better clustering results for heartbeat time series after outlier removal. Therefore, mean clustering can be used to cluster the cleaned heartbeat time series. Specifically, circular sliding windows are created centered on multiple random points in the cleaned heartbeat time series. The radius of the circular sliding window is determined based on the standard deviation of the cleaned heartbeat time series. Optionally, the standard deviation of the heartbeat series can be calculated, and a radius of 3 times the standard deviation can be used. Then, the mean of each circular sliding window is calculated. Using each mean as a new center, the circular sliding windows are moved towards the direction of data density within the circular window until the data density within the circular sliding window no longer increases. Multiple circular sliding windows may overlap; in this case, the number of data points in each circular sliding window can be determined, and the circular sliding window containing the most data points is retained.

[0073] Step 107: Determine the heart rate detection result based on the clustering results. Multiple non-overlapping circular sliding windows were obtained in the above steps. At this point, the centroid of the data within each circular sliding window can be calculated, and the heart rate detection result can be determined accordingly.

[0074] Corresponding to the above-described heart rate detection method, this embodiment of the invention provides a heart rate detection device, such as... Figure 3 As shown, the heart rate detection device includes an acquisition module 301 and a processing module 302.

[0075] The acquisition module 301 is used to acquire multiple sets of heartbeat sampling data.

[0076] The processing module 302 is used to decompose multiple sets of heartbeat sampling data using a preset sparse dictionary to obtain sparse representations of the multiple sets of heartbeat sampling data.

[0077] The processing module 302 is also used to determine the portion of the sparse representation that is greater than a preset threshold as a heartbeat time sequence.

[0078] The processing module 302 is also used to detect outliers in the heartbeat time series and obtain multiple outliers in the heartbeat time series.

[0079] The processing module 302 is also used to exclude multiple outliers to obtain a cleaned heartbeat time sequence.

[0080] The processing module 302 is also used to cluster the cleaned heartbeat time sequence.

[0081] The processing module 302 is also used to determine the heart rate detection result based on the clustering result.

[0082] Figure 3The mobile terminal provided in the illustrated embodiment can be used to execute this specification. Figures 1-2 The implementation principle and technical effects of the method embodiment shown can be further referred to the relevant description in the method embodiment.

[0083] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, such as... Figure 4 As shown, the aforementioned electronic device may include at least one processor and at least one memory communicatively connected to the processor, wherein the memory stores program instructions executable by the processor, and the processor can execute this specification by calling the program instructions. Figures 1-2 The heart rate detection method provided in the illustrated embodiment.

[0084] like Figure 4 As shown, the electronic device is represented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: one or more processors 410, communication interface 420 and memory 430, and a communication bus 440 connecting different system components (including memory 430, communication interface 420 and processing unit 410).

[0085] Communication bus 440 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) buses, Micro Channel Architecture (MAC) buses, Enhanced ISA buses, Video Electronics Standards Association (VESA) local buses, and Peripheral Component Interconnect (PCI) buses.

[0086] Electronic devices typically include a variety of computer-readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, and removable and non-removable media.

[0087] Memory 430 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The electronic device may further include other removable / non-removable, volatile / non-volatile computer system storage media. Memory 430 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments described herein.

[0088] A program / utility having a set (at least one) of program modules may be stored in memory 430. Such program modules include—but are not limited to—an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules typically perform the functions and / or methods described in the embodiments of this specification.

[0089] Processor 410 executes various functional applications and data processing by running programs stored in memory 430, such as implementing the functions described in this specification. Figures 1-2 The heart rate detection method provided in the illustrated embodiment.

[0090] This specification provides a computer-readable storage medium storing computer instructions that cause a computer to execute this specification. Figures 1-2 The heart rate detection method provided in the illustrated embodiment.

[0091] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in connection with an instruction execution system, apparatus, or device.

[0092] 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.

[0093] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0094] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this specification, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0095] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this specification includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which the embodiments of this specification pertain.

[0096] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0097] It should be noted that the devices involved in the embodiments of this specification may include, but are not limited to, personal computers (hereinafter referred to as PCs), personal digital assistants (hereinafter referred to as PDAs), wireless handheld devices, tablet computers, mobile phones, MP3 displays, MP4 displays, etc.

[0098] In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus 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 interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0099] 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 in a combination of hardware and software functional units.

[0100] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, a connector, or a network device, etc.) or a processor to execute some steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0101] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

Claims

1. A heart rate detection method, characterized in that, include: Acquire multiple sets of heart rate sampling data; The multiple sets of heartbeat sampling data are decomposed using a preset sparse dictionary to obtain a sparse representation of the multiple sets of heartbeat sampling data; The portion of the sparse representation that exceeds a preset threshold is determined as the heartbeat time sequence; Outlier detection is performed on the heartbeat time sequence to obtain multiple outliers in the heartbeat time sequence; After eliminating the outliers, a cleaned heartbeat time sequence is obtained; Cluster the cleaned heartbeat time sequence; Based on the clustering results, the heart rate detection results are determined; The multiple sets of heartbeat sampling data were all acquired by data acquisition windows of the same size; Outlier detection was performed on the heartbeat time sequence to obtain multiple outliers in the heartbeat time sequence, including: The corresponding heartbeat time distance matrix is ​​obtained based on the heartbeat time sequence; Linear fitting is performed on each row of the heartbeat time distance matrix to obtain the fitting coefficients for each row; Multiple outlier rows were identified based on the fitting coefficients; The outlier row is identified as the outlier factor.

2. The method according to claim 1, characterized in that, The multiple sets of heartbeat sampling data are decomposed using a preset sparse dictionary to obtain a sparse representation of the multiple sets of heartbeat sampling data, including: Calculate the inner product of the multiple sets of heartbeat sampling data and the inner product of each atom in the preset sparse dictionary, respectively; The atom with the largest inner product in the sparse dictionary is determined as the atom that best matches the heartbeat sampling data. The most matching atom is subtracted from the multiple sets of heartbeat sampling data to split the multiple sets of heartbeat sampling data into an atom part and a residual part; The residual portion is further split until the size of the residual portion is lower than a preset residual threshold or the number of splits is greater than a preset number threshold. The sparse representation of the multiple sets of heartbeat sampling data is determined based on the splitting results.

3. The method according to claim 1, characterized in that, Clustering of the cleaned heartbeat time sequence includes: The cleaned heartbeat time sequence was clustered using the mean clustering algorithm.

4. The method according to claim 3, characterized in that, The cleaned heartbeat time sequence is clustered using the mean clustering algorithm, including: Using multiple random points in the cleaned heartbeat time sequence as centers, a corresponding circular sliding window is created, and the radius of the circular sliding window is determined based on the standard deviation of the cleaned heartbeat time sequence. Calculate the mean value in each of the circular sliding windows; Using the aforementioned mean values ​​as new centers, move each circular sliding window in the direction of data density within the circular window until the data density within the circular sliding window no longer increases.

5. The method according to claim 4, characterized in that, Based on the clustering results, the heart rate detection results are determined, including: Calculate the centroid of the data within each of the circular sliding windows; The heart rate detection result is determined based on the centroid.

6. The method according to claim 1, characterized in that, Before decomposing the multiple sets of heartbeat sampling data using a preset sparse dictionary to obtain a sparse representation of the multiple sets of heartbeat sampling data, the method further includes: The multiple sets of heartbeat sampling data are preprocessed to obtain multiple sets of heartbeat sampling data after noise removal; A pre-defined sparse dictionary is used to decompose multiple sets of heartbeat sampling data after noise removal, resulting in sparse representations of the multiple sets of heartbeat sampling data.

7. A heart rate detection device, characterized in that, include: The acquisition module is used to acquire multiple sets of heartbeat sampling data; The processing module is used to decompose the multiple sets of heartbeat sampling data using a preset sparse dictionary to obtain a sparse representation of the multiple sets of heartbeat sampling data; The processing module is further configured to determine the portion of the sparse representation that is greater than a preset threshold as a heartbeat time sequence; The processing module is further configured to perform outlier detection on the heartbeat time sequence to obtain multiple outliers in the heartbeat time sequence; The processing module is also used to exclude the multiple outliers to obtain a cleaned heartbeat time sequence. The processing module is also used to cluster the cleaned heartbeat time sequence; The processing module is also used to determine the heart rate detection result based on the clustering result; The multiple sets of heartbeat sampling data were all acquired by data acquisition windows of the same size; The processing module is specifically used for: The corresponding heartbeat time distance matrix is ​​obtained based on the heartbeat time sequence; Linear fitting is performed on each row of the heartbeat time distance matrix to obtain the fitting coefficients for each row; Multiple outlier rows were identified based on the fitting coefficients; The outlier row is identified as the outlier factor.

8. An electronic device, characterized in that, include: At least one processor; as well as At least one memory communicatively connected to the processor, wherein: The memory stores program instructions that can be executed by the processor, and the processor can execute the method as described in any one of claims 1 to 6 by calling the program instructions.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause the computer to perform the method as described in any one of claims 1 to 6.