Control method of electronic device, electronic device, and computer-readable storage medium

By determining the battery's maximum load and power consumption information in adapter-powered mode, and promptly disconnecting the target load, the system failure problem caused by the adapter suddenly stopping power supply was solved, achieving stable operation when powered by battery and reducing the system failure rate.

CN116191609BActive Publication Date: 2026-04-24GOERTEK INC
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GOERTEK INC
Filing Date
2023-02-20
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

When the adapter suddenly stops supplying power, the battery cannot immediately deliver enough power to the device, causing system failures such as device crashes or malfunctions.

Method used

In adapter power supply mode, determine the maximum load corresponding to the current battery charge, obtain the power consumption information of each load, determine the target load based on the power consumption information and the maximum load, and control the target load to disconnect from the battery when the adapter power is detected to be cut off.

Benefits of technology

By promptly disconnecting the target load from the battery, it is ensured that the battery can provide sufficient load when switching to power supply, maintaining the normal operation of the load that is not disconnected, and reducing the system failure rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116191609B_ABST
    Figure CN116191609B_ABST
Patent Text Reader

Abstract

The application discloses a kind of electronic equipment control method, electronic equipment and computer readable storage medium, wherein the method comprises: in adapter power supply mode, the minimum load corresponding to the current power of battery is determined;Obtain the power consumption information corresponding to each load in the electronic equipment at the current time;Determine target load based on the power consumption information and the minimum load;When detecting that adapter power is cut off, the target load is disconnected with the battery.The present application aims to reduce the system failure rate of electronic equipment when adapter switches to battery power supply.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power supply for devices, and more particularly to a control method for electronic devices, electronic devices, and computer-readable storage media. Background Technology

[0002] Most smart devices offer two power sources: a rechargeable battery and an adapter plugged into an outlet. Adapters can provide higher voltage, allowing for heavier device loads. However, when the adapter suddenly stops supplying power and the device switches to battery power, the battery cannot immediately deliver enough charge. The device experiences a sudden drop in power, making it unable to sustain the heavier load previously supported by the adapter, leading to system malfunctions such as crashes or abnormal operation.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this invention is to provide a control method for an electronic device, an electronic device, and a computer-readable storage medium, with the aim of reducing the system failure rate.

[0005] To achieve the above objectives, the present invention provides a power switching method, the method comprising:

[0006] In adapter power supply mode, determine the maximum load corresponding to the current battery charge;

[0007] Obtain the power consumption information of each load in the electronic device at the current moment;

[0008] The target load is determined based on the power consumption information and the maximum load.

[0009] When the adapter power is detected to be cut off, the target load is disconnected from the battery.

[0010] Optionally, after the step of disconnecting the target load from the battery, the method further includes:

[0011] Determine the power supply status of the battery;

[0012] When the power supply status is normal, control the target load to establish a connection with the battery.

[0013] Optionally, the step of determining the maximum load corresponding to the current battery charge includes:

[0014] Obtain the voltage change value associated with the current power level;

[0015] The output voltage that the battery can provide is determined based on the current power supply voltage of the adapter and the voltage change value;

[0016] The maximum load is determined based on the output voltage.

[0017] Optionally, before the step of obtaining the voltage change value associated with the current power consumption, the method further includes:

[0018] The output voltage of the battery at multiple different charge levels is collected when the electronic device is under full load and switches from adapter power mode to battery power mode.

[0019] Based on the power supply voltage and the output voltage of the adapter, determine the voltage change value corresponding to the amount of electricity;

[0020] Each of the stated electrical quantities and its corresponding voltage change value are associated and stored.

[0021] Optionally, the step of determining the target load based on the power consumption information and the maximum load includes:

[0022] Determine the total power consumption of the electronic device at the current moment based on the power consumption information;

[0023] The target load is determined based on the difference between the maximum load and the sum of the power consumption.

[0024] Optionally, before the step of determining the target load based on the difference between the maximum load and the total power consumption, the method further includes:

[0025] The priority of each load is determined based on its usage frequency, operating status, and / or power consumption information.

[0026] Based on the priority, at least one of the loads is selected as the target load, wherein the total power consumption of the target loads is greater than or equal to the difference.

[0027] Optionally, the step of selecting at least one of the loads as the target load based on the priority includes:

[0028] The loads are sorted according to the priority.

[0029] Calculate the total power consumption of a preset number of loads;

[0030] When the total power consumption is greater than or equal to the difference, the first preset number of loads will be used as the target load;

[0031] When the total power consumption is less than the difference, the value of the preset number is increased, and the step of calculating the total power consumption of the preset number of loads before the calculation is repeated.

[0032] In addition, to achieve the above objectives, the present invention also provides an electronic device, the electronic device including a memory, a processor, and a power switching program stored in the memory and executable on the processor, wherein the power switching program, when executed by the processor, implements the steps of the power switching method as described above.

[0033] Optionally, the electronic device includes a battery and multiple load units, and a detection and control module is provided between the battery and each load unit. The detection and control module is used to acquire power consumption information of each load unit and control the connection status between the load unit and the battery.

[0034] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a power switching program, which, when executed by a processor, implements the steps of the power switching method as described above.

[0035] This invention discloses a control method for an electronic device, an electronic device, and a computer-readable storage medium. First, in adapter-powered mode, the minimum load corresponding to the current battery charge is determined. Then, power consumption information for each load in the electronic device at the current moment is acquired. Based on the power consumption information and the minimum load, a target load is determined. When adapter power is detected to be cut off, the target load is disconnected from the battery. By determining the current minimum battery load and the power consumption information of each load in the electronic device, the target load that needs to be disconnected when switching to battery power is achieved can be determined. This allows for timely disconnection of the target load from the battery when adapter power is detected to be cut off, ensuring that the battery can provide sufficient load to maintain the normal operation of the connected loads when switching to battery power, thereby reducing the system failure rate. Attached Figure Description

[0036] Figure 1 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of the present invention;

[0037] Figure 2 This is a flowchart illustrating an embodiment of the power switching method of the present invention;

[0038] Figure 3 This is a flowchart illustrating another embodiment of the power switching method of the present invention;

[0039] Figure 4 This is a schematic diagram of the electronic device structure involved in an embodiment of the present invention.

[0040] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0041] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0042] In related technologies, when the adapter suddenly stops supplying power and switches to battery power, the battery cannot immediately deliver enough power to the device. The power available to the device drops instantly, making it unable to maintain the large load previously maintained by the adapter, leading to system failures such as device crashes and malfunctions.

[0043] To reduce the failure rate of electronic device systems, embodiments of the present invention propose a control method for an electronic device, an electronic device, and a computer-readable storage medium, wherein the main steps of the method include:

[0044] In adapter power supply mode, determine the maximum load corresponding to the current battery charge;

[0045] Obtain the power consumption information of each load in the electronic device at the current moment;

[0046] The target load is determined based on the power consumption information and the maximum load.

[0047] When an adapter power failure is detected, the target load is disconnected from the battery. This is achieved by determining the current minimum battery load and the power consumption information of each load in the electronic device. Furthermore, it determines the target load that needs to be powered down when switching to battery power after an adapter power failure. By promptly disconnecting loads that the battery cannot handle upon detecting an adapter power failure, the system maintains the normal operation of the connected loads, thereby reducing the system failure rate.

[0048] The claims of this invention will be described in detail below with reference to the accompanying drawings.

[0049] like Figure 1 As shown, Figure 1 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of the present invention.

[0050] In this embodiment of the invention, the terminal can be an electronic device.

[0051] like Figure 1As shown, the terminal may include: a processor 1001, such as a CPU, a memory 1003, and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The memory 1003 may be a high-speed RAM or a stable, non-volatile memory, such as a disk drive. Optionally, the memory 1003 may also be a storage device independent of the aforementioned processor 1001.

