CN116526640B - Battery protection method, electronic device, and computer-readable storage medium - Google Patents
Battery protection method, electronic device, and computer-readable storage medium Download PDFInfo
- Publication number
- CN116526640B CN116526640B CN202310814490.8A CN202310814490A CN116526640B CN 116526640 B CN116526640 B CN 116526640B CN 202310814490 A CN202310814490 A CN 202310814490A CN 116526640 B CN116526640 B CN 116526640B
- Authority
- CN
- China
- Prior art keywords
- battery
- electric quantity
- sim card
- task
- electronic device
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 89
- 230000004044 response Effects 0.000 claims description 95
- 230000007774 longterm Effects 0.000 abstract description 22
- 230000002035 prolonged effect Effects 0.000 description 19
- 238000010586 diagram Methods 0.000 description 8
- 238000012544 monitoring process Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 230000003993 interaction Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 238000013528 artificial neural network Methods 0.000 description 2
- 230000002950 deficient Effects 0.000 description 2
- 230000002349 favourable effect Effects 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W52/00—Power management, e.g. TPC [Transmission Power Control], power saving or power classes
- H04W52/02—Power saving arrangements
- H04W52/0209—Power saving arrangements in terminal devices
- H04W52/0261—Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3206—Monitoring of events, devices or parameters that trigger a change in power modality
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02H—EMERGENCY PROTECTIVE CIRCUIT ARRANGEMENTS
- H02H7/00—Emergency protective circuit arrangements specially adapted for specific types of electric machines or apparatus or for sectionalised protection of cable or line systems, and effecting automatic switching in the event of an undesired change from normal working conditions
- H02H7/18—Emergency protective circuit arrangements specially adapted for specific types of electric machines or apparatus or for sectionalised protection of cable or line systems, and effecting automatic switching in the event of an undesired change from normal working conditions for batteries; for accumulators
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J7/00—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
- H02J7/0029—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J7/00—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
- H02J7/0029—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits
- H02J7/0031—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits using battery or load disconnect circuits
-
- H—ELECTRICITY
- H02—GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
- H02J—CIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
- H02J7/00—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
- H02J7/0047—Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits
- H02J7/0048—Detection of remaining charge capacity or state of charge [SOC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W52/00—Power management, e.g. TPC [Transmission Power Control], power saving or power classes
- H04W52/02—Power saving arrangements
- H04W52/0209—Power saving arrangements in terminal devices
- H04W52/0251—Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Power Engineering (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Power Sources (AREA)
Abstract
The embodiment of the application provides a battery protection method, electronic equipment and a computer readable storage medium, and relates to the technical field of power management. The battery protection method comprises the following steps: determining a shutdown scene of the electronic device, wherein the shutdown scene comprises an active shutdown scene or a passive shutdown scene. And acquiring the presence state of a Subscriber Identity Module (SIM) card of the electronic equipment and the electric quantity of a battery of the electronic equipment according to the shutdown scene, wherein the presence state of the SIM card comprises presence or non-presence. And switching to a transportation mode or shutting down according to the in-place state of the SIM card and the electric quantity of the battery. Therefore, whether the electronic equipment is in a scene which is not used for a long time can be effectively judged. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched into a transportation mode, so that the electronic equipment is completely powered off, thereby protecting the battery and prolonging the service life of the battery.
Description
Technical Field
The embodiment of the application relates to the technical field of power management, in particular to a battery protection method, electronic equipment and a computer readable storage medium.
Background
If the electronic device is not used for a long time, the power of the battery in the electronic device is continuously consumed. Even if the electronic device is in a shutdown state, certain components of the electronic device (e.g., registers and system configuration) may still operate, thereby continuously consuming battery power, which may result in the battery being in a power-starved state. If the battery is in a power shortage state for a long time, the service life of the battery can be influenced.
Disclosure of Invention
The embodiment of the application provides a battery protection method, electronic equipment and a computer readable storage medium, which aim to solve the problem of how to prolong the service life of a battery in a scene that the electronic equipment is not used for a long time.
A first aspect of an embodiment of the present application provides a battery protection method, applied to an electronic device, where the method includes: determining a shutdown scene of the electronic device, wherein the shutdown scene comprises an active shutdown scene or a passive shutdown scene. And acquiring the presence state of a Subscriber Identity Module (SIM) card of the electronic equipment and the electric quantity of a battery of the electronic equipment according to the shutdown scene, wherein the presence state of the SIM card comprises presence or non-presence. And switching to a transportation mode or shutting down according to the in-place state of the SIM card and the electric quantity of the battery.
In this embodiment, according to whether the shutdown scene is an active shutdown scene or a passive shutdown scene, the in-place state of the SIM card and the electric quantity of the battery are obtained, and then the transport mode or shutdown is switched according to the in-place state of the SIM card and the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the in-place state of the SIM card and the electric quantity of the battery which are respectively corresponding to the two shutdown scenes. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to a transportation mode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than switched to a transportation mode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
In one embodiment, obtaining, according to a shutdown scenario, an in-place status of a SIM card of a user identification module of an electronic device and an electric quantity of a battery of the electronic device includes: and setting and starting a first timing startup task in response to the shutdown scene being an active shutdown scene. And responding to the startup of the electronic equipment at or before the expiration of the first timing startup task, and acquiring the in-place state of the SIM card and the electric quantity of the battery.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and switching to a transportation mode in response to the in-place state of the SIM card being in place and the electric quantity of the battery being less than a first electric quantity threshold.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and setting a first mark for indicating that the electric quantity of the battery is acquired when the electronic equipment is started next time in response to the in-place state of the SIM card being in place and the electric quantity of the battery being greater than or equal to a first electric quantity threshold value. And (5) turning off, setting and starting a second timing startup task. And in response to powering on the electronic device at or before the expiration of the second timed power-on task, acquiring the electric quantity of the battery according to the first mark. And switching to a transport mode in response to the charge of the battery being less than the second charge threshold. Wherein the second power threshold is greater than the first power threshold.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and setting a second mark for indicating switching to a transportation mode when the electronic equipment is started next time in response to the in-place state of the SIM card being in place and the electric quantity of the battery being greater than or equal to a second electric quantity threshold value. And (5) turning off, setting and starting a third timing startup task. In response to the electronic device powering on at or before the expiration of the third timed-on task, switching to the transport mode according to the second flag.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and switching to a transportation mode in response to the presence state of the SIM card being out of the presence state and the electric quantity of the battery being less than a third electric quantity threshold.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and setting a first mark for indicating that the electric quantity of the battery is acquired when the electronic equipment is started next time in response to the in-place state of the SIM card being out of place and the electric quantity of the battery being greater than or equal to a third electric quantity threshold value. And (5) turning off, setting and starting a second timing startup task. And in response to powering on the electronic device at or before the expiration of the second timed power-on task, acquiring the electric quantity of the battery according to the first mark. And switching to the transportation mode in response to the charge of the battery being less than the fourth charge threshold. Wherein the fourth power threshold is greater than the third power threshold.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and setting a second flag in response to the charge of the battery being greater than or equal to a fourth charge threshold, the second flag being used to indicate to switch to the transport mode the next time the electronic device is powered on. And (5) turning off, setting and starting a third timing startup task. In response to the electronic device powering on at or before the expiration of the third timed-on task, switching to the transport mode according to the second flag.
In another embodiment, obtaining the in-place status of the SIM card of the electronic device and the electric quantity of the battery of the electronic device according to the shutdown scenario includes: and responding to the shutdown scene being a passive shutdown scene, and acquiring the silent placement duration of the electronic equipment. And acquiring the in-place state of the SIM card and the electric quantity of the battery in response to the silence placement duration reaching the preset duration.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching the first preset time length, the in-place state of the SIM card being in place, the electric quantity of the battery being smaller than a fifth electric quantity threshold value, shutting down, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching a second preset time length, and the in-place state of the SIM card being in place, wherein the electric quantity of the battery is smaller than a sixth electric quantity threshold value, shutting down, and setting and starting a fourth timed starting task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching a third preset time length, the in-place state of the SIM card being in place, the electric quantity of the battery being smaller than a seventh electric quantity threshold value, shutting down, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching the first preset time length, and the in-place state of the SIM card is out of place, wherein the electric quantity of the battery is smaller than an eighth electric quantity threshold value, powering off, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching a second preset time length, and the in-place state of the SIM card is out of place, wherein the electric quantity of the battery is smaller than a ninth electric quantity threshold value, shutting down, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching a third preset time length, and the in-place state of the SIM card is out of place, wherein the electric quantity of the battery is smaller than a tenth electric quantity threshold value, shutting down, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
A second aspect of an embodiment of the present application provides an electronic device, where the electronic device includes a memory and a processor, where the memory is configured to store instructions, and the processor is configured to execute the instructions stored in the memory, so that the electronic device executes a battery protection method according to an embodiment of the present application.
A third aspect of the embodiments of the present application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the battery protection method of the embodiments of the present application.
Technical effects of the second aspect and the third aspect of the embodiments of the present application may be seen from the description of the battery protection method of the first aspect, which is not repeated herein.
Drawings
Fig. 1 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Fig. 2 is a schematic software structure of an electronic device according to an embodiment of the present application.
Fig. 3 is a flowchart of a battery protection method according to an embodiment of the present application.
Fig. 4 is a flowchart for determining a shutdown scenario of an electronic device according to an embodiment of the present application.
Fig. 5 is a flowchart of a battery protection method in an active shutdown scenario according to an embodiment of the present application.
Fig. 6 is a flowchart of a method for protecting a battery in a passive shutdown scenario according to an embodiment of the present application.
Fig. 7 is an interaction diagram of a battery protection method in a scenario where an active shutdown and an SIM card is in place according to an embodiment of the present application.
Fig. 8 is an interaction diagram of a battery protection method in a scenario in which an active shutdown is provided and a SIM card is not in place according to an embodiment of the present application.
Fig. 9 is an interaction diagram of a battery protection method in a situation that a passive shutdown and a SIM card are in place according to an embodiment of the present application.
Fig. 10 is an interactive diagram of a battery protection method in a scenario where the battery is powered off passively and the SIM card is not in place according to an embodiment of the present application.
Fig. 11 is a schematic structural view of a battery protection device according to an embodiment of the present application.
Detailed Description
It should be noted that, in the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and the representation may have three relationships, for example, a and/or B may represent: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The terms "first," "second," "third," "fourth" and the like in the description and in the claims and drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
It should be further noted that, in the method disclosed in the embodiment of the present application or the method shown in the flowchart, one or more steps for implementing the method are included, and the execution order of the steps may be interchanged with each other, where some steps may be deleted without departing from the scope of the claims.
If the electronic device is not used for a long time, the power of the battery in the electronic device is continuously consumed. Even if the electronic device is in a shutdown state, certain components of the electronic device (e.g., registers and system configuration) may still operate, thereby continuously consuming battery power, which may result in the battery being in a power-starved state. For example, when the electric quantity of the battery is less than 3%, the electronic device starts an automatic shutdown process to enter a shutdown state. However, in the shutdown state, some components still operate, and the battery power is still continuously consumed, so that the battery is in a power-deficient state. If the battery is in a power shortage state for a long time, the service life of the battery can be influenced.
If the electronic device is controlled to enter a shipping mode (shipmode) in a scenario where the electronic device is not used for a long time, the electronic device can be completely powered off. That is, when the electronic device is in the shimode, all the components of the electronic device are powered off, so that the electric quantity of the battery can be kept almost unchanged. However, after the electronic device is switched to the shimode, if the electronic device is restarted, the relevant configuration of the startup needs to be loaded, which results in a long startup time delay, and may affect the use experience of the user. Therefore, how to accurately identify a scene in which an electronic device is not used for a long time becomes a key of the problem.
Based on this, the embodiment of the application provides a battery protection method, an electronic device and a computer readable storage medium, wherein a shutdown scene of the electronic device is firstly determined, then an on-site state of a subscriber identity module (Subscriber Identity Module, SIM) card and the electric quantity of a battery are obtained according to whether the shutdown scene is an active shutdown scene or a passive shutdown scene, and then the on-site state of the SIM card and the electric quantity of the battery are switched to a shipmode or shutdown. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the in-place state of the SIM card and the electric quantity of the battery which are respectively corresponding to the two shutdown scenes. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to the shipmode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than being switched to a shipmode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
It can be appreciated that the battery protection method provided by the embodiment of the application is not only suitable for electronic equipment and computer readable storage media, but also suitable for other products powered by a battery, such as electric automobiles, unmanned aerial vehicles and the like. The battery protection method provided by the embodiment of the application is described below by taking an electronic device as an example.
Fig. 1 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Referring to fig. 1, an electronic device 100 includes a processor 110 and a memory 120. The processor 110 may execute instructions stored in the memory 120 to cause the electronic device 100 to perform a battery protection method of an embodiment of the present application.
Processor 110 may include one or more processing units. For example, the processor 110 may include, but is not limited to, an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), an image signal processor (Image Signal Processor, ISP), a controller, a video codec, a digital signal processor (Digital Signal Processor, DSP), a baseband processor, a Neural-network processor (Neural-Network Processing Unit, NPU), and the like. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the 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 reuse instructions or data, it may be called directly from memory.
Memory 120 may include an external memory interface and an internal memory. The external memory interface may be used, among other things, to connect an external memory card, such as a Micro SD card, to extend the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface to implement data storage functions. The internal memory may be used to store computer-executable program code that includes instructions. The internal memory may include a stored program area and a stored data area. The storage program area may store an operating system, and application programs (e.g., camera, voice, map, etc.) required for at least one function, among others. The storage data area may store data (e.g., images, audio data, etc.) created by the electronic device 100 during use, and so forth. In addition, the internal memory may include a high-speed random access memory, and may also include a nonvolatile memory, such as at least one disk storage device, a flash memory device, or a universal flash memory (Universal Flash Storage, UFS), or the like. The processor 110 performs various functional applications of the electronic device 100 and data processing, such as performing the battery protection method of the embodiment of the present application, by executing instructions stored in an internal memory, and/or instructions stored in a memory provided in the processor 110.
Fig. 2 is a schematic software structure of an electronic device according to an embodiment of the present application.
Referring to fig. 2, a software system of the electronic device 100 may employ a layered architecture that divides the software into several layers, each layer having distinct roles and branches, and the layers communicate with each other through software interfaces. In the present embodiment, the software system of the electronic device 100 is divided into three layers, namely, an Application (APP) layer, a Framework (Framework) layer, and a kernel layer from top to bottom.
The APP layer includes a series of application packages. In this embodiment, the APP layer includes a battery security module 1001, and the battery security module 1001 is configured to execute the battery protection method according to the embodiment of the present application. The battery security module 1001 may be a specific application or may be a functional module in some applications, for example, the battery security module 1001 is a functional module in a "cell phone manager" application.
The Framework layer provides an application programming interface (Application Programming Interface, API) and programming Framework for the APP layer applications. In this embodiment, the Framework layer includes a shutdown module 1002, a SIM card module 1003, and a timing startup module 1004. The shutdown module 1002 is configured to perform a shutdown operation according to an instruction from the battery security module 1001. The SIM card module 1003 is configured to perform an operation of acquiring an in-place status of the SIM card according to an instruction from the battery security module 1001. The timing start module 1004 is configured to perform an operation of starting a timing start task according to an instruction from the battery security module 1001.
The kernel layer includes kernel functions for performing different functions. In this embodiment, the kernel function includes an enable_mode (enable_mode) node. The enable_shiftcode node is configured to perform a shift operation to the shiftcode according to an instruction from the battery security module 1001.
It will be appreciated that the structures shown in fig. 1 and 2 do not constitute a particular limitation of the electronic device. In other embodiments, the electronic device may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Fig. 3 is a flowchart of a battery protection method according to an embodiment of the present application.
The battery protection method is applied to an electronic device, for example, to the electronic device 100 shown in fig. 1 and 2. As shown in fig. 3, the battery protection method includes the steps of:
s301, determining a shutdown scene of the electronic device, wherein the shutdown scene comprises an active shutdown scene or a passive shutdown scene.
In this embodiment, the electronic device may confirm the active shutdown scenario by monitoring activity (activity) corresponding to shutdown. The active shutdown scenario refers to a scenario in which a shutdown procedure is started when a power key of the electronic device is triggered. For example, when a user presses a power key for a long time and clicks or touches a shutdown control, a shutdown procedure is initiated.
The electronic device may confirm the passive shutdown scenario by monitoring a timed task corresponding to shutdown. The passive shutdown scene refers to a scene in which a shutdown process is started when the electronic device is placed in silence for a long time. The silent placement refers to a state in which the electronic device is turned on and off (or off) screen is placed. For example, when the silent placement duration of the electronic device reaches a preset duration, a shutdown procedure is started. The preset duration of the timed task may be set as desired, for example, the preset duration may be set to 2 days, 3 days, 4 days, or the like.
For example, fig. 4 is a flowchart of determining a shutdown scenario of an electronic device according to an embodiment of the present application. As shown in fig. 4, in step S401, activity and timing tasks corresponding to shutdown are monitored. In step S402, in response to the power key being pressed for a long time by the activity corresponding to shutdown, and the shutdown control being clicked or touched, the shutdown procedure is started. In step S403, the shutdown scenario is confirmed to be an active shutdown scenario. In step S404, in response to the timing task corresponding to shutdown reaching the preset duration for the silence placement duration, a shutdown procedure is started. In step S405, the shutdown scenario is confirmed to be a passive shutdown scenario.
S302, acquiring the presence state of a Subscriber Identity Module (SIM) card of the electronic equipment and the electric quantity of a battery of the electronic equipment according to a shutdown scene, wherein the presence state of the SIM card comprises presence or non-presence.
In this embodiment, the electronic device may monitor the in-place status of the SIM card and the power of the battery. The embodiment of monitoring the in-place status of the SIM card and the electric quantity of the battery is not limited.
For example, the electronic device may acquire the in-place status of the SIM card by monitoring the flag corresponding to the SIM card. The sign corresponding to the SIM card is used for indicating that the in-place state of the SIM card is in place or out of place. When the corresponding mark of the SIM card is enabled, the in-place state of the SIM card is indicated to be in-place. When the corresponding mark of the SIM card is disabled, the bit state of the SIM card is not bit.
In addition, the electronic equipment can detect the electric quantity of the battery through the chip corresponding to the battery, and then acquire the electric quantity of the battery reported by the chip corresponding to the battery. The chip corresponding to the battery can be a built-in chip arranged inside the battery, or an external chip which is positioned outside the battery and connected with the battery.
S303, switching to a transportation mode or shutting down according to the in-place state of the SIM card and the electric quantity of the battery.
It is understood that the electronic device is in a state of incomplete power down when powered down, and in a state of complete power down when in a shipping mode (shipmode).
In this embodiment, the electronic device obtains the in-place state of the SIM card and the electric quantity of the battery according to whether the shutdown scene is an active shutdown scene or a passive shutdown scene, and then switches to the transportation mode or shuts down according to the in-place state of the SIM card and the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the in-place state of the SIM card and the electric quantity of the battery which are respectively corresponding to the two shutdown scenes. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to a transportation mode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than switched to a transportation mode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
In one embodiment, obtaining, according to a shutdown scenario, an in-place status of a SIM card of a user identification module of an electronic device and an electric quantity of a battery of the electronic device includes: and setting and starting a first timing startup task in response to the shutdown scene being an active shutdown scene. And responding to the startup of the electronic equipment at or before the expiration of the first timing startup task, and acquiring the in-place state of the SIM card and the electric quantity of the battery.
It can be appreciated that the timed start task is configured to start a start-up procedure when the power-off duration reaches a preset duration. The timed-on task expiration refers to the fact that the shutdown time length reaches the preset time length. The electronic device may set the timed-boot task by invoking an interface that sets the timed-boot task.
The preset duration of the first timed start task may be set as required, for example, the preset duration may be set to 1 day.
In this embodiment, when it is determined that the shutdown scenario is an active shutdown scenario, a first timed startup task is set and started. When the electronic equipment is started up at or before the expiration of the first timing startup task, the in-place state of the SIM card and the electric quantity of the battery are obtained. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the in-place state of the SIM card and the electric quantity of the battery in the active shutdown scene.
In some scenarios, when the first timing boot task is not expired, and the power key of the electronic device is triggered, and the boot process is started, the electronic device will also acquire the in-place status of the SIM card and the electric quantity of the battery.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and switching to a transportation mode in response to the in-place state of the SIM card being in place and the electric quantity of the battery being less than a first electric quantity threshold.
The first electric quantity threshold value is a preset low electric quantity threshold value. The first power threshold may be set as desired, for example, the first power threshold may be set to 5%.
In this embodiment, in the active shutdown scenario, when the in-place state of the SIM card is in place and the electric quantity of the battery is smaller than the first electric quantity threshold, the electronic device is indicated to be in a scenario that the electronic device is not used for a long time, and is switched to the transport mode at this time, so that the electronic device is completely powered off, which is favorable for avoiding the battery from being in a power-deficient state, thereby protecting the battery and prolonging the service life of the battery.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and setting a first mark for indicating that the electric quantity of the battery is acquired when the electronic equipment is started next time in response to the in-place state of the SIM card being in place and the electric quantity of the battery being greater than or equal to a first electric quantity threshold value. And (5) turning off, setting and starting a second timing startup task. And in response to powering on the electronic device at or before the expiration of the second timed power-on task, acquiring the electric quantity of the battery according to the first mark. And switching to a transport mode in response to the charge of the battery being less than the second charge threshold. Wherein the second power threshold is greater than the first power threshold.
The preset duration of the second timed starting task may be set as required, for example, the preset duration may be set to 1 day.
Further, the second power threshold is a low power threshold that is greater than the first power threshold. The second power threshold may be set as desired, for example, the second power threshold may be set to 8%. The reason why the second power threshold is greater than the first power threshold is that: compared with the scene of comparing the first electric quantity threshold value, the accumulated shutdown time length of the electronic equipment is larger in the scene of comparing the second electric quantity threshold value.
In this embodiment, in the active power-off scenario, when the on-site status of the SIM card is on-site and the electric quantity of the battery is greater than or equal to the first electric quantity threshold, it indicates that the electronic device is in a scenario where short-term unused is highly probable, and at this time, the first flag is set, power-off is performed, and the second timed power-on task is set and started. When the electronic equipment is started up at or before the expiration of the second timing startup task, the electric quantity of the battery is obtained according to the indication of the first mark. When the electric quantity of the battery is smaller than the second electric quantity threshold value, the electronic equipment is indicated to be in a scene of being unused for a long time, and the electronic equipment is switched to a transportation mode at the moment, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
It will be appreciated that the electronic device may set flags corresponding to various functions in a setting database. The flag may be represented as enable (disable) or disable (disable). In some scenarios, the logo may also be represented in other forms, such as a particular number, letter, symbol, or the like. For example, when the first flag is 1, it indicates that the battery will be charged when the electronic device is turned on next time.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and setting a second mark for indicating switching to a transportation mode when the electronic equipment is started next time in response to the in-place state of the SIM card being in place and the electric quantity of the battery being greater than or equal to a second electric quantity threshold value. And (5) turning off, setting and starting a third timing startup task. In response to the electronic device powering on at or before the expiration of the third timed-on task, switching to the transport mode according to the second flag.
The preset duration of the third timed start task may be set as required, for example, the preset duration may be set to 1 day.
Furthermore, in some scenarios, when the second flag is 2, this indicates that the electronic device will switch to the transport mode the next time it is powered on.
In this embodiment, in the active power-off scenario, when the on-site status of the SIM card is on-site and the electric quantity of the battery is greater than or equal to the second electric quantity threshold, it indicates that the electronic device is in a scenario where the electronic device is not used for a short period with a high probability, at this time, the second flag is set, and the third timing power-on task is set and started. When the electronic equipment is started before or when the third timing starting task expires, the electronic equipment is in a scene of being unused for a long time with high probability, and is directly switched to a transportation mode according to the indication of the second mark, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and switching to a transportation mode in response to the presence state of the SIM card being out of the presence state and the electric quantity of the battery being less than a third electric quantity threshold.
It will be appreciated that the probability of the electronic device being in a long-term unused scenario is greater in a scenario in which the SIM card is not in place relative to a scenario in which the SIM card is in place. Thus, the third power threshold is typically set to a low power threshold that is greater than the first power threshold. The third power threshold may be set as desired, for example, the third power threshold may be set to 10%.
In this embodiment, in the active shutdown scenario, when the in-place state of the SIM card is not in place and the electric quantity of the battery is less than the third electric quantity threshold, the electronic device is indicated to be in a scenario that the electronic device is not used for a long time, and the electronic device is switched to the transport mode at this time, so that the electronic device is completely powered off, which is favorable for avoiding the battery from being in a power-down state, thereby protecting the battery and prolonging the service life of the battery.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and setting a first mark for indicating that the electric quantity of the battery is acquired when the electronic equipment is started next time in response to the in-place state of the SIM card being out of place and the electric quantity of the battery being greater than or equal to a third electric quantity threshold value. And (5) turning off, setting and starting a second timing startup task. And in response to powering on the electronic device at or before the expiration of the second timed power-on task, acquiring the electric quantity of the battery according to the first mark. And switching to the transportation mode in response to the charge of the battery being less than the fourth charge threshold. Wherein the fourth power threshold is greater than the third power threshold.
The fourth power threshold may be set as needed, for example, the fourth power threshold may be set to 20%.
In this embodiment, in the active power-off scenario, when the in-place state of the SIM card is not in place and the electric quantity of the battery is greater than or equal to the third electric quantity threshold, it indicates that the electronic device is in a scenario where short-term unused is highly probable, and at this time, the first flag is set, power-off is performed, and the second timed power-on task is set and started. When the electronic equipment is started up at or before the expiration of the second timing startup task, the electric quantity of the battery is obtained according to the indication of the first mark. When the electric quantity of the battery is smaller than the fourth electric quantity threshold value, the electronic equipment is indicated to be in a scene of being unused for a long time in a high probability, and the electronic equipment is switched to a transportation mode at the moment, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and setting a second flag in response to the charge of the battery being greater than or equal to a fourth charge threshold, the second flag being used to indicate to switch to the transport mode the next time the electronic device is powered on. And (5) turning off, setting and starting a third timing startup task. In response to the electronic device powering on at or before the expiration of the third timed-on task, switching to the transport mode according to the second flag.
In this embodiment, in the active power-off scenario, when the in-place state of the SIM card is not in place and the electric quantity of the battery is greater than or equal to the fourth electric quantity threshold, it indicates that the electronic device is in a scenario where the electronic device is not used for a short period with a high probability, at this time, the second flag is set, and the third timing power-on task is set and started. When the electronic equipment is started before or when the third timing starting task expires, the electronic equipment is in a scene of being unused for a long time with high probability, and is directly switched to a transportation mode according to the indication of the second mark, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
In another embodiment, obtaining the in-place status of the SIM card of the electronic device and the electric quantity of the battery of the electronic device according to the shutdown scenario includes: and responding to the shutdown scene being a passive shutdown scene, and acquiring the silent placement duration of the electronic equipment. And acquiring the in-place state of the SIM card and the electric quantity of the battery in response to the silence placement duration reaching the preset duration.
It will be appreciated that the electronic device may obtain the silence placement duration through a timer. The timer is started when the electronic device enters a state in which it is off-screen (or off-screen).
In this embodiment, when it is determined that the shutdown scenario is a passive shutdown scenario, a silent placement duration of the electronic device is obtained. And when the silent placement time length reaches the preset time length, acquiring the in-place state of the SIM card and the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the in-place state of the SIM card and the electric quantity of the battery in a passive shutdown scene.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching the first preset time length, the in-place state of the SIM card being in place, the electric quantity of the battery being smaller than a fifth electric quantity threshold value, shutting down, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
The first preset time period may be set as needed, for example, the first preset time period may be set to 2 days. In addition, the fifth power threshold may be set as needed, for example, the fifth power threshold may be set to 5%. In addition, the preset duration of the fourth timed starting task may be set as required, for example, the preset duration may be set to 2 days.
In this embodiment, in the passive shutdown scenario, when the silent placement duration reaches the first preset duration and the on-site state of the SIM card is on-site, and the electric quantity of the battery is smaller than the fifth electric quantity threshold, the shutdown is performed, and the fourth timed startup task is set and started. When the electronic equipment is started before or when the fourth timing starting task expires, the electronic equipment is in a scene of being unused for a long time with high probability, and is switched to a transportation mode at the moment, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching a second preset time length, and the in-place state of the SIM card being in place, wherein the electric quantity of the battery is smaller than a sixth electric quantity threshold value, shutting down, and setting and starting a fourth timed starting task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
The second preset time period is longer than the first preset time period. The second preset time period may be set as desired, for example, the second preset time period may be set to 3 days. In addition, compared with a scene in which the silence placement duration reaches the first preset duration, the probability that the electronic equipment is in a scene which is not used for a long time is higher under the scene in which the silence placement duration reaches the second preset duration. Accordingly, the sixth power threshold is typically set to a low power threshold that is greater than the fifth power threshold. The sixth power threshold may be set as desired, for example, the sixth power threshold may be set to 8%.
In this embodiment, in the passive shutdown scenario, when the silent placement duration reaches the second preset duration and the on-site state of the SIM card is on-site, and the electric quantity of the battery is smaller than the sixth electric quantity threshold, the shutdown is performed, and the fourth timed startup task is set and started. When the electronic equipment is started before or when the fourth timing starting task expires, the electronic equipment is in a scene of being unused for a long time with high probability, and is switched to a transportation mode at the moment, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching a third preset time length, the in-place state of the SIM card being in place, the electric quantity of the battery being smaller than a seventh electric quantity threshold value, shutting down, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task. .
The third preset time period is longer than the second preset time period. The third preset time period may be set as desired, for example, the third preset time period may be set to 4 days. In addition, compared with a scene in which the silence placement duration reaches the second preset duration, the probability that the electronic equipment is in a scene which is not used for a long time is higher under the scene in which the silence placement duration reaches the third preset duration. Accordingly, the seventh power threshold is typically set to a low power threshold that is greater than the sixth power threshold. The seventh power threshold may be set as desired, for example, the seventh power threshold may be set to 10%.
In this embodiment, in the passive shutdown scenario, when the silent placement duration reaches a third preset duration and the on-site state of the SIM card is on-site, and the electric quantity of the battery is smaller than the seventh electric quantity threshold, the shutdown is performed, and a fourth timed startup task is set and started. When the electronic equipment is started before or when the fourth timing starting task expires, the electronic equipment is in a scene of being unused for a long time with high probability, and is switched to a transportation mode at the moment, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching the first preset time length, and the in-place state of the SIM card is out of place, wherein the electric quantity of the battery is smaller than an eighth electric quantity threshold value, powering off, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
Wherein the eighth power threshold is typically set to a low power threshold that is greater than the fifth power threshold. The eighth charge threshold may be set as desired, for example, the eighth charge threshold may be set to 10%.
In this embodiment, in the passive shutdown scenario, when the silent placement duration reaches the first preset duration and the on-site state of the SIM card is not on-site, and the electric quantity of the battery is less than the eighth electric quantity threshold, shutdown is performed, and a fourth timed startup task is set and started. When the electronic equipment is started before or when the fourth timing starting task expires, the electronic equipment is in a scene of being unused for a long time with high probability, and is switched to a transportation mode at the moment, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching a second preset time length, and the in-place state of the SIM card is out of place, wherein the electric quantity of the battery is smaller than a ninth electric quantity threshold value, shutting down, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
Wherein the ninth power threshold is typically set to a low power threshold that is greater than the eighth power threshold. The ninth power threshold may be set as desired, for example, the ninth power threshold may be set to 20%.
In this embodiment, in the passive shutdown scenario, when the silent placement duration reaches the second preset duration and the on-site state of the SIM card is not on-site, and the electric quantity of the battery is smaller than the ninth electric quantity threshold, shutdown is performed, and a fourth timed startup task is set and started. When the electronic equipment is started before or when the fourth timing starting task expires, the electronic equipment is in a scene of being unused for a long time with high probability, and is switched to a transportation mode at the moment, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
In another embodiment, switching to a transport mode or shutdown according to an in-place status of the SIM card and an amount of power of the battery includes: and responding to the silence placement time length reaching a third preset time length, and the in-place state of the SIM card is out of place, wherein the electric quantity of the battery is smaller than a tenth electric quantity threshold value, shutting down, and setting and starting a fourth timing startup task. The electronic device is switched to the transport mode in response to powering on at or before expiration of the fourth timed-on task.
Wherein the tenth power threshold is typically set to a low power threshold that is greater than the ninth power threshold. The tenth charge threshold may be set as desired, for example, the tenth charge threshold may be set to 30%.
In this embodiment, in the passive shutdown scenario, when the silent placement duration reaches a third preset duration and the on-site state of the SIM card is not on-site, and the electric quantity of the battery is less than the tenth electric quantity threshold, shutdown is performed, and a fourth timed startup task is set and started. When the electronic equipment is started before or when the fourth timing starting task expires, the electronic equipment is in a scene of being unused for a long time with high probability, and is switched to a transportation mode at the moment, so that the electronic equipment is completely powered off, the battery is prevented from being in a power shortage state, the battery is protected, and the service life of the battery is prolonged.
Fig. 5 is a flowchart of a battery protection method in an active shutdown scenario according to an embodiment of the present application.
The battery protection method is applied to an electronic device, for example, to the electronic device 100 shown in fig. 1 and 2. As shown in fig. 5, the battery protection method includes the steps of:
s501, setting and starting a first timing startup task in response to the shutdown scene being an active shutdown scene.
S502, responding to the startup of the electronic equipment when or before the expiration of the first timing startup task, and acquiring the in-place state of the SIM card and the electric quantity of the battery.
S503, determining whether the in-place status of the SIM card is in place.
If the in-place status of the SIM card is in-place, executing step S504; if not, step S511 is performed.
S504, determining whether the electric quantity of the battery is smaller than a first electric quantity threshold value.
If the electric quantity of the battery is smaller than the first electric quantity threshold value, executing step S505; if not, steps S506 to S508 are performed.
S505, switching to the transportation mode.
S506, a first mark is set, the machine is turned off, and a second timing startup task is set and started.
S507, in response to the electronic device being started up at or before the expiration of the second timed starting task, the electric quantity of the battery is obtained according to the first mark.
S508, determining whether the electric quantity of the battery is smaller than a second electric quantity threshold value.
If the electric quantity of the battery is smaller than the second electric quantity threshold value, executing step S505; if not, steps S509 to S510 are performed.
S509, a second flag is set, shutdown is performed, and a third timed startup task is set and started.
S510, switching to the transportation mode according to the second mark in response to the electronic device being started up at or before the expiration of the third timed starting task.
S511, it is determined whether the electric quantity of the battery is less than a third electric quantity threshold.
If the electric quantity of the battery is smaller than the third electric quantity threshold value, step S512 is executed; if not, steps S513 to S515 are performed.
S512, switching to a transportation mode.
S513, a first mark is set, the machine is turned off, and a second timing startup task is set and started.
S514, in response to the electronic device being started up at or before the expiration of the second timed starting task, the electric quantity of the battery is obtained according to the first mark.
S515, it is determined whether the battery charge is less than a fourth charge threshold.
If the electric quantity of the battery is smaller than the fourth electric quantity threshold value, step S512 is executed; if not, steps S516 to S517 are performed.
S516, a second mark is set, the machine is turned off, and a third timing startup task is set and started.
S517, switching to the transport mode according to the second flag in response to the electronic device powering on at or before the expiration of the third timed-on task.
In this embodiment, the electronic device obtains the in-place state of the SIM card and the electric quantity of the battery in the active shutdown scenario, and then switches to the transportation mode or shuts down according to the in-place state of the SIM card and the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the in-place state of the SIM card and the electric quantity of the battery in the active shutdown scene. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to a transportation mode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than switched to a transportation mode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
Fig. 6 is a flowchart of a method for protecting a battery in a passive shutdown scenario according to an embodiment of the present application.
The battery protection method is applied to an electronic device, for example, to the electronic device 100 shown in fig. 1 and 2. As shown in fig. 6, the battery protection method includes the steps of:
s601, obtaining the silent placement duration of the electronic equipment in response to the shutdown scene being a passive shutdown scene.
S602, determining whether the in-place state of the SIM card is in place.
If the in-place status of the SIM card is in-place, step S603 is executed; if not, step S608 is performed.
S603, determining whether the silence placement duration reaches a first preset duration and whether the electric quantity of the battery is smaller than a fifth electric quantity threshold.
If the silence placement duration reaches the first preset duration and the electric quantity of the battery is smaller than the fifth electric quantity threshold, executing steps S604 to S605; if not, step S606 is performed.
S604, turning off, setting and starting a fourth timing startup task.
S605, in response to the electronic device powering on at or before the expiration of the fourth timed-on task, switches to the transport mode.
S606, determining whether the silence placement duration reaches a second preset duration and whether the electric quantity of the battery is smaller than a sixth electric quantity threshold.
If the silence placement duration reaches the second preset duration and the electric quantity of the battery is smaller than the sixth electric quantity threshold, executing steps S604 to S605; if not, step S607 is performed.
S607, determining whether the silence placing duration reaches a third preset duration and whether the electric quantity of the battery is less than a seventh electric quantity threshold.
If the silent placing duration reaches the third preset duration and the electric quantity of the battery is smaller than the seventh electric quantity threshold, executing steps S604 to S605; if not, the process returns to step S603.
S608, determining whether the silence placement duration reaches a first preset duration, and whether the electric quantity of the battery is less than an eighth electric quantity threshold.
If the silent placement duration reaches the first preset duration and the electric quantity of the battery is smaller than the eighth electric quantity threshold, executing steps S609 to S610; if not, step S611 is performed.
S609, turning off, setting and starting a fourth timing startup task.
S610, switching to the transport mode in response to the electronic device powering on at or before expiration of the fourth timed power-on task.
S611, determining whether the silence placement duration reaches a second preset duration and whether the electric quantity of the battery is smaller than a ninth electric quantity threshold.
If the silent placing duration reaches the second preset duration and the electric quantity of the battery is smaller than the ninth electric quantity threshold, executing steps S609 to S610; if not, step S612 is performed.
S612, determining whether the silence placement duration reaches a third preset duration and whether the electric quantity of the battery is smaller than a tenth electric quantity threshold.
If the silence placement duration reaches the third preset duration and the electric quantity of the battery is smaller than the tenth electric quantity threshold, executing steps S609 to S610; if not, the process returns to step S608.
In this embodiment, the electronic device obtains the silent placement duration, the on-site state of the SIM card, and the electric quantity of the battery in the passive shutdown scenario, and switches to the transport mode or shutdown according to the silent placement duration, the on-site state of the SIM card, and the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or a short-term unused scene can be effectively distinguished according to the silent placement time, the in-place state of the SIM card and the electric quantity of the battery in the passive shutdown scene. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to a transportation mode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than switched to a transportation mode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
Fig. 7 is an interaction diagram of a battery protection method in a scenario where an active shutdown and an SIM card is in place according to an embodiment of the present application.
The battery protection method is applied to an electronic device, for example, to the electronic device 100 shown in fig. 1 and 2. As shown in fig. 7, the battery protection method includes the steps of:
s701, the battery safety module of the application program layer responds to the shutdown scene as an active shutdown scene and sends a first timing startup task instruction to the timing startup module of the frame layer.
S702, the timing starting module responds to the instruction of the first timing starting task to set and start the first timing starting task.
S703, the battery safety module responds to the electronic device being started up at or before the expiration of the first timing startup task to acquire the electric quantity of the battery.
S704, the battery security module sends an instruction for inquiring the in-place state of the SIM card to the SIM card module of the framework layer.
S705, the SIM card module responds to the instruction for inquiring the presence state of the SIM card, and inquires the presence state of the SIM card.
S706, the SIM card module sends a message of the in-place state of the SIM card to the battery safety module.
S707, the battery security module determines whether the in-place status of the SIM card is in place according to the message of the in-place status of the SIM card.
S708, the battery security module determines whether the battery charge is less than the first charge threshold in response to the SIM card being in place.
S709, the battery security module sends an instruction to switch to the transportation mode to the kernel layer in response to the battery power being less than the first power threshold.
S710, the kernel layer responds to the instruction for switching to the transportation mode and enables the transportation mode node to switch to the transportation mode by calling.
S711, the battery safety module sets a first flag in response to the charge of the battery being greater than or equal to a first charge threshold.
S712, the battery safety module sends a shutdown instruction to the shutdown module of the frame layer.
S713, the battery security module sends an instruction of the second timed start task to the timed start module.
S714, the shutdown module responds to the shutdown instruction and shuts down.
S715, the timing starting module responds to the instruction of the second timing starting task to set and start the second timing starting task.
And S716, the battery safety module responds to the startup of the electronic equipment when or before the second timing startup task expires, and acquires the electric quantity of the battery according to the first sign.
And S717, the battery safety module transmits an instruction for switching to the transportation mode to the kernel layer in response to the electric quantity of the battery being smaller than the second electric quantity threshold.
S718, the kernel layer responds to the instruction for switching to the transport mode by calling the transport mode enabling node to switch to the transport mode.
S719, the battery security module sets a second flag in response to the charge of the battery being greater than or equal to a second charge threshold.
S720, the battery safety module sends a shutdown instruction to the shutdown module.
S721, the battery security module sends an instruction of the third timed start task to the timed start module.
S722, the shutdown module responds to the shutdown instruction and shuts down.
S723, the timing starting module responds to the instruction of the third timing starting task to set and start the third timing starting task.
S724, the battery security module sends an instruction to switch to the transport mode to the kernel layer according to the second flag in response to the electronic device powering on at or before the expiration of the third timed-on task.
S725, the kernel layer responds to the instruction for switching to the transportation mode by calling the transportation mode enabling node to switch to the transportation mode.
In this embodiment, the electronic device obtains the electric quantity of the battery in the scene of active shutdown and in-place of the SIM card, and then switches to the transportation mode or shutdown according to the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the electric quantity of the battery under the scenes that the electronic equipment is actively powered off and the SIM card is in place. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to a transportation mode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than switched to a transportation mode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
Fig. 8 is an interaction diagram of a battery protection method in a scenario in which an active shutdown is provided and a SIM card is not in place according to an embodiment of the present application.
The battery protection method is applied to an electronic device, for example, to the electronic device 100 shown in fig. 1 and 2. As shown in fig. 8, the battery protection method includes the steps of:
s801, the battery safety module of the application program layer responds to the shutdown scene as an active shutdown scene and sends a first timing startup task instruction to the timing startup module of the framework layer.
S802, the timing starting module responds to the instruction of the first timing starting task to set and start the first timing starting task.
S803, the battery safety module responds to the electronic equipment starting up when or before the first timing starting up task expires, and acquires the electric quantity of the battery.
S804, the battery safety module sends an instruction for inquiring the in-place state of the SIM card to the SIM card module of the framework layer.
S805, the SIM card module inquires the presence state of the SIM card in response to the instruction for inquiring the presence state of the SIM card.
S806, the SIM card module sends a message of the on-bit status of the SIM card to the battery security module.
S807, the battery security module determines whether the in-place status of the SIM card is in place according to the message of the in-place status of the SIM card.
S808, the battery security module determines whether the battery charge is less than the third charge threshold in response to the SIM card being out of place.
S809, the battery safety module responds to the fact that the electric quantity of the battery is smaller than a third electric quantity threshold value, and sends an instruction for switching to the transportation mode to the kernel layer.
S810, the kernel layer responds to an instruction for switching to the transportation mode and enables the transportation mode node to switch to the transportation mode through calling.
S811, the battery safety module sets a first flag in response to the charge of the battery being greater than or equal to a third charge threshold.
S812, the battery safety module sends a shutdown instruction to a shutdown module of the framework layer.
S813, the battery safety module sends a command of the second timing startup task to the timing startup module.
S814, the shutdown module responds to the shutdown instruction to shutdown.
S815, the timing starting module responds to the instruction of the second timing starting task to set and start the second timing starting task.
The battery security module obtains the charge of the battery according to the first flag in response to the electronic device powering on at or before the expiration of the second timed power-on task S816.
And S817, the battery safety module responds to the fact that the electric quantity of the battery is smaller than a fourth electric quantity threshold value, and sends an instruction for switching to the transportation mode to the kernel layer.
S818, the kernel layer responds to the instruction for switching to the transportation mode and enables the transportation mode node to switch to the transportation mode through calling.
The battery security module sets a second flag in response to the charge of the battery being greater than or equal to the fourth charge threshold, S819.
S820, the battery safety module sends a shutdown instruction to the shutdown module.
S821, the battery safety module sends a third timing startup task instruction to the timing startup module.
S822, the shutdown module responds to a shutdown instruction and shuts down.
S823, setting and starting a third timing starting task by the timing starting module in response to the instruction of the third timing starting task.
S824, the battery security module sends an instruction to switch to the transport mode to the kernel layer according to the second flag in response to the electronic device powering on at or before the expiration of the third timed-on task.
S825, the kernel layer responds to the instruction for switching to the transportation mode by calling the transportation mode node to be started to switch to the transportation mode.
In this embodiment, the electronic device obtains the electric quantity of the battery in the scene that the electronic device is actively powered off and the SIM card is not in place, and then switches to the transportation mode or powered off according to the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the electric quantity of the battery under the scene that the electronic equipment is actively powered off and the SIM card is not in place. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to a transportation mode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than switched to a transportation mode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
Fig. 9 is an interaction diagram of a battery protection method in a situation that a passive shutdown and a SIM card are in place according to an embodiment of the present application.
The battery protection method is applied to an electronic device, for example, to the electronic device 100 shown in fig. 1 and 2. As shown in fig. 9, the battery protection method includes the steps of:
s901, the battery safety module of the application program layer responds to the shutdown scene as a passive shutdown scene to acquire the silent placement duration of the electronic equipment.
S902, the battery security module sends an instruction for inquiring the in-place state of the SIM card to the SIM card module of the framework layer.
S903, the SIM card module responds to the instruction for inquiring the presence state of the SIM card, and inquires the presence state of the SIM card.
S904, the SIM card module sends a message of the in-place state of the SIM card to the battery safety module.
S905, the battery security module determines whether the in-place state of the SIM card is in place according to the message of the in-place state of the SIM card.
S906, the battery safety module determines whether the silent placement duration reaches a first preset duration and whether the electric quantity of the battery is smaller than a fifth electric quantity threshold value according to the on-site state of the SIM card.
S907, the battery safety module responds to the silence placement time to reach a first preset time, the electric quantity of the battery is smaller than a fifth electric quantity threshold value, and a shutdown instruction is sent to a shutdown module of the frame layer.
S908, the battery safety module sends a fourth instruction of the timing startup task to the timing startup module of the frame layer.
S909, the shutdown module responds to the shutdown instruction and shuts down.
S910, the timing starting module responds to the instruction of the fourth timing starting task to set and start the fourth timing starting task.
S911 the battery security module sends an instruction to the kernel layer to switch to the transport mode in response to the electronic device powering on at or before the expiration of the fourth timed power-on task.
S912, the kernel layer switches to the transport mode by invoking the transport mode enabled node in response to the instruction to switch to the transport mode.
And S913, the battery safety module determines whether the silent placement duration reaches the second preset duration and the electric quantity of the battery is smaller than a sixth electric quantity threshold in response to the silent placement duration not reaching the first preset duration or the electric quantity of the battery is larger than or equal to the fifth electric quantity threshold.
S914, the battery safety module responds to the silence placement time to reach a second preset time, the electric quantity of the battery is smaller than a sixth electric quantity threshold value, and a shutdown instruction is sent to the shutdown module.
S915, the battery safety module sends an instruction of the fourth timing startup task to the timing startup module.
S916, the shutdown module responds to the shutdown instruction and shuts down.
S917, the timing starting module responds to the instruction of the fourth timing starting task to set and start the fourth timing starting task.
S918, the battery security module sends an instruction to switch to the transport mode to the kernel layer in response to the electronic device powering on at or before the expiration of the fourth timed power-on task.
At S919, the kernel layer switches to the transport mode by invoking the enable transport mode node in response to the instruction to switch to the transport mode.
And S920, the battery safety module determines whether the silent placement duration reaches a third preset duration and whether the electric quantity of the battery is smaller than a seventh electric quantity threshold in response to the silent placement duration not reaching the second preset duration or the electric quantity of the battery is larger than or equal to the sixth electric quantity threshold.
S921, the battery safety module responds to the silence placement time to reach a third preset time, and the electric quantity of the battery is smaller than a seventh electric quantity threshold value, and sends a shutdown instruction to the shutdown module.
S922, the battery safety module sends a fourth timing startup task instruction to the timing startup module.
S923, the shutdown module responds to the shutdown instruction and shuts down.
S924, the timing starting module responds to the instruction of the fourth timing starting task to set and start the fourth timing starting task.
S925, the battery security module sends an instruction to switch to the transport mode to the kernel layer in response to the electronic device powering on at or before the expiration of the fourth timed power-on task.
In response to the instruction to switch to the transport mode, the kernel layer switches to the transport mode by invoking the transport mode enabled node S926.
In this embodiment, the electronic device obtains the silent placement duration and the electric quantity of the battery in the passive shutdown and in-place SIM card scene, and switches to the transport mode or shutdown according to the silent placement duration and the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the silent placement duration and the electric quantity of the battery under the scenes that the electronic equipment is powered off passively and the SIM card is in place. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to a transportation mode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than switched to a transportation mode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
Fig. 10 is an interactive diagram of a battery protection method in a scenario where the battery is powered off passively and the SIM card is not in place according to an embodiment of the present application.
The battery protection method is applied to an electronic device, for example, to the electronic device 100 shown in fig. 1 and 2. As shown in fig. 10, the battery protection method includes the steps of:
s1001, the battery safety module of the application program layer responds to the shutdown scene as a passive shutdown scene to acquire the silent placement duration of the electronic equipment.
S1002, the battery safety module sends an instruction for inquiring the in-place state of the SIM card to the SIM card module of the framework layer.
S1003, the SIM card module inquires the presence state of the SIM card in response to the instruction for inquiring the presence state of the SIM card.
S1004, the SIM card module sends a message of the in-place state of the SIM card to the battery safety module.
S1005, the battery safety module determines whether the in-place state of the SIM card is in place according to the message of the in-place state of the SIM card.
S1006, the battery safety module determines whether the silent placement duration reaches a first preset duration and whether the electric quantity of the battery is smaller than an eighth electric quantity threshold value in response to the in-place state of the SIM card being out of place.
S1007, the battery safety module responds to the silence placement time to reach a first preset time, the electric quantity of the battery is smaller than an eighth electric quantity threshold value, and a shutdown instruction is sent to a shutdown module of the frame layer.
S1008, the battery safety module sends a fourth timing startup task instruction to the timing startup module of the frame layer.
S1009, the shutdown module responds to the shutdown instruction and shuts down.
S1010, the timing starting module responds to the instruction of the fourth timing starting task to set and start the fourth timing starting task.
S1011, the battery security module sends an instruction to switch to the transport mode to the kernel layer in response to the electronic device powering on at or before the expiration of the fourth timed power-on task.
S1012, the kernel layer responds to the instruction for switching to the transportation mode and enables the transportation mode node to switch to the transportation mode through calling.
In S1013, the battery safety module determines whether the silence placement duration reaches the second preset duration and the electric quantity of the battery is less than the ninth electric quantity threshold in response to the silence placement duration not reaching the first preset duration or the electric quantity of the battery is greater than or equal to the eighth electric quantity threshold.
S1014, the battery safety module responds to the silence placement time to reach a second preset time, and the electric quantity of the battery is smaller than a ninth electric quantity threshold value, and sends a shutdown instruction to the shutdown module.
S1015, the battery safety module sends a fourth timing startup task instruction to the timing startup module.
S1016, the shutdown module responds to the shutdown instruction and shuts down.
S1017, the timing starting module responds to the instruction of the fourth timing starting task to set and start the fourth timing starting task.
S1018, the battery security module sends an instruction to switch to the transport mode to the kernel layer in response to the electronic device powering on at or before the expiration of the fourth timed power-on task.
S1019, the kernel layer responds to the instruction for switching to the transportation mode and enables the transportation mode node to switch to the transportation mode by calling.
And S1020, the battery safety module determines whether the silent placement duration reaches a third preset duration and whether the electric quantity of the battery is smaller than a tenth electric quantity threshold or not in response to the silent placement duration not reaching the second preset duration or the electric quantity of the battery is larger than or equal to the ninth electric quantity threshold.
S1021, the battery safety module responds to the silence placement time to reach a third preset time, the electric quantity of the battery is smaller than a tenth electric quantity threshold value, and a shutdown instruction is sent to the shutdown module.
S1022, the battery safety module sends a fourth timing startup task instruction to the timing startup module.
S1023, the shutdown module responds to a shutdown instruction and shuts down.
S1024, the timing starting module responds to the instruction of the fourth timing starting task to set and start the fourth timing starting task.
S1025, the battery security module sends an instruction to switch to the transport mode to the kernel layer in response to the electronic device powering on at or before the expiration of the fourth timed power-on task.
S1026, the kernel layer responds to the instruction for switching to the transportation mode and enables the transportation mode node to switch to the transportation mode by calling.
In this embodiment, the electronic device obtains the silent placement duration and the electric quantity of the battery in a passive shutdown and in a situation where the SIM card is not in place, and then switches to a transport mode or shutdown according to the silent placement duration and the electric quantity of the battery. Therefore, whether the electronic equipment is in a long-term unused scene or in a short-term unused scene can be effectively distinguished according to the silent placement duration and the electric quantity of the battery under the scene that the passive shutdown is carried out and the SIM card is not in place. When the electronic equipment is determined to be in a long-term unused scene, the electronic equipment is controlled to be switched to a transportation mode, so that the electronic equipment is completely powered off, and the battery is prevented from being in a power shortage state, so that the battery is protected and the service life of the battery is prolonged. When the electronic equipment is determined to be in a short-term unused scene, the electronic equipment is controlled to be powered off, rather than switched to a transportation mode, so that the electronic equipment can be quickly started when being restarted, and the use experience of a user is not affected.
Fig. 11 is a schematic structural view of a battery protection device according to an embodiment of the present application.
The battery protection device may be an electronic device or may be a component inside the electronic device. Referring to fig. 11, the battery protection device 200 includes a shutdown scenario determination module 210, a SIM card in-place status monitoring module 220, a battery level monitoring module 230, and a switching module 240.
The shutdown scenario determination module 210 is configured to determine a shutdown scenario of the electronic device, where the shutdown scenario includes an active shutdown scenario or a passive shutdown scenario.
The SIM card presence status monitoring module 220 is configured to obtain, according to a shutdown scenario, a presence status of a SIM card of the electronic device, where the presence status of the SIM card includes presence or non-presence.
The battery power monitoring module 230 is configured to obtain the power of the battery of the electronic device according to the shutdown scenario.
The switching module 240 is configured to switch to a transport mode or to switch off according to an in-place status of the SIM card and an amount of power of the battery.
It will be appreciated that the above-described division of modules into a logical function division may be implemented in other ways. In addition, each functional module in each embodiment of the present application may be integrated in the same processing unit, or each module may exist alone physically, or two or more modules may be integrated in the same processing unit. The integrated modules may be implemented in hardware or in hardware plus software functional modules.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores instructions, which when run on a computer, cause the computer to execute the battery protection method of the embodiment of the application.
Computer-readable storage media include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer-readable storage media includes, but is not limited to, random access Memory (Random Access Memory, RAM), read-Only Memory (ROM), electrically-charged erasable programmable Read-Only Memory (EEPROM), flash Memory or other Memory, compact disk Read-Only Memory (CD-ROM), digital versatile disks (Digital Versatile Disc, DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer.
The embodiments of the present application have been described in detail with reference to the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge of one of ordinary skill in the art without departing from the spirit of the present application.
Claims (15)
1. A battery protection method applied to an electronic device, the method comprising:
determining a shutdown scene of the electronic equipment, wherein the shutdown scene comprises an active shutdown scene or a passive shutdown scene;
setting and starting a first timing startup task in response to the shutdown scene being the active shutdown scene;
responding to the starting of the electronic equipment when or before the expiration of the first timing starting task, and acquiring the in-place state of a Subscriber Identity Module (SIM) card of the electronic equipment and the electric quantity of a battery of the electronic equipment, wherein the in-place state of the SIM card comprises in-place or out-of-place;
and switching to a transportation mode in response to the in-place state of the SIM card being in place and the electric quantity of the battery being less than a first electric quantity threshold.
2. The battery protection method of claim 1, wherein the method further comprises:
setting a first mark for indicating that the electric quantity of the battery is acquired when the electronic equipment is started next time, wherein the electric quantity of the battery is larger than or equal to the first electric quantity threshold value in response to the in-place state of the SIM card;
powering off, setting and starting a second timing startup task;
Responding to the starting of the electronic equipment when or before the expiration of the second timed starting task, and acquiring the electric quantity of the battery according to the first mark;
switching to the transportation mode in response to the charge of the battery being less than a second charge threshold; wherein the second power threshold is greater than the first power threshold.
3. The battery protection method of claim 1, wherein the method further comprises:
setting a second flag to indicate switching to the transportation mode when the electronic device is powered on next time in response to the in-place status of the SIM card being in place and the power of the battery being greater than or equal to a second power threshold;
powering off, setting and starting a third timing startup task;
and switching to the transportation mode according to the second flag in response to the electronic device being powered on at or before the expiration of the third timed-on task.
4. The battery protection method of claim 1, wherein the method further comprises:
and switching to the transportation mode in response to the presence state of the SIM card being out of place and the electric quantity of the battery being less than a third electric quantity threshold.
5. The battery protection method of claim 1, wherein the method further comprises:
setting a first mark for indicating that the electric quantity of the battery is acquired when the electronic equipment is started next time, wherein the in-place state of the SIM card is not in place and the electric quantity of the battery is larger than or equal to a third electric quantity threshold value;
powering off, setting and starting a second timing startup task;
responding to the starting of the electronic equipment when or before the expiration of the second timed starting task, and acquiring the electric quantity of the battery according to the first mark;
switching to the transportation mode in response to the charge of the battery being less than a fourth charge threshold; wherein the fourth power threshold is greater than the third power threshold.
6. The battery protection method of claim 1, wherein the method further comprises:
setting a second flag for indicating to switch to the transportation mode when the electronic device is next powered on in response to the charge of the battery being greater than or equal to a fourth charge threshold;
powering off, setting and starting a third timing startup task;
and switching to the transportation mode according to the second flag in response to the electronic device being powered on at or before the expiration of the third timed-on task.
7. The battery protection method of claim 1, wherein the method further comprises:
responding to the shutdown scene as the passive shutdown scene, and acquiring the silent placement duration of the electronic equipment;
and acquiring the in-place state of the SIM card and the electric quantity of the battery in response to the silent placement duration reaching a preset duration.
8. The battery protection method of claim 7, wherein the method further comprises:
responding to the silence placement duration reaching a first preset duration, and the in-place state of the SIM card being in place, wherein the electric quantity of the battery is smaller than a fifth electric quantity threshold value, powering off, and setting and starting a fourth timing startup task;
switching to the transport mode in response to the electronic device powering on at or before expiration of the fourth timed-on task.
9. The battery protection method of claim 7, wherein the method further comprises:
responding to the silence placement duration reaching a second preset duration, and the in-place state of the SIM card being in place, wherein the electric quantity of the battery is smaller than a sixth electric quantity threshold value, powering off, and setting and starting a fourth timing startup task;
Switching to the transport mode in response to the electronic device powering on at or before expiration of the fourth timed-on task.
10. The battery protection method of claim 7, wherein the method further comprises:
responding to the silence placement duration reaching a third preset duration, and the in-place state of the SIM card being in place, wherein the electric quantity of the battery is smaller than a seventh electric quantity threshold value, powering off, and setting and starting a fourth timing startup task;
switching to the transport mode in response to the electronic device powering on at or before expiration of the fourth timed-on task.
11. The battery protection method of claim 7, wherein the method further comprises:
responding to the silence placement duration reaching a first preset duration, and the in-place state of the SIM card being unoccupied, wherein the electric quantity of the battery is smaller than an eighth electric quantity threshold value, powering off, and setting and starting a fourth timing startup task;
switching to the transport mode in response to the electronic device powering on at or before expiration of the fourth timed-on task.
12. The battery protection method of claim 7, wherein the method further comprises:
Responding to the silence placement duration reaching a second preset duration, and the in-place state of the SIM card being unoccupied, wherein the electric quantity of the battery is smaller than a ninth electric quantity threshold, shutting down, and setting and starting a fourth timing startup task;
switching to the transport mode in response to the electronic device powering on at or before expiration of the fourth timed-on task.
13. The battery protection method of claim 7, wherein the method further comprises:
responding to the silence placement duration reaching a third preset duration, and the in-place state of the SIM card being unoccupied, wherein the electric quantity of the battery is smaller than a tenth electric quantity threshold, powering off, and setting and starting a fourth timing startup task;
switching to the transport mode in response to the electronic device powering on at or before expiration of the fourth timed-on task.
14. An electronic device comprising a memory for storing instructions and a processor for executing the instructions stored in the memory, causing the electronic device to perform the battery protection method of any one of claims 1 to 13.
15. A computer readable storage medium storing instructions which, when run on a computer, cause the computer to perform the battery protection method of any one of claims 1 to 13.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310814490.8A CN116526640B (en) | 2023-07-05 | 2023-07-05 | Battery protection method, electronic device, and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310814490.8A CN116526640B (en) | 2023-07-05 | 2023-07-05 | Battery protection method, electronic device, and computer-readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116526640A CN116526640A (en) | 2023-08-01 |
CN116526640B true CN116526640B (en) | 2023-10-20 |
Family
ID=87390758
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310814490.8A Active CN116526640B (en) | 2023-07-05 | 2023-07-05 | Battery protection method, electronic device, and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116526640B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103856620A (en) * | 2012-12-06 | 2014-06-11 | 华为终端有限公司 | Method and device for controlling terminal to close down |
CN105657800A (en) * | 2015-12-28 | 2016-06-08 | 宇龙计算机通信科技(深圳)有限公司 | Power saving method and device of mobile terminal |
EP3037913A1 (en) * | 2013-08-22 | 2016-06-29 | Samsung Electronics Co., Ltd. | Method for performing power-saving mode in electronic device and electronic device therefor |
CN111009698A (en) * | 2019-12-23 | 2020-04-14 | 联想(北京)有限公司 | Information processing method and electronic equipment |
CN112540304A (en) * | 2020-11-19 | 2021-03-23 | Oppo广东移动通信有限公司 | Battery power management method, electronic device and computer storage medium |
CN114615656A (en) * | 2022-04-11 | 2022-06-10 | 西安广和通无线软件有限公司 | Method, system and related device for managing eSIM card in electronic equipment |
WO2022134949A1 (en) * | 2020-12-21 | 2022-06-30 | 展讯通信(上海)有限公司 | Power calibration method and apparatus, and electronic device |
-
2023
- 2023-07-05 CN CN202310814490.8A patent/CN116526640B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103856620A (en) * | 2012-12-06 | 2014-06-11 | 华为终端有限公司 | Method and device for controlling terminal to close down |
EP3037913A1 (en) * | 2013-08-22 | 2016-06-29 | Samsung Electronics Co., Ltd. | Method for performing power-saving mode in electronic device and electronic device therefor |
CN105657800A (en) * | 2015-12-28 | 2016-06-08 | 宇龙计算机通信科技(深圳)有限公司 | Power saving method and device of mobile terminal |
CN111009698A (en) * | 2019-12-23 | 2020-04-14 | 联想(北京)有限公司 | Information processing method and electronic equipment |
CN112540304A (en) * | 2020-11-19 | 2021-03-23 | Oppo广东移动通信有限公司 | Battery power management method, electronic device and computer storage medium |
WO2022134949A1 (en) * | 2020-12-21 | 2022-06-30 | 展讯通信(上海)有限公司 | Power calibration method and apparatus, and electronic device |
CN114615656A (en) * | 2022-04-11 | 2022-06-10 | 西安广和通无线软件有限公司 | Method, system and related device for managing eSIM card in electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN116526640A (en) | 2023-08-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9639256B2 (en) | Method for starting activity of mobile terminal and the mobile terminal | |
CN114945028B (en) | Information processing method based on Internet of things equipment, related equipment and storage medium | |
US11132766B2 (en) | Image processing method and device using multiple layers of an operating system | |
CN103500111A (en) | Information configuration method and device based on zookeeper | |
CN103838648A (en) | Terminal and data backup method | |
CN105045637A (en) | Application start method and terminal | |
CN104346264A (en) | System and method for processing system event logs | |
CN107831887B (en) | Application starting method and device | |
CN112860322B (en) | Operating system switching method, device, equipment and storage medium | |
CN104714861A (en) | Scene recovery data saving method and application running method, device and system | |
CN116526640B (en) | Battery protection method, electronic device, and computer-readable storage medium | |
CN111580769A (en) | Display control system, method, device, storage medium and processor | |
CN114121131A (en) | External flash self-adaption method, device, equipment and medium | |
CN104503674A (en) | Screenshot picture generating method | |
CN114296646A (en) | Caching method, device, server and storage medium based on IO service | |
US9596131B2 (en) | Method for transiting operation mode of routing processor | |
US10705981B2 (en) | Method and apparatus for data storage service | |
CN113688343A (en) | Page permission control method, device, equipment and readable storage medium | |
CN105808299A (en) | External device automatic mounting and informing control method and system | |
CN105282327A (en) | Control method, electronic device and external device | |
CN113412480B (en) | Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium | |
US20190324518A1 (en) | Method for operating a device having a switchable power saving mode for reducing its power consumption | |
CN108829455A (en) | A kind of device identification acquisition methods, device and equipment | |
CN113885969A (en) | Embedded device, embedded software loading method and storage medium | |
CN111464395B (en) | Method and device for creating blockchain and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |