Wake-up method and electronic equipment
By controlling the processor to report sensor data in a specific period in an electronic device, the problem of sensor interleaving wake-up processor is solved, and the effect of reducing power consumption is achieved.
Patent Information
- Application Number
- CN202411617033.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-04-18
AI Technical Summary
In the prior art, multiple sensors in the electronic device interlaced to wake up the processor, causing the processor to be woken up multiple times, increasing power consumption.
By controlling the processor to periodically report the data of the first sensor and the second sensor in the first and second cycles, it is ensured that the processor switches from the sleep state to the working state when receiving the reported data, and avoids sensors interleaving to wake up the processor.
This reduces the number of times the processor is awakened, and thus reduces the power consumption of electronic devices.
Smart Images

Figure CN119847313A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a wake-up method and an electronic device. Background Art
[0002] Electronic devices such as smart wearable devices are equipped with a variety of sensors, such as acceleration sensors, heart rate sensors, ambient light sensors, magnetic sensors, air pressure sensors, etc.
[0003] In order to improve the battery life of electronic devices and ensure the user's battery life experience, electronic devices can automatically enter a dormant state. Among them, the electronic device entering a dormant state mainly refers to the processor of the electronic device entering a dormant state. At present, in some scenarios, the sensor in the electronic device can wake up the electronic device in a dormant state, that is, wake up the processor. After being awakened, the processor can execute the corresponding control logic based on the data collected by the sensor.
[0004] In conventional technology, there is a situation where multiple sensors alternately wake up the electronic device, causing the electronic device to be woken up multiple times and increasing power consumption. Summary of the invention
[0005] The embodiments of the present application provide a wake-up method and an electronic device, which can reduce the number of times the electronic device is woken up and reduce the power consumption of the electronic device.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In the first aspect, a wake-up method is provided, which is applied to an electronic device, wherein the electronic device includes a processor, a first sensor and a second sensor, and the processor is in a dormant state. The method includes: controlling to periodically report the first data of the first sensor to the processor in a first cycle from a first moment, and periodically reporting the second data of the second sensor to the processor in a second cycle. When the processor receives the reported data, it is awakened by switching from the dormant state to the working state. Since the second cycle has a multiple relationship with the first cycle, such as an integer multiple relationship, there is a situation where the processor is awakened once and receives data from the first sensor and the second sensor at the same time, which can avoid the first sensor and the second sensor from staggeredly reporting data to the processor to wake up the processor. The number of times the processor is awakened can be reduced, thereby reducing the power consumption of the electronic device.
[0008] That is to say, in the present application, the electronic device includes a wake-up target, a first device, and a second device. The wake-up target is in a dormant state. The electronic device controls, from a first moment onwards, to periodically report first data of the first device to the wake-up target with a first period, and periodically report second data of the second device to the wake-up target with a second period. For example, the wake-up target may be a processor, the first device may be a first sensor, and the second device may be a second sensor.
[0009] In a possible implementation of the first aspect, according to the timing task of the first timer, control is performed to periodically report the first data to the processor with a first period from the first moment, and to periodically report the second data to the processor with a second period. Since the timer has the advantages of being simple to use and low in cost, using the timer to implement this solution can reduce the cost and complexity of the electronic device.
[0010] In a possible implementation of the first aspect, the second cycle is q times the first cycle, and q is an integer greater than or equal to 1. The first timer has the functions of timing and counting. The timing tasks of the first timer include: reporting the first data to the processor when the i-th first timing duration arrives; reporting the second data to the processor when the q*i-th first timing duration arrives. Among them, the first moment is the start time of the first timer, the first timing duration is equal to the first cycle; i takes values in [1,2,3,4,...n] in sequence. Since the second cycle is q times the first cycle, when q is greater than 1, the processor can receive the first data and the second data at the same time when the q*i-th first timing duration arrives. When q is equal to 1, the processor can receive the first data and the second data at the same time when the i-th first timing duration arrives. It can avoid the first sensor and the second sensor from staggeredly reporting data to the processor to wake up the processor. It can reduce the number of times the processor is woken up, thereby reducing the power consumption of the electronic device.
[0011] Optionally, reporting data such as the first data and the second data to the processor may be understood as the first timer triggering the driver of the sensor to report the data to the processor.
[0012] In a possible implementation of the first aspect, the first sensor and the second sensor may be normally-open sensors. A normally-open sensor is a sensor that starts and works automatically when the electronic device is turned on. In some implementations, the reporting capability of the normally-open sensor is turned on by default. During the startup of the electronic device, the electronic device keeps the reporting capability of the first target sensor turned on and turns off the reporting capability of the second target sensor according to multiple cycles corresponding to multiple normally-open sensors. The reporting capability is used for the sensor to actively report sensor data to the processor. The cycle corresponding to the first target sensor is the minimum cycle among the multiple cycles corresponding to the multiple normally-open sensors, and the cycle corresponding to the second target sensor is an integer multiple of the minimum cycle.
[0013] In a possible implementation of the first aspect, the second period is q times the first period, where q is an integer greater than or equal to 1. During the startup of the electronic device, the reporting capability of the second sensor is turned off, and the reporting capability of the first sensor is turned on. When q=1, the electronic device randomly uses one sensor as the first sensor and another sensor as the second sensor.
[0014] In a possible implementation of the first aspect, since the reporting capability of the first sensor is turned on, the electronic device can first obtain the first data reported by the first sensor based on the reporting capability of the first sensor. Afterwards, in response to the first data reported by the first sensor based on the reporting capability of the first sensor, the first timer is started and the reporting capability of the first sensor is turned off. After receiving a first data, if the first timer is turned on again, then after the first cycle, the second first data will be received, and the reporting logic of the first data will not be disrupted, thereby avoiding the acquisition of erroneous first data.
[0015] In a possible implementation of the first aspect, the electronic device further includes a third sensor, and the method further includes: controlling the third sensor to start; controlling the first timer to be turned off from the second moment, periodically reporting the first data of the first sensor to the processor in a first cycle, periodically reporting the second data of the second sensor to the processor in a second cycle, and periodically reporting the third data of the third sensor to the processor in a third cycle; wherein the first cycle and the third cycle have a multiple relationship. Since the first cycle and the third cycle have a multiple relationship, the processor can simultaneously receive any two or all of the first data, the second data, and the third data after being awakened once, which can avoid the sensor from staggeredly reporting data to wake up the processor, reduce the number of times the processor is awakened, and thus reduce the power consumption of the electronic device.
[0016] In a possible implementation manner of the first aspect, the third sensor may be a very open type sensor.
[0017] In a possible implementation of the first aspect, the electronic device controls, based on the timing task of the second timer, to periodically report the first data to the processor with a first period, periodically report the second data to the processor with a second period, and periodically report the third data to the processor with a third period from the second moment. Since the timer has the advantages of being simple to use and low in cost, using the timer to implement this solution can reduce the cost and complexity of the electronic device.
[0018] In a possible implementation of the first aspect, the second period is p times the third period, the first period is m times the third period, p is an integer greater than or equal to 1, and m is an integer greater than or equal to 1. The first timer has the functions of timing and counting. The timing tasks of the second timer include: reporting the third data to the processor when the jth second timing duration arrives; reporting the second data to the processor when the p*jth second timing duration arrives; reporting the first data to the processor when the m*jth second timing duration arrives; wherein the second moment is the start moment of the second timer, and the second timing duration is equal to the third period; j takes values in [1,2,3,4,...n] in sequence.
[0019] Then, in the case where p and m do not have an integer multiple relationship, when the p*jth timing duration arrives, the processor can simultaneously receive data from the second sensor and the third sensor. When the m*jth timing duration arrives, the processor can simultaneously receive data from the first sensor and the third sensor. When the Xth timing duration arrives, the processor can simultaneously receive data from the first sensor, the second sensor, and the third sensor. Wherein, X is a multiple of p*m. In the case where p and m have an integer multiple relationship, for example, when m is an integer multiple of p, when the m*jth timing duration arrives, the processor can simultaneously receive data from the first sensor, the second sensor, and the third sensor. For example, in the case where p is an integer multiple of m, when the p*jth timing duration arrives, the processor can simultaneously receive data from the first sensor, the second sensor, and the third sensor. In the case where p and m are equal, when the p*jth timing duration or the m*jth timing duration arrives, the processor can simultaneously receive data from the first sensor, the second sensor, and the third sensor.
[0020] In a possible implementation of the first aspect, the third period is k times the first period, and k is an integer greater than or equal to 1. The first timer has the functions of timing and counting. The timing tasks of the second timer include: reporting the first data to the processor when the 1*jth second timing duration arrives; reporting the second data to the processor when the q*jth second timing duration arrives; reporting the third data to the processor when the k*jth second timing duration arrives; wherein the second moment is the start moment of the second timer, and the second timing duration is equal to the third period; j takes values in [1,2,3,4,...n] in sequence.
[0021] Then, in the case where q and k do not have an integer multiple relationship, when the q*jth timing duration arrives, the processor can simultaneously receive data from the first sensor and the second sensor. When the k*jth timing duration arrives, the processor can simultaneously receive data from the first sensor and the third sensor. When the Yth timing duration arrives, the processor can simultaneously receive data from the first sensor, the second sensor, and the third sensor, where Y is a multiple of q*k. In the case where q and k have an integer multiple relationship, for example, when q is an integer multiple of k, when the q*jth timing duration arrives, the processor can simultaneously receive data from the first sensor, the second sensor, and the third sensor. For example, when k is an integer multiple of q, when the k*jth timing duration arrives, the processor can simultaneously receive data from the first sensor, the second sensor, and the third sensor. In the case where q and k are equal, when the q*jth timing duration or the k*jth timing duration arrives, the processor can simultaneously receive data from the first sensor, the second sensor, and the third sensor.
[0022] Optionally, data such as the first data, the second data, or the third data is reported to the processor. It can be understood that the second timer triggers the driver of the sensor to report the data to the processor.
[0023] In a possible implementation of the first aspect, the electronic device creates a second timer, starts the second timer at the moment of reporting the first data and the second data, and turns off the first timer. That is, the second moment is the moment of starting the second timer. The duration between the first moment and the second moment may be an integer multiple of the second period.
[0024] In a possible implementation manner of the first aspect, the first timer is modified to the second timer when the first data and the second data are reported.
[0025] In a possible implementation of the first aspect, before controlling to periodically report the first data of the first sensor to the processor with a first period, periodically report the second data of the second sensor to the processor with a second period, and periodically report the third data of the third sensor to the processor with a third period from the second moment onwards, the reporting capability of the third sensor is turned off; the reporting capability is used for the sensor to actively report the sensor data to the processor.
[0026] In a second aspect, the present application provides an electronic device, comprising: a memory, one or more sensors, and one or more processors; the memory, one or more sensors are coupled to the processor; wherein, the one or more sensors are used to collect data; the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device executes any method as in the first aspect.
[0027] In a third aspect, a chip system is provided, which can be applied to an electronic device including a memory. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by a line. The interface circuit is used to receive a signal from the above-mentioned memory and send the signal to the processor, and the signal includes a computer instruction stored in the memory. When the processor executes the computer instruction, the electronic device executes the method as in the first aspect and any possible design thereof.
[0028] According to a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes any one of the methods in the first aspect.
[0029] In a fifth aspect, a computer program product comprises a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of any method in the first aspect are implemented.
[0030] It can be understood that the beneficial effects that can be achieved by the electronic device of any possible design of the second aspect, the chip system of the third aspect, the computer-readable storage medium of the fourth aspect, and the computer program product of the fifth aspect can be referred to as the beneficial effects in the first aspect and any possible design of the electronic device, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A schematic diagram of a data reporting method provided for related technologies;
[0032] Figure 2 Power consumption diagram corresponding to the data reporting method provided for related technologies;
[0033] Figure 3 A schematic diagram of a data reporting method provided in an embodiment of the present application;
[0034] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0035] Figure 5 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0036] Figure 6 A flowchart of a wake-up method provided in an embodiment of the present application;
[0037] Figure 7 A pulse signal comparison diagram provided in an embodiment of the present application;
[0038] Figure 8 A power consumption diagram corresponding to the data reporting method provided in the embodiment of the present application;
[0039] Fig. 9 An interaction diagram of internal modules of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] Electronic devices such as smart wearable devices are equipped with various sensors, such as accelerometers (ACC), heart rate sensors (PPG), ambient light sensors (ALS), magnetic sensors, and air pressure sensors. Among them, ACC is used to measure the acceleration of electronic devices. PPG is used to measure the heart rate of users wearing electronic devices. Ambient light sensors are used to measure the light intensity of the environment in which the electronic device is currently located. Magnetic sensors are used to measure the magnitude and / or direction of the magnetic force in the environment in which the electronic device is located. Air pressure sensors are used to measure the air pressure in the environment in which the electronic device is located. It should be understood that electronic devices may include more or fewer sensors than in the above examples, and the embodiments of the present application do not make specific limitations on this.
[0041] In order to improve the battery life of electronic devices and ensure the battery life experience of users, electronic devices such as processors in electronic devices can automatically enter a sleep state when the sleep conditions are met. Among them, the sleep state can also be called a low power consumption state. In some scenarios, the sensor in the electronic device can wake up the electronic device, that is, wake up the processor of the electronic device. After being awakened, the processor can execute the corresponding control logic based on the data collected by the sensor. Exemplarily, taking the electronic device as a smart wearable device, such as a smart watch, as an example, the processor of the smart watch such as a smart watch is in a sleep state. For example, in some scenarios, ACC sends acceleration data collected by ACC to the processor of the smart watch. In response to receiving the acceleration data, the processor switches from a sleep state to a working state. Afterwards, the processor in the working state can obtain the user's motion information such as exercise duration, average speed and other information based on the acceleration data. Afterwards, the smart watch can store or display the user's motion information.
[0042] Every time a sensor wakes up an electronic device, such as a processor of an electronic device, from a sleep state to a working state, at each moment of waking up, the electronic device will generate an instantaneous maximum current, called a spike current (Wake-up Peak Current). That is to say, when an electronic device switches from a sleep state to a working state, a spike current will be generated. At the moment when the spike current appears, the power consumption of the electronic device will increase instantly. Among them, different sensors can periodically report the data collected by the sensor to the processor according to their corresponding reporting cycles. When the electronic device is dormant, the electronic device will be awakened in order to execute the corresponding control logic. Generally, after executing the corresponding control logic, the electronic device, such as the processor of the electronic device, will re-enter the sleep state. However, since different sensors have different corresponding reporting cycles, there will be a situation where different sensors wake up the electronic device with their respective reporting cycles in an interlaced manner. In this way, the electronic device is awakened multiple times, generating multiple spike currents, which increases the power consumption of the electronic device.
[0043] Take electronic equipment including ACC and PPG as an example, Figure 1 As shown, the reporting period of ACC can be, for example, 500ms, and the reporting period of PPG can be, for example, 1000ms. ACC reports its own collected data once every 500ms from moment t1. PPG reports its own collected data once every 1000ms from moment t2. If the electronic device is in a dormant state before moment t1, and t1 and t2 are not the same moment, then ACC and PPG are turned on at different moments and report the collected data with their respective reporting periods, which will cause the electronic device to be awakened in an interlaced manner. The electronic device will be awakened multiple times. For example, within 10s, ACC will wake up the electronic device 20 times, generate 20 spike currents, and generate 20 power consumption peaks. PPG will wake up the electronic device 10 times, generate 10 spike currents, and generate 10 power consumption peaks. Since ACC and PPG wake up the electronic device at different frequencies in an interlaced manner, the electronic device may be awakened 30 times within 10s, generating 30 spike currents.
[0044] By connecting the electronic device to the power consumption meter, the power consumption curve of the electronic device, ACC and PPG can be obtained. The power consumption curve can be Figure 2 For example, a power consumption curve is a graph showing the relationship between the power consumed by a device (i.e., power consumption) and time. Figure 2As shown in (a), curve 1 is the power consumption curve of PPG, curve 2 is the power consumption curve of ACC, and curve 3 is the power consumption curve of the electronic device. The power consumption peaks in curves 1 and 2 occur when the sensor wakes up the electronic device, that is, when the sensor sends the data collected by the sensor to the processor. In other words, the power consumption of the sensor is low when collecting data, that is, the sensor can collect data in low power mode. When sending the collected data to the processor, the power consumption of the sensor increases. The power peak in curve 3 occurs when the electronic device is awakened, that is, in response to receiving the data reported by the sensor, it switches from the sleep state to the working state. It can be seen from curves 1 and 2 that ACC and PPG wake up the electronic device at different frequencies. It can be seen from curve 3 that in response to each awakening, the power consumption of the electronic device increases instantaneously. Zoom in and observe the power consumption curve of the electronic device, as shown Figure 2 As shown in (b), each power consumption peak includes power consumption spikes. Figure 2 The circled part in (b) and the average power consumption are shown in Figure 2 The circled part in (b) is shown in Figure 1. The power consumption peak is generated by the peak current at the moment of wake-up, and the average power consumption is generated when processing the control logic corresponding to the sensor.
[0045] That is, when the electronic device is in a dormant state, the sensors in the electronic device wake up the dormant electronic device at different frequencies, causing the electronic device to be woken up more times, thereby increasing the power consumption of the electronic device.
[0046] To this end, an embodiment of the present application provides a wake-up method and an electronic device. The electronic device includes a processor, a first sensor, and a second sensor. When the processor is in a dormant state, the electronic device can control the first sensor data to be periodically reported to the processor from the first timer in a first cycle, and control the second sensor data to be periodically reported to the processor in a second cycle. When the processor receives the reported data, it is awakened by switching from the dormant state to the working state. Since the second cycle has a multiple relationship with the first cycle, such as an integer multiple relationship, there is a situation where the processor is awakened once and receives data from the first sensor and the second sensor at the same time, which can avoid the first sensor and the second sensor from staggeredly reporting data to the processor to wake up the processor. The number of times the processor is awakened can be reduced, thereby reducing the power consumption of the electronic device.
[0047] For example, Figure 3As shown in the figure, when the electronic device is in sleep mode, after the alignment reporting cycle, ACC wakes up the electronic device once every 500ms from t3; PPG wakes up the electronic device once every 1000ms from t3. At t4, the electronic device is woken up by ACC, and at t5, the electronic device is woken up by ACC and PPG. Then, within 10s, the electronic device will be woken up 20 times, of which ACC wakes up the electronic device alone 10 times, and ACC and PPG wake up the electronic device at the same time 10 times. Compared with Figure 2 The wake-up method shown, Figure 3 The wake-up method shown can reduce the number of times the electronic device is woken up and reduce the power consumption of the electronic device.
[0048] The method provided in the embodiment of the present application can be applied to an electronic device including a processor and multiple sensors, and the electronic device may include a mobile phone, a tablet computer, a laptop computer, a netbook, a personal digital assistant (PDA), a wearable device (such as a smart watch, a smart bracelet, etc.), a vehicle-mounted device, a virtual reality device, etc., and the embodiment of the present application does not impose any restrictions on this. In the embodiment of the present application, the above-mentioned electronic device is an electronic device that can run an operating system and install application programs. Optionally, the operating system running on the electronic device can be system, system, System, etc. Optionally, the electronic device in the embodiment of the present application may be a smart watch.
[0049] Take the electronic device as a smart watch as an example. Figure 4 As shown, the electronic device 400 may include: a processor 410, a memory 420, a universal serial bus (USB) interface 430, a power management module 440, antennas such as antenna 1 and antenna 2, a communication module 450, a display screen 460, an audio module 470, a camera 480, a sensor 490, etc.
[0050] The processor 410 may include one or more processing units, for example, the processor 410 may include an application processor (AP), a central processing unit (CPU), a modem processor, a graphics processing unit (GPU), an 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 into one or more processors. The controller may be the nerve center and command center of the electronic device 400. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0051] In the embodiment of the present application, the electronic device being in a dormant state can be understood as the processor 410 of the electronic device being in a dormant state. The processor 410 can specifically be a CPU. It can also be other processing units, such as one or more of AP, GPU, etc. The embodiment of the present application takes the processor in the dormant state as an example that the CPU is an example. For example, the state of the CPU includes a dormant state and a working state. The CPU in a dormant state can be awakened by a sensor. For example, a CPU in a dormant state can receive data from a sensor, and in response to the data, the CPU can switch from a dormant state to a working state. In the working state, the CPU can obtain the data of the sensor, perform an algorithm operation on the data, and save or control the display screen 460 to display the data after the operation. Among them, the data after the operation can be, for example, motion data, wearing conditions, and heart rate data. In the case where the electronic device 400 includes multiple sensors, the CPU can also control the periodic awakening of the CPU with the reporting cycle of multiple sensors starting from the same moment.
[0052] The memory 420 can be used to store computer executable program codes, which include instructions. The processor 410 executes various functional applications and data processing of the electronic device by running the instructions stored in the memory 420. The memory 420 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an interface display function, etc.). The data storage area may store data (such as notification messages) created during the use of the electronic device, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0053] In the embodiment of the present application, the memory 420 stores a computer executable program code, and the executable program code includes instructions. The processor 410 executes a wake-up method provided in the embodiment of the present application by running the instructions stored in the memory 420.
[0054] The power management module 440 is used to connect the battery and the processor 410. The power management module 440 receives the battery and / or power input to power the processor 410, the memory 420, the communication module 450, the display screen 460 and the camera 480. The power management module 440 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 440 can also be set in the processor 410.
[0055] The communication module 450 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 400. The communication module 450 can be one or more devices integrating at least one communication processing module. The communication module 450 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 410. The communication module 450 can also receive the signal to be sent from the processor 410, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna.
[0056] In some embodiments, the antenna of the electronic device 400 is coupled to the communication module 450 so that the electronic device 400 can communicate with the network and other devices through 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, global navigation satellite system (GNSS), WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), Beidou navigation satellite system (BDS), global navigation satellite system (GLONASS) and / or Galileo satellite navigation system (GALILEO).
[0057] The electronic device 400 implements the display function through a GPU, a display screen 460, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 460 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 410 may include one or more GPUs, which execute program instructions to generate or change display information.
[0058] The display screen 460 is used to display images, videos, etc. The display screen 460 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-LED, Micro-OLED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc.
[0059] The electronic device 400 can realize the shooting function and the video recording function through the ISP, the camera 480, the video codec, the GPU, the display screen 460 and the application processor.
[0060] The audio module 470 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 470 can also be used to encode and decode audio signals. In some embodiments, the audio module 470 can be arranged in the processor 410, or some functional modules of the audio module 470 can be arranged in the processor 410.
[0061] Camera 480 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. 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, and then transmits the electrical signal to the ISP for conversion 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 standard RGB, YUV and other formats.
[0062] The sensor 490 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a heart rate sensor, and a bone conduction sensor, among others.
[0063] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 400. In other embodiments, the electronic device 400 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0064] Take the electronic device 400 as an example, which is a smartwatch. The software system of the electronic device 400 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 400 is exemplified.
[0065] Figure 5 It is a software structure block diagram of the electronic device 400 according to an embodiment of the present application.
[0066] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. The system is divided into five layers, from top to bottom: application layer, application framework layer, algorithm layer, hardware abstraction layer (HAL) and kernel layer.
[0067] The application layer can include a series of application packages.
[0068] like Figure 5 As shown, the application package may include sports, health, altimeter, compass, Bluetooth, social and other applications.
[0069] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 5 As shown, the application framework layer may include rendering components, communication services, audio services, sports health services, timers, etc. Among them, the rendering component may include a graphical user interface framework, a dial template, fonts, layouts, and views, etc. Communication services may include message services, call services, interconnection, and contacts. Sports health services may include: heart rate services, respiratory pressure, heart health, and blood oxygen services, etc.
[0070] A timer such as the first timer or the second timer may trigger the sensor driver to obtain data collected by the sensor and send the data collected by the sensor to the processor 410 .
[0071] The algorithm layer may include a series of algorithm models and internal libraries. The algorithm layer may include basic libraries, algorithm libraries, and protocol stacks. Among them, the basic library may include a basic C library; the algorithm library may include a wearing detection algorithm, a heart rate algorithm, a breathing algorithm, an audio algorithm, a liveness detection algorithm, a gesture algorithm, a dimming algorithm, a motion algorithm, a blood oxygen algorithm, etc.; the protocol stack may include a traditional Bluetooth protocol stack and a low-power Bluetooth protocol stack.
[0072] In the hardware abstraction layer, all hardware operations required by the upper layer of the system need to call the HAL-related application programming interface. The software architecture layer of each hardware device has some functions specified, and the HAL layer can be used to implement these functions.
[0073] The kernel layer is a layer between hardware and software. The kernel layer may include a touch screen driver, a camera driver, a display driver, a sensor driver, etc. In an embodiment of the present application, the sensor driver may obtain data collected by the sensor. When the reporting capability of the sensor is turned on, the sensor driver may actively send the data collected by the sensor to the processor 410. When the reporting capability of the sensor is turned off, the sensor driver cannot actively send the data collected by the sensor to the processor 410. The sensor driver may send the data collected by the sensor to the processor 410 in response to the triggering of the timer.
[0074] The wake-up method provided in this embodiment may be executed by an electronic device, and specifically may be executed by a processor in the electronic device, and the processor may be, for example, any one of a CPU, an AP, and a GPU.
[0075] In the present application, an electronic device includes a wake-up target, a first device and a second device. Among them, the wake-up target is in a dormant state. The electronic device controls to report the first data of the first device to the wake-up target periodically in a first cycle from the first moment, and to report the second data of the second device to the wake-up target periodically in a second cycle. As an example, the wake-up target can be, for example, a processor, the first device can be a first sensor, and the second device can be a second sensor. When the processor is in a dormant state, the electronic device can control the first data of the first sensor to be reported to the processor periodically in a first cycle from the first moment, and control the second data of the second sensor to be reported to the processor periodically in a second cycle. When the processor receives the reported data, it is switched from the dormant state to the working state and is awakened. Since the second cycle has a multiple relationship with the first cycle, such as an integer multiple relationship, there is a situation where the processor is awakened once and receives the data of the first sensor and the second sensor at the same time, which can avoid the first sensor and the second sensor from staggeredly reporting data to the processor to wake up the processor. The number of times the processor is awakened can be reduced, thereby reducing the power consumption of the electronic device.
[0076] The following takes a smart watch as an example of an electronic device and introduces a wake-up method provided in an embodiment of the present application in conjunction with the accompanying drawings.
[0077] The first sensor and the second sensor are normally-on sensors. The normally-on sensors are sensors that start up and keep working when the smartwatch is turned on. Normally-on sensors are exemplified by the ACC and PPG mentioned above.
[0078] For example, the first sensor is sensor 1, the second sensor is sensor 2, and the processor is CPU. Figure 6 Introduce this program. Figure 6 A flowchart of a wake-up method provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the above method may include:
[0079] S601, the smart watch is turned on, and the CPU turns off the reporting capability of sensor 2; wherein, the reporting capability of sensor 1 is turned on.
[0080] Among them, sensor 1 is the sensor with the smallest reporting period among the multiple normally-on sensors of the smart watch. The reporting period of sensor 1 can be called the minimum reporting period. Sensor 2 includes sensors with a reporting period that is an integer multiple of the aforementioned minimum reporting period among the multiple normally-on sensors of the smart watch.
[0081] When the reporting capability of the sensor is turned on, the sensor periodically reports data to the CPU with the reporting period as the period. When the reporting capability of the sensor is turned off, the sensor cannot report data to the CPU. Among them, the sensor periodically reporting data to the CPU can be understood as the sensor periodically sending the data collected by the sensor to the CPU. Exemplarily, the sensor periodically collects data, and the sensor places the collected data in a buffer. The sensor includes a corresponding sensor driver (hereinafter referred to as the driver), and the sensor periodically reports data to the CPU specifically as: the sensor driver periodically reads data from the buffer and sends data to the CPU. Among them, turning off the reporting capability of the sensor can be understood as turning off the ability of the driver corresponding to the sensor to actively send data to the CPU.
[0082] Among them, in some embodiments, the reporting capability of the normally-on sensors of the smart watch, such as the above-mentioned sensor 1 and sensor 2, is turned on by default. Multiple normally-on sensors correspond to multiple reporting cycles one by one. During the boot process, the CPU keeps the reporting capability of the sensor corresponding to the minimum reporting cycle among the multiple reporting cycles turned on, and the CPU turns off the reporting capabilities of the remaining sensors corresponding to the remaining reporting cycles except the minimum reporting cycle among the multiple reporting cycles. In addition, the reporting cycles of the remaining sensors are integer multiples of the minimum reporting cycle.
[0083] For example, the reporting period of sensor 1 (i.e., the first period) is the minimum reporting period of sensor 1 and sensor 2 (i.e., the second period), such as 500ms. The reporting period of sensor 2 is an integer multiple of the reporting period of sensor 1, such as 1000ms. Therefore, during the boot process, the smart watch keeps the reporting capability of sensor 1 turned on and turns off the reporting capability of sensor 2.
[0084] The CPU can determine whether to disable the sensor's reporting capability based on the following two methods.
[0085] In some examples, the normally-open sensor includes a preset flag bit 1, which uses different identifiers such as 1 or 0 to indicate whether the reporting capability of the sensor needs to be turned off. For example, 1 indicates that the reporting capability is not turned off, and 0 indicates that the reporting capability is turned off. The CPU can determine whether the reporting capability of the sensor needs to be turned off based on the identifier of the preset flag bit 1 of the sensor. Among them, the identifier in the preset flag bit 1 can be pre-configured by the developer based on the reporting cycle of the normally-open sensor. For example, the reporting capability of the normally-open sensor is turned on by default. During the boot process, the CPU reads that the identifier in the preset flag bit 1 of sensor 1 is 1, and the CPU keeps the reporting capability of sensor 1 turned on based on the identifier. The CPU reads that the identifier in the preset flag bit 1 of sensor 2 is 0, and the CPU turns off the reporting capability of sensor 2 based on the identifier.
[0086] In other examples, the CPU can determine whether to turn off the reporting capability of the sensor based on the reporting cycle of the normally-on sensor. For example, the CPU stores the reporting cycles of the normally-on sensors distributed in the smartwatch. The CPU maintains the reporting capability of the sensor corresponding to the minimum reporting cycle among the reporting cycles, and turns off the reporting capability of the sensor corresponding to the reporting cycle that is an integer multiple of the minimum reporting cycle among multiple reporting cycles.
[0087] The above description is based on the example that the reporting capability of the normally open sensor is enabled by default.
[0088] In some other embodiments, the reporting capability of the normally-on sensor may also be disabled by default. In this embodiment, the above S601 may be replaced by: the smartwatch is turned on, and the CPU enables the reporting capability of sensor 1; wherein the reporting capability of sensor 2 is disabled. Similarly, the CPU may identify whether the reporting capability of the sensor needs to be enabled based on the identification in the preset flag or based on the reporting cycle of the normally-on sensor.
[0089] In some other embodiments, the reporting capability of the normally-open sensor can also be configured as on or off by default based on the size of the reporting cycle. For example, based on the reporting cycle of the normally-open sensor, during the development stage, the developer configures the reporting capability of the sensor corresponding to the smallest reporting cycle among multiple normally-open sensors to be on by default, and configures the reporting capability of the sensors whose reporting cycle is an integer multiple of the smallest reporting cycle among multiple normally-open sensors to be off by default. Continuing with the above example, the reporting capability of sensor 1 is configured as on by default, and the reporting capability of sensor 2 is configured as off by default. In this way, when the smart watch is turned on, the reporting capability of the sensor corresponding to the smallest reporting cycle is on, and the reporting capability of the sensor whose reporting cycle is an integer multiple of the smallest reporting cycle is off. In this embodiment, the above S601 can be replaced by: the smartphone is turned on. That is, in this embodiment, the CPU does not need to perform the operation of turning off the reporting capability of sensor 2.
[0090] The aforementioned minimum reporting period refers to the smallest reporting period among multiple reporting periods.
[0091] S602 , the CPU receives first data from sensor 1 .
[0092] After the smartwatch is turned on, sensor 1 is also started synchronously. Since the reporting capability of sensor 1 is in the on state, after sensor 1 is started, sensor 1 can send the first data to the CPU for the first time based on its own reporting capability. For example, considering that the sensor needs a certain amount of time to collect data after starting, the sensor generally reports data to the CPU after a period of time after the sensor is started, such as after a reporting cycle, such as sending the first data for the first time. Among them, the first data is the data collected by sensor 1.
[0093] After executing S601, the CPU can enter a sleep state or remain in a working state. Among them, whether the CPU enters a sleep state or remains in a working state can be judged according to whether the smart watch has not received any operation or other conditions for a long time. For details, please refer to the description of the relevant technology, and this application will not go into details here. If the CPU receives the first data of sensor 1 in a sleep state. In response to the first data, the CPU can first switch from the sleep state to the working state, that is, be awakened. After being awakened, the CPU can execute the method shown in S603. If the CPU receives the first data of sensor 1 in a working state. In response to the first data, the CPU can execute the method shown in S603.
[0094] S603 , in response to the first data of sensor 1 , the CPU turns off the reporting capability of sensor 1 and starts timer 1 .
[0095] As described in the above embodiment, sensor 2 includes a sensor whose reporting period is an integer multiple of the above minimum reporting period among multiple normally-on sensors of the smart watch. Based on this, the reporting period of sensor 1 and the reporting period of sensor 2 satisfy the following relationship: the reporting period of sensor 2 = q times the reporting period of sensor 1. Wherein, q is an integer greater than or equal to 1. For example, sensor 1 is ACC, and its reporting period is 500ms, that is, the first data is reported every 500ms. Sensor 2 is PPG, and its reporting period is 1000ms, that is, the second data is reported every 1000ms. Wherein, q=2. The second data is the data collected by sensor 2. Optionally, when q=1, the CPU randomly selects one of the sensors as sensor 1 and the other sensor as sensor 2.
[0096] Timer 1 (such as the first timer) is used to periodically send the first data to the CPU with the timing duration as a period, and to periodically send the second data to the CPU with q times the timing duration as a period. Among them, the above-mentioned timing duration is the timing duration of timer 1, which is equal to the minimum reporting period of the reporting period of sensor 1 and the reporting period of sensor 2. For example, continuing the above example, the timing duration of timer 1 is equal to the reporting period of sensor 1. q is the ratio of the reporting period of sensor 2 to the reporting period of sensor 1. For example, sensor 1 is ACC, sensor 2 is PPG, and timer 1 is used to periodically send the first data collected by ACC to the CPU with a period of 500ms, and to periodically send the second data collected by PPG to the CPU with a period of 2*500ms, that is, 1000ms. Among them, the periodic sending of data such as the first data or the second data to the CPU by timer 1 can be understood as the timer periodically triggering the driver corresponding to the sensor to send data to the CPU. For example, timer 1 periodically triggers the driver of ACC to send the first data collected by ACC to CPU with a period of 500 ms, and periodically triggers the driver of PPG to send the second data collected by PPG to CPU with a period of 1000 ms.
[0097] For example, timer 1 includes timing and counting functions. After timer 1 is started, timer 1 starts timing, and when the timing duration reaches the timing duration, the timing task is executed and the timing is restarted. When the timing duration reaches the timing duration again, the timing task is executed again and the timing is restarted, and so on. In addition, timer 1 can record the number of timing durations that have been reached. Specifically, timer 1 can add one to the count of timer 1 each time the timing duration reaches the timing duration.
[0098] The CPU may control the first timer to periodically report the first data of the first sensor to the processor in a first cycle, and control the second data of the second sensor to be periodically reported to the processor in a second cycle according to the timing task of the first timer.
[0099] The timing tasks of timer 1 include: when the i-th timing duration arrives, the driver of sensor 1 is triggered to report the first data to the processor; when the q*i-th timing duration arrives, the driver of sensor 2 is triggered to report the second data to the processor; the first timing duration is equal to the first cycle; i takes values in [1,2,3,4,...n] in sequence. Among them, the first moment is the start moment of the first timer.
[0100] Specifically, the timer 1 timing task can be that when the i-th timing duration arrives, the driver of sensor 1 is triggered to obtain the first data collected by sensor 1 and send it to the CPU, and when the q*i-th timing duration arrives, the driver of sensor 2 is triggered to obtain the second data collected by sensor 2 and send it to the CPU. For example, timer 1 is set to trigger the driver of ACC to obtain the first data collected by ACC and send it to the CPU when the i-th 500ms arrives, and trigger the driver of PPG to obtain the second data collected by PPG and send it to the CPU when the 2*i-th 500ms arrives.
[0101] In response to the first first data sent by sensor 1, the CPU turns off the reporting capability of sensor 1 and starts timer 1. For example, sensor 1 is started at time T, and at time T+500ms, the CPU receives the first first data sent by sensor 1. In response to the first data, the CPU turns off the reporting capability of sensor 1 and starts timer 1. From the start time of timer 1, such as time T+500ms, and after the timing duration of timer 1 of 500ms, at time T+1000ms, the CPU can receive the second first data reported by timer 1 again. In this way, the reporting cycle of the first data will not be interrupted, avoiding the CPU from obtaining erroneous first data. In other words, the CPU can create timer 1 during the startup process of the smart watch, and after receiving the first data of sensor 1, in response to the first data, turn off the reporting capability of sensor 1 and start timer 1.
[0102] Optionally, after receiving the first data from the sensor 1 , the CPU turns off the reporting capability of the sensor 1 in response to the first data, and creates and starts the timer 1 .
[0103] Optionally, during the startup of the smartwatch, the CPU may create timer 1, and upon recognizing that sensor 1 and / or sensor 2 are started, start timer 1 and disable the reporting capability of sensor 1. In other words, this application does not specifically limit the time when the CPU starts timer 1.
[0104] S604, from the start time, timer 1 periodically triggers the driver of sensor 1 to send first data to the CPU with the timing duration as a period, and periodically triggers the driver of sensor 2 to send second data to the CPU with q times the timing duration as a period.
[0105] Specifically, timer 1 periodically triggers the driver of sensor 1 to obtain first data with a timing duration as a period from the start time, and sends the first data to the CPU; and periodically triggers the driver of sensor 2 to obtain second data with a timing duration q times as a period, and sends the second data to the CPU. The driver of the sensor can obtain data from a preset buffer, and each sensor corresponds to a preset buffer.
[0106] S605, the CPU periodically receives the first data with the timing duration as a period, and periodically receives the second data with q times the timing duration as a period, starting from the start time of the timer 1.
[0107] Since the reporting capabilities of sensor 1 and sensor 2 are turned off and timer 1 is started, from the start time of timer 1, the driver of sensor 1 periodically sends the first data to the CPU with the timing duration as a period, and the driver of sensor 2 periodically sends the second data to the CPU with q times the timing duration as a period. Then, from the start time of timer 1, the CPU periodically receives the first data with the timing duration as a period, and periodically receives the second data with q times the timing duration as a period.
[0108] For example, after turning on timer 1, the CPU can receive the first data once at an interval of 500ms and the second data once at an interval of 1000ms. Specifically, from the moment when timer 1 is turned on, such as moment T1, at moment T1+500ms, the CPU receives the first data of ACC. At moment T1+2*500ms, the CPU receives the first data of ACC and the second data of PPG. At moment T1+3*500ms, the CPU receives the first data of ACC. At moment T1+4*500ms, the CPU receives the first data of ACC and the second data of PPG. ...and so on, which will not be repeated here. In this way, at each moment T1+2i*500ms, the CPU can simultaneously receive the first data of ACC and the second data of PPG. Among them, the moment when timer 1 is turned on can be called the first moment, and i takes values in [1, 2, 3, 4, ..., n] in sequence.
[0109] Then, when the CPU is in sleep mode, the CPU will be awakened periodically with the timing duration of timer 1 as the period. For example, when the i-th timing duration is reached, in response to the first data of ACC, the CPU is awakened and executes the corresponding control logic. When the q*i-th timing duration is reached, in response to the first data of ACC and the second data of PPG, the CPU is awakened and executes the corresponding control logic. Since, when the q*i-th timing duration is reached, the CPU can be awakened in response to the data of sensor 1 and sensor 2, such as the first data and the second data, at the same time, this can avoid sensor 1 and sensor 2 sending data to the CPU alternately to wake up the CPU, which can reduce the number of times the CPU is awakened and reduce the power consumption of the CPU.
[0110] The above description uses the example that the second sensor includes sensor 2, and it should be understood that the present application does not limit the number of second sensors. When the number of second sensors is greater than 1, for example, the second sensor also includes sensor a. Then, timer 1 can be set to trigger the driver of sensor 1 to send the first data to the CPU when the i-th timing duration is reached, trigger the driver of sensor 2 to send the second data to the CPU when the q*i-th timing duration is reached, and trigger the driver of sensor a to send the data of sensor a to the CPU when the t*i-th timing duration is reached. Among them, t is the ratio of the reporting period of sensor a to the reporting period of sensor 1. Among them, t and q can be the same or different.
[0111] Then, in the case where q and t do not have an integer multiple relationship, when the q*ith timing duration arrives, the CPU can simultaneously receive data from sensor 1 and sensor 2. When the t*ith timing duration arrives, the CPU can simultaneously receive data from sensor 1 and sensor a. When the Zth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor a. Among them, Z is a multiple of q*t. In the case where q and t have an integer multiple relationship, for example, when q is an integer multiple of t, when the q*ith timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor a. In the case where t is an integer multiple of q, when the t*ith timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor a. In the case where q and t are the same, when the q*ith timing duration or the t*ith timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor a.
[0112] In this way, the CPU can be awakened periodically and can receive data from at least two sensors when awakened once. While meeting business needs, it can avoid multiple sensors from waking up the CPU in an interleaved manner, reduce the number of times the CPU is awakened, thereby reducing the generation of peak current and reducing CPU power consumption.
[0113] It should be understood that the normally-on sensors distributed in the smart watch may also include other sensors in addition to the first sensor and the second sensor. The reporting period of the other sensors is not a multiple of the minimum reporting period in the above text. During the process of starting the smart watch, such sensors are self-starting. After self-starting, such sensors collect data and send the collected data to the processor based on the corresponding reporting period.
[0114] In some embodiments, a smart watch using this solution and a smart watch not using this solution are connected to a logic analyzer to analyze the wake-up frequency of the CPU in the smart watch. The logic analyzer is an instrument used to analyze the logical relationship of a digital system. The logic analyzer can display Figure 7 The pulse image shown. Among them, Figure 7 (a) in the figure is the pulse image output by the logic analyzer after connecting a smart watch using this solution. Figure 7 (b) is the pulse image output by the logic analyzer after connecting a smart watch that does not use this solution. Figure 7 The smart watches in the market all include ACC and PPG.
[0115] from Figure 7 It can be seen from (a) that when the CPU is in sleep mode, in a smart watch that does not use this solution, ACC wakes up the CPU periodically with 500ms, PGG wakes up the CPU periodically with 1000ms, and ACC and PPG wake up the CPU alternately. Specifically, the CPU receives a pulse signal every 500ms, and the pulse signal corresponds to the first data sent by ACC. The CPU receives a pulse signal every 1000ms, and the pulse signal corresponds to the second data sent by PPG. There is a time difference between the time when the CPU receives the pulse signal corresponding to ACC and the time when it receives the pulse signal corresponding to PPG, that is, they are not synchronized. Figure 7 As shown in (a), within 10 seconds, the CPU can receive 20 pulse signals corresponding to ACC and 10 pulse signals corresponding to PGG, a total of 30 pulse signals. When the CPU is in sleep mode, the CPU will be awakened 30 times.
[0116] from Figure 7It can be seen from (b) that in the smart watch using this solution, ACC and PPG synchronously report data to the CPU. For example, in the first second, the CPU receives a pulse signal corresponding to the ACC and a pulse signal corresponding to the PPG, in the second second, the CPU receives a pulse signal corresponding to the ACC, in the third second, the CPU receives a pulse signal corresponding to the ACC and a pulse signal corresponding to the PPG, and so on, in a periodic cycle. Then, within 10 seconds, the CPU can receive 20 pulse signals corresponding to the ACC and 10 pulse signals corresponding to the PPG. Since the reporting cycle of the ACC is synchronized with the reporting cycle of the PPG, that is, when receiving the pulse signal corresponding to the ACC, the pulse signal of the PPG will be received at the same time, then, when the CPU is in sleep mode, the CPU will be awakened 20 times.
[0117] In some embodiments, the smart watch using the present solution is connected to a power consumption meter to obtain power consumption curves of the smart watch, ACC and PPG. The power consumption curves can be as follows: Figure 8 As shown. Figure 8 As shown in , curve 1 is the power consumption curve of PPG, curve 2 is the power consumption curve of ACC, and curve 3 is the power consumption curve of the smart watch. It can be seen from curves 1, 2, and 3 that ACC wakes up the smart watch 5 times, PPG wakes up the smart watch 3 times, and the smart watch is woken up 5 times in total, generating 5 peak currents.
[0118] In some embodiments, researchers have calculated that the power consumption of a smart watch that does not implement this solution is 723.024 microamperes; the power consumption of a smart watch that implements this solution is 712.015 microamperes. It can be seen that the power consumption of a smart watch that implements this solution increases by about 0.2 days.
[0119] The above article takes the normally-open sensor in the smart watch as an example to introduce the method of waking up the smart watch with the normally-open sensor. In some embodiments, the smart watch also includes a normally-open sensor. A normally-open sensor refers to a sensor that starts and works when a target condition is met and does not work when another target condition is met. Normally-open sensors include ALS, magnetic sensors, and air pressure sensors. For example, when the display screen is on, the ALS starts and starts working, and when the display screen is off, the ALS does not work. For another example, when the compass application is turned on, the magnetic sensor starts and starts working, and when the compass application is turned off, the magnetic sensor does not work. For another example, when the altimeter application is turned on, the air pressure sensor starts and starts working, and when the altimeter application is turned off, the air pressure sensor does not work. The following describes this solution by taking the normally-open sensor as sensor 3 as an example. In some embodiments, sensor 3 may be, for example, an ALS.
[0120] When the target condition is met, the CPU controls the sensor 3 to start and start working. When the smart watch is in a dormant state, the sensor 3 will periodically wake up the smart watch in a third cycle, such as the reporting cycle 3.
[0121] The CPU may align the reporting periods of sensor 1, sensor 2, and sensor 3. After aligning the reporting periods, the CPU may periodically receive the first data of sensor 1 in reporting period 1, periodically receive the second data of sensor 2 in reporting period 2, and periodically receive the third data of sensor 3 in reporting period 3. Aligning the reporting periods of multiple sensors means starting timing from the same moment and periodically reporting the data of each sensor according to the reporting period of each sensor.
[0122] For example, the CPU controls to turn off the first timer from the second moment, and periodically reports the first data of the first sensor to the processor in a first cycle, periodically reports the second data of the second sensor to the processor in a second cycle, and periodically reports the third data of the third sensor to the processor in a third cycle.
[0123] Hereinafter, the reporting period of sensor 1 is referred to as reporting period 1, and the reporting period of sensor 2 is referred to as reporting period 2.
[0124] In some embodiments, reporting period 3, reporting period 1, and reporting period 2 have the following relationship: reporting period 3 is the minimum reporting period of the three reporting periods, and the other two reporting periods are integer multiples of the minimum reporting period. For example, reporting period 1 = m times reporting period 3; reporting period 2 = p times reporting period 3. Wherein, p is an integer greater than or equal to 1, and m is an integer greater than or equal to 1. p and m may be the same or different, and the embodiments of the present application do not make specific limitations on this. The following is an introduction using the example of p and m being different. Exemplarily, for example, reporting period 3 is 20m, and reporting period 3 is the minimum reporting period. Reporting period 1 is 25 times reporting period 3, i.e., 500ms, and reporting period 2 is 50 times reporting period 3, i.e., 1000ms.
[0125] In other embodiments, reporting period 3, reporting period 1, and reporting period 2 have the following relationship: reporting period 1 is the minimum reporting period of the three reporting periods, and the other two reporting periods are integer multiples of the minimum reporting period. For example, reporting period 2 = q times reporting period 1; reporting period 2 = k times reporting period 1. Wherein, q is an integer greater than or equal to 1, and k is an integer greater than or equal to 1. q and k may be the same or different, and are not specifically limited in comparison with the embodiments of the present application. For example, reporting period 1 is 500m, and reporting period 1 is the minimum reporting period. Reporting period 2 is twice the reporting period 1, i.e., 1000ms, and reporting period 3 is three times the reporting period 1, i.e., 1500ms.
[0126] Since reporting cycle 1, reporting cycle 2, and reporting cycle 3 are multiples, after executing this solution, the CPU may receive data from two or three sensors at the same time. When the CPU is in a dormant state, the CPU can be awakened once and receive data from two or three sensors. This can avoid different processors from sending data to the CPU in an interleaved manner, i.e., awakening the CPU in an interleaved manner, and can reduce the number of times the CPU is awakened, thereby reducing the power consumption of the CPU.
[0127] Optionally, the CPU may control, according to the timing task of the second timer, to turn off the first timer from the second moment, to periodically report the first data of the first sensor to the processor in the first cycle, to periodically report the second data of the second sensor to the processor in the second cycle, and to periodically report the third data of the third sensor to the processor in the third cycle. Exemplarily, Figure 6 The method shown also includes:
[0128] S606, the CPU recognizes that the sensor 3 is started, creates a timer 2 according to the reporting cycle 1, the reporting cycle 2 and the reporting cycle 3, and starts the timer 2.
[0129] Timer 2 (i.e., the second timer) is used to periodically trigger the driver of sensor 1 to send the first data of sensor 1 to the CPU with a reporting period of 1, to periodically trigger the driver of sensor 2 to send the second data of sensor 2 to the CPU with a reporting period of 2, and to periodically trigger the driver of sensor 3 to send the third data of sensor 3 to the CPU with a reporting period of 3.
[0130] For example, timer 2 includes timing and counting functions. After timer 2 is started, timer 2 starts timing, and when the timing duration reaches the timing duration, the timing task is executed and the timing is restarted. When the timing duration reaches the timing duration again, the timing task is executed again and the timing is restarted, and so on. In addition, timer 2 can record the number of timing durations that have been reached. Specifically, timer 2 can add one to the count of timer 2 each time the timing duration reaches the timing duration.
[0131] In some examples, when reporting cycle 1 = m times reporting cycle 3; reporting cycle 2 = p times reporting cycle 3, timer 2 is used to periodically trigger the driver of sensor 1 to send the first data of sensor 1 to the CPU at m times the timing duration, periodically trigger the driver of sensor 2 to send the second data of sensor 2 to the CPU at p times the timing duration, and periodically trigger the driver of sensor 3 to send the third data of sensor 3 to the CPU at the timing duration. Wherein, the timing duration of timer 2 is the minimum reporting cycle among multiple reporting cycles corresponding to multiple sensors, such as reporting cycle 3.
[0132] In this embodiment, the timing task of timer 2 can be: when the jth second timing duration arrives, the driver of trigger sensor 3 reports the third data to the processor; when the p*jth second timing duration arrives, the driver of trigger sensor 2 reports the second data to the processor; when the m*jth second timing duration arrives, the driver of trigger sensor 1 reports the first data to the processor; wherein the second moment is the start moment of the second timer, and the second timing duration is equal to the third period; j takes values in [1,2,3,4,...n] in sequence. wherein p is the ratio of reporting period 2 to reporting period 3, and m is the ratio of reporting period 1 to reporting period 3.
[0133] Then, in the case where p and m do not have an integer multiple relationship, when the p*jth timing duration arrives, the CPU can simultaneously receive data from sensor 2 and sensor 3. When the m*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1 and sensor 3. When the Xth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor 3. Among them, X is a multiple of p*m. In the case where p and m have an integer multiple relationship, for example, when m is an integer multiple of p, when the m*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor 3. For example, when p is an integer multiple of m, when the p*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor 3. In the case where p and m are equal, when the p*jth timing duration or the m*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor 3.
[0134] For example, reporting cycle 3 is 20ms, reporting cycle 1 is 500ms, and reporting cycle 2 is 1000ms. Sensor 2 can be specifically set to: when the 25*jth 20ms arrives, the driver of sensor 1 is triggered to send the first data of sensor 1 to the CPU; when the 50*jth 20ms arrives, the driver of sensor 2 is triggered to send the second data of sensor 2 to the CPU; when the jth 20ms arrives, the driver of sensor 3 sends the third data of sensor 3 to the CPU; where j takes values in [1, 2, 3, 4, ..., n] in sequence.
[0135] Then, when the CPU is in sleep mode, when the jth 20ms arrives, the CPU can receive data from sensor 1 and sensor 3 at the same time. When the 25*jth 20ms arrives, the CPU can receive data from sensor 1 and sensor 3 at the same time. When the 50*jth 20ms arrives, the CPU can receive data from sensor 1, sensor 2, and sensor 3 at the same time. This can avoid the situation where sensor 1, sensor 2, and sensor 3 send data to the CPU alternately to wake up the CPU, which can reduce the number of times the CPU is woken up and reduce the power consumption of the CPU.
[0136] In other examples, when reporting cycle 2 = q times reporting cycle 1; reporting cycle 3 = k times reporting cycle 1, timer 2 is specifically used to periodically trigger the driver of sensor 1 to send the first data of sensor 1 to the CPU at a timing duration, periodically trigger the driver of sensor 2 to send the second data of sensor 2 to the CPU at q times the timing duration, and periodically trigger the driver of sensor 3 to send the third data of sensor 3 to the CPU at k times the timing duration. Among them, the timing duration of timer 2 is the minimum reporting cycle among the reporting cycles corresponding to multiple sensors, such as reporting cycle 1.
[0137] In this embodiment, the timing task of timer 2 can be that when the jth second timing duration arrives, the driver of triggering sensor 1 reports the first data to the processor; when the q*jth second timing duration arrives, the driver of triggering sensor 2 reports the second data to the processor; when the k*jth second timing duration arrives, the driver of triggering sensor 3 reports the third data to the processor; wherein the second moment is the start moment of the second timer, and the second timing duration is equal to the third period; j takes values in [1,2,3,4,...n] in sequence. wherein q is the ratio of reporting period 2 to reporting period 1, and k is the ratio of reporting period 3 to reporting period 1.
[0138] Then, in the case where q and k do not have an integer multiple relationship, when the q*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1 and sensor 2. When the k*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1 and sensor 3. When the Yth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor 3, where Y is a multiple of q*k. In the case where q and k have an integer multiple relationship, for example, when q is an integer multiple of k, when the q*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor 3. For example, when k is an integer multiple of q, when the k*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor 3. In the case where q and k are equal, when the q*jth timing duration or the k*jth timing duration arrives, the CPU can simultaneously receive data from sensor 1, sensor 2, and sensor 3.
[0139] The CPU can create Timer 2 and start Timer 2 in the following two ways.
[0140] Method 1: When the CPU recognizes that sensor 3 is started, it recreates a timer, and the newly created timer is timer 2. After creating timer 2, timer 2 can be started immediately, or, if the conditions are met, timer 2 can be started. Wherein, timer 1 can be turned off when timer 2 is turned on. For example, the CPU recognizes that sensor 3 is started, creates timer 2, starts timer 2 and turns off timer 1. For another example, the CPU recognizes that sensor 3 is started, and the CPU creates timer 2. When it is recognized that sensor 3 is started, timer 1 may not have counted to the timing duration. At this time, if timer 2 is started and timer 1 is turned off, the data of sensor 1 and sensor 2 obtained by the CPU will be incorrect. Therefore, after sensor 3 is started and the data of sensor 1 and sensor 2 (such as the first data and the second data) are received, the CPU starts timer 2, which will not disrupt the upload rhythm of the data of sensor 1 and sensor 2, and avoid the CPU from obtaining incorrect data. That is, the above conditions are: sensor 3 is started and the first data of sensor 1 and the second data of sensor 2 are received.
[0141] Mode 2: When the sensor 3 is identified to be activated, the CPU changes the timer 1 to the timer 2.
[0142] When the timing durations of timer 1 and timer 2 are different, the CPU first modifies the timing duration of timer 1 to the timing duration of timer 2. Among them, the timing duration of timer 1 is the minimum reporting period of reporting period 1 and reporting period 2. The timing duration of timer 2 is the minimum reporting period of reporting period 1, reporting period 2 and reporting period 3. After that, the CPU adds a timing task corresponding to sensor 3. Finally, set the multiple relationship between the reporting period and the timing duration of the sensor. For example, change the timing duration of timer 1 from 500ms to 20ms. Add a timing task corresponding to sensor 3, which can be, for example, sending the third data of sensor 3 to the CPU when the i-th timing duration arrives. Set the reporting period 1 of sensor 1 to 25 times the timing duration, and set the reporting period 2 of sensor 2 to 50 times the timing duration.
[0143] When the timing durations of timer 1 and timer 2 are the same, a timing task corresponding to sensor 3 is added.
[0144] In some embodiments, the CPU does not stop timer 1 when changing timer 1 to timer 2, so after the CPU changes timer 1 to timer 2, timer 2 is turned on. Therefore, when the CPU recognizes that sensor 3 is started, timer 1 can be changed to timer 2, or, if the conditions are met, timer 1 can be changed to timer 2. The above conditions are: sensor 3 is started and receives the first data of sensor 1 and the second data of sensor 2. After timer 1 is changed to timer 2, timer 2 restarts from the start time and executes the corresponding timed task based on the timing duration of timer 2.
[0145] In other embodiments, the CPU stops timer 1 when changing timer 1 to timer 2, and starts timer 2 after changing timer 1 to timer 2. Therefore, the CPU can start timer 2 immediately after changing timer 1 to timer 2, or the CPU starts timer 2 when a condition is met. The above condition may be: sensor 3 is started and receives the first data of sensor 1 and the second data of sensor 2.
[0146] When starting timer 2, the reporting capability of sensor 3 can be turned off. After starting timer 2, from the start time of starting timer 2, i.e., the second time, sensor 1, sensor 2, and sensor 3 periodically wake up the CPU. The second time may be the time when the first data and the second data are received. That is, timer 2 is started at the time when the first data and the second data are received. That is, the time when the first data and the second data are received is the time when timer 2 is started, i.e., the second time.
[0147] Taking the reporting cycle 1 = m times the reporting cycle 3; the reporting cycle 2 = p times the reporting cycle 3 as an example, the above method may further include:
[0148] S607, from the start time, timer 2 periodically triggers the driver of sensor 3 to send third data to the CPU with a timing duration as a period, periodically triggers the driver of sensor 2 to send second data to the CPU with a period of p times the timing duration, and periodically triggers the driver of sensor 1 to send first data to the CPU with a period of m times the timing duration.
[0149] Specifically, from the start moment, timer 2 periodically triggers the driving of sensor 3 with the timing duration as a period to obtain the third data, and sends the third data to the CPU; periodically obtains the second data through the driving of sensor 2 with a period of p times the timing duration, and sends the first data to the CPU; periodically obtains the first data through the driving of sensor 1 with a period of m times the timing duration, and sends the first data to the CPU.
[0150] S608, from the start time of timer 2, the CPU periodically receives the third data of sensor 3 with the timing duration as a period, periodically receives the second data of sensor 2 with p times the timing duration as a period, and periodically receives the first data of sensor 1 with m times the timing duration as a period.
[0151] Since reporting cycle 1, reporting cycle 2, and reporting cycle 3 are multiples, the CPU may receive data from two or three sensors at the same time. When the CPU is in sleep mode, the CPU can receive data from two or three sensors when it is awakened once. This can avoid different processors from sending data to the CPU in an interleaved manner, i.e., awakening the CPU in an interleaved manner, and can reduce the number of times the CPU is awakened, thereby reducing the power consumption of the CPU.
[0152] In the case where reporting cycle 2 = q times reporting cycle 1; reporting cycle 3 = k times reporting cycle 1, the above S607 can be: from the start time, timer 2 periodically triggers the driver of sensor 1 to send first data to the CPU with the timing duration as a period, periodically triggers the driver of sensor 2 to send second data to the CPU with q times the timing duration as a period, and periodically triggers the driver of sensor 3 to send third data to the CPU with k times the timing duration as a period. The above S608 can be: from the start time of timer 2, the CPU periodically receives the first data of sensor 1 with the timing duration as a period, periodically receives the second data of sensor 2 with q times the timing duration as a period, and periodically receives the third data of sensor 3 with k times the timing duration as a period.
[0153] In the above embodiment, the timing duration of the first timer may be the first timing duration, and the timing duration of the second timer may be the second timing duration.
[0154] It should be understood that the non-open sensors distributed in the smart watch may also include other sensors in addition to the third sensor. The reporting period of the other sensors does not have a multiple relationship with the reporting period of sensor 1 and / or the reporting period of sensor 2. When the preset conditions are met, such sensors start and collect data, and send the collected data to the processor based on the corresponding reporting period.
[0155] Figure 6 The execution subject CPU in the embodiment shown, the awakened processor is also a CPU. For example, the CPU can execute the methods shown in S601, S602, S603, and S606 when in working state. The CPU can execute the methods shown in S605 and S608 when in working state or in sleep state.
[0156] In another embodiment, the execution subject of a wake-up method provided in an embodiment of the present application may be a processor A, and the awakened processor may be processor B. For example, processor A and processor B are any one of a CPU, an AP, and a GPU, respectively, and processor A is different from processor B. For example, the execution subject is a CPU, and the awakened processor is a GPU. Specifically, the CPU may execute the methods shown in S601, S602, S603, and S606. The GPU may execute the methods shown in S605 and S608 to be periodically awakened.
[0157] The above text, combined with the accompanying drawings, introduces a wake-up method provided in an embodiment of the present application. The following, assuming that sensor 1 is ACC, sensor 2 is PPG, and sensor 3 is ALS, introduces the interaction process between the internal modules of the smart watch in combination with the accompanying drawings. The smart watch includes drivers corresponding to the sensors, such as ACC driver (ACC Driver), PGG driver (PPG Driver) and ALS driver (ALS Driver). A timer such as the first timer or the second timer can obtain data collected by the sensor through the driver. The following text takes reporting period 1 = p times reporting period 3; reporting period 2 = m times reporting period 3 as an example, combined with Fig. 9 A wake-up method provided in an embodiment of the present application is introduced.
[0158] Fig. 9 A wake-up method provided in an embodiment of the present application, the module in the smart watch can execute the following Fig. 9 The method shown implements the wake-up method described above. Fig. 9 This can include:
[0159] S1, during the startup of the smart watch, the CPU turns off the PPG reporting capability.
[0160] Optionally, when the reporting capability of ACC is enabled by default and the reporting capability of PPG is disabled by default, the CPU may not execute S1. When the smart watch is turned on, normally-on sensors in the smart watch, such as ACC and PPG, are automatically started.
[0161] After executing S1, the CPU can enter a sleep state or remain in a working state.
[0162] S2, ACC Driver obtains the first data collected by ACC.
[0163] For example, ACC is started at time T, and at time T+500ms, the first first data collected by ACC is stored in the buffer corresponding to ACC, and the ACC Driver can obtain the first first data from the buffer corresponding to ACC.
[0164] S3, ACC Driver sends the first first data to the CPU.
[0165] When the CPU is in a sleep state, in response to the first first data, the CPU may first switch from the sleep state to the working state, and then the CPU may create and start the timer 1.
[0166] S4, in response to the first first data, the CPU creates timer 1 and starts it.
[0167] For the specific form of the periodic timer 1 and the method for the CPU to create the timer 1, please refer to the previous description, which will not be repeated here. After starting the timer 1, the timer 1 periodically sends the first data of the ACC to the CPU with a period of 500ms, and periodically sends the second data of the PPG to the CPU with a period of 1000ms. The following takes the timer sending data twice as an example for introduction.
[0168] S5, at T1+500ms, timer 1 sends instruction 1 to ACC Driver.
[0169] This instruction 1 is used to instruct the ACC Driver to send the first data to the CPU.
[0170] S6: In response to instruction 1, the ACC Driver sends first data to the CPU.
[0171] Specifically, in response to the instruction 1, the ACC Driver may read the first data from a preset buffer corresponding to the ACC, and send the first data to the CPU.
[0172] S7, at T1+1000ms, timer 1 sends instruction 1 to the ACC Driver and sends instruction 2 to the PPG Driver.
[0173] The instruction 2 is used to instruct to obtain the second data collected by the PPG.
[0174] S8, in response to instruction 1, the ACC Driver sends first data to the CPU; in response to instruction 2, the PPG Driver sends second data to the CPU.
[0175] The instruction 2 is used for the PPG Driver to send the first data to the CPU. In response to the instruction 2, the PPG Driver can read the second data from the preset buffer corresponding to the PPG, and send the second data to the CPU.
[0176] It can be seen that after starting timer 1, the ACC Driver periodically sends the first ACC data to the CPU with a period of 500ms, and the PPG Driver periodically sends the second PPG data to the CPU with a period of 1000ms. Since the reporting period of PPG is twice that of ACC, when the CPU is in sleep state, when it is awakened for an even number of times, the CPU can receive data from ACC and PPG at the same time, which can avoid waking up the CPU by staggered reporting of data from ACC and PPG, reduce the number of times the CPU is awakened, reduce the number of times the peak current is generated, and reduce the power consumption of the CPU.
[0177] When the CPU recognizes that ALS is started, the CPU can report the period of ALS, PPG, and ACC. For example, after the CPU recognizes that ALS is started and receives data such as the first data and the second data of AAC and PPG, it starts timer 2. For the specific form of timer 2 and the method for the CPU to create timer 2, please refer to the introduction in the previous text, which will not be repeated here. The above method also includes:
[0178] S9, the CPU recognizes that the ALS is started and the AAC and PPG data are received, and the CPU starts timer 2.
[0179] When the CPU starts timer 2, it turns off the ALS reporting capability and timer 1.
[0180] After starting timer 2, timer 2 periodically sends the third data of ALS to the CPU with a period of 20 ms, periodically sends the first data of ACC to the CPU with a period of 500 ms, and periodically sends the second data of PPG to the CPU with a period of 1000 ms.
[0181] The following takes the example of timer 2 sending data to the CPU 50 times.
[0182] S10, from the start time T2 of timer 2 to T2+1000ms, timer 2 sends instruction 3 to the ALS Driver at intervals of 20ms.
[0183] The instruction 3 is used to instruct the ALS Driver to send the first data to the CPU. In response to the instruction 3, the ALS Driver can read the third data from the preset buffer corresponding to the ALS, and send the third data to the CPU.
[0184] S11, the ALS Driver periodically responds to instruction 3 with a period of 20 ms and sends third data to the CPU.
[0185] For example, at time T2+i*20ms, timer 2 sends instruction 3 to ALS Driver. In response to instruction 3, ALS Driver sends third data to CPU, where i takes values in [1, 2, 3, 4, ..., 50] in sequence.
[0186] In this way, when the CPU is in sleep mode, the CPU will be awakened 50 times from the start time T2 of timer 2 to the time T2+1000ms.
[0187] S12, at T2+500ms, timer 2 sends instruction 1 to ACC Drive.
[0188] S13, in response to instruction 1, the ACC Driver sends first data to the CPU.
[0189] In this way, at the time T2+500ms, the CPU will receive the third data and the first data simultaneously.
[0190] S14, at time T2+1000ms, timer 2 sends instruction 1 to ACC Drive and sends instruction 2 to PPG Drive.
[0191] S15, in response to instruction 1, the ACC Driver sends first data to the CPU, and in response to instruction 2, the PPG Driver sends second data to the CPU.
[0192] In this way, at the time T2+1000ms, the CPU will receive the third data, the first data and the second data simultaneously.
[0193] When the CPU is in sleep mode, from the start time T2 of timer 2 to the time T2+50*20ms, the CPU can be awakened 50 times, of which the CPU is awakened by the third data sent by timer 2 for the first 24 times. At the 25th time, the CPU is awakened by both the first data and the third data sent by timer 2. At the 26th to 49th times, the CPU is awakened by the third data sent by timer 2, and at the 50th time, the CPU is awakened by both the first data, the second data, and the third data sent by timer 2.
[0194] Optionally, timers such as the first timer and the second timer can trigger the sensor driver to send sensor data to the processor by calling the interrupt callback function of the sensor. For example, timer 2 or timer 1 calls the interrupt callback function of ACC, triggering the ACC Driver to read the data collected by ACC and send it to the CPU.
[0195] In the above embodiment, the first data is the data collected by sensor 1, the second data is the data collected by sensor 2, and the third data is the data collected by sensor 3. Optionally, the first data, the second data and the third data can be the first interrupt data, the second interrupt data and the third interrupt data, respectively. Among them, the first interrupt data includes the storage address of the first data, the second interrupt data includes the storage address of the second data, and the third interrupt data includes the storage address of the third data. When the processor is in a sleep state, in response to the above interrupt data, the processor switches from the sleep state to the working state, and obtains the corresponding data based on the storage address in the above interrupt data. In this embodiment, a timer such as a first timer or a second timer can trigger the sensor driver to send interrupt data such as the first interrupt data, the second interrupt data or the third interrupt data to the CPU.
[0196] It can be seen that when the reporting cycles of multiple sensors meet the conditions, after aligning the reporting cycles of multiple sensors, the number of times the smart watch is awakened can be reduced, the power consumption of the smart watch can be reduced, and the battery life of the smart watch can be further improved. The condition can be that the reporting cycles of multiple sensors include the minimum reporting cycle, and the remaining reporting cycles are integer multiples of the minimum reporting cycle. When the reporting cycle of some sensors in the smart watch does not meet the above requirements, the reporting cycle of the sensor can be adjusted in the early product design stage, for example, the reporting cycle can be adapted in collaboration with upstream and downstream fields.
[0197] The present application embodiment provides an electronic device, which includes: a memory, a display screen, and one or more processors. The display screen is coupled to the processor. The memory is used to store computer program code. The computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can execute the various functions or steps executed by the mobile phone in the above method embodiment. The structure of the electronic device can refer to Figure 4 The structure of the electronic device 400 is shown.
[0198] The present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are in the above electronic device (such as Figure 4 When the method is executed on the electronic device 400 shown in the figure, the electronic device executes each function or step in the above method embodiment.
[0199] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step in the above method embodiment.
[0200] The embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected by lines. For example, the interface circuit can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices (such as a processor). Exemplarily, the interface circuit can read instructions stored in the memory and send the instructions to the processor. When the instruction is executed by the processor, the electronic device can perform the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiment of the present application.
[0201] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0202] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0203] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0204] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0205] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0206] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A wake-up method, characterized in that: Applied to an electronic device, the electronic device includes a processor, a first sensor and a second sensor, the processor is in a dormant state, and the method includes: Controlling, from a first moment onwards, to periodically report first data of the first sensor to the processor with a first period, and to periodically report second data of the second sensor to the processor with a second period; The first cycle and the second cycle are in a multiple relationship; when the processor receives reported data, the processor is awakened.
2. The method according to claim 1, characterized in that The controlling, starting from a first moment, periodically reporting first data of the first sensor to the processor in a first cycle, and periodically reporting second data of the second sensor to the processor in a second cycle, includes: According to the timing task of the first timer, control is performed to periodically report the first data to the processor with the first period from the first moment onwards, and to periodically report the second data to the processor with the second period.
3. The method according to claim 2, characterized in that The second period is q times the first period, where q is an integer greater than or equal to 1; The timing tasks of the first timer include: When the i-th first timing duration arrives, reporting the first data to the processor; When the q*ith first timing duration arrives, reporting the second data to the processor; Among them, the first moment is the start time of the first timer, the first timing duration is equal to the first period; i takes values in [1, 2, 3, 4, ... n] in sequence.
4. The method according to claim 2 or 3, characterized in that: The method further comprises: During the startup of the electronic device, the reporting capability of the second sensor is turned off, and the reporting capability of the first sensor is turned on; the reporting capability is used for the sensor to actively report sensor data to the processor.
5. The method according to claim 4, characterized in that Before controlling, according to the timing task of the first timer, to periodically report the first data to the processor with the first period from the first moment, and to periodically report the second data to the processor with the second period, the method further includes: Acquire first data reported by the first sensor based on a reporting capability of the first sensor; In response to first data reported by the first sensor based on a reporting capability of the first sensor, the first timer is started and the reporting capability of the first sensor is disabled.
6. The method according to any one of claims 2 to 5, characterized in that: The electronic device further includes a third sensor; and the method further includes: Controlling the third sensor to start; Controlling, from a second moment onwards, to turn off the first timer, to periodically report the first data of the first sensor to the processor with the first period, to periodically report the second data of the second sensor to the processor with the second period, and to periodically report the third data of the third sensor to the processor with the third period; The first period and the third period are in a multiple relationship.
7. The method according to claim 6, characterized in that The controlling, starting from the second moment, periodically reporting the first data of the first sensor to the processor with the first period, periodically reporting the second data of the second sensor to the processor with the second period, and periodically reporting the third data of the third sensor to the processor with the third period, includes: According to the timing task of the second timer, control is performed to periodically report the first data to the processor with the first period, periodically report the second data to the processor with the second period, and periodically report the third data to the processor with the third period from the second moment onwards.
8. The method according to claim 7, characterized in that The second period is p times the third period, the first period is m times the third period, p is an integer greater than or equal to 1, and m is an integer greater than or equal to 1; The timing tasks of the second timer include: When the jth second timing duration arrives, reporting the third data to the processor; When the p*jth second timing duration arrives, reporting the second data to the processor; When the m*jth second timing duration arrives, reporting the first data to the processor; Among them, the second moment is the start time of the second timer, the second timing duration is equal to the third period; j takes values in [1, 2, 3, 4, ... n] in sequence.
9. The method according to claim 7, characterized in that: The third period is k times the first period, where k is an integer greater than or equal to 1; The timing tasks of the second timer include: When the jth second timing duration arrives, reporting the first data to the processor; When the q*jth second timing duration arrives, reporting the second data to the processor; When the k*jth second timing duration arrives, reporting the third data to the processor; Among them, the second moment is the start time of the second timer, the second timing duration is equal to the third period; j takes values in [1, 2, 3, 4, ... n] in sequence.
10. The method according to any one of claims 6 to 8, characterized in that: The method further comprises: The second moment is a moment at which the first data and the second data are reported.
11. The method according to any one of claims 6 to 9, characterized in that: Before the control periodically reports the first data of the first sensor to the processor with the first cycle, periodically reports the second data of the second sensor to the processor with the second cycle, and periodically reports the third data of the third sensor to the processor with the third cycle from the second moment onwards, the method further includes: Turn off the reporting capability of the third sensor; the reporting capability is used for the sensor to actively report sensor data to the processor.
12. An electronic device, characterized in that: The electronic device comprises: a memory, one or more sensors, and one or more processors; the memory and the one or more sensors are coupled to the processor; wherein the one or more sensors are used to collect data; the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-11.
13. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 11.
14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.