WO2020155055A1 - 一种降低功耗的方法和电子设备 - Google Patents

一种降低功耗的方法和电子设备 Download PDF

Info

Publication number
WO2020155055A1
WO2020155055A1 PCT/CN2019/074270 CN2019074270W WO2020155055A1 WO 2020155055 A1 WO2020155055 A1 WO 2020155055A1 CN 2019074270 W CN2019074270 W CN 2019074270W WO 2020155055 A1 WO2020155055 A1 WO 2020155055A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
power consumption
front camera
human body
preset
Prior art date
Application number
PCT/CN2019/074270
Other languages
English (en)
French (fr)
Inventor
邵明明
钟小飞
王金波
李刚
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2019/074270 priority Critical patent/WO2020155055A1/zh
Priority to CN201980088001.7A priority patent/CN113260949B/zh
Publication of WO2020155055A1 publication Critical patent/WO2020155055A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power

Definitions

  • This application relates to the field of electronic devices, and more specifically, to a method and electronic device for reducing power consumption.
  • the present application provides a method and electronic device for reducing power consumption, which help reduce the power consumption of the electronic device and increase the use time of the electronic device.
  • the first aspect provides a method for reducing power consumption.
  • the method can be applied to an electronic device that is in a stationary state.
  • the electronic device includes a front camera and a pyroelectric sensor.
  • the method includes: the electronic device obtains the pyroelectric sensor. The output signal of the electrical sensor; when the change in the output signal satisfies the first preset condition, the electronic device determines that the person or animal is far away from the electronic device; the electronic device turns on the front camera and determines that the image captured by the front camera is not included Including human body characteristics; the electronic device reduces the power consumption of the electronic device and automatically turns off the front camera; when the change in the output signal of the pyroelectric sensor satisfies the second preset condition, the electronic device determines that a person or animal is approaching the Electronic device; the electronic device turns on the front camera and determines that the image collected by the front camera includes human features; the electronic device restores the power consumption of the electronic device and automatically turns off the front camera, the first preset condition and the The
  • the first aspect provides a method for reducing power consumption.
  • the pyroelectric sensor detects that people or animals are far away from the electronic device, then turns on the front camera and determines that the image collected by the front camera does not include human characteristics, thereby reducing the power of the electronic device. It helps to solve the problem of wasting the power of the electronic device when there is no interaction, and it will not significantly affect the user experience.
  • the pyroelectric sensor first detects that a person or animal is approaching the electronic device, and then turns on the front camera and determines that the image collected by the front camera includes human characteristics, thereby restoring the power consumption of the electronic device without the need for the user to manually pass on the touch screen The touch or press operation restores the power consumption of the electronic device.
  • the electronic device in a stationary state can be that the user keeps the electronic device still when the user holds the electronic device, or the electronic device is fixed on a stand to remain still, or the electronic device can also be stationary on the desktop.
  • the method further includes: the electronic device detects a user's touch or key operation on the touch screen of the electronic device, or, The electronic device detects that the electronic device moves; the electronic device restores the power consumption of the electronic device.
  • the first preset condition includes: the duration from outputting a pulse signal to not outputting a pulse signal and not outputting a pulse signal is greater than or equal to the first preset duration;
  • the second preset condition includes: never outputting a pulse signal to outputting a pulse signal, and the duration of the output pulse signal is greater than or equal to the second preset duration.
  • the first preset condition further includes: the waveform change frequency of the pulse signal output by the pyroelectric sensor changes from greater than or equal to the first frequency threshold to less than or equal to the second frequency threshold, where the first A frequency threshold is greater than the second frequency threshold.
  • the second preset condition further includes: the waveform change frequency of the pulse signal output by the pyroelectric sensor changes from less than the second frequency threshold to greater than or equal to the first frequency threshold, where the first frequency The threshold is greater than the second frequency threshold.
  • the method further includes: when the time interval from reducing the power consumption of the electronic device to restoring the power consumption of the electronic device is greater than or equal to a third preset duration , The electronic device reduces the first preset duration; or, when the time interval from reducing the power consumption of the electronic device to restoring the power consumption of the electronic device is less than the third preset duration, the electronic device increases the first preset duration Set the duration.
  • the electronic device after the electronic device enters the low power consumption state, the user immediately manually triggers the exit of low power consumption (or, the duration of the electronic device from low power consumption to recovery power consumption is less than the third preset duration),
  • the electronic device can restore normal power consumption and start to update the first preset duration (for example, increase the first preset duration according to the preset change value), so that the first preset duration is more in line with the user's habits, and at the same time, It helps to improve the accuracy of the electronic device's judgment of the user's motion state.
  • the electronic device after the electronic device enters the low-power state, it takes a long time for the user to manually trigger the exit of low-power consumption (or, the duration of the electronic device from low power consumption to recovery power consumption is greater than or equal to the third Preset duration), the electronic device can resume normal power consumption, and start to update the first preset duration (for example, lower the first preset duration according to the preset change value), so that the first preset duration is more suitable for the user Being used to, at the same time, electronic devices enter a low power consumption state more quickly, which also helps to save the power consumption of electronic devices.
  • the first preset duration for example, lower the first preset duration according to the preset change value
  • the method further includes: when the time interval from reducing the power consumption of the electronic device to restoring the power consumption of the electronic device is greater than or equal to a fourth preset duration , The electronic device reduces the detection period and/or the number of detections of the front camera; or, when the time interval from reducing the power consumption of the electronic device to restoring the power consumption of the electronic device is less than the fourth preset time period, the electronic device The device increases the detection cycle and/or detection times of the front camera.
  • the human body feature can be detected according to the preset detection period and/or the number of detections. Thereafter, the electronic device may adjust the detection period and/or the number of detections according to the time interval from reducing the power consumption of the electronic device to recovering the power consumption of the electronic device.
  • the number of times of detection is the number of times that the human body feature is continuously detected.
  • the number of detections may also be the number of detections.
  • the electronic device After the front camera is turned on, the electronic device starts to detect in a certain detection cycle. When the number of times that the human body feature is not detected continuously reaches the first value, the power consumption of the electronic device is reduced and the front camera is turned off; when the human body feature is continuously detected When the number of times reaches the first value, the power consumption of the electronic device is restored and the front camera is turned off, and the first value includes an integer greater than 1.
  • the detection period is assigned an initial value, and the upper and lower limits of the value are limited.
  • the fixed change update once successful, can reduce the duration of a detection cycle according to the preset change. After reducing the power consumption, the user triggers the recovery in a short time, and the duration of a detection cycle is increased according to the preset change. Adopting this supplementary technical solution helps to realize that for users who often leave for a long time, the electronic device enters low power consumption faster; for users who leave for a short time, the detection period of the electronic device is lengthened, which improves the electronic device's movement status to the user The accuracy of the judgment.
  • the detection period may be a period for the front camera to detect human features, and the detection period may be a time period during which the front camera detects the human body characteristics.
  • the number of detections of human body characteristics is assigned an initial value, and the upper and lower limits of the value are limited.
  • the human body characteristics are detected according to the initial value of the number of detections.
  • the number of successes is updated with a fixed amount of change.
  • the value of the number of times of detection based on the preset amount of change is reduced.
  • the user triggers the recovery in a short time, and the value of the number of times of detection is increased according to the preset amount .
  • the number of detections may be the number of times that the front camera detects human features.
  • the number of detections may be the number of times that the front camera continuously detects human features. For example, if the number of detections is N, and N is a positive integer greater than 1, the electronic device determines the image captured by the front camera The inclusion of the human body feature in the EM can also be understood as the electronic device determining that the image collected by the front camera includes the human body feature in N consecutive detection cycles.
  • the electronic device reduces the power consumption of the electronic device, including one or more of the following: switching the display screen of the electronic device from a bright screen state to a black screen state, The electronic device reduces the brightness of the display; the electronic device reduces the operating frequency of the system; the electronic device switches the high-power audio parameters to low-power audio parameters; the electronic device reduces the refresh rate of the Wi-Fi module; the electronic device reduces the Bluetooth The refresh frequency of the module.
  • the human body characteristics include one or more of human body characteristic information, human body trunk information, human body limb information, and human head shape information.
  • a second aspect provides an electronic device with reduced power consumption, the electronic device is included in an electronic device, and the electronic device has the function of realizing the foregoing aspects and the behavior of the electronic device in the possible implementation manners of the foregoing aspects.
  • the function can be realized by hardware or by designing corresponding software.
  • the hardware or software includes one or more modules or units corresponding to the above-mentioned functions.
  • a third aspect provides an electronic device that includes a processor, a memory, a front camera, and a pyroelectric sensor; the front camera is used to acquire image data; the pyroelectric sensor is used to acquire human or animal emissions The infrared rays are converted into electrical signals for output; the memory is used to store instructions; the processor is used to execute the instructions in the memory, so that the electronic device realizes the above-mentioned first aspect and the possible implementation of the first aspect to reduce power consumption Methods.
  • a fourth aspect provides an electronic device, which includes a touch screen, a memory, one or more processors, a front camera, a pyroelectric sensor, multiple application programs, and one or more programs; among them, one or more A program is stored in the memory; when one or more processes are executing the one or more programs, the electronic device is enabled to implement the foregoing first aspect and the method for reducing power consumption in the possible implementation manners of the first aspect.
  • a fifth aspect provides a computer storage medium, including instructions, which when the instructions run on an electronic device, cause the electronic device to execute the method for reducing power consumption in any of the foregoing possible implementations.
  • a sixth aspect provides a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute the method for reducing power consumption in any of the foregoing possible implementations.
  • FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Figure 2 is the spectral distribution curve of human body radiation.
  • Fig. 3 is a schematic block diagram of a system architecture of an electronic device provided by an embodiment of the present application.
  • Fig. 4 is a schematic diagram of a user when away from or approaching an electronic device according to an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method for reducing power consumption provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram of the structure of a pyroelectric sensor.
  • FIG. 7 is a schematic diagram of four states of the existence of a user and an electronic device provided by an embodiment of the present application.
  • FIG. 8 is another schematic flowchart of a method for reducing power consumption provided by an embodiment of the present application.
  • FIG. 9 is a schematic block diagram of an electronic device for reducing power consumption provided by an embodiment of the present application.
  • FIG. 10 is another schematic structural diagram of an electronic device for reducing power consumption provided by an embodiment of the present application.
  • the method for reducing power consumption provided by the embodiments of this application can be applied to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) devices, virtual reality (VR) devices, laptop computers, and super Mobile personal computers (ultra-mobile personal computers, UMPC), netbooks, personal digital assistants (personal digital assistants, PDAs) and other electronic devices, can also be applied to automatic teller machines (automatic teller machines), courier cabinets, etc. through touch screens
  • the embodiment of the present application does not impose any restriction on the specific type of electronic device.
  • FIG. 1 shows a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, touch screen 194, and user
  • An identification module subscriber identification module, SIM
  • the sensor module 180 may include pressure sensor 180A, gyroscope sensor 180B, air pressure sensor 180C, magnetic sensor 180D, acceleration sensor 180E, pyroelectric sensor 180F, proximity light sensor 180G, acceleration sensor 180H, temperature sensor 180J, touch sensor 180K, One or more of the ambient light sensor 180L and the bone conduction sensor 180M.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART mobile industry processor interface
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the electronic device 100.
  • the electronic device 100 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used for connecting the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the touch screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the electronic device 100 implements a display function through a GPU, a touch screen 194, and an application processor.
  • the GPU is a microprocessor for image processing, connected to the touch screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the touch screen 194 is used to display images, videos, etc.
  • the touch screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light emitting diode (active-matrix organic light emitting diode). Diode, AMOLED), flexible light-emitting diode (FLED), Mini LED, Micro LED, Micro-OLED, quantum dot light emitting diode (QLED), etc.
  • the electronic device 100 may include one or N touch screens 194, and N is a positive integer greater than one.
  • the electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a touch screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • the camera 193 can be divided into a front camera and a rear camera.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • the NPU can realize applications such as intelligent cognition of the electronic device 100, such as image recognition, human body feature recognition, voice recognition, text understanding, and so on.
  • the electronic device 100 can turn on the camera 193 to collect images, and the processor (for example, NPU) can determine whether the image collected by the camera 193 includes the human body characteristics of the user.
  • the processor for example, NPU
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • UFS universal flash storage
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the touch screen 194.
  • the capacitive pressure sensor may include at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch location but have different touch operation strengths may correspond to different operation instructions. For example: when a touch operation whose intensity of the touch operation is less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
  • the pyroelectric sensor 180F includes pyroelectric infrared sensors, etc.; the pyroelectric sensor 180F focuses on the infrared signal emitted by people or animals within a certain range in front of the electronic device 100 through the adjusted lens, and is filtered to the pyroelectric by the filter On the sensing unit of the sensor 180F, the sensing unit will lose the charge balance when the temperature changes when it receives infrared radiation from humans or animals, so the signal output terminal of the pyroelectric sensor 180F will output a signal to the processor 110, 110 can determine that a person or an animal is approaching or away from the electronic device according to the change of the signal output by the pyroelectric sensor 180F.
  • the processor 110 when the processor 110 determines that a person or an animal is far away through the output signal of the pyroelectric sensor 180F, it can control the front camera to collect images.
  • the front camera can provide color or depth images, and the front camera can The collected image data is sent to the processor 110 for analysis and processing.
  • the processor 110 detects that there is no human feature information in the image collected by the front camera, the processor 110 can reduce the power consumption of the electronic device 100.
  • the processor 110 can also turn off the front camera while reducing the power consumption of the electronic device 100.
  • the processor 110 determines that a person or an animal is approaching through the output signal of the pyroelectric sensor 180F, it can control to turn on the front camera to collect images, and the front camera sends the collected images to the processor 110 for analysis and processing.
  • the processor 110 detects that there are human features in the image collected by the front camera, the processor 110 can restore the power consumption of the electronic device 100.
  • the processor 110 may also turn off the front camera while restoring the power consumption of the electronic device 100.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 100 emits infrared light to the outside through the light emitting diode.
  • the electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100.
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, and the pocket mode will automatically unlock and lock the screen.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the touch screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
  • the acceleration sensor 180H is installed on the internal circuit board of the electronic device and is connected to the processor through the I2C interface. It can provide high-precision x, y, and z three-axis acceleration values to detect whether the device is moving.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be provided on the touch screen 194, and the touch screen is composed of the touch sensor 180K and the touch screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the touch screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the touch screen 194.
  • FIG. 3 shows a schematic block diagram of the system architecture of the electronic device 100 provided by an embodiment of the present application.
  • the system architecture consists of the user detection and power control module 110 in the Framework layer, the execution adaptation subsystem 120 in the Daemon service in the Native layer, and the hardware abstraction layer and the kernel (HAL&Driver) layer.
  • the kernel adaptation subsystem 130 constitutes.
  • the execution adaptation subsystem 120 may include a Wi-Fi service module and a Bluetooth service module in the resident service;
  • the kernel adaptation subsystem 130 may include a touch screen module, an audio module, a Wi-Fi module, and a Bluetooth module.
  • the role of the user detection and power consumption control module 110 is to identify whether there is an interactive state and to perform power consumption optimization and recovery decisions in the corresponding state.
  • the lock state switching perception module recognizes scenarios such as applications (APP) holding the lock screen for a long time, and the user setting to automatically sleep for a long time, and detects the proximity and distance of the human body, and makes a decision whether to optimize the power consumption after the human body is far away.
  • APP applications
  • the touch, key, and position detection module is used to identify when the human body moves from far away to approaching when operating the electronic device, and make a decision whether to restore power consumption after the identification passes.
  • the lock state is divided into the locked state and the unlocked state.
  • the locked state and the unlocked state can be applied to the application.
  • the locked state can be understood as the application applying for and holding the lock.
  • the purpose of holding the lock is to allow the application to continue to run.
  • the unlocked state can be understood as the application requesting to release the lock and entering the unlocked state.
  • the lock may include a screen bright wake lock. When an application holds a screen bright wake lock, the electronic device will keep the CPU running during the running of the application, allowing the screen to be highlighted, and allowing the keyboard light to be turned off.
  • the video playback APP when a user opens a video playback APP to play a video, the video playback APP first applies to the power manager module in the framework layer to hold the screen highlight lock, so that when the user watches the video through the video playback APP, the electronic device will not Turn off the screen and enter the dormant state.
  • the execution adaptation subsystem 120 is the local part of the execution of power optimization and recovery actions. This part provides the connection function from the framework layer to the hardware abstraction layer and the kernel layer, and transfers the power control function called by Java to the function execution function of the kernel.
  • the core adaptation subsystem 130 is the core part of the power consumption optimization and recovery action execution. This part provides the bottom function function of power consumption control for the upper layer to call at an appropriate time.
  • Power consumption optimization includes, but is not limited to: switching the display screen of the electronic device from a bright screen state to a black screen state, lowering the brightness of the display screen of the electronic device, reducing the system operating frequency of the electronic device, and changing the audio frequency of the electronic device.
  • the parameters are switched from high-power audio parameters to low-power audio parameters, reducing the refresh frequency of the Wi-Fi module of the electronic device, and reducing one or more of the refresh frequency of the bluetooth (BT) module of the electronic device.
  • BT bluetooth
  • the hardware abstraction layer and the kernel layer in the embodiments of the present application can also be divided into two layers, namely the hardware abstraction layer and the kernel layer. Because the hardware abstraction layer and the kernel layer all store touch screens, audio, and Wi-Fi , Bluetooth has different functional functions, so for convenience, in the embodiments of this application, the hardware abstraction layer and the kernel layer are unified together and described as the hardware abstraction layer and the kernel layer.
  • the embodiment of the present application provides a method and electronic device for reducing power consumption, which intelligently detects whether a user is interacting with the electronic device. When no user interaction is detected, a series of measures are adopted to reduce the power consumption according to the current operating scenario of the electronic device. Power consumption; the power consumption of the electronic device is restored when it is detected that the user restarts the interaction. In this process, the electronic device can automatically identify whether there is user interaction, and reduce and restore power consumption without manual operation by the user.
  • an entry can be set on the electronic device, allowing the user to turn it on and off in real time, and set a time without interaction.
  • FIG. 4 shows a schematic diagram of a user moving away from or approaching an electronic device according to an embodiment of the present application. As shown in FIG. 4, when the user is far away from the electronic device, the electronic device enters a low power consumption state; when the user approaches the electronic device, The electronic device resumes normal power consumption.
  • the query is initiated to see whether the user has entered a long-term interaction scene.
  • the scene includes but is not limited to the following:
  • the user sets a sleep duration that exceeds the threshold
  • the electronic device When the electronic device meets one or more of the above conditions, first check whether the electronic device (for example, the tablet computer shown in Figure 4) has been stationary for a period of time, if not, continue to wait; if it has been stationary for a period of time, Then the pyroelectric sensor is activated to detect the approach or distance of people or animals in real time. The current state is maintained when the approach or distance of a person or animal is not detected; when the approach or distance of a person or animal is detected, the front camera is activated to identify human body characteristics, thereby determining the interaction state of the electronic device and the user.
  • the electronic device for example, the tablet computer shown in Figure 4
  • FIG. 5 shows a schematic flowchart of a method 300 for reducing power consumption according to an embodiment of the present application. As shown in FIG. 5, the method 300 includes:
  • S301 The electronic device activates the acceleration sensor.
  • S302 The electronic device determines whether the electronic device has been stationary for a period of time.
  • the electronic device obtains the agent of the sensor manager module from the framework layer through the user detection and power consumption control module 110 in FIG. 3. Specifically, the electronic device obtains the agent of the acceleration sensor management module in the sensor management module, and Register a fixed sampling rate P (unit: times/s) to the framework layer through the acceleration sensor management module, such as a 1Hz acceleration sensor listener, and calculate the x, y, z axis acceleration from the raw data reported by the bottom layer in the monitoring processing function .
  • the touch, key, and position detection module maintains a list L of acceleration history values within a fixed time period T (unit: s). The list is updated each time the data is performed by the monitoring processing function in a first-in-first-out manner.
  • the list L is filled for the first time, and the root mean square error of the x, y, and z axis acceleration values in the list L is calculated. If the root mean square error of the three values is within the first threshold range, it is determined that the electronic device has been in a static state for a period of time; if the root mean square error of the three values is not within the first threshold range, then continue to wait.
  • the monitoring function processes and updates the t*P group of data. At this time, the root mean square error X rmse of the x, y, and z axis acceleration values in the list L is calculated again, and it is judged whether it is within the threshold range, and so on. In this way, the stationary judgment standard can be determined by customizing the first threshold range, which is more customizable.
  • the calculation method of the variance X rmse of the acceleration values of the x, y, and z axes can be as shown in formula (1):
  • X rmse is the root mean square error of the acceleration values of the x, y, and z axes
  • N is 3
  • x t is the current acceleration value of the x-axis, y-axis or z-axis
  • x avg is the x-axis, y-axis in the history list Or the average acceleration of the z-axis.
  • the first threshold value range is (0, 0.06).
  • S301 to S302 are optional steps, because these two steps may have been executed one time before S302.
  • S304 The electronic device judges whether human or animal movement is detected.
  • a pyroelectric sensor may be used to detect human or animal motion, where the human or animal motion includes the human or animal approaching or moving away from the electronic device.
  • a crystal with a pyroelectric effect in a pyroelectric sensor will cause a temperature change when receiving infrared radiation from a human or animal, the charge in the crystal moves, and a certain amount of charge is generated at both ends, which is amplified by the circuit. , Can output high and low levels, or pulse signals.
  • the pyroelectric sensor Since the pyroelectric sensor generates electric charge only when it receives changes in external infrared radiation, it generates electric potential at both ends, and then the electric charge will be balanced again, and the electric potential disappears. Therefore, it is only sensitive to moving infrared radiation sources and cannot be detected. When a person or animal is moving, it is impossible to judge whether the person or animal is stationary or not in the detection area.
  • the pyroelectric sensor only needs to receive external infrared light and simple circuit processing when working, so the power consumption is extremely low, it has high real-time performance when it is normally open, and the cost is low.
  • Fig. 6 shows a schematic structural diagram of a pyroelectric sensor.
  • the pyroelectric sensor includes 3 pins: pin “1" is connected to the positive electrode of the power supply, pin “2" is connected to the signal output terminal, Pin “3" is connected to the negative pole of the power supply.
  • the filter can effectively pass the infrared rays radiated by humans or animals, and prevent the infrared rays in visible light such as sunlight and lights from passing through, so as not to cause interference;
  • the sensing unit can be the above-mentioned pyroelectric effect Crystals.
  • the pyroelectric infrared sensor does not detect the infrared radiation signal of human or animal, and the two sensing units are connected in series with opposite polarities, the electric charge generated due to the influence of the ambient temperature is offset, and the pyroelectric sensor has no voltage output.
  • the infrared radiation energy irradiated on the sensing unit is equal, and the same amount of opposite charges are generated on the sensing unit, and the pyroelectric sensor has no voltage output.
  • the infrared radiation generated by the person or animal makes the energy of the infrared radiation received on the two sensing units different, and the sensor generates different voltages before the sensor outputs electricity. signal.
  • the pyroelectric sensor in the embodiments of the present application can also be called a pyroelectric infrared sensor; since the pyroelectric sensor itself does not emit any form of energy, it only receives infrared light to complete the detection, so the pyroelectric sensor
  • the sensor can also be called a passive pyroelectric infrared sensor (passive pyroelectric infrared sensor).
  • Fig. 7 shows a schematic diagram of the four states of the user and the electronic device provided by an embodiment of the present application. As shown in Fig. 7, there are four states of the user and the electronic device: the user is in front of the electronic device (interacting), and the user is in Far away, the user is not in front of the electronic device (not interacting), and the user is approaching.
  • the ideal state switching sequence is the clockwise sequence shown in FIG. 7 above, but there are also cases where the user changes his mind while moving away and returns to the front of the electronic device.
  • the electronic device uses the output signal of the pyroelectric sensor to detect the user's movement state in real time, and activates the front camera to identify and confirm the human body characteristics when the movement of a human or animal is detected. When no movement of a human or animal is detected, Keep the previous state.
  • the following describes the process of electronic equipment using the output signal of the pyroelectric sensor to detect the movement of people or animals.
  • the pyroelectric sensor focuses the infrared light emitted by humans or animals onto the pyroelectric crystal through a lens, and at the same time produces alternating infrared radiation high sensitive areas and blind areas.
  • the output signal voltage of the pyroelectric sensor is in pulse form, and the frequency is changed by The speed of human or animal movement is determined.
  • the pyroelectric sensor normally outputs a pulse signal, and the processor of the electronic device can determine that there are people or animals in front of it.
  • the pyroelectric sensor of the electronic device When a person or animal approaches an electronic device, the pyroelectric sensor of the electronic device never outputs a pulse signal to output a pulse signal.
  • the processor of the electronic device detects that the voltage state output by the pyroelectric sensor before is 0, and from a certain moment When the pulse signal starts to be output normally and the duration of the output pulse signal is greater than or equal to the second preset duration (for example, 1s), the electronic device can determine that a person or an animal is approaching.
  • the second preset duration for example, 1s
  • the pyroelectric sensor of the electronic device changes from outputting a pulse signal to not outputting a pulse signal.
  • the processor of the electronic device detects that the pyroelectric sensor outputs a normal pulse signal, and from a certain moment If the pulse signal is no longer output and the pulse signal is not output for a period of time greater than or equal to the second preset period of time (for example, 1s), the processor of the electronic device may determine that the human or animal is far away from the electronic device.
  • the electronic device can also filter out this part of the weak signal, and consider that the person or animal is still in front of the electronic device.
  • the change of the signal output by the pyroelectric sensor satisfies the first preset condition, it is determined that the human or animal is far away from the electronic device.
  • the first preset condition may be that the time period from the pyroelectric sensor outputting a normal pulse signal to not outputting a pulse signal and not outputting a pulse signal exceeds the first preset time period.
  • the first preset duration can be assigned an initial value, limited the upper and lower limits, and updated with a fixed amount of change according to the number of successes. Once successful, the first preset duration is reduced once according to the preset amount of change.
  • the first preset duration may also be a fixed value. In the following, the first preset duration can be dynamically changed as an example, but it does not constitute a limitation.
  • the electronic device after the electronic device enters the low power consumption state, after the user immediately manually triggers the exit of low power consumption (or, the electronic device can resume the power consumption from low power consumption to resume power consumption for less than the third preset duration) Normal power consumption, and start to update the first preset duration, for example, the original preset duration is 2s, and now it is updated to 3s, so that the first preset duration is more in line with the user’s habits, and it also helps to improve the electronic equipment The accuracy of judging the user's exercise status.
  • the electronic device after the electronic device enters the low power consumption state, it takes a long time for the user to manually trigger the exit of low power consumption (or, the duration of the electronic device from low power consumption to restoration of power consumption is greater than or equal to the third preset duration), The electronic device can resume normal power consumption and start to update the first preset duration.
  • the original preset duration is 2s, and now it is updated to 1s, making the first preset time more in line with the user’s habits.
  • the electronic device Getting into a low-power state faster will also help save the power consumption of electronic devices.
  • “success once” can also be understood as determining that the user turns on the front camera after moving away from the electronic device and does not detect human characteristics, and starts to reduce power consumption, and the time for reducing power consumption continues for a preset period of time The electronic device resumes power consumption.
  • the first preset duration may have an upper limit and a lower limit.
  • the upper limit is 10s and the lower limit is 1s.
  • the first preset duration is no longer increased; or, when the first preset duration is reduced to 1s, the first preset duration is no longer reduced.
  • the third preset duration in the embodiment of the present application may be a fixed value, and the third preset duration may not need to be adjusted.
  • the first preset condition may also be that the waveform change frequency of the signal output by the pyroelectric sensor changes from greater than or equal to the first frequency threshold to less than or equal to the second frequency threshold, where the first frequency threshold is greater than Or equal to the second frequency threshold.
  • the waveform of the signal output by the pyroelectric sensor changes more frequently, and when the person or animal is far away from the electronic device, the frequency of the signal change shown by the pyroelectric sensor gradually decreases until When a person or animal completely leaves the electronic device, the waveform change frequency becomes zero.
  • the frequency of the waveform change of the output signal can also be used to determine that the person or animal is far away from the electronic device.
  • the change of the signal output by the pyroelectric sensor satisfies the second preset condition, it is determined that a person or an animal is approaching the electronic device.
  • the second preset condition may be that the pyroelectric sensor never outputs a normal pulse signal to output a pulse signal, and the time length of outputting the pulse signal exceeds the second preset time length.
  • the electronic device may also adjust the second preset duration according to the user's habits, and the method for adjusting the second preset duration is not limited here.
  • the second preset duration may also be a fixed value.
  • the second preset condition may also be that the waveform change frequency of the signal output by the pyroelectric sensor changes from less than the second frequency threshold to greater than or equal to the first frequency threshold, where the first frequency threshold is greater than the The second frequency threshold.
  • S306 The electronic device determines whether a human body feature is detected.
  • the electronic device updates the electronic device to a non-interactive state and reduces the current power consumption of the electronic device when the human body characteristics are not detected.
  • the electronic device operates with normal power consumption.
  • the front camera in this embodiment of the present application includes a color camera and/or a depth camera.
  • the front camera on Huawei's Mate 20 mobile phone is a color camera
  • the front camera on Huawei's Mate 20 Pro mobile phone includes a color camera and a depth camera.
  • the human body characteristics of the user include one or more of face information, human torso information, human limbs information, and human head shape information.
  • the electronic device determines whether a human body feature is detected, including:
  • the electronic device determines whether a human body feature is detected and whether the human body feature meets the third preset condition.
  • the electronic device updates the electronic device to an interactive state and maintains the current power consumption;
  • the electronic device updates the electronic device to a non-interactive state, reducing the power consumption of the current electronic device .
  • the third preset condition is the range of the included angle between the vertical line of the display screen of the electronic device and the straight line where the body part faces.
  • the following takes the user's human body characteristics including face information as an example for description.
  • the face detection part of S305-S308 uses AI to provide face detection capabilities.
  • the process of face detection may be:
  • AI vision base The static class of artificial intelligence vision base (AI vision base) is used to initialize the parameters to obtain the connection to the system AI service.
  • the image obtained from the front camera is provided to the FaceDetector.detect function in the form of a class to execute the face detection algorithm, and waits for the face information result in the form of object notation (Javascript object notation, Json) to be returned.
  • Javascript object notation Json
  • the face information result includes the facial feature information of the human body and the azimuth angle information of the face.
  • the azimuth angle information of the human face can be understood as the angle between the vertical line of the display screen of the electronic device and the straight line where the face is facing.
  • the electronic device can determine that it is in The interactive state is maintained or restored to the power consumption of the electronic device during normal operation.
  • the third preset condition may be: the angle between the vertical line of the display screen of the electronic device and the straight line where the face is facing is less than or equal to the first angle threshold.
  • the foregoing third preset condition may also be other conditions.
  • the third preset condition may be: the vertical line of the display screen of the electronic device and the direction of the body torso The included angle of the straight line is less than or equal to the second angle threshold.
  • the priority of the face information is higher than the priority of other human body characteristic information.
  • the first angle threshold and the second angle threshold are the same or different.
  • Step1 First collect a large amount of face data and divide it into training data, verification data and test data.
  • Step2 Build the basic structure of the convolutional neural network: input layer, convolution layer, sub-sampling layer, fully connected layer, output layer. Convolutional layer and sub-sampling layer are matched, and there can be more than one.
  • the output layer can use the softmax regression method.
  • Step3 Build a convolutional neural network model: connect sequentially in the order of the previous step. Define cost function, learning rate, batch size and other parameters, and use batch stochastic gradient descent algorithm to optimize the cost function.
  • Step4 Update the model parameters on the training data set. Set the number of training steps, traverse a batch of samples extracted from the training data each time, and find the model parameters required to minimize the cost function.
  • Step5 After the model parameters are generated, initialize them to the model, and input the test image after image preprocessing to complete the test data, which is the face recognition of the real image.
  • the front camera can collect one or more pictures, or collect a video, and the collected picture or video can be cached in the buffer of the electronic device.
  • the electronic device passes the picture or video After the human body characteristics are recognized, the cached pictures or videos can be deleted.
  • the method of reducing the power consumption of the current electronic device includes but is not limited to one or more of the following:
  • high power consumption units include but are not limited to: reducing the number of global positioning system (global positioning system, GPS) positioning, for application applications, the previous data can be used; reducing the modem (Modem) and processor Information interaction; reduce the refresh frequency of touch panels (TP).
  • global positioning system global positioning system, GPS
  • Modem modem
  • TP refresh frequency of touch panels
  • the front camera Since the image is collected by the front camera and the human body feature recognition algorithm is used to detect whether there are human features in the image, the accuracy is very high, but the large amount of calculation leads to high power consumption, so the front camera is not suitable for long-time opening.
  • the respective advantages of the pyroelectric sensor and the front camera are used to make up for the disadvantages, and a low-cost, low-power, high-real-time, and accurate detection method of the human body's approaching and distant state is realized.
  • the pyroelectric sensor may be used to detect that people or animals are approaching or far away from the electronic device. For example, when the pyroelectric sensor never outputs a normal pulse signal to output a normal pulse signal and continues After the time length exceeds the first preset time length, it can be considered that a person or animal approaches the electronic device, and the electronic device restores power consumption (the power consumption of the electronic device was reduced at a certain time before) or the power consumption of the electronic device is maintained.
  • the electronic device when the electronic device detects that the pyroelectric sensor has changed from outputting a normal pulse signal to not outputting a normal pulse signal and the duration exceeds the first preset time period, it can be considered that the user is far away from the electronic device, and the electronic device can be reduced Power consumption.
  • the electronic device can intelligently adjust the power consumption of the system based on whether there is an interaction state, and run normally when there is user interaction; and run with low power consumption when there is no user interaction. This method can solve the problem of wasting the power of the electronic device when there is no interaction, and will not significantly affect the user experience.
  • the electronic device uses the acceleration change detected by the acceleration sensor as the starting condition of the method, and detects the distance or approach of people or animals in real time through the change of the output signal of the pyroelectric sensor, and is collected by the front camera
  • the image of the human body is recognized to ensure the low cost, low power consumption, high real-time and accuracy of the method.
  • the electronic device may be determined to enter the interactive state in the following ways.
  • the embodiments of the present application provide multiple ways to detect the user's restart of interaction, including manual screen touches and keystrokes, electronic device movement, and automatic pyroelectric sensor and front camera combination multi-sensor cooperative detection method.
  • This method can be implemented in the service created by the application of the electronic device.
  • the touch, key, and position detection module creates a view with the x-axis starting position, the y-axis starting position, the length, and the width being 1, and the The view is added to the interface of the electronic device, and touch events are monitored according to the view.
  • touch event processing function filter the touch types that are effective for this method, and when the type requirements are met, the touch, key, and position detection modules update the status and issue power switching instructions.
  • This method can be implemented in the service, and the touch, key and position detection module can monitor key events in the view created above. Filter the key types that are effective for this method in the key event processing function, and when the type requirements are met, the touch, key, and position detection modules update the state and issue a power consumption switching instruction.
  • This method can be implemented in the service, and the touch, key, and position detection module can monitor the events of the acceleration sensor in the view created above.
  • the frequency of the monitoring data is set to 1 Hz, so that the acceleration sensor data is obtained every 1 s, and the data includes the acceleration of the electronic device on the x, y, and z axes.
  • the root mean square error X rmse of each of the three accelerations of the N groups can be calculated according to the above formula (1), which is used to evaluate the dispersion of the acceleration values of the latest N groups. The greater the degree of dispersion, the greater the movement amplitude of the electronic device The larger the value, the electronic device is considered to be in motion when X rmse exceeds the first threshold range.
  • the method for judging that there is no user interaction in collaboration with the pyroelectric sensor and the front camera is described.
  • the difference between the method of judging that there is interaction and the method of judging that there is no user interaction is that the pyroelectric sensor detects the movement of people or animals at the timing.
  • the human body feature recognition algorithm also detects the human body feature, and then updates the current state to the interactive state.
  • FIG. 8 shows a schematic flowchart of a method 400 for reducing power consumption according to an embodiment of the present application. As shown in FIG. 8, the method 400 includes:
  • S401 The electronic device determines that the set sleep time exceeds a threshold.
  • S402 The electronic device determines that the APP applies for a bright screen lock.
  • S403 The electronic device determines that the system starts to upgrade.
  • step S404 may be executed.
  • S404 The electronic device determines whether the user has enabled automatic adjustment.
  • S406 The electronic device judges whether the electronic device remains stationary for longer than a preset period of time.
  • the electronic device determines whether a person or an animal is detected close to or far away from the electronic device.
  • the electronic device determines that the user is close to the electronic device.
  • the electronic device determines that the user is far away from the electronic device.
  • S412 The electronic device determines whether a human body feature is detected.
  • S417 The electronic device determines that a person or an animal is approaching or far away from the electronic device.
  • S421 The electronic device judges whether a human body feature is detected.
  • the electronic device may repeat the detection of the front camera in S410.
  • a detection period is 2s, and 5 to 8 detection periods may be performed.
  • the images collected by the electronic device through the front camera do not detect human features, and start to reduce power consumption.
  • the electronic device can also adaptively adjust the detection period and/or detection times of the front camera according to the user's habits.
  • the detection period may be a period in which the front camera detects the human body characteristics, that is, the front camera detects the human body characteristics within a certain period of time.
  • the number of times of detection is the number of times that the front camera continuously detects human features. For example, if the number of detections is N, and N is a positive integer greater than 1, then the electronic device determines that the image collected by the front camera includes the human body feature can also be understood as the electronic device determines that the front camera is determined in N detection cycles Human features are included in the captured images.
  • the time interval between reducing the power consumption of the electronic device and restoring the power consumption of the electronic device is greater than or equal to a fourth preset time period, reduce the detection period and/or of the front camera The number of tests; or,
  • the detection cycle and the number of detections of the front camera can be cumulatively updated based on the number of successful previous processes.
  • the detection period is assigned an initial value, and the upper and lower limits are limited.
  • the electronic device turns on the front camera for the first time, the human body characteristics are detected according to the initial value of the detection period. After that, it can be updated with a fixed amount of change according to the number of successes.
  • the preset amount of change the duration of a detection cycle is reduced.
  • the recovery is triggered by the user within a short time (can be defined, such as 10s), and the duration of a detection cycle is increased according to the preset amount of change.
  • the electronic device enters low power consumption faster; for users who leave for a short time, the detection period of the electronic device is prolonged, which improves the accuracy of the electronic device for judging the user's motion state.
  • a user who leaves for a short time can also be understood as a user who has a short time interval between away from the electronic device and approaching the electronic device.
  • the number of detections of human body characteristics is assigned an initial value, and the upper and lower limits of the value are limited.
  • the electronic device first turns on the front camera, the human body characteristics are detected according to the initial value of the number of detections, and then can be updated with a fixed amount of change according to the number of successes. Once successful, the value of the number of times of detection is reduced according to the preset amount of change. After the power consumption is reduced, the recovery is triggered by the user in a short time (can be defined, such as 10s), and the value of the number of times of detection is increased once according to the preset amount of change.
  • a short time can be defined, such as 10s
  • the electronic device enters low power consumption faster; for users who leave for a short time, the number of human body feature detections of the electronic device increases, which improves the accuracy of the electronic device for judging the user's motion state.
  • the human body feature can be detected according to the preset detection period and/or the number of detections. Thereafter, the electronic device may adjust the detection period and/or the number of detections according to the time interval from reducing the power consumption of the electronic device to recovering the power consumption of the electronic device.
  • the number of detections may be the number of consecutive detections of human features.
  • the electronic device determining that the image collected by the front camera includes the human body feature can also be understood as the electronic device determining that the image collected by the front camera includes the human body feature in N consecutive detection cycles.
  • the electronic device After the front camera is turned on, the electronic device starts to detect in a certain detection cycle. When the number of times that the human body feature is not detected continuously reaches the first value, the power consumption of the electronic device is reduced and the front camera is turned off; when the human body feature is continuously detected When the number of times reaches the second value, the power consumption of the electronic device is restored and the front camera is turned off.
  • the first value and the second value are the same or different.
  • the first value is 2 times, and the preset detection period of the electronic device is 2s.
  • the electronic device detects that a person or animal is far away for the first time, it turns on the front camera and performs detection according to the detection period of 2s. If no human body feature is detected within 2 detection cycles, the power consumption of the electronic device is reduced and the front camera is turned off.
  • the first value is 2 times
  • the preset detection period of the electronic device is 2s.
  • the electronic device detects a human or animal approaching for the first time, it turns on the front camera and performs detection according to the detection period of 2s. If human body characteristics are detected within 2 detection cycles, the power consumption of the electronic device is restored and the front camera is turned off.
  • the electronic device can adjust Low detection cycle, which can make the electronic device enter low power consumption faster.
  • the electronic device can increase the detection cycle, which improves the electronic device’s response to the user.
  • the accuracy of the motion state judgment is not limited to, the Bosch Sensortec BMA150, the Bosch Sensortec BMA150, the Bosch Sensortec BMA150, the Bosch Sensortec BMA150, the Bosch Sensortec BMA150, the Bosch Sensortec BMA150, the Bosch Sensortec BMA150, the Bosch Sensortec BMA150, the Bosch Sensortec BMA150, the Bosch Sensortect, the electronic device successfully reduces power consumption and the time interval from reducing power consumption to restoring power consumption is less than the fourth preset time period, the electronic device can increase the detection cycle, which improves the electronic device’s response to the user. The accuracy of the motion state judgment.
  • the electronic device detects according to one detection cycle (for example, 1s), and after two consecutive detection cycles do not detect human features, it is considered that there is no user interaction, which reduces the power consumption of the electronic device.
  • one detection cycle for example, 1s
  • the electronic device will lengthen the detection period. For example, if the detection period is increased to 2s, the next time it encounters the above scenario, because no human body features are detected in the first detection period, but in the second detection period If the human body characteristic is detected periodically, the electronic device will not be triggered to enter low power consumption, which improves the accuracy of the electronic device in determining the user's motion state.
  • the fourth preset duration may be a preset fixed duration, that is, the fourth preset duration may not need to be adjusted.
  • the fourth preset duration may be equal to the third preset duration.
  • the detection of the pyroelectric sensor and the front camera can also be stopped, and the detection of the user's touch or key operation can be waited to resume.
  • the power consumption of the electronic device for example, if the human body characteristics are detected in S411, after reducing the power consumption of the electronic device, the front camera may not be turned off. After the current camera detects the user's human body characteristics again, the electronic The power consumption of the device.
  • the electronic device when the human body characteristics are detected in the S411, the power consumption of the electronic device is reduced, and the pyroelectric sensor and the front camera are turned off, which can reduce the power consumption of about 300-700mA; Turn on the front camera, you can save about 240-640mA power consumption.
  • the user detection and power consumption control module resides in the background in the form of service, and is inactive for a long time. It is triggered to execute when the sleep duration exceeds the threshold, the APP setting applies for bright screen lock, etc. When exiting these states, it will be in an inactive state again to ensure that the service has the lowest impact on system performance and power consumption.
  • the power management module calls the power manager service through inter-process communication.
  • the APP needs to apply to the power management module to release the bright screen lock to complete the business processing.
  • the power management module calls the service function releaseWakeLock() provided by the power management service through inter-process communication, and then calls the releaseWakeLockInternal() of this class, which is constructed in releaseWakeLockInternal() Pile the position after the wake-up lock structure, broadcast notifications to the user detection and power consumption control module, and close the no-interaction detection.
  • the hardware of this method relies on a pyroelectric sensor, taking the pyroelectric sensor as an example, and at the same time, it relies on a front color camera or a depth camera.
  • the human body approach and distance detection module is implemented as processing logic of three threads:
  • the main thread is responsible for overall startup control, user interface (UI) operation, and optimization and restoration of power consumption;
  • the human or animal detection thread is responsible for the pyroelectric sensor data reading and pyroelectric real-time analysis and real-time notification of the face detection thread;
  • the face detection thread is responsible for the front camera to collect images and face detection and notify the main thread of the results in a timely manner.
  • Step1 Register the broadcast monitor for long-time bright screen use.
  • the monitoring processing function after filtering the application for a long time, screen lock, sleep time, etc., start the non-interactive state detection; after exiting the long-time bright screen scene, cancel There is no interactive state detection, and the power recovery action is forced to be executed according to the situation.
  • Step2 Register the data listener of the acceleration sensor when starting the non-interactive state detection, set the data reading frequency to 1Hz, and execute the device movement detection method in the data change processing function of the listener.
  • canceling the non-interactive state detection cancel the registration of the data listener of the acceleration sensor, and notify the human or animal detection thread and the face detection thread to stop working.
  • Step3 If the device moves, the detection is continued until the device does not move within a certain time interval set by the present invention, and the human or animal detection thread is notified to start the human or animal approach analysis through the communication between handler threads.
  • Step4 Create a loop processing body based on this thread to receive messages from other threads, and handleMessage() to process various events sent. If it is an event that completes human or animal detection and the number of human bodies is 0, the power consumption optimization action is executed, and the UI prompts to enter the non-interactive low power consumption mode; if the number of human bodies is greater than 0, the power recovery action is executed, and the UI Prompt to exit the non-interactive low power consumption mode, and the delay disappears. If it is a touch, button or device movement event, the power consumption recovery action is forced to be executed, and the UI prompts to exit the non-interactive low power consumption mode, and the delay disappears.
  • the human or animal detection thread processing flow is as follows:
  • Step1 Create and start HandlerThread, create a loop processing body based on HandlerThread, receive messages from other threads, and handleMessage() handles various events sent.
  • Step2 If an event that initiates a human or animal approach to analysis is received, the data of the pyroelectric sensor can be periodically read at a frequency of 50 Hz, and the data output is in three states: human or animal shaking in front of the electronic device, human or animal Approach electronic equipment, or keep people or animals away from electronic equipment.
  • the abnormal interference data is filtered through multiple readings. If it is determined that a person or animal is detected to move, the face detection thread is notified to start the face detection algorithm through the communication between the handler threads.
  • Step3 If an event that stops human or animal approaching analysis is received, stop the timer for reading data from the pyroelectric sensor.
  • the processing flow of the face detection thread is as follows:
  • Step1 Create HandlerThread and start it, create a loop processing body based on HandlerThread, receive messages from other threads, and handleMessage() to process various events sent.
  • Step2 If an event to start face detection is received, turn on the front camera, set various parameters of the front camera, start the preview, and register the autofocus callback function. Execute the camera function in the callback function, stop auto focus and preview in the provided callback function for completion of the camera, and save the image data of the camera.
  • Step3 Encapsulate the saved image data into Frame format and submit it to the AI module FaceDetector.Detect() for processing, and return the face linked list data defined by AI.
  • the number of faces in the linked list represents the number of faces.
  • Step4 Encapsulate the number of detected faces to Message, and notify the main thread for processing.
  • FIG. 9 shows a schematic block diagram of an electronic device 500 for reducing power consumption provided by an embodiment of the present application.
  • the electronic device 500 is in a stationary state.
  • the electronic device 500 includes:
  • Pyroelectric sensor 510 used to output signals
  • the processor 520 is configured to obtain information output by the pyroelectric sensor 510, and determine that the person or animal is far away from the electronic device 500 when the change in the output signal meets the first preset condition;
  • the processor 520 is also used to start the front camera 530;
  • the front camera 530 is used to collect images
  • the processor 520 is also configured to determine that the image collected by the front camera 530 does not include human body characteristics
  • the processor 520 is also used to reduce the power consumption of the electronic device 500 and automatically turn off the front camera 530;
  • the processor 520 is further configured to determine that a person or animal is close to 500 and turn on the front camera 530 when the change in the output signal meets the second preset condition;
  • the processor 520 is further configured to determine that the image collected by the front camera 530 includes human body characteristics
  • the processor 520 is also used to restore the power consumption of the electronic device 500 and automatically turn off the front camera 530.
  • the first preset condition is different from the second preset condition.
  • the processor 520 is further configured to detect a user's touch or key operation on the touch screen of the electronic device 500, or detect the movement of the electronic device 500;
  • the processor 520 is also used to restore the power consumption of the electronic device 500.
  • the first preset condition includes: the duration from output of the pulse signal to no output of the pulse signal and no output of the pulse signal is greater than or equal to the first preset duration;
  • the second preset condition includes: never outputting a pulse signal to outputting a pulse signal, and the duration of the output pulse signal is greater than or equal to the second preset duration.
  • the processor 520 is further configured to: when the time interval from the reduction of the power consumption of the electronic device to the restoration of the power consumption of the electronic device is greater than or equal to a third preset duration, Lower the first preset duration; or,
  • the processor 520 is further configured to: when the time interval from reducing the power consumption of the electronic device to recovering the power consumption of the electronic device is greater than or equal to a fourth preset duration, Reduce the detection period and/or detection times of the front camera; or,
  • processor 520 is specifically configured to perform one or more of the following operations:
  • the human body characteristics include one or more of face information, human torso information, human limbs information, and human head shape information.
  • the pyroelectric sensor 510 can be used to implement part of the function of the human body approaching and far from the detection module in FIG. 3 (this part of the function is to obtain the infrared radiation changes of humans or animals and output signals); the front camera 530 can be used to Realize part of the function of the human body approaching and away from the detection module in Figure 3 (this part of the function is the front camera to collect images); the processor 520 can be used to realize the part of the human body approaching and away from the detection module in Figure 3 (this part of the function is through thermal release
  • the electrical sensor output signal determines whether the human body is approaching or far away, and the image collected by the front camera is used to determine whether the human body characteristics are included) and all functions of power consumption mode decision-making (for this front function, please refer to the power consumption mode decision process in the above method embodiment) .
  • the electronic device 500 can be used to execute the method of the foregoing method embodiment, and the above and other management operations and/or functions of the electronic device 500 are used to implement the corresponding steps of the method of the foregoing method embodiment. Therefore, the beneficial effects in the foregoing method embodiments can also be achieved, and for the sake of brevity, details are not described here.
  • the electronic device 500 may correspond to the electronic device 100 in FIG. 1
  • the processor 520 may correspond to the processor 110 in FIG. 1
  • the front camera 530 may correspond to the camera 193 (in the camera 193) in FIG.
  • the pyroelectric sensor 510 may correspond to the pyroelectric sensor 180F in FIG. 1.
  • the electronic device 500 may adopt the form shown in FIG. 1.
  • the processor 520 may be implemented by the processor 640 shown in FIG. 10.
  • the processor 640 may also execute a computer program stored in the memory to determine that a person or an animal is approaching or far away from the electronic device 600 and that the image collected by the front camera 610 includes or does not include human characteristics.
  • the electronic device 600 is a chip, then the function and/or implementation process of receiving and sending involved in the electronic device 600 may also be implemented through pins or interface circuits.
  • the memory is a storage unit in the chip, such as a register, a cache, etc., and the storage unit may also be a storage unit located outside the chip in the computer device, such as the memory shown in FIG. 630.
  • FIG. 10 shows a schematic structural diagram of an electronic device 600 for reducing power consumption according to an embodiment of the present application.
  • the electronic device 600 includes a front camera 610, a pyroelectric sensor 620, a memory 630, and In the processor 640, one or more computer programs are stored in the memory 630, and the one or more computer programs include instructions. When the instructions are executed by the processor 630, the electronic device 600 is caused to perform the following operations:
  • the power consumption of the electronic device 600 is restored, and the front camera 610 is automatically turned off, wherein the first preset condition and the second preset condition are different.
  • the pyroelectric sensor 620 may correspond to the human or animal motion detection module 510 in the electronic device 500
  • the front camera 610 may correspond to the image acquisition module 530 in the electronic device 500
  • the processor 630 may correspond to The processing module 520 in the electronic device 500 described above.
  • the electronic device 600 further includes a pressure sensor 650 and an acceleration sensor 660.
  • the electronic device 600 is caused to perform the following operations:
  • the pressure sensor 650 detects the user's touch or key operation on the touch screen of the electronic device 600, or the acceleration sensor 660 detects the movement of the electronic device 600;
  • the first preset condition includes: the duration from output of the pulse signal to no output of the pulse signal and no output of the pulse signal is greater than or equal to the first preset duration;
  • the second preset condition includes: never outputting a pulse signal to outputting a pulse signal, and the duration of the output pulse signal is greater than or equal to the second preset duration.
  • the electronic device 600 when the instruction is executed by the processor 630, the electronic device 600 is caused to perform the following operations:
  • the first preset duration is reduced
  • the electronic device 600 when the instruction is executed by the processor 630, the electronic device 600 is caused to perform the following operations:
  • the detection period of the front camera and/ Or the number of tests is greater than or equal to the fourth preset time period, the detection period of the front camera and/ Or the number of tests; or,
  • the electronic device 600 when the instruction is executed by the processor 630, the electronic device 600 is caused to perform the following operations:
  • the human body characteristics include one or more of face information, human body torso information, human body limbs information, and human head shape information.
  • the foregoing electronic device 500 or electronic device 600 may be an electronic device.
  • the electronic device 600 may correspond to the electronic device 100 in FIG. 1
  • the processor 630 may correspond to the processor 110 in FIG. 1
  • the memory 640 may correspond to the internal memory 121 in FIG. 1
  • the front camera 610 may correspond to
  • the pyroelectric sensor 620 may correspond to the pyroelectric sensor 180F in FIG. 1
  • the pressure sensor 650 may correspond to the pressure sensor 180A in FIG.
  • the sensor 660 may correspond to the acceleration sensor 180E in FIG. 1.
  • This embodiment also provides a computer storage medium in which computer instructions are stored.
  • the computer instructions run on an electronic device, the electronic device is caused to execute the above-mentioned related method steps to achieve the power consumption reduction in the above-mentioned embodiment. method.
  • This embodiment also provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the above-mentioned related steps, so as to implement the method for reducing power consumption in the above-mentioned embodiment.
  • the embodiments of the present application also provide an electronic device.
  • the electronic device may specifically be a chip, component, or module.
  • the electronic device may include a connected processor and a memory; wherein the memory is used to store computer-executed instructions.
  • the processor can execute the computer-executable instructions stored in the memory, so that the chip executes the methods for reducing power consumption in the foregoing method embodiments.
  • the electronic device, computer storage medium, computer program product, or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding method provided above. The beneficial effects of the method will not be repeated here.
  • the disclosed electronic device and method can be implemented in other ways.
  • the electronic device embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection of electronic devices or units through some interfaces, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the existing technology, or all or part of the technical solutions can be embodied in the form of software products, which are stored in a storage medium. It includes several instructions to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods of the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

