Heart rate value prediction method and device, medium and equipment
By calculating the difference in heart rate distribution and determining the heart rate value based on the historical and current distributions, the problem of low reliability and accuracy of the central rate prediction in the prior art is solved, and a more stable and accurate heart rate prediction result is achieved.
Patent Information
- Application Number
- CN202310602544.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2024-12-03
AI Technical Summary
Existing heart rate prediction methods rely on different types of heart rate prediction models and artificial empirical parameters, resulting in low reliability and accuracy of prediction results, especially in cases of large heart rate fluctuations, which are prone to deviations.
By calculating the difference in the heart rate distribution of the current moment and historical moment output by the heart rate prediction model, if the difference is greater than the preset threshold, the heart rate value of the current moment is corrected according to the heart rate distribution of the historical moment. If the difference is not large, the heart rate distribution of the current moment is used. Ensure the reliability and accuracy of heart rate values. Specific methods include calculating the distribution difference using KL divergence and determining the final heart rate value based on the variance weight.
It improves the reliability and accuracy of heart rate prediction, reduces model deviation and fluctuations, ensures the stability and accuracy of heart rate values, and is suitable for a variety of heart rate prediction models and distribution forms.
Smart Images

Figure CN119055207A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of smart wearable devices, and in particular to a heart rate value prediction method, device, medium and equipment. Background Art
[0002] Accurate prediction of heart rate helps people understand their physical condition. One method of predicting heart rate is photoplethysmography (PPG), which is a method of detecting heartbeats by transmitting red / green light through photoelectric devices and then measuring the light reflected / transmitted by the skin. Using PPG to predict heart rate has the advantages of low cost, high portability, and strong real-time performance.
[0003] Normally, after the heart rate prediction is completed, the predicted value of the heart rate will be processed to avoid large differences in the model-predicted heart rate at similar moments. Current heart rate calibration generally uses a filtering method. First, the predicted heart rate values of the previous N-1 moments are saved, and a heart rate interval is determined based on the average heart rate of the previous N-1 moments. If the heart rate value predicted at the current moment is not in this heart rate interval, the heart rate value predicted at the current moment is modified to the maximum endpoint value of the heart rate interval. However, the selection of this heart rate interval is mainly determined by artificial experience values, and different types of heart rate prediction models have different selection criteria for heart rate intervals. In summary, the heart rate prediction in the prior art relies more on different types of heart rate prediction models and the selection of artificial experience parameters, and the overall planting of heart rate prediction has greater uncertainty.
[0004] Based on this, there is an urgent need for a method, device, product, medium and equipment for heart rate prediction to increase the reliability and accuracy of heart rate prediction. Summary of the invention
[0005] Embodiments of the present application provide a method, apparatus, product, medium, and device for increasing the reliability and accuracy of heart rate prediction.
[0006] In a first aspect, an embodiment of the present application provides a method for predicting a heart rate value, the method comprising:
[0007] Obtaining a first heart rate distribution output by a heart rate prediction model for the current moment;
[0008] Determine a distribution difference between a heart rate distribution at a historical moment and the first heart rate distribution; the heart rate distribution at the historical moment is determined based on a second heart rate value at the historical moment;
[0009] When the distribution difference is greater than a preset threshold, a first heart rate value at a current moment is determined according to the heart rate distribution at the historical moment and the first heart rate distribution, and the first heart rate value is output.
[0010] Through the above method, the distribution difference between the first heart rate distribution and the second heart rate distribution is first determined. When the distribution difference is too large, it means that the heart rate prediction model has a large deviation and the heart rate fluctuates greatly in a short period of time, which is inconsistent with the actual heart rate situation. Therefore, this situation is screened out, and the first heart rate value is determined according to the heart rate distribution at the historical moment and the first heart rate distribution at the current moment, so as to realize the correction of the first heart rate value and obtain a more reliable and accurate first heart rate.
[0011] In a possible implementation, after determining the first heart rate value at the current moment, the method further includes:
[0012] determining a second heart rate distribution according to the first heart rate value;
[0013] The second heart rate distribution is updated to the heart rate distribution at the historical moment.
[0014] In a possible implementation, if the distribution difference is not greater than the preset threshold, determining the first heart rate value at the current moment according to the first heart rate distribution;
[0015] The first heart rate distribution is updated to the heart rate distribution at the historical moment.
[0016] Through the above method, when the distribution difference is not large, it means that the heart rate distribution at the current moment has not produced abnormal fluctuations and has not fluctuated. Therefore, the first heart rate distribution at the current moment can be directly used to determine the first heart rate value without any inaccuracy.
[0017] In a possible implementation, the method further includes:
[0018] If it is determined that the heart rate distribution at the historical moment does not exist, determining the first heart rate value at the current moment according to the first heart rate distribution;
[0019] The first heart rate distribution is updated to the heart rate distribution at the historical moment.
[0020] In a possible implementation, determining the distribution difference between the heart rate distribution at the historical moment and the first heart rate distribution includes:
[0021] The distribution difference is determined according to the following formula:
[0022]
[0023] Wherein P(x) is the heart rate distribution at the historical moment, Q(x) is the first heart rate distribution at the current moment, and KL(P||Q) is the distribution difference.
[0024] In one possible implementation,
[0025] Obtaining the first heart rate distribution output by the heart rate prediction model for the current moment, including:
[0026] Obtain the variance and mean of the heart rate prediction model based on the Gaussian distribution output that characterizes the heart rate at the current moment; wherein the variance and mean are used to characterize the heart rate distribution; or
[0027] The position parameters and shape parameters that characterize the current heart rate output by the heart rate prediction model based on the logistic distribution are obtained; wherein the position parameters and shape parameters are used to characterize the heart rate distribution.
[0028] In the above manner, the first heart rate distribution output by the first heart rate prediction model can be in various forms, and the above method can be used for all of them, which is independent of the output of the heart rate prediction model itself and the fixed hyperparameter selection, thereby achieving universal compatibility of heart rate value calibration.
[0029] In a possible implementation, determining the first heart rate value at the current moment according to the heart rate distribution at the historical moment and the first heart rate distribution includes:
[0030] Determine, according to a first variance corresponding to the first heart rate distribution and a second variance corresponding to the heart rate distribution at the historical moment, a first weight of a first mean corresponding to the first heart rate distribution and a second weight of a second mean of the heart rate distribution at the historical moment;
[0031] A first heart rate value at a current moment is determined according to the first weight, the first mean value, the second weight and the second mean value.
[0032] In a possible implementation, determining a first weight of a first mean corresponding to the first heart rate distribution and a second weight of a second mean of the heart rate distribution at the historical moment respectively according to a first variance corresponding to the first heart rate distribution and a second variance corresponding to the heart rate distribution at the historical moment includes:
[0033] If the first variance is greater than the second variance, determining that the first weight is less than the second weight;
[0034] If the first variance is smaller than the second variance, determining that the first weight is greater than the second weight;
[0035] If the first variance is equal to the second variance, it is determined that the first weight is equal to the second weight.
[0036] Through the above method, it can be seen that the determination of weight is mainly based on the size of the variance. For the first heart rate distribution at the current moment and the heart rate distribution at the historical moment, the larger the variance, the less reliable the mean of the distribution. Therefore, it is allowed to account for a smaller proportion when the final first heart rate value is determined.
[0037] In a possible implementation, determining the first heart rate value at the current moment according to the first weight, the first mean, the second weight, and the second mean includes:
[0038] The first heart rate value is determined according to the following formula:
[0039]
[0040] Among them, μ P is the first mean, σ P is the first variance, μ Q is the second mean, σ Q is the second variance, h is the first heart rate value; the first weight is The second weight is
[0041] By the above method, the likelihood function (probability) of the heart rate at the historical moment and the current moment can be maximized.
[0042] In a possible implementation manner, determining a second heart rate distribution according to the first heart rate value includes:
[0043] using the first heart rate value as a third mean of the second heart rate distribution;
[0044] A third variance of the second heart rate distribution is determined according to the third weight, the fourth weight, the first variance, and the second variance, wherein the sum of the third weight and the fourth weight is 1.
[0045] In the above manner, the heart rate distribution at the historical moment can be updated, so that when the heart rate distribution at the historical moment is used to predict the heart rate distribution at the current moment, a more accurate first heart rate value can be obtained.
[0046] In a second aspect, an embodiment of the present application provides a heart rate value prediction device, the device comprising:
[0047] An acquisition module, used to acquire a first heart rate distribution output by a heart rate prediction model for a current moment;
[0048] a determination module, configured to determine a distribution difference between a heart rate distribution at a historical moment and the first heart rate distribution; the heart rate distribution at the historical moment is determined based on a second heart rate value at the historical moment;
[0049] The determination module is further configured to determine a first heart rate value at a current moment according to the heart rate distribution at the historical moment and the first heart rate distribution and output the first heart rate value when the distribution difference is greater than a preset threshold.
[0050] In a possible implementation, the determining module is further configured to determine a second heart rate distribution according to the first heart rate value;
[0051] The second heart rate distribution is updated to the heart rate distribution at the historical moment.
[0052] In a possible implementation, the determination module is further configured to determine the first heart rate value at the current moment according to the first heart rate distribution if the distribution difference is not greater than the preset threshold;
[0053] The first heart rate distribution is updated to the heart rate distribution at the historical moment.
[0054] In a possible implementation, the determining module is further configured to determine the first heart rate value at the current moment according to the first heart rate distribution if it is determined that the heart rate distribution at the historical moment does not exist;
[0055] The first heart rate distribution is updated to the heart rate distribution at the historical moment.
[0056] In a possible implementation, the determining module is further configured to determine the distribution difference according to the following formula:
[0057]
[0058] Wherein P(x) is the heart rate distribution at the historical moment, Q(x) is the first heart rate distribution at the current moment, and KL(P||Q) is the distribution difference.
[0059] In a possible implementation, the acquisition module is further used to acquire a first heart rate distribution output by the heart rate prediction model for the current moment, including:
[0060] Obtain the variance and mean of the heart rate prediction model based on the Gaussian distribution output that characterizes the heart rate at the current moment; wherein the variance and mean are used to characterize the heart rate distribution; or
[0061] The position parameters and shape parameters that characterize the current heart rate output by the heart rate prediction model based on the logistic distribution are obtained; wherein the position parameters and shape parameters are used to characterize the heart rate distribution.
[0062] In a possible implementation, the determination module is specifically configured to determine, according to a first variance corresponding to the first heart rate distribution and a second variance corresponding to the heart rate distribution at the historical moment, a first weight of a first mean corresponding to the first heart rate distribution and a second weight of a second mean of the heart rate distribution at the historical moment;
[0063] A first heart rate value at a current moment is determined according to the first weight, the first mean value, the second weight and the second mean value.
[0064] In a possible implementation, the determining module is specifically configured to:
[0065] If the first variance is greater than the second variance, determining that the first weight is less than the second weight;
[0066] If the first variance is smaller than the second variance, determining that the first weight is greater than the second weight;
[0067] If the first variance is equal to the second variance, it is determined that the first weight is equal to the second weight.
[0068] In a possible implementation, the determining module is specifically configured to determine the first heart rate value according to the following formula:
[0069]
[0070] Among them, μ P is the first mean, σ P is the first variance, μ Q is the second mean, σ Q is the second variance, h is the first heart rate value; the first weight is The second weight is
[0071] In a possible implementation manner, the determining module is specifically configured to use the first heart rate value as a third mean value of the second heart rate distribution;
[0072] A third variance of the second heart rate distribution is determined according to the third weight, the fourth weight, the first variance, and the second variance, wherein the sum of the third weight and the fourth weight is 1.
[0073] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is run, any one of the methods in the first aspect is executed.
[0074] In a fourth aspect, an embodiment of the present application provides a computing device, comprising: a memory for storing program instructions; a processor for calling the program instructions stored in the memory, and executing the method in any one of the designs in the above-mentioned first aspect according to the obtained program.
[0075] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a processor, implements a method as in any one of the designs in the first aspect above.
[0076] The beneficial effects of the second to fifth aspects mentioned above can be specifically referred to the beneficial effects that can be achieved by any design of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 A schematic diagram of a scenario architecture provided by an embodiment of the present application is exemplarily shown;
[0078] Figure 2 A schematic diagram showing an exemplary process of a heart rate value prediction method provided in an embodiment of the present application;
[0079] Figure 3 A schematic diagram exemplarily illustrates a flow chart of a method for determining a first heart rate value provided in an embodiment of the present application;
[0080] Figure 4 A schematic diagram exemplarily illustrates a flow chart of another method for determining a first heart rate value provided in an embodiment of the present application;
[0081] Figure 5 A schematic diagram of a heart rate value prediction device provided in an embodiment of the present application is exemplarily shown. DETAILED DESCRIPTION
[0082] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0083] Some wearable devices such as smart watches have developed health monitoring functions, among which one of the more important is heart rate monitoring, which helps people understand their physical condition. At present, there are generally three ways to monitor heart rate.
[0084] Method 1: Photoplethysmography (PPG)
[0085] The sensor of the wearable device in contact with the skin will emit a photoelectric transmission light, which will hit the skin and measure the reflected or transmitted light. Because blood absorbs light of a specific wavelength, every time the heart pumps blood, a large amount of this wavelength will be absorbed, so the heartbeat can be determined. Some smart wearable bracelets generally use this method, which is highly portable, real-time, and relatively low in cost. However, this method is easily interfered by ambient light, resulting in inaccurate heart rate measurement.
[0086] Method 2: ECG signal measurement method
[0087] The sensors of wearable devices can determine the user's heart rate by measuring the electrical signals of myocardial contraction, which is similar to the principle of electrocardiogram. In each cardiac cycle, the atria and ventricles of the human heart are excited successively, accompanied by the successive operation of countless myocardial cells, which will cause potential changes. The heart rate can be detected by detecting the periodic changes in the electrocardiogram. However, the circuit in this method is relatively complex and susceptible to electromagnetic interference. It is difficult for small wearable devices such as bracelets to adopt this method.
[0088] Method 3: Electric pulse measurement method
[0089] Because each heartbeat causes vibrations in the body, this vibration is captured by a high-precision sensor, and the heartbeat can be obtained after signal processing. Electrical pulse measurement uses dry electrode technology to obtain human electrocardiogram data and obtains heart rate through peak detection. Before the heart mechanically contracts, an electrical excitation is generated, which can be transmitted to the body surface through human tissue. The electrical pulse measurement method measures the heart rate by monitoring this electrical excitation. Devices such as smart cushions or massagers can adopt this method.
[0090] Figure 1 A schematic diagram of a scenario architecture provided by an embodiment of the present application is exemplarily shown, such as Figure 1 As shown, when the above-mentioned devices measure the heart rate, they will input the collected electrical signals into the heart rate prediction model for prediction, and then filter them to obtain the final heart rate value. The heart rate prediction model can be divided into regression task class and classification task class. In the regression task, different heart rate prediction models are calculated according to the characteristics of the input electrical signals, and directly output the predicted heart rate value, such as 60bpm, 80bpm, 100bpm, 120bpm, etc. In the classification task, the possible heart rate intervals are divided into several categories according to a certain resolution, such as 40bpm to 220bpm are divided into 240 categories with an interval of 0.75bpm. The classification algorithm is classified according to the characteristics of the input electrical signals, and finally the current heart rate value is calculated. The heart rate prediction model may be inaccurate during training, and there will be large differences in heart rates at similar times, which does not conform to the actual situation of the heart rate. Therefore, some filtering algorithms need to be used to calibrate the predicted heart rate.
[0091] For example, when predicting heart rate, save the predicted heart rate of N-1 moments before the current moment, and then use the mean algorithm to calculate the average heart rate of these N-1 moments. Take a mean interval before and after the average heart rate. If the predicted heart rate at the current moment is in this mean interval, the predicted heart rate at the current moment is used as the final heart rate value. For example, if the average heart rate of the previous 10 moments is calculated to be 80, the mean interval before and after can be [75,85]. If the heart rate value at the current moment is 82, it is in the mean interval. Then the final heart rate value can be 82; if the heart rate value at the current moment is 70, which is less than the minimum value of the mean interval, the heart rate value is directly pulled to the minimum value of the mean interval; if the heart rate value at the current moment is 90, which is greater than the maximum value of the mean interval, the heart rate value is directly pulled to the maximum value of the mean interval.
[0092] Through the above method, the heart rate value output by the heart rate prediction model can be stabilized in a range, and the heart rate value will not fluctuate. However, as a filtering hyperparameter, the mean interval is mainly selected based on human experience, and different mean intervals have a greater impact on the final heart rate value. Moreover, different heart rate prediction models require different filtering hyperparameters, and there is no unified standard, which reduces the reliability of determining the final heart rate value.
[0093] Based on this, an embodiment of the present application provides a heart rate value prediction method for improving the accuracy and reliability of heart rate value prediction.
[0094] Figure 2 A schematic diagram showing a flow chart of a heart rate prediction method provided by an embodiment of the present application is shown as follows: Figure 2 As shown, the method includes:
[0095] Step 201, obtaining a first heart rate distribution output by a heart rate prediction model for the current moment.
[0096] The heart rate prediction model in this step can be the heart rate prediction model used when predicting the heart rate value using the methods in the above-mentioned methods 1, 2, and 3. Taking the photoplethysmography in method 1 as an example, blood absorbs light of a specific wavelength, and the heart rate value can be determined by measuring the light intensity of the reflected light and other information. When measuring the light intensity, a statistical method is required. The heart rate prediction model can form a heart rate distribution diagram based on the output of the light intensity, such as a Gaussian distribution. The values used to describe the Gaussian distribution are the mean and variance, that is, the first heart rate distribution can be determined by the mean and variance.
[0097] The frequency of heart rate prediction can be manually determined on the smart wearable device, or it can be hard-coded in the heart rate prediction function program of the smart wearable device. For example, set the heart rate prediction to occur every 5 seconds. Then the current moment can be recorded as 0 on the time axis, and the time axis can be recorded as -5, -10, -15, -20... It should be noted that some heart rate prediction frequencies are very high. For example, when the sports mode of the smart wearable device is turned on, the heart rate value needs to be monitored in real time. At this time, the frequency of heart rate prediction may be 10HZ, that is, the heart rate is predicted 10 times per second. At this time, the predicted heart rate value changes in real time from the user's perspective.
[0098] Step 202, determining the distribution difference between the heart rate distribution at the historical moment and the first heart rate distribution; the heart rate distribution at the historical moment is determined based on the second heart rate value at the historical moment.
[0099] After each prediction of a heart rate value, it can be recorded and saved as the heart rate distribution of historical moments. For example, after the first prediction of the heart rate value, it is stored as heart rate value 1, and the heart rate values predicted at each moment thereafter are heart rate value 2, heart rate value 3, heart rate value 4, and so on. After the heart rate value 11 is predicted, heart rate value 1 is deleted, and heart rate value 11 is stored, and so on, and the final retained historical moments are always 10.
[0100] For the sake of simplicity in calculation, a heart rate distribution at a historical moment can also be used in this step. For example, when predicting a heart rate value of 12, only a heart rate of 11 can be used as the heart rate distribution at the historical moment. Then, the distribution difference with the first heart rate distribution at the current moment is determined. According to the actual heart rate situation, the difference in heart rate values at adjacent moments should not be too large, so the distribution difference can be used to calibrate the first heart rate value.
[0101] Step 203, when the distribution difference is greater than a preset threshold, determine the first heart rate value at the current moment according to the heart rate distribution at the historical moment and the first heart rate distribution, and output the first heart rate value.
[0102] If the distribution difference is relatively large, it means that the heart rate distribution at the historical moment is quite different from the heart rate distribution at the current moment. This may be because the prediction of the heart rate distribution at the current moment is biased. In this case, the heart rate value at the current moment can be calibrated based on the heart rate distribution at the historical moment and the first heart rate distribution (the heart rate distribution at the current moment) to obtain a reliable and accurate heart rate value.
[0103] Through the above method, the distribution difference between the first heart rate distribution and the second heart rate distribution is first determined. When the distribution difference is too large, it means that the heart rate prediction model has a large deviation and the heart rate fluctuates greatly in a short period of time, which is inconsistent with the actual heart rate situation. Therefore, this situation is screened out, and the first heart rate value is determined according to the heart rate distribution at the historical moment and the first heart rate distribution at the current moment, so as to realize the correction of the first heart rate value and obtain a more reliable and accurate first heart rate.
[0104] In the above step 203, there may be a situation where the distribution difference is not greater than the preset threshold value. In this case, the first heart rate distribution at the current moment is not much different from the heart rate distribution at the historical moment, which is consistent with the actual heart rate situation. At this time, the first heart rate value at the current moment can be determined based on the first heart rate distribution. Afterwards, the first heart rate distribution is updated to the heart rate distribution at the historical moment.
[0105] Through the above method, when the distribution difference is not large, it means that the heart rate distribution at the current moment has not produced abnormal fluctuations and has not fluctuated. Therefore, the first heart rate distribution at the current moment can be directly used to determine the first heart rate value without any inaccuracy.
[0106] The following is a method for calculating the distribution difference between the heart rate distribution at the historical moment and the first heart rate distribution. The specific method can be determined according to the following formula:
[0107]
[0108] Where P(x) is the heart rate distribution at the historical moment, Q(x) is the first heart rate distribution at the current moment, and KL(P||Q) is the distribution difference. KL divergence (Kullback-Leibler divergence), also known as relative entropy or information divergence, is the degree of asymmetry between the differences between two probability distributions. Relative entropy can measure the distance between two random distributions. When the two random distributions are the same, their relative entropy is zero. When the difference between the two random distributions increases, their relative entropy will also increase. Therefore, relative entropy can be used to compare the similarity of texts. First, the frequency of the words is counted, and then the relative entropy is calculated. In addition, in the evaluation of multi-indicator systems, the allocation of indicator weights is a key and difficult point, which can also be handled through relative entropy.
[0109] It should be noted that when there are heart rate distributions at multiple historical moments, the heart rate distributions at the historical moments can be preprocessed to find the average of the multiple historical moments, which can then be substituted into the above formula to find the distribution difference.
[0110] In a possible implementation, in the above step 201, the first heart rate distribution at the current moment may be a Gaussian distribution. In the Gaussian distribution, the heart rate distribution at the current moment is characterized by the mean and variance, wherein the mean of the heart rate distribution at the current moment may be recorded as μ Q , the variance can be recorded as σ Q .
[0111] In another possible implementation, the first heart rate distribution at the current moment may be a logistic distribution. In the logistic distribution, the heart rate distribution is characterized by a location parameter and a shape parameter, where the location parameter may be denoted as μ and the shape parameter may be denoted as γ. Then the probability density function of the corresponding logistic distribution may be expressed as:
[0112]
[0113] It should be noted that, for most of the heart rate prediction models on the market, the two distributions provided in the embodiments of the present application have a Gaussian distribution as the output, and a Gaussian distribution can be uniquely determined using the mean and variance. Therefore, the following describes how to determine the first heart rate value using the Gaussian distribution.
[0114] Figure 3 A flow chart showing a method for determining a first heart rate value provided by an embodiment of the present application is exemplified as follows: Figure 3 As shown, the method includes:
[0115] Step 301: according to the first variance σ corresponding to the first heart rate distribution Q , the second variance σ corresponding to the heart rate distribution at the historical moment P , respectively determine the first mean μ corresponding to the first heart rate distribution Q The first weight and the second mean μ of the heart rate distribution at the historical moment P The second weight of .
[0116] In this step, the first weight and the second weight may be determined in the following manner:
[0117] If the first variance is greater than the second variance, determining that the first weight is less than the second weight;
[0118] If the first variance is smaller than the second variance, determining that the first weight is greater than the second weight;
[0119] If the first variance is equal to the second variance, then the first weight is determined to be equal to the second weight.
[0120] Through the above method, it can be seen that the determination of weight is mainly based on the size of the variance. For the first heart rate distribution at the current moment and the heart rate distribution at the historical moment, the larger the variance, the less reliable the mean of the distribution. Therefore, it is allowed to account for a smaller proportion when the final first heart rate value is determined.
[0121] Step 302: according to the first weight and the first mean u Q , the second weight and the second mean u P Determine a first heart rate value at the current moment.
[0122] Specifically, the first heart rate value may be determined according to the following formula:
[0123]
[0124] Among them, μ P is the first mean, σ P is the first variance, μ Q is the second mean, σ Q is the second variance, h is the first heart rate value; the first weight is The second weight is
[0125] In the above method, the likelihood function (probability) of the heart rate at the historical moment and the current moment can be maximized. This can be proved by the following method:
[0126]
[0127] Let Z(h) = P(h)*Q(h), and let:
[0128]
[0129] You can get:
[0130]
[0131] Finally, we get
[0132]
[0133] That is
[0134]
[0135] In this case, the likelihood function (probability) of the heart rate at the historical moment and the current moment can be maximized.
[0136] In a possible implementation, after the above step 203, a second heart rate distribution may be determined according to the first heart rate value; and the second heart rate distribution may be updated to the heart rate distribution at the historical moment.
[0137] Specifically, the first heart rate value may be used as the third mean of the second heart rate distribution; the third variance of the second heart rate distribution is determined according to the third weight, the fourth weight, the first variance and the second variance, wherein the sum of the third weight and the fourth weight is 1, and the following formula may be referred to for execution:
[0138]
[0139]
[0140] w1+w2=1,w1≥w2
[0141] in, is the third mean, is the third party difference; w1 is the third weight, and w2 is the fourth weight.
[0142] In the above manner, the heart rate distribution at the historical moment can be updated, so that when the heart rate distribution at the historical moment is used to predict the heart rate distribution at the current moment, a more accurate first heart rate value can be obtained.
[0143] The process of determining the first heart rate value is described below through a complete example. Figure 4 A flow chart showing another method for determining a first heart rate value provided by an embodiment of the present application is exemplarily shown as follows: Figure 4 As shown, the method includes:
[0144] Step 401, obtaining a first heart rate distribution output by a heart rate prediction model for the current moment;
[0145] Step 402, determine whether there is a heart rate distribution at a historical moment, if yes, execute step 403; if no, execute step 406;
[0146] Step 403, determining the distribution difference between the heart rate distribution at the historical moment and the first heart rate distribution;
[0147] Step 404, determine whether the distribution difference is greater than a preset threshold, if so, execute step 405, if not, execute step 406;
[0148] Step 405, determining a first heart rate value at the current moment according to the heart rate distribution at the historical moments and the first heart rate distribution and outputting the first heart rate value;
[0149] Step 406: Determine the first heart rate value at the current moment according to the first heart rate distribution.
[0150] Based on the same technical concept, the embodiment of the present application also provides a heart rate value prediction device. Figure 5 The following is a schematic diagram of a heart rate prediction device provided in an embodiment of the present application. The device can execute the aforementioned heart rate prediction method, such as Figure 5 As shown, the device comprises:
[0151] An acquisition module, used to acquire a first heart rate distribution output by a heart rate prediction model for a current moment;
[0152] a determination module, configured to determine a distribution difference between a heart rate distribution at a historical moment and the first heart rate distribution; the heart rate distribution at the historical moment is determined based on a second heart rate value at the historical moment;
[0153] The determination module is further configured to determine a first heart rate value at a current moment according to the heart rate distribution at the historical moment and the first heart rate distribution and output the first heart rate value when the distribution difference is greater than a preset threshold.
[0154] In a possible implementation, the determining module is further configured to determine a second heart rate distribution according to the first heart rate value;
[0155] The second heart rate distribution is updated to the heart rate distribution at the historical moment.
[0156] In a possible implementation, the determination module is further configured to determine the first heart rate value at the current moment according to the first heart rate distribution if the distribution difference is not greater than the preset threshold;
[0157] The first heart rate distribution is updated to the heart rate distribution at the historical moment.
[0158] In a possible implementation, the determining module is further configured to determine the first heart rate value at the current moment according to the first heart rate distribution if it is determined that the heart rate distribution at the historical moment does not exist;
[0159] The first heart rate distribution is updated to the heart rate distribution at the historical moment.
[0160] In a possible implementation, the determining module is further configured to determine the distribution difference according to the following formula:
[0161]
[0162] Wherein P(x) is the heart rate distribution at the historical moment, Q(x) is the first heart rate distribution at the current moment, and KL(P||Q) is the distribution difference.
[0163] In a possible implementation, the acquisition module is further used to acquire a first heart rate distribution output by the heart rate prediction model for the current moment, including:
[0164] Obtain the variance and mean of the heart rate prediction model based on the Gaussian distribution output that characterizes the heart rate at the current moment; wherein the variance and mean are used to characterize the heart rate distribution; or
[0165] The position parameters and shape parameters that characterize the current heart rate output by the heart rate prediction model based on the logistic distribution are obtained; wherein the position parameters and shape parameters are used to characterize the heart rate distribution.
[0166] In a possible implementation, the determination module is specifically configured to determine, according to a first variance corresponding to the first heart rate distribution and a second variance corresponding to the heart rate distribution at the historical moment, a first weight of a first mean corresponding to the first heart rate distribution and a second weight of a second mean of the heart rate distribution at the historical moment;
[0167] A first heart rate value at a current moment is determined according to the first weight, the first mean value, the second weight and the second mean value.
[0168] In a possible implementation, the determining module is specifically configured to:
[0169] If the first variance is greater than the second variance, determining that the first weight is less than the second weight;
[0170] If the first variance is smaller than the second variance, determining that the first weight is greater than the second weight;
[0171] If the first variance is equal to the second variance, it is determined that the first weight is equal to the second weight.
[0172] In a possible implementation, the determining module is specifically configured to determine the first heart rate value according to the following formula:
[0173]
[0174] Among them, μ P is the first mean, σ P is the first variance, μ Q is the second mean, σ Q is the second variance, h is the first heart rate value; the first weight is The second weight is
[0175] In a possible implementation manner, the determining module is specifically configured to use the first heart rate value as a third mean value of the second heart rate distribution;
[0176] A third variance of the second heart rate distribution is determined according to the third weight, the fourth weight, the first variance, and the second variance, wherein the sum of the third weight and the fourth weight is 1.
[0177] Based on the same technical concept, an embodiment of the present invention further provides a computer program product. When the computer program product runs on a processor, the method shown in the above embodiment is implemented.
[0178] Based on the same technical concept, an embodiment of the present invention further provides a computing device, including: a memory for storing program instructions;
[0179] The processor is used to call the program instructions stored in the memory and execute the method shown in the above embodiment according to the obtained program.
[0180] Based on the same technical concept, an embodiment of the present invention further provides a computer-readable storage medium. When the computer program product runs on a processor, the method shown in the above embodiment is implemented.
[0181] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0182] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0185] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A heart rate value prediction method, characterized in that: The method comprises: Obtaining a first heart rate distribution output by a heart rate prediction model for the current moment; Determine a distribution difference between a heart rate distribution at a historical moment and the first heart rate distribution; the heart rate distribution at the historical moment is determined based on a second heart rate value at the historical moment; When the distribution difference is greater than a preset threshold, a first heart rate value at a current moment is determined according to the heart rate distribution at the historical moment and the first heart rate distribution, and the first heart rate value is output.
2. The method according to claim 1, characterized in that After determining the first heart rate value at the current moment, the method further includes: determining a second heart rate distribution according to the first heart rate value; The second heart rate distribution is updated to the heart rate distribution at the historical moment.
3. The method according to claim 1, characterized in that If the distribution difference is not greater than the preset threshold, determining the first heart rate value at the current moment according to the first heart rate distribution; The first heart rate distribution is updated to the heart rate distribution at the historical moment.
4. The method according to claim 1, characterized in that The method further comprises: If it is determined that the heart rate distribution at the historical moment does not exist, determining the first heart rate value at the current moment according to the first heart rate distribution; The first heart rate distribution is updated to the heart rate distribution at the historical moment.
5. The method according to claim 1, characterized in that Determining a distribution difference between the heart rate distribution at the historical moment and the first heart rate distribution includes: The distribution difference is determined according to the following formula: Wherein P(x) is the heart rate distribution at the historical moment, Q(x) is the first heart rate distribution at the current moment, and KL(P||Q) is the distribution difference.
6. The method according to any one of claims 1 to 5, characterized in that Obtaining the first heart rate distribution output by the heart rate prediction model for the current moment, including: Obtain the variance and mean of the heart rate prediction model based on the Gaussian distribution output that characterizes the heart rate at the current moment; wherein the variance and mean are used to characterize the heart rate distribution; or The position parameters and shape parameters that characterize the current heart rate output by the heart rate prediction model based on the logistic distribution are obtained; wherein the position parameters and shape parameters are used to characterize the heart rate distribution.
7. The method according to claim 6, characterized in that Determining a first heart rate value at a current moment according to the heart rate distribution at the historical moment and the first heart rate distribution includes: Determine, according to a first variance corresponding to the first heart rate distribution and a second variance corresponding to the heart rate distribution at the historical moment, a first weight of a first mean corresponding to the first heart rate distribution and a second weight of a second mean of the heart rate distribution at the historical moment; A first heart rate value at a current moment is determined according to the first weight, the first mean value, the second weight and the second mean value.
8. The method according to claim 7, characterized in that Determining a first weight of a first mean corresponding to the first heart rate distribution and a second weight of a second mean of the heart rate distribution at the historical moment respectively according to a first variance corresponding to the first heart rate distribution and a second variance corresponding to the heart rate distribution at the historical moment, including: If the first variance is greater than the second variance, determining that the first weight is less than the second weight; If the first variance is smaller than the second variance, determining that the first weight is greater than the second weight; If the first variance is equal to the second variance, it is determined that the first weight is equal to the second weight.
9. The method according to claim 7, characterized in that Determining a first heart rate value at a current moment according to the first weight, the first mean, the second weight, and the second mean includes: The first heart rate value is determined according to the following formula: Among them, μ P is the first mean, σ P is the first variance, μ Q is the second mean, σ Q is the second variance, h is the first heart rate value; the first weight is The second weight is 10. The method according to claim 6, characterized in thatDetermining a second heart rate distribution according to the first heart rate value includes: using the first heart rate value as a third mean of the second heart rate distribution; A third variance of the second heart rate distribution is determined according to the third weight, the fourth weight, the first variance, and the second variance, wherein the sum of the third weight and the fourth weight is 1.
11. A heart rate prediction device, characterized in that: The device comprises: An acquisition module, used to acquire a first heart rate distribution output by a heart rate prediction model for a current moment; a determination module, configured to determine a distribution difference between a heart rate distribution at a historical moment and the first heart rate distribution; the heart rate distribution at the historical moment is determined based on a second heart rate value at the historical moment; The determination module is further configured to determine a first heart rate value at a current moment according to the heart rate distribution at the historical moment and the first heart rate distribution and output the first heart rate value when the distribution difference is greater than a preset threshold.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 is executed.
13. A computing device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory and execute the method according to any one of claims 1 to 7 according to the obtained program.
Citation Information
Cited By
Signal processing method in heart rate measurement
CN120392049A
