Heart rate detection method and electronic device

Through contactless heart rate detection combined with exercise data and body data, the expected heart rate interval is determined and the heart rate is corrected, which solves the problem of decreased detection accuracy caused by user exercise interference and achieves higher heart rate detection accuracy.

CN114581358BActive Publication Date: 2025-07-25HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011376504.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-30
Publication Date
2025-07-25
Estimated Expiration
2040-11-30

AI Technical Summary

Technical Problem

When electronic devices detect user's heart rate during exercise, user's movement interference causes a decrease in the accuracy of heart rate detection.

Method used

Through the contactless heart rate detection method, the expected heart rate interval is determined in combination with the user's exercise data and body data, and the heart rate to be verified is corrected to improve accuracy.

Benefits of technology

It reduces the interference of user exercise on heart rate detection and improves the accuracy of heart rate detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114581358B_ABST
    Figure CN114581358B_ABST
Patent Text Reader

Abstract

The present application provides a heart rate detection method and an electronic device. In this method, the electronic device can use a non-contact heart rate detection method to calculate the heart rate of the target user during exercise, and obtain the unverified heart rate of the target user. The electronic device can calculate the actual exercise intensity of the target user by combining the exercise data of the target user and body data such as age and body fat percentage, and determine the expected heart rate range of the target user according to the actual exercise intensity. The electronic device can use the above-mentioned expected heart rate range to verify the above-mentioned unverified heart rate, and correct the unverified heart rate with errors to obtain the final heart rate detection result. This method can reduce the interference of user exercise on heart rate detection and improve the accuracy of heart rate detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminals, and in particular to a heart rate detection method and an electronic device. Background Art

[0002] Heart rate is of great significance for measuring the health of a person's heart. An abnormal heart rate may be a sign of sudden death or other diseases. Especially during exercise, users can judge whether the exercise intensity is too high based on their heart rate, so as to avoid risks caused by the exercise intensity exceeding their tolerance.

[0003] However, when an electronic device detects the heart rate of a user during exercise, the user's movement often interferes with the heart rate detection. For example, the electronic device performs heart rate detection on the user based on the captured face image. Due to the user's movement, the face image captured by the camera is blurred. The blurred face image will reduce the accuracy of heart rate detection. Summary of the Invention

[0004] This application provides a heart rate detection method and an electronic device, aiming to determine whether there is an error in the heart rate obtained by the electronic device through capturing a face image, and correct the heart rate with an error, so as to reduce the interference of the user's movement on the heart rate detection of the electronic device and improve the accuracy of heart rate detection.

[0005] In a first aspect, an embodiment of this application provides a heart rate detection method. The method includes: The electronic device can obtain a first image of a first user in a first time period. The electronic device can determine a first heart rate range of the first user in the first time period based on the first exercise intensity of the first user in the first image. The electronic device can determine the first heart rate of the first user in the first time period based on the face image of the first user in the first image. When the electronic device determines that the first heart rate is included in the first heart rate range, the electronic device can display the first heart rate. When the electronic device determines that the first heart rate is not included in the first heart rate range, the electronic device can display a second heart rate. The second heart rate is included in the above-mentioned first heart rate range.

[0006] As can be seen from the above method, when detecting the heart rate of a user during exercise, the electronic device can determine the expected heart rate range (i.e., the first heart rate range) of the user according to the actual exercise intensity of the user. The electronic device can determine the heart rate of the user according to the captured face image of the user. This heart rate is the heart rate to be verified. The electronic device can judge whether there is an error in the heart rate to be verified according to this expected heart rate range. If it is determined that there is an error, the electronic device can correct the heart rate to be verified according to this expected heart rate range, and use the corrected heart rate as the final detection result of the heart rate. The above method can reduce the interference of the user's movement on heart rate detection and improve the accuracy of heart rate detection.

[0007] The method for the electronic device to obtain the heart rate to be verified can be a non-contact heart rate detection method based on a face image. Among them, the change in the skin color in the user's face image is related to the blood flow in the blood vessels. The change in skin color can reflect the change in heart rate. Thus, the electronic device can determine the user's heart rate according to the user's face image. The embodiments of the present application do not limit the method for the electronic device to obtain the above-mentioned heart rate to be verified. The electronic device 100 can also obtain the user's heart rate from other devices and verify the obtained heart rate using the expected heart rate range.

[0008] In combination with the first aspect, in some embodiments, the above-mentioned first heart rate not being included in the first heart rate range may specifically be that the first heart rate is less than the minimum value of the first heart rate range, or the first heart rate is greater than the maximum value of the first heart rate range.

[0009] When the electronic device determines that the first heart rate is less than the minimum value of the first heart rate range, the second heart rate displayed by the electronic device can be any value in the first half of the first heart rate range.

[0010] When the electronic device determines that the first heart rate is greater than the maximum value of the first heart rate range, the second heart rate displayed by the electronic device can be any value in the second half of the first heart rate range.

[0011] In combination with the first aspect, in some embodiments, the electronic device can obtain the resting heart rate of the above-mentioned first user before the user starts exercising.

[0012] Specifically, the electronic device can obtain a second image of the first user in a second time period. The second time period is before the above-mentioned first time period. The electronic device can determine the resting heart rate of the first user based on the face image of the first user in the second image.

[0013] In combination with the first aspect, in some embodiments, the electronic device can determine that the first exercise intensity belongs to a first exercise intensity range. The first exercise intensity range can be obtained by dividing the span of the human body's exercise intensity. The electronic device can use the resting heart rate as a reference and shift in the direction of increasing heart rate to obtain a first heart rate range. Among them, the offset range is a first range. The greater the average exercise intensity of the first exercise intensity range, the greater the average heart rate of the first range. The larger the size of the first exercise intensity range, the wider the range width of the first range.

[0014] In addition, the greater the difference between the maximum heart rate and the resting heart rate of the first user, the greater the average heart rate of the above-mentioned first range.

[0015] In combination with the first aspect, in some embodiments, the electronic device may obtain the second exercise intensity and the third heart rate of the first user during the third time period. The third time period is the previous time period of the first time period. The second exercise intensity is the exercise intensity of the first user in the second image, and the second image is an image of the first user during the third time period. The third heart rate is included in the heart rate range determined by the electronic device based on the second exercise intensity. The electronic device may offset based on the third heart rate to obtain the first heart rate range. The offset range is the second range, and the greater the difference between the first exercise intensity and the second exercise intensity, the greater the average heart rate of the second range.

[0016] It can be understood that the electronic device may determine the offset direction based on the third heart rate according to the magnitudes of the first exercise intensity and the second exercise intensity. Specifically, if the electronic device determines that the first exercise intensity is higher than the second exercise intensity, the electronic device may offset based on the third heart rate in the direction of increasing heart rate to obtain the first heart rate range. If the electronic device determines that the first exercise intensity is lower than the second exercise intensity, the electronic device may offset based on the third heart rate in the direction of decreasing heart rate to obtain the first heart rate range.

[0017] In a possible implementation, a heart rate change rate model may be stored in the electronic device. The heart rate change rate model can be used to represent the mapping relationship between the heart rate change rate and the change amount of exercise intensity. The heart rate change rate model may be determined according to the relationship between the heart rate change rate and the change amount of exercise intensity reflected by a large amount of data. When obtaining the difference between the first exercise intensity and the second exercise intensity, the electronic device 100 may determine the heart rate change rate of the first user during the first time period according to the heart rate change rate model. Further, the electronic device may determine the heart rate change amount range of the first user during the first time period according to the time length of the first time period and the heart rate change rate of the first user during the first time period. This heart rate change amount range is the second range.

[0018] In combination with the first aspect, in some embodiments, the first time period and the second time period are adjacent time periods. The heart rate of the first user during the second time period is the resting heart rate. The electronic device may offset based on the resting heart rate in the direction of increasing heart rate to obtain the first heart rate range. The offset range is the second range, and the greater the first exercise intensity, the greater the average heart rate of the second range.

[0019] In a possible implementation, the range width of the second range may be negatively correlated with the magnitude of the first exercise intensity.

[0020] In combination with the first aspect, in some embodiments, the first exercise intensity may be determined by the electronic device based on the movement displacements of each joint point of the first user in the first image within the first time period, and the frequency of the actions completed by the first user within the first time period.

[0021] The above-mentioned first exercise intensity may also be determined by the electronic device based on one or more of the following: the age of the first user, the gender of the first user, the body fat percentage of the first user, the standard exercise data of the fitness course; the fitness course can be used to provide exercise guidance for the first user, and the standard exercise data of the fitness course includes the exercise intensity of the coach in the fitness course.

[0022] It can be understood that the heart rate of a user often changes with the change of exercise intensity. The higher the actual exercise intensity of the user, the higher the heart rate. The more the exercise intensity of the user increases per unit time, the more the heart rate increases. The electronic device can determine the movement displacements of each joint point of the user and the frequency of the actions completed by the user according to the image of the user during the exercise. The more the movement displacements of each joint point within unit time, the greater the exercise intensity of the user. The higher the frequency of the actions completed by the user within the unit time period, the greater the exercise intensity of the user. In addition, users with different ages and different body fat percentages may have different exercise abilities. In the case where the movement displacements of each joint point within unit time are the same and the frequency of the actions completed is the same, the actual exercise intensity may also be different. The electronic device can calculate the exercise intensity more accurately by combining the age and body fat percentage of the user.

[0023] In combination with the first aspect, in some embodiments, the electronic device may determine the first user as the target user before obtaining the first image of the first user within the first time period. The above-mentioned target user may be a user who needs the electronic device to obtain a face image and perform heart rate detection. The above-mentioned target user includes one or more users.

[0024] In a possible implementation manner, when the face image of the target user is determined, the electronic device may determine the area where the target user is located in the obtained image through a target tracking algorithm. In this way, the electronic device can determine the exercise intensity of the target user.

[0025] The above determination of the target user helps to avoid the inaccurate determination of the exercise intensity by the electronic device 100 when the image obtained by the electronic device includes other users other than the target user.

[0026] In combination with the first aspect, in some embodiments, the face image of the first user is not included in the images acquired by the electronic device during a certain time period. The electronic device may use the detected heart rate in the previous time period of this time period as the detected heart rate in this time period. That is, the heart rate displayed by the electronic device in this time period is the detected heart rate in the previous time period. The above-mentioned detected heart rate is the heart rate obtained after being verified by the expected heart rate range in the previous time period.

[0027] Optionally, the electronic device may determine the expected heart rate range of the first user in this time period according to the exercise intensity and personal heart rate of the first user in the images of this time period, such as age, body fat percentage, etc. The electronic device may use any value in the above-mentioned expected heart rate range as the detected heart rate of the first user in this time period.

[0028] In some embodiments, when the electronic device determines that the above-mentioned first exercise intensity does not exceed the preset threshold, the electronic device may determine the above-mentioned first heart rate range based on the exercise intensity range corresponding to the first exercise intensity. When the electronic device determines that the above-mentioned first exercise intensity exceeds the preset threshold, the electronic device may determine the above-mentioned first heart rate range based on the difference between the first exercise intensity and the second exercise intensity in the previous time period.

[0029] In a second aspect, an embodiment of the present application provides an electronic device. The electronic device includes an image acquisition device, a memory, and one or more processors. Among them, the image acquisition device is used to acquire images of the user. The memory can be used to store computer programs. The above-mentioned one or more processors can be used to call the computer program, so that the electronic device executes any possible implementation method in the first aspect.

[0030] In a third aspect, an embodiment of the present application provides a chip, which is applied to an electronic device. The chip includes one or more processors, and the processors are used to call computer instructions so that the electronic device executes any possible implementation method in the first aspect.

[0031] In a fourth aspect, an embodiment of the present application provides a computer program product containing instructions. When the computer program product runs on a device, it causes the electronic device to execute any possible implementation method in the first aspect.

[0032] In a fifth aspect, an embodiment of the present application provides a computer storage medium, including computer instructions. When the computer instructions run on an electronic device, it causes the electronic device to execute any possible implementation method in the first aspect.

[0033] Understandably, the electronic device provided in the second aspect above, the chip provided in the third aspect, the computer program product provided in the fourth aspect, and the computer storage medium provided in the fifth aspect are all used to execute the method provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 FIG. is a schematic diagram of a heart rate detection scenario provided by an embodiment of the present application;

[0035] Figure 2 FIG. is a schematic diagram of human joint points provided by an embodiment of the present application;

[0036] Figure 3 FIG. is a way to implement an electronic device to calculate the movement displacement of each joint point of a user during exercise provided by an embodiment of the present application;

[0037] Figures 4A to 4G FIGs. are schematic diagrams of some heart rate detection scenarios provided by an embodiment of the present application;

[0038] Figure 5 FIG. is a schematic diagram of an exercise intensity model provided by an embodiment of the present application;

[0039] Figure 6 FIG. is a schematic diagram of a fitness report interface of a fitness course in an electronic device provided by an embodiment of the present application;

[0040] Figure 7 FIG. is a flowchart of a heart rate detection method provided by an embodiment of the present application;

[0041] Figure 8 FIG. is a schematic diagram of a heart rate change rate model provided by an embodiment of the present application;

[0042] Figure 9 FIG. is a flowchart of another heart rate detection method provided by an embodiment of the present application;

[0043] Figure 10 FIG. is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0044] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular forms "a", "one", "said", "above-mentioned", "the", and "this" are also intended to include the plural forms, unless clearly indicated to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more of the listed items.

[0045] An embodiment of the present application provides a heart rate detection method, which can improve the accuracy of an electronic device in detecting the heart rate of a user during exercise. Specifically, in this method, the electronic device can use a non-contact heart rate detection method to calculate the first heart rate of the user in the first time period. Among them, the electronic device can determine the actual exercise intensity of the user by combining the user's body data (such as age, body fat percentage, etc.) and the exercise data (such as exercise displacement, exercise frequency, etc.) of the user during exercise in the first time period, and calculate the expected heart rate range of the first heart rate according to the exercise intensity. If the above first heart rate is included in the above expected heart rate range, the electronic device can use the above first heart rate as the final detection result of the user's heart rate in the first time period. If the above first heart rate is not included in the above expected heart rate range, the electronic device can correct the first heart rate according to the above expected heart rate range, and use the corrected first heart rate as the final detection result of the user's heart rate in the first time period.

[0046] In the above non-contact heart rate detection method, the user does not need to touch the electronic device for heart rate detection. For example, the electronic device can detect the change in the color of the user's face caused by the change in blood volume in the blood vessels according to the face image of the user collected by the camera, so as to calculate the heart rate. However, during the user's exercise, such as when the user makes exercise movements such as jumping and moving left and right, the distance and angle between the user's face and the camera change, and the image collected by the camera may be blurred. This has a great interference on the electronic device's calculation of the user's heart rate. It is easy for the electronic device to detect errors in the heart rate.

[0047] It can be understood that the change in the user's heart rate during exercise is related to the change in exercise intensity. When the user's exercise intensity is high, the user's heart rate is usually high. The electronic device can determine the expected heart rate range of the user at the exercise intensity according to the actual exercise intensity of the user. This expected heart rate range can be used to correct the heart rate obtained by the electronic device when detecting the user's exercise at the corresponding exercise intensity. Exemplarily, the electronic device detects that the user's exercise intensity is low, and the expected heart rate range at this exercise intensity is [60 beats per minute (bpm), 130 bpm]. However, the heart rate obtained by the electronic device through the non-contact heart rate detection method is 150 bpm. The electronic device can determine that this heart rate is an abnormal value. Furthermore, the electronic device can correct this heart rate according to the above expected heart rate range. For example, the value of this heart rate is corrected to 130 bpm.

[0048] The above expected heart rate range of [60 bpm, 130 bpm] can indicate that the heart rate within the expected heart rate range is greater than or equal to 60 bpm and less than or equal to 130 bpm.

[0049] As can be seen from the above method, when detecting the user's heart rate during exercise, the electronic device can determine the user's expected heart rate range according to the actual exercise intensity of the user. The electronic device can judge whether the detected heart rate is an abnormal value based on this expected heart rate range. If it is determined to be an abnormal value, the electronic device can correct the detected heart rate according to this expected heart rate range, and use the corrected heart rate as the final detection result of the heart rate. The above method can reduce the interference of user exercise on heart rate detection and improve the accuracy of heart rate detection.

[0050] To facilitate a better understanding of the heart rate detection method in this solution, the implementation manner of a non-contact heart rate detection method will be specifically introduced below.

[0051] As Figure 1 shown, the electronic device 100 may include a camera 193. When performing non-contact heart rate detection, the camera 193 can collect the user's image. The electronic device 100 can display the image collected by the camera 193 in the area 201 of the user interface 20. The above image may include the user's face image. Among them, the electronic device 100 can calculate the user's heart rate based on the above face image. For example, it is calculated that the user's current heart rate is 70 bpm. The electronic device 100 can display the user's heart rate (such as 70 bpm) in the heart rate display box 202 of the user interface 20.

[0052] Since the blood flow brought about by each heartbeat can form a periodic change in the blood vessels of the human skin tissue, the light absorbed or reflected by this blood can form a periodic signal. Thus, the color of the skin on the face image will also change accordingly. The electronic device can analyze the above periodic signal from the face image collected by the camera, and then calculate the user's heart rate.

[0053] Specifically, the electronic device 100 can determine the first image data of the first region where the face is located in each frame of the face images of the first user collected within the first time period by the camera 193. The above-mentioned first region can be a region or a set of multiple regions among regions such as the forehead, cheeks, and chin. The above-mentioned first image data can be data obtained by the electronic device 100 extracting the pixel data of a color channel (such as the green channel) or multiple color channels in the image where the above-mentioned first region is located. The above-mentioned color channel extraction can be, for example, when the color mode is the red green blue (RGB) color mode, the electronic device 100 extracts the pixel data of one color channel (such as the green channel) or multiple color channels in the pixel data of the image where the first region is located. The electronic device 100 can arrange and accumulate the first image data of the above-mentioned multiple frames of images in the chronological order of the multiple frames of face images of the first user to form a raw signal. The above-mentioned multiple frames of face images of the first user can be all the frames of images collected by the camera 193 within the first time period, or a part of the above-mentioned all frames of images.

[0054] Then, the electronic device 100 can perform noise reduction processing on the above-mentioned raw signal by using noise reduction methods such as moving average filtering or band-pass filtering. In addition to the change in blood volume in blood vessels, there may be other factors affecting the change in face color. The electronic device 100 can use the blind source separation method (BSS) or the joint blind source separation method (JBSS) to extract the main signal from the raw signal after noise reduction processing, so as to obtain the blood volume pulse signal of the first user's face within the first time period. The above-mentioned blood volume pulse signal contains a heart rate component. Without being limited to the above-mentioned BSS and the above-mentioned JBSS, the electronic device 100 can also extract the blood volume pulse signal from the face image through other blood volume pulse signal extraction methods.

[0055] When the above-mentioned blood volume pulse signal is obtained, the electronic device 100 can use time-frequency domain analysis methods (such as peak detection method, fast Fourier transform method, etc.) or algorithms based on deep learning to process the above-mentioned blood volume pulse signal to obtain the heart rate of the first user within the first time period.

[0056] The embodiments of the present application do not limit the specific implementation of the above non-contact heart rate detection method. The non-contact heart rate detection method can also be, for example, a detection method based on wireless fidelity (WiFi) signals. For example, the beating of the heart can cause chest movement, and breathing can cause skin vibration. The electronic device can emit WiFi signals and calculate the time elapsed from the emission to the return of each WiFi signal, so as to calculate the user's heart rate.

[0057] The user's sports meeting may interfere with the heart rate calculated by the above non-contact heart rate detection method. To improve the accuracy of heart rate detection, the electronic device 100 may use the heart rate calculated by the above non-contact heart rate detection method as the heart rate to be verified. The electronic device 100 may determine the expected heart rate range of the above heart rate to be verified according to the actual exercise intensity of the user. The electronic device 100 may correct the above heart rate to be verified through the above expected heart rate range, and use the corrected heart rate as the final detected heart rate. The above detected heart rate is the heart rate detection result provided by the electronic device 100 to the user. As Figure 1 shown, after the electronic device 100 corrects the heart rate to be verified, it determines that the detected heart rate of the user is 70 bpm. The electronic device 100 may display the above detected heart rate (70 bpm) in the heart rate display box 202 of the user interface 20.

[0058] Regarding how to determine the actual exercise intensity of the user and the expected heart rate range, the subsequent embodiments will describe in detail, and will not be elaborated here first.

[0059] The heart rate detection method in the embodiments of the present application is mainly used to detect the heart rate of the user during exercise and improve the accuracy of heart rate detection. Among them, the user's exercise can be exercise according to the relevant fitness courses in the electronic device 100. Next, the concepts of the fitness courses, the standard exercise data of the fitness courses, and the exercise data of the user involved in the embodiments of the present application will be introduced.

[0060] 1. Fitness courses

[0061] Fitness courses usually include multiple actions. There may be a preset rest time between two consecutive actions among the above multiple actions, and any two actions among the above multiple actions may be the same or different. The fitness course can be recommended by the electronic device according to the user's historical fitness data, or can be selected by the user according to actual needs. The fitness course can be played locally or online. No specific limitations are made here.

[0062] In some embodiments, a fitness course may include multiple sub-courses, and each sub-course may include one or more consecutive actions of the fitness course. The above multiple sub-courses may be divided according to exercise type, exercise purpose, exercise part, etc. No specific limitations are made here.

[0063] For example, a fitness course includes three sub-courses. Among them, the first sub-course is a warm-up exercise, the second sub-course is a formal exercise, and the third sub-course is a stretching exercise. Any one of the above three sub-courses includes one or more consecutive actions.

[0064] In the embodiments of the present application, the fitness course may include one or more types of content such as video, animation, voice, text, etc., and no specific limitation is made here.

[0065] 2. Standard motion data

[0066] In some embodiments of the present application, the fitness course of the electronic device 100 includes a video of a coach performing actions in the fitness course. This can guide the user to complete the corresponding actions. The standard motion data of the fitness course may include the standard position information of each joint point of the coach in each action corresponding to the playback progress of the fitness course, the standard motion displacement of each joint point of the coach within a certain time period, the standard motion frequency of the coach to complete each action, and the standard motion intensity of the fitness course, etc.

[0067] Exemplarily, as Figure 2 shown, the human joint points may include: head point, neck point, left shoulder point, right shoulder point, right elbow point, left elbow point, right hand point, left hand point, right hip point, left hip point, middle point between the left and right hips, right knee point, left knee point, right foot point, left foot point. Not limited to the above joint points, other joint points may also be included in the embodiments of the present application, and no specific limitation is made here.

[0068] In the embodiments of the present application, the position information may be represented by three-dimensional coordinates in space. The position information of each joint point may be the position information of each of the above joint points with one joint point as a reference node. For example, taking the head point as the reference node, the position information of the head point may be the coordinates (0, 0, 0). Then, the electronic device 100 may determine the position information of other nodes according to the relative positions of other nodes and the head node.

[0069] Among them, the electronic device 100 may perform human pose detection on the image of the coach performing a certain action during the playback of the fitness course to determine the joint points of the coach, and then determine the position information of each joint point. The specific implementation manner of the above human pose detection may refer to the methods of human pose detection in the prior art, and the embodiments of the present application do not make limitations thereto.

[0070] According to the above position information, the electronic device 100 may determine the standard motion displacement of each joint point of the coach within a certain time period. Specifically, the electronic device 100 may determine the standard position information of each joint point of the coach in multiple frames of images during the playback of the fitness course in the first time period. Then, the electronic device 100 may calculate the displacement of each joint point between two consecutive frames of images among the above multiple frames of images. The electronic device 100 may add up the displacements of a certain joint point between all consecutive two frames of images among the above multiple frames of images to obtain the standard motion displacement of this joint point in the first time period.