[0052] Those skilled in the art will understand that Figure 1 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0053] like Figure 1 As shown, the memory 1003, which serves as a computer storage medium, may include an operating system and a power switching program.

[0054] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the power switching program stored in the memory 1003 and perform the following operations:

[0055] In adapter power supply mode, determine the maximum load corresponding to the current battery charge;

[0056] Obtain the power consumption information of each load in the electronic device at the current moment;

[0057] The target load is determined based on the power consumption information and the maximum load.

[0058] When the adapter power is detected to be cut off, the target load is disconnected from the battery.

[0059] Furthermore, the processor 1001 can call the power switching program stored in the memory 1003 and also perform the following operations:

[0060] Determine the power supply status of the battery;

[0061] When the power supply status is normal, control the target load to establish a connection with the battery.

[0062] Furthermore, the processor 1001 can call the power switching program stored in the memory 1003 and also perform the following operations:

[0063] Obtain the voltage change value associated with the current power level;

[0064] The output voltage that the battery can provide is determined based on the current power supply voltage of the adapter and the voltage change value;

[0065] The maximum load is determined based on the output voltage.

[0066] Furthermore, the processor 1001 can call the power switching program stored in the memory 1003 and also perform the following operations:

[0067] The output voltage of the battery at multiple different charge levels is collected when the electronic device is under full load and switches from adapter power mode to battery power mode.

[0068] Based on the power supply voltage and the output voltage of the adapter, determine the voltage change value corresponding to the amount of electricity;

[0069] Each of the stated electrical quantities and its corresponding voltage change value are associated and stored.

[0070] Furthermore, the processor 1001 can call the power switching program stored in the memory 1003 and also perform the following operations:

[0071] Determine the total power consumption of the electronic device at the current moment based on the power consumption information;

[0072] The target load is determined based on the difference between the maximum load and the sum of the power consumption.

[0073] Furthermore, the processor 1001 can call the power switching program stored in the memory 1003 and also perform the following operations:

[0074] The priority of each load is determined based on its usage frequency, operating status, and / or power consumption information.

[0075] Based on the priority, at least one of the loads is selected as the target load, wherein the total power consumption of the target loads is greater than or equal to the difference.

[0076] Furthermore, the processor 1001 can call the power switching program stored in the memory 1003 and also perform the following operations:

[0077] The loads are sorted according to the priority.

[0078] Calculate the total power consumption of a preset number of loads;

[0079] When the total power consumption is greater than or equal to the difference, the first preset number of loads will be used as the target load;

[0080] When the total power consumption is less than the difference, the value of the preset number is increased, and the step of calculating the total power consumption of the preset number of loads before the calculation is repeated.

[0081] The following explanation, through specific exemplary solutions, clarifies the scope of protection claimed in the claims of this invention, so that those skilled in the art can better understand the scope of protection of the claims. It is understood that the following exemplary solutions do not limit the scope of protection of this invention, but are only used to explain this invention.

[0082] For example, refer to Figure 2 In one embodiment of the power switching method of the present invention, the power switching method includes the following steps:

[0083] Step S10: In adapter power supply mode, determine the maximum load corresponding to the current battery charge.

[0084] In this embodiment, the electronic device can be a smart wearable device, or a device that can be powered by both a battery and an adapter. The system within the electronic device requires power to operate, and the electronic device has two power supply modes: adapter-powered mode and battery-powered mode. That is, both the adapter and the battery can act as power sources to supply power to the electronic device's system, and they can switch between each other. (Refer to...) Figure 4 In adapter-powered mode, electronic devices connect to a socket via an adapter. The adapter converts the socket's power supply to a standard voltage, which can then be used for battery charging and as a system power source to power various loads. In battery-powered mode, the battery in the electronic device can directly serve as the system power source to power various loads. Loads are power-consuming units in an electronic system, and their power consumption varies depending on their operating conditions.

[0085] In adapter mode, power outages or adapter unplugging can cause the adapter power to be cut off at any time, meaning the adapter cannot supply power to the system normally and needs to switch to battery power. If the electronic device simultaneously operates multiple power-consuming loads, the battery power supply cannot provide sufficient voltage to the system instantaneously, causing a significant drop in system power and preventing normal power supply to the loads. This can lead to system failures such as restarts, crashes, and malfunctions. This situation is more likely to occur when the battery is low. Wearable devices with cameras, due to their small battery capacity and high system load, are also more prone to this problem. To ensure normal system operation, the load can be reduced before disconnecting the adapter to lower power consumption. However, it is necessary to precisely disconnect the target load to avoid disconnecting too few loads, which would not reduce the system failure rate.

[0086] When the electronic device is detected to be in adapter power mode, the current battery power can be obtained in real time or at preset intervals, and it can be determined that if the current adapter power is cut off at the current power level, the electronic device will switch from adapter power mode to battery power mode. At the moment of switching, the battery can provide the system's output voltage, and the maximum load that can be carried under the output voltage can be determined.

[0087] Optionally, the voltage change value associated with the current power level is obtained; the output voltage that the battery can provide is determined based on the current adapter's supply voltage and the voltage change value; and the maximum load is determined based on the output voltage.

[0088] When an electronic device switches from adapter-powered mode to battery-powered mode, the battery replaces the adapter to power the system. On one hand, the battery voltage is generally slightly lower than the adapter voltage; on the other hand, the battery voltage cannot be immediately supplied to the system. This results in a momentary drop in the voltage received by the system. The instantaneous voltage supplied to the system varies depending on the battery's charge level, and consequently, the maximum load the system can handle also varies. The solution involves determining the voltage change between the current adapter supply voltage and the battery's current charge level when switching power modes, and the instantaneous output voltage received by the system. Generally, the adapter supply voltage remains unchanged and can be stored as a preset value for easy recall. When calculating the maximum load corresponding to the current charge level, the current adapter supply voltage and voltage change value are used to determine the battery's current output voltage. Based on the output voltage and / or the current battery output current, the maximum load the battery can handle at the current charge level is determined. The specific calculation method for the maximum load can be determined based on the electronic device's circuit layout and the maximum load calculation method.

[0089] Furthermore, when the electronic device is under full load and switches from adapter power supply mode to battery power supply mode, the output voltage of the battery at multiple different charge levels is collected; based on the power supply voltage of the adapter and the output voltage, the voltage change value corresponding to the charge level is determined; and multiple currents and their corresponding voltage change values ​​are associated and stored.

[0090] When switching power supply modes, factors affecting the output voltage received by the system include battery charge level; the lower the battery charge, the smaller the instantaneous output voltage the system can receive. In addition, the power consumption of the load in the system also affects the output voltage; the greater the system's power consumption, the lower the battery's output voltage and the greater the voltage change. Under a given charge level, the voltage change range exists. When the system is fully loaded, i.e., all load units are consuming power and acting as loads, the maximum voltage change value under that charge level will appear. To reduce the possibility of system failure and save time in determining the target load, the output voltage of the battery under various charge levels can be collected in advance when the electronic device is under full load and switches from adapter power supply mode to battery power supply mode. Based on the output voltage of each charge level and the adapter's supply voltage, the voltage change value corresponding to each charge level can be determined, and the association between each charge level and its corresponding voltage change value can be saved. After determining the current battery charge level, the minimum output voltage corresponding to the current charge level can be determined based on the association relationship. The maximum load of the current battery can be calculated using the minimum output voltage, which can further reduce the system failure rate.

[0091] Step S20: Obtain the power consumption information corresponding to each load in the electronic device at the current moment;

[0092] In this embodiment, while determining the maximum load corresponding to the current power level, it is also necessary to obtain the power consumption information of each load in the electronic device at the current moment. The power consumption information includes the power consumption of each load, i.e., current information or power information.

