Power consumption control method and electronic equipment

By reducing the frequency of the sensor reporting attitude data in the standby state of the electronic device, the problem of high power consumption in the standby state of the electronic device is solved, and the overall power consumption is optimized.

CN119450657APending Publication Date: 2025-02-14HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310964951.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-01
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When the electronic device is in standby state, the sensor frequently reports attitude data, resulting in high power consumption.

Method used

By reducing the frequency of the sensor reporting attitude data when the electronic device is in standby state, power consumption optimization is achieved. The specific method is that the frequency of receiving the first functional data in the standby state of the first application decreases, resulting in the frequency of the first sensor reporting the data to the sensor drive management module also decreases, thereby reducing power consumption.

Benefits of technology

In the standby state of the electronic device, by reducing the frequency of sensor data reporting, the overall power consumption of the electronic device is significantly reduced and the energy efficiency performance of the device is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119450657A_ABST
    Figure CN119450657A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a power consumption control method and electronic equipment, relates to the technical field of electronic equipment, and realizes power consumption optimization of the electronic equipment. According to the scheme, a first application is installed in the electronic equipment, the electronic equipment further comprises a first sensor, and the first application is used for providing a first function through first data collected by the first sensor. And the electronic equipment receives a first operation for indicating the electronic equipment to run the first application. And in response to the first operation, running the first application by the electronic equipment. The method comprises the steps that the first application subscribes to first function information, and the first function information is obtained based on the first data and corresponds to the first function. When the electronic equipment is in a wake-up state, the frequency of the first application receiving the first function information is a first frequency. When the electronic equipment is in a standby state, the frequency of receiving the first function information by the first application is a second frequency. The second frequency is smaller than the first frequency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of electronic devices, and in particular to a power consumption control method and an electronic device. Background Art

[0002] Currently, electronic devices (such as wearable devices, mobile phones, etc.) include various sensors such as accelerometers (ACC) and gyroscopes. Electronic devices can collect posture data of electronic devices based on sensors to implement functions such as step counting, screen lighting when hand is raised, screen rotation, and fall detection. Among them, posture data can include the movement direction of the electronic device and the magnitude of acceleration.

[0003] In some implementations, the sensor may report the posture data to the electronic device, so that the electronic device can perform subsequent processing on the posture data and implement functions based on the posture data.

[0004] In order to ensure the accuracy of functions based on posture data in electronic devices, sensors need to frequently report posture data to electronic devices to facilitate subsequent processing of the posture data by the electronic devices, resulting in high power consumption in the electronic devices. Summary of the invention

[0005] The embodiments of the present application provide a power consumption control method and an electronic device, which can reduce the frequency of a sensor reporting attitude data when the electronic device is in a standby state, thereby reducing the overall 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 a first aspect, a power consumption control method is applied to an electronic device, the electronic device is installed with a first application, the electronic device also includes a first sensor, the first application is used to provide a first function through first data collected by the first sensor. The electronic device receives a first operation, the first operation is used to instruct the electronic device to run the first application. In response to the first operation, the electronic device runs the first application. The method includes: the first application subscribes to first function information, the first function information is obtained based on the first data and corresponds to the first function. The electronic device is in an awake state, and the frequency at which the first application receives the first function information is a first frequency. The electronic device is in a standby state, and the frequency at which the first application receives the first function information is a second frequency. The second frequency is less than the first frequency.

[0008] Based on the above scheme, when the electronic device is in standby mode, the frequency of the first application receiving the first function data decreases. In the present application, the first function information is obtained by the first data reported by the sensor driver management module to the first application, and the first data is reported by the first sensor to the sensor driver management module. Therefore, when the electronic device is in standby mode, the frequency of the first application receiving the first function data decreases, corresponding to the decrease in the frequency of the first sensor reporting the first data to the sensor driver management module, thereby reducing the power consumption caused by the first sensor and the sensor driver management module, and optimizing the overall power consumption of the electronic device.

[0009] Optionally, when the electronic device switches from the awake state to the standby state, the frequency at which the first application receives the first function information switches from the first frequency to the second frequency. In this way, when the electronic device switches from the awake state to the standby state, the frequency at which the first application receives the first function information can be reduced.

[0010] Optionally, the first application subscribes to the first function information from the sensor drive management module, including: the first application subscribes to the first data from the sensor drive management module. In this way, the first application can subscribe to the first function data by subscribing to the first data.

[0011] Optionally, the electronic device also includes a first virtual client, and the first application subscribing to the first function information from the sensor driver management module includes: the first application sending a first message to the first virtual client. After receiving the first message, the first virtual client sends a first subscription request to the sensor driver management module to subscribe to the first data. The first subscription request includes a first reporting interval and a first sampling frequency. The first virtual client is used to obtain the first function information based on the first data. The method also includes: the first application obtaining the first function information from the first virtual client.

[0012] Based on the above solution, when the electronic device is in the awake state, in response to the first message sent by the first application, the first virtual client sends a first subscription request to the sensor driver management module to subscribe to the first data. The sensor driver management module can send the first data to the first virtual client, and the first virtual client can be used to determine the first function information corresponding to the first data, so that the first application can obtain the first function information from the first virtual client.

[0013] Optionally, the first sensor is configured with a first-in-first-out FIFO buffer, and the FIFO buffer is used to cache the first data. The method also includes: setting the available bit width of the FIFO buffer. When the first data stored in the FIFO buffer reaches the available bit width of the FIFO buffer, the first sensor sends the first data stored in the FIFO buffer to the sensor drive management module. Based on the above scheme, the first sensor can set the first frequency or the second frequency by setting the available bit width of the FIFO buffer. The larger the available bit width of the FIFO buffer, the smaller the frequency of the first application receiving the first function data.

[0014] Optionally, the setting of the available bit width of the FIFO buffer includes: setting the available bit width of the FIFO buffer as a first watermark through the first sensor, and the first watermark is determined by the sensor driver management module according to the second sampling frequency and the second time interval. The second sampling frequency is greater than or equal to the first sampling frequency. The second time interval is less than or equal to the first time interval. The second sampling frequency and the first watermark are obtained by the first sensor from the sensor driver management module. Based on the above scheme, when the electronic device is in the awake state, the first watermark corresponds to the second sampling frequency and the second time interval.

[0015] Optionally, the method further includes: based on the first watermark being not 0, the first sensor collects the first data according to the second sampling frequency, and stores the collected first data in the first FIFO buffer.

[0016] Optionally, the method further includes: based on the first WM being 0, the first sensor collects the first data according to the second sampling frequency, and sends the collected first data to the sensor drive management module.

[0017] Optionally, the electronic device is provided with a first flag, which is used to indicate that the electronic device enters a dormant state or enters an awake state. The first flag includes a first value or a second value. The first value corresponds to the electronic device entering a standby state, and the second value corresponds to the electronic device entering an awake state. The electronic device also includes a state storage unit, which is used to configure and store the first flag. Before the first virtual client sends the first subscription request to the sensor drive management module, the method also includes: the first virtual client sends a second message to the state storage unit. After receiving the second message, the state storage unit configures the first flag to the second value. Based on the above scheme, the electronic device can configure the first flag to the second value when it is in the awake state. So that the first flag is set to the second value in the future, and the available bit width of the FIFO buffer and the sampling frequency of the first sensor are set when the electronic device is in the awake state.

[0018] Optionally, after the first virtual client sends the first subscription request to the sensor driver management module, the method further includes: the sensor driver management module reads the first flag bit from the state storage unit as the second value. The sensor driver management module determines the second sampling frequency and the second time interval according to the first flag bit being the second value. In this way, the sensor driver management module determines the second sampling frequency and the second time interval according to the first flag bit being the second value.

[0019] Optionally, the electronic device further includes a state monitoring module, and the state monitoring module is used to detect whether the electronic device enters a standby state and whether it enters a wake-up state. Before the first virtual client sends the first subscription request to the sensor drive management module, the method further includes: the first virtual client registers the state of the electronic device with the state monitoring module, so that the first virtual client obtains the state of the electronic device.

