Heart rate detection method, device and equipment, readable storage medium and product

By using neural network models and signal processing algorithms to process photoplethysmography (PPG) data in electronic devices, abnormal data can be identified and removed, thus solving the problem of low heart rate detection accuracy and achieving higher heart rate detection accuracy.

CN121101508APending Publication Date: 2025-12-12THE FOURTH PARADIGM BEIJING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511217840.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing electronic devices are easily interfered with by noise signals when detecting a user's heart rate, resulting in low accuracy in heart rate detection.

Method used

By inputting photoplethysmography (PPG) data into a neural network model and a signal processing algorithm, first and second heart rate sequences are obtained respectively. The first heart rate sequence is used to determine whether there is abnormal data in the second heart rate sequence. If there is, the abnormal data is deleted to obtain the third heart rate sequence.

Benefits of technology

This reduces interference from abnormal data and improves the accuracy of the third heart rate sequence, thereby improving the accuracy of the user's heart rate output data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121101508A_ABST
    Figure CN121101508A_ABST
Patent Text Reader

Abstract

The invention provides a heart rate detection method, device and equipment, a readable storage medium and a product, and the heart rate detection method comprises the steps that photoelectric volume pulse wave data of a user is acquired; inputting the photoelectric volume pulse wave data of the user into the neural network model to obtain a first heart rate sequence; inputting the photoelectric volume pulse data of the user into a signal processing algorithm to obtain a second heart rate sequence; the second heart rate sequence and the first heart rate sequence have a corresponding relation in time sequence; judging whether abnormal data exist in the second heart rate sequence or not, and if yes, deleting the abnormal data to obtain a third heart rate sequence; if not, taking the second heart rate sequence as a third heart rate sequence; judging whether abnormal data exist in the second heart rate sequence or not: judging whether abnormal data exist in the second heart rate sequence or not according to the first heart rate sequence; and obtaining heart rate output data of the user according to the third heart rate sequence. Therefore, the accuracy of the obtained heart rate output data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of electronics, and in particular, to a heart rate detection method, device, equipment, readable storage medium and product. BACKGROUND

[0002] With the continuous development of electronic technology, electronic devices occupy an increasingly important position in people's lives. Current electronic devices can be worn on the user's body and can detect the user's heart rate. However, the current electronic devices are usually susceptible to noise signals when detecting the user's heart rate, thereby resulting in low accuracy of the user's heart rate detected by the electronic device. SUMMARY

[0003] Embodiments of the present application provide a heart rate detection method, device, equipment, readable storage medium and product to solve the problem of low accuracy of the user's heart rate detected by the electronic device.

[0004] To solve the above problem, the present application is implemented as follows:

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

[0006] obtaining photoelectric plethysmogram data of a user;

[0007] inputting the photoelectric plethysmogram data of the user into a neural network model to obtain a first heart rate sequence;

[0008] inputting photoelectric plethysmogram data of the user into a signal processing algorithm to obtain a second heart rate sequence; wherein the second heart rate sequence and the first heart rate sequence have a corresponding relationship in time sequence;

[0009] determining whether there is abnormal data in the second heart rate sequence, if yes, deleting the abnormal data to obtain a third heart rate sequence; if no, taking the second heart rate sequence as the third heart rate sequence; wherein determining whether there is abnormal data in the second heart rate sequence comprises: determining whether there is abnormal data in the second heart rate sequence according to the first heart rate sequence;

[0010] obtaining heart rate output data of the user according to the third heart rate sequence.

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

[0012] a data acquisition module configured to obtain photoelectric plethysmogram data of a user;

[0013] a first heart rate sequence determination module configured to input the photoelectric plethysmogram data of the user into a neural network model to obtain a first heart rate sequence;

[0014] The second heart rate sequence determination module is configured to input the photoplethysmogram data of the user into a signal processing algorithm to obtain a second heart rate sequence; wherein the second heart rate sequence has a corresponding relationship in time sequence with the first heart rate sequence.

[0015] The data processing module is configured to determine whether there is abnormal data in the second heart rate sequence, and if yes, delete the abnormal data to obtain a third heart rate sequence; and if no, take the second heart rate sequence as the third heart rate sequence; wherein the determination of whether there is abnormal data in the second heart rate sequence comprises: determining, according to the first heart rate sequence, whether there is abnormal data in the second heart rate sequence.