[0071] The above-mentioned multi-frame images can be all the frame images during the playback of a fitness course in the first time period, or a part of the frame images. For example, the electronic device can take frames at a preset frame number interval among all the above-mentioned frame images, and calculate the standard motion displacements of each joint point in the first time period based on the selected multi-frame images.

[0072] Exemplarily, as Figure 3 shown, the electronic device 100 determines n frame images during the playback of a fitness course in the first time period. Taking the calculation of the standard motion displacement of the left knee point in the first time period as an example for illustration. The electronic device 100 can determine the first position information in the first frame image and the second position information in the second frame image. The electronic device 100 can calculate the difference between the above-mentioned first position information and the second position information to obtain the motion displacement of the coach's left knee point between the moment corresponding to the first frame image and the moment corresponding to the second frame image (Δx t1 , Δy t1 , Δz t1 ). Similarly, the electronic device 100 can obtain the motion displacement of the coach's left knee point between the moment corresponding to the second frame image and the moment corresponding to the third frame image (Δx t2 , Δy t2 , Δz t2 ), and the motion displacement between the moment corresponding to the (n - 1)-th frame image and the moment corresponding to the n-th frame image (Δx t(n-1) , Δy t(n-1) , Δz t(n-1) ). The electronic device 100 can add up the motion displacements of the left knee point between every two consecutive frame images from the first frame image to the n-th frame image, so as to obtain the standard motion displacement of the coach's left knee point in the first time period. In addition, the electronic device 100 can also add up the standard motion displacements of all joint points in the first time period to obtain the standard total motion displacement of the coach in the first time period.

[0073] The electronic device 100 can calculate the standard movement frequency at which the coach completes each action based on multiple frames of images during the playback of a fitness course. Exemplarily, in the multiple frames of images during the playback of the fitness course when the coach completes a jumping jack, the posture of the coach can change from a standing posture to an upward jumping posture, then to a downward falling posture, and finally back to the standing posture. The electronic device 100 can determine the time it takes for the coach to complete a jumping jack based on the images during the playback of the fitness course, such as 3 seconds (s). Further, the electronic device 100 can calculate that the frequency at which the coach completes a jumping jack is 1 / 3 (times / s). In some embodiments, the fitness course includes the time it takes for the coach to complete each action. For example, a part of the movement content of the fitness course is to complete 10 jumping jacks within 30 s. The electronic device 100 can obtain the time of the above movement content and the number of completed jumping jacks in the fitness course. Furthermore, the electronic device 100 can calculate the frequency at which the coach completes a jumping jack.

[0074] The standard exercise intensity of a fitness course can be determined based on factors such as the difficulty of each action, the frequency of completing each action, and the rest time between actions when the fitness course is formulated. The higher the standard exercise intensity of a fitness course, the higher the physical fitness requirements for the user. The standard exercise intensity can be used as a reference for users to select fitness courses.

[0075] In some embodiments, the standard exercise intensity of a fitness course can also represent the standard exercise intensity of each sub-course in the fitness course. For example, the fitness course includes three sub-courses: warm-up exercise, formal exercise, and stretching exercise. Among them, the standard exercise intensity of the warm-up exercise and the stretching exercise is lower than that of the stretching exercise.

[0076] In some embodiments of the present application, the actually used standard exercise data can also be generated based on the standard exercise data of the coach in the fitness course and the position information of each joint point of the user. It can be understood that since the body shapes of the user and the coach are not the same, the exercise data of the user cannot be directly compared with the standard exercise data of the coach. The electronic device 100 can process the data of each joint point in the standard exercise data of the coach according to the comparison of the body shapes of the user and the coach, so as to generate standard exercise data suitable for the user.

[0077] 3. The exercise data of the user

[0078] In some embodiments of the present application, the exercise data of the user can include the position information of each joint point when the user performs each action, the movement displacement of each joint point of the user within a certain time period, and the exercise frequency at which the user completes each action, etc.

[0079] Among them, the electronic device 100 can collect images of the target user's body during exercise through the camera 193, and obtain the target user's motion data from the images of the above-mentioned body.

[0080] Specifically, the electronic device 100 can perform human pose detection on the body image of the target user collected by the camera 193 to determine the user's joint points. Furthermore, the electronic device 100 can calculate the target user's motion data. Among them, the method for the electronic device 100 to determine the position information of the target user's joint points, the method for determining the motion displacement of the target user's joint points within a certain time period, and the method for determining the motion frequency of the target user to complete each action can respectively refer to the method for determining the standard motion data in the foregoing embodiments. Details are not described herein again.

[0081] Next, a heart rate detection scenario involved in the embodiments of the present application is introduced.

[0082] This heart rate detection scenario is a scenario for detecting the heart rate of a user during exercise. Here, an example is given where the user exercises according to the fitness course on the electronic device 100.

[0083] Phase 1: Start the fitness course.

[0084] As Figure 4A shown, Figure 4A An exemplary user interface 21 for displaying the application programs installed on the electronic device 100 is shown on the electronic device 100.

[0085] The user interface 21 may include an icon 211 for the fitness application, and icons for other application programs (such as mail, gallery, and music, etc.). The icon of any application can be used to respond to the user's operation, such as a touch operation, so that the electronic device 100 starts the application corresponding to the icon. The user interface 21 may also contain more or less content, which is not limited in the embodiments of the present application.

[0086] In response to the user operation on the fitness icon 211, the electronic device 100 can display a fitness course interface 22 as Figure 4B shown. The fitness course interface 22 may include an application program title bar 221, a function bar 222, and a display area 223. Among them:

[0087] The application program title bar 221 can be used to indicate that the current page is used to display the setting interface of the electronic device 100. The manifestation form of the application program title bar 221 can be text information "Intelligent Fitness", an icon, or other forms.

[0088] The function bar 222 may include: a user center control, a course recommendation control, a fat burning zone control, a body shaping zone control, and a body shaping zone control. Without being limited to the above controls, the function bar 222 may include more or fewer controls.

[0089] In response to a user operation on any control in the function bar 222, the electronic device 100 may display the content indicated by the control in the display area 223.

[0090] For example, in response to a user operation on the user center control, the electronic device 100 may display the interface content of the user personal center in the display area 223. In response to a user operation on the course recommendation control, the electronic device 100 may display one or more recommended fitness courses in the display area 223. As Figure 4B shown, the display area 223 displays the course covers of multiple recommended courses. The course cover may include the course classification, duration, name, and exercise intensity of the corresponding fitness course. In response to a user operation on any course cover, the electronic device 100 may start the fitness course corresponding to the course cover and display the exercise content in the fitness course.

[0091] The embodiments of the present application do not limit any of the above-mentioned user operations. For example, the user may also control the electronic device 100 through a remote control to execute corresponding instructions (such as starting a fitness application program, starting a fitness course, etc.).

[0092] The fitness course interface 22 may also include more or fewer contents, and the embodiments of the present application do not limit this.

[0093] In response to a user operation on the course cover of any fitness course (such as a fitness course with the course name "Full Body Fat Burning Beginner"), the electronic device 100 may start the fitness course. Among them, during the playback of the fitness course, the electronic device 100 needs to collect the user's image through the camera. Then, before playing the fitness course, the electronic device 100 may prompt the user that the camera is about to be turned on.

[0094] As Figure 4C shown, the electronic device 100 may display a prompt box 224. Among them, the prompt box 224 may include a text description for turning on the camera. For example, the text description may be "Turning on the fitness course defaults to turning on the camera permission (the camera shooting screen is only used for local vision algorithm processing, will not be stored nor uploaded to the cloud server)". This text description can be used to prompt the user that the camera is in the on state during the playback of the fitness course. The embodiments of the present application do not limit the specific content of the above text description.

[0095] The prompt box 224 may further include a confirmation control 224A. In response to a user operation acting on the confirmation control 224A, the electronic device 100 may turn on the camera 193.

[0096] Phase 2: Determine the target user and their personal information.

[0097] The above-mentioned target user may refer to a user who exercises and needs to record exercise data during the playback of a fitness course on the electronic device.

[0098] The above-mentioned personal information may include, but is not limited to: resting heart rate, age, body fat percentage.

[0099] In some embodiments, as Figure 4D shown, the electronic device 100 may collect the user's face information to determine the target user who exercises. Determining the target user is beneficial for the electronic device 100 to accurately obtain the exercise data of the target user. This can avoid inaccurate exercise data obtained by the electronic device 100 when there are other users other than the target user within the shooting range of the camera.

[0100] Exemplarily, the electronic device 100 may display a target user determination interface 23. The target user determination interface 23 may include a prompt message and a face collection frame 231. Among them, the prompt message may be used to prompt the user to perform face entry. The prompt message may be a text prompt "Please keep your frontal face within the collection frame". The form and specific content of the above-mentioned prompt message are not limited in the embodiments of the present application. The face collection frame 231 may be used to display the face image collected by the camera.

[0101] When the face collection is completed, the electronic device 100 may display a prompt box 232 as Figure 4E shown on the target user determination interface 23. The prompt box 232 may be used to prompt the target user that the face collection is successful. Among them, when a face image is collected, the electronic device 100 may detect the user's resting heart rate according to the non-contact heart rate detection method in the foregoing embodiments. Since the target user has not started exercising at this time, the heart rate calculated based on the currently collected face image can be considered to be free from exercise interference. For example, the electronic device 100 calculates that the user's resting heart rate is 70 bpm based on the face image collected during the target user determination process. The electronic device 100 may prompt the target user in the prompt box 232 that their resting heart rate is 70 bpm.

[0102] When the face image of the target user is determined, the electronic device 100 may use a target tracking algorithm to determine the data of the area where the target user is located in the image data collected by the camera during the playback of the fitness course. In this way, the electronic device can calculate the exercise data of the target user. The implementation method of the above-mentioned target tracking algorithm may refer to the specific implementation of the target tracking algorithm in the prior art and will not be elaborated here.

[0103] Further, the electronic device 100 can obtain personal information of the target user, such as age and body fat percentage. As Figure 4F shown, the electronic device 100 can display the user interface 24. The user interface 24 may include a prompt 241, an information input area 242, a confirmation control 243, and a skip control 244. Among them:

[0104] The prompt 241 can be used to prompt the user to input personal information in the information input area 242. The prompt 241 may include a text prompt "Enter the following data to more accurately detect your heart rate during exercise!". The specific content in the prompt 241 in the embodiments of the present application is not limited.

[0105] The information input area 242 can be used for the user to input their personal information. Such as age, body fat percentage, etc. The information input area 242 may include an associated device control 242A. The associated device control 242A can be used for the electronic device 100 to be associated with a body fat percentage detection device and obtain the user's body fat percentage. The associated device control 242A may include a text prompt "Associate the device to obtain the body fat percentage". The above text prompt can be used to prompt the user that they can input the body fat percentage by associating their body fat percentage detection device. In response to a user operation on the associated device control 242A, the electronic device 100 can search for nearby body fat percentage detection devices and establish a communication connection with the detected body fat percentage detection device. The electronic device 100 can obtain the user's body fat percentage from the body fat percentage detection device. This can improve the convenience of the user inputting personal information, so as to prevent the user from forgetting or not knowing their personal information such as body fat percentage.

[0106] The confirmation control 243 can be used for the electronic device 100 to store the personal information input by the user in the information input area 242.

[0107] The skip control 244 can be used for the user to skip the process of inputting personal information.

[0108] In response to a user operation on the confirmation control 243 or the skip control 244, the electronic device 100 can play a fitness course.

[0109] The embodiments of the present application do not limit the method for confirming the target user as described above.