[0020] Optionally, the setting of the available bit width of the FIFO buffer includes: modifying the available bit width of the FIFO buffer to a second watermark through the first sensor, and the second watermark is determined by the sensor driver management module according to the second sampling frequency and the third time interval. Among them, the second sampling frequency is greater than or equal to the first sampling frequency. The third time interval is greater than the second time interval. The second watermark is obtained by the first sensor from the sensor driver management module. Based on the above scheme, when the electronic device enters the standby state, the second watermark corresponds to the second sampling frequency and the third time interval, and the available bit width of the FIFO buffer corresponds to the second watermark. Since the third time interval is greater than the second time interval. Then, when the electronic device enters the standby state, the frequency of the first sensor sending the first data to the first virtual client decreases, thereby reducing the frequency of the first application acquiring the first function data. The reduction of the electronic device in the standby state is achieved, thereby optimizing the overall power consumption of the electronic device.

[0021] Optionally, the method further includes: according to the second watermark being not 0, the first sensor collects the first data according to the second sampling frequency, and stores the collected first data in the first FIFO buffer. In the present application, since the third time interval is greater than the second time interval, the second watermark is determined based on the second sampling frequency and the third time interval. Therefore, the second watermark is not 0. Based on the above scheme, when the first data stored in the FIFO buffer reaches the bit width corresponding to the second watermark, the first virtual client can receive the first data sent by the sensor driver management module. Thereby realizing that when the electronic device enters the wake-up state, the frequency at which the first application receives the first function information is set to the second frequency.

[0022] Optionally, before the sensor driver management module determines the second watermark, the method further includes: the first virtual client sends a second subscription request to the sensor driver management module. The first sensor modifies the available bit width of the FIFO buffer to the second watermark, including: when the sensor driver management module receives the second subscription request, the first sensor modifies the available bit width of the FIFO buffer to the second watermark. In this way, the first virtual client can send the second subscription request to enable the sensor driver management module to execute the setting of the available bit width of the FIFO buffer.

[0023] Optionally, before the first virtual client sends the second subscription request to the sensor driver management module, the method further includes: the first virtual client sends a third message to the state storage unit. After receiving the third message, the state storage unit configures the first flag bit to the first value. In order to facilitate the subsequent reading of the first value of the first flag bit, the available bit width of the FIFO cache and the sampling frequency of the first sensor are set when the electronic device enters the standby state.

[0024] Optionally, before the sensor drive management module determines the second watermark, the method further includes: the sensor drive management module reads the first flag bit from the state storage unit as the first value, so as to subsequently implement the frequency setting of the first application receiving the first function information when the electronic device enters the standby state according to the first flag bit being the second value.

[0025] Optionally, after the first virtual client sends the second subscription request to the sensor driver management module, the method further includes: the sensor driver management module reads the first flag bit from the state storage unit as the first value. The sensor driver management module determines the second sampling frequency and the third time interval according to the first flag bit being the first value.

[0026] Optionally, before the first virtual client sends the third message to the state storage unit, the method further includes: the first virtual client receives a fourth message, and the fourth message corresponds to the electronic device entering the standby state. The fourth message is sent by the state monitoring module. In this way, the first virtual client obtains the message that the electronic device enters the standby state, and according to the electronic device entering the standby state, the frequency of the first application receiving the first function information is set to the second frequency.

[0027] Optionally, the electronic device is provided with a first chip system and a second chip system. The first application is configured on the first chip system. The first virtual client, the state monitoring module, the sensor drive management module and the state storage unit are configured on the second chip system. In this way, when the first virtual client, the state monitoring module, the sensor drive management module and the state storage unit perform corresponding operations, there is no need to wake up the first chip system, thereby achieving low power consumption of the electronic device.

[0028] Optionally, the electronic device further includes a first application processor, the first application processor is configured with the first application, and the electronic device is in a standby state, corresponding to the first application processor being in a dormant state. The electronic device is in an awake state, corresponding to the first application processor being in an awake state.

[0029] In a second aspect, a power consumption control method is applied to an electronic device, the electronic device is installed with a first application, the electronic device also includes a first sensor, and the electronic device is also configured with a sensor drive management module. The sensor drive management module is used to report the first data collected by the first sensor to the first application, and the first application is used to provide a first function through the first data. The method includes: the sensor drive management module receives the first function information subscribed by the first application, and the first function information is obtained based on the first data and corresponds to the first function. The electronic device is in an awake state, and the sensor drive management module reports the first function information to the first application at a first frequency. The electronic device enters a standby state, and the sensor drive management module reports the first function information to the first application at a second frequency. The second frequency is less than the first frequency.

[0030] Based on the above scheme, when the electronic device is in standby mode, the frequency of the sensor driver management sending the first function data to the first application decreases. In the present application, the first function information is obtained based on the first data, and the first data is sent by the first sensor to the sensor driver management module. Therefore, when the electronic device is in standby mode, the frequency of the sensor driver management sending the first function data decreases, corresponding to the decrease in the frequency of the first sensor sending the first data to the sensor driver management module, thereby reducing the power consumption caused by the first sensor and the sensor driver management module, and optimizing the overall power consumption of the electronic device.

[0031] In a third aspect, an electronic device is provided, wherein a first application is installed on the electronic device, and the electronic device includes one or more processors, one or more memories, and a first sensor. The one or more memories are coupled to the one or more processors. The first sensor is used to collect first data, and the first application is used to provide a first function through the first data collected by the first sensor. The one or more memories store computer instructions.

[0032] When the one or more processors execute the computer instructions, the electronic device executes any one of the information acquisition methods in the first aspect and its optional designs.

[0033] In a fourth aspect, a chip system includes a processor and a communication interface. The processor is used to call and run a computer program stored in a storage medium from a storage medium to perform any information acquisition method in the first aspect and its optional designs.

[0034] Optionally, the chip system includes at least one first module, a second module, a third module, and a fourth module. The first module corresponds to the sensor driver management in the first aspect and its optional design, the second module corresponds to the first virtual client in the first aspect and its optional design, the third module corresponds to the state monitoring module in the first aspect and its optional design. The fourth module corresponds to the state storage unit in the first aspect and its optional design.

[0035] In a fifth aspect, a computer-readable storage medium is provided, which includes computer instructions. When the computer instructions are executed, any information acquisition method in the first aspect and its optional designs is executed.

[0036] In a sixth aspect, a computer program product is provided, wherein the computer program includes instructions, and when a computer runs the instructions, the information acquisition method of any one of the first aspect and its optional designs is executed.

[0037] It can be understood that the technical solutions provided in the second to sixth aspects above can respectively correspond to the circuit board detection methods provided in the aforementioned designs, and the beneficial effects that can be obtained are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of the composition of an electronic device interface;

[0039] Figure 2 A flowchart of a data acquisition method is shown;

[0040] Figure 3 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application;

[0041] Figure 4 A schematic diagram of another electronic device provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of another electronic device provided in an embodiment of the present application;

[0043] Figure 6 A flowchart of a power consumption control method provided in an embodiment of the present application;

[0044] Figure 7 A schematic diagram of a power consumption control method provided in an embodiment of the present application;

[0045] Figure 8 A schematic diagram of another power consumption control method provided in an embodiment of the present application;

[0046] Fig. 9A schematic diagram of another power consumption control method provided in an embodiment of the present application;

[0047] Fig.10 A flowchart of another power consumption control method provided in an embodiment of the present application;

[0048] Fig.11 A schematic diagram of another electronic device provided in an embodiment of the present application;

[0049] Fig.12 A schematic diagram of the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0051] Currently, electronic devices (such as wearable devices, mobile phones, etc.) are equipped with one or more sensors, such as ACC, gyroscope sensor, ambient light sensor, etc. The electronic devices can implement various functions based on the data collected by the sensors.

[0052] Taking the ACC and gyroscope sensors configured in electronic devices as an example, electronic devices can collect the posture data of electronic devices based on the sensors to implement functions such as step counting, screen lighting when hand is raised, screen rotation, and fall detection. Among them, the posture data may include the movement direction of the electronic device and the magnitude of acceleration.