[0016] The user heart rate determination module is configured to obtain user heart rate output data according to the third heart rate sequence.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and capable of running on the processor; the processor is configured to read the program in the memory to implement the steps in the method in the first aspect.

[0018] In a fourth aspect, an embodiment of the present application further provides a readable storage medium for storing a program, the program being executed by a processor to implement the steps in the method in the first aspect.

[0019] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising computer instructions, the computer instructions being executed by a processor to implement the steps in the method in the first aspect.

[0020] In the embodiment of the present application, the photoplethysmogram data of the user can be input into a neural network model and a signal processing algorithm to obtain a first heart rate sequence and a second heart rate sequence respectively, then according to the first heart rate sequence, it is determined whether there is abnormal data in the second heart rate sequence, if yes, the abnormal data is deleted to obtain a third heart rate sequence; if no, the second heart rate sequence is taken as the third heart rate sequence, thus the interference of abnormal data is reduced, the accuracy of the third heart rate sequence is improved, and the accuracy of the user heart rate output data obtained according to the third heart rate sequence is further improved. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0022] Figure 1 is one of the flowcharts of the heart rate detection method provided by the embodiments of the present application;

[0023] Figure 2 FIG. 2 is a flowchart of a heart rate detection method according to an embodiment of the present application;

[0024] Figure 3A FIG. 3 is a flowchart of a heart rate detection method according to an embodiment of the present application;

[0025] Figure 3B FIG. 4 is a flowchart of a heart rate detection method according to an embodiment of the present application;

[0026] Figure 3C FIG. 5 is a flowchart of a heart rate detection method according to an embodiment of the present application;

[0027] Figure 3D FIG. 6 is a flowchart of a heart rate detection method according to an embodiment of the present application;

[0028] Figure 3E FIG. 7 is a flowchart of a heart rate detection method according to an embodiment of the present application;

[0029] Figure 3F FIG. 8 is a flowchart of a training process and an application process of a neural network model according to an embodiment of the present application;

[0030] Figure 3G FIG. 9 is a flowchart of a heart rate detection method according to an embodiment of the present application;

[0031] Figure 3H FIG. 10 is a structural schematic diagram of a heart rate detection device according to an embodiment of the present application;

[0032] Figure 4 FIG. 11 is a structural schematic diagram of an electronic device according to an embodiment of the present application.

[0033] Figure 5 FIG. 12 is a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.

[0035] The terms "first", "second", and the like in the embodiments of the present application are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products, or devices. In addition, "and / or" is used in the present application to represent at least one of the connected objects, for example, A and / or B and / or C, which represents 7 cases including A alone, B alone, C alone, A and B both exist, B and C both exist, A and C both exist, and A, B and C all exist.

[0036] Please refer to Figure 1 , Figure 1 is a flowchart of a heart rate detection method provided by the embodiments of the present application. Figure 1 The heart rate detection method shown in the figure can be executed by an electronic device.

[0037] As shown in Figure 1 , the heart rate detection method can include the following steps:

[0038] Step 101, obtaining photoplethysmography (PPG) data of a user.

[0039] The PPG data is data obtained by a non-invasive physiological signal detection technology based on optical principles. The core principle of the non-invasive physiological signal detection technology is to detect the change of blood volume in human tissue by using the absorption and reflection characteristics of light. It should be noted that the optical signal detected by the non-invasive physiological signal detection technology is called PPG signal, and the PPG data can be obtained by detecting and analyzing the PPG signal.

[0040] The way to obtain the PPG data of the user can be seen from the following description: the PPG data of the user can be obtained in real time, or the PPG data of the user can also be obtained every preset period.

[0041] The type of the electronic device in the embodiments of the present application is not limited here. Optionally, the electronic device can include a wearable device or a mobile phone, and the wearable device can include a smart watch. Therefore, the user can be understood as the user of the electronic device in the embodiments of the present application.

[0042] Step 102, inputting the PPG data of the user into a neural network model to obtain a first heart rate sequence.

[0043] Among them, the neural network model can accurately obtain the first heart rate sequence from the photoplethysmography pulse wave data, that is, the neural network model has a high accuracy in recognizing the first heart rate sequence.

[0044] It should be noted that the specific type of neural network model is not limited here. Optionally, the neural network model may include Convolutional Neural Network (CNN) model, Recurrent Neural Network (RNN) model, Long Short-Term Memory (LSTM) model, Feedforward Neural Network (FNN) model, fully connected neural network, etc.