[0110] In some embodiments, the electronic device 100 can collect other biometric information of the user, such as hand biometric information, through a camera to determine the target user. Alternatively, the electronic device 100 can also prompt the user to complete a preset action, and determine the user who has completed the above preset action as the target user through the image collected by the camera.

[0111] In some embodiments, a face image of a target user is stored in the electronic device 100. Before playing a fitness course, the target user can log in to the personal account of the fitness application. When calculating the user's exercise data and performing heart rate detection, the electronic device 100 can obtain the face image of the target user. Based on the face image of the target user, the electronic device 100 can determine the area where the target user is located from the image captured by the camera, and then calculate the user's exercise data and heart rate.

[0112] Among them, personal information of the target user (such as resting heart rate, age, body fat percentage, etc.) can also be stored in the electronic device 100. When the fitness application logs in with the user's account, the electronic device 100 can confirm that the user corresponding to the account is the target user and can obtain the stored personal information. In this way, the user does not need to perform face image collection and personal information entry before each fitness course.

[0113] In some embodiments, the above-mentioned target user may include multiple users. Among them, the electronic device 100 can obtain the number of target users before playing the fitness course. Further, the electronic device 100 can obtain the face images of all target users and the personal information of each target user. During the process of playing the fitness course, the electronic device 100 can calculate the exercise data and heart rate of all target users.

[0114] The embodiments of the present application are introduced by taking the number of target users as one for exemplification.

[0115] Phase three: Detect the heart rate of the target user during exercise.

[0116] As Figure 4G shown, the electronic device 100 can play a fitness course. Exemplarily, the electronic device 100 can display a sports interface 25. The sports interface 25 may include a fitness course window 251 and a user fitness window 252. Among them,

[0117] The fitness course window 251 can be used to display the specific content of the fitness course. The specific content of the fitness course may include: a time indicator 251A, an action name 251B, an action count indicator 251C, an action duration indicator 251D, and an image of the coach performing the actions in the fitness course, etc.

[0118] The above-mentioned time indicator 251 can be used to indicate the time that the fitness course has currently elapsed. For example, the time indicator 251A being "03:21" can indicate that the fitness course has currently elapsed for 3 minutes and 21 seconds.

[0119] The above-mentioned action name 251B can be used to indicate the name of the action currently being performed in the fitness class. For example, the action name 251B is "hold the head and lift the left knee", indicating that the current action is to hold the head and lift the left knee.

[0120] The above-mentioned action count indicator 251C can be used to indicate the total number of times the action currently being performed in the fitness class needs to be completed and the number of times that have been completed currently. For example, the action count indicator 251C is "3 / 10", which can indicate that the total number of times the action "hold the head and lift the left knee" needs to be completed is 10 times, and the coach has completed 3 times currently.

[0121] The above-mentioned action duration indicator 251D can be used to indicate the total time length that the action currently being performed in the fitness class needs to be carried out and the time length that has been carried out currently. For example, the action duration indicator 251D is "9s / 30s", which can indicate that the current action "hold the head and lift the left knee" needs to be done for 30 seconds, and the coach has already done it for 9 seconds.

[0122] According to the specific content of the above-mentioned fitness class, the electronic device 100 can obtain the standard motion data of the fitness class. For example, according to the above-mentioned action count indicator 251C and the above-mentioned action duration indicator 251D, the electronic device 100 can determine that the frequency of the coach performing the action "hold the head and lift the left knee" is 1 / 3 (times / s). According to the images of the coach performing the actions in the fitness class, the electronic device 100 can determine the standard motion displacements of the coach's respective joint points within a certain period of time. The specific implementation manner of determining the standard motion displacements can refer to the foregoing embodiments, which will not be elaborated here.

[0123] The user fitness window 252 can be used to display the body posture of the target user collected by the camera in real time. The user fitness window 252 can also be used to display the heart rate of the target user detected by the electronic device 100 in real time. For example, the electronic device 100 calculates the detected heart rate of the target user within a certain period of time based on the face image of the target user collected by the camera in real time, and the detected heart rate is 83 bpm. Then the value of the heart rate in the heart rate display box 252A can be 83 bpm. The electronic device 100 can update the heart rate in the heart rate display box 252A every preset period of time.

[0124] The embodiments of the present application do not limit the distribution manner of the above-mentioned fitness class window 251 and the above-mentioned user fitness window 252 on the motion interface 25. The fitness class window 251 and the user fitness window 252 can be distributed as shown in Figure 4G a left-right distribution with no overlapping areas, or the fitness class window 251 can occupy the entire motion interface 25, and the user fitness window 252 can be suspended on the fitness class window 251 as a floating small window.

[0125] The above-mentioned exercise interface 25 may also include more or less content, and the embodiments of the present application do not limit this. For example, the electronic device 100 may compare the exercise data of the target user with the standard exercise data to determine whether the actions of the target user are correct and whether the amplitude of the target user's actions reaches the amplitude of the corresponding action in the standard exercise data. Then, the electronic device 100 may display the score of the target user's actions and relevant prompts for prompting the target user to improve the actions on the exercise interface 25, etc.

[0126] The electronic device 100 displays the heart rate of the target user in real time on the exercise interface 25, which is conducive to the target user intuitively understanding their own heart rate changes and reasonably adjusting their exercise intensity. For example, when the detected heart rate is low and the target user perceives that the current exercise intensity of the fitness course is low, the target user can actively increase their actual exercise intensity (such as increasing the frequency of actions, increasing the amplitude of completing one action, etc.). In this way, the target user can achieve better exercise effects. When the detected heart rate is high (such as reaching or even exceeding the maximum heart rate of the target user), the target user can temporarily stop exercising or actively reduce their actual exercise intensity to avoid harm to the body caused by excessive exercise.

[0127] In the embodiments of the present application, the electronic device 100 may calculate the actual exercise intensity of the target user during a certain period according to the exercise data and personal information of the target user. According to the actual exercise intensity of the target user, the electronic device 100 may calculate the expected heart rate range of the target user during this period. Furthermore, the electronic device 100 may verify whether there is an error in the heart rate to be verified obtained by the non-contact heart rate detection method according to the above-mentioned expected heart rate range and correct the heart rate to be verified with an error.

[0128] The following introduces the specific implementation manner for the electronic device 100 to obtain the detected heart rate of the target user.

[0129] (1) Calculate the actual exercise intensity of the target user during exercise.

[0130] In some embodiments, the electronic device 100 may calculate the actual exercise intensity of the target user during this period according to the movement displacement of each joint point of the target user, the frequency of the actions performed by the target user, the age of the target user, and the body fat percentage.

[0131] Specifically, the electronic device 100 determines n frames of images from multiple frames of images collected by the camera within the first time period. The above-mentioned n frames of images may be all the frames of images collected by the camera within the first time period. The above-mentioned n frames of images may also be partial frames of images collected by the camera within the first time period. For example, among the multiple frames of images collected by the camera of the electronic device 100 within the first time period, one frame of image is selected every preset number of frames at intervals, and a total of n frames of images are selected. The embodiments of the present application do not limit the method for the electronic device to determine n frames of images of the target user within the first time period during the movement process.

[0132] The above-mentioned first time period is any time period during the process of the electronic device 100 playing a fitness course. The length of the above-mentioned first time period may be a time length such as 1 s or 2 s. The embodiments of the present application do not limit the length of the first time period.

[0133] According to the method for calculating the movement displacement of each joint point in the foregoing embodiments, the electronic device 100 can calculate the total movement displacement dis of all joint points of the target user within the first time period. The expression of dis can refer to the following formula (1):

[0134]

[0135] where m represents the number of joint points determined by the electronic device 100 on one frame of image. Δx k_ti may represent the movement displacement of the kth joint point in the front-back direction between the i-th frame of image and the (i + 1)-th frame of image. Δy k_ti may represent the movement displacement of the kth joint point in the horizontal direction between the i-th frame of image and the (i + 1)-th frame of image. Δz k_ti may represent the movement displacement of the kth joint point in the vertical direction between the i-th frame of image and the (i + 1)-th frame of image.

[0136] The electronic device 100 can calculate the frequency of the actions performed by the target user within the first time period. Among them, the electronic device 100 can determine the time elapsed from the start of a certain action to the end of a certain action by the user according to the human pose detection algorithm, and then obtain the frequency of the target user performing this action. The electronic device 100 can use this frequency as the frequency fre of the actions performed by the target user within the first time period.

[0137] Alternatively, the target user does not complete an action within the first time period. The electronic device 100 can obtain the frequency of the target user completing a certain action calculated within the time period closest to the first time period. The electronic device 100 can use this frequency as the frequency fre of the actions performed by the target user within the first time period. The embodiments of the present application do not limit the method for the electronic device 100 to calculate the frequency of the actions performed by the target user within the first time period.

[0138] Further, the electronic device 100 may calculate the weighted value W of the following four parameters: the total movement displacement dis of all joint points of the target user within the first time period, the frequency fre of the actions performed by the target user within the first time period, the body fat rate fat_rate of the target user, and the age age of the target user. The expression of the weighted value W may refer to the following formula (2):

[0139] W = α * dis + β * fre + χ * fat_rate + δ * age (2)

[0140] Wherein, α, β, χ, and δ are all positive numbers greater than 0 and less than 1. And, α + β + χ + δ = 1. The specific values of α, β, χ, and δ in the embodiments of the present application are not otherwise limited.

[0141] When the above-mentioned weighted value W is calculated, the electronic device 100 may determine the actual exercise intensity Q of the target user according to the stored exercise intensity model.

[0142] The above exercise intensity model may be determined according to the relationship between the weighted value W and the exercise intensity Q reflected by a large amount of data. The embodiments of the present application do not limit the specific method for determining the above exercise intensity model.

[0143] Figure 5 An exemplary schematic diagram of the relationship between the exercise intensity Q and the weighted value W in the above exercise intensity model is shown.

[0144] Wherein, the specific value of the exercise intensity Q may be a positive number greater than or equal to 0 and less than or equal to 1. The electronic device 100 may divide the exercise intensity range according to the value of the exercise intensity Q. For example, the electronic device 100 may divide three exercise intensity ranges: the first exercise intensity range (or low intensity range), the second exercise intensity range (or medium intensity range), and the third exercise intensity range (or high intensity range). The value of the exercise intensity Q within the first exercise intensity range may be a value greater than or equal to 0 and less than 0.5. The value of the exercise intensity Q within the second exercise intensity range may be a value greater than 0.5 and less than 0.75. The value of the exercise intensity Q within the third exercise intensity range may be a value greater than 0.75 and less than or equal to 1. The embodiments of the present application do not limit the above division method of the exercise intensity range.

[0145] From Figure 5 it can be seen that when the above-mentioned weighted value W is determined, the electronic device 100 may calculate the actual exercise intensity of the target user and the exercise intensity range to which it belongs according to the exercise intensity model. Figure 5 This is only an example of the relationship between the exercise intensity Q and the weighted value W in the exercise intensity model, and does not limit the specific content of the exercise intensity model.

[0146] The actual movement displacement of the user and the frequency of completing actions are detected, and the exercise intensity can be measured according to the movement displacement and the frequency of completing actions. The electronic device can estimate the actual exercise intensity of the target user based on the actual movement displacement of each joint point of the target user and the frequency of completing actions. In addition, for users of different ages and different body fat rates, when they complete the same actions (both the type of action and the resulting movement displacement are the same) and the frequency of completing actions is the same during exercise, there are differences in exercise intensity. For example, when completing the same actions at the same frequency, the exercise intensity of a 40-year-old user is often higher than that of a 20-year-old user. Therefore, calculating the exercise intensity by combining the age and body fat rate of the target user can calculate the actual exercise intensity of the target user more accurately.

[0147] In some embodiments, the electronic device 100 can also calculate the actual exercise intensity of the target user during the first time period in combination with the standard exercise data of the fitness course during the first time period.

[0148] Specifically, the standard exercise data of the fitness course may include the standard exercise intensity Q of the exercise content of the fitness course during the first time period stan . Combining the above standard exercise intensity Q stan , dis, fre, fat_rate, and age in the foregoing embodiments, the electronic device 100 can calculate the weighted value W1 according to the following formula (3).

[0149] W1 = α1 * dis + β1 * fre + χ1 * fat_rate + δ1 * age + ε1 * φ * Q stan (3)

[0150] Wherein, α1, β1, χ1, δ1, and ε1 are all positive numbers greater than 0 and less than 1. And, α1 + β1 + χ1 + δ1 + ε1 = 1. The specific values of α1, β1, χ1, δ1, and ε1 in the embodiments of the present application are not otherwise limited. φ can be the completion degree of the target user relative to the standard exercise data of the fitness course during the movement process in the first time period. For example, the above completion degree can be estimated based on several data such as the movement displacement of each joint point of the target user, the movement displacement of each joint point of the coach in the standard exercise data, the frequency of actions performed by the target user during the first time period, and the frequency of actions performed by the coach in the standard exercise data during the first time period. The expression of φ can refer to the following formula (4):

[0151]

[0152] Wherein, γ can represent the weight of the frequency when calculating the completion degree φ. can represent the weight that the movement displacement of the k-th joint point occupies when calculating the completion degree φ. m represents the number of joint points determined by the electronic device 100 in one frame of image. fre stan can represent the frequency of the actions performed by the coach in the first time period in the standard motion data. dis k can represent the movement displacement of the k-th joint point of the target user in the first time period. dis stan_k can represent the movement displacement of the k-th joint point of the coach in the first time period in the standard motion data. The embodiments of the present application do not limit the method for calculating the above-mentioned completion degree φ.

[0153] Furthermore, the electronic device 100 can calculate the actual exercise intensity of the target user in the first time period and the exercise intensity interval to which it belongs according to the stored exercise intensity model. Among them, the above exercise intensity model can be used to reflect the mapping relationship between the above weight value W1 and the actual exercise intensity Q of the target user.

[0154] The standard exercise intensity of the fitness course can be used as a factor for estimating the actual exercise intensity of the target user. The higher the standard exercise intensity of the fitness course, the higher the actual exercise intensity of the target user tends to be. The electronic device obtains the completion degree of the target user for completing the fitness course by comparing the actual movement displacements of the joints of the target user and the frequency of the actions performed with the standard motion data of the fitness course. According to the product of the completion degree and the standard exercise intensity, the electronic device can estimate the actual exercise intensity of the target user. Combining the standard exercise intensity of the fitness course, the electronic device can calculate the actual exercise intensity of the target user more accurately.

[0155] In some embodiments, the electronic device 100 does not obtain the age and / or body fat percentage of the target user. As Figure 4F shown, the electronic device 100 does not receive the age and body fat percentage input by the user and receives a user operation acting on the skip control 244. When calculating the actual exercise intensity of the target user, the electronic device 100 can calculate the actual exercise intensity of the target user according to one or more of the above movement displacements of the joints of the target user, the frequency of the actions completed by the target user, and the standard motion data of the fitness course. The embodiments of the present application do not limit the parameters used when calculating the actual exercise intensity of the target user as described above. For example, the electronic device can also combine the gender of the target user, the oxygen consumption per unit time, etc. to calculate the actual exercise intensity of the target user.

[0156] (2) Determine the expected heart rate interval of the target user.

[0157] When the actual exercise intensity of the target user in the first time period and the exercise intensity interval to which it belongs are determined, the electronic device 100 can determine the expected heart rate interval of the target user in the first time period.

[0158] Specifically, the electronic device 100 can calculate the expected heart rate range of the target user within the first time period according to the following formula (5).

[0159] Expected heart rate range = (maximum heart rate - resting heart rate) * exercise intensity range + resting heart rate (5)

[0160] Among them, the above maximum heart rate can represent the maximum value that the heart rate of the target user can reach. The value of the maximum heart rate can be the value obtained by subtracting the age of the target user from 220. The embodiment of the present application does not limit the calculation method of the maximum heart rate. The resting heart rate can be the heart rate value calculated by the electronic device 100 when collecting the face image of the target user as Figure 4D and Figure 4E The resting heart rate can also be obtained by the electronic device 100 from the personal information of the target user stored. The embodiment of the present application does not limit the method for the electronic device 100 to obtain the resting heart rate of the target user.

[0161] Exemplarily, the first exercise intensity range is [0, 0.5). The second exercise intensity range is [0.5, 0.75). The third exercise intensity range is [0.75, 1]. The above range [0, 0.5) can represent that the value of the exercise intensity within the first exercise intensity range is greater than or equal to 0 and less than 0.5. The above range [0.5, 0.75) can represent that the value of the exercise intensity within the second exercise intensity range is greater than or equal to 0.5 and less than 0.75. The above range [0.75, 1] can represent that the range of the exercise intensity within the third exercise intensity range is greater than or equal to 0.75 and less than or equal to 1.

[0162] The actual exercise intensity of the target user within the first time period belongs to the above first exercise intensity range. The age of the target user is 20 years old, and the resting heart rate is 70 bpm. Then the maximum heart rate of the target user is 200 bpm. The electronic device 100 can calculate the expected heart rate range of the target user within the first time period: [70, 135). The above range [70, 135) can represent that the heart rate value within the expected heart rate range is greater than or equal to 70 bpm and less than 135 bpm.

[0163] The specific values of the above exercise intensity range and expected heart rate range are only examples of the present application, and do not limit the values of the exercise intensity range and expected heart rate range.

[0164] (3) Verify the heart rate to be verified to obtain the detected heart rate.

[0165] The electronic device 100 may calculate the heart rate of the target user within the first time period according to the non-contact heart rate detection method in the foregoing embodiments, and obtain the unverified heart rate for the first time period. Further, the electronic device 100 may use the expected heart rate range within the first time period to verify the unverified heart rate for the first time period to determine whether there is an error in the unverified heart rate.

[0166] If the unverified heart rate for the first time period belongs to the expected heart rate range within the first time period, the electronic device 100 may determine that there is no error in the unverified heart rate range. Then, the electronic device 100 may use the unverified heart rate for the first time period as the detected heart rate of the target user within the first time period.

[0167] If the unverified heart rate for the first time period does not belong to the expected heart rate range within the first time period, the electronic device 100 may determine that there is an error in the unverified heart rate. Then, the electronic device 100 may correct the unverified heart rate for the first time period to obtain the detected heart rate for the first time period. The detected heart rate for the first time period belongs to the expected heart rate range within the first time period.

[0168] Wherein, if the unverified heart rate of the target user within the first time period is less than the minimum value of the heart rate in the expected heart rate range within the first time period, the electronic device 100 may correct the unverified heart rate for the first time period to the minimum value of the heart rate in the expected heart rate range within the first time period. Alternatively, the electronic device 100 may divide the expected heart rate range within the first time period into a first half and a second half according to the heart rate value in the middle of the expected heart rate range within the first time period. The electronic device 100 may correct the unverified heart rate for the first time period to any heart rate value in the first half of the expected heart rate range within the first time period.

[0169] If the unverified heart rate of the target user within the first time period is greater than the maximum value of the heart rate in the regional heart rate range within the first time period, the electronic device 100 may correct the unverified heart rate for the first time period to the maximum value of the heart rate in the expected heart rate range within the first time period. Alternatively, the electronic device 100 may correct the unverified heart rate for the first time period to any heart rate value in the second half of the expected heart rate range within the first time period.

[0170] The embodiments of the present application do not limit the specific method for the electronic device 100 to correct the unverified heart rate with errors according to the expected heart rate range.

[0171] Exemplarily, the expected heart rate range of the target user within the first time period is [70, 135). If the electronic device 100 calculates that the heart rate to be verified of the target user within the first time period is 55 bpm, the electronic device 100 may correct the heart rate to be verified to 70 bpm. That is, the electronic device 100 may use 70 bpm as the detected heart rate of the target user within the first time period. If the electronic device 100 calculates that the heart rate to be verified of the target user within the first time period is 160 bpm, the electronic device 100 may correct the heart rate to be verified to 134 bpm. That is, the electronic device 100 may use 134 bpm as the detected heart rate of the target user within the first time period.

[0172] Through the above non-contact heart rate detection method, the target user can conveniently understand their heart rate during exercise without wearing additional wearable devices for heart rate detection. Moreover, according to the heart rate detection method provided in the embodiments of the present application, the electronic device can determine the expected heart rate range of the target user based on the actual exercise intensity of the user. According to this expected heart rate range, the electronic device can correct the heart rate with errors. In this way, the electronic device can calculate the heart rate of the target user during exercise more accurately, making the heart rate obtained by the target user more meaningful as a reference.

[0173] In some embodiments, the images captured by the camera of the electronic device 100 within certain time periods do not contain the face image of the target user. For example, when the actions performed by the target user are push-ups, planks, etc., since the face of the target user is facing the ground, the camera cannot capture the face image of the target user. Then the electronic device 100 cannot calculate the heart rate of the target user according to the non-contact heart rate detection method in the foregoing embodiments.

[0174] The electronic device 100 may use the detected heart rate of the time period closest to the time period when the face image of the target user cannot be captured and where the face image of the target user can be captured as the detected heart rate within the time period when the face image of the target user cannot be captured. That is to say, if the images captured by the camera of the electronic device 100 within the first time period do not contain the face image of the target user, the electronic device 100 may use the last calculated detected heart rate of the target user during the process from the start of detecting the heart rate of the target user to the above first time period as the detected heart rate of the target user within the first time period and provide it to the user (for example, display it on the display screen of the electronic device 100).

[0175] Optionally, the electronic device 100 may predict the detected heart rate of the target user during the first time period based on the detected heart rate of the target user obtained in the last calculation during the process from the time when the heart rate of the target user starts to be detected to the above-mentioned first time period and the actual exercise intensity of the target user during the first time period. For example, according to the heart rate detection method in the embodiments of the present application, the electronic device 100 may calculate the expected heart rate range of the target user during the first time period by using the actual exercise intensity of the target user during the first time period and the personal information of the target user. The electronic device 100 may predict the detected heart rate of the target user during the first time period in combination with the expected heart rate range during the first time period. For example, the electronic device 100 may use any value in the expected heart rate range during the first time period as the detected heart rate of the target user during the first time period. The embodiments of the present application do not limit the method for the electronic device 100 to predict the detected heart rate during the time period when the face image of the target user cannot be collected.

[0176] Not limited to verifying the heart rate calculated based on the non-contact heart rate detection method to improve the accuracy of heart rate detection. The electronic device 100 may also verify the heart rate calculated based on the contact heart rate detection method.

[0177] In the above contact heart rate detection method, the user needs to touch the electronic device for heart rate detection. The above electronic device for heart rate detection may be, for example, a smart bracelet, a heart rate detection chest strap, etc. The above contact heart rate detection method may be, for example, a photoplethysmography (PPG) detection method, an electrocardiography (ECG) detection method, etc. The specific implementation of the contact heart rate detection method may refer to the implementation manner of the contact heart rate detection method in the prior art, and the embodiments of the present application do not limit this.

[0178] In some embodiments, the electronic device 100 may obtain the heart rate detected by the above electronic device for heart rate detection and use this heart rate as the heart rate to be verified. Further, the electronic device 100 may determine the actual exercise intensity of the target user according to the method in the foregoing embodiments, and determine the expected heart rate range of the target user according to the actual exercise intensity. The electronic device 100 may use the above expected heart rate range to verify the heart rate to be verified obtained by the non-contact heart rate detection method to obtain the final detection result. The electronic device 100 may present the above final detection result to the target user on the display screen.