[0093] Optionally, the electronic device includes a battery and multiple load units, and a detection and control module is provided between the battery and each load unit. The detection and control module is used to acquire power consumption information of each load unit and control the connection status between the load unit and the battery.

[0094] Reference Figure 4 The electronic device includes a battery and multiple load units. When the load units are turned on and running, they consume power as loads. The battery establishes a connection with each load unit, and can supply power to the load units based on this connection. A detection and control module is also connected between the battery and each load unit. This module acquires power consumption information from each load unit and is controlled by a programmable logic controller (PLC). Based on PLC instructions, it controls the connection status between the load units and the battery, disconnecting or connecting the connection. The electronic device can also be connected to an adapter. When the electronic device and adapter are connected, the adapter can charge the battery and simultaneously supply power to the load units. The electronic device also includes a fuel gauge connected to the battery, used to measure electrical information such as battery charge, output voltage, and output current.

[0095] Step S30: Determine the target load based on the power consumption information and the maximum load;

[0096] In this embodiment, power consumption information refers to the power consumption required to maintain the normal operation of the load per unit time. At any given moment, the power consumption information of each load remains unchanged. However, if switching to battery power is initiated at this moment, the maximum load that the battery can currently handle is limited. Therefore, power supply to loads exceeding the maximum load needs to be stopped to maintain the stable operation of the entire system. The loads corresponding to the power consumption exceeding the maximum load are designated as target loads. If the maximum load is greater than or equal to the sum of the power consumption of all currently running loads, then no load is designated as a target load. If the maximum load is less than the sum of the power consumption, then some loads need to be designated as target loads. The sum of the power consumption of all loads other than the target loads must be less than or equal to the maximum load.

[0097] Step S40: When the adapter power is detected to be cut off, control the target load to disconnect from the battery.

[0098] In this embodiment, the target load is determined at the current moment. If the system switches from adapter-powered mode to battery-powered mode at the current moment, the battery cannot power the target load. When the adapter power is detected to be cut off within a preset time (i.e., no current input is detected from the adapter or current output is detected from the battery), the battery cannot immediately provide sufficient voltage to the various loads in the system. As a result, only loads other than the target load can be maintained during the preset period, requiring the target load to be disconnected from the battery. A control command can be sent to the detection control module between the battery and the target load. Upon receiving the control command, the detection control module disconnects the power supply connection between the battery and the target load. In this way, the battery can meet the power consumption requirements of the operating load in the electronic device, avoiding system failures that are easily caused by the adapter stopping power supply.

[0099] It should be noted that the preset time should be relatively short, and the target load currently determined can be applied for a short period of time. For example, during the charging process, the battery power level changes continuously, and the corresponding target load also changes. However, the changes in the current power level of the power supply, the corresponding maximum load, and the power consumption information of each load within a short preset time can be ignored.

[0100] Optionally, the power supply status of the battery is determined; when the power supply status is normal, the target load is controlled to establish a connection with the battery.

[0101] When switching from adapter-powered mode to battery-powered mode, due to wiring issues, the voltage supplied by the battery to the system cannot instantly reach the battery's standard supply voltage, causing a momentary drop in the voltage received by the system. However, the voltage supplied by the battery gradually reaches the system, and the voltage received by the system gradually increases to the battery's standard supply voltage, indicating a normal battery power supply state. By detecting the voltage across the battery terminals or the system voltage, when the difference between the voltage and the standard supply voltage is less than a preset value, the current battery power supply state is determined to be normal. When the battery power supply state is normal, the target load is reconnected to the battery, and the battery re-supplys the target load to restart its operation, restoring the electronic device to its adapter-powered operating state.

[0102] In the technical solution disclosed in this embodiment, in adapter power supply mode, the minimum load corresponding to the current battery charge is determined; power consumption information corresponding to each load in the electronic device at the current moment is obtained; a target load is determined based on the power consumption information and the minimum load; when the adapter power is detected to be cut off, the target load is disconnected from the battery. By determining the current minimum battery load and based on the minimum battery load and the power consumption information of each load in the current electronic device, the target load that needs to be disconnected when switching to battery power is determined in advance. This allows for timely disconnection of the target load from the battery when the adapter power is cut off, ensuring that the battery can provide sufficient load to maintain the normal operation of the connected loads when switching to battery power, thus preventing system crashes, restarts, and malfunctions, thereby reducing the system failure rate.

[0103] Optionally, refer to Figure 3 Based on any of the above embodiments, in another embodiment of the power switching method of the present invention, the power switching method further includes:

[0104] Step S31: Determine the total power consumption of the electronic device at the current moment based on the power consumption information;

[0105] Step S32: Determine the target load based on the power consumption of each load, the difference between the maximum load and the sum of the power consumption.

[0106] In this embodiment, the maximum load that the battery can currently handle is limited, requiring the electronic device to operate within its maximum load capacity. That is, the target load, beyond the maximum load corresponding to the current battery level, needs to be determined based on the power consumption information of each load on the electronic device. The current information of each load unit is collected by a detection and control module connected to each load. If current flows through a load unit, it indicates that the load unit is operating as a load. The power consumption of each load unit is calculated based on the current information. Power consumption can be expressed as a power value; correspondingly, the maximum load needs to be expressed as power consumption. The total power consumption of the electronic device at the current moment is determined based on the power consumption information. If the maximum load is less than or equal to the total power consumption, then no load is considered a target load. If the maximum load is greater than the total power consumption, the difference between the total power consumption and the maximum load is obtained by subtracting the maximum load from the total power consumption. A load combination including at least one load is generated based on the power consumption of each load. The sum of the power consumption of this load combination must be greater than or equal to the difference between the total power consumption and the maximum load. Then, all loads in this load combination are target loads, and their power supply connection needs to be cut off when switching to battery power mode.

[0107] Optionally, the priority of each load is determined based on the usage frequency, operating status and / or power consumption information of the load; based on the priority, at least one load is selected as the target load, wherein the sum of the power consumption of the target load is greater than or equal to the difference.

[0108] When determining target loads, priority can be given to loads with low usage frequency, high power consumption, and background operation. If a load has a low usage frequency, it indicates it's not a frequently used unit; temporarily disconnecting its power supply will not affect the normal operation of the electronic system, and vice versa. For example, the main control unit is used more frequently than the camera unit, so the camera unit can be prioritized for shutdown, making it a higher priority target load than the main control unit. Prioritizing the shutdown of high-power-consuming loads reduces the number of target loads, minimizing interference with electronic equipment operation while ensuring the power consumption of the target loads is greater than or equal to the difference. The operating status can also be used to determine whether a load unit is running in the background and the duration of this background operation; prioritizing background loads also reduces interference with electronic equipment operation. Furthermore, a comprehensive score can be calculated for each load based on usage frequency, operating status, and / or power consumption information, and the priority of each load can be determined based on the score.

[0109] Optionally, the loads are sorted according to the priority; the total power consumption of the first preset number of loads is calculated; when the total power consumption is greater than or equal to the difference, the first preset number of loads are taken as the target load; when the total power consumption is less than the difference, the preset number is increased, and the step of calculating the total power consumption of the first preset number of loads is repeated.

[0110] The loads are sorted according to priority, and the first preset number of loads are taken as load combinations. The total power consumption of the first preset number of load combinations is calculated. When the total power consumption of the load combination is greater than or equal to the difference, the first preset number of loads are taken as target loads. When the total power consumption of the load combination is less than the difference, the preset number is increased to update the loads in the load combination. For example, if the preset number is n, it is updated to n+1, and the step of calculating the total power consumption of the first preset number of load combinations is re-executed. This orderly selection of target loads can reduce the number of times the total power consumption of the target load is calculated, thereby improving efficiency.