[0045] Optionally, when the neural network model is a fully connected neural network model, the user's photoplethysmography (PPG) data can be input into the multi-layer perceptron (MLP) of the fully connected neural network model to obtain the first heart rate sequence.

[0046] Optionally, the user's photoplethysmography (PPG) data is input into a neural network model to obtain a first heart rate sequence, including:

[0047] After standardizing the user's photoplethysmography (PPG) pulse wave data using the Z-score, the data is input into a neural network model. The output data of the neural network model is then mapped using the min_max method to obtain the aforementioned first heart rate sequence. This reduces the size of the input and output data of the neural network model, thereby reducing the consumption of computational resources, improving computational efficiency, and shortening computation time. At the same time, it allows the aforementioned neural network model to be applied to electronic devices with limited memory, such as smartwatches with limited memory.

[0048] Step 103: Input the user's photoplethysmography (PPG) data into the signal processing algorithm to obtain the second heart rate sequence; wherein the second heart rate sequence corresponds to the first heart rate sequence in terms of time sequence.

[0049] Among them, the signal processing algorithm can be used to accurately identify the user's status information based on the user's photoplethysmography pulse data, and the user's status information may include a second heart rate sequence, etc.

[0050] It should be noted that the specific type of signal processing algorithm is not limited here. Optionally, the signal processing algorithm may include the multi-scale peak and trough detection (MSPTD) algorithm.

[0051] Optionally, see Figure 3A ,like Figure 3A As shown, the steps of the signal processing algorithm to obtain the second heart rate sequence can be described as follows:

[0052] Step 301: Preprocess photoplethysmography (PPG) data:

[0053] Overlap: Streaming photoplethysmography (PPG) data retains a certain amount of historical signal to form a certain degree of overlap; the retention window is adjustable.

[0054] Detrending: Perform linear detrending processing to remove low-frequency trend components from the photoplethysmography (PPG) data.

[0055] Step 302: Calculate the scalogram.

[0056] Prefill: Prefill all cells in the scale chart to no (false).

[0057] Binary labeling: Using binary values ​​to indicate whether a point is higher than its neighbors at a specific scale.

[0058] Scale range: Includes all scales from 1 sample interval to sample intervals corresponding to heart rates greater than 30 bpm.

[0059] Step 303: Identify peaks and / or onsets:

[0060] Extreme value identification: Find the local maximum value of the corresponding peak in the scale plot, and the local minimum value of the corresponding starting point.

[0061] Row filtering: Remove rows with excessively large scales among local maximum or minimum values.

[0062] Row and column determination: The column where all values ​​are true is identified as the peak and / or starting point.

[0063] Step 304, Post-process peaks and / or onsets:

[0064] Position optimization: Search within 50ms on both sides of the original position to optimize the position of the peak and / or the starting point.

[0065] Integration and sorting: Integrate the peaks and starting points identified by each window, remove duplicate indices, and the data corresponding to the remaining positions can be used as the second heart rate sequence.

[0066] The temporal correspondence between the second heart rate sequence and the first heart rate sequence can be understood as follows: the second heart rate sequence and the first heart rate sequence are obtained by processing the user's photoplethysmography (PPG) data in two different ways. That is, the second heart rate sequence is obtained by processing the user's PPG data using a signal processing algorithm, while the first heart rate sequence is obtained by processing the user's PPG data using a neural network model. Therefore, the second heart rate sequence and the first heart rate sequence are data corresponding to each other within the same time period.

[0067] Step 104: Determine whether there is abnormal data in the second heart rate sequence. If so, delete the abnormal data to obtain the third heart rate sequence; otherwise, use the second heart rate sequence as the third heart rate sequence. Determining whether there is abnormal data in the second heart rate sequence includes: determining whether there is abnormal data in the second heart rate sequence based on the first heart rate sequence.

[0068] In determining whether there is abnormal data in the second heart rate sequence, the first heart rate sequence can be used as a reference for judgment. This can make the accuracy of identifying abnormal data in the second heart rate sequence higher.

[0069] Step 105: Obtain the user's heart rate output data based on the third heart rate sequence.

[0070] The specific method for obtaining the user's heart rate output data based on the third heart rate sequence is not limited here. Optionally, it may include the following methods: outputting the heart rate output data corresponding to at least a certain time segment in the third heart rate sequence, or standardizing the user's third heart rate sequence to output the user's heart rate output data.