[0179] In some embodiments, the electronic device 100 may also obtain the motion data of the target user from other electronic devices. The aforementioned other electronic devices may be, for example, electronic devices equipped with motion sensors (such as acceleration sensors, gyroscope sensors, inertial sensors). This electronic device can calculate motion data such as the motion displacement of the target user during the motion and the frequency of completing actions through the motion sensors. The electronic device 100 may obtain the motion data of the target user from the aforementioned electronic devices equipped with motion sensors. According to the method for calculating the actual motion intensity of the target user in the foregoing embodiments, the electronic device 100 may determine the motion intensity range of the target user, and further determine the expected heart rate range of the target user. Then, the electronic device 100 may use the expected heart rate range to verify the heart rate to be verified, so as to improve the accuracy of heart rate detection.

[0180] The embodiments of the present application do not limit the method for the electronic device 100 to obtain the motion data of the target user.

[0181] In some embodiments, the user's exercise may be autonomous exercise. That is, the user does not exercise according to the relevant fitness courses in the electronic device 100. Among them, when the user performs autonomous exercise, the electronic device 100 does not play fitness courses. Or, the user may exercise according to the motion-sensing fitness game in the electronic device 100. The aforementioned motion-sensing fitness game may indicate the user to complete the corresponding exercise content through relevant game scenarios. Among them, when the user exercises according to the motion-sensing fitness game in the electronic device 100, the electronic device 100 may play the game interface of the motion-sensing fitness game.

[0182] In the above scenarios where the user exercises autonomously or exercises according to the motion-sensing fitness game in the electronic device 100, the electronic device 100 can still determine the target user according to the method in the foregoing embodiments, and obtain the personal information of the target user and the motion data during the exercise to calculate the actual motion intensity of the target user. Further, the electronic device 100 may determine the expected heart rate range of the target user according to the actual motion intensity of the user, and use the expected heart rate range to verify the calculated heart rate to be verified.

[0183] Figure 6 An exemplary fitness report interface 26 provided by the embodiments of the present application is shown.

[0184] When the user completes the fitness course, the electronic device 100 may display Figure 6 the shown fitness report interface 26 to display the relevant data of the user during the exercise. Such as Figure 6As shown, the fitness report interface 26 may include exercise time 261, exercise score 262, fitness course name 263, heart rate graph 264, low-intensity exercise time 265, medium-intensity exercise time 266, high-intensity exercise time 267, calories burned 268, exercise items 269, do again control 2610, and close control 2611. Among them,

[0185] The exercise time 261 can represent the time taken by the user to complete the fitness course. For example, an exercise time 261 of "30:00" can indicate that the user spent 30 minutes completing the fitness course.

[0186] The exercise score 262 can represent the user's performance in completing the fitness course. The specific value of the exercise score 262 can be obtained by the electronic device 100 comparing the standard exercise data of the fitness course with the user's exercise data. The calculation method of the exercise score 262 is not limited here.

[0187] The fitness course name 263 can represent the name of the fitness course. For example, the name of the fitness course is "Beginner Whole Body Fat Burning".

[0188] The heart rate graph 264 can represent the change in the user's heart rate during the fitness course. The heart rate in the heart rate graph 264 can be the detected heart rate of the target user obtained by the electronic device 100 according to the heart rate detection method in the foregoing embodiments.

[0189] The low-intensity exercise time 265, medium-intensity exercise time 266, and high-intensity exercise time 267 can respectively represent the time of low-intensity exercise, medium-intensity exercise, and high-intensity exercise during the user's performance of the fitness course. The above division methods of low-intensity exercise, medium-intensity exercise, and high-intensity exercise can be the division methods of dividing the first exercise intensity interval, the second exercise intensity interval, and the third exercise intensity interval in the foregoing embodiments. Among them, low-intensity exercise can indicate that the value of the exercise intensity belongs to the first exercise intensity interval. Medium-intensity exercise can indicate that the value of the exercise intensity belongs to the second exercise intensity interval. High-intensity exercise can indicate that the value of the exercise intensity belongs to the third exercise intensity interval.

[0190] The calories burned 268 can represent the calories consumed by the user in completing the fitness course. The embodiment of the present application does not limit the method of calculating the calories burned 268.

[0191] The exercise items 269 can represent the actions included in the fitness course. For example, shoulder rotation, hands stretching, and so on.

[0192] The do again control 2610 can be used to perform again the fitness course indicated by the above fitness course name 263.

[0193] The closing control 2611 can be used for the electronic device 100 to close the fitness report interface 26.

[0194] Figure 7 The flowchart of a heart rate detection method provided by an embodiment of the present application is exemplarily shown. As Figure 7 shown, the heart rate detection method may include steps S101 to S109. Among them:

[0195] S101. The electronic device 100 determines the target user through the camera.

[0196] When receiving the user operation to start a fitness course, the electronic device 100 can turn on the camera. The above user operation to start a fitness course can be, for example, a user operation acting on the course cover of the fitness course as Figure 4B shown. Alternatively, the electronic device 100 includes a setting option for detecting exercise heart rate. When the target user is performing independent exercise, the electronic device 100 can turn on the function of detecting exercise heart rate. In response to the user operation acting on the setting option for detecting exercise heart rate, the electronic device 100 can turn on the camera to determine the target user and detect the heart rate of the target user. The embodiment of the present application does not limit the timing for the electronic device 100 to turn on the camera.

[0197] The manner in which the electronic device 100 determines the target user through the camera can refer to the introduction of Figure 4D and Figure 4E in the foregoing embodiments. Details are not described herein again. The embodiment of the present application does not limit the manner in which the electronic device 100 determines the target user. In addition to using the camera, detection devices such as an infrared light sensor and a laser sensor can also be used.

[0198] S102. The electronic device 100 obtains the personal information of the target user. The above personal information may include resting heart rate, age, and body fat percentage.

[0199] In a possible implementation manner, the electronic device 100 can display a personal information entry interface before playing the fitness course. The target user can input their personal information in the above personal information entry interface. The electronic device 100 can receive the input of the target user to obtain the personal information of the target user. The above personal information entry interface can be, for example, the user interface 24 as Figure 4F shown above.

[0200] In another possible implementation manner, the target user logs in to their account in the fitness application. The electronic device 100 can obtain the personal information of the target user corresponding to the currently logged-in account from the local or the cloud.

[0201] The embodiments of the present application do not limit the manner in which the electronic device 100 obtains the personal information of the target user. The personal information is not limited to resting heart rate, age, and body fat percentage, and may also include less or more content. For example, the personal information may also include the gender of the target user, oxygen consumption per unit time, etc.

[0202] S103. The electronic device 100 continuously captures the body images of the target user during exercise through a camera.

[0203] S104. The electronic device 100 determines the face image of the target user within the first time period from the above body images, and calculates the unverified heart rate of the target user within the first time period based on the above face image.

[0204] The electronic device 100 may calculate the heart rate of the target user according to the non-contact heart rate detection method in the foregoing embodiments. The calculated heart rate above is the unverified heart rate of the target user within the first time period.

[0205] S105. The electronic device 100 calculates the actual exercise intensity of the target user within the first time period based on the body images of the target user within the first time period in the body images captured in step S103.

[0206] S106. According to the actual exercise intensity of the above target user, the electronic device 100 calculates the expected heart rate range of the target user within the first time period.

[0207] The method by which the electronic device 100 calculates the actual exercise intensity and the expected heart rate range of the target user within the first time period may refer to the introduction in the foregoing embodiments, and will not be elaborated here.

[0208] It should be noted that there is no limitation on the time sequence between step S104 and step S105 above. The electronic device 100 may calculate the unverified heart rate of the target user within the first time period and its actual exercise intensity simultaneously based on the body images of the target user within the first time period.

[0209] S107. The electronic device 100 uses the expected heart rate range within the first time period to determine whether there is an error in the unverified heart rate obtained in step S104.

[0210] Specifically, the electronic device 100 may determine whether there is an error in the unverified heart rate within the first time period according to whether the unverified heart rate of the target user within the first time period is included in the expected heart rate range within the first time period.

[0211] If the heart rate to be verified within the first time period belongs to the expected heart rate range within the first time period, the electronic device 100 may determine that there is no error in the heart rate to be verified within the first time period. Further, the electronic device 100 may perform the following step S108.

[0212] If the heart rate to be verified within the first time period does not belong to the expected heart rate range within the first time period, the electronic device 100 may determine that there is an error in the heart rate to be verified within the first time period. Further, the electronic device 100 may perform the following step S109.

[0213] S108. If there is no error in the heart rate to be verified within the first time period, the electronic device 100 uses the heart rate to be verified within the first time period as the detected heart rate within the first time period.

[0214] S109. If there is an error in the heart rate to be verified within the first time period, the electronic device 100 corrects the heart rate to be verified within the first time period according to the expected heart rate range within the first time period, and uses the corrected heart rate as the detected heart rate within the first time period.

[0215] The electronic device 100 may provide the detected heart rate of the target user within the first time period obtained according to step S108 or step S109 to the target user. For example, as Figure 4G shown, the electronic device 100 may display the detected heart rate within the first time period on the display screen. In this way, the target user can intuitively obtain his own heart rate during exercise.

[0216] The specific implementation methods of the above step S108 and the above step S109 may refer to the method by which the electronic device 100 determines the detected heart rate of the target user within the first time period in the foregoing embodiments, and will not be elaborated here.

[0217] From Figure 7 the heart rate detection method shown, the actual exercise intensity of the user can more accurately estimate the change in the user's heart rate during exercise. The electronic device determines the expected heart rate range of the target user based on the actual exercise intensity of the user, and corrects the heart rate with errors according to the expected heart rate range. The above heart rate detection method can reduce the interference of user exercise on heart rate detection and improve the accuracy of heart rate detection. Thus, the detected heart rate obtained by the user is more meaningful for the user as a reference.

[0218] In some embodiments, the electronic device 100 may compare the actual exercise intensity of the user during the first time period and the previous time period of the first time period. If the difference between the exercise intensities calculated for these two consecutive time periods is greater than a preset threshold, the electronic device 100 may not correct the heart rate to be verified during the first time period using the expected heart rate range calculated based on the exercise intensity during the first time period. Specifically, the electronic device 100 may use the detected heart rate obtained in the previous time period as the detected heart rate for the first time period. That is, the electronic device 100 may display the detected heart rate obtained in the previous time period in the heart rate display box 252A on the display screen during the first time period.

[0219] Among them, the actual exercise intensity of the user during a certain time period is related to the movement displacement of each joint point of the user during this time period and the frequency of completing actions. If the difference in the movement displacement of each joint point and the frequency of completing actions of the user in two consecutive time periods is large. For example, if the user was performing relatively gentle stretching exercises in the previous time period and fast jumping exercises in the subsequent time period, the difference in the exercise intensities calculated by the electronic device 100 for these two time periods may be large. If the difference in the exercise intensities calculated for two consecutive time periods is too large, the exercise intensity ranges of these two consecutive time periods may show a mutation. Consequently, the expected heart rate range calculated using the above exercise intensity range will also show a mutation. That is, the difference in the expected heart rate ranges of these two consecutive time periods is large. Then, after the electronic device 100 corrects the heart rate to be verified using the expected heart rate range, it may cause the detected heart rates of these two consecutive time periods to show a mutation. However, the human heart rate changes slowly. The heart rate generally does not show a mutation within two consecutive time periods. Therefore, when the electronic device 100 determines that the exercise intensity of the user has mutated within two consecutive time periods, it may not correct the heart rate to be verified using the expected heart rate range to avoid errors in the detected heart rate.

[0220] It can be understood that the above Figure 7 shown heart rate detection method can be particularly implemented in a scenario where the actual exercise intensity of the user changes gradually to improve the accuracy of heart rate detection by the electronic device during the user's exercise.

[0221] In some embodiments, the electronic device 100 may estimate the change in the heart rate of the target user based on the change in the actual exercise intensity of the target user in two consecutive time periods, and then determine the expected heart rate range of the target user in the current time period.

[0222] It can be understood that the actual exercise intensity of a user can be used to estimate the user's heart rate. If the actual exercise intensity of the user in the current time period is higher than that in the previous time period, the change trend of the user's heart rate from the previous time period to the current time period is often upward. Moreover, the higher the actual exercise intensity in the current time period is than that in the previous time period, the faster the rising rate of the user's heart rate is often. If the actual exercise intensity of the user in the current time period is lower than that in the previous time period, the change trend of the user's heart rate from the previous time period to the current time period is often downward. Moreover, the lower the actual exercise intensity in the current time period is than that in the previous time period, the faster the falling rate of the user's heart rate is often.

[0223] The following specifically introduces another method for determining the expected heart rate range of a target user provided by the embodiments of the present application.

[0224] (1) Determine the expected heart rate change amount range of the target user.

[0225] The expected heart rate change amount range of the target user within the first time period can represent the expected change amount of the heart rate of the target user within the first time period. The electronic device 100 can calculate the expected heart rate range of the target user within the first time period according to the detected heart rate within the previous time period of the first time period and the expected heart rate change amount range within the first time period.

[0226] A heart rate change rate model can be stored in the electronic device 100. The heart rate change rate model can be used to represent the mapping relationship between the heart rate change rate v and the exercise intensity change amount ΔQ. The heart rate change rate model can be determined according to the relationship between the heart rate change rate v and the exercise intensity change amount ΔQ reflected by a large amount of data.

[0227] In a possible implementation manner, the electronic device 100 can adjust the above heart rate change rate model according to the relationship between the heart rate change rate and the exercise intensity change amount in the historical exercise data of the target user. The adjusted heart rate change rate model can be better applicable to the target user. In this way, the electronic device 100 can calculate a more accurate expected heart rate change amount range, thereby better improving the accuracy of heart rate detection.

[0228] The embodiments of the present application do not limit the method for determining the above heart rate change rate model.

[0229] Figure 8 An exemplary schematic diagram of a relationship between the heart rate change rate v and the exercise intensity change amount ΔQ in the above heart rate change rate model is shown. The above heart rate change rate model can be a functional relationship: v = f(ΔQ). The embodiments of the present application do not limit the specific expression of the above functional relationship.

[0230] Among them, the heart rate change rate v can be used to reflect the speed of heart rate change over a period of time. The exercise intensity change amount ΔQ can be the difference obtained by subtracting the actual exercise intensity of the target user in the previous time period from the actual exercise intensity of the target user in the current time period.

[0231] It can be seen from Figure 8 that when the actual exercise intensity change amount of the target user in the current time period and the previous time period is determined, the electronic device 100 can determine the heart rate change rate of the target user in the current time period according to the heart rate change rate model. Figure 8 This is only an example of the relationship between the heart rate change rate and the exercise intensity change amount in the heart rate change rate model, and does not limit the specific content of the heart rate change rate model.

[0232] In a possible implementation manner, the electronic device 100 can determine the heart rate change rate interval of the target user in the current time period according to the determined heart rate change rate in the current time period. The electronic device 100 can calculate the expected heart rate change amount interval of the target user in the current time period according to the heart rate change rate interval.

[0233] Among them, the heart rate change rate interval can be [heart rate change rate - μ, heart rate change rate + μ].

[0234] In a possible implementation manner, the value of μ above can be preset according to experience. Among them, the value of μ can be a value greater than 0 and less than or equal to 10.

[0235] In another possible implementation manner, the electronic device 100 can determine the value of μ according to the magnitude of the actual exercise intensity of the user in the current time period. The value of μ can be negatively correlated with the actual exercise intensity of the user in the current time period.

[0236] When the electronic device uses a non-contact heart rate detection method to detect the user's heart rate, if the captured face image of the user is blurred, the probability of error in the calculated heart rate to be verified is relatively high. And the blurring of the face image is mainly caused by the user performing exercises with a relatively high exercise intensity. For example, when the user jumps quickly, the face image captured by the electronic device is often blurred. Then when the probability of error in the heart rate to be verified is relatively high, the electronic device can increase the probability of correcting the heart rate to be verified using the expected heart rate interval to improve the accuracy of heart rate detection.

[0237] Among them, the smaller the range of the expected heart rate interval, the higher the accuracy of the expected heart rate interval, the lower the probability that the heart rate to be verified falls within the expected heart rate interval, and the higher the probability that the electronic device corrects the heart rate to be verified. The size of the range of the expected heart rate interval in the first time period can be determined by the value of μ and the time length T of the first time period. The higher the actual exercise intensity of the user within the first time period, the smaller the product of μ and T. The electronic device can determine the value of μ according to the formula μ = g(Q) / T. Among them, g(Q) can represent a functional relationship with the exercise intensity Q as a variable. The specific expression of the functional relationship g(Q) is not limited in the embodiments of the present application.

[0238] Compared with the value of a single heart rate change rate, the above heart rate change rate interval has a higher confidence level. That is, the probability that the actual heart rate change amount of the user falls within the expected heart rate change amount interval calculated according to the above heart rate change rate interval is higher. In this way, the electronic device 100 can improve the accuracy of calculating the heart rate change amount of the user within the current time period.

[0239] When the heart rate change rate interval of the target user within the current time period is determined, the electronic device 100 can calculate the expected heart rate change amount interval of the target user within the current time period in combination with the time length T of the current time period. Specifically, the expression for calculating the expected heart rate change amount interval can be: expected heart rate change amount interval = heart rate change rate interval * T = [(heart rate change rate - μ) * T, (heart rate change rate + μ) * T].

[0240] Exemplarily, the electronic device 100 determines that the actual exercise intensity of the target user within the first time period is 0.3 according to the method for calculating the actual exercise intensity of the target user in the foregoing embodiments. The electronic device 100 also determines that the actual exercise intensity of the target user within the previous time period of the first time period is 0.1. Then the electronic device 100 can determine that the exercise intensity change amount of the target user within the first time period is 0.2. According to the above heart rate change rate model, the electronic device 100 can determine that the heart rate change rate corresponding to ΔQ being 0.2 is 2 bpm / s. μ in the above heart rate change rate interval is 1 bpm / s. The time length of the first time period is 1 s. Then the electronic device 100 can determine that the expected heart rate change amount interval of the target user within the first time period is [1, 3].

[0241] The specific values of the above exercise intensity change amount, the value of μ, and the length of the first time period are all for exemplary illustration and do not limit the manner of determining the expected heart rate change amount interval of the target user within the first time period in the embodiments of the present application.

[0242] (2) Determine the expected heart rate interval of the target user.

[0243] When the expected heart rate change range of the target user within the first time period is determined, the electronic device 100 can calculate the expected heart rate range of the target user in combination with the detected heart rate in the previous time period of the first time period.

[0244] Specifically, the second time period is the previous time period of the first time period during the target user's exercise. If the actual exercise intensity of the target user within the first time period is higher than the actual exercise intensity within the second time period, the electronic device 100 can calculate the expected heart rate range of the target user within the first time period: the expected heart rate range within the first time period = the detected heart rate in the second time period + the expected heart rate change range.

[0245] If the actual exercise intensity of the target user within the first time period is lower than the actual exercise intensity within the second time period, the electronic device 100 can calculate the expected heart rate range of the target user within the first time period: the expected heart rate range within the first time period = the detected heart rate in the second time period - the expected heart rate change range.

[0246] In some embodiments, the above-mentioned first time period is an initial time period during the target user's exercise. The electronic device 100 can calculate the expected heart rate range of the target user in combination with the target user's resting heart rate. Specifically, the expected heart rate range within the first time period can be the sum of the target user's resting heart rate and the expected heart rate change range.

[0247] According to the method for determining the expected heart rate range of the target user described above, another heart rate detection method provided by the embodiments of the present application will be introduced below.

[0248] Figure 9 Exemplarily shows a flowchart of a heart rate detection method. As Figure 9 shown, this heart rate detection method may include steps S201 to S211. Among them:

[0249] Steps S201 to S203 are mainly methods for the electronic device 100 to determine the target user, obtain the personal information of the target user, and collect images of the target user during exercise. Steps S201 to S203 can refer to steps S101 to S103 in the method shown above Figure 7 and will not be elaborated here.

[0250] Step S204 is a method for the electronic device 100 to calculate the heart rate to be verified of the target user. This step can refer to step S104 in the method shown above Figure 7 and will not be elaborated here.

[0251] Steps S205 to S208 are methods for the electronic device 100 to calculate the expected heart rate range of the target user. The method for calculating the expected heart rate range of the target user here can refer to the method in the foregoing embodiments for determining the expected heart rate range of the target user according to the change in the actual exercise intensity of the target user in two consecutive time periods, which will not be elaborated here.

[0252] Steps S209 to S211 are methods for the electronic device 100 to verify the verified heart rate of the target user according to the expected heart rate range of the target user and correct the verified heart rate with errors to obtain the detected heart rate of the target user. Steps S209 to S211 can refer to steps S107 to S109 in the method shown above. Figure 7 which will not be elaborated here.

[0253] From Figure 9 the heart rate detection method shown, the electronic device can calculate the change amount of the target user's heart rate according to the actual change in the exercise intensity of the target user. Based on the detected heart rate in the previous time period, the electronic device can calculate the expected heart rate range of the target user in the current time period and verify the verified heart rate calculated in the current time period with this expected heart rate range. The above heart rate detection method can reduce the interference of user exercise on heart rate detection and improve the accuracy of heart rate detection. Thus, the detected heart rate obtained by the user is more meaningful for the user as a reference.

[0254] In some embodiments, the electronic device 100 can combine Figure 7 and Figure 9 the heart rate detection methods shown. For example, if it is detected that the difference in the exercise intensity of the user between the first time period and the previous time period does not exceed the preset threshold, the electronic device 100 can determine the expected heart rate range of the first time period according to Figure 7 the heart rate detection method shown and verify the verified heart rate according to this expected heart rate range. If it is detected that the difference in the exercise intensity of the user between the first time period and the previous time period exceeds the preset threshold, the electronic device 100 can determine the expected heart rate range of the first time period according to Figure 9 the heart rate detection method shown and verify the verified heart rate according to this expected heart rate range.

[0255] Figure 10 Exemplarily shows a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.

[0256] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0257] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0258] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0259] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.

[0260] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0261] The charging management module 140 is configured to receive a charging input from a charger. Herein, the charger may be a wireless charger or a wired charger.

[0262] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as the battery capacity, the number of battery cycles, and the battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.

[0263] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.

[0264] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0265] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation.

[0266] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.

[0267] The electronic device 100 implements the display function through the GPU, the display screen 194, the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0268] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel may adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0269] The electronic device 100 may implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor, etc.

[0270] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light passes through the lens and is transmitted to the image sensor of the camera. The light signal is converted into an electrical signal, and the image sensor of the camera transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image through algorithms. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.

[0271] The camera 193 is used to capture still images or videos. An object generates an optical image through the lens and projects it onto the image sensor. The image sensor can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The image sensor converts the light signal into an electrical signal and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as RGB or YUV. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0272] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0273] The video codec is used to compress or decompress digital videos. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0274] The NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission pattern between human brain neurons, it can quickly process the input information and can also continuously learn by itself. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, speech recognition, text understanding, etc.

[0275] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.

[0276] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.). The data storage area can store the data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0277] The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor, etc. For example, music playback, recording, etc.

[0278] The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.

[0279] The speaker 170A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or hands-free calls through the speaker 170A.

[0280] The receiver 170B, also known as the "earpiece", is used to convert an audio electrical signal into a sound signal. When the electronic device 100 answers a call or a voice message, the voice can be listened to by bringing the receiver 170B close to the human ear.

[0281] The microphone 170C, also known as the "microphone", "transmitter", is used to convert a sound signal into an electrical signal.

[0282] The headphone interface 170D is used to connect a wired headphone.

[0283] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0284] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0285] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0286] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0287] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0288] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0289] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 utilizes the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In some other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In some other embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0290] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as the "touch display screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In some other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from that of the display screen 194.

[0291] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys. They can also be touch keys. The electronic device 100 can receive key inputs and generate key signal inputs related to the user settings and function control of the electronic device 100.