本申请提供了一种降低功耗的方法,包括:当电子设备处于静止状态时,电子设备通过热释电传感器输出的信号确定用户远离电子设备;电子设备开启前置摄像头并确定前置摄像头采集的图像中不包括人体特征;电子设备降低功耗并自动关闭前置摄像头;电子设备通过热释电传感器输出的信号确定用户接近电子设备;电子设备开启前置摄像头并确定前置摄像头采集的图像中包括人体特征;电子设备恢复功耗并自动关闭前置摄像头。采用上述方法,有助于降低电子设备的功耗,提高电子设备的使用时长。

Description

一种降低功耗的方法和电子设备 技术领域
本申请涉及电子设备领域,并且更具体地,涉及一种降低功耗的方法和电子设备。
背景技术
随着科技的发展,大量的智能交互式电子设备不断涌现。这些电子设备多数由电池供电,而考虑到体积、成本等因素,电池容量相对限定,因此电子设备的续航时间长短对产品来说尤为重要。
用户在远离电子设备时,并不特别在意电子设备的运行状态,如果此时电子设备仍长时间亮屏运行,会产生大量不必要的电量消耗。
发明内容
本申请提供一种降低功耗的方法和电子设备,有助于降低电子设备的功耗,提高电子设备的使用时长。
第一方面提供了一种降低功耗的方法,该方法可以应用于电子设备,该电子设备处于静止状态,电子设备包括前置摄像头和热释电传感器,该方法包括:电子设备获取该热释电传感器的输出信号;在输出信号的变化满足第一预设条件时,该电子设备确定人或动物远离该电子设备;该电子设备开启该前置摄像头并确定该前置摄像头采集的图像中不包括人体特征;该电子设备降低该电子设备的功耗并自动关闭该前置摄像头;在该热释电传感器的输出信号的变化满足第二预设条件时,该电子设备确定人或动物接近该电子设备;该电子设备开启前置摄像头并确定该前置摄像头采集的图像中包括人体特征;该电子设备恢复该电子设备的功耗并自动关闭该前置摄像头,该第一预设条件和该第二预设条件不同。
第一方面提供的降低功耗的方法,先通过热释电传感器检测人或动物远离电子设备,再开启前置摄像头并确定前置摄像头采集的图像中不包括人体特征,从而降低电子设备的功耗,有助于解决了无交互时电子设备电量的浪费问题,并且不会对用户体验带来明显影响。此外,先通过热释电传感器检测到人或动物接近电子设备,再开启前置摄像头并确定前置摄像头采集的图像中包括人体特征,从而恢复电子设备的功耗,无需用户手动通过在触摸屏上的触摸或者按压操作恢复电子设备的功耗。
应理解,电子设备处于静止状态可以是用户手持电子设备时保持静止,或者,也可以是电子设备放在固定在支架上保持静止,或者,还可以是电子设备静止放在桌面上。
结合第一方面,在第一方面的某些实现方式中,降低电子设备的功耗之后,该方法还包括:该电子设备检测到用户在该电子设备的触摸屏上的触摸或者按键操作,或者,该电子设备检测到该电子设备移动;该电子设备恢复该电子设备的功耗。
结合第一方面,在第一方面的某些实现方式中,该第一预设条件包括:从输出脉冲信号到不输出脉冲信号且不输出脉冲信号的持续时长大于或等于第一预设时长;该第二预设 条件包括:从不输出脉冲信号到输出脉冲信号且输出脉冲信号的持续时长大于或等于第二预设时长。在检测到热释电传感器不输出脉冲信号持续时长大于第一预设时长时,确定用户远离电子设备,有助于提高电子设备的判决准确度。
在一些可能的实现方式中,该第一预设条件还包括:热释电传感器输出脉冲信号的波形变化频率从大于或者等于第一频率阈值,变化为小于或者等于第二频率阈值,其中,第一频率阈值大于第二频率阈值。
在一些可能的实现方式中,该第二预设条件还包括:热释电传感器输出脉冲信号的波形变化频率从小于第二频率阈值,变化为大于或者等于第一频率阈值,其中,第一频率阈值大于第二频率阈值。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:在从降低电子设备的功耗到恢复电子设备的功耗之间的时间间隔大于或者等于第三预设时长时,该电子设备调低第一预设时长;或者,在从降低电子设备的功耗到恢复电子设备的功耗之间的时间间隔小于第三预设时长时,该电子设备调高第一预设时长。
在一些可能的实现方式中,当电子设备进入低功耗状态后,用户立即手动触发退出低功耗后(或者,电子设备从低功耗到恢复功耗持续时间小于第三预设时长),电子设备可以恢复正常功耗,并且开始更新该第一预设时长(例如,按照预设变化值调高该第一预设时长),使得第一预设时长更加切合用户的习惯,同时,也有助于提高电子设备对用户运动状态判断的准确度。
在一种可能的实现方式中,当电子设备进入低功耗状态后,用户很长时间才手动触发退出低功耗(或者,电子设备从低功耗到恢复功耗持续时间大于或者等于第三预设时长),电子设备可以恢复正常功耗,并且开始更新该第一预设时长(例如,按照预设变化值调低该第一预设时长),使得第一预设时间更加切合用户的习惯,同时,电子设备更快速得进入低功耗状态,也有助于节省电子设备的功耗。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:在从降低电子设备的功耗到恢复电子设备的功耗之间的时间间隔大于或者等于第四预设时长时,该电子设备调低前置摄像头的检测周期和/或检测次数;或者,在从降低电子设备的功耗到恢复电子设备的功耗之间的时间间隔小于第四预设时长时,该电子设备调高前置摄像头的检测周期和/或检测次数。
应理解,电子设备第一次打开前置摄像头时,可以按照预设的检测周期和/或检测次数进行人体特征的检测。之后,电子设备可以根据从降低电子设备的功耗到恢复电子设备的功耗之间的时间间隔的情况来调整检测周期和/或检测次数。
在一种可能的实现方式中,该检测次数为连续检测到人体特征的次数。
在一种可能的实现方式中,该检测次数还可以为检测的次数。
电子设备在开启前置摄像头后以一定的检测周期开始检测,当连续未检测到人体特征的次数达到第一数值时,则降低电子设备的功耗并且关闭前置摄像头;当连续检测到人体特征的次数达到第一数值时,则恢复电子设备的功耗并且关闭前置摄像头,第一数值包括大于1的整数。
在一种可能的实现方式中,检测周期赋初始值,限定取值上下限,电子设备第一次打开前置摄像头时,按照检测周期的初始值进行人体特征的检测,之后可以根据成功次数以 固定的变化量更新,成功一次,可以依据预设的变化量缩减一次检测周期的时长,降低功耗后短时间内由用户触发恢复,则依据预设的变化量增加一次检测周期的时长。采用此补充技术方案,有助于实现对于经常离开较长时间的用户,电子设备更快进入低功耗;对于短时间离开的用户,电子设备的检测周期加长,提高了电子设备对用户运动状态判断的准确度。
应理解,该检测周期可以为前置摄像头检测人体特征的周期,该检测周期可以为一个时间段,前置摄像头在这个时间段内检测人体特征。
在一种可能的实现方式中,人体特征的检测次数赋初始值,限定取值上下限,电子设备第一次打开前置摄像头时,按照检测次数的初始值进行人体特征的检测,之后可以根据成功次数以固定的变化量更新,成功一次,缩减依据预设的变化量一次检测次数的值,降低功耗后短时间内由用户触发恢复,则依据预设的变化量增加一次检测次数的值。采用此补充技术方案,有助于实现对于经常离开较长时间的用户,电子设备更快进入低功耗;对于短时间离开的用户,电子设备的人体特征检测次数增多,提高了电子设备对用户运动状态判断的准确度。
在一些可能的实现方式中,该检测次数可以为前置摄像头检测到人体特征的次数。
在一些可能的实现方式中,该检测次数可以为前置摄像头连续检测到人体特征的次数,例如,该检测次数为N,N为大于1的正整数,则电子设备确定前置摄像头采集的图像中包括所述人体特征还可以理解为电子设备确定在连续的N个检测周期内都确定前置摄像头采集的图像中包括人体特征。
结合第一方面,在第一方面的某些实现方式中,该电子设备降低电子设备的功耗,包括以下一种或者多种:将该电子设备的显示屏从亮屏状态切换至黑屏状态,该电子设备降低显示屏亮度;该电子设备降低系统运行频率;该电子设备将高功耗音频参数切换至低功耗音频参数;该电子设备降低Wi-Fi模块的刷新频率;该电子设备降低蓝牙模块的刷新频率。
结合第一方面,在第一方面的某些实现方式中,人体特征包括人体特征信息、人体躯干信息、人体四肢信息、人体头型信息中的一种或者多种。
第二方面提供了一种降低功耗的电子设备,该电子设备包含在电子设备中,该电子设备具有实现上述方面及上述方面的可能实现方式中电子设备行为的功能。功能可以通过硬件实现,也可以通过设计相应的软件来实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。
第三方面提供了一种电子设备,该电子设备包括处理器、存储器,前置摄像头,热释电传感器;该前置摄像头用于获取图像数据;该热释电传感器用于获取人或动物发出的红外线并转换为电信号输出;该存储器用于存储指令;该处理器用于执行该存储器中的指令,使得该电子设备实现上述第一方面及第一方面的可能的实现方式中的降低功耗的方法。
第四方面提供了一种电子设备,该电子设备包括触摸屏,存储器,一个或者多个处理器,前置摄像头,热释电传感器,多个应用程序以及一个或者多个程序;其中,一个或者多个程序被存储在该存储器中;当一个或者多个处理在执行该一个或者多个程序时,使得电子设备实现上述第一方面及第一方面可能的实现方式中的降低功耗的方法。
第五方面提供了一种计算机存储介质,包括指令,当指令在电子设备上运行时,使得 电子设备执行上述任一项可能的实现中的降低功耗的方法。
第六方面提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述任一项可能的实现中的降低功耗的方法。
附图说明
图1是本申请实施例提供的电子设备的结构示意图。
图2是人体辐射的光谱分布曲线。
图3是本申请实施例提供的电子设备的系统架构的示意性框图。
图4是本申请实施例提供的用户在远离或者接近电子设备时的示意图。
图5是本申请实施例提供的降低功耗的方法的示意性流程图。
图6是一种热释电传感器的结构示意图。
图7是本申请实施例提供的用户与电子设备存在的四种状态的示意图。
图8是本申请实施例提供的降低功耗的方法的另一示意性流程图。
图9是本申请实施例提供的降低功耗的电子设备的示意性框图。
图10是本申请实施例提供的降低功耗的电子设备的另一示意性结构图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
本申请实施例提供的降低功耗的方法可以应用于手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等电子设备上,也可以应用于自动取款机(automatic teller machine)、快递柜等等通过触摸屏与用户交互的设备上,本申请实施例对电子设备的具体类型不作任何限制。
示例性的,图1示出了本申请实施例提供的电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,触摸屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,热释电传感器180F,接近光传感器180G,加速度传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M中一种或者任几种等。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器 (application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,触摸屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
电子设备100通过GPU,触摸屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接触摸屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
触摸屏194用于显示图像,视频等。触摸屏194包括显示面板。显示面板可以采用液 晶触摸屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Mini LED,Micro LED,Micro-OLED,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个触摸屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,触摸屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
摄像头193可以分为前置摄像头和后置摄像头。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人体特征识别,语音识别,文本理解等。
本申请实施例中,电子设备100可以开启摄像头193采集图像,并可以由处理器(例如,NPU)判断摄像头193采集的图像中是否包括用户的人体特征。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于触摸屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少 两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于触摸屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
热释电传感器180F,包括热释电红外传感器等;热释电传感器180F通过配合调教后的透镜,聚焦电子设备100前方一定范围内人或动物发射红外线信号,经过滤光片过滤到热释电传感器180F的感应单元上,该感应单元在接收到人或动物的红外辐射,温度发生变化时就会失去电荷平衡,从而热释电传感器180F的信号输出端会向处理器110输出信号,处理器110可以根据热释电传感器180F输出的信号的变化情况确定人或者动物接近或者远离电子设备。
图2示出了人体辐射的光谱分布曲线,如图2所示,波长λ=9.5636μm时,能量密度最高,而热释电传感器180F可以检测的波长范围为5-14μm,可以覆盖9.5636μm的波长,因此热释电传感器180F适合用作人或动物红外辐射信号的检测。
本申请实施例中,当处理器110通过热释电传感器180F的输出信号确定人或动物远离时,可以控制开启前置摄像头采集图像,前置摄像头可以提供彩色或者深度图像,前置摄像头可以将采集的图像数据发送给处理器110进行分析处理。当处理器110检测到前置摄像头采集的图像中没有人体特征信息时,处理器110可以降低电子设备100的功耗。可选地,处理器110在降低电子设备100的功耗的同时,还可以关闭该前置摄像头。
当处理器110通过热释电传感器180F的输出信号确定人或者动物接近时,可以控制开启前置摄像头采集图像,前置摄像头将采集的图像发送给处理器110进行分析处理。当处理器110检测到前置摄像头采集的图像中有人体特征时,处理器110可以恢复电子设备100的功耗。可选地,处理器110在恢复电子设备100的功耗的同时,还可以关闭该前置摄像头。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节触摸屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
加速度传感器180H,安装于电子设备内部电路板,通过I2C接口与处理器相连,可以提供高精度的x、y、z三轴的加速度值,用于检测设备是否正在运动。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于触摸屏194,由触摸传感器180K与触摸屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过触摸屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与触摸屏194所处的位置不同。
图3示出了本申请实施例提供的电子设备100的系统架构的示意性框图。该系统架构由框架(Framework)层的用户检测与功耗控制模块110、本地(Native)层的常驻(Daemon)服务中的执行适配子系统120和硬件抽象层与内核(HAL&Driver)层的内核适配子系统130构成。其中,执行适配子系统120可以包括常驻服务中Wi-Fi服务模块和蓝牙服务模块;内核适配子系统130可以包括触摸屏模块、音频模块、Wi-Fi模块和蓝牙模块。
各模块功能如下:
用户检测与功耗控制模块110的作用是识别是否有交互的状态和执行相应状态下功耗优化和恢复的决策。锁状态切换感知模块识别出应用(application,APP)长时间持锁亮屏、用户设置长时间自动休眠等场景,并进行人体接近远离的检测,在人体远离后进行功耗是否优化的决策。触摸、按键与位置检测模块用来在人体从远离到接近后,对电子设备进行操作时的识别,识别通过后进行功耗是否恢复的决策。
锁状态分为持锁状态和无锁状态,持锁状态和无锁状态可以是针对应用而言,持锁状态可以理解为应用申请并且持有锁,持锁的目的是为允许应用持续运行不进入休眠状态,无锁状态可以理解为应用申请释放锁并进入无锁状态。本申请实施例中,锁可以包括屏幕高亮锁(screen bright wake lock),当应用持有屏幕高亮锁时,在应用运行期间,电子设备会保持CPU运行,允许保持屏幕高亮显示,允许关闭键盘灯。
例如,用户打开视频播放APP在播放视频时,视频播放APP先去向框架层中的电源管理(power manager)模块申请持有屏幕高亮锁,这样用户在通过该视频播放APP观看视频时,电子设备不会灭屏进入休眠状态。
执行适配子系统120是功耗优化与恢复动作执行的本地部分。该部分提供框架层到硬件抽象层与内核层的连接功能,将Java调用的功耗控制函数,转调到内核的功能执行函数。
内核适配子系统130是功耗优化与恢复动作执行的内核部分,该部分提供功耗控制的底层功能函数,供上层在适当的时候调用。功耗优化包括但不限于:将所述电子设备的显示屏从亮屏状态切换至黑屏状态,调低电子设备的显示屏的亮度,降低所述电子设备的系统运行频率,将电子设备的音频参数由高功耗音频参数切换至低功耗音频参数,降低电子设备的Wi-Fi模块的刷新频率,降低电子设备的蓝牙(bluetooth,BT)模块的刷新频率中的一种或者多种。
应理解,本申请实施例中的硬件抽象层与内核层还可以分为两个层,分别是硬件抽象层、内核层,由于硬件抽象层、内核层中都保存有触摸屏、音频、Wi-Fi、蓝牙的不同功能函数,所以为了方便,本申请实施例中,将硬件抽象层、内核层统一在一起描述为硬件抽象层与内核层。
本申请实施例提供了一种降低功耗的方法和电子设备,智能化地检测用户是否在与电 子设备进行交互,在检测到无用户交互时,根据当前电子设备运行场景,通过一系列措施降低功耗;在检测到用户重新开始交互时恢复电子设备的功耗。该过程可以由电子设备自动识别是否有用户交互,并降低和恢复功耗,无需用户手动操作。
本申请实施例中,可以在电子设备上设置入口,允许用户实时开启与关闭,设置无交互时间等。
图4示出了本申请实施例提供的用户在远离或者接近电子设备时的示意图,如图4所示,当用户远离电子设备时,电子设备进入低功耗状态;当用户接近电子设备时,电子设备恢复正常功耗。
本申请实施例中,在用户主动打开该功能并授权获取用户图像信息后,启动查询是否进入了用户长时间交互的场景,该场景包括但不限于以下几种:
(1)用户设置了超过阈值的休眠时长;
(2)APP自主申请了亮屏锁;
(3)系统开始升级;
(4)电子设备长时间亮屏运行的其他场景。
当电子设备满足以上几种情况的一种或者多种时,首先检测电子设备(例如,图4所示的平板电脑)是否静止了一段时间,如果没有,则继续等待;如果已经静止一段时间,则启动热释电传感器实时检测人或者动物的接近或者远离。在未检测到人或者动物的接近或者远离时保持当前状态;在检测到人或者动物的接近或者远离时启动前置摄像头进行人体特征的识别,从而确定电子设备与用户的交互状态。
图5示出了本申请实施例提供的降低功耗的方法300的示意性流程图,如图5所示,该方法300包括:
S301,电子设备启动加速度传感器。
S302,该电子设备判断电子设备是否已经静止一段时间。
示例性的,电子设备通过图3中用户检测与功耗控制模块110向框架层获取传感器管理(sensor manager)模块的代理,具体地,电子设备获取传感器管理模块中加速度传感器管理模块的代理,并通过加速度传感器管理模块向框架层注册固定采样率P(单位为次数/s),如1Hz的加速度传感器监听器,在监听处理函数中通过底层上报来的原始数据计算得到x、y、z轴加速度。触摸、按键与位置检测模块维护固定时间段T(单位为s)内的加速度历史值的列表L,列表通过先进先出的方式,由监听处理函数对每次数据进行更新。
在监听处理函数更新T*P次后,列表L被首次填充满,此时计算列表L中x、y、z轴加速度值的均方根误差。如果是三个值的均方根误差均在第一阈值范围内,则判定电子设备已经处于静止状态一段时间;如果三个值的均方根误差不在第一阈值范围内,则继续等待,在经历t时间后,监听函数处理更新t*P组数据,此时再次计算列表L中x、y、z轴加速度值的均方根误差X rmse,并判断是否在阈值范围,如此重复。这样,可以通过自定义第一阈值范围的方式确定静止判断标准,具有更强的可定制性。
一种可能的实现方式中,x、y、z轴加速度值的方差X rmse的计算方式可以如公式(1)所示:
Figure PCTCN2019074270-appb-000001
其中,X rmse为x、y、z轴加速度值的均方根误差,N为3,x t为当前x轴、y轴或者z轴的加速度值,x avg为历史列表中x轴、y轴或者z轴的加速度均值。
一种可能的实现方式中,该第一阈值范围为(0,0.06)。
需要说明的是S301至S302为可选步骤,因为这两个步骤可以在S302之前的一个时间已经执行完。
S303,在确定电子设备已经静止一段时间的情况下,电子设备启动热释电传感器。
S304,电子设备判断是否检测到人或者动物运动。
可选地,本申请实施例中,可以通过热释电传感器检测人或者动物运动,其中,人或者动物运动包括人或者动物接近或者远离电子设备。
示例性的,热释电传感器中具有热释电效应的晶体会在接收到人或者动物的红外辐射时造成温度变化,晶体内电荷移动,在两端产生一定量的电荷,经由电路放大处理后,可以对外输出高低电平,或者脉冲信号。
由于热释电传感器只有在接收外部红外线辐射变化时才会产生电荷,在两端产生电势,而后将会再次电荷平衡,电势消失,因此它只对运动的红外辐射源较为敏感,在检测不到人或者动物运动时,无法判断人或者动物是处于静止状态还是不在检测区域。热释电传感器在工作时仅需接收外界红外光和简单的电路处理,所以功耗极低,常开时具有较高的实时性,且成本较低。
示例性的,图6示出了一种热释电传感器的结构示意图,该热释电传感器包括3个引脚:引脚“1”接电源正极,引脚“2”接信号输出端,引脚“3”接电源负极。
如图6所示,滤光片能有效地让人或者动物辐射的红外线通过,而最大限度地阻止阳光、灯光等可见光中的红外线通过,以免引起干扰;感应单元可以为上述具有热释电效应的晶体。
当热释电红外传感器没有检测到人或者动物的红外辐射信号时,而两个感应单元上以相反的极性串联,由于环境温度影响所产生的电荷抵消,热释电传感器无电压输出。
当人或者动物静止在传感器的检测区域内时,照射到感应单元上的红外辐射能量相等,感应单元上产生等量的相反电荷,热释电传感器无电压输出。
当人或者动物在热释电传感器检测区域内移动时,人或者动物产生的红外辐射使得两个感应单元上接收到的红外辐射的能量不同,感应单元上产生不同的电压,传感器才会输出电信号。
应理解,本申请实施例中的热释电传感器也可以称为热释电红外传感器;由于热释电传感器本身并不发出任何形式的能量,只是靠接收红外光来完成检测,所以热释电传感器还可以称为被动式热释电红外传感器(passive pyroelectric infrared sensor)。
图7示出了本申请实施例提供的用户与电子设备存在的四种状态的示意图,如图7所示,用户与电子设备的状态存在四种:用户在电子设备前方(交互)、用户在远离、用户不在电子设备前方(未交互)、用户在接近。
理想的状态切换顺序如上图7所示的顺时针方向的顺序,但也存在用户在远离过程中又改变主意,重新回到电子设备前方等的情况。
本申请实施例中,电子设备利用热释电传感器的输出信号实时检测用户运动状态,在检测到人或者动物运动时启动前置摄像头进行人体特征的识别确认,未检测到人或者动物运动时,保持此前状态。
下面介绍电子设备利用热释电传感器的输出信号检测人或者动物运动的过程。
热释电传感器通过透镜将人或动物发射的红外光聚焦到热释电晶体上,同时也产生交替变化的红外辐射高灵敏区和盲区,热释电传感器输出信号电压呈脉冲形式,且频率由人或者动物运动速度决定。当用户在电子设备前晃动时,热释电传感器正常输出脉冲信号,电子设备的处理器可以确定前方有人或者动物。
当人或者动物接近电子设备时,电子设备的热释电传感器从不输出脉冲信号到输出脉冲信号,电子设备的处理器检测到热释电传感器之前输出的电压状态为0,而从某个时刻开始正常输出脉冲信号且输出脉冲信号的时长大于或者等于第二预设时长(例如,1s),则电子设备可以确定有人或者动物接近。
当人或者动物远离电子设备时,电子设备的热释电传感器从输出脉冲信号到不输出脉冲信号,电子设备的处理器检测到热释电传感器之前输出正常的脉冲信号,而从某个时刻开始不再输出脉冲信号且不输出脉冲信号的时长大于或者等于第二预设时长(例如,1s),则电子设备的处理器可以确定人或者动物远离电子设备。
应理解,当人或者动物在电子设备前的晃动幅度比较小时,电子设备也可以将这一部分信号较弱的部分过滤掉,认为人或者动物在电子设备前是静止的。
可选地,当热释电传感器输出的信号的变化满足第一预设条件时,确定人或者动物远离该电子设备。
可选地,该第一预设条件可以为热释电传感器从输出正常的脉冲信号到不输出脉冲信号并且不输出脉冲信号的时间长度超过第一预设时长。第一预设时长可以赋初始值,限定取值上下限,并根据成功次数以固定的变化量更新,成功一次,依据预设的变化量缩减一次第一预设时长。当然,第一预设时长也可以是固定值。下面以第一预设时长可以动态变化为例进行说明,但并不构成限定。
示例性的,当电子设备进入低功耗状态后,用户立即手动触发退出低功耗后(或者,电子设备从低功耗到恢复功耗持续时间小于第三预设时长),电子设备可以恢复正常功耗,并且开始更新该第一预设时长,例如,原来的预设时长为2s,此时更新为3s,使得第一预设时长更加切合用户的习惯,同时,也有助于提高电子设备对用户运动状态判断的准确度。
示例性的,当电子设备进入低功耗状态后,用户很长时间才手动触发退出低功耗(或者,电子设备从低功耗到恢复功耗持续时间大于或者等于第三预设时长),电子设备可以恢复正常功耗,并且开始更新该第一预设时长,例如,原来的预设时长为2s,此时更新为1s,使得第一预设时间更加切合用户的习惯,同时,电子设备更快速得进入低功耗状态,也有助于节省电子设备的功耗。
应理解,本申请实施例中,“成功一次”也可以理解为确定用户远离电子设备后打开前置摄像头没有检测到人体特征,开始降低功耗,且降低功耗的时间持续一定预设时长后电子设备才恢复功耗。
还应理解,本申请实施例中,第一预设时长可以有上限值和下限值,例如,上限值为 10s,下限值为1s,在电子设备自适应调整预设时长的过程中,当第一预设时长更新至10s后,则不再增加该第一预设时长;或者,当第一预设时长降低至1s后,则不再减少该第一预设时长。
还应理解,本申请实施例中的第三预设时长可以为固定值,该第三预设时长可以不用进行调整。
可选地,该第一预设条件也可以为热释电传感器输出的信号的波形变化频率从大于或者等于第一频率阈值,变化为小于或者等于第二频率阈值,其中,第一频率阈值大于或者等于第二频率阈值。
人或者动物接近电子设备过程中,热释电传感器输出的信号的波形变化频率比较大,而当人或者动物远离电子设备过程中,热释电传感器示出的信号的变化频率逐渐变小,直到人或者动物彻底离开电子设备前时,波形变化频率变为0。本申请实施例中,也可以通过输出信号的波形变化频率来判断人或者动物远离电子设备。
可选地,当热释电传感器输出的信号的变化满足第二预设条件时,确定人或者动物接近该电子设备。
可选地,该第二预设条件可以为热释电传感器从不输出正常的脉冲信号到输出脉冲信号并且输出脉冲信号的时间长度超过第二预设时长。
本申请实施例中,电子设备也可以根据用户的习惯对第二预设时长进行调整,此处并不对该第二预设时长的调整方式做任何限定。当然,第二预设时长也可以是固定值。
可选地,该第二预设条件还可以为热释电传感器输出的信号的波形变化频率从小于第二频率阈值,变化为大于或者等于第一频率阈值,其中,该第一频率阈值大于该第二频率阈值。
S305,该电子设备在检测到人或者动物运动的情况下,开启前置摄像头采集图像。
S306,该电子设备判断是否检测到人体特征。
S307,该电子设备在检测到人体特征的情况下,更新电子设备为交互状态,并保持当前的功耗。
S308,该电子设备在未检测到人体特征的情况下,更新电子设备为未交互状态,并降低当前电子设备的功耗。
应理解,方法300中在启动加速度传感器之前,该电子设备以正常的功耗运行。
一种可能的实现方式中,本申请实施例的前置摄像头包括彩色摄像头和/或深度摄像头。
例如,华为的Mate 20手机上的前置摄像头为彩色摄像头,华为的Mate 20Pro手机上的前置摄像头包括了彩色摄像头和深度摄像头。
可选地,用户的人体特征包括人脸信息、人体躯干信息、人体四肢信息、人体头型信息中的一种或者多种。
可选地,该电子设备判断是否检测到人体特征,包括:
该电子设备判断是否检测到人体特征以及该人体特征是否满足第三预设条件。
可选地,在检测到人体特征,且该人体特征满足第三预设条件的情况下,该电子设备更新电子设备为交互状态,保持当前的功耗;或者,
在未检测到人体特征的情况下,或者,在检测到人体特征且该人体特征不满足第三预 设条件的情况下,该电子设备更新电子设备为未交互状态,降低当前电子设备的功耗。
可选地,该第三预设条件为电子设备的显示屏的垂直线与人体部位朝向所在的直线的夹角的范围。
以下以用户的人体特征包括人脸信息为例进行说明。
本申请实施例中,S305-S308中人脸检测部分采用了AI提供人脸检测能力,一种可能的实现方式中,人脸检测的过程可以为:
(1)添加人脸检测相关功能类到项目工程。
(2)采用人工智能视觉基础(AI vision base)静态类进行参数初始化,获取到系统AI服务的连接。
(3)定义人脸检测(face detector)实例。
(4)将从前置摄像头获取的图像以类的形式提供给FaceDetector.detect函数执行人脸检测算法,并等待返回对象简谱(Javascript object notation,Json)格式的人脸信息结果。
一种可能的实现方式,人脸信息结果包括人体的脸部特征信息,以及人脸的方位角信息。
人脸的方位角信息可以理解为以电子设备的显示屏的垂直线为基准,其与人脸朝向所在的直线的夹角,当该夹角满足第三预设条件时,电子设备可以确定处于交互状态,从而保持或者恢复为电子设备之前正常运行时的功耗。
可选地,该第三预设条件可以为:电子设备的显示屏的垂直线与人脸朝向所在的直线的夹角小于或者等于第一角度阈值。
应理解,上述第三预设条件还可以为其他条件,例如,当人体特征信息包括人体躯干信息时,该第三预设条件可以为:电子设备的显示屏的垂直线与人体躯干朝向所在的直线的夹角小于或者等于第二角度阈值。
可选地,在该人体特征包括人脸信息及其他人体特征信息时,人脸信息的优先级高于其他人体特征信息的优先级。
可选地,该第一角度阈值与该第二角度阈值相同或者不同。
示例性的,以卷积神经网络算法为例说明:
Step1:首先收集大量人脸数据,并分为训练数据、验证数据和测试数据。
Step2:搭建卷积神经网络基本结构:输入层、卷积层、子采样层、全连接层、输出层。卷积层和子采样层配套,并且可以有多个。输出层可以采用softmax回归方法。
Step3:搭建卷积神经网络模型:按上一步的顺序依次连接。定义代价函数、学习速率、批大小等参数,采用批量随机梯度下降算法优化代价函数。
Step4:在训练数据集上更新模型参数。设置训练步数,每次遍历从训练数据中提取的一批样本,寻找代价函数最小化所需的模型参数。
Step5:模型参数生成后初始化到该模型中,输入经图像预处理之后的测试图像,即可完成测试数据,也就是真实图像的人脸识别。
应理解,本申请实施例中对于人体特征的检测并不限于以上举例,还可以采用其他方式进行人体特征的检测。
还应理解,本申请实施例中,前置摄像图可以采集一张或者多张图片,或者采集一段视频,采集的图片或者视频可以缓存在电子设备的缓存器中,当电子设备通过图片或者视 频识别出人体特征后,可以删除缓存的图片或者视频。
一种可能的实现方式中,降低当前电子设备的功耗的方法包括但不限于以下的一种或者多种:
(1)降低显示屏亮度;
(2)降低系统运行频率;
(3)将高功耗音频参数切换至低功耗音频参数;
(4)降低Wi-Fi模块的刷新频率;
(5)降低蓝牙模块的刷新频率;
(6)削减高耗电单元的功耗;
(7)将显示屏由亮屏状态切换为黑屏状态。
一种可能的实现方式中,高耗电单元包括但不限于:减少全球定位系统(global positioning system,GPS)定位次数,对于应用的申请,可以采用之前的数据;减少调制解调器(Modem)与处理器的信息交互;降低触控面板(touch panel,TP)刷新频率。
由于通过前置摄像头采集图像,并通过人体特征识别算法来检测图像中是否有人体特征的方式准确率很高,但计算量大导致功耗较高,所以前置摄像头不适合长时间开启。
本申请实施例中,利用热释电传感器和前置摄像头各自的优势,弥补劣势,实现低成本、低功耗、高实时且识别准确的人体接近与远离状态检测方法。
应理解,本申请实施例中,也可以只采用热释电传感器来检测人或者动物接近或者远离电子设备,例如,当热释电传感器从不输出正常的脉冲信号到输出正常的脉冲信号并且持续的时长超过第一预设时长后,则可以认为人或者动物接近电子设备,则电子设备恢复功耗(之前的某一时刻降低了电子设备的功耗)或者保持电子设备的功耗。
又例如,当电子设备检测到热释电传感器从输出正常的脉冲信号到不输出正常的脉冲信号并且持续的时长超过第一预设时长后,则可以认为用户远离电子设备,则电子设备可以降低功耗。
本申请实施例提供的降低功耗的方法,电子设备可以基于有无交互态智能调节系统功耗,在有用户交互时正常运行;在无用户交互时低功耗运行。该方法可以解决无交互时电子设备电量的浪费问题,并且不会对用户的体验带来明显影响。
本申请实施例的降低功耗的方法,电子设备通过加速度传感器检测的加速度变化作为方法的启动条件,通过热释电传感器的输出信号变化实时检测人或者动物远离或者接近,并由前置摄像头采集的图像进行人体特征识别,保证了方法的低成本、低功耗、高实时和准确性。
以上结合图5描述了本申请实施例提供判断电子设备的交互状态的示意性流程图,当电子设备确定进入未交互状态后,可以通过以下几种方式确定电子设备进入交互状态。
可选地,本申请实施例提供多种方式检测用户重新开始交互,包括手动的屏幕触摸和按键、电子设备移动,自动的热释电传感器与前置摄像头组合的多传感器协同检测方法。
(a)触摸屏幕退出未交互状态
本方法实现可以在电子设备的应用自己创建的service中,触摸、按键与位置检测模块通过创建一个x轴起始位置、y轴起始位置、长度、宽度均为1的视图,通过WindowManager将该视图添加到电子设备的界面上,并且根据视图来监听触摸事件。在 触摸事件处理函数中过滤对本方法生效的触摸类型,满足类型要求时,触摸、按键与位置检测模块对状态进行更新,并下发功耗切换指令。
(b)按键退出未交互状态
本方法实现可以在service中,触摸、按键与位置检测模块在如上创建的视图中监听按键事件。在按键事件处理函数中过滤对本方法生效的按键类型,满足类型要求时,触摸、按键与位置检测模块对状态进行更新,并下发功耗切换指令。
(c)设备移动退出未交互状态
本方法实现可以在service中,触摸、按键与位置检测模块在如上创建的视图中监听加速度传感器的事件。监听数据的频率设置为1Hz,这样,每隔1s获取一次加速度传感器数据,数据包括电子设备在x、y、z轴上的加速度。例如,可以根据上述公式(1)计算N组的三个加速度各自的均方根误差X rmse,用于评估最近N组的各加速度值的离散情况,离散程度越大,表明电子设备的运动幅度越大,在X rmse超过第一阈值范围时认为电子设备处于运动状态。
(d)热释电传感器与前置摄像头组合的多传感器协同检测退出未交互状态
上述实施例中描述过了热释电传感器与前置摄像头协同判断无用户交互的方法,判断有交互的方法与判断无用户交互的方法的区别是在热释电传感器定时检测出人或者动物运动后,人体特征识别算法也检测到人体特征,则更新当前状态为交互状态。
图8示出了本申请实施例提供的降低功耗的方法400的示意性流程图,如图8所示,该方法400包括:
S401,电子设备确定设置休眠时间超过阈值。
S402,该电子设备确定APP申请亮屏锁。
S403,该电子设备确定系统开始升级。
当满足S401-S403中的一种或者多种时,可以执行步骤S404。
S404,该电子设备判断用户是否开启自动调节。
S405,如果用户开启自动调节,则该电子设备启动加速度传感器。
S406,该电子设备判断电子设备是否保持静止状态大于预设时长。
S407,如果电子设备保持静止状态大于预设时长,则该电子设备启动热释电传感器。
S408,该电子设备判断是否检测到人或者动物接近或者远离电子设备。
S409,如果检测到人或动物接近电子设备,则该电子设备保持当前的功耗。
可选地,当满足第二预设条件时,该电子设备确定用户接近电子设备。
S410,如果未检测到人或动物远离电子设备,且没有检测到人或动物接近电子设备,则该电子设备保持当前的功耗。
S411,如果检测到人或动物远离电子设备,则该电子设备启动前置摄像头。
可选地,当满足第一预设条件时,该电子设备确定用户远离电子设备。
应理解,该第一预设条件与该第二预设条件可以参考上述方法300中的描述,为了简洁,在此不再赘述。
S412,该电子设备判断是否检测到人体特征。
S413,如果检测到人体特征,则该电子设备保持当前的功耗。
S414,如果未检测到人体特征,则该电子设备降低当前的功耗。
S415,如果检测到用户在电子设备的显示屏上的触摸或者按键操作,该电子设备执行S422。
S416,如果检测到用户移动电子设备,该电子设备执行S422。
S417,该电子设备判断检测到人或者动物接近或者远离电子设备。
S418,如果检测到人或动物远离电子设备,则该电子设备保持当前的功耗。
S419,如果未检测到人或动物远离电子设备,且未检测到人或动物接近电子设备,则该电子设备保持当前的功耗。
S420,如果检测到人或动物接近电子设备,则该电子设备启动前置摄像头。
S421,电子设备判断是否检测到人体特征。
S422,如果检测到人体特征,或者,检测到显示屏上的触摸或者按键操作,或者,检测到用户移动电子设备,则电子设备恢复电子设备的功耗。
S423,如果未检测到人体特征,则电子设备保持当前的功耗。
示例性的,本申请实施例中,电子设备在降低功耗之前,可以重复S410中前置摄像头的检测,例如,一个检测周期为2s,可以进行5~8次检测周期的检测,在10~16s内,电子设备通过前置摄像头采集的图像均没有检测到人体特征,则开始降低功耗。
可选地,在启动前置摄像头检测人体特征的过程中,电子设备还可以根据用户的习惯,自适应调整前置摄像头的检测周期和/或检测次数。
应理解,本申请实施例中,检测周期可以为前置摄像头检测人体特征的周期,即前置摄像头在一定的时间段内,检测人体特征。
可选地,该检测次数为前置摄像头连续检测到人体特征的次数。例如,该检测次数为N,N为大于1的正整数,则电子设备确定前置摄像头采集的图像中包括所述人体特征还可以理解为电子设备确定在N个检测周期内都确定前置摄像头采集的图像中包括人体特征。可选地,在降低所述电子设备的功耗与恢复所述电子设备的功耗之间的时间间隔大于或者等于第四预设时长时,调低所述前置摄像头的检测周期和/或检测次数;或者,
在降低所述电子设备的功耗与恢复所述电子设备的功耗之间的时间间隔小于所述第四预设时长时,调高所述前置摄像头的检测周期和/或检测次数。
由于用户使用习惯千差万别,有部分用户在电子设备长时间亮屏(如看视频或玩游戏)从不离开,或者离开时让电子设备休眠,有部分用户经常中途离开。所以前置摄像头检测周期、检测次数可以根据此前全部流程成功的次数来累积更新。
检测周期赋初始值,限定取值上下限,电子设备第一次打开前置摄像头时,按照检测周期的初始值进行人体特征的检测,之后可以根据成功次数以固定的变化量更新,成功一次,依据预设的变化量缩减一次检测周期的时长,降低功耗后短时间内(可以定义,比如10s)由用户触发恢复,则依据预设的变化量增加一次检测周期的时长。最终实现对于经常离开较长时间的用户,电子设备更快进入低功耗;对于短时间离开的用户,电子设备的检测周期加长,提高了电子设备对用户运动状态判断的准确度。
应理解,短时间离开的用户还可以理解为远离电子设备和接近电子设备之间时间间隔较短的用户。
人体特征的检测次数赋初始值,限定取值上下限,电子设备第一次打开前置摄像头时,按照检测次数的初始值进行人体特征的检测,之后可以根据成功次数以固定的变化量更 新,成功一次,依据预设的变化量缩减一次检测次数的值,降低功耗后短时间内(可以定义,比如10s)由用户触发恢复,则依据预设的变化量增加一次检测次数的值。最终实现对于经常离开较长时间的用户,电子设备更快进入低功耗;对于短时间离开的用户,电子设备的人体特征检测次数增多,提高了电子设备对用户运动状态判断的准确度。
应理解,电子设备第一次打开前置摄像头时,可以按照预设的检测周期和/或检测次数进行人体特征的检测。之后,电子设备可以根据从降低电子设备的功耗到恢复电子设备的功耗之间的时间间隔的情况来调整检测周期和/或检测次数。
可选地,该检测次数可以为连续检测到人体特征的次数。
电子设备确定前置摄像头采集的图像中包括所述人体特征还可以理解为电子设备确定在连续的N个检测周期内都确定前置摄像头采集的图像中包括人体特征。
电子设备在开启前置摄像头后以一定的检测周期开始检测,当连续未检测到人体特征的次数达到第一数值时,则降低电子设备的功耗并且关闭前置摄像头;当连续检测到人体特征的次数达到第二数值时,则恢复电子设备的功耗并且关闭前置摄像头。
可选地,该第一数值和该第二数值相同或者不同。
例如,该第一数值为2次,电子设备预设的检测周期为2s,电子设备在第一次检测到人或者动物远离时,开启前置摄像头并按照2s的检测周期进行检测,当连续在2个检测周期内未检测到人体特征,则降低电子设备的功耗并关闭前置摄像头。
又例如,该第一数值为2次,电子设备预设的检测周期为2s,电子设备在第一次检测到人或者动物接近时,开启前置摄像头并按照2s的检测周期进行检测,当连续在2个检测周期内检测到人体特征,则恢复电子设备的功耗并关闭前置摄像头。
应理解,本申请实施例中,在调整前置摄像头的检测周期与检测次数时,可以根据电子设备是否成功进入低功耗,并且电子设备在低功耗与恢复功耗之前持续的时间大于或者等于第四预设时长。
以检测周期为例,当用户经常长时间离开电子设备前,即电子设备成功降低功耗并从降低功耗到恢复功耗之间的时间间隔大于或者等于第四预设时长,电子设备可以调低检测周期,这可以使得电子设备更快进入低功耗。
当用户短时间离开电子设备,即电子设备成功降低功耗并从降低功耗到恢复功耗之间的时间间隔小于第四预设时长,电子设备可以调高检测周期,提高了电子设备对用户运动状态判断的准确度。
例如,电子设备按照一个检测周期(例如,1s)检测,在连续2个检测周期没有检测到人体特征后认为无用户交互,降低电子设备的功耗。
以一个具体的场景为例,用户在看视频时,手中拿的笔掉了,用户从俯身到捡起笔这一过程持续了2s,那么电子设备其实在这2s内都没有检测到人体特征,随后电子设备会降低功耗但是很快会恢复功耗。
此时,电子设备会将检测周期加长,例如,检测周期调高至2s,那么下一次在遇到上述场景的情况,由于第一个检测周期内没有检测到人体特征,但是在第二个检测周期检测到了人体特征,则电子设备不会触发进入低功耗,提高了电子设备对用户运动状态判断的准确度。
应理解,该第四预设时长可以为一个预设的固定时长,即该第四预设时长可以不用进 行调整。
可选地,该第四预设时长可以和该第三预设时长相等。
本申请实施例中,在S411中如果检测到人体特征,则降低电子设备的功耗后,也可以停止热释电传感器以及前置摄像头的检测,等待检测到用户的触摸或者按键操作后,恢复电子设备的功耗;又例如,在S411中如果检测到人体特征,则降低电子设备的功耗后,还可以不关闭前置摄像头,当前置摄像头再一次检测到用户的人体特征后,恢复电子设备的功耗。
以电子设备为平板电脑为例,当S411中检测到人体特征后,则降低电子设备的功耗,关闭热释电传感器以及前置摄像头,可以降低约300-700mA左右的功耗;而如果一直开启前置摄像头,则可以节省约240-640mA左右的功耗。
用户检测与功耗控制模块作为系统级APP,以service的形态常驻后台,长期处于未活动状态,在设置休眠时长超过阈值、APP设置申请亮屏锁等长时间运行时被触发执行,并在退出这些状态时重新处于未活动状态,保证该服务对系统性能、功耗的影响最低。
下面结合图3所示的系统架构介绍本申请实施例中几个检测过程的内部实现。
(1)开启与关闭有无人或动物的检测
以APP长时间持亮屏锁为例说明,APP需要长时间亮屏时会向电源管理(power manager)模块申请亮屏锁,电源管理模块通过进程间通信调用电源管理服务(power manager service)提供的服务函数acquireWakeLock(),进而调用本类的acquireWakeLockInternal(),通过在acquireWakeLockInternal()中构造好唤醒锁(wake lock)结构体后的位置打桩,发送定向广播,通知到用户检测与功耗控制模块,启动无交互检测。APP完成业务处理需向电源管理模块申请释放亮屏锁,电源管理模块通过进程间通信调用电源管理服务提供的服务函数releaseWakeLock(),进而调用本类的releaseWakeLockInternal(),通过在releaseWakeLockInternal()中构造好唤醒锁结构体后的位置打桩,广播通知给用户检测与功耗控制模块,关闭无交互检测。
(2)电子设备是否运动的检测
用户检测与功耗控制模块启动后通过context.startService()启动前台服务,在服务的onCreate()方法中注册Sensor.TYPE_ACCELEROMETER型传感器的数据监听,并且可以设置数据读取频率,在传感器事件监听器(sensor event listener)的onSensorChanged()方法中读取x、y、z轴上的加速度,计算三个加速度各自的均方根误差,并判断是否超过在第一阈值范围内。在M分钟内均未超过静止阈值时,认为已经静止M分钟,从而进行下一步的人或者动物检测。
(3)热释电传感器与前置摄像头组合的多传感器协同检测
该方法实现上硬件依赖热释电传感器,以热释电传感器为例说明,同时依赖前置彩色摄像头或者深度摄像头。
人体接近远离检测模块上实现为三个线程的处理逻辑:
主线程负责整体的启动控制、用户界面(user interface,UI)操作和功耗的优化和恢复;
人或者动物检测线程负责热释电传感器的数据读取与热释电实时分析并实时通知人脸检测(face detect)线程;
人脸检测线程负责前置摄像头采集图像和人脸检测并适时通知主线程结果。
其中,主线程处理流程如下:
Step1:注册针对长时间亮屏使用的广播监听,监听处理函数中对应用长时间持亮屏锁、休眠时间长等类型过滤后,启动无交互状态检测;在退出长时间亮屏场景后,取消无交互状态检测,并视情况强制执行功耗恢复动作。
Step2:启动无交互状态检测时注册加速度传感器的数据监听器,设定数据读取频率为1Hz,监听器的数据变化处理函数中执行设备移动检测方法。取消无交互状态检测时取消注册的加速度传感器的数据监听器,通知人或者动物检测线程和人脸检测线程停止工作。
Step3:如果设备移动,则持续检测,直到设备在本发明设置的一定时间间隔内均未移动,则通过handler线程间通信的方式,通知人或者动物检测线程启动人或者动物接近分析。
Step4:创建基于本线程的循环处理体接收其他线程的消息(message),handleMessage()处理发送来的各类事件。如果是完成人或者动物检测的事件,人体个数为0,则执行功耗优化动作,UI上提示进入无交互低功耗模式;如果人体个数大于0,则执行功耗恢复动作,UI上提示退出无交互低功耗模式,并且延时消失。如果是触摸、按键或者设备移动的事件,则强制执行功耗恢复动作,并且UI上提示退出无交互低功耗模式,延时消失。
人或者动物检测线程处理流程如下:
Step1:创建HandlerThread并启动,创建基于HandlerThread的的循环处理体,接收其他线程的message,handleMessage()处理发送来的各类事件。
Step2:如果接收到启动人或者动物接近分析的事件,则可以以50Hz的频率定时读取热释电传感器的数据,其数据输出为三种状态,人或者动物在电子设备前晃动、人或者动物接近电子设备,或者,人或者动物远离电子设备。通过多次读取来过滤异常干扰数据,如果确定检测到人或者动物移动,则通过handler线程间通信的方式通知给人脸检测线程启动人脸检测算法。
Step3:如果接收到停止人或者动物接近分析的事件,则停止热释电传感器数据读取的定时器。
人脸检测线程处理流程如下:
Step1:创建HandlerThread并启动,创建基于HandlerThread的的循环处理体,接收其他线程的message,handleMessage()处理发送来的各类事件。
Step2:如果接收到启动人脸检测的事件,则打开前置摄像头,设置前置摄像头各项参数,启动预览,注册自动对焦的回调函数。在回调函数中执行拍照函数,在提供的拍照完成回调函数中停止自动对焦和预览,保存拍照的图像数据。
Step3:对保存的图像数据封装成Frame格式,提交给AI模块FaceDetector.Detect()处理,返回AI定义的Face链表数据,链表中Face个数代表人脸个数。
Step4:封装检测到的人脸个数到Message,通知主线程处理。
以上结合图1至图8,详细地描述了本申请实施例的降低功耗的方法,下面结合附图描述本申请实施例的降低功耗的电子设备。应理解,方法实施例所描述的技术特征同样适用于以下电子设备实施例。
图9示出了本申请实施例提供的降低功耗的电子设备500的示意性框图,所述电子设备500处于静止状态,如图9所示,该电子设备500包括:
热释电传感器510,用于输出信号;
处理器520,用于获取热释电传感器510输出的信息,并在该输出的信号的变化满足第一预设条件时,确定人或者动物远离电子设备500;
处理器520,还用于启动前置摄像头530;
前置摄像头530,用于采集图像;
该处理器520,还用于确定前置摄像头530采集的图像中不包括人体特征;
该处理器520,还用于降低电子设备500的功耗并自动关闭前置摄像头530;
该处理器520,还用于在该输出信号的变化满足第二预设条件时,确定人或者动物接近500并开启前置摄像头530;
该处理器520,还用于确定前置摄像头530采集的图像中包括人体特征;
该处理器520,还用于恢复电子设备500的功耗,并自动关闭前置摄像头530,该第一预设条件和该第二预设条件不同。
可选地,该处理器520,还用于检测到用户在电子设备500的触摸屏上的触摸或者按键操作,或者,检测到电子设备500移动;
该处理器520,还用于恢复电子设备500的功耗。
可选地,该第一预设条件包括:从输出脉冲信号到不输出脉冲信号且不输出脉冲信号的持续时长大于或等于第一预设时长;
该第二预设条件包括:从不输出脉冲信号到输出脉冲信号且输出脉冲信号的持续时长大于或等于第二预设时长。
可选地,该处理器520,还用于在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔大于或者等于第三预设时长时,调低所述第一预设时长;或者,
在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔小于所述第三预设时长时,调高所述第一预设时长。
可选地,该处理器520,还用于在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔大于或者等于第四预设时长时,调低所述前置摄像头的检测周期和/或检测次数;或者,
在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔小于所述第四预设时长时,调高所述前置摄像头的检测周期和/或检测次数。
可选地,该处理器520,具体用于执行以下操作中的一种或者多种:
将所述电子设备的显示屏从亮屏状态切换至黑屏状态;
降低显示屏亮度;
降低系统运行频率;
由高功耗音频参数切换至低功耗音频参数;
降低Wi-Fi模块的刷新频率;或者
降低蓝牙模块的刷新频率。
可选地,人体特征包括人脸信息、人体躯干信息、人体四肢信息、人体头型信息中的 一种或者多种。
应理解,该热释电传感器510可以用来实现图3中人体接近远离检测模块的部分功能(该部分功能为通过获得人或者动物的红外线辐射变化,输出信号);前置摄像头530可以用来实现图3中人体接近远离检测模块的部分功能(该部分功能为前置摄像头采集图像);处理器520可以用于实现图3中人体接近远离检测模块的部分功能(该部分功能为通过热释电传感器输出信号判断人体接近或者远离,通过前置摄像头采集的图像判断是否包括人体特征)以及功耗模式决策的全部功能(该前部功能可以参考上述方法实施例中的功耗模式决策过程)。
还应理解,根据本申请实施例的电子设备500可用于执行前述方法实施例的方法,并且电子设备500的上述和其它管理操作和/或功能分别为了实现前述方法实施例的方法的相应步骤,因此也可以实现前述方法实施例中的有益效果,为了简洁,这里不作赘述。
还应理解,该电子设备500可以对应于图1中的电子设备100,处理器520可以对应于图1中的处理器110,前置摄像头530可以对应于图1中的摄像头193(摄像头193中的前置摄像头),热释电传感器510可以对应于图1中的热释电传感器180F。
可选地,在一个简单的实施例中,本领域的技术人员可以想到电子设备500可以采用图1所示的形式。处理器520可以通过图10所示的处理器640实现。处理器640还可以通过执行存储器中存储的计算机程序来确定人或动物接近或者远离电子设备600以及确定前置摄像头610采集的图像中包括人体特征或者不包括人体特征。可选地,当所述电子设备600是芯片时,那么电子设备600中涉及的收发的功能和/或实现过程还可以通过管脚或接口电路等来实现。可选地,所述存储器为所述芯片内的存储单元,比如寄存器、缓存等,所述存储单元还可以是所述计算机设备内的位于所述芯片外部的存储单元,如图10所的存储器630。
图10示出了根据本申请实施例提供的降低功耗的电子设备600的示意性结构图,如图10所示,该电子设备600包括前置摄像头610、热释电传感器620、存储器630和处理器640,其中,一个或多个计算机程序被存储在存储器630中,一个或多个计算机程序包括指令。当指令被处理器630执行时,使得电子设备600执行以下操作:
获取该热释电传感器620的输出信号;
在输出信号的变化满足第一预设条件时,确定人或者动物远离该电子设备600;
开启该前置摄像头610并确定该前置摄像头610采集的图像中不包括人体特征;
降低该电子设备的功耗并自动关闭该前置摄像头610;
在输出信号的变化满足第二预设条件时,确定人或者动物接近该电子设备600;
开启该前置摄像头610并确定该前置摄像头610采集的图像中包括人体特征;
恢复所述电子设备600的功耗,并自动关闭所述前置摄像头610,其中,该第一预设条件和该第二预设条件不同。
应理解,该热释电传感器620可以对应于上述电子设备500中的人或动物运动检测模块510,前置摄像头610可以对应于上述电子设备500中的图像采集模块530,处理器630可以对应于上述电子设备500中的处理模块520。
可选地,该电子设备600还包括压力传感器650和加速度传感器660,当指令被处理器630执行时,使得电子设备600执行以下操作:
通过压力传感器650,检测到用户在电子设备600的触摸屏上的触摸或者按键操作,或者,通过加速度传感器660,检测到电子设备600移动;
恢复电子设备的功耗。
可选地,该第一预设条件包括:从输出脉冲信号到不输出脉冲信号且不输出脉冲信号的持续时长大于或等于第一预设时长;
该第二预设条件包括:从不输出脉冲信号到输出脉冲信号且输出脉冲信号的持续时长大于或等于第二预设时长。
可选地,当指令被处理器630执行时,使得电子设备600执行以下操作:
在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔大于或者等于第三预设时长时,调低所述第一预设时长;或者,
在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔小于所述第三预设时长时,调高所述第一预设时长。
可选地,当指令被处理器630执行时,使得电子设备600执行以下操作:
在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔大于或者等于第四预设时长时,调低所述前置摄像头的检测周期和/或检测次数;或者,
在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔小于所述第四预设时长时,调高所述前置摄像头的检测周期和/或检测次数
可选地,当指令被处理器630执行时,使得电子设备600执行以下操作:
降低显示屏亮度;
降低系统运行频率;
由高功耗音频参数切换至低功耗音频参数;
降低Wi-Fi模块的刷新频率;或者
降低蓝牙模块的刷新频率。
可选地,人体特征包括人脸信息、人体躯干信息、人体四肢信息、人体头型信息中的一种或者多种。
可选地,在一种可能的实现方式中,上述电子设备500或电子设备600可以是电子设备。
例如,该电子设备600可以对应于图1中的电子设备100,处理器630可以对应于图1中的处理器110,存储器640可以对应于图1中的内部存储器121,前置摄像头610可以对应于图1中的摄像头193(摄像头193中的前置摄像头),热释电传感器620可以对应于图1中的热释电传感器180F,压力传感器650可以对应于图1中的压力传感器180A,加速度传感器660可以对应于图1中的加速度传感器180E。
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的降低功耗的方法。
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的降低功耗的方法。
另外,本申请的实施例还提供一种电子设备,这个电子设备具体可以是芯片,组件或模块,该电子设备可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令, 当电子设备运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的降低功耗的方法。
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将电子设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的电子设备和方法,可以通过其它的方式实现。例如,以上所描述的电子设备实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个电子设备,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,电子设备或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (11)

  1. 一种降低功耗的方法,应用于电子设备,所述电子设备处于静止状态,所述电子设备包括前置摄像头和热释电传感器,其特征在于,包括:
    获取所述热释电传感器的输出信号;
    在所述输出信号的变化满足第一预设条件时,确定人或动物远离所述电子设备;
    开启所述前置摄像头并确定所述前置摄像头采集的图像中不包括人体特征;
    降低所述电子设备的功耗并自动关闭所述前置摄像头;
    在所述输出信号的变化满足第二预设条件时,确定人或动物接近所述电子设备;
    开启所述前置摄像头并确定所述前置摄像头采集的图像中包括所述人体特征;
    恢复所述电子设备的功耗,并自动关闭所述前置摄像头,所述第一预设条件和所述第二预设条件不同。
  2. 根据权利要求1所述的方法,其特征在于,所述降低所述电子设备的功耗之后,所述方法还包括:
    检测到用户在所述电子设备的触摸屏上的触摸或者按键操作,或者,检测到所述电子设备移动;
    恢复所述电子设备的功耗。
  3. 根据权利要求1或2所述的方法,其特征在于,
    所述第一预设条件包括:从输出脉冲信号到不输出脉冲信号且不输出脉冲信号的持续时长大于或等于第一预设时长;
    所述第二预设条件包括:从不输出脉冲信号到输出脉冲信号且输出脉冲信号的持续时长大于或等于第二预设时长。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔大于或者等于第三预设时长时,调低所述第一预设时长;或者,
    在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔小于第三预设时长时,调高所述第一预设时长。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述方法还包括:
    在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔大于或者等于第四预设时长时,调低所述前置摄像头的检测周期或检测次数;或者,
    在从所述降低所述电子设备的功耗到所述恢复所述电子设备的功耗之间的时间间隔小于第四预设时长时,调高所述前置摄像头的检测周期或检测次数。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述降低所述电子设备的功耗,包括以下一种或者多种:
    将所述电子设备的显示屏从亮屏状态切换至黑屏状态;
    降低所述电子设备的显示屏的亮度;
    降低所述电子设备的系统运行频率;
    将所述电子设备的音频参数由高功耗音频参数切换至低功耗音频参数;
    降低所述电子设备的Wi-Fi模块的刷新频率;或者
    降低所述电子设备的蓝牙模块的刷新频率。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述人体特征包括人脸信息、人体躯干信息、人体四肢信息,或,人体头型信息中的一种或者多种。
  8. 一种电子设备,其特征在于,所述电子设备包括:处理器,存储器、前置摄像头和热释电传感器;所述前置摄像头用于获取图像数据,所述热释电传感器用于获取人或动物发射的红外线并转换为电信号输出;所述存储器用于存储指令;所述处理器用于执行所述存储器中的所述指令,执行如权利要求1-7任一所述的方法。
  9. 一种电子设备,包括触摸屏,存储器,一个或多个处理器,前置摄像头,热释电传感器,多个应用程序,以及一个或多个程序,其中所述一个或多个程序被存储在所述存储器中,其特征在于,所述一个或多个处理器在执行所述一个或多个程序时,使得所述电子设备实现如权利要求1-7任一项所述的方法。
  10. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1-7中任一项所述的方法。
  11. 一种计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1-7中任一项所述的方法。
PCT/CN2019/074270 2019-01-31 2019-01-31 一种降低功耗的方法和电子设备 WO2020155055A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/074270 WO2020155055A1 (zh) 2019-01-31 2019-01-31 一种降低功耗的方法和电子设备
CN201980088001.7A CN113260949B (zh) 2019-01-31 2019-01-31 一种降低功耗的方法和电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/074270 WO2020155055A1 (zh) 2019-01-31 2019-01-31 一种降低功耗的方法和电子设备

Publications (1)

Publication Number Publication Date
WO2020155055A1 true WO2020155055A1 (zh) 2020-08-06

Family

ID=71840778

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/074270 WO2020155055A1 (zh) 2019-01-31 2019-01-31 一种降低功耗的方法和电子设备

Country Status (2)

Country Link
CN (1) CN113260949B (zh)
WO (1) WO2020155055A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113625540A (zh) * 2021-07-19 2021-11-09 交控科技股份有限公司 双机热备控制方法、装置及双机热备系统
WO2024129462A1 (en) * 2022-12-14 2024-06-20 Ecolink Intelligent Technology, Inc. Method and apparatus for detecting imminent use of an electronic device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113709375B (zh) * 2021-09-06 2023-07-11 维沃移动通信有限公司 一种图像显示方法及其装置、电子设备
CN114447638B (zh) * 2021-12-28 2024-04-16 兰马 带有电力线路运行数据在线监测功能的自锁接地环
CN114387733A (zh) * 2022-01-24 2022-04-22 上海蜜罐科技有限公司 室外快递柜节能方法及系统
CN114779916B (zh) * 2022-03-29 2024-06-11 杭州海康威视数字技术股份有限公司 一种电子设备屏幕唤醒方法、门禁管理方法及装置
CN117311484A (zh) * 2022-06-24 2023-12-29 华为技术有限公司 调整设备功耗的方法及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202795225U (zh) * 2012-08-07 2013-03-13 重庆电力高等专科学校 一种基于人脸检测的计算机省电系统
CN106940590A (zh) * 2017-02-08 2017-07-11 华为技术有限公司 一种终端设备状态切换方法及装置
CN106973326A (zh) * 2017-04-28 2017-07-21 张青 能够智能待机的智能电视机及其控制系统和控制方法
US20180004275A1 (en) * 2016-07-01 2018-01-04 Microsoft Technology Licensing, Llc Face detection circuit
CN109274810A (zh) * 2018-09-29 2019-01-25 努比亚技术有限公司 一种终端处理方法、终端及计算机可读存储介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100465827C (zh) * 2005-03-29 2009-03-04 华为技术有限公司 多媒体终端及其进行状态转换的方法
JP5348296B2 (ja) * 2012-08-16 2013-11-20 富士ゼロックス株式会社 電力供給制御装置、画像処理装置、電力供給制御プログラム
KR20150033505A (ko) * 2013-09-23 2015-04-01 삼성전자주식회사 전자 장치에서 절전 모드를 수행하는 방법 및 이를 위한 전자 장치
JP2015174281A (ja) * 2014-03-14 2015-10-05 キヤノン株式会社 画像形成装置及びその制御方法、並びにプログラム
CN204423302U (zh) * 2015-02-13 2015-06-24 杭州乐鼎科技有限公司 电子签名设备
CN204810441U (zh) * 2015-07-14 2015-11-25 深圳市奔迈科技有限公司 一种基于rf传输的远程可视门铃
CN105100730A (zh) * 2015-08-21 2015-11-25 联想(北京)有限公司 一种监控方法及摄像头装置
CN107120701A (zh) * 2017-05-04 2017-09-01 广东万家乐燃气具有限公司 一种具有人体智能识别功能及手势操作的吸油烟机
CN107340856A (zh) * 2017-06-12 2017-11-10 美的集团股份有限公司 控制方法、控制器、智能镜子和计算机可读存储介质
CN107340860A (zh) * 2017-06-21 2017-11-10 杰创智能科技股份有限公司 显示屏控制方法及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202795225U (zh) * 2012-08-07 2013-03-13 重庆电力高等专科学校 一种基于人脸检测的计算机省电系统
US20180004275A1 (en) * 2016-07-01 2018-01-04 Microsoft Technology Licensing, Llc Face detection circuit
CN106940590A (zh) * 2017-02-08 2017-07-11 华为技术有限公司 一种终端设备状态切换方法及装置
CN106973326A (zh) * 2017-04-28 2017-07-21 张青 能够智能待机的智能电视机及其控制系统和控制方法
CN109274810A (zh) * 2018-09-29 2019-01-25 努比亚技术有限公司 一种终端处理方法、终端及计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113625540A (zh) * 2021-07-19 2021-11-09 交控科技股份有限公司 双机热备控制方法、装置及双机热备系统
WO2024129462A1 (en) * 2022-12-14 2024-06-20 Ecolink Intelligent Technology, Inc. Method and apparatus for detecting imminent use of an electronic device

Also Published As

Publication number Publication date
CN113260949B (zh) 2024-07-02
CN113260949A (zh) 2021-08-13

Similar Documents

Publication Publication Date Title
WO2020155055A1 (zh) 一种降低功耗的方法和电子设备
WO2020187157A1 (zh) 一种控制方法和电子设备
WO2021073185A1 (zh) 一种触摸屏、电子设备、显示控制方法
WO2021179773A1 (zh) 图像处理方法和装置
EP3933664A1 (en) Integrated chip and sensor data processing method
WO2020029974A1 (zh) 数据传输方法、芯片、控制器及显示装置
WO2021147396A1 (zh) 图标管理方法及智能终端
CN110266930A (zh) 图像拍摄的补光方法、移动终端及灯光调节方法
CN108182896B (zh) 一种亮度检测方法、装置及移动终端
CN110456938A (zh) 一种曲面屏的防误触方法及电子设备
WO2023000772A1 (zh) 模式切换方法、装置、电子设备及芯片系统
WO2021000943A1 (zh) 一种指纹开关的管理方法及装置
CN107664841A (zh) 智能眼镜及控制智能眼镜休眠唤醒的方法
JP2014142851A (ja) 電子機器、視線入力プログラムおよび視線入力方法
CN110687998A (zh) 一种应用管理方法及装置
CN113691271B (zh) 数据传输方法及可穿戴设备
WO2021238387A1 (zh) 一种执行应用的方法及装置
CN114090102B (zh) 启动应用程序的方法、装置、电子设备和介质
WO2023083132A1 (zh) 拍摄方法、装置、电子设备和可读存储介质
CN113920963A (zh) 一种屏幕亮度调节方法、电子设备及存储介质
CN115589051A (zh) 充电方法和终端设备
CN110058729B (zh) 调节触摸检测的灵敏度的方法和电子设备
CN108833695A (zh) 控制方法、控制装置、电子装置、计算机存储介质及设备
CN111524528A (zh) 防录音检测的语音唤醒方法及装置
WO2022089625A1 (zh) 一种增强现实功能控制方法和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19912278

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19912278

Country of ref document: EP

Kind code of ref document: A1