[0071] In this embodiment, through steps 101 to 105, the user's photoplethysmography (PPG) data can be input into a neural network model and a signal processing algorithm to obtain a first heart rate sequence and a second heart rate sequence, respectively. Then, based on the first heart rate sequence, it is determined whether there is abnormal data in the second heart rate sequence. If there is abnormal data, the abnormal data is deleted to obtain a third heart rate sequence; if there is no abnormal data, the second heart rate sequence is used as the third heart rate sequence. In this way, the interference of abnormal data is reduced, the accuracy of the third heart rate sequence is improved, and thus the accuracy of the user's heart rate output data obtained based on the third heart rate sequence is improved.

[0072] As an optional implementation, see [link to implementation details]. Figure 3B The steps for determining whether there is abnormal data in the second heart rate sequence based on the first heart rate sequence include:

[0073] Step 1041: According to the temporal correspondence, calculate the matching degree of the data at each time point in the first heart rate sequence and the second heart rate sequence to obtain the matching result at each time point;

[0074] Step 1042: If the matching result is a mismatch, it is determined that there is abnormal data, and the data at the corresponding time is identified as abnormal data; if the matching result is a match, it is determined that there is no abnormal data.

[0075] Specifically, according to the temporal correspondence, the matching degree of data at each moment in the first heart rate sequence and the second heart rate sequence is calculated to obtain the matching result at each moment. This can be understood as: calculating the matching degree between the heart rate value in the first heart rate sequence and the corresponding heart rate value in the second heart rate sequence at each moment. For example, the heart rate value corresponding to the first moment in the first heart rate sequence is the first value, and the heart rate value corresponding to the first moment in the second heart rate sequence is the second value. The matching degree of the first value and the second value is calculated. If the matching degree is within a preset range, it can be determined that the first value and the second value match. If the matching degree is not within the preset range, it can be determined that the first value and the second value do not match.

[0076] Optionally, the matching degree of the first value and the second value can be calculated by calculating the difference between the first value and the second value, and the difference can be determined as the matching degree.

[0077] In this embodiment, the matching degree of the data at each time point in the first heart rate sequence and the second heart rate sequence is calculated according to the time sequence correspondence to obtain the matching result at each time point. The data at the time point where the matching result does not match is identified as abnormal data. In this way, the accuracy of the identified abnormal data can be higher and the efficiency of identifying abnormal data can be improved.

[0078] It should be noted that since the first heart rate sequence and the second heart rate sequence are obtained by processing the user's photoplethysmography data in two different ways, the difference between the two is usually not too large. If the data corresponding to the first heart rate sequence and the second heart rate sequence differ too much at a certain moment, resulting in a low matching degree, then it is obvious that the data corresponding to that moment is abnormal data.

[0079] As an optional implementation, see [link to implementation details]. Figure 3C Determining whether there is abnormal data in the second heart rate sequence also includes:

[0080] Step 1043: Determine whether the data at each moment in the second heart rate sequence are within the preset interval range;

[0081] Step 1044: If there is data in the second heart rate sequence that exceeds the preset range, then it is determined that there is abnormal data, and the data corresponding to that moment is determined to be abnormal data; if there is no data in the second heart rate sequence that exceeds the preset range, then it is determined that there is no abnormal data.

[0082] Since the data at each moment of the second heart rate sequence is used to represent the user's heart rate, the user's heart rate usually needs to be within the range of 50-200 bpm. If the data at a certain moment is not within the above range, then it is obvious that the data corresponding to that moment is abnormal data.

[0083] The data corresponding to the aforementioned moment is judged as abnormal data, which can be understood as: data in the second heart rate sequence that exceeds the preset range is judged as abnormal data.

[0084] In this embodiment of the application, if there is data in the second heart rate sequence that exceeds the preset range, the data that exceeds the preset range is judged as abnormal data. In this way, the accuracy of the identified abnormal data can be high, and the diversity and flexibility of the abnormal data identification method are also increased.

[0085] As an optional implementation, see [link to implementation details]. Figure 3D Based on the third heart rate sequence, the user's heart rate output data is obtained, including:

[0086] Step 1051: Take the average of the data corresponding to time t and the heart rate output data corresponding to time t-1 in the third heart rate sequence as the heart rate output data corresponding to time t;

[0087] or,

[0088] Step 1052: Subtract the data corresponding to time t in the third heart rate sequence from the heart rate output data corresponding to time t-1 and map it onto a preset function to obtain the change data. Based on the heart rate output data corresponding to time t-1 and the change data, obtain the heart rate output data corresponding to time t.

[0089] or,

[0090] Step 1053: Calculate the standard deviation of the data corresponding to time t in the third heart rate sequence and the N data corresponding to time t in the previous N times in the third heart rate sequence. If the standard deviation is less than the first preset threshold, the mean of each data corresponding to time t and the previous N times in the third heart rate sequence is used as the heart rate output data corresponding to time t; if the standard deviation is greater than or equal to the first preset threshold, the heart rate output data corresponding to time t-1 is used as the heart rate output data corresponding to time t, where N is a positive integer greater than 1.

[0091] The specific type of the preset function is not limited here. Optionally, the preset function can be understood as a function used to calculate heart rate change data. The aforementioned change data can include change value, change rate, etc. When the change data includes change value, the sum of the heart rate output data at time t-1 and the change value can be used as the heart rate output data at time t. When the change data includes change rate, the product of the heart rate output data at time t-1 and the change rate can be used as the heart rate output data at time t.

[0092] The heart rate output data can be calculated in a more diverse and flexible way by using the embodiments of this application.

[0093] As an optional implementation, see [link to implementation details]. Figure 3E Before inputting the user's photoplethysmography (PPG) data into the neural network model to obtain the first heart rate sequence, the process also includes:

[0094] Step 106: The neural network model contains conversion code. The neural network model is converted into a C language function file using the conversion code. The size of the neural network model does not exceed 3kb.

[0095] The user's photoplethysmography (PPG) data is input into a neural network model to obtain the first heart rate sequence, including:

[0096] Step 1021: Process the photoplethysmography (PPG) data using a C language function file to obtain the first heart rate sequence.

[0097] In this way, by converting the code, neural network models trained in other non-C language environments can be converted into C language function files. This allows neural network models trained in non-C language environments to run in a C language runtime environment and process photoplethysmography (PPG) data to obtain the first heart rate sequence.

[0098] In this embodiment of the application, when the resources of the electronic device are limited, the neural network model trained in other non-C language environments can be converted into a C language function file by converting the code. This allows the electronic device to process the photoplethysmography pulse wave data through the C language function file to obtain the first heart rate sequence. In other words, this embodiment of the application can run the above neural network model in an environment with limited resources and strict performance requirements.

[0099] It should be noted that, see Figure 3F , Figure 3F This is a flowchart illustrating the training and application processes of a neural network model. Optionally, such as... Figure 3F As shown, the training and application processes of the neural network model can be described as follows:

[0100] 1. Train the FNN model using Python.

[0101] Among these, non-C languages ​​can be Python, because Python has a wider range of applications, and neural network models can be FNN models;

[0102] The training of the FNN model can include two normalization operations:

[0103] The Z-score method is used to normalize the input sample data (ppg signal). Z-score normalization can make the sample data have a mean of 0 and a standard deviation of 1, which helps the model training converge.

[0104] The label data (heart rate data actually collected by the watch for training) is normalized using the Min-Max normalization method. This method scales the data to a specified range (usually [0,1]). At the same time, the output data of the FNN model also needs to be normalized using the Min-Max normalization method. This makes it easier to compare the output data of the FNN model with the label data, so as to more accurately determine whether the FNN model has converged.

[0105] 2. Once the FNN model has converged, the converged FNN model trained in the Python environment can be converted into a C language function file.

[0106] 3. Apply the C language function file to the electronic device, and process the photoplethysmography data using the C language function file to obtain the first heart rate sequence.

[0107] As an optional implementation, see [link to implementation details]. Figure 3G The neural network model is converted into a C language function file through code conversion, including:

[0108] Step 1061: Analyze the neural network model to obtain the layer structure included in the neural network model;

[0109] Step 1062: Traverse each layer of structure to obtain the parameters and operation logic corresponding to each layer of structure;

[0110] Step 1063: Hard-encode the parameters corresponding to each layer of structure;

[0111] Step 1064: Convert the operational logic corresponding to each layer of the structure into C language functions;

[0112] Step 1065: Generate a C language function file using the hard-coded parameters and the converted C language functions. The C language function file is executable code containing interface functions.