[0292] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playing, etc.) can correspond to different vibration feedback effects. Touch operations acting on different regions of the display screen 194 can also correspond to different vibration feedback effects for the motor 191. Different application scenarios (such as time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0293] The indicator 192 can be an indicator light and can be used to indicate the charging state, power change, and can also be used to indicate messages, missed calls, notifications, etc.

[0294] The SIM card interface 195 is used to connect the SIM card.

[0295] not limited to Figure 10For the components shown, the electronic device 100 may include more or fewer components. In the embodiments of the present application, the electronic device 100 may be a television, a mobile phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a portable multimedia player (PMP), a dedicated media player, an AR (augmented reality) / VR (virtual reality) device, or other types of electronic devices. The embodiments of the present application do not limit the specific category of the electronic device 100.

[0296] In the embodiments of the present application, the electronic device acquires a first image of a first user in a first time period. The first image may include multiple frames of images acquired by the camera in the first time period.

[0297] The electronic device determines a first heart rate range of the first user in the first time period based on the first exercise intensity of the first user in the first image. Among them, the electronic device may determine the first exercise intensity according to the method for calculating the actual exercise intensity of the user during exercise in the foregoing embodiments. The first heart rate range may be the expected heart rate range of the first user in the first time period in the foregoing embodiments. The specific method for the electronic device to determine the first heart rate range may also refer to the foregoing embodiments.

[0298] In the embodiments of the present application, the electronic device determines that the first exercise intensity belongs to a first exercise intensity range. The first exercise intensity range is obtained by dividing the exercise intensity span of the human body. In a possible implementation manner, the exercise intensity of the human body may be divided into three ranges: a low-intensity range, a medium-intensity range, and a high-intensity range. The value of the exercise intensity in the low-intensity range may be greater than or equal to 0 and less than 0.5. The value of the exercise intensity in the medium-intensity range may be greater than 0.5 and less than 0.75. The value of the exercise intensity in the high-intensity range may be greater than 0.75 and less than or equal to 1. The embodiments of the present application do not limit the method for dividing the exercise intensity of the human body.

[0299] In the embodiments of the present application, the electronic device may determine the first heart rate range based on the first exercise intensity range to which the first exercise intensity belongs. Among them, the electronic device takes the resting heart rate of the first user as a reference and offsets it in the direction of increasing heart rate by a first range to obtain the first heart rate range. In a possible implementation manner, the first heart rate range may be the heart rate range obtained by multiplying the difference between the maximum heart rate and the resting heart rate by the first exercise intensity range and then adding the resting heart rate. The first range is the range obtained by multiplying the difference between the maximum heart rate and the resting heart rate by the first exercise intensity range.

[0300] As used in the foregoing embodiments, depending on the context, the term "when" may be construed to mean "if" or "after" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "when determining" or "if detecting (the stated condition or event)" may be construed to mean "if determining" or "in response to determining" or "when detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)".

[0301] In the foregoing embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.

[0302] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the foregoing embodiments can be completed by computer programs instructing relevant hardware. The programs can be stored in a computer-readable storage medium. When the programs are executed, they can include the processes of the foregoing method embodiments. The foregoing storage medium includes various media that can store program codes, such as ROM or random access memory RAM, magnetic disks, or optical discs.

Claims

1. A heart rate detection method, characterized in that, The method includes: The electronic device obtains a first image of a first user in a first time period; The electronic device determines a first heart rate range of the first user in the first time period based on a first exercise intensity of the first user in the first image, where the first exercise intensity is determined based on movement displacements of each joint point of the first user in the first image in the first time period and a frequency of actions completed by the first user in the first time period; The electronic device determines a first heart rate of the first user in the first time period based on a face image of the first user in the first image; When the electronic device determines that the first heart rate is included in the first heart rate range, the electronic device displays the first heart rate; When the electronic device determines that the first heart rate is not included in the first heart rate range, the electronic device displays a second heart rate; the second heart rate is included in the first heart rate range.

2. The method according to claim 1, wherein When the electronic device determines that the first heart rate is not included in the first heart rate range, the electronic device displays a second heart rate; The second heart rate being included in the first heart rate range specifically includes: When the electronic device determines that the first heart rate is less than a minimum value of the first heart rate range, the electronic device displays the second heart rate; The second heart rate is any value in the first half of the first heart rate range; When the electronic device determines that the first heart rate is greater than a maximum value of the first heart rate range, the electronic device displays the second heart rate; the second heart rate is any value in the second half of the first heart rate range.

3. The method according to claim 1 or 2, characterized in that, The method further includes: The electronic device obtains a second image of the first user in a second time period; the second time period is before the first time period; The electronic device determines a resting heart rate of the first user based on a face image of the first user in the second image.

4. The method according to claim 3, wherein The electronic device determining the first heart rate range of the first user in the first time period based on the first exercise intensity of the first user in the first image specifically includes: The electronic device determines that the first exercise intensity belongs to a first exercise intensity range; the first exercise intensity range is obtained by dividing the span of the exercise intensity of the human body; The electronic device offsets in the direction of increasing heart rate with the resting heart rate as a reference to obtain the first heart rate range; Wherein, the offset range is a first range; the greater the average exercise intensity of the first exercise intensity range, the greater the average heart rate of the first range; the greater the size of the first exercise intensity range, the wider the range width of the first range.

5. The method according to claim 4, characterized in that The greater the difference between the maximum heart rate of the first user and the resting heart rate of the first user, the greater the average heart rate of the first range.

6. The method according to claim 1 or 2, characterized in that, The electronic device determining the first heart rate range of the first user in the first time period based on the first exercise intensity of the first user in the first image specifically includes: The electronic device obtains the second exercise intensity and the third heart rate of the first user during a third time period; the third time period is the time period immediately preceding the first time period, the second exercise intensity is the exercise intensity of the first user in a second image, the second image is an image of the first user during the third time period, and the third heart rate is included in the heart rate range determined by the electronic device based on the second exercise intensity; The electronic device offsets based on the third heart rate to obtain the first heart rate range; Wherein, the offset range is a second range, and the greater the difference between the first exercise intensity and the second exercise intensity, the greater the average heart rate of the second range.

7. The method according to claim 3, characterized in that The electronic device determines the first heart rate range of the first user during the first time period based on the first exercise intensity of the first user in the first image, specifically including: The electronic device obtains the second exercise intensity and the third heart rate of the first user during a third time period; the third time period is the time period immediately preceding the first time period, the second exercise intensity is the exercise intensity of the first user in a second image, the second image is an image of the first user during the third time period, and the third heart rate is included in the heart rate range determined by the electronic device based on the second exercise intensity; The electronic device offsets based on the third heart rate to obtain the first heart rate range; Wherein, the offset range is a second range, and the greater the difference between the first exercise intensity and the second exercise intensity, the greater the average heart rate of the second range.

8. The method according to claim 6, characterized in that The electronic device offsets based on the third heart rate to obtain the first heart rate range, specifically including: The electronic device determines that the first exercise intensity is higher than the second exercise intensity, and the electronic device offsets based on the third heart rate in the direction of increasing heart rate to obtain the first heart rate range; The electronic device determines that the first exercise intensity is lower than the second exercise intensity, and the electronic device offsets based on the third heart rate in the direction of decreasing heart rate to obtain the first heart rate range.

9. The method according to claim 7, wherein The electronic device offsets based on the third heart rate to obtain the first heart rate range, specifically including: The electronic device determines that the first exercise intensity is higher than the second exercise intensity, and the electronic device offsets based on the third heart rate in the direction of increasing heart rate to obtain the first heart rate range; The electronic device determines that the first exercise intensity is lower than the second exercise intensity, and the electronic device offsets based on the third heart rate in the direction of decreasing heart rate to obtain the first heart rate range.

10. The method according to claim 3, wherein The first time period and the second time period are adjacent time periods. The electronic device determines the first heart rate range of the first user during the first time period based on the first exercise intensity of the first user in the first image, specifically including: The electronic device offsets based on the resting heart rate in the direction of increasing heart rate to obtain the first heart rate range; Among them, the range of the offset is the second range, and the greater the first exercise intensity, the greater the average heart rate of the second range.

11. The method according to claim 6, wherein The range width of the second range is negatively correlated with the magnitude of the first exercise intensity.

12. The method according to any one of claims 7-10, characterized in that, The range width of the second range is negatively correlated with the magnitude of the first exercise intensity.

13. The method according to any one of claims 1, 2, 4, 5, 7-11, characterized in that The first exercise intensity is further determined by the electronic device based on one or more of the following: the age of the first user, the gender of the first user, the body fat percentage of the first user, the standard exercise data of the fitness course; the fitness course is used to provide exercise guidance for the first user, and the standard exercise data of the fitness course includes the exercise intensity of the coach in the fitness course.

14. The method according to claim 3, wherein The first exercise intensity is further determined by the electronic device based on one or more of the following: the age of the first user, the gender of the first user, the body fat percentage of the first user, the standard exercise data of the fitness course; the fitness course is used to provide exercise guidance for the first user, and the standard exercise data of the fitness course includes the exercise intensity of the coach in the fitness course.

15. The method according to claim 6, wherein The first exercise intensity is further determined by the electronic device based on one or more of the following: the age of the first user, the gender of the first user, the body fat percentage of the first user, the standard exercise data of the fitness course; the fitness course is used to provide exercise guidance for the first user, and the standard exercise data of the fitness course includes the exercise intensity of the coach in the fitness course.

16. The method according to claim 12, characterized in that, The first exercise intensity is further determined by the electronic device based on one or more of the following: the age of the first user, the gender of the first user, the body fat percentage of the first user, the standard exercise data of the fitness course; the fitness course is used to provide exercise guidance for the first user, and the standard exercise data of the fitness course includes the exercise intensity of the coach in the fitness course.

17. The method according to any one of claims 1, 2, 4, 5, 7-11, 14-16, characterized in that Before the electronic device acquires the first image of the first user in the first time period, the method further includes: The electronic device determines that the first user is the target user; the target user is a user who needs the electronic device to acquire a face image and perform heart rate detection, and the target user includes one or more users.

18. The method according to claim 3, characterized in that Before the electronic device acquires the first image of the first user in the first time period, the method further includes: The electronic device determines that the first user is the target user; the target user is a user who needs the electronic device to acquire a face image and perform heart rate detection, and the target user includes one or more users.

19. The method according to claim 6, characterized in that, Before the electronic device acquires the first image of the first user in the first time period, the method further includes: The electronic device determines that the first user is the target user; the target user is a user who needs the electronic device to acquire a face image and perform heart rate detection, and the target user includes one or more users.

20. The method according to claim 12, wherein Before the electronic device acquires the first image of the first user in the first time period, the method further includes: The electronic device determines that the first user is the target user; the target user is a user who requires the electronic device to acquire a face image and perform a heart rate detection, and the target user includes one or more users.

21. The method according to claim 13, wherein Before the electronic device acquires the first image of the first user in the first time period, the method further includes: The electronic device determines that the first user is the target user; the target user is a user who requires the electronic device to acquire a face image and perform a heart rate detection, and the target user includes one or more users.

22. An electronic device, characterized in that, Including: An image acquisition device, a memory, and one or more processors; The image acquisition device is configured to acquire an image of a user; The memory is configured to store a computer program; the one or more processors are configured to call the computer program, so that the electronic device executes the method according to any one of claims 1-21.

23. A computer storage medium, characterized in that, Including: Computer instructions; when the computer instructions run on an electronic device, the electronic device is caused to execute the method according to any one of claims 1-21.

24. A computer program product, characterized in that, When the computer program product runs on an electronic device, the electronic device is caused to execute the method according to any one of claims 1-21.

Citation Information

Patent Citations

  • Heart rate measurement method and system

    CN105943016A

  • Method and device for monitoring and alarming

    CN106448055A

  • Indoor exercise observation apparatus and method based on body feeling technology, and storage medium

    CN107392939A