[0111] In the technical solution disclosed in this embodiment, the total power consumption of the electronic device at the current moment is determined based on the power consumption information; the target load is determined based on the difference between the maximum load and the total power consumption. This allows for targeted determination of the target load using the difference between the maximum load and the total power consumption, improving the speed of target load determination, enabling timely disconnection of the battery from the target load, and further reducing the system failure rate.

[0112] Furthermore, this invention also proposes an electronic device, which includes a memory, a processor, and a power switching program stored in the memory and executable on the processor. When the power switching program is executed by the processor, it implements the steps of the power switching method described in the above embodiments.

[0113] Optionally, refer to Figure 4 The electronic device includes a battery and multiple load units. A detection and control module is provided between the battery and each load unit. The detection and control module is used to acquire the power consumption information of each load unit and control the connection status between the load unit and the battery.

[0114] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing a power switching program, which, when executed by a processor, implements the steps of the power switching method described in the above embodiments.

[0115] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0116] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause an electronic device to execute the methods described in the various embodiments of the present invention.

[0118] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A control method for an electronic device, characterized in that, The method includes: In adapter power supply mode, determine the maximum load corresponding to the current battery charge; Obtain the power consumption information of each load in the electronic device at the current moment; The target load is determined based on the power consumption information and the maximum load. When the adapter power is detected to be cut off, the target load is disconnected from the battery.

2. The control method for an electronic device as described in claim 1, characterized in that, After the step of disconnecting the target load from the battery, the method further includes: Determine the power supply status of the battery; When the power supply status is normal, control the target load to establish a connection with the battery.

3. The control method for an electronic device as described in claim 1, characterized in that, The step of determining the maximum load corresponding to the current battery charge includes: Obtain the voltage change value associated with the current power level; The output voltage that the battery can provide is determined based on the current power supply voltage of the adapter and the voltage change value; The maximum load is determined based on the output voltage.

4. The control method for an electronic device as described in claim 3, characterized in that, Before the step of obtaining the voltage change value associated with the current power level, the method further includes: The output voltage of the battery at multiple different charge levels is collected when the electronic device is under full load and switches from adapter power mode to battery power mode. Based on the power supply voltage and the output voltage of the adapter, determine the voltage change value corresponding to the amount of electricity; Each of the stated electrical quantities and its corresponding voltage change value are associated and stored.

5. The control method for an electronic device as described in claim 1, characterized in that, The step of determining the target load based on the power consumption information and the maximum load includes: Determine the total power consumption of the electronic device at the current moment based on the power consumption information; The target load is determined based on the difference between the maximum load and the sum of the power consumption.

6. The control method for an electronic device as described in claim 5, characterized in that, Before the step of determining the target load based on the difference between the maximum load and the total power consumption, the method further includes: The priority of each load is determined based on its usage frequency, operating status, and / or power consumption information. Based on the priority, at least one of the loads is selected as the target load, wherein the total power consumption of the target loads is greater than or equal to the difference.

7. The control method for an electronic device as described in claim 6, characterized in that, The step of selecting at least one of the loads as the target load based on the priority includes: The loads are sorted according to the priority. Calculate the total power consumption of a preset number of loads; When the total power consumption is greater than or equal to the difference, the first preset number of loads will be used as the target load; When the total power consumption is less than the difference, the value of the preset number is increased, and the step of calculating the total power consumption of the preset number of loads before the calculation is repeated.

8. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a power switching program stored in the memory and executable on the processor, wherein the power switching program, when executed by the processor, implements the steps of the power switching method as described in any one of claims 1 to 7.

9. The electronic device as claimed in claim 8, characterized in that, The electronic device includes a battery and multiple load units. A detection and control module is provided between the battery and each load unit. The detection and control module is used to acquire the power consumption information of each load unit and control the connection status between the load unit and the battery.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a power switching program, which, when executed by a processor, implements the steps of the power switching method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Power supply switching device and method

    CN102832691A

  • Multi-stage power adapter

    CN103412632A