[0113] The aforementioned layer structure may include at least one of the following: mlp, sigmoid, ReLU, and z-score layers.

[0114] The implementation method of this application can accurately generate C language function files, so that the neural network model can run stably and accurately in the C language environment.

[0115] As an optional implementation, see [link to implementation details]. Figure 3H Before inputting the user's photoplethysmography (PPG) data into a neural network model to obtain the first heart rate sequence, and before inputting the user's PPG data into a signal processing algorithm to obtain the second heart rate sequence, the method further includes:

[0116] Step 107: Determine whether the amount of photoplethysmography data has reached the second preset threshold.

[0117] If so, then the steps of inputting the user's photoplethysmography (PPG) data into the neural network model to obtain the first heart rate sequence and inputting the user's PPG data into the signal processing algorithm to obtain the second heart rate sequence are executed.

[0118] In this embodiment, when the amount of photoplethysmography (PPG) data reaches a second preset threshold, the steps of inputting the user's PPG data into a neural network model to obtain a first heart rate sequence and inputting the user's PPG data into a signal processing algorithm to obtain a second heart rate sequence are executed. This improves the accuracy of this step and the accuracy of the obtained first and second heart rate sequences, avoiding the phenomenon that the accuracy of the obtained first and second heart rate sequences is low due to insufficient PPG data before executing the above steps.

[0119] It should be noted that when the amount of photoplethysmography (PPG) data does not reach the second preset threshold, it means that the amount of PPG data is still relatively small, which can easily lead to lower accuracy of the calculated first and second heart rate sequences, and consequently lower accuracy of the final user's heart rate output data.

[0120] Optionally, when the amount of photoplethysmography (PPG) data does not reach the second preset threshold, the user's PPG data is input into the neural network model to obtain the first heart rate sequence, and the first heart rate sequence is determined as the user's heart rate output data. This can improve the output efficiency of the user's heart rate output data and avoid the need to wait for the amount of PPG data to reach the second preset threshold before obtaining the first and second heart rate sequences when the amount of PPG data is small.

[0121] It should be noted that, for a more complete explanation of the above embodiments, please refer to [link / reference needed]. Figure 2 , Figure 2 This is a flowchart illustrating the heart rate detection method provided in the embodiments of this application. The above embodiments can be found in [reference needed]. Figure 2 The steps shown are the same as those in the above embodiments and have the same beneficial technical effects, which will not be repeated here.

[0122] See Figure 4 , Figure 4 This is a structural diagram of the heart rate detection device provided in the embodiments of this application, as shown below. Figure 4 As shown, the heart rate detection device 400 includes:

[0123] Data acquisition module 401 is used to acquire the user's photoplethysmography (PPG) data;

[0124] The first heart rate sequence determination module 402 is used to input the user's photoplethysmography pulse wave data into a neural network model to obtain the first heart rate sequence.

[0125] The second heart rate sequence determination module 403 is used to input the user's photoplethysmography (PPG) data into a signal processing algorithm to obtain a second heart rate sequence; wherein the second heart rate sequence has a temporal correspondence with the first heart rate sequence;

[0126] The data processing module 404 is used to determine whether there is abnormal data in the second heart rate sequence. If so, the abnormal data is deleted to obtain the third heart rate sequence; otherwise, the second heart rate sequence is used as the third heart rate sequence. The determination of whether there is abnormal data in the second heart rate sequence includes: determining whether there is abnormal data in the second heart rate sequence based on the first heart rate sequence.

[0127] The user heart rate determination module 405 is used to obtain the user's heart rate output data based on the third heart rate sequence.

[0128] As an optional implementation, the data processing module 404 includes:

[0129] The first anomaly determination module is used to calculate the matching degree of data at each time point in the first heart rate sequence and the second heart rate sequence according to the time sequence correspondence, and obtain the matching result at each time point; if the matching result is a mismatch, it is determined that there is abnormal data and the data at the corresponding time point is determined to be abnormal data; if the matching result is a match, it is determined that there is no abnormal data.

[0130] The exception handling module is used to delete the abnormal data in the second heart rate sequence when it is determined that there is abnormal data, and use the second heart rate sequence after deleting the abnormal data as the third heart rate sequence. When it is determined that there is no abnormal data, the second heart rate sequence is used as the third heart rate sequence.