[0053] As an implementation method, the electronic device may further include at least one client. The client may be used to enable the electronic device to implement one or more functions such as step counting, screen lighting when hand is raised, and fall detection based on the posture data collected by the sensor.

[0054] refer to Figure 1 , take the electronic device including client 1 and client 2 as an example. Figure 1 As shown, the electronic device also includes a sensor drive management module and a sensor. Client 1 and client 2 enable the electronic device to implement different functions based on the posture data. The sensor drive management module is used to send the posture data collected by the sensor to client 1 and client 2.

[0055] It should be noted that, before the sensor drive management module sends the posture data to the client 1 and the client 2, it needs to first obtain the posture data from the sensor.

[0056] In some implementations, the sensor may send the collected posture data to the sensor drive management module, so that the sensor drive management module acquires the posture data.

[0057] In other implementations, the sensor outputs a high-level signal to instruct the sensor drive management module to read the posture data collected by the sensor, thereby enabling the sensor drive management module to acquire the posture data.

[0058] For example, taking the first implementation as an example, refer to Figure 2 , client 1, and client 2 can subscribe to the posture data from the sensor driver management module to obtain the posture data.

[0059] like Figure 2 As shown, the program includes:

[0060] S201. When the electronic device is turned on, the client 1 sends a request A for subscribing to posture data to the sensor drive management module.

[0061] Exemplarily, request A includes a reporting interval T0, and request A indicates that client 1 needs to obtain posture data.

[0062] S202: When the electronic device is turned on, the client 2 sends a request B for subscribing to posture data to the sensor drive management module.

[0063] Exemplarily, request B includes frequency B, and request B indicates that client 2 needs to obtain posture data.

[0064] It should be noted that in some implementations, when the electronic device is turned on, the operations of S201 and S202 may be performed simultaneously. After receiving and responding to the operations of S201 and S202, the electronic device may perform the operation of S203.

[0065] S203: Determine a reporting interval T2 according to request A and request B.

[0066] Exemplarily, when receiving request A and request B, the sensor driver management module may determine the reporting interval T2 according to the reporting interval T0 in request A and the reporting interval T1 in request B. The reporting interval T2 is the minimum duration between the reporting interval T0 and the reporting interval T1.

[0067] S204: The sensor drive management module synchronously reports the interval T2 to the sensor.

[0068] Exemplarily, after determining the reporting interval T2, the sensor driving management module may synchronize the reporting interval T2 to the sensor, so that the sensor can subsequently feed back the posture data based on the reporting interval T2.

[0069] S205 . The sensor feeds back the posture data to the sensor drive management module based on the reporting interval T2 .

[0070] Exemplarily, the sensor may feed back the collected posture data to the sensor drive management module based on the reporting interval T2.

[0071] S206 . The sensor drive management module feeds back the posture data to the client 2 based on the reporting interval T2 .

[0072] Exemplarily, after receiving the posture data fed back by the sensor, the sensor driving management module feeds back the posture data to the client 2 based on the reporting interval T2.

[0073] S207 . The sensor drive management module feeds back the posture data to the client 1 based on the reporting interval T2 .

[0074] Exemplarily, after receiving the posture data fed back by the sensor, the sensor driving management module feeds back the posture data to the client 1 based on the reporting interval T2.

[0075] according to Figure 1 In the scheme shown in , the sensor feeds back the posture data to the sensor drive management module based on the minimum reporting interval T2. After receiving the posture data, the ACC drive management module feeds back the posture data to the client 1 and the client 2. This enables each client to provide more real-time and accurate information based on the processing of the posture data.

[0076] It should be noted that the sensor drive management module, client 1 and client 2 are all in a low-power sleep mode before acquiring the posture data. After the sensor executes the operation of S205, the sensor drive management module, client 1 and client 2 will be awakened. Therefore, when the sensor frequently feeds back the posture data to the sensor drive management module, it is easy to cause the problem of high power consumption of the electronic device.

[0077] In addition, the above examples are explained by taking ACC and gyroscope sensors as examples. In other embodiments of the present application, other types of sensors in the electronic device (such as ambient light sensors, etc.) will also frequently report data when sending collected data, resulting in the problem of high power consumption of the electronic device.

[0078] An embodiment of the present application provides a power consumption control method, and an electronic device includes a client 1. When the electronic device is in an awake state, the client 1 sends a request 1 to subscribe to posture data to the sensor driver management module. In response to the request 1, the sensor driver management module sets the frequency of the sensor reporting posture data to frequency 1. When the electronic device is in a standby state, the client 1 sends a request 2 to subscribe to posture data to the sensor driver management module. In response to the request 2, the frequency of the sensor reporting posture data by the sensor driver management module is frequency 2. Among them, frequency 2 is less than frequency 1. In this way, the operating frequency of the sensor driver management module can be reduced, thereby reducing the power consumption of the electronic device. In some embodiments of the present application, frequency 1 corresponds to the first frequency, frequency 2 corresponds to the second frequency, and the posture data can also be referred to as the first data.

[0079] The technical solution provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0080] It should be noted that the solution provided in the embodiments of the present application can be applied to electronic devices.

[0081] The electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, etc. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.

[0082] As an implementation, the electronic device may have Figure 3 The structure of the electronic device 300 is shown.

[0083] like Figure 3As shown, the electronic device 300 may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera module 393, a display screen 394, and a subscriber identification module (SIM) card interface 395, etc. The sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an ambient light sensor 380L, a bone conduction sensor 380M, etc.

[0084] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 300. In other embodiments of the present application, the electronic device 300 may include more or fewer components than shown in the figure, or combine some components, or split 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.

[0085] The processor 310 may include one or more processing units, for example, the processor 310 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0086] The processor can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.

[0087] The processor 310 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 310 may be a cache memory. The memory may store instructions or data that have been used or are frequently used by the processor 310. If the processor 310 needs to use the instruction or data, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.

[0088] The electronic device 300 can realize the display function through a GPU, a display screen 394, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 394 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or change display information.

[0089] The display screen 394 is used to display images, videos, etc. The display screen 394 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), a quantum dot light-emitting diode (QLED), etc.

[0090] The internal memory 324 can be used to store computer executable program codes, which include instructions. The internal memory 324 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 image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 300 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 324 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. The processor 340 executes various functional methods or data processing of the electronic device 300 by running instructions stored in the internal memory 324 and / or instructions stored in a memory provided in the processor.

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

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

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

[0094] The ambient light sensor 380L can be used to sense the brightness of the ambient light. The electronic device 300 can adaptively adjust the brightness of the display screen 393 according to the perceived brightness of the ambient light. The ambient light sensor 380L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 380L can also cooperate with the proximity light sensor 380G to detect whether the electronic device 300 is blocked, such as when the electronic device is in a pocket. When it is detected that the electronic device is blocked or in a pocket, some functions (such as the touch function) can be disabled to prevent misoperation.

[0095] The electronic device involved in the embodiment of the present application may also have a layered architecture. The layered architecture includes several layers, each layer has a clear role and division of labor, and the layers communicate with each other through software interfaces.

[0096] For example, Figure 4 FIG. 1 shows a schematic diagram of the composition of an electronic device. Figure 4As shown, the software architecture of the electronic device includes an application processor module (AP) and a sensor control module. The hardware architecture of the electronic device includes a hardware layer.

[0097] In an embodiment of the present application, the hardware layer is used to collect posture data. The sensor control module is used to process posture data so that the electronic device can realize new functions based on posture data. Such as step counting, raising the hand to light up the screen, and rotating the screen. In some embodiments, the sensor control module can also be called sensorhub. AP is used to perform processing related to the operating system, user interface, and application. AP and sensor control module run on two different chip systems. The sensor control module can interact with the hardware layer to obtain posture data. AP can interact with the sensor control module to obtain the processing results of the sensor control module on the posture data and display the results to the user.

[0098] refer to Figure 5 ,The layered architecture of the AP in this electronic device is from top to bottom respectively : application layer, application framework layer, Android runtime (ART) and system library, hardware abstract layer (HAL), and kernel layer.

[0099] The application layer can include a series of application packages.

[0100] like Figure 5 As shown, the application layer may include music, video, call, ringtone, alarm, Bluetooth, navigation, settings, gallery, first application, second application and other applications. The first application and the second application may realize different functions based on the posture data collected by the sensor (such as ACC, gyroscope sensor).

[0101] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0102] like Figure 5 As shown, the application framework layer may include a window manager, an activity manager, an input manager, a resource manager, a notification manager, a view system, and the like.

[0103] The window manager provides window management services (WMS). WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system.

[0104] In an embodiment of the present application, the graphical user interface of the application corresponds to one or more activities, and the activities include one or more views. The window manager can add the views included in the graphical user interface to be displayed to the window manager. Figure 5 on the display 494 in the Figure 2 Remove the view from the graphical user interface displayed on display screen 494.

[0105] The activity manager can provide activity management services (AMS), which can be used to start, switch, and schedule system components (such as activities, services, content providers, and broadcast receivers) as well as manage and schedule application processes.

[0106] The input manager can provide input management services (IMS), which can be used to manage system input, such as touch screen input, key input, sensor input, etc. IMS takes events from input device nodes and distributes them to appropriate windows through interaction with WMS.

[0107] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0108] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

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

[0110] The Android runtime is responsible for converting source code into machine code. The Android runtime mainly uses ahead-of-time (AOT) compilation technology and just-in-time (JIT) compilation technology.

[0111] The Android runtime also includes core libraries. The core libraries are mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks, etc. The core libraries provide APIs for users to develop Android applications.

[0112] The system library can include multiple functional modules, such as surface manager, media library, and media framework.

[0113] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media framework supports playback and recording of multiple common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0114] The hardware abstraction layer runs in user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer. The hardware abstraction layer includes at least a display module and an audio module.

[0115] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers and audio drivers.

[0116] The sensor control module corresponds to the sensor control module layer. Figure 5 As shown, the sensor control module layer may include client 1, client 2, a status monitoring module, and a sensor drive management module.

[0117] In an embodiment of the present application, the client 1 can enable the electronic device to implement the first function based on the processing of the posture data. As an implementation, the client 1 can be a motion recognition module, and the first function can be one or more functions such as step counting, raising the hand to light up the screen, and rotating the screen. In some embodiments, the motion recognition module can also be called a motion module. In other embodiments of the present application, the posture data can also be called the first data.

[0118] The client 2 can process the posture data to enable the electronic device to realize the second function. For example, the client 2 can be the client 2, and the second function can be static / motion state detection, activity posture (such as standing, climbing, etc.) recognition, etc.

[0119] The state monitoring module is used to detect whether the electronic device is in a standby or awake state. The sensor driver management module is used to determine the reporting interval and sampling frequency of the sensor for the posture data, and send the posture data collected by the sensor to client 1 and client 2.

[0120] In other implementations of the present application, the sensor control module layer may include a client 1, a state monitoring module, and a sensor drive management module, etc. The specific functions of the client 1, the state monitoring module, and the sensor drive management module can refer to the description in the first embodiment, and will not be repeated here.

[0121] In the embodiments of the present application, Figure 5 As shown, the electronic device is provided with a hardware layer below the sensor control module layer. The hardware layer includes a sensor module, and the sensor module includes a gyroscope sensor, and ACC, etc. The gyroscope sensor and ACC (hereinafter referred to as the sensor) are used to collect the posture data of the electronic device. The posture data may include the movement direction of the electronic device, and the magnitude of acceleration. In other embodiments of the present application, the sensor module may also be referred to as the first sensor.

[0122] The ACC involved in this embodiment is Figure 3 The acceleration sensor 380E in this embodiment is the gyroscope sensor Figure 3 The gyro sensor 380B in the ACC can be found in the introduction of ACC and gyro sensor. Figure 3 The instructions in the article are not repeated here.

[0123] In some embodiments, the sensor is also configured with a First Input First Output (FIFO) memory. The FIFO buffer is used to cache the gesture data sampled in real time. The FIFO buffer is provided with an available bit width. When the gesture data stored in the FIFO buffer reaches the available bit width, the sensor feeds back the gesture data stored in the FIFO buffer to the sensor control module. In this way, after the sensor control module receives the gesture data fed back by the sensor, the gesture data can be fed back to the client 1 and the client 2 through the sensor drive management module. The available bit width of the FIFO buffer can be set by the watermark of the FIFO buffer. In other embodiments, the watermark can also be called a watermark. In other embodiments of the present application, the FIFO buffer can also be called a first FIFO buffer.

[0124] In some implementations, if the watermark of the FIFO buffer is not 0, the sensor can store the real-time sampled gesture data in the FIFO buffer. When the gesture data stored in the FIFO buffer reaches the bit width corresponding to the watermark, the sensor reports the gesture data in the FIFO buffer to the sensor control module.

[0125] In some other implementations, the watermark of the FIFO buffer is equal to 0, and the FIFO buffer is closed. Then the sensor module can directly report the real-time sampled posture data to the sensor control module. For example, if the sampling frequency of the sensor module is 100 Hz, it corresponds to the sensor module sampling the posture data every 10 ms and reporting the sampled posture data directly to the sensor control module layer.

[0126] In this example, the hardware layer and the sensor control module layer can interact, so that the sensor driver management module can set the frequency of the sensor module reporting posture data, and the sensor module can report the collected posture data to the sensor control module layer.

[0127] It should be noted that when the electronic device is in the awake state, the functions based on the posture data in the electronic device may include functions such as step counting, raising the hand to light up the screen, and rotating the screen. When the electronic device is in the standby state, the AP is also in the dormant state. All application processes in the electronic device are in a suspended state. At this time, the functions based on the posture data in the electronic device may include functions such as step counting, raising the hand to light up the screen, and so on.

[0128] It is understandable that when the electronic device is in the awake state, the user's perception of the above-mentioned functions based on the posture data is more obvious. The sensor needs to report the posture data frequently. When the electronic device is in the standby state, the user's perception of the above-mentioned functions based on the posture data is not obvious. The sensor does not need to report the posture data frequently.

[0129] Therefore, in order to reduce the power consumption of electronic devices while ensuring the user experience, in the present application, when the electronic device is in standby mode, the frequency of the sensor reporting posture data can be reduced.

[0130] In some embodiments of the present application, a first flag is set in the electronic device, and the first flag is used to indicate that the electronic device is in a dormant or awake state. Among them, the first flag includes 1, or 0. 1 corresponds to the electronic device being in a standby state, and 0 corresponds to the electronic device being in an awake state. The electronic device can set the frequency of the sensor reporting posture data according to the first flag. In other embodiments of the present application, 1 can also be called the first value, and 0 can also be called the second value.

[0131] The following takes the electronic device including the client 1 and the client 2, the client 1 supports the first function, and the client 2 supports the second function as an example, and describes in detail the setting of the frequency of the sensor reporting the attitude data.

[0132] Exemplary, reference Figure 6The electronic device can set the frequency of the sensor reporting posture data according to the value of the first flag through the interaction between the client 1, the client 2, the state monitoring module, and the sensor drive management module.

[0133] like Figure 6 As shown, the program includes:

[0134] S601, when the electronic device is turned on, the client 2 sends a subscription request 11 to the sensor drive management module, and the subscription request 11 includes a reporting interval T11 and a sampling frequency F11. In other embodiments of the present application, the reporting interval T11 can also be called a first reporting interval, and the sampling frequency F11 can also be called a first sampling frequency.

[0135] S602: When the electronic device is turned on, the client 1 sends a subscription request 12 to the sensor drive management module. The subscription request 12 includes a reporting interval T12 and a sampling frequency F12.

[0136] It should be noted that in some implementations, when the electronic device is turned on, it can perform the operations of S601 and S602 simultaneously. When the electronic device is performing S601 and S602, it can also perform the operation of S603.

[0137] S603: Client 1 registers the status of the electronic device with the status monitoring module.

[0138] Exemplarily, the client 1 may register the status of the electronic device with the status monitoring module when the electronic device is turned on, so that the client 1 can obtain the status of the electronic device.

[0139] In this example, the state of the electronic device includes a standby state or a wake-up state. When the electronic device is in the standby state, the AP is in a dormant state, and the application process running in the electronic device is in a suspended state.

[0140] Combination Figure 5 The state monitoring module is used to detect whether the electronic device is in a standby or awake state. The state monitoring module can perform the operation of S613 when the electronic device is detected to be in a standby state. The state monitoring module can perform the operation of S625 when the electronic device is detected to be in an awake state.

[0141] S604: The state storage unit configures the first flag bit to be 0.

[0142] In an embodiment of the present application, the electronic device further includes a state storage unit, which is used to configure the value of the first flag bit. When the electronic device is turned on, the state storage unit configures the first flag bit to 0.

[0143] S605: The sensor drive management module reads a first flag bit from the state storage unit, which is 0.

[0144] Exemplarily, when the sensor driving management module receives request 11 and request 12, the first flag bit read from the state storage unit is 0. When the first flag bit is 0, the sensor driving management module may continue to perform the operation of S606.

[0145] S606 , the sensor drive management module determines that T11 is less than T12 and F12 is greater than F11 , and determines the corresponding watermark11 (hereinafter referred to as WM11 ) according to T11 and F12 .

[0146] In some implementations, the sensor drive management module determines that T11 is less than T12, F12 is greater than F11, and determines WM11 according to T11 and F12 based on request 11 and request 12. WM11 corresponds to the bit width occupied by the WM11 group gesture data. Among them, WM11 is equal to T11 / T12, and T12 is the reciprocal of F12. In other embodiments of the present application, WM11 can also be called the first WM, F12 can also be called the second sampling frequency, and T11 can also be called the second time interval.

[0147] For example, if T11 is 20ms and F12 is 100Hz, then T12=1 / 100Hz=10ms. Then WM11=2ms / 10ms=2 is determined based on T11 and F12.

[0148] It should be noted that the above example is based on the example that T11 is less than T12 and F12 is greater than F11 to illustrate the method of determining WM11. In the embodiments of the present application, there is no restriction on the sizes of T11, T12, F11, and F12. For example, in other implementations, T11 is greater than or equal to T12, and F12 is less than or equal to F11. The sensor drive management module can determine WM11 based on T12 and F11.

[0149] The following uses T11 being less than T12 and F12 being greater than F11 as an example to illustrate the method provided in the embodiments of the present application.

[0150] S607 , the sensor driver management module sends WM11 and F12 to the sensor.

[0151] Exemplarily, after completing S606 , the sensor driver management module may send WM11 and F12 to the sensor, so that the sensor can perform subsequent operations based on WM11 and F12 .

[0152] It is understandable that in some implementations, WM11 is not 0. At this time, after receiving WM11, the sensor executes S608 to S611 according to WM11 not being 0, so as to feed back the posture data to the sensor drive management module.

[0153] S608: The sensor configures the available bit width of the FIFO buffer according to WM11.

[0154] Exemplarily, when WM11 is not 0, the sensor sets WM11 to the available bit width of the FIFO buffer. Assuming that WM11 is 2, the available bit width of the FIFO buffer corresponds to the bit width occupied by 2 groups of gesture data.

[0155] In some embodiments of the present application, when WM11 is not 0, the sensor may further execute the operation of S609 to enable the FIFO buffer to facilitate subsequent use of the FIFO buffer.

[0156] S609 : The sensor configures the enable flag of the FIFO buffer to 1 according to the fact that WM11 is not 0.

[0157] Exemplarily, the FIFO buffer is correspondingly provided with an enable flag, and the enable flag includes 0 or 1. When the enable flag is 0, the FIFO buffer is in a closed state, and when the enable flag is 1, the FIFO buffer is in an open state.

[0158] Therefore, the sensor can configure the enable flag of the FIFO buffer to 1 based on the fact that WM11 is not 0, so as to enable the FIFO buffer.

[0159] In the embodiment of the present application, after completing the operations of S608 and S609, the sensor continues to perform the operations of S610 and S611 to report the posture data.

[0160] S610: The sensor collects posture data according to F12, and stores the acquired posture data in a FIFO buffer.

[0161] S611: When all available bit widths of the FIFO buffer are occupied, the sensor sends the gesture data stored in the FIFO buffer to the sensor drive management module.

[0162] For example, assuming that WM11 is 2, when two sets of posture data are stored in the FIFO buffer, the sensor sends the two sets of posture data in the FIFO buffer to the sensor drive management module together.

[0163] In some other implementations, WM11 is 0. At this time, after receiving WM11, the sensor executes S612 to S614 according to WM11 being 0, so as to feed back the posture data to the sensor drive management module.

[0164] S612: The sensor configures the enable flag of the FIFO buffer to 0 based on WM11 being 0.

[0165] Exemplarily, when WM11 is 0, the sensor does not use the FIFO buffer to store the gesture data. In combination with the description of S609 above, the sensor can configure the enable flag of the FIFO buffer to 0 to close the FIFO buffer.

[0166] S613. The sensor collects posture data according to F12.

[0167] S614: The sensor sends the posture data to the sensor drive management module.

[0168] Exemplarily, when WM11 is 0, the sensor directly sends the posture data acquired in S613 to the sensor drive management module.

[0169] In the embodiment of the present application, after the sensor driving management module receives the posture data fed back by the sensor, it can continue to perform the operations of S615 and S616, so that the client 1 and the client 2 obtain the posture data.

[0170] S615 . The sensor drive management module feeds back the posture data to the client 1 .

[0171] S616 , the sensor drive management module feeds back the posture data to the client 2 .

[0172] According to the description in S601 to S616, when the electronic device is turned on, the sensor driver management module determines F12 and WM11 according to request 11 and request 12, and sends F12 and WM11 to the sensor. When WM11 is not 0, the sensor turns on the FIFO buffer and sets WM11 to the available bit width of the FIFO buffer. The sensor collects posture data based on F12 and stores the collected posture data in the FIFO buffer. When all available bit widths of the FIFO buffer are occupied, the posture data is sent to the sensor driver management module. When WM11 is 0, the sensor turns off the FIFO buffer. The sensor collects posture data based on F12 and sends the collected posture data directly to the sensor driver management module.

[0173] S617: When the electronic device enters the standby state, the state monitoring module sends a standby state entry indication to the client 1.

[0174] In an embodiment of the present application, upon receiving the indication of entering the standby state, the client 1 may continue to perform the operations of S618 and S620. In other embodiments of the present application, the indication of entering the standby state may also be referred to as a fourth message.

[0175] S618. Client 1 sends an instruction to configure the first flag bit to be 1 to the state storage unit.

[0176] In other embodiments of the present application, the indication of configuring the first flag bit to be 1 may also be referred to as a third message.

[0177] Exemplarily, after receiving the indication of entering the standby state, the client 1 may send an indication of configuring the first flag bit to be 1 to the state storage unit.

[0178] S619: The state storage unit modifies the first flag bit to 1.

[0179] Exemplarily, in response to the instruction in S618 , the state storage unit modifies the first flag bit to 1.

[0180] S620. The client 1 sends a subscription request 21 to the sensor driver management module.

[0181] Exemplarily, the client 1 may send a subscription request 21 to the sensor driver management module after the operation of S619 is completed. The subscription request 21 is used to instruct the sensor driver management module to perform the determination of the sampling frequency of the sensor and the available bit width of the FIFO buffer. In other embodiments of the present application, the subscription request 21 may also be referred to as a second subscription request.

[0182] In the embodiment of the present application, after receiving the request 21, the sensor driver management module can determine the sampling frequency of the sensor and the available bit width of the FIFO buffer by executing the operations in S621 to S623.

[0183] S621: The sensor drive management module reads a first flag bit as 1 from the state storage unit.

[0184] Exemplarily, when the sensor driving management module receives the request 21, the first flag bit read from the state storage unit is 1. When the first flag bit is 1, the sensor driving management module may continue to perform the operation of S622.

[0185] S622. The sensor driver management module determines the reporting interval T21 corresponding to the first flag bit being 1, and determines the corresponding watermark21 (hereinafter referred to as WM21) according to T21 and F12.

[0186] In some other embodiments of the present application, WM21 may also be referred to as a second WM.

[0187] Exemplarily, T21 is a preset duration, and T21 is greater than T11. WM21 corresponds to the bit width occupied by the gesture data of the WM21 group. Wherein, WM21 is equal to T21 / T12, and T12 is the reciprocal of F12.

[0188] For example, if T21 is 50ms and F12 is 100Hz, T12 = 1 / 100Hz = 10ms. Then WM11 = 50ms / 10ms = 5 is determined based on T21 and F12. That is, WM21 corresponds to the bit width occupied by 5 groups of gesture data.

[0189] S623: The sensor driver management module sends WM21 and F12 to the sensor.

[0190] Exemplarily, after determining WM21, the sensor driving management module may send WM21 and F12 to the sensor, so that the sensor performs subsequent processing based on WM21 and F12.

[0191] It can be understood that, combined with the description in S622, since T21 is greater than T11, T21 is greater than 0ms, that is, WM21 is not 0. In this case, after receiving WM21 and F12, the sensor can perform operations from S624 to S627 to complete sending the collected posture data to the sensor drive management module.

[0192] S624: The sensor configures the available bit width of the FIFO buffer according to WM21.

[0193] Illustratively, the sensor sets WM21 to the available bit width of the FIFO buffer.

[0194] In some embodiments of the present application, since WM21 is not 0, the sensor may also execute the operation of S625 to open the FIFO buffer to facilitate subsequent use of the FIFO buffer.

[0195] S625: The sensor configures the enable flag of the FIFO buffer to 1 based on the fact that WM21 is not 0.

[0196] Exemplarily, in combination with the description in S609 , the sensor may configure the enable flag of the FIFO buffer to be 1, so as to enable the FIFO buffer.

[0197] In the embodiment of the present application, after completing the operations of S624 and S625, the sensor continues to perform the operations of S626 and S627 to collect and report the posture data.

[0198] S626: The sensor collects posture data according to F12, and stores the acquired posture data in a FIFO buffer.

[0199] S627: When all available bit widths of the FIFO buffer are occupied, the sensor sends the gesture data stored in the FIFO buffer to the sensor drive management module.

[0200] In an embodiment of the present application, after the sensor driving management module receives the posture data fed back by the sensor, it may continue to execute the operations of S628 and S629, so that the client 1 and the client 2 obtain the posture data.

[0201] S628 . The sensor drive management module feeds back the posture data to the client 1 .

[0202] S629: The sensor drive management module feeds back the posture data to the client 2.

[0203] In the implementation of the present application, when the electronic device enters the standby state, by executing the operations of S617 to S629, the available bit width of the FIFO buffer in the sensor is set to the bit width indicated by WM21. The sensor can store the collected posture data in the FIFO buffer, and send the posture data to the sensor drive management module when all the available bit widths of the FIFO buffer are occupied.

[0204] S630: When the electronic device enters the awake state, the state monitoring module sends an indication of entering the awake state to the client 1.

[0205] In an embodiment of the present application, when the client 1 receives an instruction to enter the awake state, it can continue to perform the operations of S631 and S633.

[0206] S631. Client 1 sends an instruction to configure the first flag bit to be 0 to the state storage unit.

[0207] Exemplarily, after receiving the indication of entering the awake state, the client 1 may send an indication of configuring the first flag bit to 0 to the state storage unit. In other embodiments of the present application, the indication of configuring the first flag bit to 0 may also be referred to as a second message.

[0208] S632: The state storage unit modifies the first flag bit to 0.

[0209] Exemplarily, in response to the instruction in S631, the state storage unit modifies the first flag bit to 0.

[0210] S633. Client 1 sends a subscription request 31 to the sensor driver management module.

[0211] Exemplarily, after the operation of S632 is completed, the client 1 may send a subscription request 31 to the sensor driver management module. The request 31 is used to instruct the sensor driver management module to determine the sampling frequency of the sensor and the available bit width of the FIFO buffer.

[0212] In the embodiment of the present application, after receiving the request 31, the sensor driver management module can determine the sampling frequency of the sensor and the available bit width of the FIFO buffer by executing the operations in S634 to S635.

[0213] S634: The sensor drive management module reads a first flag bit as 0 from the state storage unit.

[0214] Exemplarily, when the sensor driving management module receives the request 31, the first flag bit read from the state storage unit may be 0. When the first flag bit is 0, the sensor driving management module may continue to perform the operations of S635 and S636.

[0215] S635 , the sensor drive management module determines that T11 is less than T12 and F12 is greater than F11 , and determines the corresponding WM11 according to T11 and F12 .

[0216] S636: The sensor driver management module sends WM11 and F12 to the sensor.

[0217] In the embodiments of the present application, S635 and S636 may refer to the descriptions in S606 and S607, and the specific embodiments may refer to each other and will not be described in detail here.

[0218] It is understandable that in some implementations, WM11 is not 0. At this time, after receiving WM11, the sensor executes S637 to S640 according to the fact that WM11 is not 0, so as to feed back the posture data to the sensor drive management module.

[0219] S637: The sensor configures the available bit width of the FIFO buffer according to WM11.

[0220] S638: The sensor configures the enable flag of the FIFO buffer to 1 based on the fact that WM11 is not 0.

[0221] S639, the sensor collects posture data according to F12, and stores the acquired posture data in the FIFO buffer.

[0222] S640: When all available bit widths of the FIFO buffer are occupied, the sensor sends the posture data stored in the FIFO buffer to the sensor drive management module.

[0223] In the embodiments of the present application, S637 and S640 may refer to the descriptions in S608 and S611, and the specific embodiments may refer to each other and will not be described in detail here.

[0224] In some other implementations, WM11 is 0. At this time, after receiving WM11, the sensor executes S641 to S643 according to WM11 being 0, so as to feed back the posture data to the sensor drive management module.

[0225] S641: The sensor configures the enable flag of the FIFO buffer to 0 based on WM11 being 0.

[0226] S642, the sensor collects posture data according to F12.

[0227] S643: The sensor sends the posture data to the sensor drive management module.

[0228] In the embodiments of the present application, S641 and S643 may refer to the description in S612 and S614, and the specific embodiments may refer to each other and will not be repeated here.

[0229] After receiving the posture data fed back by the sensor, the sensor driving management module may continue to perform operations of S644 and S645, so that the client 1 and the client 2 obtain the posture data.

[0230] S644 , the sensor drive management module feeds back the posture data to the client 1 .

[0231] S645 . The sensor drive management module feeds back the posture data to the client 2 .

[0232] According to the description in S630 to S645, when the electronic device enters the awake state, the sensor driver management module determines F12 and WM11 after receiving the subscription request 31, and sends F12 and WM11 to the sensor. When WM11 is not 0, the available bit width of the FIFO buffer in the sensor is set to the bit width indicated by WM11. The sensor can store the collected posture data in the FIFO buffer, and send the posture data to the sensor driver management module when all the available bit widths of the FIFO buffer are occupied. When WM11 is 0, the sensor closes the FIFO buffer. The sensor will collect posture data based on the sampling frequency F12, and send the acquired posture data directly to the sensor driver management module.

[0233] In the above embodiment, since T21 is greater than T11, that is, when the electronic device is in the standby state, the available bit width of the FIFO buffer increases, so that the frequency of the sensor sending posture data to the sensor drive management module is reduced. In turn, the sensor control module where the sensor drive management module is located will not be frequently awakened, thereby optimizing the overall power consumption of the electronic device.

[0234] Assume that F11 is 100Hz, F12 is 50Hz, T11 is 50ms, and T12 is 0ms.

[0235] the following Figure 7 The first log of the electronic device in the standby state is shown. From the first log, it can be checked that when the electronic device is in the standby state, according to the following Figure 6 The scheme shown in the figure, the corresponding sampling frequency of the sensor, and the corresponding available bit width of the FIFO buffer in the sensor.

