WO2023015945A1 - 系统功耗控制方法及电子设备 - Google Patents

系统功耗控制方法及电子设备 Download PDF

Info

Publication number
WO2023015945A1
WO2023015945A1 PCT/CN2022/088777 CN2022088777W WO2023015945A1 WO 2023015945 A1 WO2023015945 A1 WO 2023015945A1 CN 2022088777 W CN2022088777 W CN 2022088777W WO 2023015945 A1 WO2023015945 A1 WO 2023015945A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
power
moment
communication
preset
Prior art date
Application number
PCT/CN2022/088777
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 EP22751239.9A priority Critical patent/EP4155928A4/en
Publication of WO2023015945A1 publication Critical patent/WO2023015945A1/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
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • G06F1/3278Power saving in modem or I/O interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4893Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues taking into account power or heat criteria
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/1613Constructional details or arrangements for portable computers
    • G06F1/163Wearable computers, e.g. on a belt
    • 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
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • 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
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3209Monitoring remote activity, e.g. over telephone lines or network connections
    • 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
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3212Monitoring battery levels, e.g. power saving mode being initiated when battery voltage goes below a certain level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72451User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to schedules, e.g. using calendar applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0251Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity
    • H04W52/0254Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity detecting a user operation or a tactile contact or a motion of the device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0251Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity
    • H04W52/0258Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity controlling an operation mode according to history or models of usage information, e.g. activity schedule or time of day
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • H04W52/0274Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof
    • H04W52/0277Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof according to available power supply, e.g. switching off when a low battery condition is detected
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • H04W52/0274Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof
    • H04W52/028Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level by switching on or off the equipment or parts thereof switching on or off only a part of the equipment circuit blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present application relates to the field of electronic technology, in particular to a system power consumption control method and electronic equipment.
  • multi-tasking technology is usually applied to electronic devices, and the electronic devices run multiple different application programs or processes at the same time.
  • these open multiple applications are usually not closed, causing the process of the application to run in the background.
  • the background process communicates frequently, it will occupy the internal resources of the electronic device. This leads to a rapid power consumption, which reduces the use time of electronic devices and affects user experience.
  • the present application provides a system power consumption control method and an electronic device, which can control the communication of the background process at night and other environments, avoid the rapid consumption of the power of the electronic device, ensure the use time of the electronic device, and improve user experience .
  • Some embodiments of the present application provide a method for controlling system power consumption.
  • the following describes the present application from various aspects, and the implementation manners and beneficial effects of the following aspects can be referred to each other.
  • the present application provides a method for controlling system power consumption, which is applied to an electronic device.
  • the method includes: confirming that the electronic device enters a first mode, for example, a sleep mode, a low power state, or an unused state of the electronic device; Determining the power loss of the battery and the number of communications of the background process, wherein the power loss is the power value reduced relative to the power at the first moment, and the first moment is the initial moment when the electronic device enters the first mode;
  • the above communication times are used to indicate all processes currently running in the background, and the sum of the communication times with other devices counted since the electronic device is powered on; when the power loss reaches the preset power threshold and the communication times reach the preset communication times, the electronic device Close network communication.
  • the network communication connection is controlled by monitoring the power of the battery and the communication status of the background process, which can avoid the rapid power consumption of the electronic device and affect the user experience .
  • the electronic device determines the power loss of the battery, including: the electronic device obtains the initial power of the battery corresponding to the first moment, and the current power of the battery at the current moment, and subtracts the initial power from the current
  • the power level is the power loss of the battery corresponding to the current moment.
  • the power loss after entering the first mode can be determined by subtracting the current power from the initial power when entering the first mode, which is convenient for the electronic device to control the communication situation in time.
  • the above-mentioned method further includes: when the electronic device determines that within the first preset time period, the power-down power reaches a preset power threshold, and the number of changes in the number of communication times reaches a preset number of changes, The electronic device closes the network communication connection.
  • the method controls the network connection interface (power management and control) when the power loss speed is too fast and the communication frequency is too frequent, so as to avoid too fast power consumption and affect user experience.
  • the electronic device determines the power loss of the battery, including:
  • the electronic device obtains the electric quantity corresponding to the second moment and the current electric quantity of the battery at the current moment.
  • the second moment is the starting moment within the second preset time length
  • the second preset time length is the time length of the stored electric quantity record.
  • the corresponding electric quantity is subtracted from the current electric quantity to obtain the power loss of the battery corresponding to the current moment, wherein the second preset duration is longer than the first preset duration.
  • the method retains the electric quantity records within the second preset time period, so that the preserved electric quantity records are more representative, and at the same time, the premature records are deleted in time, which can reduce memory consumption.
  • the second preset duration is longer than the first preset duration to ensure that valid data can be obtained within the prescribed preset duration.
  • the electronic device determines the number of changes in the number of communication times of the battery corresponding to the current moment, including: the electronic device acquires the number of communication times corresponding to the second moment, and the current number of communication times, and the current number of communication times Subtract the number of times of communication corresponding to the second moment to obtain the number of changes in the number of times of communication.
  • the method keeps the records of the number of times of communication within the second preset time length, so that the records of the number of times of communication kept are more representative, and at the same time, the records with too early time are deleted in time, which can reduce memory consumption.
  • confirming that the electronic device enters the first mode includes: the electronic device is based on at least one of ambient light data, touch screen data, electronic device motion posture data, GPS data, and user sleep data , confirm to enter the first mode.
  • the first mode includes a sleep mode, a low battery state or an unused state.
  • the electronic device when the electronic device receives the user's operation data, it starts the network communication connection.
  • the user's operation data includes: at least one of operation data of clicking on the touch screen and operation data of position changes of the electronic device.
  • an electronic device comprising:
  • memory for storing instructions to be executed by one or more processors of the device
  • the processor is used to confirm that the electronic device enters the first mode, and the processor determines the power loss of the battery and the number of communications of the background process, wherein the power loss is a power value reduced relative to the power at the first moment, and the first moment is the electronic
  • the initial moment when the device enters the first mode the number of communications is used to indicate all the processes currently running in the background, and the sum of the number of communications with other devices counted since the electronic device is powered on; when the power loss reaches the preset power threshold, And when the number of times of communication reaches the preset number of times of communication, the processor controls the switch of the network interface to close the network communication.
  • the closing of the network interface is controlled by monitoring the power of the battery and the communication status of the background process, which can avoid the rapid power consumption of the electronic device and affect the user experience.
  • the processor is configured to: obtain the initial power of the battery at the first moment, and the current power of the battery at the current moment, and subtract the current power from the initial power to obtain the power loss of the battery corresponding to the current moment. electricity.
  • the power loss after entering the first mode can be determined by subtracting the current power from the initial power when entering the first mode, which is convenient for timely management and control of the electronic device.
  • the processor is further configured to: when it is determined that within the first preset time period, the power-down power of the electronic device reaches a preset power threshold, and the number of changes in the number of communication times reaches a preset change times, the processor controls the network interface switch to close the network communication.
  • the method controls the network connection interface (power management and control) when the power loss speed is too fast and the communication frequency is too frequent, so as to avoid too fast power consumption and affect user experience.
  • the processor acquires the power corresponding to the second moment and the current power of the battery at the current moment, where the second moment is the starting moment within the second preset duration
  • the second preset duration is the duration of the stored electric quantity record, and the electric quantity corresponding to the second moment is subtracted from the current electric quantity to obtain the power loss corresponding to the current moment, wherein the second predetermined period is longer than the first predetermined period.
  • the electronic device retains the power records within the second preset time period, so that the reserved power records are more representative, and at the same time, the premature records are deleted in time, which can reduce memory consumption.
  • the second preset duration is longer than the first preset duration to ensure that valid data can be obtained within the prescribed preset duration.
  • the processor is configured to obtain the communication times corresponding to the second moment and the current communication times, and subtract the communication times corresponding to the second time from the current communication times to obtain the change times of the communication times.
  • the electronic device keeps the records of the number of communication times within the second preset time period, so that the kept records of the number of times of communication are more representative, and at the same time, the records that are too early can be deleted in time to reduce memory consumption.
  • the processor determines to enter the first model.
  • the first mode includes a sleep mode, a low power state or an unused state.
  • the processor when the processor receives the user's operation data, it starts the network communication connection.
  • the user's operation data includes: at least one of operation data of clicking on the touch screen and operation data of position changes of the electronic device.
  • the present application also provides an electronic device, including:
  • a confirmation module configured to confirm that the electronic device enters the first mode
  • the processing module is used to determine the power loss of the battery and the number of communications of the background process, wherein the power loss is a power value reduced relative to the power at the first moment, and the first moment is when the electronic device enters the first mode The starting moment; the number of times of communication is used to indicate all processes currently running in the background, and the sum of the number of times of communication with other devices counted since the electronic device is powered on;
  • the network management module is used to close the network communication when the power loss reaches the preset power threshold and the communication times reach the preset communication times.
  • the network interface is controlled to be closed by monitoring the power of the battery and the communication status of the background process, which can avoid the rapid power consumption of the electronic device and affect the user. experience.
  • the processing module acquires the initial battery power corresponding to the first moment and the current battery power at the current moment, and subtracts the current power from the initial power to obtain the power-down corresponding to the current moment.
  • the power loss after entering the first mode can be determined by subtracting the current power from the initial power when entering the first mode. It is convenient for timely management and control of electronic equipment.
  • the processing module is further configured to: when it is determined that within the first preset time period, the power-down power of the electronic device reaches the preset power threshold, and the number of changes in the number of communication times reaches the preset change times, the processing module controls the network management module to close the network communication.
  • the electronic device controls the network connection interface (power management and control) when the power loss is too fast and the communication frequency is too frequent, so as to avoid too fast power consumption and affect user experience.
  • the processing module obtains the power corresponding to the second moment and the current power of the battery before the current time, the second moment is the starting time within the second preset time length, and the second preset Let the duration be the duration of the stored power record, and subtract the current power from the power corresponding to the second moment to obtain the power loss corresponding to the current moment, wherein the second preset duration is longer than the first preset duration.
  • the electronic device keeps the electric quantity record within the second preset time period, so that the preserved electric quantity record is more representative, and at the same time, the premature record is deleted in time, which can reduce memory consumption.
  • the second preset duration is longer than the first preset duration to ensure that valid data can be obtained within the prescribed preset duration.
  • the processing module is used to obtain the number of communications corresponding to the second moment and the current number of communications, and subtract the current number of communications from the number of communications corresponding to the second moment to obtain the number of changes in the number of communications .
  • the electronic device keeps the record of communication times within the second preset time length, making the retained record of communication times more representative, and at the same time, deletes records that are too early in time to reduce memory consumption.
  • the processing module determines to enter the first model.
  • the first mode includes a sleep mode, a low battery state or an unused state.
  • the processing module when the processing module receives the user's operation data, it starts the network communication connection.
  • the user's operation data includes: at least one of operation data of clicking on the touch screen and operation data of position changes of the electronic device.
  • the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is run by a processor, the processor executes the method in the embodiment of the first aspect above.
  • the present application discloses a computer program product containing instructions, which, when run on a computer, causes the computer to execute the method in the embodiment of the first aspect above.
  • the network communication of the electronic device is controlled according to the change value of the electric power and the number of times of background communication.
  • the method can avoid excessive power consumption of the electronic device by controlling the communication of the background process when the electronic device is in a non-use state, sleep state, or low power, thereby ensuring a long use time of the electronic device and further improving user experience.
  • the network communication connection is opened, so as to avoid affecting the normal use of the user and further improve user experience.
  • Fig. 1 is a scene diagram when the mobile phone is in an idle state according to an embodiment of the present application
  • Figure 2a is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 2b is a software architecture diagram of an electronic device according to an embodiment of the present application.
  • FIG. 3 is a flowchart of a system power consumption control method according to an embodiment of the present application.
  • Fig. 4 is the power variation figure of an embodiment of the present application.
  • FIG. 5 is another flowchart of a system power consumption control method according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a mobile phone interface operation according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the first mode includes a sleep mode, a low power state or an idle state of the electronic device.
  • the idle state means that the electronic device is in a non-use state.
  • the determination of this state may be performed by the electronic device in combination with sleep-related data of the user.
  • the electronic device acquires the sleep data of the user.
  • the sleep data of the user may include data such as heart rate or blood pressure. Based on these data, it is judged whether the user is in a sleep state. When it is judged that the user is in a sleep state, it is determined that the user is in an idle state.
  • the electronic device acquires data about its own state to make a judgment. For example, data such as location data and screen-off time of electronic devices.
  • the electronic device can also combine the sensor data measuring the movement data, the light sensor, the screen-off time, and the current system time to determine that the user may be in a sleep state, which means that the mobile phone is in an idle state.
  • the initial power refers to the power of the battery obtained by initializing the mobile phone when it enters the idle state.
  • Power loss the difference between the initial power minus the current power, or sort the power according to the acquisition time, the power corresponding to the starting time (second moment) within the preset time period (second preset time) minus the current difference in power.
  • the initial electric quantity indicates the electric quantity obtained at the first moment when the electronic device enters the first mode
  • the first moment is the initial moment when the electronic device enters the first mode.
  • the second moment is the starting moment within the second preset time length
  • the second preset time length is the time length of the stored power records.
  • the number of communications refers to the sum of all the processes currently running in the background, and the total number of communications with other devices from the start of the electronic device.
  • the number of changes in the number of communication times is the number of communication times increased relative to the number of communication times corresponding to the second moment within the second preset time length, that is, the number of times of communication corresponding to the second moment is subtracted from the current number of communication times to obtain the communication times
  • the number of changes in times may be the first moment when the electronic device enters the first mode, or may be a certain moment after the first moment.
  • FIG. 1 shows a scene diagram when the mobile phone is in an idle state.
  • the scene diagram includes a mobile phone 101 , a base station 102 and a user 103 .
  • the mobile phone 101 and the base station 102 are communicating, and the user is in a sleeping state.
  • the mobile phone 101 acquires a certain amount of sleep data related to the user, such as data such as heart rate, blood pressure, respiration rate, and eyeball rotation speed. These data can be obtained through wearable devices worn by the user, for example, by wearing a watch, and the watch transmits these data to the mobile phone 101.
  • the mobile phone determines that the user is in a sleep state based on these sleep-related data, that is, the mobile phone determines that it is in an idle state.
  • the mobile phone performs system initialization, records the system time when it enters the idle state, the initial power level of the battery corresponding to the system time, and the communication times of the process of the application program not closed in the background. And after that, continuously obtain the battery power and the number of times the application or process communicates with the base station 102, and calculate the power loss based on the continuously obtained battery power (current power) and the battery power when entering the idle state (initial power) (current power - initial power), or based on the current power minus the power obtained at the starting point within the preset time (second preset duration) to calculate the power loss (current power - the power obtained at the starting time within the preset time) .
  • the power loss exceeds 10% of the preset power threshold, it is further judged whether the communication times of the background process exceed the preset communication times of 50 times.
  • the mobile phone closes the network communication connection and disconnects the communication with the base station 102 . Therefore, when the user is in a sleep state (the first mode), the communication of the background process is prevented, and the problem of the power reduction of the electronic device caused by the communication of the background process is avoided, which affects the experience of the user.
  • the mobile phone 101 can also determine whether the mobile phone is idle through data such as whether the mobile phone measures whether it is moving, the intensity of received light, and the time when the screen is off. state.
  • the determination of the idle state of the mobile phone is illustrated here as an example, and is not intended as a limitation to the present application.
  • the application scenario of the technical solution of the present application is not limited to the scenario where the user is in a sleep state, and may also be a scenario where the power of the mobile phone is lower than a preset threshold, or the mobile phone enters a sleep mode, or other scenarios where the user is not in use. Not limited.
  • the mobile phone can also judge whether to close the network communication connection according to the power loss and the number of times of communication within the first preset time period, that is, determine whether to turn off the network communication according to the speed of power loss and the frequency of communication times connect. For example, within 20 minutes, the power loss exceeds 10%, and the number of communications of the background process reaches 50 times. Then the mobile phone 101 judges that the process is frequent communication, and the battery is rapidly consumed, and then closes the network communication connection. Avoid the problem that the background process causes the power of the electronic device to drop sharply due to frequent communication, which affects the user experience.
  • a mobile phone is taken as an example of an electronic device.
  • the electronic device in this application may be a tablet computer, a notebook computer, a super mobile personal computer, a personal digital assistant (personal digital assistant, PDA), a television, or a wearable electronic device , such as watches, bracelets, etc.
  • PDA personal digital assistant
  • the device type of the electronic device is not specifically limited in this application.
  • FIG. 2a is a schematic structural diagram of an electronic device 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 (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, button 190, motor 191, indicator 192, camera 193, display screen 194, And a subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 can generate an operation control signal according to the instruction opcode and the timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • the processor 110 judges that the electronic device enters the idle state, it initializes, records the initial power level of the battery when entering the idle state, and during the initialization process, the background does not close the communication of the application program or process. frequency.
  • the Android-based broadcast broadcast continuously obtains the current battery power and the current communication times of the process, and calculates based on the continuously obtained battery power (current power) and the battery power (initial power) when entering the dormant state Calculate the lost power (current power-initial power), or calculate the power lost based on the power obtained at the starting point within the preset time minus the current power (current power-the power obtained at the starting point within the preset time).
  • the power loss exceeds the preset power threshold for example, the power loss exceeds 10%
  • the processor 110 closes the network communication connection. Therefore, the method can prevent the communication of the background process when the electronic device 100 is in an idle state or the like, so as to avoid the problem that the power of the electronic device decreases due to the communication of the background process, which affects the user's experience.
  • 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 (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (derail clock line, SCL).
  • processor 110 may include multiple sets of I2C buses.
  • the processor 110 can be respectively coupled to the touch sensor 180K, the charger, the flashlight, the camera 193 and the like through different I2C bus interfaces.
  • the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface to realize the touch function of the electronic device 100 .
  • touch information input by the user is received through the touch sensor 180K, for example, the user sets the battery power management mode through the interface of the electronic device, which can be set by clicking the power management application on the interface.
  • the touch sensor sends the position coordinate information of the user’s click on the power management application to the processor 110, and the processor 110 determines that the touch operation is to open the click management application according to the position coordinate information, and executes the opening of the power management application, so that the user can Various functional requirements can be realized through touch operation.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • a UART interface is generally used to connect the processor 110 and the wireless communication module 160 .
  • the processor 110 is connected to the wireless communication module 160 through a UART interface to implement wireless network communication functions, such as Bluetooth communication, local area network communication, and the like.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 while the charging management module 140 is charging the battery 142 , it can also monitor the battery level 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 the input of the battery 142 and/or the charging management module 140, and supplies power for the processor 110, the internal memory 121, the display screen 194, and the wireless communication module 160, etc.
  • 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 adopt a periodic monitoring method, for example, monitor the power of the battery 142 every 30 seconds, so as to observe the change of the power, and The situation is sent to the processor 110, so that the processor 110 can judge whether it is necessary to control the electronic device according to the change of the electric power.
  • the processor 110 determines that the amount of power change (power loss) is greater than the set threshold, it further determines whether the number of communications of the background process exceeds the set number, and if the number of times exceeds the set number, the processor 110 can close the process , or disconnect the communication connection with the mobile communication module and the wireless communication module, so that the electronic device 100 is disconnected from the network. Avoid excessive power consumption when the electronic device is in the first mode of the machine, such as idle state, and reduce user experience.
  • the processor 110 may obtain battery power data and communication times data from the power management module 141 through the broadcast module, so that the processor 110 determines whether to control the power according to these data.
  • the wireless communication function of the electronic device 100 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 150 , the wireless communication module 160 , a modem processor, a baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation.
  • every time the mobile communication module 150 receives a signal it is recorded as a communication, and every time a signal is sent, it is recorded as a communication, and the number of times (communication times) of these received and sent signals is counted, and sent to the processor 110 , the processor 110 determines whether the electronic device is disconnected from the network based on the number of communications.
  • the communication times may be obtained by the broadcast module of the processor 110 .
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100.
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation. In one embodiment, each time the wireless communication module 160 receives an electromagnetic wave signal is counted as one communication, and each time the wireless communication module 160 sends an electromagnetic wave signal is counted as one communication, and the communication times recorded each time are sent to the processor 110 . The processor 110 determines whether the electronic device 100 disconnects the network communication connection based on the mobile communication times and the communication times of the wireless communication module 160 .
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the battery level can be displayed on the display screen.
  • the user can also select the battery power control mode through operations on the display screen 194 .
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • 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, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the storage data area of the memory 121 stores the stored data in the form of a record table, for example, a hash table, which can record the initial battery power and Information such as the communication times of the background process.
  • the processor 110 can calculate the power loss of the electronic device in an idle state according to the data information in the hash table, and determine whether to control the network communication of the electronic device based on the number of communications.
  • the power management module 141 records each monitored electric quantity and the time corresponding to each electric quantity in a hash table.
  • the processor 110 records each obtained communication count and a time stamp corresponding to the communication count in a hash table.
  • the processor 110 can obtain the power loss based on the power recorded in the hash table, and when it is judged that the power loss exceeds the set threshold (condition a) and the number of communications exceeds the set number of times (condition b), the above conditions are further judged according to the timestamp Whether a and condition b are established within the preset time period. If yes, the processor 110 disconnects the network for the electronic device. If not, continue to update the records in the hash table. When the number of records in the hash table exceeds the set number, the processor 110 sorts by time, and deletes the electric power record or the communication count record corresponding to the time stamp arranged earlier.
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device 100 .
  • the angular velocity of the electronic device 100 around three axes ie, x, y and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B sends the detected movement posture data to the processor 110, and the processor 110 judges the current movement state of the mobile phone according to the movement posture data.
  • the acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • the processor 110 can combine the motion posture data of the electronic device 100 detected by the gyro sensor 180B, and the acceleration sensor 180E can detect the magnitude and transformation of the acceleration of the electronic device 100 in different directions to accurately determine the electronic device 100. Device 100 is at rest or in motion.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 100 emits infrared light through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the reflected light detected by the proximity light sensor 180G to make the processor determine that the electronic device 100 is placed in a backpack or pocket, thereby determining that the electronic device 100 is currently in an idle state.
  • the processor 110 determines that the electronic device 100 is in the idle state, it obtains the system time when the electronic device 100 enters the idle state, the initial power level of the battery, and the number of communications of the background process, etc., so that the processor 110 can obtain information continuously based on these data.
  • the data determines whether to control the network connection of the electronic device.
  • the ambient light sensor 180L is used for sensing ambient light brightness.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a backpack or a pocket, or whether the current time is nighttime.
  • the ambient light sensor detects data such as the intensity and brightness of the current light
  • the processor 110 can accurately determine that it is nighttime according to the data such as the intensity and brightness of the light and combined with the current system time.
  • the processor 110 may combine the movement data detected by the gyro sensor 180B and the acceleration sensor 180E, the light brightness and intensity data detected by the ambient light sensor 180L, and the system time to determine whether the current electronic device is idle. state. That is, the mobile data remains unchanged during the set time, the brightness and intensity of the light belong to the brightness and intensity of the night light, the screen of the mobile phone is black during the set time, and the system time belongs to the set night time. Then it can be determined that the mobile phone is in an idle state, and the idle state at this time may indicate that the user is in a sleep state, and the mobile phone is in a non-use state by the user.
  • the processor 110 can perform regular analysis and judgment on changes in power and communication times to manage and control the power when preset conditions are met, reducing excessive power consumption when the mobile phone is in an idle state.
  • the touch sensor 180K is also called “touch device”.
  • the touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194 .
  • the touch sensor 180k can detect the touch operation of the user clicking on the power management application program on the display screen 194, and send the clicked touch event to the processor 110, and the processor 110 will open the power management application program through the display screen 194
  • the interface of the program, or the power setting interface in the setting program is displayed to the user, and the user can, according to the prompt on the display screen 194, set the power information, such as the threshold value of the power loss, the set number of communication times, and the preset duration, etc. Options for each parameter are set.
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the software structure of the electronic device 100 is exemplarily described by taking an Android system with a layered architecture as an example.
  • Fig. 2b is an architectural diagram including a software structure and a hardware structure.
  • the Android system is divided into four layers, from top to bottom are the application layer, application framework layer, Android runtime (Android runtime) and system library, and the kernel layer.
  • the application layer can consist of a series of application packages.
  • the application package may include camera, gallery, calendar, map, WLAN, Bluetooth, short message, power management application, broadcast receiver and so on.
  • the power management application is used to provide a channel for the user to input preset parameters. Users can set various parameters related to power management through the power management application, such as the set threshold of power loss, the preset number of communication times of background processes, and the time parameters reflecting power consumption and communication frequency, etc.
  • Broadcast receivers are used to respond to broadcast messages from other applications or the system. For example, when the application monitors the battery level, the communication times of the background process, etc. by registering the broadcast receiver in the Android Manifest.xml.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include a window manager, a content provider, a phone manager, a resource manager, a data analysis module, an execution module, and the like.
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make it accessible to applications.
  • Said data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
  • the phone manager is used to provide communication functions of the electronic device 100 . For example, the management of call status (including connected, hung up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the data analysis module is used to analyze whether the power consumption of the electronic device is currently controlled according to various parameter information of power consumption.
  • the execution module is used to control the hardware at the hardware layer to perform corresponding actions according to the instructions of the data analysis module, for example, to turn off the communication switch, so as to control the power consumption of the electronic equipment caused by communication.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer can include sensor drivers, fuel gauge drivers, radio frequency transceiver drivers, and communication switch drivers. These drivers serve as communication bridges between software modules and hardware to realize communication between software and hardware.
  • the fuel gauge driver is used to drive the fuel gauge to monitor the power of the battery, and send the monitoring result to the system, and the system broadcasts the result so that the broadcast receiver can obtain the corresponding battery power.
  • the radio frequency transceiver driver is used for the radio frequency transceiver to count the communication times, and send the statistical result to the system, and the system broadcasts the result, so that the broadcast receiver can obtain the communication times of the corresponding process.
  • the hardware layer includes hardware that executes various instructions, as shown in Figure 2b, which may include data storage areas, fuel gauges, batteries, radio frequency transceivers, communication switches, and light sensors, etc.
  • the light sensor is used to obtain data related to external light.
  • the light sensor may include an ambient light sensor and a proximity light sensor as shown in FIG. 1 .
  • the ambient light sensor can obtain ambient light brightness, light intensity, etc.
  • the proximity light sensor can obtain data of infrared reflected light reflected by surrounding objects.
  • the light sensor acquires data related to external light, and sends the data to the data analysis module through the sensor driver.
  • the data analysis module analyzes and judges these data to determine whether the current electronic device is at night or in the backpack (usually understood as non-user use time period, the electronic device is in an idle state).
  • the data analysis module determines that the electronic device is in an idle state
  • the data analysis module sends an instruction to the execution module to monitor the power consumption of the electronic device, and the execution module drives the fuel gauge to monitor the power of the battery based on the instruction.
  • the execution module is driven by the radio frequency transmitter to make the radio frequency transmitter record the communication times.
  • the framework layer traverses all the broadcast receivers registered for this broadcast, and the system broadcasts the change information of the battery level to the registered broadcast receivers to receive the battery level.
  • other data of this application can also be obtained through broadcast receivers, such as location data, screen-off time, system time, etc. These data are collected by respective sensors at the hardware layer, and the sensors convert analog signals into digital signals through The corresponding driver writes to the device node, and sends the data to the registered broadcast receiver through Android broadcast. To realize the process from the underlying data to the application layer.
  • the broadcast receiver sends the current power received and the current number of communications to the data analysis module.
  • the data analysis module calculates the power loss based on the received current power and the initial power stored in the data storage area, or the power corresponding to the starting point within the preset time, and compares the power loss with the preset threshold (which can be obtained from the power management application obtained or the system default) for comparison. When the power loss is greater than or equal to the preset threshold, such as 10%, it is further judged whether the current communication times are greater than or equal to the preset times (can be obtained from the power management application or the system default value). If so, the data analysis module sends a control instruction to the execution module.
  • the preset threshold which can be obtained from the power management application obtained or the system default
  • the execution module executes the instruction, and drives the communication switch to be closed through the communication switch, that is, the electronic device is disconnected from the network, so that the radio frequency transceiver stops receiving and sending signals. Therefore, when the mobile phone is in an idle state (that is, when the user does not use the electronic device), the power consumption of the battery is reduced, and the user experience is improved.
  • the system power consumption control method of the present application can be applied to the electronic devices described in FIG. 2a and FIG. 2b above.
  • a mobile phone is used as the electronic device for illustration.
  • FIG. 3 exemplarily shows a flowchart of a method for controlling power consumption of a system. As shown in FIG. 3, the flowchart includes S300-S308.
  • the mobile phone determines that it is in an idle state.
  • the idle state may be judged in one or more of the following ways.
  • the mobile phone can determine whether it is currently at night through its own ambient light sensor and proximity light sensor to detect parameters such as ambient light brightness, light intensity, and infrared reflected light. This step is performed as the ambient light sensor, the proximity light sensor and the processor in FIG. 1 above. If it is at night, further judge whether the time of the black screen of the mobile phone exceeds the set time, for example, exceeds 1 minute, if so, then determine that the mobile phone is in an idle state.
  • the mobile phone can judge whether it is currently night time through the system time. For example, when the system time reaches 10:00 PM, it is night time. In addition, the mobile phone can judge whether it is currently at night through the mode set by the user. For example, a mobile phone has a night mode and a day mode, and when the user sets the mobile phone to the night mode, the mobile phone determines that it is currently at night. Further judge whether the time of the black screen of the mobile phone exceeds the set time, for example, exceeds 1 minute, and if so, then determine that the mobile phone is in an idle state.
  • the third is that the mobile phone can make judgments based on user data.
  • the watch worn by the user monitors data such as the user's heart rate or blood pressure, and based on these user data, it is judged that the user is in a sleep state. Then it can be judged that the current mobile phone is in an idle state. Whether the user is sleeping or not can be determined at any time through the user data. And predict that the phone is idle.
  • the mobile phone may combine multiple data of the above three types to determine whether it is in an idle state, so as to improve the accuracy of the determination.
  • the description here is only an example, and other data may also be used to determine whether the mobile phone is in an idle state.
  • data such as whether the mobile phone is charging may be used to determine, which is not limited herein.
  • the idle state is used as the first mode of the mobile phone.
  • the first mode can also be that the power level is low, or the mobile phone enters the sleep mode, etc., which is not limited here.
  • the mobile phone acquires the system time and initial power when entering the idle state.
  • the mobile phone executes system initialization, obtains the system time and initial power, and stores them in the internal memory as original records.
  • the mobile phone continuously monitors the battery power and the communication times of the background process during the idle state, and stores each monitored battery power and communication times. For example, information such as battery power, system time, and communication times can be broadcast through the system broadcast, and the broadcast receiver can monitor and obtain the battery power, system time, communication times, etc. In order to enable other programs of the mobile phone to further analyze and process these data.
  • the number of communications refers to the sum of communications between all background processes and the outside world.
  • These data are stored in the form of a hash table, so that the mobile phone can quickly obtain the data specified in the table.
  • the data in the hash table exceeds the set value, the previous power records are deleted according to the order of the record time.
  • the mobile phone may also assign an identifier to each process in the background, and determine the communication times of each process according to the identifier.
  • the communication process of each process is recorded separately, so as to control the traffic of a single process.
  • the mobile phone calculates the power loss.
  • the mobile phone subtracts the current power from the initial power to obtain the lost power.
  • the current power can be subtracted from the power at the initial moment in the recording table, so that the power with low reference value can be removed in time and the memory can be released.
  • Q1 is 99% of the initial power
  • the power Q2 obtained at time t1 is 95%
  • the power loss at time t1 Q1-Q2, that is, from t0 to The t1 interval is 15 minutes
  • Q3 is 89% of the electricity obtained at time t2.
  • the time intervals corresponding to every two powers are not necessarily the same.
  • the time interval from t0 to t1 is 15 minutes, and the time interval from t1 to t2 is 20 minutes. If the method of periodically monitoring the electric quantity is adopted, the time interval may be set to a fixed value, for example, 15 minutes.
  • the mobile phone judges whether the power loss reaches a set threshold. For example, as shown in FIG. 4 , if the threshold is set to 10% and the current power level is 95%, the power loss will be 4%, which does not reach 10%. Then the mobile phone returns to execute S302.
  • the mobile phone executes S305 to read the communication times of the background process.
  • the number of communications is the sum of the number of communications of all processes in the background of the mobile phone.
  • the mobile phone determines whether the number of times of communication reaches a preset number of times of communication.
  • the number of communications refers to the sum of the number of communications with other devices, counted from the starting moment when the phone is powered on, by all processes running in the background of the mobile phone at the current moment.
  • the preset number of times is 50 times.
  • the number of communications in the current background process is 40, which has not reached the set number. Then the mobile phone continues to execute S305.
  • the number of times of communication may be the total number of times of communication performed by the background process.
  • the mobile phone executes S307, and the mobile phone controls power consumption. For example, by controlling the network communication switch, the mobile phone is disconnected from the network communication connection.
  • the background process of the mobile phone communicates more times, which causes power consumption and affects user experience.
  • the communication times of each process running in the background can also be limited. For example, calculate the number of times of communication for each process in the background, for example, the process calls the upper layer interface, and reads the data in the device node, and obtains the respective data such as power consumption and communication times.
  • the mobile phone can independently manage the process, for example, close the specified process.
  • the speed of power loss and the frequency of communication may also be limited.
  • the power failure and the number of communications within the preset time are used as the judgment conditions, which can avoid the situation of rapid power consumption in a short period of time.
  • FIG. 5 exemplarily shows another flow chart of the system power consumption control method.
  • the method can be executed by the mobile phone having the structure shown in Fig. 1 and Fig. 2 above.
  • the flowchart includes S500-S508.
  • S500-S501 are the same as S300-S301 in the above-mentioned FIG. 3
  • S503-S504 are the same as S303-S304 in the above-mentioned FIG.
  • the mobile phone continuously monitors the battery power and the corresponding time stamp when the mobile phone is in an idle state, monitors the communication times of the background process and the corresponding time stamp, and stores them.
  • the mobile phone periodically detects the battery power, it also records the time stamp corresponding to each power record. And when recording the number of times of communication each time, the corresponding time stamp of each number of times of communication is recorded at the same time.
  • the current communication times of the background process is read, and the difference between the communication times corresponding to the starting time within the preset time period (the second preset time period) and the current communication times (change quantity of the communication times) is obtained. For example, if the record of 20 communication times of the process corresponding to the starting point within the second preset duration, for example, within 20 minutes is obtained, and the communication times obtained at the current moment are 80 times, then the number of changes in the communication times is 60 times .
  • the second preset time length it is possible to avoid the reduction of the reference significance of the previously obtained records due to too long time. Therefore, by setting the preset time length, the earlier records in the records are regularly deleted to improve the electronic equipment. Reliability of judging power consumption.
  • the mobile phone determines whether the number of changes in the number of communications reaches a preset number of changes. For example, the preset number of changes is 50, and when the number of changes in the number of communication times is 60, then it is greater than 50, and then the process is executed in S507. Otherwise, the mobile phone executes S505.
  • the preset number of changes is 50, and when the number of changes in the number of communication times is 60, then it is greater than 50, and then the process is executed in S507. Otherwise, the mobile phone executes S505.
  • the mobile phone determines whether the power loss reaches the preset power threshold within a preset time period (the first preset time period), and the number of changes in the number of communication times reaches the set number of changes.
  • the first preset duration is 10 minutes, that is, within 10 minutes, if the power loss reaches the set threshold of 10%, and the number of communications reaches the set number of 50 times, the mobile phone executes S508 to control the power consumption of the mobile phone.
  • This method can effectively avoid excessive power consumption due to the fast power consumption of mobile phones in a short period of time by judging that the power loss reaches the preset threshold and the number of times of communication changes reaches the preset number of times within a preset time period. quick.
  • the first preset duration set should be shorter than the second preset duration of the power record and communication times record, so that in S507, there is a sufficient duration Power record and communication record to ensure the accuracy of judgment.
  • the mobile phone when the mobile phone is in a non-use state, sleep state or low battery, the mobile phone can avoid the rapid consumption of the power of the electronic device by controlling the communication of the background process, ensuring that the electronic The usage time of the device is improved to further improve the user experience.
  • the mobile phone when the mobile phone detects the user's operation, for example, when the screen is brightened after clicking, moving and other operations, it is judged that it is currently in the state of being used by the user, and then the network is restored so that the user can use the network normally. Improve user experience.
  • the parameters such as the preset threshold, the preset number of times, and the setting duration mentioned above in FIG. 3 and FIG. 5 may be system default values, or may be set by the user according to needs.
  • FIG. 6 exemplarily shows a schematic diagram of an interface operation of a mobile phone.
  • a battery management icon 611 is displayed on the interface 610 .
  • the user can set parameters such as the preset threshold of power loss and the preset number of communication times.
  • the user setting interface can be entered.
  • the interface 620 is a user setting interface, and the interface 620 includes options for parameter setting, and the user sets each parameter through these saving ideas, for example, "set management time” , “Set the preset threshold of power”, “Set the preset number of communication times” and “Set the preset duration”.
  • the user clicks to set the preset threshold value of the electric quantity, as shown in (c) in FIG. parameter value.
  • the user can also manage the time period that needs to be managed through the settings on the interface 620 , for example, from 10:00 pm to 5:00 am the next day.
  • the user can also set the first preset duration by setting the preset duration option.
  • This application adopts the user-defined setting method to improve the flexibility of the user's use, and different users can select appropriate parameters according to different needs, which is conducive to improving user experience.
  • the embodiment of the present application also provides an electronic device, which can be used to implement the functions performed by the electronic device in the power consumption control method in the foregoing embodiments.
  • the functions of the electronic device may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • Hardware or software includes one or more modules or units corresponding to the functions described above.
  • FIG. 7 shows a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device may include: a confirmation module 710, a processing module 720, a network management module 730, and the like.
  • the confirming module 710 is configured to confirm that the electronic device enters the first mode
  • the processing module 720 is configured to determine the power loss of the battery and the number of communications of the background process, wherein the power loss is a power value reduced relative to the power at the first moment, and the first moment is the initial moment when the electronic device enters the first mode ;
  • the number of times of communication is used to indicate all processes currently running in the background, and the sum of the number of times of communication with other devices counted since the electronic device is powered on;
  • the network management module 730 is configured to close the network communication connection when the power loss reaches the preset power threshold and the communication times reach the preset communication times.
  • the present application also provides an electronic device, including:
  • memory 810 for storing instructions to be executed by one or more processors of the device
  • the processor 820 is configured to execute the methods shown in the above embodiments with reference to FIG. 3 and FIG. 5 .
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the computer program When the computer program is run on the electronic device, the electronic device realizes the power consumption as shown in FIG. 3 and FIG. 5 in the above embodiment. Control Method.
  • the embodiments of the present application may be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (for example, computer-readable) storage media, which may be implemented by one or more The processor reads and executes.
  • instructions may be distributed over a network or via other computer-readable media.
  • a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including, but not limited to, floppy disks, compact discs, compact discs, Compact Disc Read Only Memory , CD-ROMs), magneto-optical disk, read-only memory (Read Only Memory, ROM), random access memory (RAM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM), electrically erasable Programmable read-only memory (Electrically Erasable Programmable Read Only Memory, EEPROM), magnetic card or optical card, flash memory, or used to transmit information in the form of electricity, light, sound or other forms of transmission using the Internet (for example, carrier waves, infrared signals Tangible machine-readable storage of digital signals, etc.).
  • a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
  • the present application also provides a computer program product containing instructions, and when the computer program product is run on the electronic device, the electronic device is made to execute the power consumption control method shown in FIG. 3 and FIG. 5 in the above embodiment.

Abstract

本申请提供一种系统功耗控制方法及电子设备,属于电子设备技术领域,该方法包括确认电子设备进入第一模式,电子设备确定电池的掉电量和后台进程的通信次数,其中,掉电量是相对于第一时刻的电量所降低的电量值,第一时刻为电子设备进入第一模式的起始时刻;通信次数用于指示当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和;当掉电量达到预设电量阈值,且通信次数达到预设通信次数,电子设备关闭网络通信连接。根据本申请实施例的方法,通过对电池的电量变化和后台进程通信次数的监测,可以在电子设备进入第一模式后,避免因后台进程频繁通信,导致电子设备的电量急剧下降而影响用户的体验。

Description

系统功耗控制方法及电子设备
本申请要求于2021年08月11日提交中国专利局、申请号为202110918392.X、申请名称为“系统功耗控制方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子技术领域,尤其涉及系统功耗控制方法及电子设备。
背景技术
随着通信技术的不断发展,电子设备,例如,手机、平板电脑和等智能电子设备的功能越来越强大。
目前,电子设备通常应用了多任务处理技术,电子设备同时运行多个不同的应用程序或进程。但是通常在夜间或者用户不使用电子设备时,通常不会将这些开启多个应用程序关闭,导致应用程序的进程在后台运行,当后台的进程频繁通信时,会对电子设备的内部资源占用,导致电量急剧消耗,降低了电子设备的使用时长,影响用户体验。
发明内容
有鉴于此,本申请提供一种系统功耗控制方法及电子设备,能够在夜间等环境中,控制后台进程的通信,避免电子设备的电量被急剧消耗,确保电子设备的使用时长,提高用户体验。
本申请的一些实施方式提供了一种系统功耗控制方法。以下从多个方面介绍本申请,以下多个方面的实施方式和有益效果可互相参考。
第一方面,本申请提供一种系统功耗控制方法,应用于电子设备,方法包括:确认电子设备进入第一模式,例如,电子设备的睡眠模式、低电量状态或未使用状态等;电子设备确定电池的掉电量和后台进程的通信次数,其中,掉电量是相对于第一时刻的电量所降低的电量值,所述第一时刻为所述电子设备进入第一模式的起始时刻;所述通信次数用于指示当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和;当掉电量达到预设电量阈值,且通信次数达到预设通信次数,电子设备关闭网络通信。
根据本申请实施例的方法,在电子设备进入第一模式时,通过对电池的电量和后台进程的通信情况的监测,来控制网络通信连接,可以避免电子设备的电量消耗较快,影响用户体验。
在上述第一方面的一种可能的实现中,电子设备确定电池的掉电量,包括:电子设备获取第一时刻对应的电池的初始电量,以及当前时刻电池的当前电量,将初始电量减去当前电量得到当前时刻对应的电池的掉电量。通过进入第一模式时的初始电量减去当前电量可以确定出从进入第一模式后掉电量的情况,便于电子设备对通信情况及时管控。
在上述第一方面的一种可能的实现中,上述方法还包括:当电子设备确定在第一预设时长内,掉电量达到预设电量阈值,且通信次数的变化次数达到预设变化次数,电子设备对关闭网络通信连接。该方法通过在掉电量的速度过快和通信频率过于频繁时,对网络连接接口(电量管控)进行控制,避免电量消耗过快,而影响用户体验。
在上述第一方面的一种可能的实现中,电子设备确定电池的掉电量,包括:
电子设备获取第二时刻对应的电量,以及当前时刻电池的当前电量,第二时刻为在第二预设时长内的起点时刻,第二预设时长为存储的电量记录的时长,将第二时刻对应的电量减去当前电量得到当前时刻对应的电池的掉电量,其中,第二预设时长大于第一预设时长。该方法保留了第二预设时长内的电量记录,使得保留的电量记录更具有代表性,同时,将时间过早的记录及时的删除,可以减少内存的消耗。此外,第二预设时长大于第一预设时长可以确保在规定的预设时长内可以获得有效的数据。
在上述第一方面的一种可能的实现中,电子设备确定当前时刻对应的电池的通信次数的变化次数,包括:电子设备获取第二时刻对应的通信次数,以及当前通信次数,将当前通信次数减去第二时刻对应的通信次数得到通信次数的变化次数。该方法保留了第二预设时长内的通信次数记录,使得保留的通信次数记录更具有代表性,同时,将时间过早的记录及时的删除,可以减少内存的消耗。
在上述第一方面的一种可能的实现中,确认电子设备进入第一模式,包括:电子设备基于环境光数据、触摸屏数据、电子设备运动姿态数据、GPS数据和用户的睡眠数据中的至少一个,确定进入第一模式。
在上述第一方面的一种可能的实现中,第一模式包括睡眠模式、低电量状态或未使用状态。
在上述第一方面的一种可能的实现中,当电子设备接收到用户的操作数据,则开启网络通信连接。
在上述第一方面的一种可能的实现中,用户的操作数据包括:点击触摸屏的操作数据和电子设备发生的位置变化的操作数据中的至少一种。
第二方面,本申请公开了一种电子设备,包括:
存储器,用于存储由设备的一个或多个处理器执行的指令,以及
处理器,用于确认电子设备进入第一模式,处理器确定电池的掉电量和后台进程的通信次数,其中,掉电量是相对于第一时刻的电量所降低的电量值,第一时刻为电子设备进入第一模式的起始时刻;所述通信次数用于指示当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和;当掉电量达到预设电量阈值,且通信次数达到预设通信次数,处理器控制网络接口开关关闭网络通信。
根据本申请实施例的电子设备,在电子设备进入第一模式时,通过对电池的电量和后台进程的通信情况的监测,来控制网络接口关闭,可以避免电子设备的电量消耗较快,影响用户体验。
在上述第二方面的一种可能的实现中,处理器用于:获取第一时刻的电池的初始电量,以及当前时刻电池的当前电量,将初始电量减去当前电量得到当前时刻对应的电池的掉电量。通过进入第一模式时的初始电量减去当前电量可以确定出从进入第一模式后掉电量的情况,便于电子设备及时管控。
在上述第二方面的一种可能的实现中,处理器还用于:当确定在第一预设时长内,电子设备的掉电量达到预设电量阈值,且通信次数的变化次数达到预设变化次数,处理器控制网络接口开关关闭网络通信。该方法通过在掉电量的速度过快和通信频率过于频繁时,对网络连接接口(电量管控)进行控制,避免电量消耗过快,而影响用户体验。
在上述第二方面的一种可能的实现中,处理器获取第二时刻对应的电量,以及当前时刻电池的当前电量,其中,所述第二时刻为在第二预设时长内的起点时刻,所述第二预设时长为存储的电量记录的时长,将第二时刻对应的电量减去当前电量得到当前时刻对应的掉电量,其中,第二预设时长大于第一预设时长。该电子设备保留了第二预设时长内的电量记录,使得保留的电量记录更具有代表性,同时,将时间过早的记录及时的删除,可以减少内存的消耗。此外,第二预设时长大于第一预设时长可以确保在规定的预设时长内可以获得有效的数据。
在上述第二方面的一种可能的实现中,处理器用于获取第二时刻对应的通信次数,以及当前通信次数,将当前通信次数减去第二时刻对应的通信次数得到通信次数的变化次数。该电子设备保留了第二预设时长内的通信次数记录,使得保留的通信次数记录更具有代表性,同时,将时间过早的记录及时的删除,可以减少内存的消耗。
在上述第二方面的一种可能的实现中,处理器基于传感器采集的环境光数据、触摸屏数据、运动姿态数据、用户的睡眠数据以及通信单元获取的GPS数据中的至少一个,确定进入第一模式。
在上述第二方面的一种可能的实现中,第一模式包括睡眠模式、低电量状态或未使用状态。
在上述第二方面的一种可能的实现中,当处理器接收到用户的操作数据,则开启网络通信连接。
在上述第二方面的一种可能的实现中,用户的操作数据包括:点击触摸屏的操作数据和电子设备发生的位置变化的操作数据中的至少一种。
第三方面,本申请还提供一种电子装置,包括:
确认模块,用于确认电子设备进入第一模式,
处理模块,用于确定电池的掉电量和后台进程的通信次数,其中,掉电量是相对于第一时刻的电量所降低的电量值,所述第一时刻为所述电子设备进入第一模式的起始时刻;所述通信次数用于指示当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和;
网络管理模块,用于当掉电量达到预设电量阈值,且通信次数达到预设通信次数时,关闭网络通信。
根据本申请实施例的电子装置,在电子设备进入第一模式时,通过对电池的电量和后台进程的通信情况的监测,来控制网络接口关闭,可以避免电子设备的电量消耗较快,影响用户体验。
在上述第三方面的一种可能的实现中,处理模块获取第一时刻对应的电池的初始电量,以及当前时刻电池的当前电量,将初始电量减去当前电量得到当前时刻对应的掉电量。通过进入第一模式时的初始电量减去当前电量可以确定出从进入第一模式后掉电量的情况。便于电子设备及时管控。
在上述第三方面的一种可能的实现中,处理模块还用于:当确定在第一预设时长内,电子设备的掉电量达到预设电量阈值,且通信次数的变化次数达到预设变化次数,处理模块控制网络管理模块关闭网络通信。该电子装置通过在掉电量的速度过快和通信频率过于频繁时,对网络连接接口(电量管控)进行控制,避免电量消耗过快,而影响用户体验。
在上述第三方面的一种可能的实现中,处理模块获取第二时刻对应的电量,以及当前时前电池的当前电量,第二时刻为在第二预设时长内的起点时刻,第二预设时长为存储的电量记录的时长,将第二时刻对应的电量减去当前电量得到当前时刻对应的掉电量,其中,第二预设时长大于第一预设时长。该电子装置保留了第二预设时长内的电量记录,使得保留的电量记录更具有代表性,同时,将时间过早的记录及时的删除,可以减少内存的消耗。此外,第二预设时长大于第一预设时长可以确保在规定的预设时长内可以获得有效的数据。
在上述第三方面的一种可能的实现中,处理模块用于获取第二时刻对应的通信次数,以及当前通信次数,将当前通信次数减去第二时刻对应的通信次数得到通信次数的变化次数。该电子装置保留了第二预设时长内的通信次数记录,使得保留的通信次数记录更具有代表性,同时,将时间过早的记录及时的删除,可以减少内存的消耗。
在上述第三方面的一种可能的实现中,处理模块基于传感器采集的环境光数据、触摸屏数据、运动姿态数据、用户的睡眠数据以及通信单元获取的GPS数据中的至少一个,确定进入第一模式。
在上述第三方面的一种可能的实现中,第一模式包括睡眠模式、低电量状态或未使用状态。
在上述第三方面的一种可能的实现中,当处理模块接收到用户的操作数据,则开启网络通信连接。
在上述第三方面的一种可能的实现中,用户的操作数据包括:点击触摸屏的操作数据和电子装置发生的位置变化的操作数据中的至少一种。
第四方面,本申请提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器运行时,使得处理器执行上述第一方面实施例的方法。
第五方面,本申请的公开了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面实施例的方法。
根据本申请实施例的系统功耗控制方法,通过在电子设备进入第一模式时,根据电量变化值和后台进行通信次数的情况,对电子设备的网络通信进行管控。该方法能够在电子装置处于非使用的状态下、睡眠状态或低电量等情况下,通过控制后台进程的通信,避免电子设备的电量消耗过快,确保电子设备的使用时长,进一步提高用户体验。此外,在电子设备检测到用户使用的数据时,开启网络通信连接,避免影响用户的正常使用,进一步提高用户体验。
附图说明
图1为本申请一个实施例手机处于空闲状态时的场景图;
图2a为本申请一个实施例的电子设备的结构示意图;
图2b为本申请一个实施例的电子设备的软件架构图;
图3为本申请一个实施例的系统功耗控制方法的流程图;
图4为本申请一个实施例的电量变化图;
图5为本申请一个实施例的系统功耗控制方法的另一流程图;
图6为本申请一个实施例的手机界面操作示意图;
图7为本申请一个实施例的电子装置的结构示意图;
图8为本申请一个实施例的电子设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
为了便于理解,下面对本申请中出现的名词进行说明。
第一模式,包括所述电子设备的睡眠模式、低电量状态或空闲状态。
空闲状态,是指电子设备处于非使用状态。对于该状态的判断可以是电子设备结合用户的睡眠相关数据进行判断。例如,电子设备获取用户的睡眠数据,用户的睡眠数据可以包括心跳频率或血压等数据,根据这些数据判断用户是否处于睡眠状态,当判断用户处于睡眠状态时,则确定自身处于空闲状态。或者,电子设备获取关于自身状态的数据进行判断。例如,电子设备的位置数据、灭屏时间等数据。若位置数据在预设时间内保持不变,且灭屏时间达到预设时长,则判断电子设备处于非使用状态。此外,在一些实施例中,电子设备还可以将测量移动数据的传感器数据、光传感器、灭屏时间、以及当前系统时间等结合来判断用户可能处于睡眠状态,即表明手机为空闲状态。
初始电量,是指手机进入空闲状态时进行初始化,获得的电池的电量。
掉电量,初始电量减去当前电量的差值,或者,将电量按照获取时间先后进行排序,预设时间段(第二预设时长)内的起点时刻(第二时刻)对应的电量减去当前电量的差值。其中,初始电量表示电子设备进入第一模式时的第一时刻获取的电量,第一时刻为电子设备进入第一模式的起始时刻。第二时刻为在第二预设时长内的起点时刻,第二预设时长为存储的电量记录的时长。
通信次数,是指当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和。
通信次数的变化次数,是相对于在第二预设时长内的第二时刻对应的通信次数所增加的通信次数,即,当前通信次数减去所述第二时刻对应的通信次数得到所述通信次数的变化次数。其中,第二预设时长的第二时刻(起点时刻)可以是电子设备进入第一模式时的第一时刻,也可以是在第一时刻之后的某一时刻。
下面结合具体场景对本申请的技术方案进行描述。
参考图1,图1示出了手机处于空闲状态时的场景图。该场景图中包括手机101,基站102和用户103。其中,手机101和基站102正在通信,而用户在睡眠状态中。手机101获取到一定量的用户有关的睡眠数据,例如,心跳频率、血压、呼吸频率、眼球转动快慢等数据。这些数据可以是通过用户佩戴的穿戴设备,例如,通过佩戴手表获得,手表将这些数据传输给手机101.手机基于这些睡眠相关的数据判断用户处于睡眠状态,即手机判断自身处于空闲状态。此时手机进行系统初始化,记录进入空闲状态时的系统时刻,该系统时刻对应的电池的初始电量,以及后台未关闭应用程序的进程的通信次数。并在此之后不断地获得电池的电量以及应用或进程与基站102的通信次数,并基于持续获得的电池的电 量(当前电量)和进入空闲状态时的电池的电量(初始电量)计算出掉电量(当前电量-初始电量),或者基于当前电量减去预设时间(第二预设时长)内的起点时刻获得的电量计算出掉电量(当前电量-预设时间内的起点时刻获得的电量)。当掉电量超过预设电量阈值10%,则进一步判断后台进程的通信次数是否超过预设通信次数50次。当后台进程的通信次数超过50次,则手机关闭网络通信连接,断开与基站102通信。从而在用户处于睡眠状态中(第一模式),阻止后台进程通信,避免后台进程因通信而导致电子设备的电量下降的问题,影响用户的体验。
在本申请的一些实施例中,当用户的睡眠数据不足以判断用户处于睡眠中时,手机101还可以通过手机测量自身是否移动的数据、接收光线的强度、灭屏时间等数据判断手机为空闲状态。此处为示例性说明手机空闲状态的判断,并不作为对本申请的限定。
需要说明的是,本申请的技术方案应用的场景不局限于用户处于睡眠状态,还可以是手机的电量低于预设阈值,或者手机进入睡眠模式,或其他用户非使用状态等场景,此处并不作限定。
在本申请的一些实施例中,手机还可以根据第一预设时长内的掉电量和通信次数来判断是否关闭网络通信连接,即通过掉电的速度和通信次数的频率来确定是否关闭网络通信连接。例如,在20分钟之内,掉电量超过10%,且后台进程的通信次数达到50次。则手机101判断进程为频繁通信,电量急剧消耗,则关闭网络通信连接。避免后台进程因频繁通信而导致电子设备的电量急剧下降的问题,影响用户的体验。
上述描述中以手机为电子设备举例进行说明,本申请中的电子设备可以是平板电脑、笔记本电脑、超级移动个人计算机、个人数字助理(personal digital assistant,PDA)、电视,或者可穿戴的电子设备,如手表、手环等。本申请中对电子设备的设备类型不予具体限定。
下面结合附图对本申请的技术方案进行详细的描述。
示例性的,图2a为本申请实施例提供的一种电子设备的结构示意图。该电子设备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中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110 中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在本申请的一个实施例中,处理器110在判断电子设备进入空闲状态时,进行初始化,记录进入空闲状态时的电池的初始电量,以及在初始化过程中,后台未关闭应用程序或进程的通信次数。并在此之后,基于安卓的广播播报不断地获得电池的当前电量以及进程的当前通信次数,并基于持续获得的电池的电量(当前电量)和进入休眠状态时的电池的电量(初始电量)计算出掉电量(当前电量-初始电量),或者基于预设时间内的起点时刻获得的电量减去当前电量计算出掉电量(当前电量-预设时间内的起点时刻获得的电量)。当掉电量超过预设电量阈值,例如,掉电量超过10%,则进一步判断后台进程的通信次数是否超过预设次数,例如,50次。当后台进程的通信次数超过50次,则处理器110关闭网络通信连接。从而该方法能够在电子设备100处于空闲状态等状态时,阻止后台进程通信,避免后台进程因通信而导致电子设备的电量下降的问题,影响用户的体验。
在一些实施例中,处理器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)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(derail clock line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器180K,充电器,闪光灯,摄像头193等。例如:处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备100的触摸功能。
在一些实施例中,通过触摸传感器180K接收到用户输入的触摸信息,例如用户通过电子设备界面设定电池电量的管理模式,可以通过点击界面上的电量管理应用程序进行设置。触摸传感器将用户点击电量管理应用程序的位置坐标信息发送给处理器110,处理器110根据位置坐标信息等确定该触摸操作为打开点击管理应用程序,并执行打开电量管理应用程序,以便于用户可以通过触摸操作实现各种功能需求。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。在一些实施例中,处理器110通过UART接口与无线通信模块160连接,实现无线网络通信功能,例如,蓝牙通信,局域网络通信等。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些的实施例中,充电管理模块140为电池142充电的同时,还可以通过电源管理模块141监测电池电量的情况。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,显 示屏194,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在一些实施例中,当电子设备100处于空闲状态时,电源管理模块141可以采用周期性监测方式,例如,每隔30秒监测电池142的电量,以便于观察电量的变化情况,并将变化的情况发送给处理器110,以便于处理器110根据电量变化判断是否需要对电子设备进行管控。在一些实施例中,当处理器110判断电量变化量(掉电量)大于设定阈值,则进一步判断后台进程的通信次数是否超过设定次数,若超过设定次数,则处理器110可以关闭进程,或断开与移动通信模块和无线通信模块的通信连接,使电子设备100断网。避免电子设备在机内第一模式,例如空闲状态时,耗电速度过快,降低用户体验。
在本申请的一些实施例中,处理器110可以通过广播模块从电源管理模块141获取电池的电量数据和通信次数数据,从而使得处理器110根据这些数据判断是否对电量进行管控。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150每接收一次信号,记为一次通信,每发送出去一个信号,记为一次通信,并统计这些接收和发送的信号次数(通信次数),发送给处理器110,由处理器110基于通信次数判断是否为电子设备断网。在本申请的一些实施例中,通信次数可以由处理器110的播报模块获得。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。在一个实施例中,无线通信模块160每接收一次电磁波信号,计作一次通信,每发送一次电磁波信号计作一次通信,并将每次记录的通信次数发送给处理器110。处理器110基于可以基于移动通信次数和无线通信模块160的通信次数判断是否为电子设备100断开网络通信连接。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。在一些实施例中,显示屏上可以显示电池电量。用户也可以通过显示屏194上操作实现对电池电量控制模式进行选择。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
在一些实施例中,存储器121的存储数据区将存储的数据以记录表形式进行存储,例如,哈希表,该哈希表中可以记录电子设备100刚进入空闲状态时的电池的初始电量和后台进程的通信次数等信息。处理器110可以根据哈希表中的数据信息计算出电子设备处于空闲状态下的掉电量,并结合通信次数,判断是否对电子设备的网络通信情况进行管控。
在一些实施例中,电源管理模块141将每一次监测到的电量以及每一次电量对应的时间,记录在哈希表中。处理器110将每一次的获得的通信计数以及对应通信计数的时间戳,记录在哈希表中。处理器110可以基于哈希表中的记录的电量得到掉电量,并在判断掉电量超过设定阈值(条件a),通信次数超过设定次数时(条件b),进一步根据时间戳判断上述条件a和条件b成立是否在预设时长内。若是,处理器110为电子设备断网。若不是,继续更新哈希表内的记录。当哈希表内的记录数量超出设定数量,则处理器110按照时间排序,删除排列在前的时间戳对应的电量记录或通信计数记录。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。在一些实施例中,陀螺仪传感器180B将检测的运动姿态数据发送给处理器110,处理器110根据运动姿态数据判断手机当前的运动状态。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。在一些实施例中,处理器110可以结合陀螺仪传感器180B检测的电子设备100的运动姿态数据,和加速度传感器180E可检测电子设备100的在不同方向上的加速度大小和变换,准确的判断出电子设备100是处于静止或者运动。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。在一些实施例中,电子设备100可以利用接近光传感器180G检测到的反射光,而使处理器判断出电子设备100被放在背包或口袋中,从而可以判断电子设备100当前处于空闲状态。当处理器110判断出电子设备100处于空闲状态时,则获得电子设备100进入空闲状态时的系统时刻、电池的初始电量和后台进程的通信次数等,以 使处理器110基于这些数据以及持续获得数据判断是否对电子设备的网络连接情况进行管控。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在背包或口袋里,又或者是当前时刻为夜间。
在一些实施例中,环境光传感器检测到当前光线的强度、亮度等数据,处理器110根据这些光线的强度、亮度等数据,并结合当前系统时间可以准确的判断出当前是夜间。
在一些实施例中,处理器110可以将上述陀螺仪传感器180B、加速度传感器180E检测的表示移动的数据、环境光传感器180L检测的光线亮度、强度数据,以及系统时间结合判断当前电子设备是否处于空闲状态。即,在设定时间内移动数据保持不变,光线亮度和强度属于夜间光线的亮度和强度,手机的屏幕在设定时间内黑屏,以及系统时间属于设定的夜间时间。则可以判定手机为空闲状态,此时的空闲状态可以表示用户处于睡眠状态,手机在处于用户非使用状态中。处理器110可以执行对电量变化和通信次数的定期分析和判断以在满足预设条件时,对电量进行管控,减少手机在空闲状态时,电量的过度消耗。
触摸传感器180K,也称“触控器件”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在一些实施例中,触摸传感器180k可以检测用户点击显示屏194上的电量管理应用程序的触摸操作,并将点击的触摸事件发送给处理器110,处理器110通过显示屏194将打开电量管理应用程序的界面,或者设置程序中电量设置界面展现给用户,用户可以根据显示屏194上界面提示,对电量信息,例如,掉电量的设定阈值,通信次数的设定数量、以及预设时长等各参数的选项进行设置。
下面结合软件、硬件的架构图,对本申请的系统功耗控制方法进行描述。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
示例性的,图2b为包括软件结构和硬件结构的架构图。如图2b所示,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图2b所示,应用程序包可以包括相机、图库、日历、地图、WLAN、蓝牙、短信息、电量管理应用和广播接收器等。
电量管理应用,用于提供用户输入预设参数的通道。用户可以通过电源管理应用设置关于电量管理的各个参数,例如,掉电量的设定阈值、后台进程的通信次数的预设次数,以及反应电量消耗和通信频次的时间参数等。
广播接收器用于响应来自其他应用程序或者系统的广播消息。例如,当应用程序通过在Android Manifest.xml中注册广播接收器来监听电池的电量,后台进程的通信次数等。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application  programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2b所示,应用程序框架层可以包括窗口管理器、内容提供器、电话管理器、资源管理器、数据分析模块、执行模块等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
在本申请的一个实施例中,数据分析模块用于根据功耗的各类参数信息分析当前是否对电子设备的功耗进行管控。
执行模块用于根据数据分析模块的指令,控制硬件层的硬件执行相应的动作,例如,关闭通信开关,以控制电子设备因通信造成的功耗。
如图2b所示,内核层是硬件和软件之间的层。内核层可以包括传感器驱动、电量计驱动、射频收发器驱动、通信开关驱动,这些驱动作为软件模块与硬件之间的通信桥梁,实现软硬件之间的通信。其中电量计驱动用于驱动电量计对电池的电量进行监测,并向系统发送监测结果,由系统对该结果进行播报,以使广播接收器获得对应的电池电量。射频收发器驱动用于射频收发器统计通信次数,并向系统发送统计结果,由系统对该结果进行播报,以使广播接收器获得对应的进程的通信次数。
硬件层包括执行各种指令的硬件,如图2b所示,可以包括数据存储区、电量计、电池、射频收发器和通信开关和光传感器等,
光传感器用于获取外界光的相关数据。光传感器可以包括如图1所示的环境光传感器和接近光传感器。环境光传感器可以获取环境的光线亮度、光线强度等,接近光传感器可以获取周围物体反射的红外反射光的数据。光传感器获取到外界光的相关数据,并将这些数据通过传感器驱动发送给数据分析模块。数据分析模块对这些数据进行分析判断,以确定当前电子设备是否处于夜间或背包内(通常理解为非用户使用时间段,电子设备为空闲状态)。
当数据分析模块判断电子设备处于空闲状态时,数据分析模块向执行模块发送电子设备为监测功耗的指令,执行模块基于该指令通过电量计驱动使电量计监测电池的电量。执行模块通过射频发射器驱动使射频发射器记录通信次数。这些数据在硬件层被获取,并通过对应的驱动写到设备节点(写到内存的指定文件内),并通过系统播报方式被应用层的广播接收器获得。其中,关于广播接收器接收硬件层的数据的实现过程。以电量数据为例,对于上层安卓安装包(Android Package kits,APK),需要注册安卓动作意图电量变化(android intent action Battery-changed)广播。当电量变化时,框架层会遍历所有注册此广播的广播接收器,系统广播向注册过的广播接收器发送电量的变化信息,从而接收到电量。此外,本申请的其他的数据,也可以通过广播接收器获得,例如,位置数据,灭屏时间,系统时间等,这些数据被硬件层各自的传感器采集,传感器将模拟信号转化为数字信号,通过对应的驱动写到设备节点,通过安卓广播将这些数据发送给注册的广播接 收器。以实现底层数据到应用层的过程。
如图2b所示,当电量计将获得的系统时刻、初始电量、以及持续监测的当前电量时,将这些数据以记录表的形式存储到数据存储区,射频发射器将获得通信次数存储到对应的记录表中。在数据存储区可以将上述数据以哈希表形式存储,便于快速的查询。
广播接收器将接收的当前电量和当前通信次数发送给数据分析模块。数据分析模块基于接收的当前电量和存储在数据存储区内的初始电量,或预设时间内的起点时刻对应的电量,计算出掉电量,并将掉电量与预设阈值(可以从电量管理应用获得或系统默认值)进行比较。当掉电量大于等于预设阈值,例如10%,则进一步判断当前通信次数是否大于等于预设次数(可以从电量管理应用获得或系统默认值)。若是,数据分析模块向执行模块发送管控指令。例如,关闭网络的指令,执行模块执行该指令,并通过通信开关驱动关闭通信开关,即为电子设备断网,使射频收发器停止信号接收和发送。从而实现在手机处于空闲状态时(即用户不使用电子设备时),减少电池的电量的消耗,提高用户体验。
下面结合具体实施例对本申请实施例的系统功耗控制方法进行描述。
本申请的系统功耗控制方法可以应用于上述图2a和图2b描述的电子设备中,在下面的实施例中以手机作为电子设备进行了说明。
参考图3,图3示例性示出了系统功耗控制方法的流程图。如图3所示,该流程图包括S300~S308。
在S300,手机确定自身处于空闲状态。
在本申请的一个实施例中,空闲状态可以包括以下几种方式中的一种或多种进行判断。
第一种,手机可以通过自身的环境光传感器和接近光传感器检测环境光亮度、光线强度、以及红外线反射光等参数判断当前自身是否处于夜间。该步骤如上述图1中环境光传感器、接近光传感器和处理器执行。若处于夜间,进一步判断手机的屏幕黑屏的时间是否超过设定时间,例如,超过1分钟,若是,则确定自身处于空闲状态。
第二种,手机可以通过系统时间来判断当前是否处于夜间。例如,当系统时间到达晚上10点,属于夜间时间。此外,手机可以通过用户设定的模式判断当前是否处于夜间。例如,手机设有夜间模式和白天模式,当用户将手机设定为夜间模式时,则手机确定当前处于夜间。进一步判断手机的屏幕黑屏的时间是否超过设定时间,例如,超过1分钟,若是,则确定自身处于空闲状态。
第三种,手机可以结合用户数据进行判断。例如,用户佩戴的手表监测到用户的心跳频率或血压等数据,基于这些用户数据判断该用户处于睡眠状态。则可以判断当前手机为空闲状态。通过用户数据可以在任何时间对用户是否处于睡眠中。并预测手机处于空闲状态。
在本申请的一些实施例中,手机可以将上述三种中的多种数据进行结合来判断自身是否处于空闲状态,以提高判断的准确性。此处只是示例性说明,也可以结合其他数据判断手机为空闲状态,例如,可以结合手机是否在充电等数据进行判断,此处并不作为限定。
上述描述中以空闲状态作为手机的第一模式进行的说明,本申请的一些实施例中,第一模式还可以是电量值较低,或者手机进入睡眠模式等,此处并不作为限定。
S301,手机获取进入空闲状态时的系统时刻和初始电量。
当手机进入空闲状态时,作为对电量管控判断的时机,手机通过执行系统初始化,获取的系统时刻和初始电量,并作为原始记录存储在内部存储器内。
S302,手机在处于空闲状态时间内不断监听的电量和后台进程的通信次数,并将每一次监测到的电量和通信次数进行存储。例如,可以通过系统广播播报电量、系统时刻、通信次数等信息,由广播接收器监听并获得电量、系统时刻、通信次数等。以使手机的其他程序可以进一步对这些数据进行分析处理。
在本申请的实施例中,通信次数是指后台所有进程与外界通信的总和。这些数据被以哈希表的形式存储,便于手机能够快速的获取到表中指定的数据。当哈希表中的数据超过设定值时,则按照记录时间的先后顺序将排列在前的电量记录进行删除。
在本申请的一些实施例中,手机还可以对后台的每一个进程赋予标识,并根据标识确定每一个进程的通信次数。对每一个进程的通信进程分别进行记录,以便于对单个进程的通行情况进行管控。
S303,手机计算掉电量。
在本申请的实施例中,手机将初始电量减去当前电量得到掉电量。或者可以将记录表中的起始时刻的电量减掉当前电量,从而可以及时去除参考价值低的电量,释放内存。
如图4所示的电量变化图,如图4所示,Q1作为初始电量99%,在时间t1获得的电量Q2为95%,则在t1时间的掉电量=Q1-Q2,即从t0到t1间隔15分钟,掉电量为99%-95%=4%。Q3为在时间t2获得的电量89%。在t2时间的掉电量=Q1-Q3,即从t1到t2间隔20分钟,掉电量为99%-89%=10%。在本申请中,当获取电量时通过系统播报的方式,即当电量发生变化时获得电量,则每两个电量对应的获取时间间隔并不一定相同。例如,在t0到t1的时间间隔为15分钟,而在t1到t2的时间间隔为20分钟。若采用周期性监测电量的方式时,时间间隔可以设定为固定值,例如15分钟。
S304,手机判断掉电量是否达到设定阈值。举例说明,结合图4所示,若设定阈值为10%,当前电量为95%,则掉电量4%,未达到10%。则手机返回执行S302。
当前电量为89%,则掉电量为10%,达到10%,则手机执行S305,读取后台进程的通信次数。其中,通信次数为手机后台所有进程通信次数的总和。
S306,手机判断通信次数是否达到预设通信次数。
在本申请的一个实施例中,该通信次数是指,在当前时刻,手机后台运行的所有进程从手机开机完成的起点时刻开始统计的,与其他设备通信次数的总和。
例如,预设次数为50次。当前后台进程通信次数为40次,未达到设定次数。则手机继续执行S305。其中通信次数可以是后台进程运行的总的通信次数。
若当前后台进程通信次数为60次,超过预设次数50次,则手机执行S307,手机对电量的消耗进行管控。例如,通过控制网络通信开关,使手机断开网络通信连接。
根据本申请实施例的系统功耗控制方法,可以避免在手机处于空闲状态时(非用户使用状态),手机后台进程通信次数较多,而使电量被消耗,影响用户体验。
在一些实施例中,还可以对后台运行的每一个进程的通信次数进行限定。例如,对后台的每一个进程分别计算各自的通信次数,例如,进程通过调用上层接口,并读取到设备节点中的数据,并获得各自的电量、通信次数等数据。当其中一个进程的通信次数达到设定值,例如20次,则手机可以单独对该进程进行管理,例如,关闭该指定进程。
在本申请的另一个实施例中,还可以对掉电量的速度和通信的频次进行限定。即将预设时间内的掉电量和通信次数作为判断条件,可以避免短时间内电量急剧消耗的情况。
参考图5,图5示例性示出了系统功耗控制方法的另一流程图。该方法可以由具有上 述图1和图2中所示结构的手机执行。如图5所示,该流程图包括S500~S508。
其中,S500~S501与上述图3中S300~S301相同,S503~S504与上述图3中S303~S304相同,具体可参考上述实施例中的描述,此处不再赘述。
在S502中,手机在空闲状态时不断监听电池的电量以及对应的时间戳、监测后台进程的通信次数以及对应的时间戳,并存储。手机在周期检测的电池的电量时,同时记录每一条电量记录对应的时间戳。并且在每一次记录通信次数时,同时记录每一条通信次数的对应的时间戳。
在S505中,读取后台进程的当前通信次数,并获取预设时长(第二预设时长)内的起点时刻对应的通信次数与当前通信次数的差值(通信次数的变化数量)。例如,获取记录中的在第二预设时长,例如20分钟内的起点时刻对应的进程的通信次数20次的记录,而当前时刻获得通信次数为80次,则通信次数的变化数量为60次。通过设定第二预设时长,可以避免由于时间过长,在先的获取的记录的参考意义降低,因此,通过设定预设时长,定期对记录中时间较早的记录删除,提高电子设备对耗电情况判断的可靠性。
在S506中,手机判断通信次数的变化次数是否达到预设变化次数。例如,预设变化次数是50次,当通信次数变化的数量为60次,则大于50次,则执行在S507。否则,手机执行S505。
在S507,手机判断是否在预设时长(第一预设时长)内掉电量达到预设电量阈值,且通信次数的变化数量达到设定变化次数。例如,第一预设时长为10分钟,即在10分钟内,若掉电量达到设定阈值10%,且通信次数达到设定次数50次,则手机执行S508,手机对电量的消耗进行管控。该方法通过在预设时长内判断掉电量达到预设阈值和通信次数的变化次数达到预设变化次数,可以有效的避免在较短时间内,因手机耗电速度较快,而导致电量消耗过快。因此,当发生短时间内掉电量过快时,需要及时对手机进行管控,例如,通过控制通信开关,使手机断开网络通信连接。通过三个因数的结合判断,可以提高电量管控的谨慎性,避免因切断网络而给用户带来不便。
需要说明的是,在判断掉电量和通信次数的变化次数时,设置的第一预设时长应小于电量记录和通信次数记录的第二预设时长,以使得在S507中,具有足够时长内的电量记录和通信记录,确保判断的准确性。
当在S507中,判断结果为否,即未在预设时长内掉电量达到设定阈值,且通信次数的变化次数达到设定变化次数,手机返回执行S502。
根据本申请实施例的系统功耗控制方法,能够在手机处于非使用的状态下、睡眠状态或低电量等情况下,手机通过控制后台进程的通信,避免电子设备的电量被急剧消耗,确保电子设备的使用时长,进一步提高用户体验。
在本申请的实施例中,当手机检测用户的操作,例如,点击后的亮屏、移动等操作时,则判断当前处于被用户使用的状态,则恢复网络,以便于用户可以正常使用网络,提高用户体验。
在本申请的一些实施例中,上述图3和图5中提及的预设阈值和预设次数、设定时长等参数可以是系统默认值,也可以是用户根据需要进行设定。
参考图6,图6示例性示出了手机的界面操作示意图。如图6中的(a)所示,该界面610上显示有电量管理图标611。用户可以通过打开图标611对掉电量的预设阈值和通信次数的预设次数等参数进行设定。当用户点击图标611,可进入用户设置界面。如图6中 的(b)所示,界面620为用户设置界面,该界面620包括用于参数设定的选项,用户通过这些攒想对各参数进行设定,例如,“设定管理时间”、“设置电量的预设阈值”、“设置通信次数的预设次数”和“设置预设时长”。当用户点击设置电量的预设阈值,如图6中的(c)所示,进入界面630,630包括掉电量的预设阈值的设定尺631,用户可以通过设定尺631选择预设电量阈值的参数值。此外,用户还可以通过界面620上的设定管理时间需要管理的时间段,例如,晚上10点到次日凌晨5点。通过设置通信次数的预设次数设定通信次数的预设次数或者预设变化次数等。用户还可以通过设置预设时长选项对第一预设时长进行设定。本申请采用用户自定义设定方式可以提高用户使用的灵活性,不同用户可根据不同需求选择适当的参数,有利于提高用户体验。
本申请实施例还提供一种电子装置,该电子装置可以用于实现前述实施例中的功耗控制方法中电子设备所执行的功能。该电子设备的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。
例如,图7示出了本申请实施例提供的电子装置的结构示意图。如图7所示,该电子设备可以包括:确认模块710、处理模块720和网络管理模块730等。
其中,确认模块710,用于确认电子设备进入第一模式;
处理模块720,用于确定电池的掉电量和后台进程的通信次数,其中,掉电量是相对于第一时刻的电量所降低的电量值,第一时刻为电子装置进入第一模式的起始时刻;所述通信次数用于指示当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和;
网络管理模块730,用于当掉电量达到预设电量阈值,且通信次数达到预设通信次数时,关闭网络通信连接。
上述各模块执行的具体实例,在上述图3和图5描述的方法中进行了说明,具体可参考上述方法的描述,此处不再赘述。并取得了相应的技术效果,即,能够在电子装置处于非使用的状态下、睡眠状态或低电量等情况下,电子装置通过控制后台进程的通信,避免电子装置的电量被急剧消耗,确保电子装置的使用时长,进一步提高用户体验。
参考图8,本申请还提供一种电子设备,包括:
存储器810,用于存储由设备的一个或多个处理器执行的指令,以及
处理器820,用于执行上述实施例中结合图3和图5所示的方法。
在上述各器件执行的具体实施例中,在上述图3和图5描述的方法中进行了说明,并取得了相应的技术效果,具体可参考上述方法的描述,此处不再赘述。
本申请还提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序在电子设备上运行时,使得电子设备实现如上述实施例中图3和图5所示的功耗控制方法。
可选地,本申请实施例可以被实现为由一个或多个暂时或非暂时性机器可读(例如,计算机可读)存储介质承载或存储在其上的指令,其可以由一个或多个处理器读取和执行。例如,指令可以通过网络或通过其他计算机可读介质分发。因此,机器可读介质可以包括用于以机器(例如,计算机)可读的形式存储或传输信息的任何机制,包括但不限于,软盘、光盘、光碟、光盘只读存储器(Compact Disc Read Only Memory,CD-ROMs)、磁光盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(RAM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、电可擦除可编程只读 存储器(Electrically Erasable Programmable Read Only Memory,EEPROM)、磁卡或光卡、闪存、或用于利用因特网以电、光、声或其他形式的传播信号来传输信息(例如,载波、红外信号数字信号等)的有形的机器可读存储器。因此,机器可读介质包括适合于以机器(例如,计算机)可读的形式存储或传输电子指令或信息的任何类型的机器可读介质。
本申请还提供一种包含指令的计算机程序产品,当该计算机程序产品在电子设备上运行时,使得电子设备执行上述实施例中图3和图5所示的功耗控制方法。
在上述程序产品执行的具体实施例中,在上述图3和图5描述的方法中进行了说明,并取得了相应的技术效果,具体可参考上述方法的描述,此处不再赘述。
需要说明的是,在本专利的示例和说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。

Claims (21)

  1. 一种系统功耗控制方法,应用于电子设备,其特征在于,所述方法包括:
    确认所述电子设备进入第一模式;
    所述电子设备确定电池的掉电量和后台进程的通信次数,其中,所述掉电量是相对于第一时刻的电量所降低的电量值,所述第一时刻为所述电子设备进入第一模式的起始时刻;所述通信次数用于指示当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和;
    当所述掉电量达到预设电量阈值,且所述通信次数达到预设通信次数,所述电子设备关闭网络通信连接。
  2. 根据权利要求1所述的方法,其特征在于,所述电子设备确定电池的掉电量,包括:
    所述电子设备获取所述第一时刻对应的电池的初始电量,以及当前时刻电池的当前电量,将所述初始电量减去所述当前电量得到当前时刻对应的所述掉电量。
  3. 根据权利要求1所述的方法,其特征在于,还包括:
    当所述电子设备确定在第一预设时长内,所述掉电量达到预设电量阈值,且所述通信次数的变化次数达到预设变化次数,所述电子设备关闭网络通信连接。
  4. 根据权利要求3所述的方法,其特征在于,所述电子设备确定电池的掉电量,包括:
    所述电子设备获取第二时刻对应的电量,以及当前时刻对应的电池的当前电量,所述第二时刻为在第二预设时长内的起点时刻,所述第二预设时长为存储的电量记录的时长,将所述第二时刻对应的电量减去所述当前电量得到当前时刻对应的所述掉电量,其中,所述第二预设时长大于所述第一预设时长。
  5. 根据权利要求4所述的方法,其特征在于,所述电子设备确定当前时刻对应的电池的通信次数的变化次数,包括:
    所述电子设备获取在所述第二时刻对应的通信次数,以及当前通信次数,将所述当前通信次数减去所述第二时刻对应的通信次数得到所述通信次数的变化次数。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,确认所述电子设备进入第一模式,包括:
    所述电子设备基于环境光数据、触摸屏数据、电子设备运动姿态数据、GPS数据和用户的睡眠数据中的至少一个,确定进入所述第一模式。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述第一模式包括所述电子设备的睡眠模式、低电量状态或空闲状态。
  8. 根据权利要求1-7任一项所述的方法,其特征在于,当所述电子设备接收到用户的操作数据,则开启网络通信连接。
  9. 根据权利要求8所述的方法,其特征在于,所述用户的操作数据包括:点击触摸屏的操作数据和电子设备获取的位置变化的操作数据中的至少一种。
  10. 一种电子设备,其特征在于,包括:
    存储器,用于存储由设备的一个或多个处理器执行的指令,以及
    处理器,用于确认所述电子设备进入第一模式,所述处理器确定电池的掉电量和后台进程的通信次数,其中,所述掉电量是相对于第一时刻的电量所降低的电量值,所述第一时刻为所述电子设备进入第一模式的起始时刻;所述通信次数用于指示当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和;当所述掉电量达到预设电量阈值,且所述通信次数达到预设通信次数,所述处理器控制网络接口开关关闭网络通信连接。
  11. 根据权利要求10所述的电子设备,其特征在于,所述处理器用于:获取所述第一时刻对应的电池的初始电量,以及当前时刻电池的当前电量,将所述初始电量减去所述当前电量得到当前时刻对应的所述掉电量。
  12. 根据权利要求10所述的电子设备,其特征在于,处理器还用于:
    当确定在第一预设时长内,所述掉电量达到预设电量阈值,且所述通信次数的变化次数达到预设变化次数,所述处理器控制网络接口开关关闭网络通信。
  13. 根据权利要求12所述的电子设备,其特征在于,
    所述处理器获取第二时刻对应的电量,以及当前时刻电池的当前电量,其中,所述第二时刻为在第二预设时长内的起点时刻,所述第二预设时长为存储的电量记录的时长,将所述第二时刻对应的电量减去所述当前电量得到当前时刻对应的所述掉电量,其中,所述第二预设时长大于所述第一预设时长。
  14. 根据权利要求13所述的电子设备,其特征在于,
    所述处理器用于获取所述第二时刻对应的通信次数,以及当前通信次数,将所述当前通信次数减去所述第二时刻对应的通信次数得到所述通信次数的变化次数。
  15. 根据权利要求10-14任一项所述的电子设备,其特征在于,所述处理器基于传感器采集的环境光数据、触摸屏数据、运动姿态数据、用户的睡眠数据以及通信单元获取的GPS数据中的至少一个,确定进入第一模式。
  16. 根据权利要求10-15任一项所述的电子设备,其特征在于,所述第一模式包括睡眠模式、低电量状态或未使用状态。
  17. 根据权利要求10-16任一项所述的电子设备,其特征在于,当所述处理器接收到用户的操作数据,则开启网络通信连接。
  18. 根据权利要求17所述的电子设备,其特征在于,所述用户的操作数据包括:点击触摸屏的操作数据、电子设备发生的位置变化的操作数据中的至少一种。
  19. 一种电子设备,其特征在于,包括:
    确认模块,用于确认所述电子设备进入第一模式,
    处理模块,用于确定电池的掉电量和后台进程的通信次数,其中,所述掉电量是相对于第一时刻的电量所降低的电量值,所述第一时刻为所述电子设备进入第一模式的起始时刻;所述通信次数用于指示当前在后台运行的所有进程,从电子设备开机完成开始统计的与其他设备通信次数的总和;
    网络管理模块,用于当所述掉电量达到预设电量阈值,且所述通信次数达到预设通信次数时,关闭网络通信。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器运行时,使得所述处理器执行权利要求1-9任一 项所述的方法。
  21. 一种包含指令的计算机程序产品,其特征在于,当该计算机程序产品在电子设备上运行时,使得处理器执行权利要求1-9任一项所述的方法。
PCT/CN2022/088777 2021-08-11 2022-04-24 系统功耗控制方法及电子设备 WO2023015945A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP22751239.9A EP4155928A4 (en) 2021-08-11 2022-04-24 SYSTEM ENERGY CONSUMPTION REGULATING METHOD AND ELECTRONIC DEVICE

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110918392.XA CN114995625B (zh) 2021-08-11 2021-08-11 系统功耗控制方法及电子设备
CN202110918392.X 2021-08-11

Publications (1)

Publication Number Publication Date
WO2023015945A1 true WO2023015945A1 (zh) 2023-02-16

Family

ID=83018819

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/088777 WO2023015945A1 (zh) 2021-08-11 2022-04-24 系统功耗控制方法及电子设备

Country Status (3)

Country Link
EP (1) EP4155928A4 (zh)
CN (1) CN114995625B (zh)
WO (1) WO2023015945A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116567127B (zh) * 2023-06-15 2024-01-23 深圳市誉源通讯技术有限公司 一种具有故障监测功能的智能手机
CN116719401A (zh) * 2023-08-10 2023-09-08 北京小米移动软件有限公司 供电控制方法和装置、电子设备、存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1736850B1 (en) * 2005-06-15 2009-09-30 Research In Motion Limited Power management for portable electronic device with integrated pointing device
CN102647527B (zh) * 2012-03-28 2015-07-29 华为终端有限公司 一种智能通信终端及其服务运行方法、装置
CN104268009B (zh) * 2014-09-24 2018-07-06 联想(北京)有限公司 一种运行控制方法、装置及电子设备
CN107835311B (zh) * 2017-10-31 2020-05-12 Oppo广东移动通信有限公司 应用管理方法、装置、存储介质及电子设备
CN107832131B (zh) * 2017-10-31 2020-07-07 Oppo广东移动通信有限公司 应用程序关闭方法、装置、存储介质和电子设备

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070271234A1 (en) * 2006-05-22 2007-11-22 Ravikiran Chickmangalore N Information Exchange Among Members of a Group of Communication Device Users
CN101461176A (zh) * 2006-06-01 2009-06-17 日本电气株式会社 通信节点认证系统和方法以及通信节点认证程序
WO2009070415A1 (en) * 2007-11-27 2009-06-04 Motorola, Inc. A wireless communication device and method op disabling an idle of one operational mode
JP5181181B2 (ja) * 2008-03-11 2013-04-10 インターナショナル・ビジネス・マシーンズ・コーポレーション コンピュータ・システムの省電力化法
JP2010166543A (ja) * 2008-12-18 2010-07-29 Japan Radio Co Ltd 無線ノード装置
CN102256019A (zh) * 2011-07-27 2011-11-23 宇龙计算机通信科技(深圳)有限公司 一种多模移动通信终端及其控制方法、系统
US8655307B1 (en) * 2012-10-26 2014-02-18 Lookout, Inc. System and method for developing, updating, and using user device behavioral context models to modify user, device, and application state, settings and behavior for enhanced user security
CN103228031A (zh) * 2013-05-02 2013-07-31 黄晓峰 一种低功耗无线数据采集器
US10268254B2 (en) * 2016-01-15 2019-04-23 Google Llc Systems and methods for extending battery life by monitoring mobile application activity
CN106936557B (zh) * 2017-03-23 2020-04-03 江苏中科羿链通信技术有限公司 一种无线信道资源分配方法
CN108134873A (zh) * 2017-12-15 2018-06-08 广东欧珀移动通信有限公司 电子装置的抗干扰方法及相关产品
CN109661022A (zh) * 2018-12-19 2019-04-19 惠州Tcl移动通信有限公司 网络控制方法、系统、存储介质及移动终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1736850B1 (en) * 2005-06-15 2009-09-30 Research In Motion Limited Power management for portable electronic device with integrated pointing device
CN102647527B (zh) * 2012-03-28 2015-07-29 华为终端有限公司 一种智能通信终端及其服务运行方法、装置
CN104268009B (zh) * 2014-09-24 2018-07-06 联想(北京)有限公司 一种运行控制方法、装置及电子设备
CN107835311B (zh) * 2017-10-31 2020-05-12 Oppo广东移动通信有限公司 应用管理方法、装置、存储介质及电子设备
CN107832131B (zh) * 2017-10-31 2020-07-07 Oppo广东移动通信有限公司 应用程序关闭方法、装置、存储介质和电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4155928A4

Also Published As

Publication number Publication date
CN114995625A (zh) 2022-09-02
CN114995625B (zh) 2023-05-12
EP4155928A4 (en) 2023-05-24
EP4155928A1 (en) 2023-03-29

Similar Documents

Publication Publication Date Title
US20220053080A1 (en) Touchscreen Response Method and Electronic Device
WO2020108356A1 (zh) 一种应用显示方法及电子设备
WO2023015945A1 (zh) 系统功耗控制方法及电子设备
WO2021213164A1 (zh) 应用界面交互方法、电子设备和计算机可读存储介质
WO2020093833A1 (zh) 一种接近光传感器的控制方法及电子设备
WO2020073288A1 (zh) 一种触发电子设备执行功能的方法及电子设备
WO2020077540A1 (zh) 一种信息处理方法及电子设备
WO2022033320A1 (zh) 蓝牙通信方法、终端设备及计算机可读存储介质
WO2020056778A1 (zh) 一种屏蔽触摸事件的方法及电子设备
EP4236434A1 (en) Channel switching method, electronic device, and storage medium
CN110687998A (zh) 一种应用管理方法及装置
WO2021213151A1 (zh) 显示控制方法和可穿戴设备
EP4130969A1 (en) Method and device for adjusting memory configuration parameter
WO2021238460A1 (zh) 风险预警方法、风险行为信息获取方法和电子设备
WO2023005282A1 (zh) 一种消息推送方法及装置
CN113220176B (zh) 基于微件的显示方法、装置、电子设备及可读存储介质
WO2021238387A1 (zh) 一种执行应用的方法及装置
WO2021190314A1 (zh) 触控屏的滑动响应控制方法及装置、电子设备
WO2021218429A1 (zh) 应用窗口的管理方法、终端设备及计算机可读存储介质
CN116070035A (zh) 数据处理方法和电子设备
WO2022089216A1 (zh) 一种界面显示的方法和电子设备
WO2022252972A1 (zh) 一种窗口显示方法和电子设备
WO2021155709A1 (zh) 一种充电控制方法及电子设备
CN113672083B (zh) 监测作息时刻的方法和装置
WO2023138533A1 (zh) 业务协同方法、电子设备、可读存储介质和芯片系统

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2022751239

Country of ref document: EP

Effective date: 20220818

WWE Wipo information: entry into national phase

Ref document number: 17904472

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE