Heart rate detection method and electronic device

CN122642866APending Publication Date: 2026-08-28HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510237474.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

但是PPG的信号质量容易受到运动噪声或者低温环境的影响,从而影响心率检测的准确性

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122642866A_ABST
    Figure CN122642866A_ABST
Patent Text Reader

Abstract

The application provides a heart rate detection method and an electronic device. In the method, the electronic device obtains first data of a user, and determines a first heart rate value according to the first data. When the first heart rate value does not satisfy a preset condition, the electronic device obtains second data of the user, determines a second heart rate value according to the second data, and the second data is related to a heart rate detection scene. The electronic device performs fusion processing on the first heart rate value and the second heart rate value, and determines a target heart rate value. Through the scheme, when the electronic device detects the heart rate of the user, if the first heart rate value determined based on the first data is inaccurate, the electronic device can obtain the second data related to the heart rate detection scene, generate the second heart rate value based on the second data, and generate the target heart rate value according to the first heart rate value and the second heart rate value, so that the inaccurate heart rate value can be calibrated in combination with the heart rate detection scene, and the accuracy of heart rate detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a heart rate detection method and electronic device. Background Technology

[0002] When a user wears a wearable device, the device can detect the user's heart rate. Heart rate detection in wearable devices relies on optical principles, using photoplethysmography (PPG) to detect changes in blood flow and thus determine the user's heart rate. However, the signal quality of PPG is easily affected by motion noise or low temperatures, thus impacting the accuracy of heart rate detection. Summary of the Invention

[0003] This application provides a heart rate detection method and electronic device to improve the accuracy of heart rate detection.

[0004] Firstly, this application provides a heart rate detection method, which can be executed by an electronic device. In this method, the electronic device acquires first data from a user and determines a first heart rate value based on the first data. When the first heart rate value does not meet a preset condition, the electronic device acquires second data from the user and determines a second heart rate value based on the second data, wherein the second data is related to the heart rate detection scenario. The electronic device performs a fusion process on the first heart rate value and the second heart rate value to determine a target heart rate value.

[0005] In the above method, when the electronic device detects the user's heart rate, if the first heart rate value determined based on the first data is inaccurate, the electronic device can obtain second data related to the heart rate detection scenario, generate a second heart rate value based on the second data, and then generate a target heart rate value based on the first and second heart rate values. In this way, the inaccurate heart rate value can be calibrated in combination with the heart rate detection scenario, thereby improving the accuracy of heart rate detection.

[0006] In one possible design, determining the second heart rate value based on the second data includes: determining the second heart rate value based on a target detection model using the second data. Through this design, the electronic device can determine the second heart rate value based on a personalized target detection model to obtain a heart rate value based on the second data. This second heart rate value can be used to calibrate the first heart rate value, thereby improving the accuracy of heart rate detection.

[0007] In one possible design, before determining the second heart rate value based on the target detection model using the second data, the method further includes: determining a heart rate detection scenario and obtaining the target detection model corresponding to the heart rate detection scenario. Through this design, the target detection model obtained by the electronic device is related to the heart rate detection scenario, thereby making the second heart rate value generated by the target detection model more closely match the user's heart rate detection scenario, thus ensuring the accuracy of the second heart rate value.

[0008] In one possible design, acquiring the user's second data includes: acquiring the second data according to the heart rate detection scenario; or acquiring multiple candidate data and selecting the second data from the multiple candidate data according to the heart rate detection scenario. Through this design, the electronic device can acquire the second data according to the heart rate detection scenario, thereby acquiring different second data in different heart rate detection scenarios, making the second heart rate value generated based on the second data more suitable for the current heart rate detection scenario.

[0009] In one possible design, determining the first heart rate value based on the first data includes: determining the first heart rate value and its corresponding confidence level based on a general heart rate detection model using the first data; wherein, the first heart rate value does not meet a preset condition if the confidence level corresponding to the first heart rate value is less than a first preset threshold. Through this design, the electronic device can determine the confidence level corresponding to the first heart rate value, which represents the accuracy of the first heart rate value. When the confidence level corresponding to the first heart rate value is less than the first preset threshold, the first heart rate value can be considered inaccurate. In this case, the electronic device can calibrate the first heart rate value to ensure the accuracy of heart rate detection.

[0010] In one possible design, obtaining the target detection model corresponding to the heart rate detection scenario includes: obtaining the model parameters of the target detection model corresponding to the target scenario type from multiple detection model parameters corresponding to multiple scenario types stored locally, or obtaining the model parameters of the target detection model corresponding to the target scenario type from the server; and generating the target detection model based on the model parameters of the target detection model.

[0011] In one possible design, the multiple scene types include at least one motion scene, and / or, everyday scene.

[0012] In one possible design, the second data includes at least one of the user's motion data, physiological characteristic data, or environmental data. With this design, the electronic device, when generating a second heart rate value, can consider the impact of motion, physiological characteristics, and environment on the user's heart rate from multiple perspectives, thereby ensuring the accuracy of the second heart rate value based on abundant second data.

[0013] In one possible design, the user's exercise data includes at least one of pace, cadence, exercise duration, exercise distance, swimming strokes, swimming style data, treadmill data, and number of racket swings in ball sports; the physiological characteristic data includes at least one of sleep data, blood oxygen data, blood pressure data, basal metabolic rate, and body fat percentage; and the environmental data includes at least one of altitude, air pressure, temperature, and humidity.

[0014] In one possible design, the method further includes: determining a training sample data set and a test sample data set from a sample data set, the sample data set including the user's historical detection data; training a regression model based on the training sample data set; performing detection on the trained detection model based on the test sample data set; and determining that the training of the detection model is complete when the detection accuracy of the trained detection model is greater than or equal to a second preset threshold. Through this design, the electronic device can train the detection model based on stored historical detection data to obtain a personalized heart rate detection model for the user, ensuring the accuracy of the detection model in heart rate detection.

[0015] In one possible design, determining the training sample data set and the test sample data set from the sample data set includes: determining a valid sample data set from the sample data set, wherein each valid sample data set includes multiple sets of data, and the number of data sets with a confidence level greater than or equal to a third preset threshold is greater than or equal to a fourth preset threshold; determining the data set with the largest number of data sets with a confidence level greater than or equal to the third preset threshold and a confidence level greater than or equal to a fifth preset threshold as the test sample data set; and determining the valid sample data set other than the test sample data set as the training sample data set.

[0016] In one possible design, the process of fusing the first heart rate value and the second heart rate value to determine the target heart rate value includes: weighting the first heart rate value and the second heart rate value according to a first weight value corresponding to the first heart rate value and a second weight value corresponding to the second heart rate value to determine the target heart rate value; wherein, the first weight value corresponding to the first heart rate value is related to the confidence level corresponding to the first heart rate value. Through this design, when fusing the first heart rate value and the second heart rate value, the electronic device can determine the weight value of the first heart rate value based on the confidence level corresponding to the first heart rate value, avoiding the influence of the less accurate first heart rate value on the accuracy of the target heart rate value.

[0017] Secondly, this application provides an electronic device comprising multiple functional modules; the multiple functional modules interact to implement the methods performed by the electronic device in any of the above aspects and their respective embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on specific implementations.

[0018] Thirdly, this application provides an electronic device including at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the electronic device is running, the at least one processor executes any of the above aspects and the methods executed by the electronic device in its various embodiments.

[0019] Fourthly, this application also provides a computer program product containing instructions that, when the computer program product is run on a computer, cause the computer to perform the method executed by the server or electronic device in any of the above aspects and their respective embodiments.

[0020] Fifthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a computer, causes the computer to perform the method executed by the server or electronic device in any of the above aspects and embodiments.

[0021] Sixthly, this application also provides a chip for reading a computer program stored in a memory and executing the method performed by a server or electronic device in any of the above aspects and their embodiments.

[0022] Seventhly, this application also provides a chip system including a processor for supporting a computer device in implementing the methods performed by a server or electronic device in any of the above aspects and their embodiments. In one possible design, the chip system further includes a memory for storing programs and data necessary for the computer device. The chip system may be composed of chips or may include chips and other discrete devices. Attached Figure Description

[0023] Figure 1 A schematic diagram illustrating heart rate detection using a wearable device;

[0024] Figure 2 A schematic diagram illustrating a scenario applicable to a heart rate detection method provided in this application embodiment;

[0025] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0026] Figure 4A software structure block diagram of an electronic device provided in an embodiment of this application;

[0027] Figure 5 A heart rate detection method provided in this application embodiment;

[0028] Figure 6 A schematic diagram of a heart rate display provided in an embodiment of this application;

[0029] Figure 7 A schematic diagram illustrating model training as provided in an embodiment of this application;

[0030] Figure 8 This is a schematic diagram of the architecture of a heart rate detection system provided in an embodiment of this application;

[0031] Figure 9 A flowchart illustrating a heart rate detection method provided in an embodiment of this application;

[0032] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings. In the description of the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include one or more of that feature.

[0034] It should be understood that in the embodiments of this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c can be single or multiple.

[0035] When a user wears a wearable device, the wearable device's heart rate detection function can be used to detect the user's heart rate. During heart rate detection, the wearable device uses photoplethysmography (PPG) to detect changes in blood flow, thereby determining the user's heart rate value. However, PPG signals are easily affected by motion noise or low temperatures, thus affecting the accuracy of heart rate detection. For example, Figure 1 A schematic diagram illustrating heart rate detection in a wearable device, for reference. Figure 1 In (a), when the user wears the wearable device normally, the PPG sensor in the wearable device can collect PPG signals and detect the user's heart rate value based on the PPG signals, while the reference... Figure 1 In scenario (b), when the wearable device is not in close contact with the user's skin, the input light from the PPG sensor is reflected by the epidermis and skin surface, with only a small amount of input light reaching the dermis. Furthermore, the PPG sensor is easily affected by ambient light in this scenario, resulting in a weaker effective pulse signal received by the wearable device, leading to inaccurate heart rate readings. Similarly, when a user's body temperature is low, the nervous system closes superficial capillaries and constricts blood vessels in the dermis to maintain core body temperature, causing a decrease in blood flow to the user's wrist and a reduction in vascular bed perfusion. Consequently, the effective pulse signal carried back by the input light emitted by the PPG sensor after penetrating the skin is weaker, also affecting the accuracy of heart rate detection.

[0036] To address the aforementioned problems, this application provides a heart rate detection method. This method can be executed by an electronic device, and optionally, it can also be executed by both an electronic device and a server. Figure 2 This is a schematic diagram illustrating a scenario applicable to a heart rate detection method provided in this application embodiment. (Refer to...) Figure 2 This scenario includes electronic devices, and optionally, it may also include a server. The electronic devices may be wearable devices, and the server may be a device cloud server provided by the electronic device manufacturer, or it may be an application cloud server for a heart rate detection application. The server can be implemented by a cluster of computing devices, which may include at least one computing device. When the cluster includes multiple computing devices, each of the multiple computing devices may perform the same function or perform different functions to implement the heart rate detection method provided in this application embodiment. This application embodiment does not limit this aspect.

[0037] In the heart rate detection method provided in this application embodiment, an electronic device acquires first data from a user and determines a first heart rate value based on the first data. When the first heart rate value does not meet a preset condition, the electronic device acquires second data from the user and determines a second heart rate value based on the second data, wherein the second data is related to the heart rate detection scenario. The electronic device performs fusion processing on the first heart rate value and the second heart rate value to determine a target heart rate value. Through this scheme, when the electronic device detects a user's heart rate, if the first heart rate value determined based on the first data is inaccurate, the electronic device can acquire second data related to the heart rate detection scenario, generate a second heart rate value based on the second data, and then generate a target heart rate value based on the first and second heart rate values. This allows for calibration of inaccurate heart rate values ​​by combining the heart rate detection scenario, thereby improving the accuracy of heart rate detection.

[0038] The following describes an electronic device and embodiments for using such an electronic device. The electronic device in this application embodiment can be a wearable device, or it can also be a tablet computer, mobile phone, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. This application embodiment does not impose any limitations on the specific type of electronic device.

[0039] In some embodiments of this application, the electronic device may also be a portable terminal device that includes other functions such as a personal digital assistant and / or a music player. Exemplary embodiments of the portable terminal device include, but are not limited to, devices equipped with... Or portable terminal devices with other operating systems.

[0040] Figure 3 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application. Figure 3As shown, 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 jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0041] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. Processor 110 may also include memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that processor 110 has recently used or is repeatedly used. If processor 110 needs to reuse an instruction or data, it can directly retrieve it from the memory. This avoids repeated access, reduces the waiting time of processor 110, and thus improves system efficiency.

[0042] USB interface 130 is a USB standard compliant interface, specifically a Mini USB interface, Micro USB interface, USB Type-C interface, etc. USB interface 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. Charging management module 140 receives charging input from the charger. Power management module 141 connects battery 142, charging management module 140, and processor 110. Power management module 141 receives input from battery 142 and / or charging management module 140, providing power to processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.

[0043] The wireless communication function of electronic device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0044] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, 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 via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0045] The wireless communication module 160 can provide solutions for wireless communication applications on 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), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0046] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0047] The display screen 194 is used to display the display interface of an application, such as the display page of an application installed on the electronic device 100. The display screen 194 includes a display panel. The display panel can be 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 one or N display screens 194, where N is a positive integer greater than 1.

[0048] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0049] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system and software code for at least one application program. The data storage area may store data generated during the use of electronic device 100 (e.g., captured images, recorded videos, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0050] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, images, videos, and other files can be saved on the external memory card.

[0051] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0052] The sensor module 180 may include a pressure sensor 180A, an acceleration sensor 180B, a touch sensor 180C, etc.

[0053] The pressure sensor 180A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194.

[0054] Touch sensor 180C, also known as a "touch panel," can be located on display screen 194. The touch sensor 180C and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180C detects touch operations applied to or near it. 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 display screen 194. In other embodiments, touch sensor 180C may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0055] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button inputs and generate key signal inputs related to user settings and function control. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, touch operations applied to different applications (such as taking photos, audio playback, etc.) can correspond to different vibration feedback effects. Touch vibration feedback effects can also be customized. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with electronic device 100.

[0056] Understandable Figure 3The components shown do not constitute a specific limitation on the electronic device 100. The electronic device may also include more or fewer components than shown, or combine some components, or separate some components, or have different component arrangements. Furthermore, Figure 3 The combination / connection relationships between the components can also be adjusted and modified.

[0057] Figure 4 This is a software structure block diagram of an electronic device provided in an embodiment of this application. For example... Figure 4 As shown, the software architecture of an electronic device can be a layered architecture. For example, the software can be divided into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom: the application layer, the application framework layer (framework, FWK), the runtime and system libraries, and the kernel layer.

[0058] The application layer can include a series of application packages. For example... Figure 4 As shown, the application layer may include a camera, settings, skin modules, user interface (UI), third-party applications, etc. Third-party applications may include gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, etc. In this embodiment, the application layer may further include a heart rate detection application. The heart rate detection application includes a model parameter calculation module and a heart rate calibration module. The model parameter calculation module is used to train the model based on the user's historical data to determine the model parameters of the heart rate detection model. The heart rate calibration module is used to obtain the user's second data when the first heart rate value detected based on the first data does not meet preset conditions, determine a second heart rate value based on the target detection model using the second data, and fuse the first and second heart rate values ​​to obtain a target heart rate value.

[0059] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer can include some predefined functions. For example... Figure 4As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager. In this embodiment, the application framework layer includes a data storage module and a data interaction module. The data storage module can store the user's historical data, such as heart rate values ​​detected at multiple times and user characteristic data. The data storage module can also store model parameters of the heart rate detection model, including the general heart rate detection model and the personalized heart rate detection model described in the above embodiments of this application. The data interaction module is used to send the historical data stored in the electronic device and the model parameters of the heart rate detection model to the server, or to obtain the model parameters of the heart rate detection model from the server.

[0060] The window manager is used to manage windowed applications. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture screenshots. The content provider stores and retrieves data, making this data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0061] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0062] A phone manager is used to provide communication functions for electronic devices. For example, it manages call status (including connection and disconnection).

[0063] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0064] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0065] The runtime includes the core libraries and the virtual machine. The runtime is responsible for the scheduling and management of the operating system.

[0066] The core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part contains the core libraries of the operating system. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0067] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), image processing libraries, etc.

[0068] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0069] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0070] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0071] A 2D graphics engine is a graphics engine for 2D drawing.

[0072] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0073] The hardware layer can include various types of sensors, such as accelerometers, gyroscopes, and touch sensors.

[0074] It should be noted that, Figure 3 and Figure 4 The structure shown is merely an example of an electronic device provided in this application embodiment and is not intended to limit the electronic device provided in this application embodiment in any way. In specific implementations, the electronic device may have more than Figure 3 or Figure 4 The structure shown may contain more or fewer devices or modules.

[0075] The heart rate detection method provided in the embodiments of this application is described below. Figure 5 This application provides a heart rate detection method, which can be executed by an electronic device. (Refer to...) Figure 5 The method may include the following steps:

[0076] S501: The electronic device acquires the user's first data and determines the first heart rate value based on the first data.

[0077] In the heart rate detection method provided in this application embodiment, when the electronic device detects the user's heart rate, it can acquire the user's first data, which can be PPG signal data, such as data collected by the electronic device through a PPG sensor. The electronic device can determine a first heart rate value based on the first data, such as determining the first heart rate value based on a general heart rate detection model, which is a model used for heart rate detection based on PPG signals.

[0078] S502: When the first heart rate value does not meet the preset conditions, the electronic device determines the current heart rate detection scenario.

[0079] When the first heart rate value does not meet the preset conditions, the electronic device can calibrate the first heart rate value using the personalized heart rate detection model provided in this application embodiment. Optionally, when determining the first heart rate value based on the first data, the electronic device can input the first data into a general heart rate detection model and obtain the first heart rate value output by the general heart rate detection model and the confidence level corresponding to the first heart rate value. The confidence level corresponding to the first heart rate value is used to indicate the accuracy of the first heart rate value. The first heart rate value not meeting the preset conditions can be that the confidence level corresponding to the first heart rate value is less than a first preset threshold. The first preset threshold can be empirical data set by a technician. When the confidence level corresponding to the first heart rate value is less than the first preset threshold, the first heart rate value can be considered inaccurate.

[0080] Optionally, the electronic device determines the current heart rate detection scenario, which may include exercise scenarios and daily scenarios. The electronic device can determine the scenario in which the user is when heart rate detection is triggered. For example, before starting exercise, the user can select an exercise in the electronic device's exercise application. The electronic device can determine the heart rate detection scenario based on the selected exercise. Alternatively, the electronic device can acquire data collected by sensors and determine whether the user is currently in an exercise state and the type of exercise based on the data collected by the sensors, thereby determining the heart rate detection scenario. For example, when the electronic device detects that the user is in an exercise state, the current heart rate detection scenario is an exercise scenario. Or, when the electronic device detects that the user is not in an exercise state, such as when the user is asleep or at rest, the electronic device can determine that the current heart rate detection scenario is a daily scenario. Optionally, the heart rate detection scenario in this embodiment may also include at least one exercise scenario corresponding to at least one type of exercise. When the user is engaged in different types of exercise activities, the type of exercise scenario determined by the electronic device may be different. For example, the electronic device may determine the heart rate detection scenario as a running exercise scenario, a swimming exercise scenario, etc.

[0081] S503: Electronic device acquires second data from the user.

[0082] In one optional implementation, when the first heart rate value does not meet a preset condition, the electronic device can acquire second data from the user. This second data can be data related to the current heart rate detection scenario. Optionally, when the heart rate detection scenario in this embodiment includes at least one exercise scenario corresponding to at least one type of exercise, the type of second data acquired by the electronic device will be different depending on the exercise scenario.

[0083] Optionally, the second data may include at least one of the user's exercise data, physiological characteristic data, or environmental data. The exercise data may include at least one of the following: pace, cadence, exercise duration, exercise distance, swimming strokes, swimming style data, treadmill data, and number of racket swings in ball sports. When acquiring exercise data, the electronic device may obtain the exercise data corresponding to the user's current activity type. For example, when the user is running, the second data acquired by the electronic device may include pace, cadence, exercise duration, and exercise distance; when the user is swimming, the second data acquired by the electronic device may include pace, swimming strokes, swimming style data, exercise distance, and exercise duration; when the user is cycling, the second data acquired by the electronic device may include pace, cadence data, exercise duration, and exercise distance. The user's physiological characteristic data may include sleep data, blood oxygen data, blood pressure data, basal metabolic rate, body fat percentage, etc. This physiological characteristic data can be collected by the electronic device, or it can be collected by other electronic devices associated with the electronic device, or it can be physiological characteristic data input by the user into the electronic device. These other electronic devices can be those logged into with the same user account. Environmental data may include altitude, air pressure, temperature, humidity, etc. In some embodiments, the electronic device can also acquire the user's physiological characteristic data and environmental data according to the current heart rate detection scenario. For example, the electronic device can pre-store the types of physiological characteristic data and environmental data that may affect the user's heart rate under different heart rate detection scenarios. When the electronic device acquires the user's physiological characteristic data and environmental data, it can acquire the corresponding type of data according to the current heart rate detection scenario.

[0084] In this embodiment, the electronic device can acquire second data based on the heart rate detection scenario. The electronic device can pre-store the feature data types corresponding to different heart rate detection scenarios. When the electronic device determines the heart rate detection scenario, it can acquire the second data based on the pre-stored feature data types corresponding to different heart rate scenarios. For example, when the electronic device determines that the heart rate detection scenario is a daily scenario, it can acquire the user's physiological feature data and environmental data as the second data. As another example, when the electronic device determines that the heart rate detection scenario is a running exercise scenario, it can acquire the user's exercise data, physiological feature data, and environmental data as the second data. Among them, the exercise data includes pace, cadence, exercise duration, and exercise distance.

[0085] Optionally, the electronic device can also acquire multiple candidate data, including at least one of the user's exercise data, physiological characteristic data, and environmental data. The electronic device can determine the second data from the multiple candidate data according to the heart rate detection scenario. For example, the electronic device can pre-store the feature data types corresponding to different heart rate detection scenarios. After the electronic device determines the heart rate detection scenario and acquires multiple candidate data, it can determine the second data from the multiple candidate data.

[0086] S504: Target detection model for scenarios where electronic devices acquire heart rate detection.

[0087] In this embodiment, after acquiring the second data, the electronic device can determine the user's second heart rate value based on the target detection model. Optionally, the target detection model is a personalized heart rate detection model provided in this embodiment, and the electronic device can store the model parameters of the target detection model. In some examples, the electronic device can store the model parameters of one detection model, which can be used for heart rate detection in at least one sports scenario and / or, daily scenarios. In other examples, the electronic device can store the model parameters of multiple detection models, which correspond one-to-one with the scenario types of multiple heart rate detection scenarios. For example, the multiple detection models include at least one detection model corresponding to at least one sports scenario and a detection model corresponding to a daily scenario. When the electronic device stores the model parameters of multiple detection models, it can obtain the model parameters of the target detection model corresponding to the current heart rate detection scenario from the multiple detection model parameters and generate a target detection model based on the obtained model parameters of the target detection model.

[0088] In some implementations, the model parameters of the detection model stored in the electronic device can also be model parameters obtained by the electronic device from the server. The electronic device can train the model locally and send the model parameters to the server after training is complete, thereby achieving server-side backup of the model parameters. Alternatively, the server can train the model and store the model parameters after training is complete. When the electronic device obtains the model parameters of the target detection model, if the electronic device does not store the model parameters locally, it can obtain the model parameters of the target detection model from the server, or it can obtain the model parameters of multiple detection models from the server and then determine the target detection model from the multiple detection models. Optionally, when the electronic device is reset, disconnected from the network, or otherwise lost, after the electronic device reconnects to the network, it can obtain the model parameters of multiple detection models from the server and store the obtained model parameters of multiple detection models in its local storage space for subsequent user heart rate detection.

[0089] S505: The electronic device generates a second heart rate value based on the second data and a target detection model.

[0090] In this embodiment of the application, the electronic device can input the second data into the target detection model and obtain the second heart rate value output by the target detection model.

[0091] S506: The electronic device fuses the first heart rate value and the second heart rate value to determine the target heart rate value.

[0092] After determining the user's second heart rate value, the electronic device can fuse the first and second heart rate values. Optionally, the electronic device can weight the first and second heart rate values ​​based on a first weight value corresponding to the first heart rate value and a second weight value corresponding to the second heart rate value to determine the target heart rate value; wherein, the first weight value corresponding to the first heart rate value is related to the confidence level corresponding to the first heart rate value. For example, the first heart rate value, the second heart rate value, and the target heart rate value can satisfy the following relationship:

[0093] y t =x1*a + x2*b + bias

[0094] Among them, y t Let be the target heart rate value at time t, a be the first heart rate value, b be the second heart rate value, x1 be the first weight value corresponding to the first heart rate value, and x2 be the second weight value corresponding to the second heart rate value. x1 and x2 are both positive numbers greater than or equal to 0, and x1 + x2 = 1. x1 can be correlated with the confidence level corresponding to the first heart rate value; for example, the confidence level can be divided into multiple levels, such as c1, c2, ... c... nWhen the confidence level corresponding to the first heart rate value is higher, the value of the first weight value x1 corresponding to the first heart rate value will also be larger. For example, x1 and the first confidence level c corresponding to the first heart rate value can satisfy the following relationship:

[0095]

[0096] Among them, l1, l2…l n For different values, l1 <l2<…<l n c1 <c2<…<c n .

[0097] The bias term is used to smooth the fused heart rate values ​​and prevent sudden changes in heart rate values ​​within a short period of time. The bias can satisfy the following relationship:

[0098] bias = -s*[(x1*a+x2*b)-y] t-1 ]

[0099] Where s is the smoothing coefficient, 0 ≤ s ≤ 1, and the closer s is to 0, the weaker the smoothing effect. t-1 The heart rate value at time t is the value at the time preceding time t.

[0100] It should be noted that the method of determining the first weight value corresponding to the first heart rate value in the above embodiments is only an example and not a limitation. In practice, the first weight value and the second weight value can also be determined in other ways. For example, the first weight value can be determined by combining the current heart rate detection scenario or other heart rate data (such as the average heart rate value in the previous few seconds), or the first weight value and the second weight value can be determined based on artificial intelligence (AI) models. This application embodiment does not limit this.

[0101] S507: Electronic device displays target heart rate value.

[0102] In this embodiment, after determining the target heart rate value, the electronic device can display the target heart rate value on a screen for the user. Optionally, when displaying the calibrated heart rate value, the electronic device can display an indicator near the heart rate value to indicate that the heart rate value is calibrated using a personalized heart rate detection model. For example, Figure 6 A schematic diagram of a heart rate display provided in an embodiment of this application is shown below. Figure 6 In (a), the electronic device can display a target heart rate of 90, and the electronic device displays a marker near the heart rate value of 90. After the user clicks on the marker, the electronic device can display... Figure 6 The interface shown in (b) is used to remind the user that the heart rate value of 90 is a heart rate value calibrated based on a personalized heart rate detection model, such as... Figure 6The interface shown in (b) may include "The current heart rate detection is less accurate due to the low temperature. The displayed heart rate value is the value after personalized heart rate calibration".

[0103] In this embodiment, after determining the target heart rate value, the electronic device can store the first data, the second data, and the target heart rate value as historical data. The electronic device can update and train the heart rate detection model based on the stored historical data, or the electronic device can send the historical data to a server, which will then update and train the heart rate detection model based on the historical data. Optionally, when different heart rate detection scenarios correspond to different heart rate detection models, sample data for training different heart rate detection models can be obtained from the historical data during model training, and multiple heart rate detection models can be trained separately.

[0104] This application also provides a training method for a general heart rate detection model and a personalized heart rate detection model. The model training process can be performed by an electronic device or by a server, such as... Figure 7 This is a schematic diagram of model training provided in an embodiment of this application, with reference to... Figure 7 In (a) of this example, the electronic device can perform model training tasks locally. For instance, the electronic device can perform model training tasks when idle, and it can locally store the model parameters obtained after training. When it needs to detect the user's heart rate, the electronic device can retrieve the model parameters from local storage and perform heart rate detection on the user. (See reference) Figure 7 In (b) of this example, after the electronic device performs the model training task locally, it can send the model parameters obtained after training to the server. The server can store the model parameters, and the electronic device can retrieve the model parameters from the server to achieve backup of the model parameters on the server and ensure the data security of the model parameters. (See reference) Figure 7 In (c), the electronic device can also send the sample data set to the server, the server performs the model training task, and the server can store the model parameters obtained after the model training is completed. When it is necessary to detect the user's heart rate, the electronic device can obtain the model parameters from the server to reduce the computing power pressure on the electronic device.

[0105] The following section uses the example of an electronic device performing a model training task to describe the methods for training a general heart rate detection model and a personalized heart rate detection model in the embodiments of this application.

[0106] When training a general heart rate detection model, the electronic device can use a dataset of sample data for training. Each sample data can include PPG signal data and heart rate value. The electronic device can use the PPG signal data from each sample data as input to train the initial model to be trained, and obtain the predicted value and confidence score of the model output. The confidence score is calculated based on the predicted value and the heart rate value in the sample data. The electronic device can perform multiple rounds of model training based on the sample dataset. When the electronic device determines that the number of training rounds is greater than or equal to a preset threshold, it can determine that the training has ended. Alternatively, the electronic device can calculate the loss value between the predicted heart rate value output by the trained general heart rate detection model and the heart rate value in the sample data according to a preset loss function. When the loss value converges, the electronic device can determine that the training has ended, thus obtaining the general heart rate detection model.

[0107] When an electronic device trains a personalized heart rate detection model, the sample data used for training can be the user's historical data. After detecting the user's heart rate, the electronic device can store the data related to this heart rate detection and use this data for training or updating the personalized heart rate detection model. For example, each data point in the user's historical data can include the user's heart rate value, and can also include at least one of the user's exercise data, physiological characteristic data, or environmental data. The electronic device can filter the sample data set for training from the historical data set. For example, the electronic device can filter the historical data based on the storage time, the number of groups, and the time corresponding to the high-confidence heart rate values ​​in each group of data. Here, high confidence can be defined as a confidence level greater than or equal to a third preset threshold. After obtaining the sample data set, the electronic device can determine the training sample data set and the test sample data set from the sample data set. Optionally, the electronic device can determine the valid sample data set from the sample data set. Each valid sample data in the valid sample data set includes multiple groups of data, and the number of high-confidence heart rate values ​​in each group of data is greater than or equal to a fourth preset threshold. The electronic device selects the most numerous high-confidence heart rate values ​​from the effective sample data set. It then uses the data with a confidence level greater than or equal to a fifth preset threshold as the test sample data set. The electronic device uses the remaining effective sample data from the effective sample data set as the training sample data set. The electronic device can train the initial model based on a regression model using the training sample data set. It then performs detection on the trained model using the test sample data set. For example, the electronic device calculates the difference between the predicted value output by the trained detection model and the actual heart rate value in the test sample data, and calculates the number of data points where this difference is less than a sixth preset threshold. The ratio of this number to the number of samples in the test sample data set is used as the detection accuracy of the trained detection model. When the detection accuracy is greater than or equal to a second preset threshold, the training of the detection model is considered complete.

[0108] It should be noted that different detection scenarios in this application embodiment can correspond to different personalized heart rate detection models. Therefore, when the electronic device trains the model, it can train the personalized heart rate detection model corresponding to each detection scenario based on different training sample data. The training method can be referred to in the above embodiments, and the repeated parts will not be described again. In addition, the electronic device can also store the user's heart rate detection data and update and train the personalized heart rate detection model based on the stored data, so that the personalized heart rate detection model is more in line with the user's characteristics and further improves the accuracy of heart rate detection.