[0236] like Figure 7 As shown, the sampling frequency of the sensor for the gesture data is adjusted from 0 to 100 Hz, and the available bit width of the FIFO buffer is adjusted from 0 to the bit width occupied by 5 groups of gesture data. That is to say, when the electronic device is in standby mode, the sensor samples the gesture data based on 100 Hz and caches the sampled gesture data in the FIFO buffer. When the gesture data stored in the FIFO buffer reaches 5 groups, the sensor reports the gesture data in the FIFO buffer to the sensor control module.

[0237] In some embodiments of the present application, the sensor is provided with a pin 1. When the sensor feeds back the posture data to the sensor drive management module, a high level signal is outputted from the pin 1. Figure 8 , Figure 8 The first interface of the oscilloscope shows the waveform outputted from the pin 1 of the sensor when the electronic device is in the standby state during the T2 time.

[0238] like Figure 8 As shown in the figure, at times t1 and t2, a periodic high-level signal is output on pin 1. Among them, the time corresponding to t1 is 870ms, and the time corresponding to t2 is 1.20s, so the time interval between adjacent high-level signals is 50ms. That is to say, when the electronic device is in standby mode, the sensor reports the posture data to the sensor drive management module every 50ms. At this time, the sensor control module where the sensor drive management module is located is awakened every 50ms to process the posture data.

[0239] Fig. 9 The second log of the electronic device in the awake state is shown. From the second log, it is possible to check the sampling frequency corresponding to the sensor and the available bit width corresponding to the FIFO buffer in the sensor when the electronic device is in the awake state.

[0240] like Fig. 9 As shown, the sampling frequency of the sensor for the posture data is 100 Hz, and the available bit width of the FIFO buffer is 0. That is, when the electronic device is in the awake state, the sensor samples the posture data based on 100 Hz, and directly reports the sampled posture data to the sensor control module.

[0241] according to Figures 7 to 9 As described in , when the electronic device is in standby mode, the frequency of the sensor sending posture data to the sensor drive management module is reduced, so that the sensor control module where the sensor drive management module is located will not be frequently awakened, thereby reducing the overall power consumption of the electronic device.

[0242] In some other embodiments of the present application, the electronic device also includes a first application and / or a second application, the first application is used to provide a first function through the posture data collected by the sensor, and the second application is used to provide a second function through the posture data collected by the sensor.

[0243] In some implementations, the first application and the second application correspond to two different clients in the sensor module.

[0244] For example, the first application corresponds to client 1, the second application corresponds to client 2, and client 2 supports functions such as standing posture recognition. The first application can be used to provide a step counting function supported by client 1 through posture data collected by the sensor. The second application can be used to provide a standing time statistics function supported by client 2 through posture data collected by the sensor.

[0245] In some other implementations, the first application and the second application may correspond to the same client in the sensor module.

[0246] For another example, the first application and the second application correspond to client 1, and the first application can be used to provide a step counting function supported by client 1 through gesture data collected by the sensor. The second application can be used to provide a hand-raising screen-lighting function supported by client 1 through gesture data collected by the sensor.

[0247] Exemplary, reference Fig.10 , taking the electronic device running the first application, the first application corresponding to the client 1 as an example, the electronic device can run the first application when the user inputs the first operation. The first operation is used to instruct the electronic device to run the first application. When the first application is running, it can be based on Fig.10 In the solution shown, first function information is obtained to implement the first function. The first function information corresponds to the first function.

[0248] like Fig.10 As shown, the program includes:

[0249] S1001. When a first application is running, it subscribes to first function information from a sensor driver management module.

[0250] For example, taking the first function as a pedometer function, the first function information is real-time step count information.

[0251] Exemplarily, when the first application starts running, it can send a first message to the client 1. After receiving the first message, the client 1 sends a first subscription request to the sensor drive management module to subscribe to the posture data. The first subscription request includes a reporting interval T11 and a sampling frequency F11. The client 1 can be used to determine the real-time step count information based on the posture data. In this way, the first application can obtain the step count information from the client 1.

[0252] It can be understood that when the electronic device receives the first operation from the user and runs the first application, the electronic device is in the awake state.

[0253] In some other embodiments of the present application, the second application in the electronic device subscribes to the second function information from the sensor drive management module, the second function information corresponds to the second functionality, and the second application corresponds to the client 2.

[0254] Similar to the first application, the client 2 can subscribe to the second function information by subscribing to the posture data from the sensor drive management module.

[0255] The following description takes the first application and the second application as examples.

[0256] S1002: When the electronic device is in an awake state, a first application receives first function information at a first frequency.

[0257] When the electronic device is in the awake state, Figure 6 The operations from S631 to S645 in the above method enable the client 1 to receive the posture data sent by the sensor drive management module. After acquiring the posture data, the client 1 can send the step count information corresponding to the posture data to the first application. In this way, the first application can update the step count information based on the first frequency.

[0258] S1003: When the electronic device enters a standby state, the first application receives first function information at a second frequency.

[0259] Exemplarily, when the electronic device enters the standby state, when the client 1 subscribes to the first function information from the sensor drive management module, it can send a second subscription request to the sensor drive management module to subscribe to the posture data.

[0260] As a specific implementation, when the electronic device enters the standby state, Figure 6 The operations from S617 to S629 enable the sensor drive management module to send the posture data to the client 1. After acquiring the posture data, the client 1 can send the step number information corresponding to the posture data to the first application. In this way, the first application can update the step number information based on the second frequency.

[0261] Combination Figure 6 As described in S622, since T21 is greater than T11, the sensor drive management module reduces the frequency of sending gesture data to the client 1 when the electronic device enters the standby state. Correspondingly, when the electronic device enters the standby state, the client 1 also reduces the frequency of sending the first function information to the first application. In other words, the second frequency is less than the first frequency.

[0262] It should be noted that the above example is based on an example in which the electronic device is first in an awake state and then enters a standby state to illustrate the frequency of the first application receiving step information and standing time.

[0263] In some other embodiments of the present application, the electronic device may be in a standby state first and then enter a wake-up state. When the electronic device is in a standby state, the first application receives the step count information and the standing time at a second frequency. When the electronic device enters a standby state, the first application receives the step count information and the standing time at a first frequency. For specific implementation methods, reference may be made to the descriptions in S1003 and S1002, which will not be repeated here.

[0264] In some other embodiments of the present application, the electronic device may be in a standby state. When the electronic device is in the standby state, the first application receives the step count information and the standing time at the second frequency. The specific implementation method can refer to the description in S1003, which will not be repeated here.

[0265] In some other embodiments of the present application, the electronic device may be in an awake state. When the electronic device is in an awake state, the first application receives the step count information and the standing time at a first frequency. The specific implementation method can refer to the description in S1002, which will not be repeated here.

[0266] It should be noted that in Figures 6 to 10 In the description, the ACC and gyro sensors are used as examples to illustrate the method of setting the frequency of sensor data reporting. In other embodiments of the present application, the electronic device can also perform the following steps for other types of sensors: Figure 6 and Fig.10 The method is used to set the frequency of sensor data reporting and optimize the overall power consumption of the electronic device.

[0267] The above integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0268] For example, Fig.11 FIG. 1 is a schematic diagram showing the composition of an electronic device 1100. Fig.11As shown, the electronic device 1100 may include: a processor 1101, a memory 1102, and a sensor 1103. The memory 1102 is used to store computer execution instructions, and the sensor 1103 is used to collect posture data. Exemplarily, in some embodiments, when the processor 1101 executes the instructions stored in the memory 1102, the electronic device 1100 may execute any of the technical solutions shown in the above embodiments.

[0269] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0270] Fig.12 A schematic diagram of the composition of a chip system 1200 is shown. The chip system 1200 may include: a processor 1201 and a communication interface 1202, which are used to support related devices to implement the functions involved in the above embodiments. In a possible design, the chip system also includes a memory for storing program instructions and data necessary for electronic devices. The chip system may be composed of chips, or may include chips and other discrete devices. It should be noted that in some implementations of the present application, the communication interface 1202 may also be referred to as an interface circuit.

[0271] In other embodiments of the present application, the chip system 1200 may further include at least one sensor driver management, a first virtual client, a state monitoring module and a state storage unit.

[0272] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0273] The functions or actions or operations or steps in the above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or may include one or more servers, data centers and other data storage devices that can be integrated with the medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0274] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A power consumption control method, characterized in that: The method is applied to an electronic device, the electronic device is installed with a first application, the electronic device also includes a first sensor, the first application is used to provide a first function through first data collected by the first sensor; the electronic device receives a first operation, the first operation is used to instruct the electronic device to run the first application; In response to the first operation, the electronic device runs the first application; the method includes: The first application subscribes to first function information, where the first function information is obtained based on the first data and corresponds to the first function; The electronic device is in an awake state, and a frequency at which the first application receives the first function information is a first frequency; The electronic device is in a standby state, and the frequency at which the first application receives the first function information is a second frequency; the second frequency is smaller than the first frequency.

2. The method according to claim 1, characterized in that The method further comprises: The electronic device switches from the awake state to the standby state, and the frequency at which the first application receives the first function information switches from the first frequency to the second frequency.

3. The method according to claim 1 or 2, characterized in that: The first application subscribes to the first function information from the sensor drive management module, including: The first application subscribes to the first data from the sensor driver management module.

4. The method according to claim 3, characterized in that The electronic device further includes a first virtual client, and the subscribing to the first data includes: The first application sends a first message to the first virtual client; After receiving the first message, the first virtual client sends a first subscription request to the sensor driver management module to subscribe to the first data; wherein the first subscription request includes a first reporting interval and a first sampling frequency; the first virtual client is used to determine the first function information corresponding to the first data; The method further comprises: The first virtual client obtains the first data from the sensor drive management module; The first application obtains the first function information from the first virtual client.

5. The method according to any one of claims 1 to 4, characterized in that The first sensor is configured with a first-in-first-out FIFO buffer, and the FIFO buffer is used to cache the first data; the method further includes: Setting the available bit width of the FIFO buffer; When the first data stored in the FIFO buffer reaches the available bit width of the FIFO buffer, the first sensor sends the first data stored in the FIFO buffer to the sensor driving management module.

6. The method according to claim 5, characterized in that The step of setting the available bit width of the FIFO buffer comprises: Setting the available bit width of the FIFO buffer by the first sensor to correspond to a first watermark, wherein the first watermark is determined by the sensor driving management module according to a second sampling frequency and a second time interval; Among them, the second sampling frequency is greater than or equal to the first sampling frequency; the second time interval is less than or equal to the first time interval; the second sampling frequency and the first watermark are obtained by the first sensor from the sensor driver management module.

7. The method according to claim 6, characterized in that The method further comprises: According to the first watermark not being 0, the first sensor collects the first data according to the second sampling frequency; Alternatively, according to the first watermark being 0, the first sensor collects the first data according to the second sampling frequency, and sends the collected first data to the sensor drive management module.

8. The method according to any one of claims 5 to 7, characterized in that: The electronic device is provided with a first flag, and the first flag is used to indicate that the electronic device enters a standby state or an awake state; wherein the first flag includes a first value or a second value; the first value corresponds to the electronic device entering a standby state, and the second value corresponds to the electronic device entering an awake state; the electronic device also includes a state storage unit, and the state storage unit is used to configure and store the first flag; before the first virtual client sends the first subscription request to the sensor drive management module, the method further includes: The first virtual client sends a second message to the state storage unit; After receiving the second message, the state storage unit configures the first flag bit to the second value.

9. The method according to claim 8, characterized in that After the first virtual client sends the first subscription request to the sensor driver management module, the method further includes: The sensor driving management module reads the first flag bit from the state storage unit as the second value; The sensor driving management module determines the second sampling frequency and the second time interval according to the first flag bit being the second value.

10. The method according to claim 8 or 9, characterized in that: The electronic device further comprises a state monitoring module, wherein the state monitoring module is used to detect whether the electronic device enters a standby state and whether it enters a wake-up state; Before the first virtual client sends the second message to the state storage unit, the method further includes: The first virtual client registers the status of the electronic device with the status monitoring module; So that the first virtual client obtains the status of the electronic device.

11. The method according to any one of claims 8 to 10, characterized in that: The step of setting the available bit width of the FIFO buffer comprises: The first sensor modifies the available bit width of the FIFO buffer to a second watermark, where the second watermark is determined by the sensor driving management module according to the second sampling frequency and a third time interval; The third time interval is greater than the second time interval; and the second watermark is obtained by the first sensor from the sensor driver management module.

12. The method according to claim 11, characterized in that The method further comprises: According to the second watermark being not 0, the first sensor collects the first data according to the second sampling frequency, and stores the collected first data in the first FIFO buffer.

13. The method according to claim 11 or 12, characterized in that: Before the first sensor modifies the available bit width of the FIFO buffer to the second watermark, the method further includes: The first virtual client sends a second subscription request to the sensor driver management module; The first sensor modifies the available bit width of the FIFO buffer to a second watermark, including: When the sensor driving management module receives the second subscription request, the first sensor modifies the available bit width of the FIFO buffer to a second watermark.

14. The method according to claim 13, characterized in that Before the first virtual client sends a second subscription request to the sensor driver management module, the method further includes: The first virtual client sends a third message to the state storage unit; After receiving the third message, the state storage unit configures the first flag bit to the first value.

15. The method according to claim 14, characterized in that After the first virtual client sends a second subscription request to the sensor driver management module, the method further includes: The sensor driving management module reads the first flag bit from the state storage unit as the first value; The sensor driving management module determines the second sampling frequency and the third time interval according to the first flag bit being the first value.

16. The method according to claim 14 or 15, characterized in that Before the first virtual client sends the third message to the state storage unit, the method further includes: The first virtual client receives a fourth message, and the fourth message corresponds to the electronic device entering a standby state; the fourth message is sent by the state detection and control module.

17. The method according to any one of claims 10 to 16, characterized in that The electronic device is provided with a first chip system and a second chip system; the first application is configured on the first chip system; the first virtual client, the state monitoring module, the sensor drive management module and the state storage unit are configured on the second chip system.

18. The method according to any one of claims 1 to 17, characterized in that The electronic device also includes a first application processor, which is configured with the first application. When the electronic device is in a standby state, the first application processor is in a dormant state; when the electronic device is in an awake state, the first application processor is in an awake state.

19. A power consumption control method, characterized in that: The method is applied to an electronic device, the electronic device is installed with a first application, the electronic device further includes a first sensor, and the electronic device is further configured with a sensor drive management module; The sensor drive management module is used to report the first data collected by the first sensor to the first application, and the first application is used to provide a first function through the first data; the method includes: The sensor driving management module receives first function information subscribed by the first application, where the first function information is obtained based on the first data and corresponds to the first function; The electronic device is in an awake state, and the sensor drive management module reports the first function information to the first application at a first frequency; The electronic device enters a standby state, and the sensor drive management module reports the first function information to the first application at a second frequency; the second frequency is lower than the first frequency.

20. An electronic device, characterized in that: The electronic device is installed with a first application, and the electronic device includes one or more processors, one or more memories, and a first sensor; the one or more memories are coupled to the one or more processors; the first sensor is used to collect first data, and the first application is used to provide a first function through the first data collected by the first sensor; the one or more memories store computer instructions; When the one or more processors execute the computer instructions, the electronic device is caused to perform the method as described in any one of claims 1-19.

21. A chip system, characterized in that: The chip system includes a processor and a communication interface; the processor is used to call and run a computer program stored in a storage medium from the storage medium to execute the method as described in any one of claims 1-19.

22. The chip system according to claim 21, characterized in that: The chip system includes at least one first module, a second module, a third module, and a fourth module; the first module corresponds to the sensor driver management in claims 3-19, the second module corresponds to the first virtual client in claims 4-19, the third module corresponds to the status monitoring module in claims 10-19; the fourth module corresponds to the status storage unit in claims 8-19.