[0131] As an optional implementation, the data processing module 404 further includes:

[0132] The second anomaly determination module is used to determine whether the data at each moment in the second heart rate sequence are within a preset range. If there is data in the second heart rate sequence that exceeds the preset range, then it is determined that there is abnormal data, and the data corresponding to that moment is determined to be abnormal data. If there is no data in the second heart rate sequence that exceeds the preset range, then it is determined that there is no abnormal data.

[0133] As an optional implementation, the user heart rate determination module 405 is also used for:

[0134] The average of the data at time t in the third heart rate sequence and the heart rate output data at time t-1 is used as the heart rate output data at time t.

[0135] or,

[0136] The difference between the data at time t and the heart rate output data at time t-1 in the third heart rate sequence is calculated and mapped onto a preset function to obtain the change data. Based on the heart rate output data at time t-1 and the change data, the heart rate output data at time t is obtained.

[0137] or,

[0138] The standard deviation of the data corresponding to time t in the third heart rate sequence and the N data points corresponding to time t in the previous N times in the third heart rate sequence are calculated. If the standard deviation is less than the first preset threshold, the mean of the data points corresponding to time t and the previous N times in the third heart rate sequence is used as the heart rate output data corresponding to time t. If the standard deviation is greater than or equal to the first preset threshold, the heart rate output data corresponding to time t-1 is used as the heart rate output data corresponding to time t, where N is a positive integer greater than 1.

[0139] As an optional implementation, the heart rate detection device 400 further includes:

[0140] The conversion module is used to convert the neural network model into a C language function file using the conversion code carried in the neural network model. The size of the neural network model shall not exceed 3kb.

[0141] The first heart rate sequence determination module 402 is also used to process the photoplethysmography pulse wave data through a C language function file to obtain the first heart rate sequence.

[0142] As an optional implementation, the conversion module includes:

[0143] The parsing submodule is used to parse the neural network model and obtain the layer structure included in the neural network model;

[0144] The traversal submodule is used to traverse each layer of the structure and obtain the parameters and operation logic corresponding to each layer of the structure.

[0145] The encoding submodule is used to hard-encode the parameters corresponding to each layer of the structure.

[0146] The conversion submodule is used to convert the operational logic corresponding to each layer of the structure into C language functions.

[0147] The generation submodule is used to generate a C language function file using hard-coded parameters and converted C language functions. The C language function file is executable code containing interface functions.

[0148] As an optional implementation, the heart rate detection device 400 further includes:

[0149] The judgment module is used to determine whether the amount of photoplethysmography data has reached the second preset threshold.

[0150] If so, the first heart rate sequence determination module 402 performs the step of inputting the user's photoplethysmography (PPG) data into the neural network model to obtain the first heart rate sequence; the second heart rate sequence determination module 403 performs the step of inputting the user's PPG data into the signal processing algorithm to obtain the second heart rate sequence.

[0151] The heart rate detection device 400 can achieve the functions described in the embodiments of this application. Figure 1 The various processes in the method embodiments, and the ways to achieve the same beneficial effects, will not be repeated here to avoid repetition.

[0152] This application also provides an electronic device. Please refer to [link to relevant documentation]. Figure 5 The electronic device may include a processor 501, a memory 502, and a program 5021 stored in the memory 502 and executable on the processor 501. When the program 5021 is executed by the processor 501, it can achieve... Figure 1 Any steps in the corresponding method embodiments and the achievement of the same beneficial effects will not be repeated here.

[0153] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by hardware related to program instructions, and the program can be stored in a readable medium. This application also provides a readable storage medium storing a computer program that, when executed by a processor, can implement the above-described methods. Figure 1 Any step in the corresponding method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.

[0154] Storage media, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0155] This application also provides a computer program product, including computer instructions, which, when executed by a processor, can achieve the above-described functions. Figure 1 Any step in the corresponding method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.

[0156] The above content represents preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles disclosed in this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A heart rate detection method, characterized in that, include: Acquire the user's photoplethysmography (PPG) data; The user's photoplethysmography (PPG) data is input into a neural network model to obtain a first heart rate sequence. The user's photoplethysmography (PPG) data is input into a signal processing algorithm to obtain a second heart rate sequence; wherein the second heart rate sequence corresponds to the first heart rate sequence in time. Determine whether there is abnormal data in the second heart rate sequence. If so, delete the abnormal data to obtain a third heart rate sequence; otherwise, use the second heart rate sequence as the third heart rate sequence. The determination of whether there is abnormal data in the second heart rate sequence includes: determining whether there is abnormal data in the second heart rate sequence based on the first heart rate sequence. The user's heart rate output data is obtained based on the third heart rate sequence.

2. The method according to claim 1, characterized in that, The step of determining whether there is abnormal data in the second heart rate sequence based on the first heart rate sequence includes: According to the temporal correspondence, the matching degree of the data at each time point in the first heart rate sequence and the second heart rate sequence is calculated to obtain the matching result at each time point; If the matching result is a mismatch, it is determined that there is abnormal data, and the data at the corresponding time is identified as abnormal data; if the matching result is a match, it is determined that there is no abnormal data.

3. The method according to claim 1 or 2, characterized in that, The step of determining whether there is abnormal data in the second heart rate sequence further includes: Determine whether the data at each moment in the second heart rate sequence are within a preset range; If there is data in the second heart rate sequence that exceeds the preset range, then it is determined that there is abnormal data, and the data corresponding to that moment is determined to be abnormal data; if there is no data in the second heart rate sequence that exceeds the preset range, then it is determined that there is no abnormal data.

4. The method according to claim 1, characterized in that, The step of obtaining the user's heart rate output data based on the third heart rate sequence includes: The average of the data at time t in the third heart rate sequence and the heart rate output data at time t-1 is used as the heart rate output data at time t. or, The difference between the data at time t and the heart rate output data at time t-1 in the third heart rate sequence is calculated and mapped onto a preset function to obtain the change data. Based on the heart rate output data at time t-1 and the change data, the heart rate output data at time t is obtained. or, The standard deviation of the data corresponding to time t in the third heart rate sequence is calculated with the N data points corresponding to time t in the previous N times in the third heart rate sequence. If the standard deviation is less than a first preset threshold, the mean of the data points corresponding to time t and the previous N times in the third heart rate sequence is used as the heart rate output data corresponding to time t. If the standard deviation is greater than or equal to the first preset threshold, the heart rate output data corresponding to time t-1 is used as the heart rate output data corresponding to time t, where N is a positive integer greater than 1.

5. The method according to claim 1, characterized in that, Before inputting the user's photoplethysmography (PPG) data into the neural network model to obtain the first heart rate sequence, the method further includes: The neural network model carries conversion code, which converts the neural network model into a C language function file. The size of the neural network model does not exceed 3kb. The step of inputting the user's photoplethysmography (PPG) data into a neural network model to obtain a first heart rate sequence includes: The photoplethysmography (PPG) data is processed using the C language function file to obtain the first heart rate sequence.

6. The method according to claim 5, characterized in that, The process of converting the neural network model into a C language function file using the conversion code includes: The neural network model is analyzed to obtain the layer structure included in the neural network model; Traverse each layer structure to obtain the parameters and operation logic corresponding to each layer structure; The parameters corresponding to each layer of structure are hard-coded. The operational logic corresponding to each layer of the structure is converted into C language functions; A C language function file is generated using the hard-coded parameters and the converted C language functions, wherein the C language function file is executable code containing interface functions.

7. A heart rate detection device, characterized in that, include: The data acquisition module is used to acquire the user's photoplethysmography (PPG) data. The first heart rate sequence determination module is used to input the user's photoplethysmography pulse wave data into a neural network model to obtain the first heart rate sequence. The second heart rate sequence determination module is used to input the user's photoplethysmography (PPG) data into a signal processing algorithm to obtain a second heart rate sequence; wherein the second heart rate sequence corresponds to the first heart rate sequence in time. A data processing module is used to determine whether there is abnormal data in the second heart rate sequence. If so, the abnormal data is deleted to obtain a third heart rate sequence; otherwise, the second heart rate sequence is used as the third heart rate sequence. The determination of whether there is abnormal data in the second heart rate sequence includes: determining whether there is abnormal data in the second heart rate sequence based on the first heart rate sequence. The user heart rate determination module is used to obtain the user's heart rate output data based on the third heart rate sequence.

8. An electronic device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; characterized in that the processor is configured to read the program in the memory to implement the steps of the heart rate detection method as described in any one of claims 1 to 6.

9. A readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps of the heart rate detection method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps in the heart rate detection method as described in any one of claims 1 to 6.