[0109] This application also provides a heart rate detection system, such as... Figure 8This is a schematic diagram of the architecture of a heart rate detection system provided in an embodiment of this application, with reference to... Figure 8 The heart rate detection system includes an electronic device and a server. The electronic device can be a wearable device, and the server can be a cloud data platform. Optionally, the electronic device may include a data storage module, a data interaction module, a model parameter calculation module, and a heart rate calibration module. The data storage module can be used to store the user's historical data, such as heart rate values ​​detected at multiple times and the user's feature data. The data storage module can also be used to store model parameters of the heart rate detection model, including the general heart rate detection model and the personalized heart rate detection model described in the above embodiments of this application. The data interaction module is used to send the historical data stored in the electronic device and the model parameters of the heart rate detection model to the server, or to obtain the model parameters of the heart rate detection model from the server. The model parameter calculation module is used to train the model based on the user's historical data to determine the model parameters of the heart rate detection model. The heart rate calibration module is used to obtain the user's second data when the first heart rate value detected based on the first data does not meet the preset conditions, determine the second heart rate value based on the target detection model based on the second data, and fuse the first heart rate value and the second heart rate value to obtain the target heart rate value, so as to calibrate the first heart rate value with low accuracy. The server includes a data storage module and a model parameter calculation module. The data storage module can be used to store historical data of users reported by electronic devices and model parameters of the heart rate detection model, or it can be used to store model parameters of the heart rate detection model trained by the server. The model parameter calculation module is used to train the model based on the user's historical data to determine the model parameters of the heart rate detection model.

[0110] Based on the above embodiments, Figure 9 This is a flowchart illustrating a heart rate detection method provided in an embodiment of this application. The method can be executed by an electronic device, which may have... Figure 8 The structure of the electronic device in the heart rate detection system shown is referenced. Figure 9 The method includes the following steps:

[0111] S901: The electronic device acquires the user's first data and determines the first heart rate value based on the first data.

[0112] Optionally, the electronic device can determine a first heart rate value based on a general heart rate detection model using the first data, and the electronic device can also obtain the confidence level corresponding to the first heart rate value output by the general heart rate detection model.

[0113] S902: When the first heart rate value does not meet the preset conditions, the electronic device acquires the user's second data and determines the second heart rate value based on the second data.

[0114] The second data is related to the heart rate detection scenario, which may include at least one exercise scenario and daily scenario. The second data may include at least one of the user's exercise data, physiological characteristic data, or environmental data.

[0115] Optionally, the first heart rate value not meeting the preset condition can be that the confidence level corresponding to the first heart rate value is less than the first preset threshold.

[0116] In one optional implementation, the electronic device determines a second heart rate value based on second data. This can be achieved by the electronic device generating the second heart rate value based on a target detection model corresponding to the heart rate detection scenario, using the second data. The electronic device can obtain model parameters of the target detection model corresponding to the heart rate detection scenario from multiple model parameters and generate a target detection model based on these parameters. These multiple model parameters can be model parameters stored locally by the electronic device or model parameters obtained from a server.

[0117] S903: The electronic device fuses the first heart rate value and the second heart rate value to determine the target heart rate value.

[0118] Optionally, the electronic device can perform weighted processing on the first heart rate value and the second heart rate value according to the first weight value corresponding to the first heart rate value and the second weight value corresponding to the second heart rate value to determine the target heart rate value, wherein the first weight value corresponding to the first heart rate value is related to the confidence level corresponding to the first heart rate value.

[0119] It is understood that the content of S901-S903 can refer to the content of S501-S507. For example, S901 can refer to the content of S501, S902 can refer to the content of S502-S505, and S903 can refer to the content of S506. They will not be repeated here.

[0120] In this embodiment, the electronic device can also store the target heart rate value, the first data, and the second data in local storage space for use in updating and training the personalized heart rate detection model; or the electronic device can also upload the target heart rate value, the first data, and the second data to a server for use in updating and training the personalized heart rate detection model. The training process of the personalized heart rate detection model can be performed by... Figure 8 The data storage module and model parameter calculation module in the electronic device shown are executed, or can be performed by... Figure 8 The data storage module and model parameter calculation module in the server shown are executed.

[0121] It should be noted that, Figure 9 The heart rate detection method in the illustrated embodiment can be referred to the foregoing embodiment for specific implementation, and repeated details will not be repeated.

[0122] This application also provides an electronic device. For example... Figure 10 As shown, the electronic device 1000 includes: a bus 1002, a processor 1004, a memory 1006, and a communication interface 1008. The processor 1004, the memory 1006, and the communication interface 1008 communicate with each other via the bus 1002. It should be understood that this application does not limit the number of processors and memories in the electronic device 1000.

[0123] Bus 1002 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 10 The bus 1002 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 1002 may include a path for transmitting information between various components of the electronic device 1000 (e.g., memory 1006, processor 1004, communication interface 1008).

[0124] The processor 1004 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0125] The memory 1006 may include volatile memory, such as random access memory (RAM). The processor 1004 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0126] The memory 1006 stores executable program code, and the processor 1004 executes the executable program code to implement the functions executed by the virtual machine in the aforementioned embodiments, thereby realizing the memory allocation method provided in this application embodiment. That is, the memory 1006 stores instructions for executing the memory allocation method.

[0127] Alternatively, the memory 1006 stores executable program code, and the processor 1004 executes the executable program code to implement the functions executed by the virtual machine in the embodiments of this application, thereby realizing the memory allocation method provided in the embodiments of this application.

[0128] The communication interface 1008 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable the virtual machine to receive or send data.

[0129] Based on the above embodiments, this application also provides a server, including multiple functional modules; the multiple functional modules interact with each other to implement the functions performed by the server in the various methods described in the embodiments of this application. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on specific implementations.

[0130] Based on the above embodiments, this application also provides a server, which includes at least one processor and at least one memory, wherein the at least one memory stores computer program instructions, and when the server is running, the at least one processor performs the functions performed by the server in the various methods described in the embodiments of this application.

[0131] Based on the above embodiments, this application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the methods described in the embodiments of this application.

[0132] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a computer, causes the computer to perform the methods described in the embodiments of this application.

[0133] Based on the above embodiments, this application also provides a chip for reading computer programs stored in a memory to implement the methods described in the embodiments of this application.

[0134] Based on the above embodiments, this application provides a chip system including a processor for supporting a computer device in implementing the methods described in the embodiments of this application. In one possible design, the chip system further includes a memory for storing necessary programs and data of the computer device. This chip system may be composed of chips or may include chips and other discrete devices.

[0135] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0136] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0137] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0138] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0139] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of protection of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A heart rate detection method, characterized in that, The method, applied to electronic devices, includes: Obtain the user's first data and determine the first heart rate value based on the first data; When the first heart rate value does not meet the preset conditions, the user's second data is obtained, and a second heart rate value is determined based on the second data. The second data is related to the heart rate detection scenario. The first heart rate value and the second heart rate value are fused together to determine the target heart rate value.

2. The method as described in claim 1, characterized in that, Determining the second heart rate value based on the second data includes: The second heart rate value is determined based on the second data using a target detection model.

3. The method as described in claim 2, characterized in that, Before determining the second heart rate value based on the target detection model using the second data, the method further includes: Determine the heart rate detection scenario and obtain the target detection model corresponding to the heart rate detection scenario.

4. The method as described in claim 3, characterized in that, The acquisition of the user's second data includes: The second data is obtained according to the heart rate detection scenario; or Acquire multiple candidate data, and select the second data from the multiple candidate data according to the heart rate detection scenario.

5. The method according to any one of claims 1-4, characterized in that, Determining the first heart rate value based on the first data includes: Based on the first data, the first heart rate value and the confidence level corresponding to the first heart rate value are determined using a general heart rate detection model. Wherein, the first heart rate value does not meet the preset conditions, including the confidence level corresponding to the first heart rate value being less than the first preset threshold.

6. The method as described in claim 3 or 4, characterized in that, The step of obtaining the target detection model corresponding to the heart rate detection scenario includes: The model parameters of the target detection model corresponding to the target scene type are obtained from multiple detection model parameters corresponding to multiple scene types stored locally, or the model parameters of the target detection model corresponding to the target scene type are obtained from the server. The target detection model is generated based on the model parameters of the target detection model.

7. The method as described in claim 6, characterized in that, The various scene types include at least one sports scene, and / or, everyday scene.

8. The method according to any one of claims 1-7, characterized in that, The second data includes at least one of the user's motion data, physiological characteristic data, or environmental data.

9. The method as described in claim 8, characterized in that, The user's exercise data includes at least one of pace, cadence, exercise duration, exercise distance, swimming strokes, swimming style data, treadmill data, and number of racket swings in ball sports. The physiological characteristic data includes at least one of sleep data, blood oxygen data, blood pressure data, basal metabolic rate, and body fat percentage. The environmental data includes at least one of altitude, air pressure, temperature, and humidity.

10. The method according to any one of claims 1-9, characterized in that, The method further includes: A training sample data set and a test sample data set are determined from the sample data set, wherein the sample data set includes the user's historical data; The detection model is trained based on the training sample data set and tested using the test sample data set. When the detection accuracy of the trained detection model is greater than or equal to a second preset threshold, the training of the detection model is considered complete.

11. The method as described in claim 10, characterized in that, The step of determining the training sample data set and the test sample data set from the sample data set includes: A valid sample data set is determined from the sample data set. Each valid sample data set includes multiple sets of data. The number of data sets with a confidence level greater than or equal to a third preset threshold is greater than or equal to a fourth preset threshold. The data set containing the most data with a confidence level greater than or equal to the third preset threshold, and the data with a confidence level greater than or equal to the fifth preset threshold, are determined as the test sample data set. The valid sample data in the valid sample data set, excluding the test sample data set, are determined as the training sample data set.

12. The method according to any one of claims 1-11, characterized in that, The step of fusing the first heart rate value and the second heart rate value to determine the target heart rate value includes: The first heart rate value and the second heart rate value are weighted according to the first weight value corresponding to the first heart rate value and the second weight value corresponding to the second heart rate value to determine the target heart rate value; The first weight value corresponding to the first heart rate value is related to the confidence level corresponding to the first heart rate value.

13. An electronic device, characterized in that, It includes at least one processor coupled to at least one memory, the at least one processor being configured to read a program stored in the at least one memory to perform the method as described in any one of claims 1-12.

14. A readable storage medium, characterized in that, The readable storage medium stores instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-12.

15. A computer program product containing instructions, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-12.

16. A chip, characterized in that, The chip is used to read a computer program stored in a memory to execute the method as described in any one of claims 1-12.